@sapui5/sap.ui.vbm 1.138.0 → 1.139.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.138.0",
3
+ "version": "1.139.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.138.0</version>
6
+ <version>1.139.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.138.0
27
+ * @version 1.139.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.138.0
50
+ * @version 1.139.0
51
51
  * @extends sap.ui.core.Element
52
52
  * @constructor
53
53
  * @public
@@ -300,7 +300,7 @@ sap.ui.define([
300
300
  xhr.open("GET", sPathGeoJSON, false); // set 'false' to make it synchronous
301
301
  xhr.send();
302
302
 
303
- if (xhr.status === 200) {
303
+ if (xhr.status === 200 && !!xhr.responseText) {
304
304
  oData = JSON.parse(xhr.responseText);
305
305
  } else {
306
306
  // Handle error
@@ -23,7 +23,7 @@ sap.ui.define([
23
23
  *
24
24
  * @public
25
25
  * @author SAP SE
26
- * @version 1.138.0
26
+ * @version 1.139.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.138.0
25
+ * @version 1.139.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.138.0
86
+ * @version 1.139.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.138.0
32
+ * @version 1.139.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.138.0
380
+ * @version 1.139.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.138.0
35
+ * @version 1.139.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.138.0
42
+ * @version 1.139.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 */ {
@@ -496,7 +496,7 @@ sap.ui.define([
496
496
 
497
497
  RectangleTracker.prototype.searchChildInFrustum = function (frustum, object) {
498
498
  var count = 0;
499
- if (object._sapInstance != undefined && !object.geomtry) {
499
+ if (object._sapInstance != undefined && ((object._sapInstance["VB:c"] == 'true' ) || !(object._sapInstance["VB:c"]) )) {
500
500
  var box1 = new THREE.BoxHelper(object, 0x000000);
501
501
  var vertices = box1.geometry.attributes.position.array;
502
502
  for (var i = 0, l = vertices.length; i < l; i += 3) {
@@ -47,7 +47,7 @@ sap.ui.define([
47
47
  *
48
48
  * @private
49
49
  * @author SAP SE
50
- * @version 1.138.0
50
+ * @version 1.139.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.138.0
59
+ * @version 1.139.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.138.0
23
+ * @version 1.139.0
24
24
  * @public
25
25
  */
26
26
 
@@ -46,7 +46,7 @@ sap.ui.define([
46
46
  "sap.ui.vbm.ClusterBase", "sap.ui.vbm.ClusterTree", "sap.ui.vbm.ClusterGrid", "sap.ui.vbm.ClusterDistance", "sap.ui.vbm.Heatmap",
47
47
  "sap.ui.vbm.HeatPoint", "sap.ui.vbm.ClusterContainer", "sap.ui.vbm.Adapter", "sap.ui.vbm.Adapter3D"
48
48
  ],
49
- version: "1.138.0"
49
+ version: "1.139.0"
50
50
  });
51
51
 
52
52
  sap.ui.loader.config({
@@ -396,9 +396,69 @@ sap.ui.define([
396
396
  if (that.Apressed || that.Rpressed) {
397
397
  el.style.cursor = 'crosshair';
398
398
  } else {
399
- const tooltipContent = marker.properties.ToolTip.replace(/\n/g, '<br>');
400
- const tooltip = `<div style="background-color: white; color: black;">${tooltipContent}</div>`;
401
- popup.setLngLat(marker.geometry.coordinates).setHTML(tooltip).addTo(map);
399
+ function renderTooltip(marker, popup, map) {
400
+ if (!document.getElementById('custom-maplibre-tooltip-style')) {
401
+ const style = document.createElement('style');
402
+ style.id = 'custom-maplibre-tooltip-style';
403
+ style.innerHTML = `
404
+ .maplibregl-popup {
405
+ background: transparent !important;
406
+ box-shadow: none !important;
407
+ padding: 0 !important;
408
+ width: auto;
409
+ }
410
+ .maplibregl-popup-content {
411
+ background: transparent !important;
412
+ padding: 0 !important;
413
+ box-shadow: none !important;
414
+ border-radius: 0 !important;
415
+ width: auto;
416
+ }
417
+ `;
418
+ document.head.appendChild(style);
419
+ }
420
+
421
+ const isDarkTheme = window.matchMedia &&
422
+ window.matchMedia('(prefers-color-scheme: dark)').matches;
423
+
424
+ const outerBorderColor = 'none';
425
+ const innerBgColor = isDarkTheme ? '#545555' : '#f0f0f0';
426
+ const textColor = isDarkTheme ? 'white' : 'f0f0f0';
427
+
428
+ const tooltipContent = marker.properties.ToolTip.replace(/\n/g, '<br>');
429
+
430
+ const tooltip = `
431
+
432
+ <div style="
433
+ background-color: ${innerBgColor};
434
+ color: ${textColor};
435
+ padding: 8px;
436
+ border-radius: 6px;
437
+ max-height: 180px;
438
+ display: inline-block;
439
+ font-family: Arial;
440
+ font-size: 0.875rem;
441
+ width: auto;
442
+ white-space: nowrap;
443
+ border: 2px solid ${outerBorderColor};
444
+ ">
445
+ ${tooltipContent}
446
+ </div>`;
447
+
448
+ popup.setLngLat(marker.geometry.coordinates)
449
+ .setHTML(tooltip)
450
+ .addTo(map);
451
+ }
452
+
453
+ // 2. Initial render
454
+ renderTooltip(marker, popup, map);
455
+
456
+ // 3. Re-render tooltip on system theme change
457
+ window.matchMedia('(prefers-color-scheme: dark)')
458
+ .addEventListener('change', () => {
459
+ popup.remove();
460
+ renderTooltip(marker, popup, map);
461
+ });
402
462
  }
403
463
  }
404
464
 
@@ -597,11 +657,55 @@ sap.ui.define([
597
657
  if (!that.Apressed && !that.Rpressed) {
598
658
  map.getCanvas().style.cursor = 'pointer';
599
659
  }
660
+ if (!document.getElementById('custom-maplibre-tooltip-style')) {
661
+ const style = document.createElement('style');
662
+ style.id = 'custom-maplibre-tooltip-style';
663
+ style.innerHTML = `
664
+ .maplibregl-popup {
665
+ background: transparent !important;
666
+ box-shadow: none !important;
667
+ padding: 0 !important;
668
+ width: auto;
669
+ }
670
+ .maplibregl-popup-content {
671
+ background: transparent !important;
672
+ padding: 0 !important;
673
+ box-shadow: none !important;
674
+ border-radius: 0 !important;
675
+ width: auto;
676
+ } `;
677
+ document.head.appendChild(style);
678
+ }
679
+
680
+ const isDarkTheme = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
681
+
682
+ const outerBorderColor = 'none';
683
+ const innerBgColor = isDarkTheme ? '#545555' : '#f0f0f0';
684
+ const textColor = isDarkTheme ? 'white' : 'f0f0f0';
685
+
600
686
  const coordinates = event.lngLat;
601
- const description = event.features[0].properties.ToolTip;
687
+ const description = event.features[0].properties.ToolTip || "";
688
+
602
689
  const tooltipContent = description.replace(/\n/g, '<br>');
603
- const tooltip = `<div style="background-color: white; color: black;">${tooltipContent}</div>`;
690
+
691
+ const tooltip = ` <div style="
692
+ background-color: ${innerBgColor};
693
+ color: ${textColor};
694
+ padding: 8px;
695
+ border-radius: 6px;
696
+ max-height: 180px;
697
+ display: inline-block;
698
+ font-family: Arial;
699
+ font-size: 0.875rem;
700
+ width: auto;
701
+ white-space: nowrap;
702
+ border: 2px solid ${outerBorderColor};
703
+ ">
704
+ ${tooltipContent}
705
+ </div> `;
706
+
604
707
  popupLink.setLngLat(coordinates).setHTML(tooltip).addTo(map);
708
+
605
709
  });
606
710
 
607
711
  // Revert mouse cursor back when not hovering
@@ -12,7 +12,7 @@ sap.ui.define([
12
12
  *
13
13
  * @private
14
14
  * @author SAP SE
15
- * @version 1.138.0
15
+ * @version 1.139.0
16
16
  * @alias sap.ui.vbm.vector.PayloadGenerator
17
17
  */
18
18
  var adapter = {};
@@ -12,7 +12,7 @@ sap.ui.define([
12
12
  *
13
13
  * @private
14
14
  * @author SAP SE
15
- * @version 1.138.0
15
+ * @version 1.139.0
16
16
  * @alias sap.ui.vbm.vector.RectangularSelection
17
17
  */
18
18