@sapui5/sap.ui.vbm 1.134.0 → 1.135.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 +1 -1
- package/src/sap/ui/vbm/Adapter.js +1 -1
- package/src/sap/ui/vbm/Adapter3D.js +1 -1
- 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 +1 -1
- 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 +2 -2
- package/src/sap/ui/vbm/vector/MapRenderer.js +179 -202
- 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/SAPAutomationManager.js +134 -0
- package/src/sap/ui/vbm/vector/VBITransformer.js +23 -16
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.135.0</version>
|
|
7
7
|
|
|
8
8
|
<documentation>SAP UI library: sap.ui.vbm</documentation>
|
|
9
9
|
|
|
@@ -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.135.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.135.0
|
|
51
51
|
* @extends sap.ui.core.Element
|
|
52
52
|
* @constructor
|
|
53
53
|
* @public
|
|
@@ -22,7 +22,7 @@ sap.ui.define([
|
|
|
22
22
|
*
|
|
23
23
|
* @private
|
|
24
24
|
* @author SAP SE
|
|
25
|
-
* @version 1.
|
|
25
|
+
* @version 1.135.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.135.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.135.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.135.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.135.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.135.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 */ {
|
|
@@ -47,7 +47,7 @@ sap.ui.define([
|
|
|
47
47
|
*
|
|
48
48
|
* @private
|
|
49
49
|
* @author SAP SE
|
|
50
|
-
* @version 1.
|
|
50
|
+
* @version 1.135.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.135.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 */ {
|
|
@@ -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.135.0
|
|
24
24
|
* @public
|
|
25
25
|
*/
|
|
26
26
|
|
|
@@ -45,7 +45,7 @@ sap.ui.define([
|
|
|
45
45
|
"sap.ui.vbm.ClusterBase", "sap.ui.vbm.ClusterTree", "sap.ui.vbm.ClusterGrid", "sap.ui.vbm.ClusterDistance", "sap.ui.vbm.Heatmap",
|
|
46
46
|
"sap.ui.vbm.HeatPoint", "sap.ui.vbm.ClusterContainer", "sap.ui.vbm.Adapter", "sap.ui.vbm.Adapter3D"
|
|
47
47
|
],
|
|
48
|
-
version: "1.
|
|
48
|
+
version: "1.135.0"
|
|
49
49
|
});
|
|
50
50
|
|
|
51
51
|
sap.ui.loader.config({
|
|
@@ -10,11 +10,12 @@ sap.ui.define([
|
|
|
10
10
|
"./RectangularSelection",
|
|
11
11
|
"./LassoSelection",
|
|
12
12
|
"./SAPNavControl",
|
|
13
|
+
"./SAPAutomationManager",
|
|
13
14
|
"sap/ui/core/Lib",
|
|
14
15
|
//"../lib/sapscene",
|
|
15
16
|
"./thirdparty/maplibregl",
|
|
16
17
|
"./VBITransformer"
|
|
17
|
-
], function (vb, visualobjects, actions, VBIRenderer, VectorUtils, MaplibreStyles, PayloadGenerator, RectangularSelection, LassoSelection,SAPMapNavControl, Lib) {
|
|
18
|
+
], function (vb, visualobjects, actions, VBIRenderer, VectorUtils, MaplibreStyles, PayloadGenerator, RectangularSelection, LassoSelection, SAPMapNavControl, SAPAutomationManager, Lib) {
|
|
18
19
|
'use strict';
|
|
19
20
|
visualobjects = {};
|
|
20
21
|
VBI.MapRenderer = {};
|
|
@@ -26,7 +27,6 @@ sap.ui.define([
|
|
|
26
27
|
// let isDrawing = false;
|
|
27
28
|
// let isCtrlPressed = false;
|
|
28
29
|
// let lassoPoints = [];
|
|
29
|
-
var bounds = [];
|
|
30
30
|
let predefinedMarkers = [];
|
|
31
31
|
let allMarkers = [];
|
|
32
32
|
let lineDrag = false;
|
|
@@ -81,9 +81,18 @@ sap.ui.define([
|
|
|
81
81
|
map.touchZoomRotate.enable();
|
|
82
82
|
this.map = map;
|
|
83
83
|
map.on('load', () => {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
84
|
+
|
|
85
|
+
map.getCanvas().style.cursor = 'default';
|
|
86
|
+
map.on('mouseup', function () {
|
|
87
|
+
map.getCanvas().style.cursor = 'default';
|
|
88
|
+
});
|
|
89
|
+
map.getCanvas().addEventListener('mousemove', function () {
|
|
90
|
+
map.getCanvas().style.cursor = 'default';
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
if (VBI.mapFlags.isLegendExists) {
|
|
94
|
+
// Legend control
|
|
95
|
+
VBI.VBITransformer._createLegend(map_container);
|
|
87
96
|
}
|
|
88
97
|
// Custom attribution/copyright control
|
|
89
98
|
map.addControl(new maplibregl.AttributionControl({
|
|
@@ -96,25 +105,25 @@ sap.ui.define([
|
|
|
96
105
|
maxWidth: 80,
|
|
97
106
|
unit: geoJSON[0].scaleType
|
|
98
107
|
})
|
|
99
|
-
if(VBI.mapFlags.scaleVisible){
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
}
|
|
105
|
-
|
|
108
|
+
if (VBI.mapFlags.scaleVisible) {
|
|
109
|
+
// Scale control in mi,km or nm
|
|
110
|
+
map.addControl(scaleControl);
|
|
111
|
+
} else if (!VBI.mapFlags.scaleVisible && map.hasControl(scaleControl)) {
|
|
112
|
+
map.removeControl(scaleControl);
|
|
113
|
+
}
|
|
114
|
+
|
|
106
115
|
// Parsing GeoJSON for each type of object
|
|
107
116
|
map.addSource('geojson-source', {
|
|
108
117
|
'type': 'geojson',
|
|
109
118
|
'data': geoJSON[1]
|
|
110
119
|
});
|
|
111
120
|
|
|
112
|
-
let sapNavControl = new SAPMapNavControl(VBI.mapFlags.moveDisable,VBI.mapFlags.zoomDisable);
|
|
113
|
-
if(VBI.mapFlags.navControlVisible){
|
|
114
|
-
|
|
115
|
-
}else if(!VBI.mapFlags.navControlVisible && map.hasControl(sapNavControl)){
|
|
116
|
-
|
|
117
|
-
}
|
|
121
|
+
let sapNavControl = new SAPMapNavControl(VBI.mapFlags.moveDisable, VBI.mapFlags.zoomDisable);
|
|
122
|
+
if (VBI.mapFlags.navControlVisible) {
|
|
123
|
+
map.addControl(sapNavControl, 'top-left');
|
|
124
|
+
} else if (!VBI.mapFlags.navControlVisible && map.hasControl(sapNavControl)) {
|
|
125
|
+
map.removeControl(sapNavControl);
|
|
126
|
+
}
|
|
118
127
|
|
|
119
128
|
// map.addControl(new SAPMAPLgndControl(), 'top-right');
|
|
120
129
|
// Create a popup, but don't add it to the map yet.
|
|
@@ -123,17 +132,16 @@ sap.ui.define([
|
|
|
123
132
|
closeOnClick: false
|
|
124
133
|
});
|
|
125
134
|
// add markers to map only for Points
|
|
126
|
-
bounds = [];
|
|
127
135
|
const pointFeatures = [];
|
|
128
136
|
geoJSON[1].features.forEach((marker) => {
|
|
129
137
|
let markerCoordinates = marker.geometry.coordinates;
|
|
130
138
|
if (marker.geometry.type === 'Point') {
|
|
131
139
|
// create a DOM element for the marker (parent div)
|
|
132
140
|
const el = VectorUtils.createSpotElement(marker);
|
|
133
|
-
el.id = '__mapspot' + spotid++;
|
|
134
141
|
if (marker.properties.Icon) {
|
|
135
142
|
// Create child element for the SAP icon (icon overlay)
|
|
136
143
|
const child_el = VectorUtils.createIconElement(marker.properties.Icon);
|
|
144
|
+
child_el = '__mapspot' + spotid++;
|
|
137
145
|
// Append the icon inside the marker
|
|
138
146
|
el.appendChild(child_el);
|
|
139
147
|
}
|
|
@@ -141,7 +149,7 @@ sap.ui.define([
|
|
|
141
149
|
let spot = new maplibregl.Marker({
|
|
142
150
|
element: el,
|
|
143
151
|
draggable: true
|
|
144
|
-
|
|
152
|
+
// offset: [0, -25]
|
|
145
153
|
}).setLngLat(marker.geometry.coordinates)
|
|
146
154
|
.on('dragend', onDragEnd)
|
|
147
155
|
.addTo(map);
|
|
@@ -228,6 +236,7 @@ sap.ui.define([
|
|
|
228
236
|
return value * Math.PI / 180;
|
|
229
237
|
}
|
|
230
238
|
function onDragEnd(e) {
|
|
239
|
+
map.getCanvas().style.cursor = 'default';
|
|
231
240
|
let dragItems = [];
|
|
232
241
|
let dropItems = [];
|
|
233
242
|
const key = e.target.customProperties;
|
|
@@ -237,7 +246,7 @@ sap.ui.define([
|
|
|
237
246
|
const features1 = map.queryRenderedFeatures({
|
|
238
247
|
layers: ['geojson-source-point']
|
|
239
248
|
});
|
|
240
|
-
|
|
249
|
+
|
|
241
250
|
features1.forEach((feature, index) => {
|
|
242
251
|
if (feature.properties && typeof feature.properties.Key !== 'undefined') {
|
|
243
252
|
console.log(`Feature ${index} key:`, feature.properties.Key);
|
|
@@ -253,34 +262,27 @@ sap.ui.define([
|
|
|
253
262
|
return false;
|
|
254
263
|
});
|
|
255
264
|
console.log('dragInstance:', dragInstance);
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
console.error('Error parsing JSON:', error);
|
|
268
|
-
}
|
|
269
|
-
if (Array.isArray(parsedDataArray)) {
|
|
270
|
-
parsedDataArray.forEach(data => {
|
|
271
|
-
if (data.name === "DragSource") {
|
|
272
|
-
dragItems.push(data.E.A);
|
|
273
|
-
}
|
|
274
|
-
});
|
|
265
|
+
|
|
266
|
+
if (VBI.VBITransformer && Array.isArray(VBI.VBITransformer.VisualObjs)) {
|
|
267
|
+
const matchingVO = VBI.VBITransformer.VisualObjs.find(
|
|
268
|
+
VO => VO.type === dragInstance.properties.type
|
|
269
|
+
);
|
|
270
|
+
|
|
271
|
+
if (matchingVO && matchingVO.DragSource && matchingVO.DragSource.DragItem) {
|
|
272
|
+
if (Array.isArray(matchingVO.DragSource.DragItem)) {
|
|
273
|
+
dragItems = matchingVO.DragSource.DragItem.map(item => item.type);
|
|
274
|
+
} else {
|
|
275
|
+
dragItems = [matchingVO.DragSource.DragItem.type];
|
|
275
276
|
}
|
|
276
|
-
console.log("Extracted dragItems:", dragItems);
|
|
277
277
|
} else {
|
|
278
|
-
|
|
278
|
+
dragItems = [];
|
|
279
279
|
}
|
|
280
280
|
} else {
|
|
281
|
-
console.
|
|
281
|
+
console.error("VBITransformer.VisualObjs is undefined or not an array.");
|
|
282
282
|
}
|
|
283
283
|
|
|
284
|
+
console.log("Extracted dragItems:", dragItems);
|
|
285
|
+
|
|
284
286
|
var dropInstance = VBI.MapRenderer.findNearestSpot(pos, features1);
|
|
285
287
|
console.log('Nearest Spot:', dropInstance);
|
|
286
288
|
// Haversine formula to calculate the distance between two coordinates in meters
|
|
@@ -295,41 +297,27 @@ sap.ui.define([
|
|
|
295
297
|
features: [dragInstance, dropInstance]
|
|
296
298
|
};
|
|
297
299
|
const dropSpots = featureCollection.features;
|
|
298
|
-
|
|
299
|
-
if (
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
parsedDropData = JSON.parse(dropDataArray);
|
|
311
|
-
console.log('Parsed dropData:', parsedDropData);
|
|
312
|
-
} catch (error) {
|
|
313
|
-
console.error('Error parsing drop JSON:', error);
|
|
314
|
-
}
|
|
315
|
-
if (Array.isArray(parsedDropData)) {
|
|
316
|
-
parsedDropData.forEach(data => {
|
|
317
|
-
if (data.name === "DropTarget") {
|
|
318
|
-
if (Array.isArray(data.E)) {
|
|
319
|
-
data.E.forEach(e => {
|
|
320
|
-
dropItems.push(e.A);
|
|
321
|
-
});
|
|
322
|
-
} else {
|
|
323
|
-
dropItems.push(data.E.A);
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
});
|
|
327
|
-
}
|
|
300
|
+
|
|
301
|
+
if (VBI.VBITransformer && Array.isArray(VBI.VBITransformer.VisualObjs)) {
|
|
302
|
+
const matchingVO = VBI.VBITransformer.VisualObjs.find(
|
|
303
|
+
VO => VO.type === dropInstance.properties.type
|
|
304
|
+
);
|
|
305
|
+
|
|
306
|
+
if (matchingVO && matchingVO.DropTarget && matchingVO.DropTarget.DropItem) {
|
|
307
|
+
if (Array.isArray(matchingVO.DropTarget.DropItem)) {
|
|
308
|
+
dropItems = matchingVO.DropTarget.DropItem.map(item => item.type);
|
|
309
|
+
} else {
|
|
310
|
+
|
|
311
|
+
dropItems = [matchingVO.DropTarget.DropItem.type];
|
|
328
312
|
}
|
|
329
|
-
}
|
|
330
|
-
|
|
313
|
+
} else {
|
|
314
|
+
dropItems = [];
|
|
315
|
+
}
|
|
316
|
+
} else {
|
|
317
|
+
console.error("VBITransformer.VisualObjs is undefined or not an array.");
|
|
331
318
|
}
|
|
332
319
|
|
|
320
|
+
console.log("Extracted dropItems:", dropItems);
|
|
333
321
|
const validDrop = Array.isArray(dragItems) && dragItems.some(item => dropItems.includes(item));
|
|
334
322
|
console.log("dragItems:", dragItems);
|
|
335
323
|
console.log("dropItems:", dropItems);
|
|
@@ -355,6 +343,7 @@ sap.ui.define([
|
|
|
355
343
|
if (lngLat.lng !== 0 && lngLat.lat !== 0) {
|
|
356
344
|
spot.setLngLat(originalpos);
|
|
357
345
|
}
|
|
346
|
+
map.getCanvas().style.cursor = 'default';
|
|
358
347
|
}
|
|
359
348
|
|
|
360
349
|
// Function to return a promise that resolves when the map is clicked
|
|
@@ -381,8 +370,8 @@ sap.ui.define([
|
|
|
381
370
|
if (that.Apressed || that.Rpressed) {
|
|
382
371
|
el.style.cursor = 'crosshair';
|
|
383
372
|
} else {
|
|
384
|
-
|
|
385
|
-
|
|
373
|
+
var tooltip = marker.properties.ToolTip.replace(/\n/g, '<br>');
|
|
374
|
+
popup.setLngLat(marker.geometry.coordinates).setHTML(tooltip).addTo(map);
|
|
386
375
|
}
|
|
387
376
|
}
|
|
388
377
|
|
|
@@ -406,13 +395,10 @@ sap.ui.define([
|
|
|
406
395
|
triggerPayloadSpot(e, 'DETAIL_REQUEST');
|
|
407
396
|
});
|
|
408
397
|
|
|
409
|
-
el.
|
|
410
|
-
e.stopPropagation();
|
|
411
|
-
e.preventDefault();
|
|
398
|
+
el.oncontextmenu = (e) => {
|
|
412
399
|
//Trigger payload
|
|
413
400
|
triggerPayloadSpot(e, 'CONTEXT_MENU_REQUEST');
|
|
414
|
-
}
|
|
415
|
-
|
|
401
|
+
};
|
|
416
402
|
el.addEventListener('mouseleave', () => {
|
|
417
403
|
if (!that.Apressed && !that.Rpressed) {
|
|
418
404
|
map.getCanvas().style.cursor = '';
|
|
@@ -485,44 +471,11 @@ sap.ui.define([
|
|
|
485
471
|
}
|
|
486
472
|
}
|
|
487
473
|
|
|
488
|
-
// Calculate bounds to Zoom
|
|
489
|
-
if (marker.geometry.type == "LineString") {
|
|
490
|
-
markerCoordinates.forEach((line) => {
|
|
491
|
-
let exists = bounds.some(
|
|
492
|
-
(coords) => coords[0] === line[0] && coords[1] === line[1]
|
|
493
|
-
);
|
|
494
|
-
//If it doesn't exist, push the new coordinates
|
|
495
|
-
if (!exists) {
|
|
496
|
-
bounds.push(line);
|
|
497
|
-
}
|
|
498
|
-
});
|
|
499
|
-
} else {
|
|
500
|
-
// Check if the coordinates already exist in predefinedMarkers
|
|
501
|
-
let exists = bounds.some(
|
|
502
|
-
(coords) => coords[0] === markerCoordinates[0] && coords[1] === markerCoordinates[1]
|
|
503
|
-
);
|
|
504
|
-
|
|
505
|
-
// If it doesn't exist, push the new coordinates
|
|
506
|
-
if (!exists) {
|
|
507
|
-
bounds.push(markerCoordinates);
|
|
508
|
-
}
|
|
509
|
-
}
|
|
510
|
-
|
|
511
474
|
});
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
return zoombounds.extend(coord);
|
|
517
|
-
}, new maplibregl.LngLatBounds(bounds[0], bounds[0]));
|
|
518
|
-
if(!initialZoom || +initialZoom === 0){
|
|
519
|
-
map.fitBounds(zoombounds, {
|
|
520
|
-
padding: 150
|
|
521
|
-
});
|
|
522
|
-
}
|
|
523
|
-
}
|
|
524
|
-
//map.setZoom(Number(sceneGeo.initialZoom))
|
|
525
|
-
|
|
475
|
+
if(VBI.mapFlags.automations){
|
|
476
|
+
let automations = new SAPAutomationManager(map, maplibregl.LngLatBounds);
|
|
477
|
+
automations.load(VBI.mapFlags.automations);
|
|
478
|
+
}
|
|
526
479
|
map.addLayer({
|
|
527
480
|
'id': 'geojson-source-point',
|
|
528
481
|
'type': 'circle',
|
|
@@ -650,104 +603,128 @@ sap.ui.define([
|
|
|
650
603
|
function triggerPayloaddnd() {
|
|
651
604
|
PayloadGenerator.objectDrop(action, dropItems);
|
|
652
605
|
}
|
|
606
|
+
|
|
607
|
+
map.on('mousedown', 'geojson-source-route', (e) => {
|
|
608
|
+
dragInstance = map.queryRenderedFeatures(e.point, {
|
|
609
|
+
layers: ['geojson-source-route']
|
|
610
|
+
});
|
|
611
|
+
|
|
612
|
+
if (dragInstance.length > 0) {
|
|
613
|
+
const feature = dragInstance[0];
|
|
614
|
+
const visualObjs = VBI.VBITransformer.VisualObjs;
|
|
615
|
+
const matchingVO = visualObjs.find(VO => VO.type === feature.properties.type);
|
|
616
|
+
|
|
617
|
+
if (matchingVO && matchingVO.DragSource && matchingVO.DragSource.DragItem) {
|
|
618
|
+
dragItems = Array.isArray(matchingVO.DragSource.DragItem)
|
|
619
|
+
? matchingVO.DragSource.DragItem.map(item => item.type)
|
|
620
|
+
: [matchingVO.DragSource.DragItem.type];
|
|
621
|
+
} else {
|
|
622
|
+
dragItems = [];
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
console.log("Extracted Drag Items:", dragItems);
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
if (e.originalEvent.button === 0) {
|
|
629
|
+
e.preventDefault();
|
|
630
|
+
lineDrag = true;
|
|
631
|
+
validDrop = false;
|
|
632
|
+
|
|
633
|
+
map.getCanvas().style.cursor = 'default';
|
|
634
|
+
map.on('mousemove', onMove);
|
|
635
|
+
map.on('mouseup', onUp);
|
|
636
|
+
|
|
637
|
+
|
|
638
|
+
if (!that.Apressed && !that.Rpressed) {
|
|
639
|
+
map.getCanvas().style.cursor = 'pointer';
|
|
640
|
+
}
|
|
641
|
+
if (that.Apressed || that.Rpressed) {
|
|
642
|
+
map.getCanvas().style.cursor = 'crosshair';
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
});
|
|
653
646
|
|
|
654
647
|
function onUp(e) {
|
|
648
|
+
let dropInstance = null;
|
|
655
649
|
var dropRoute = map.queryRenderedFeatures(e.point, {
|
|
656
650
|
layers: ['geojson-source-route']
|
|
657
651
|
});
|
|
658
|
-
if(dropRoute.length != 0){
|
|
659
|
-
var dropInstance = dropRoute[0];
|
|
660
|
-
}
|
|
661
652
|
|
|
662
|
-
if (
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
653
|
+
if (dropRoute.length > 0) {
|
|
654
|
+
dropInstance = dropRoute[0];
|
|
655
|
+
}
|
|
656
|
+
if (!dropInstance && map.getLayer('geojson-source-point')) {
|
|
657
|
+
var features1 = map.queryRenderedFeatures({ layers: ['geojson-source-point'] });
|
|
666
658
|
var pos = e.lngLat;
|
|
667
659
|
dropInstance = VBI.MapRenderer.findNearestSpot(pos, features1);
|
|
668
660
|
}
|
|
669
661
|
|
|
670
|
-
|
|
671
|
-
if (dropInstance != null) {
|
|
672
|
-
// Check if the left mouse button is clicked (button === 0)
|
|
662
|
+
if (dropInstance) {
|
|
673
663
|
if (e.originalEvent.button === 0) {
|
|
674
|
-
|
|
664
|
+
const visualObjs = VBI.VBITransformer.VisualObjs;
|
|
665
|
+
const matchingVO = visualObjs.find(VO => VO.type === dropInstance.properties.type);
|
|
666
|
+
|
|
667
|
+
if (matchingVO && matchingVO.DropTarget && matchingVO.DropTarget.DropItem) {
|
|
668
|
+
dropItems = Array.isArray(matchingVO.DropTarget.DropItem)
|
|
669
|
+
? matchingVO.DropTarget.DropItem.map(item => item.type)
|
|
670
|
+
: [matchingVO.DropTarget.DropItem.type];
|
|
671
|
+
} else {
|
|
672
|
+
dropItems = [];
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
console.log("Extracted Drop Items:", dropItems);
|
|
675
676
|
|
|
676
677
|
validDrop = dragItems.some(item => dropItems.includes(item));
|
|
677
|
-
|
|
678
|
-
// dropItems = undefined;
|
|
678
|
+
|
|
679
679
|
if (validDrop) {
|
|
680
|
-
//Trigger payload
|
|
680
|
+
// Trigger payload for valid drop
|
|
681
681
|
var dragInsId = VBI.VBITransformer.findObject(dragInstance[0].properties.type);
|
|
682
682
|
var dropInsId = VBI.VBITransformer.findObject(dropInstance.properties.type);
|
|
683
683
|
PayloadGenerator.triggerPayloaddnd(dragInsId, dropInsId, dragInstance[0], dropInstance, map_container);
|
|
684
|
-
// }
|
|
685
|
-
// Perform action for valid drop
|
|
686
684
|
console.log('Dropped on valid target');
|
|
687
685
|
} else {
|
|
688
|
-
// Perform action for invalid drop
|
|
689
686
|
console.log('Invalid drop');
|
|
690
687
|
}
|
|
691
688
|
}
|
|
692
689
|
}
|
|
690
|
+
|
|
693
691
|
// Reset cursor and remove event listeners
|
|
694
|
-
map.getCanvas().style.cursor = '';
|
|
692
|
+
map.getCanvas().style.cursor = 'default';
|
|
693
|
+
setTimeout(() => {
|
|
694
|
+
map.getCanvas().style.cursor = 'default';
|
|
695
|
+
}, 100);
|
|
695
696
|
map.off('mousemove', onMove);
|
|
696
|
-
//map.off('touchmove', onMove);
|
|
697
697
|
map.off('mouseup', onUp);
|
|
698
698
|
lineDrag = false;
|
|
699
699
|
validDrop = false;
|
|
700
700
|
}
|
|
701
701
|
|
|
702
|
-
// map.on('mousedown', 'geojson-source-route', (e) => {
|
|
703
|
-
map.on('mousedown', 'geojson-source-route', (e) => {
|
|
704
|
-
dragInstance = map.queryRenderedFeatures(e.point, {
|
|
705
|
-
layers: ['geojson-source-route']
|
|
706
|
-
})
|
|
707
|
-
// Check if the left mouse button is clicked (button === 0)
|
|
708
|
-
if (e.originalEvent.button === 0) {
|
|
709
|
-
dragItems = VBI.VBITransformer.getddvalues(dragInstance[0], "DragSource");
|
|
710
|
-
// Prevent the default map drag behavior.
|
|
711
|
-
e.preventDefault();
|
|
712
|
-
lineDrag = true;
|
|
713
|
-
validDrop = false; 'mouseup', onUp
|
|
714
|
-
// Add move and up event listeners
|
|
715
|
-
map.on('mousemove', onMove);
|
|
716
|
-
map.on('mouseup', onUp);
|
|
717
|
-
// Change the cursor style as a UI indicator
|
|
718
|
-
if (!that.Apressed && !that.Rpressed) {
|
|
719
|
-
map.getCanvas().style.cursor = 'pointer';
|
|
720
|
-
}
|
|
721
|
-
if (that.Apressed || that.Rpressed) {
|
|
722
|
-
map.getCanvas().style.cursor = 'crosshair';
|
|
723
|
-
}
|
|
724
|
-
}
|
|
725
|
-
});
|
|
726
|
-
|
|
727
702
|
function onMove(e) {
|
|
728
703
|
const features = map.queryRenderedFeatures(e.point, {
|
|
729
704
|
layers: ['geojson-source-route']
|
|
730
705
|
});
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
if (
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
706
|
+
|
|
707
|
+
if (features.length > 0) {
|
|
708
|
+
map.getCanvas().style.cursor = 'not-allowed';
|
|
709
|
+
|
|
710
|
+
if (!that.Apressed && !that.Rpressed) {
|
|
711
|
+
if (dragItems) {
|
|
712
|
+
dropItems = VBI.VBITransformer.getddvalues(features[0], "DropTarget");
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
if (dragItems && dropItems) {
|
|
716
|
+
validDrop = VectorUtils.isAccepted(dragItems, dropItems);
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
map.getCanvas().style.cursor = validDrop ? 'copy' : 'not-allowed';
|
|
740
720
|
}
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
// If not over a valid feature, show the "not-allowed" cursor
|
|
745
|
-
map.getCanvas().style.cursor = 'not-allowed';
|
|
721
|
+
else {
|
|
722
|
+
|
|
723
|
+
map.getCanvas().style.cursor = 'default';
|
|
746
724
|
}
|
|
747
725
|
}
|
|
748
726
|
}
|
|
749
|
-
|
|
750
|
-
|
|
727
|
+
|
|
751
728
|
mapCanvas.oncontextmenu = (e) => {
|
|
752
729
|
e.preventDefault();
|
|
753
730
|
// Get the mouse coordinates within the map container
|
|
@@ -756,7 +733,7 @@ sap.ui.define([
|
|
|
756
733
|
const y = e.clientY - rect.top;
|
|
757
734
|
const lngLat = map.unproject([x, y]);
|
|
758
735
|
// Check if the right-click happened on the 'geojson-source-route' layer
|
|
759
|
-
const features = map.queryRenderedFeatures([x, y], {layers: ['geojson-source-route']});
|
|
736
|
+
const features = map.queryRenderedFeatures([x, y], { layers: ['geojson-source-route'] });
|
|
760
737
|
|
|
761
738
|
if (features.length > 0) {
|
|
762
739
|
e.features = features;
|
|
@@ -849,27 +826,27 @@ sap.ui.define([
|
|
|
849
826
|
default:
|
|
850
827
|
}
|
|
851
828
|
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
829
|
+
// VBI.MapRenderer.createPopup = (htmlContent, posArray) => {
|
|
830
|
+
// let lngLat;
|
|
831
|
+
// switch (posArray[0]) {
|
|
832
|
+
// case "Spots":
|
|
833
|
+
// const intervalId = setInterval(() => {
|
|
834
|
+
// const foundSpot = allMarkers.find(spot => spot.customProperties.Key === posArray[1]);
|
|
835
|
+
// if (foundSpot) {
|
|
836
|
+
// clearInterval(intervalId);
|
|
837
|
+
// const lngLat = foundSpot.getLngLat();
|
|
838
|
+
// // Create the popup using lngLat and htmlContent.
|
|
839
|
+
// // For example, if using Mapbox GL:
|
|
840
|
+
// // new mapboxgl.Popup().setLngLat(lngLat).setHTML(htmlContent).addTo(map);
|
|
841
|
+
// console.log("Popup created at", lngLat);
|
|
842
|
+
// } else {
|
|
843
|
+
// console.log("Waiting for marker with key:", posArray[1]);
|
|
844
|
+
// }
|
|
845
|
+
// }, 100); // Check every 100ms until the marker is found
|
|
846
|
+
// break;
|
|
847
|
+
// default:
|
|
848
|
+
// // Handle other cases if needed.
|
|
849
|
+
// }
|
|
873
850
|
if (this.popup) {
|
|
874
851
|
//Remove existing popups
|
|
875
852
|
this.popup.remove();
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
sap.ui.define([
|
|
2
|
+
"sap/ui/core/Lib",
|
|
3
|
+
"./VBITransformer"
|
|
4
|
+
], function (Lib, VBITransformer) {
|
|
5
|
+
"use strict";
|
|
6
|
+
|
|
7
|
+
class SAPAutomationManager {
|
|
8
|
+
constructor(map, LngLatBounds) {
|
|
9
|
+
this.map = map;
|
|
10
|
+
this.LngLatBounds = LngLatBounds;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
/** Loads automation data from JSON */
|
|
15
|
+
load(data) {
|
|
16
|
+
if (!data?.Call) return;
|
|
17
|
+
|
|
18
|
+
const calls = Array.isArray(data.Call) ? data.Call : [data.Call];
|
|
19
|
+
calls.forEach(call => this.addAutomation(call));
|
|
20
|
+
}
|
|
21
|
+
createHandler(callData){
|
|
22
|
+
if (callData.handler === "FLYTOHANDLER") {
|
|
23
|
+
return this.flyToHandler(callData.Param);
|
|
24
|
+
|
|
25
|
+
} else {
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
/** creates handler functions*/
|
|
30
|
+
addAutomation(callData) {
|
|
31
|
+
let automationHandler = this.createHandler(callData);
|
|
32
|
+
if(!automationHandler){
|
|
33
|
+
return ;
|
|
34
|
+
}
|
|
35
|
+
let automation = {
|
|
36
|
+
name: callData.name || "Unnamed",
|
|
37
|
+
handler: callData.handler,
|
|
38
|
+
delay: callData.delay || 1,
|
|
39
|
+
earliest: callData.earliest || 1,
|
|
40
|
+
retryAfterMS: callData.retryAfterMS || 0,
|
|
41
|
+
reattempts: callData.reattempts || -1,
|
|
42
|
+
attempts: 0,
|
|
43
|
+
params: callData.Param,
|
|
44
|
+
start: () => automationHandler.start()
|
|
45
|
+
};
|
|
46
|
+
this.scheduleAutomation(automation);
|
|
47
|
+
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/** Runs automation with delay & retries */
|
|
51
|
+
scheduleAutomation(automation) {
|
|
52
|
+
const now = new Date().getTime();
|
|
53
|
+
const runningTime = now - (this.map.startTime || now);
|
|
54
|
+
let delay = automation.delay;
|
|
55
|
+
|
|
56
|
+
if (runningTime < automation.earliest) {
|
|
57
|
+
delay = Math.max(delay, automation.earliest - runningTime);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
setTimeout(() => this.executeAutomation(automation), delay);
|
|
61
|
+
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/** Executes automation and handles retries */
|
|
65
|
+
executeAutomation(automation) {
|
|
66
|
+
const success = automation.start();
|
|
67
|
+
if (!success && automation.retryAfterMS) {
|
|
68
|
+
automation.attempts++;
|
|
69
|
+
if (automation.reattempts === -1 || automation.attempts < automation.reattempts) {
|
|
70
|
+
setTimeout(() => this.executeAutomation(automation), automation.retryAfterMS);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
/**To calculate bounds for zoom to features */
|
|
75
|
+
calculatebounds() {
|
|
76
|
+
let bounds = [];
|
|
77
|
+
let geoJSON = VBI.VBITransformer.getTransformedJSON();
|
|
78
|
+
geoJSON[1].features.forEach((marker) => {
|
|
79
|
+
let markerCoordinates = marker.geometry.coordinates;
|
|
80
|
+
|
|
81
|
+
if (marker.geometry.type === 'LineString') {
|
|
82
|
+
markerCoordinates.forEach((coord) => {
|
|
83
|
+
if (!bounds.some((b) => b[0] === coord[0] && b[1] === coord[1])) {
|
|
84
|
+
bounds.push(coord);
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
} else {
|
|
88
|
+
if (!bounds.some((b) => b[0] === markerCoordinates[0] && b[1] === markerCoordinates[1])) {
|
|
89
|
+
bounds.push(markerCoordinates);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
let zoombounds;
|
|
94
|
+
if (bounds.length > 0) {
|
|
95
|
+
zoombounds = bounds.reduce((zoombounds, coord) => {
|
|
96
|
+
return zoombounds.extend(coord);
|
|
97
|
+
}, new this.LngLatBounds(bounds[0], bounds[0]));
|
|
98
|
+
|
|
99
|
+
}
|
|
100
|
+
return zoombounds;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/** FLYTOHANDLER*/
|
|
104
|
+
flyToHandler(params) {
|
|
105
|
+
const x = parseFloat(params.find(p => p.name === "x")?.["#"]);
|
|
106
|
+
const y = parseFloat(params.find(p => p.name === "y")?.["#"]);
|
|
107
|
+
const zoom = parseFloat(params.find(p => p.name === "lod")?.["#"]) || 12;
|
|
108
|
+
const speed = parseFloat(params.find(p => p.name === "velocity")?.["#"]) || 1;
|
|
109
|
+
const zoomToAll = params.find(p => p.name === "zoomToAll")?.["#"] || false;
|
|
110
|
+
|
|
111
|
+
if (zoomToAll) {
|
|
112
|
+
let zoombounds = this.calculatebounds();
|
|
113
|
+
//Focus the map into the features
|
|
114
|
+
if (zoombounds) {
|
|
115
|
+
map.fitBounds(zoombounds, {
|
|
116
|
+
padding: 150
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
return true;
|
|
120
|
+
} else if (x !== undefined && y !== undefined) {
|
|
121
|
+
this.map.flyTo({
|
|
122
|
+
center: [x, y],
|
|
123
|
+
zoom: zoom,
|
|
124
|
+
speed: speed,
|
|
125
|
+
essential: true
|
|
126
|
+
});
|
|
127
|
+
return true;
|
|
128
|
+
}
|
|
129
|
+
return false;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
return SAPAutomationManager
|
|
133
|
+
});
|
|
134
|
+
|
|
@@ -91,20 +91,26 @@ sap.ui.define([
|
|
|
91
91
|
VBI.mapFlags.initialZoom = obj.SAPVB.Scenes.Set.SceneGeo.initialZoom;
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
|
-
|
|
95
|
-
VBI.mapFlags.scaleVisible = obj.SAPVB.Scenes.Set.SceneGeo.scaleVisible ? JSON.parse(obj.SAPVB.Scenes.Set.SceneGeo.scaleVisible):true;
|
|
96
|
-
|
|
97
94
|
|
|
98
|
-
VBI.mapFlags.
|
|
99
|
-
|
|
95
|
+
VBI.mapFlags.scaleVisible = obj.SAPVB.Scenes.Set.SceneGeo.scaleVisible ? JSON.parse(obj.SAPVB.Scenes.Set.SceneGeo.scaleVisible) : true;
|
|
100
96
|
|
|
101
|
-
|
|
97
|
+
VBI.mapFlags.navControlVisible = obj.SAPVB.Scenes.Set.SceneGeo.navControlVisible ? JSON.parse(obj.SAPVB.Scenes.Set.SceneGeo.navControlVisible) : true;
|
|
98
|
+
|
|
99
|
+
if (obj.SAPVB.Scenes.Set.SceneGeo.NavigationDisablement) {
|
|
102
100
|
let navigationDisablement = obj.SAPVB.Scenes.Set.SceneGeo.NavigationDisablement;
|
|
103
|
-
VBI.mapFlags.moveDisable = navigationDisablement.move?JSON.parse(navigationDisablement.move):true;
|
|
104
|
-
VBI.mapFlags.zoomDisable = navigationDisablement.zoom?JSON.parse(navigationDisablement.zoom):true;
|
|
105
|
-
|
|
101
|
+
VBI.mapFlags.moveDisable = navigationDisablement.move ? JSON.parse(navigationDisablement.move) : true;
|
|
102
|
+
VBI.mapFlags.zoomDisable = navigationDisablement.zoom ? JSON.parse(navigationDisablement.zoom) : true;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
if (obj.SAPVB && obj.SAPVB.Scenes && obj.SAPVB.Scenes.Set && obj.SAPVB.Scenes.Set.SceneGeo &&
|
|
106
|
+
obj.SAPVB.Scenes.Set.SceneGeo.VO) {
|
|
107
|
+
VBI.VBITransformer = VBI.VBITransformer || {};
|
|
108
|
+
VBI.VBITransformer.VisualObjs = obj.SAPVB.Scenes.Set.SceneGeo.VO || [];
|
|
109
|
+
console.log("VisualObjs initialized:", VBI.VBITransformer.VisualObjs);
|
|
110
|
+
} else {
|
|
111
|
+
console.error("VisualObjs is undefined.");
|
|
112
|
+
}
|
|
106
113
|
|
|
107
|
-
|
|
108
114
|
// Scale Control in Maplibre
|
|
109
115
|
// metric -> m,km
|
|
110
116
|
// imperial -> ft,mi
|
|
@@ -414,8 +420,8 @@ sap.ui.define([
|
|
|
414
420
|
}
|
|
415
421
|
}
|
|
416
422
|
}
|
|
417
|
-
VBI.VBITransformer.findObject = function (itemtype){
|
|
418
|
-
for (let i = 0; i < visualObj.length; i++) {
|
|
423
|
+
VBI.VBITransformer.findObject = function (itemtype) {
|
|
424
|
+
for (let i = 0; i < visualObj.length; i++) {
|
|
419
425
|
if (visualObj[i].type === itemtype) {
|
|
420
426
|
return visualObj[i].id;
|
|
421
427
|
}
|
|
@@ -592,10 +598,10 @@ sap.ui.define([
|
|
|
592
598
|
}
|
|
593
599
|
legend = new VBI.LegendWindow();
|
|
594
600
|
if (Array.isArray(obj.SAPVB.Windows.Set.Window)) {
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
if(oLegend){
|
|
598
|
-
|
|
601
|
+
let oLegend = obj.SAPVB.Windows.Set.Window.find(window => window.id === "LEGEND");
|
|
602
|
+
VBI.mapFlags.isLegendExists = oLegend ? oLegend : false;
|
|
603
|
+
if (oLegend) {
|
|
604
|
+
legend.load(oLegend, this.mVBIContext);
|
|
599
605
|
}
|
|
600
606
|
}
|
|
601
607
|
}
|
|
@@ -809,6 +815,7 @@ sap.ui.define([
|
|
|
809
815
|
|
|
810
816
|
if (obj.SAPVB.Automation && obj.SAPVB.Automation.Call) {
|
|
811
817
|
VBI.VBITransformer._processAutomation(obj.SAPVB.Automation, obj);
|
|
818
|
+
VBI.mapFlags.automations = obj.SAPVB.Automation;
|
|
812
819
|
}
|
|
813
820
|
|
|
814
821
|
if (obj.SAPVB.Menus && Object.keys(obj.SAPVB.Menus).length != 0) {
|