@sapui5/sap.ui.vbm 1.130.0 → 1.131.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sapui5/sap.ui.vbm",
3
- "version": "1.130.0",
3
+ "version": "1.131.0",
4
4
  "description": "SAPUI5 Library sap.ui.vbm",
5
5
  "homepage": "https://sap.github.io/ui5-tooling/pages/SAPUI5/",
6
6
  "author": "SAP SE (https://www.sap.com)",
@@ -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.130.0</version>
6
+ <version>1.131.0</version>
7
7
 
8
8
  <documentation>SAP UI library: sap.ui.vbm</documentation>
9
9
 
@@ -7,7 +7,9 @@ sap.ui.define([
7
7
  "sap/ui/core/Element",
8
8
  "jquery.sap.global",
9
9
  "sap/base/Log",
10
- "./library"
10
+ "./library",
11
+ "./vector/VBITransformer",
12
+ "./vector/MapRenderer",
11
13
  ], function(Element, jQuery, Log, library) {
12
14
  "use strict";
13
15
 
@@ -22,7 +24,7 @@ sap.ui.define([
22
24
  * @param {string} [sId] id for the new control, generated automatically if no id is given
23
25
  * @param {object} [mSettings] initial settings for the new object
24
26
  * @author SAP SE
25
- * @version 1.130.0
27
+ * @version 1.131.0
26
28
  * @extends sap.ui.core.Element
27
29
  * @constructor
28
30
  * @public
@@ -251,6 +253,47 @@ sap.ui.define([
251
253
  return this;
252
254
  };
253
255
 
256
+
257
+ /**
258
+ * Processes the MapProviders section of the VBI JSON
259
+ *
260
+ * @param {object} MapProviders and Scenes section of VBI JSON. <br/>
261
+ * @returns {bool} True if map type is vector, false otherwise
262
+ * @private
263
+ */
264
+
265
+ Adapter.prototype._verifyMapType = function(obj) {
266
+ var currRefMap = "DEFAULT";
267
+ if (obj?.SAPVB?.Scenes?.Set) {
268
+ if (obj?.SAPVB?.Scenes?.Set?.SceneGeo?.refMapLayerStack) {
269
+ currRefMap = obj.SAPVB.Scenes.Set.SceneGeo.refMapLayerStack;
270
+ }
271
+ if (obj?.SAPVB?.MapProviders?.Set?.MapProvider) {
272
+ let MapProviders = obj.SAPVB.MapProviders.Set.MapProvider;
273
+ if (Array.isArray(MapProviders)) {
274
+ for (const MapProvider in MapProviders) {
275
+ if (MapProviders.hasOwnProperty(MapProvider)) {
276
+ let Provider = MapProviders[MapProvider];
277
+ if (Provider.name == currRefMap && Provider.type == "vector") {
278
+ return true;
279
+ } else if (Provider.name == currRefMap && (Provider.type == "raster" || Provider.type == "")) {
280
+ return false;
281
+ }
282
+ }
283
+ }
284
+ } else if (MapProviders.name == currRefMap && MapProviders.type == "vector") {
285
+ return true;
286
+ } else if (MapProviders.name == currRefMap && (MapProviders.type == "raster" || MapProviders.type == "")) {
287
+ return false;
288
+ }
289
+ }
290
+ } else if (obj?.SAPVB?.Scenes?.Merge) {
291
+ // Verify map type when map layer stack is switched
292
+ }
293
+ }
294
+
295
+
296
+
254
297
  /**
255
298
  * Parses and process sections of the VBI JSON and loads them into JSON Model bound to the GeoMap
256
299
  *
@@ -280,6 +323,13 @@ sap.ui.define([
280
323
  Log.debug("invalid object supplied for load", "", thisModule);
281
324
  return this;
282
325
  }
326
+ // Verifying the map type vector or raster
327
+ if (this._verifyMapType(obj)) {
328
+ VBI.VBITransformer.parseVBI(obj); // exit for vector processing
329
+ }
330
+ if (VBI.VBITransformer.getVectorFlag() == true) {
331
+ VBI.VBITransformer.parseVBI(obj); // exit for vector processing for subsequent loads - No data to distinguish
332
+ }
283
333
  if (obj.SAPVB.Config) {
284
334
  this._processConfiguration(obj.SAPVB.Config);
285
335
  }
@@ -294,6 +344,7 @@ sap.ui.define([
294
344
  this._processClusters(obj.SAPVB.Clustering);
295
345
  }
296
346
 
347
+ VBI.MapRenderer.setAdapter(this);
297
348
  return (obj.SAPVB.MapProviders ? this._processMapProviders(obj.SAPVB.MapProviders)
298
349
  : Promise.resolve()).then(function() {
299
350
  if (obj.SAPVB.MapLayerStacks) {
@@ -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.130.0
50
+ * @version 1.131.0
51
51
  * @extends sap.ui.core.Element
52
52
  * @constructor
53
53
  * @public
@@ -40,8 +40,10 @@ sap.ui.define([
40
40
  "./lib/sapconfig",
41
41
  "./lib/saplassotrack",
42
42
  "./lib/saprecttrack",
43
- "./lib/sapheatmap"
44
- ], function(Control, RenderManager, jQuery, Log, library, VBIRenderer) {
43
+ "./lib/sapheatmap",
44
+ "./vector/VBITransformer",
45
+ "./vector/MapRenderer",
46
+ ], function(Control, RenderManager, jQuery, Log, library, VBIRenderer,VBITransformer) {
45
47
  "use strict";
46
48
 
47
49
  var thisModule = "sap.ui.vbm.VBI";
@@ -1010,48 +1012,53 @@ sap.ui.define([
1010
1012
 
1011
1013
  VBI1.prototype.onAfterRendering = function() {
1012
1014
 
1013
- // when there is preserved content restore it.............................//
1014
- if (this.$oldContent.length > 0) {
1015
- // insert preserved control DOM content
1016
- this.$().append(this.$oldContent);
1017
- }
1015
+ if (VBI.VBITransformer.getVectorFlag() == false) {
1016
+ // when there is preserved content restore it.............................//
1017
+ if (this.$oldContent.length > 0) {
1018
+ // insert preserved control DOM content
1019
+ this.$().append(this.$oldContent);
1020
+ }
1018
1021
 
1019
- // process the load queue.................................................//
1020
- if (this.m_aLoadQueue) {
1021
- var nJ;
1022
- for (nJ = 0; nJ < this.m_aLoadQueue.length; ++nJ) {
1023
- this.load(this.m_aLoadQueue[nJ]);
1022
+ // process the load queue.................................................//
1023
+ if (this.m_aLoadQueue) {
1024
+ var nJ;
1025
+ for (nJ = 0; nJ < this.m_aLoadQueue.length; ++nJ) {
1026
+ this.load(this.m_aLoadQueue[nJ]);
1027
+ }
1028
+ this.m_aLoadQueue = null;
1024
1029
  }
1025
- this.m_aLoadQueue = null;
1026
- }
1027
1030
 
1028
- if (this.resizeID == "" && this.mVBIContext.GetMainScene()) {
1029
- this.resize();
1030
- this.resizeID = sap.ui.core.ResizeHandler.register(this, this.resize);
1031
- }
1031
+ if (this.resizeID == "" && this.mVBIContext.GetMainScene()) {
1032
+ this.resize();
1033
+ this.resizeID = sap.ui.core.ResizeHandler.register(this, this.resize);
1034
+ }
1032
1035
 
1033
- // do a new adjust of DOM placed elements.................................//
1034
- // the function should do nothing if nothing needs to be done.............//
1035
- var l_vbiId = this.getId();
1036
- if (this.mVBIContext.m_Windows) {
1037
- this.mVBIContext.m_Windows.Awake(l_vbiId);
1038
- }
1036
+ // do a new adjust of DOM placed elements.................................//
1037
+ // the function should do nothing if nothing needs to be done.............//
1038
+ var l_vbiId = this.getId();
1039
+ if (this.mVBIContext.m_Windows) {
1040
+ this.mVBIContext.m_Windows.Awake(l_vbiId);
1041
+ }
1039
1042
 
1040
- // move elements from hidden area to there final location
1041
- var aElems = jQuery(this.getDomRef()).children(".vbi-hidden").children();
1042
- for (var i = 0, oEntry; i < aElems.length; ++i) {
1043
- oEntry = aElems[i];
1044
- // Note: We cannot use a jQuery selector, since it fails with the artifical ID for cluster objects
1045
- // jQuery("#" + oEntry.attributes.getNamedItem("data").nodeValue).append(oEntry.firstChild);
1046
- var oDomref = document.getElementById(oEntry.attributes.getNamedItem("data").nodeValue);
1047
- if (oDomref) {
1048
- if (oEntry.firstChild) {
1049
- oDomref.appendChild(oEntry.firstChild);
1043
+ // move elements from hidden area to there final location
1044
+ var aElems = jQuery(this.getDomRef()).children(".vbi-hidden").children();
1045
+ for (var i = 0, oEntry; i < aElems.length; ++i) {
1046
+ oEntry = aElems[i];
1047
+ // Note: We cannot use a jQuery selector, since it fails with the artifical ID for cluster objects
1048
+ // jQuery("#" + oEntry.attributes.getNamedItem("data").nodeValue).append(oEntry.firstChild);
1049
+ var oDomref = document.getElementById(oEntry.attributes.getNamedItem("data").nodeValue);
1050
+ if (oDomref) {
1051
+ if (oEntry.firstChild) {
1052
+ oDomref.appendChild(oEntry.firstChild);
1053
+ }
1054
+ oEntry.parentNode.removeChild(oEntry);
1050
1055
  }
1051
- oEntry.parentNode.removeChild(oEntry);
1052
- }
1053
1056
 
1057
+ }
1058
+ } else {
1059
+ VBI.MapRenderer.renderMap();
1054
1060
  }
1061
+
1055
1062
  };
1056
1063
 
1057
1064
  VBI1.prototype.onBeforeRendering = function() {
@@ -13,6 +13,7 @@ sap.ui.define(function() {
13
13
  apiVersion: 2 // Semantic Rendering
14
14
  };
15
15
 
16
+ VBIRenderer.oControlId = "";
16
17
  /**
17
18
  * Renders the HTML for the given control, using the provided {@link sap.ui.core.RenderManager}.
18
19
  *
@@ -48,7 +49,8 @@ sap.ui.define(function() {
48
49
  oRm.openEnd();
49
50
 
50
51
  var id = oControl.getId();
51
-
52
+ VBIRenderer.oControlId = id;
53
+
52
54
  if (oControl.getPlugin()) {
53
55
 
54
56
  if (oControl.$oldContent.length === 0) {
@@ -110,6 +112,10 @@ sap.ui.define(function() {
110
112
  }
111
113
  };
112
114
 
115
+ VBIRenderer.getId = function() {
116
+ return VBIRenderer.oControlId;
117
+ }
118
+
113
119
  return VBIRenderer;
114
120
 
115
121
  }, /* bExport= */true);
@@ -23,7 +23,7 @@ sap.ui.define([
23
23
  *
24
24
  * @public
25
25
  * @author SAP SE
26
- * @version 1.130.0
26
+ * @version 1.131.0
27
27
  * @extends sap.ui.core.Control
28
28
  * @alias sap.ui.vbm.Viewport
29
29
  */
@@ -22,7 +22,7 @@ sap.ui.define([
22
22
  *
23
23
  * @private
24
24
  * @author SAP SE
25
- * @version 1.130.0
25
+ * @version 1.131.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.130.0
86
+ * @version 1.131.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.130.0
32
+ * @version 1.131.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.130.0
380
+ * @version 1.131.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.130.0
35
+ * @version 1.131.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.130.0
42
+ * @version 1.131.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.130.0
50
+ * @version 1.131.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.130.0
59
+ * @version 1.131.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.130.0
23
+ * @version 1.131.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.130.0"
48
+ version: "1.131.0"
49
49
  });
50
50
 
51
51
  sap.ui.loader.config({