@sapui5/sap.ui.vbm 1.136.0 → 1.138.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/sap/ui/vbm/.library +2 -2
- package/src/sap/ui/vbm/Adapter.js +1 -1
- package/src/sap/ui/vbm/Adapter3D.js +1 -1
- package/src/sap/ui/vbm/ClusterRenderer.js +28 -4
- package/src/sap/ui/vbm/ContainerBase.js +4 -4
- package/src/sap/ui/vbm/MapContainer.js +3 -2
- package/src/sap/ui/vbm/MapContainerButtonType.js +1 -0
- package/src/sap/ui/vbm/Viewport.js +1 -1
- package/src/sap/ui/vbm/adapter3d/ColladaBounds.js +1 -1
- package/src/sap/ui/vbm/adapter3d/DragDropHandler.js +1 -1
- package/src/sap/ui/vbm/adapter3d/ModelHandler.js +1 -1
- package/src/sap/ui/vbm/adapter3d/ObjectFactory.js +1 -1
- package/src/sap/ui/vbm/adapter3d/PolygonHandler.js +1 -1
- package/src/sap/ui/vbm/adapter3d/RectangleTracker.js +19 -11
- package/src/sap/ui/vbm/adapter3d/SceneBuilder.js +1 -1
- package/src/sap/ui/vbm/adapter3d/VBIJSONParser.js +1 -1
- package/src/sap/ui/vbm/library.js +11 -7
- package/src/sap/ui/vbm/vector/MapRenderer.js +39 -6
- package/src/sap/ui/vbm/vector/PayloadGenerator.js +1 -1
- package/src/sap/ui/vbm/vector/RectangularSelection.js +1 -1
- package/src/sap/ui/vbm/vector/VBITransformer.js +14 -3
- package/src/sap/ui/vbm/vector/VectorUtils.js +2 -1
- package/ui5.yaml +1 -1
package/package.json
CHANGED
package/src/sap/ui/vbm/.library
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<name>sap.ui.vbm</name>
|
|
4
4
|
<vendor>SAP SE</vendor>
|
|
5
5
|
<copyright>SAP UI development toolkit for HTML5 (SAPUI5) (c) Copyright 2009-2012 SAP AG. All rights reserved</copyright>
|
|
6
|
-
<version>1.
|
|
6
|
+
<version>1.138.0</version>
|
|
7
7
|
|
|
8
8
|
<documentation>SAP UI library: sap.ui.vbm</documentation>
|
|
9
9
|
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
<libraryName>sap.ui.core</libraryName>
|
|
13
13
|
</dependency>
|
|
14
14
|
<dependency>
|
|
15
|
-
<libraryName>sap.
|
|
15
|
+
<libraryName>sap.m</libraryName>
|
|
16
16
|
<lazy>true</lazy>
|
|
17
17
|
</dependency>
|
|
18
18
|
<dependency>
|
|
@@ -24,7 +24,7 @@ sap.ui.define([
|
|
|
24
24
|
* @param {string} [sId] id for the new control, generated automatically if no id is given
|
|
25
25
|
* @param {object} [mSettings] initial settings for the new object
|
|
26
26
|
* @author SAP SE
|
|
27
|
-
* @version 1.
|
|
27
|
+
* @version 1.138.0
|
|
28
28
|
* @extends sap.ui.core.Element
|
|
29
29
|
* @constructor
|
|
30
30
|
* @public
|
|
@@ -47,7 +47,7 @@ sap.ui.define([
|
|
|
47
47
|
* @param {string} [sId] id for the new control, generated automatically if no id is given
|
|
48
48
|
* @param {object} [mSettings] initial settings for the new object
|
|
49
49
|
* @author SAP SE
|
|
50
|
-
* @version 1.
|
|
50
|
+
* @version 1.138.0
|
|
51
51
|
* @extends sap.ui.core.Element
|
|
52
52
|
* @constructor
|
|
53
53
|
* @public
|
|
@@ -86,7 +86,13 @@ sap.ui.define([
|
|
|
86
86
|
var ariaRoleDescription = sap.ui.core.AccessibleRole.Description;
|
|
87
87
|
|
|
88
88
|
oRm.openStart("div", Id1);
|
|
89
|
-
|
|
89
|
+
if (typeof classOuter === "string") {
|
|
90
|
+
var cOuter = classOuter.split(" ");
|
|
91
|
+
|
|
92
|
+
for (var iCOuter = 0; iCOuter < cOuter.length; iCOuter++) {
|
|
93
|
+
oRm.class(cOuter[iCOuter]);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
90
96
|
|
|
91
97
|
if (type == sap.ui.vbm.SemanticType.None && col) {
|
|
92
98
|
oRm.style("border-color", col)
|
|
@@ -95,7 +101,13 @@ sap.ui.define([
|
|
|
95
101
|
oRm.openEnd();
|
|
96
102
|
|
|
97
103
|
oRm.openStart("div", Id2);
|
|
98
|
-
|
|
104
|
+
if (typeof classInner === "string") {
|
|
105
|
+
var cInner = classInner.split(" ");
|
|
106
|
+
|
|
107
|
+
for (var iCInner = 0; iCInner < cInner.length; iCInner++) {
|
|
108
|
+
oRm.class(cInner[iCInner]);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
99
111
|
if (type == sap.ui.vbm.SemanticType.None && col) {
|
|
100
112
|
oRm.style("border-color", col)
|
|
101
113
|
}
|
|
@@ -108,7 +120,13 @@ sap.ui.define([
|
|
|
108
120
|
if (icon) {
|
|
109
121
|
var IdIcon = oControl.getId() + "-" + "icon";
|
|
110
122
|
oRm.openStart("span", IdIcon);
|
|
111
|
-
|
|
123
|
+
if (typeof classIcon === "string") {
|
|
124
|
+
var cIcon = classIcon.split(" ");
|
|
125
|
+
|
|
126
|
+
for (var iCIcon = 0; iCIcon < cIcon.length; iCIcon++) {
|
|
127
|
+
oRm.class(cIcon[iCIcon]);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
112
130
|
if (type == sap.ui.vbm.SemanticType.None && col) {
|
|
113
131
|
oRm.style("color", col)
|
|
114
132
|
}
|
|
@@ -122,7 +140,13 @@ sap.ui.define([
|
|
|
122
140
|
if ((oControl.getText())) {
|
|
123
141
|
var IdTextbox = oControl.getId() + "-" + "textbox";
|
|
124
142
|
oRm.openStart("div", IdTextbox);
|
|
125
|
-
|
|
143
|
+
if (typeof classTextbox === "string") {
|
|
144
|
+
var cTextBox = classTextbox.split(" ");
|
|
145
|
+
|
|
146
|
+
for (var iCTBox = 0; iCTBox < cTextBox.length; iCTBox++) {
|
|
147
|
+
oRm.class(cTextBox[iCTBox]);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
126
150
|
if (type == sap.ui.vbm.SemanticType.None && col) {
|
|
127
151
|
oRm.style("border-color", col);
|
|
128
152
|
}
|
|
@@ -299,7 +299,7 @@ sap.ui.define([
|
|
|
299
299
|
// segmentedButton for for multiple content entries
|
|
300
300
|
this._oContentSegmentedButton = new SegmentedButton({
|
|
301
301
|
layoutData: oLayoutData.clone(),
|
|
302
|
-
|
|
302
|
+
selectionChange: this._onContentButtonSelect.bind(this)
|
|
303
303
|
});
|
|
304
304
|
|
|
305
305
|
// Left side...
|
|
@@ -628,12 +628,12 @@ sap.ui.define([
|
|
|
628
628
|
ContainerBase.prototype._contentChange = function() {
|
|
629
629
|
var aContent = this.getContent();
|
|
630
630
|
// remove and destroy all buttons for old content
|
|
631
|
-
this._oContentSegmentedButton.
|
|
631
|
+
this._oContentSegmentedButton.removeAllItems();
|
|
632
632
|
this._destroyButtons(this._aContentIcons);
|
|
633
633
|
|
|
634
634
|
this._aContentIcons = [];
|
|
635
635
|
if (aContent.length === 0) {
|
|
636
|
-
this._oContentSegmentedButton.
|
|
636
|
+
this._oContentSegmentedButton.removeAllItems();
|
|
637
637
|
this._setDefaultOnSegmentedButton();
|
|
638
638
|
this.switchContent(null);
|
|
639
639
|
}
|
|
@@ -660,7 +660,7 @@ sap.ui.define([
|
|
|
660
660
|
};
|
|
661
661
|
|
|
662
662
|
ContainerBase.prototype._onContentButtonSelect = function(oEvent) {
|
|
663
|
-
var sContentId = oEvent.getParameter("
|
|
663
|
+
var sContentId = oEvent.getParameter("item").getKey();
|
|
664
664
|
this._switchContent(sContentId);
|
|
665
665
|
};
|
|
666
666
|
|
|
@@ -86,7 +86,7 @@ sap.ui.define([
|
|
|
86
86
|
* List Panel aggregation
|
|
87
87
|
*/
|
|
88
88
|
"listPanelStack": {
|
|
89
|
-
type: "sap.ui.
|
|
89
|
+
type: "sap.ui.vbm.ListPanelStack",
|
|
90
90
|
multiple: false
|
|
91
91
|
},
|
|
92
92
|
/**
|
|
@@ -267,7 +267,8 @@ sap.ui.define([
|
|
|
267
267
|
this._box = new sap.m.HBox().addStyleClass("mapContainerHboxPopover");
|
|
268
268
|
|
|
269
269
|
this._popover = new sap.m.Popover({
|
|
270
|
-
|
|
270
|
+
horizontalScrolling: false,
|
|
271
|
+
verticalScrolling: false,
|
|
271
272
|
placement: sap.m.PlacementType.Horizontal,
|
|
272
273
|
content: this._box,
|
|
273
274
|
showHeader: false
|
|
@@ -22,7 +22,7 @@ sap.ui.define([
|
|
|
22
22
|
*
|
|
23
23
|
* @private
|
|
24
24
|
* @author SAP SE
|
|
25
|
-
* @version 1.
|
|
25
|
+
* @version 1.138.0
|
|
26
26
|
* @alias sap.ui.vbm.adapter3d.ColladaBounds
|
|
27
27
|
*/
|
|
28
28
|
var ColladaBounds = BaseObject.extend("sap.ui.vbm.adapter3d.ColladaBounds", /** @lends sap.ui.vbm.adapter3d.ColladaBounds.prototype */ {
|
|
@@ -83,7 +83,7 @@ sap.ui.define([
|
|
|
83
83
|
*
|
|
84
84
|
* @private
|
|
85
85
|
* @author SAP SE
|
|
86
|
-
* @version 1.
|
|
86
|
+
* @version 1.138.0
|
|
87
87
|
* @alias sap.ui.vbm.adapter3d.DragDropHandler
|
|
88
88
|
*/
|
|
89
89
|
var DragDropHandler = BaseObject.extend("sap.ui.vbm.adapter3d.DragDropHandler", /** @lends sap.ui.vbm.adapter3d.DragDropHandler.prototype */ {
|
|
@@ -29,7 +29,7 @@ sap.ui.define([
|
|
|
29
29
|
*
|
|
30
30
|
* @private
|
|
31
31
|
* @author SAP SE
|
|
32
|
-
* @version 1.
|
|
32
|
+
* @version 1.138.0
|
|
33
33
|
* @alias sap.ui.vbm.adapter3d.ModelHandler
|
|
34
34
|
*/
|
|
35
35
|
var ModelHandler = BaseObject.extend("sap.ui.vbm.adapter3d.ModelHandler", /** @lends sap.ui.vbm.adapter3d.ModelHandler.prototype */ {
|
|
@@ -377,7 +377,7 @@ sap.ui.define([
|
|
|
377
377
|
*
|
|
378
378
|
* @private
|
|
379
379
|
* @author SAP SE
|
|
380
|
-
* @version 1.
|
|
380
|
+
* @version 1.138.0
|
|
381
381
|
* @alias sap.ui.vbm.adapter3d.ObjectFactory
|
|
382
382
|
*/
|
|
383
383
|
var ObjectFactory = BaseObject.extend("sap.ui.vbm.adapter3d.ObjectFactory", /** @lends sap.ui.vbm.adapter3d.ObjectFactory.prototype */ {});
|
|
@@ -32,7 +32,7 @@ sap.ui.define([
|
|
|
32
32
|
*
|
|
33
33
|
* @private
|
|
34
34
|
* @author SAP SE
|
|
35
|
-
* @version 1.
|
|
35
|
+
* @version 1.138.0
|
|
36
36
|
* @alias sap.ui.vbm.adapter3d.PolygonHandler
|
|
37
37
|
*/
|
|
38
38
|
var PolygonHandler = BaseObject.extend("sap.ui.vbm.adapter3d.PolygonHandler", /** @lends sap.ui.vbm.adapter3d.PolygonHandler.prototype */ {
|
|
@@ -39,7 +39,7 @@ sap.ui.define([
|
|
|
39
39
|
*
|
|
40
40
|
* @private
|
|
41
41
|
* @author SAP SE
|
|
42
|
-
* @version 1.
|
|
42
|
+
* @version 1.138.0
|
|
43
43
|
* @alias sap.ui.vbm.adapter3d.RectangleTracker
|
|
44
44
|
*/
|
|
45
45
|
var RectangleTracker = BaseObject.extend("sap.ui.vbm.adapter3d.RectangleTracker", /** @lends sap.ui.vbm.adapter3d.RectangleTracker.prototype */ {
|
|
@@ -114,7 +114,7 @@ sap.ui.define([
|
|
|
114
114
|
var ref = this._viewport.getDomRef();
|
|
115
115
|
if (ref) {
|
|
116
116
|
this._dom = ref;
|
|
117
|
-
this._addListener(ref, "pointerup", this.
|
|
117
|
+
this._addListener(ref, "pointerup", this._onPointerUp);
|
|
118
118
|
this._addListener(ref, "pointerdown", this._onPointerDown);
|
|
119
119
|
this._addListener(ref, "pointermove", this._onPointerMove);
|
|
120
120
|
this._addListener(ref, "pointerleave", this._onPointerCancel);
|
|
@@ -228,15 +228,20 @@ sap.ui.define([
|
|
|
228
228
|
|
|
229
229
|
RectangleTracker.prototype._onPointerMove = function (event) {
|
|
230
230
|
event.preventDefault();
|
|
231
|
-
|
|
232
|
-
if (!this._mouseDown) {
|
|
233
|
-
this._updatePointer(event, _pointer);
|
|
234
|
-
this._handleHover(_pointer);
|
|
235
|
-
}
|
|
236
|
-
|
|
231
|
+
//this._updateController(false);
|
|
237
232
|
if (this._mouseDown) {
|
|
238
|
-
this.
|
|
233
|
+
this._cameraControls.enableRotate = false;
|
|
239
234
|
this.onSelectMove(event);
|
|
235
|
+
this._updatePointer(event, _pointer);
|
|
236
|
+
this._handleHover(_pointer);
|
|
237
|
+
}
|
|
238
|
+
// else if (!this._mouseDown) {
|
|
239
|
+
// this._cameraControls.enableRotate = false;
|
|
240
|
+
// }
|
|
241
|
+
}
|
|
242
|
+
RectangleTracker.prototype._onPointerUp = function (event) {
|
|
243
|
+
this._updateController(true);
|
|
244
|
+
if (!this._mouseDown) {
|
|
240
245
|
var that = this;
|
|
241
246
|
event.cursor = event.cursor || this._getXY(event);
|
|
242
247
|
var rect = this._viewport.getDomRef().getBoundingClientRect();
|
|
@@ -311,7 +316,7 @@ sap.ui.define([
|
|
|
311
316
|
E: [obj]
|
|
312
317
|
}]);
|
|
313
318
|
}
|
|
314
|
-
|
|
319
|
+
|
|
315
320
|
}
|
|
316
321
|
});
|
|
317
322
|
|
|
@@ -324,7 +329,10 @@ sap.ui.define([
|
|
|
324
329
|
});
|
|
325
330
|
}
|
|
326
331
|
}
|
|
327
|
-
|
|
332
|
+
this._mouseDown = false;
|
|
333
|
+
this._dom.style.cursor = this._hovered ? "pointer" : "auto";
|
|
334
|
+
this._updateController(true);
|
|
335
|
+
this.onSelectOver();
|
|
328
336
|
};
|
|
329
337
|
|
|
330
338
|
RectangleTracker.prototype._constructPayload = function (dataMap) {
|
|
@@ -47,7 +47,7 @@ sap.ui.define([
|
|
|
47
47
|
*
|
|
48
48
|
* @private
|
|
49
49
|
* @author SAP SE
|
|
50
|
-
* @version 1.
|
|
50
|
+
* @version 1.138.0
|
|
51
51
|
* @alias sap.ui.vbm.adapter3d.SceneBuilder
|
|
52
52
|
*/
|
|
53
53
|
var SceneBuilder = BaseObject.extend("sap.ui.vbm.adapter3d.SceneBuilder", /** @lends sap.ui.vbm.adapter3d.SceneBuilder.prototype */ {
|
|
@@ -56,7 +56,7 @@ sap.ui.define([
|
|
|
56
56
|
*
|
|
57
57
|
* @private
|
|
58
58
|
* @author SAP SE
|
|
59
|
-
* @version 1.
|
|
59
|
+
* @version 1.138.0
|
|
60
60
|
* @alias sap.ui.vbm.adapter3d.VBIJSONParser
|
|
61
61
|
*/
|
|
62
62
|
var VBIJSONParser = BaseObject.extend("sap.ui.vbm.adapter3d.VBIJSONParser", /** @lends sap.ui.vbm.adapter3d.VBIJSONParser.prototype */ {
|
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
* Initialization Code and shared classes of library sap.ui.vbm.
|
|
7
7
|
*/
|
|
8
8
|
sap.ui.define([
|
|
9
|
-
"sap/ui/
|
|
9
|
+
"sap/ui/base/DataType",
|
|
10
|
+
"sap/ui/core/Lib",
|
|
10
11
|
"sap/m/library",
|
|
11
12
|
"sap/ui/core/library",
|
|
12
|
-
"sap/ui/unified/library"
|
|
13
|
-
|
|
14
|
-
], function(Core,mlibrary,clibrary,ulibrary,Lib) {
|
|
13
|
+
"sap/ui/unified/library"
|
|
14
|
+
], function(DataType,Lib,_mlibrary,_clibrary,_ulibrary) {
|
|
15
15
|
"use strict";
|
|
16
16
|
|
|
17
17
|
/**
|
|
@@ -20,7 +20,7 @@ sap.ui.define([
|
|
|
20
20
|
* @namespace
|
|
21
21
|
* @alias sap.ui.vbm
|
|
22
22
|
* @author SAP SE
|
|
23
|
-
* @version 1.
|
|
23
|
+
* @version 1.138.0
|
|
24
24
|
* @public
|
|
25
25
|
*/
|
|
26
26
|
|
|
@@ -29,8 +29,9 @@ sap.ui.define([
|
|
|
29
29
|
|
|
30
30
|
var vbmLibrary = Lib.init({
|
|
31
31
|
name: "sap.ui.vbm",
|
|
32
|
+
apiVersion: 2,
|
|
32
33
|
types: [
|
|
33
|
-
"sap.ui.vbm.ClusterInfoType", "sap.ui.vbm.SemanticType"
|
|
34
|
+
"sap.ui.vbm.ClusterInfoType", "sap.ui.vbm.SemanticType", "sap.ui.vbm.RouteType"
|
|
34
35
|
],
|
|
35
36
|
controls: [
|
|
36
37
|
"sap.ui.vbm.AnalyticMap", "sap.ui.vbm.GeoMap", "sap.ui.vbm.VBI", "sap.ui.vbm.Cluster", "sap.ui.vbm.Viewport","sap.ui.vbm.ContainerLegendItem",
|
|
@@ -45,7 +46,7 @@ sap.ui.define([
|
|
|
45
46
|
"sap.ui.vbm.ClusterBase", "sap.ui.vbm.ClusterTree", "sap.ui.vbm.ClusterGrid", "sap.ui.vbm.ClusterDistance", "sap.ui.vbm.Heatmap",
|
|
46
47
|
"sap.ui.vbm.HeatPoint", "sap.ui.vbm.ClusterContainer", "sap.ui.vbm.Adapter", "sap.ui.vbm.Adapter3D"
|
|
47
48
|
],
|
|
48
|
-
version: "1.
|
|
49
|
+
version: "1.138.0"
|
|
49
50
|
});
|
|
50
51
|
|
|
51
52
|
sap.ui.loader.config({
|
|
@@ -132,6 +133,7 @@ sap.ui.define([
|
|
|
132
133
|
Hidden: "Hidden"
|
|
133
134
|
|
|
134
135
|
};
|
|
136
|
+
DataType.registerEnum("sap.ui.vbm.SemanticType", vbmLibrary.SemanticType);
|
|
135
137
|
|
|
136
138
|
/**
|
|
137
139
|
* Cluster Info Type
|
|
@@ -179,6 +181,7 @@ sap.ui.define([
|
|
|
179
181
|
Edges: 11
|
|
180
182
|
|
|
181
183
|
};
|
|
184
|
+
// As of 2025-05-23, this enum is not used in managed properties and therefore not registered
|
|
182
185
|
|
|
183
186
|
/**
|
|
184
187
|
* Route type, determining how line between start and endpoint should be drawn.
|
|
@@ -204,6 +207,7 @@ sap.ui.define([
|
|
|
204
207
|
Geodesic: "Geodesic"
|
|
205
208
|
|
|
206
209
|
};
|
|
210
|
+
DataType.registerEnum("sap.ui.vbm.RouteType", vbmLibrary.RouteType);
|
|
207
211
|
|
|
208
212
|
vbmLibrary.getResourceBundle = function() {
|
|
209
213
|
var oResourceBundle = Lib.getResourceBundleFor("sap.ui.vbm")
|
|
@@ -38,6 +38,8 @@ sap.ui.define([
|
|
|
38
38
|
let spotid = 0;
|
|
39
39
|
let fixedBounds;
|
|
40
40
|
var containerID;
|
|
41
|
+
let previousCenter = null;
|
|
42
|
+
let previousZoom = null;
|
|
41
43
|
|
|
42
44
|
|
|
43
45
|
|
|
@@ -57,6 +59,12 @@ sap.ui.define([
|
|
|
57
59
|
}
|
|
58
60
|
|
|
59
61
|
VBI.MapRenderer.renderMap = () => {
|
|
62
|
+
|
|
63
|
+
if (this.map) {
|
|
64
|
+
previousCenter = this.map.getCenter();
|
|
65
|
+
previousZoom = this.map.getZoom();
|
|
66
|
+
this.map.remove();
|
|
67
|
+
}
|
|
60
68
|
|
|
61
69
|
let geoJSON = VBI.VBITransformer.getTransformedJSON();
|
|
62
70
|
|
|
@@ -68,10 +76,23 @@ sap.ui.define([
|
|
|
68
76
|
document.head.appendChild(styleSheet);
|
|
69
77
|
|
|
70
78
|
const map = VectorUtils.createMap(geoJSON, map_container);
|
|
79
|
+
|
|
80
|
+
if (previousCenter && previousZoom !== null) {
|
|
81
|
+
map.jumpTo({
|
|
82
|
+
center: [previousCenter.lng, previousCenter.lat],
|
|
83
|
+
zoom: previousZoom
|
|
84
|
+
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
|
|
71
88
|
const canvas = map.getCanvasContainer();
|
|
72
89
|
const rectangularSelection = new RectangularSelection(map);
|
|
73
90
|
const lassoSelection = new LassoSelection(map);
|
|
74
91
|
const mapCanvas = map.getCanvas();
|
|
92
|
+
const popupLink = new maplibregl.Popup({
|
|
93
|
+
closeButton: false,
|
|
94
|
+
closeOnClick: false
|
|
95
|
+
});
|
|
75
96
|
mapCanvas.id = VectorUtils._setcanvasid();
|
|
76
97
|
// Set `true` to dispatch the event before other functions
|
|
77
98
|
// call it. This is necessary for disabling the default map
|
|
@@ -129,7 +150,11 @@ sap.ui.define([
|
|
|
129
150
|
// Create a popup, but don't add it to the map yet.
|
|
130
151
|
const popup = new maplibregl.Popup({
|
|
131
152
|
closeButton: false,
|
|
132
|
-
closeOnClick: false
|
|
153
|
+
closeOnClick: false,
|
|
154
|
+
offset: {
|
|
155
|
+
'top': [0, 0],
|
|
156
|
+
'bottom': [0, -25]
|
|
157
|
+
}
|
|
133
158
|
});
|
|
134
159
|
// add markers to map only for Points
|
|
135
160
|
const pointFeatures = [];
|
|
@@ -139,8 +164,9 @@ sap.ui.define([
|
|
|
139
164
|
// create a DOM element for the marker (parent div)
|
|
140
165
|
const el = VectorUtils.createSpotElement(marker);
|
|
141
166
|
if (marker.properties.Icon) {
|
|
167
|
+
const iconColor = marker.properties.contentColor? marker.properties.contentColor : "#000000";
|
|
142
168
|
// Create child element for the SAP icon (icon overlay)
|
|
143
|
-
const child_el = VectorUtils.createIconElement(marker.properties.Icon);
|
|
169
|
+
const child_el = VectorUtils.createIconElement(marker.properties.Icon, iconColor);
|
|
144
170
|
child_el.id = '__mapspot' + spotid++;
|
|
145
171
|
// Append the icon inside the marker
|
|
146
172
|
el.appendChild(child_el);
|
|
@@ -148,8 +174,8 @@ sap.ui.define([
|
|
|
148
174
|
// add marker to map
|
|
149
175
|
let spot = new maplibregl.Marker({
|
|
150
176
|
element: el,
|
|
151
|
-
draggable: true
|
|
152
|
-
|
|
177
|
+
draggable: true,
|
|
178
|
+
offset: [0, -20]
|
|
153
179
|
}).setLngLat(marker.geometry.coordinates)
|
|
154
180
|
.on('dragend', onDragEnd)
|
|
155
181
|
.addTo(map);
|
|
@@ -370,7 +396,8 @@ sap.ui.define([
|
|
|
370
396
|
if (that.Apressed || that.Rpressed) {
|
|
371
397
|
el.style.cursor = 'crosshair';
|
|
372
398
|
} else {
|
|
373
|
-
|
|
399
|
+
const tooltipContent = marker.properties.ToolTip.replace(/\n/g, '<br>');
|
|
400
|
+
const tooltip = `<div style="background-color: white; color: black;">${tooltipContent}</div>`;
|
|
374
401
|
popup.setLngLat(marker.geometry.coordinates).setHTML(tooltip).addTo(map);
|
|
375
402
|
}
|
|
376
403
|
}
|
|
@@ -566,10 +593,15 @@ sap.ui.define([
|
|
|
566
593
|
|
|
567
594
|
});
|
|
568
595
|
// Change mouse cursor when hovering over the line
|
|
569
|
-
map.on('mouseenter', 'geojson-source-route', function () {
|
|
596
|
+
map.on('mouseenter', 'geojson-source-route', function (event) {
|
|
570
597
|
if (!that.Apressed && !that.Rpressed) {
|
|
571
598
|
map.getCanvas().style.cursor = 'pointer';
|
|
572
599
|
}
|
|
600
|
+
const coordinates = event.lngLat;
|
|
601
|
+
const description = event.features[0].properties.ToolTip;
|
|
602
|
+
const tooltipContent = description.replace(/\n/g, '<br>');
|
|
603
|
+
const tooltip = `<div style="background-color: white; color: black;">${tooltipContent}</div>`;
|
|
604
|
+
popupLink.setLngLat(coordinates).setHTML(tooltip).addTo(map);
|
|
573
605
|
});
|
|
574
606
|
|
|
575
607
|
// Revert mouse cursor back when not hovering
|
|
@@ -577,6 +609,7 @@ sap.ui.define([
|
|
|
577
609
|
if (!that.Apressed && !that.Rpressed) {
|
|
578
610
|
map.getCanvas().style.cursor = '';
|
|
579
611
|
}
|
|
612
|
+
popupLink.remove();
|
|
580
613
|
});
|
|
581
614
|
map.on('click', 'geojson-source-route', function (e) {
|
|
582
615
|
//Trigger payload
|
|
@@ -362,8 +362,13 @@ sap.ui.define([
|
|
|
362
362
|
// "id" : currRoute['VB:ix'],
|
|
363
363
|
"id": route_id++,
|
|
364
364
|
};
|
|
365
|
-
|
|
366
|
-
|
|
365
|
+
let indexNum = featureCollection.findIndex(item => item.properties.Key === route_data.properties.Key)
|
|
366
|
+
if (indexNum !== -1) {
|
|
367
|
+
featureCollection[indexNum] = route_data
|
|
368
|
+
}
|
|
369
|
+
else {
|
|
370
|
+
featureCollection.push(route_data);
|
|
371
|
+
}
|
|
367
372
|
}
|
|
368
373
|
}
|
|
369
374
|
} else {
|
|
@@ -416,7 +421,13 @@ sap.ui.define([
|
|
|
416
421
|
// "id" : currRoute['VB:ix'],
|
|
417
422
|
"id": route_id++,
|
|
418
423
|
};
|
|
419
|
-
featureCollection.
|
|
424
|
+
let indexNum = featureCollection.findIndex(item => item.properties.Key === route_data.properties.Key)
|
|
425
|
+
if (indexNum !== -1) {
|
|
426
|
+
featureCollection[indexNum] = route_data
|
|
427
|
+
}
|
|
428
|
+
else {
|
|
429
|
+
featureCollection.push(route_data);
|
|
430
|
+
}
|
|
420
431
|
}
|
|
421
432
|
}
|
|
422
433
|
}
|
|
@@ -50,7 +50,7 @@ sap.ui.define([
|
|
|
50
50
|
var validDrop = drag.some(item => drop.includes(item));
|
|
51
51
|
return validDrop;
|
|
52
52
|
};
|
|
53
|
-
VectorUtils.createIconElement = (Icon) => {
|
|
53
|
+
VectorUtils.createIconElement = (Icon, iconColor) => {
|
|
54
54
|
const child_el = document.createElement('div');
|
|
55
55
|
child_el.className = 'marker';
|
|
56
56
|
child_el.style.position = 'absolute'; // Position it absolutely inside the parent
|
|
@@ -59,6 +59,7 @@ sap.ui.define([
|
|
|
59
59
|
child_el.style.transform = 'translate(-50%, -50%)'; // Center the icon
|
|
60
60
|
child_el.style.fontFamily = 'SAP-icons';
|
|
61
61
|
child_el.style.fontSize = '20px'; // Adjust size as needed
|
|
62
|
+
child_el.style.color = iconColor;
|
|
62
63
|
var iconInfo = sap.ui.core.IconPool.getIconInfo(Icon);
|
|
63
64
|
child_el.innerHTML = iconInfo.content;
|
|
64
65
|
return child_el;
|