@sapui5/sap.ui.vbm 1.119.0 → 1.121.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.
Files changed (95) hide show
  1. package/package.json +1 -1
  2. package/src/sap/ui/vbm/.library +1 -1
  3. package/src/sap/ui/vbm/Adapter.js +19 -19
  4. package/src/sap/ui/vbm/Adapter3D.js +7 -18
  5. package/src/sap/ui/vbm/AnalyticMap.js +3 -2
  6. package/src/sap/ui/vbm/ContainerBase.js +799 -0
  7. package/src/sap/ui/vbm/ContainerBaseRenderer.js +85 -0
  8. package/src/sap/ui/vbm/ContainerContent.js +82 -0
  9. package/src/sap/ui/vbm/ContainerContentRenderer.js +28 -0
  10. package/src/sap/ui/vbm/ContainerLegendItem.js +68 -0
  11. package/src/sap/ui/vbm/ContainerLegendItemRenderer.js +58 -0
  12. package/src/sap/ui/vbm/GeoMap.js +4 -4
  13. package/src/sap/ui/vbm/Legend.js +5 -3
  14. package/src/sap/ui/vbm/ListPanel.js +336 -0
  15. package/src/sap/ui/vbm/ListPanelRenderer.js +36 -0
  16. package/src/sap/ui/vbm/ListPanelStack.js +254 -0
  17. package/src/sap/ui/vbm/ListPanelStackRenderer.js +29 -0
  18. package/src/sap/ui/vbm/MapContainer.js +514 -0
  19. package/src/sap/ui/vbm/MapContainerButtonType.js +23 -0
  20. package/src/sap/ui/vbm/MapContainerRenderer.js +67 -0
  21. package/src/sap/ui/vbm/Viewport.js +1 -1
  22. package/src/sap/ui/vbm/VoAbstract.js +15 -1
  23. package/src/sap/ui/vbm/VoBase.js +4 -0
  24. package/src/sap/ui/vbm/adapter3d/DragDropHandler.js +1 -1
  25. package/src/sap/ui/vbm/adapter3d/ModelHandler.js +1 -1
  26. package/src/sap/ui/vbm/adapter3d/ObjectFactory.js +1 -1
  27. package/src/sap/ui/vbm/adapter3d/PolygonHandler.js +1 -1
  28. package/src/sap/ui/vbm/adapter3d/SceneBuilder.js +6 -5
  29. package/src/sap/ui/vbm/adapter3d/VBIJSONParser.js +10 -10
  30. package/src/sap/ui/vbm/getResourceBundle.js +14 -0
  31. package/src/sap/ui/vbm/i18n/messagebundle.properties +25 -0
  32. package/src/sap/ui/vbm/i18n/messagebundle_ar.properties +14 -0
  33. package/src/sap/ui/vbm/i18n/messagebundle_ca.properties +14 -0
  34. package/src/sap/ui/vbm/i18n/messagebundle_cnr.properties +14 -0
  35. package/src/sap/ui/vbm/i18n/messagebundle_cs.properties +14 -0
  36. package/src/sap/ui/vbm/i18n/messagebundle_cy.properties +14 -0
  37. package/src/sap/ui/vbm/i18n/messagebundle_da.properties +14 -0
  38. package/src/sap/ui/vbm/i18n/messagebundle_de.properties +14 -0
  39. package/src/sap/ui/vbm/i18n/messagebundle_el.properties +14 -0
  40. package/src/sap/ui/vbm/i18n/messagebundle_en.properties +13 -0
  41. package/src/sap/ui/vbm/i18n/messagebundle_en_GB.properties +14 -0
  42. package/src/sap/ui/vbm/i18n/messagebundle_en_US_sappsd.properties +14 -0
  43. package/src/sap/ui/vbm/i18n/messagebundle_en_US_saprigi.properties +14 -0
  44. package/src/sap/ui/vbm/i18n/messagebundle_en_US_saptrc.properties +14 -0
  45. package/src/sap/ui/vbm/i18n/messagebundle_es.properties +14 -0
  46. package/src/sap/ui/vbm/i18n/messagebundle_es_MX.properties +14 -0
  47. package/src/sap/ui/vbm/i18n/messagebundle_et.properties +14 -0
  48. package/src/sap/ui/vbm/i18n/messagebundle_fi.properties +14 -0
  49. package/src/sap/ui/vbm/i18n/messagebundle_fr.properties +14 -0
  50. package/src/sap/ui/vbm/i18n/messagebundle_fr_CA.properties +14 -0
  51. package/src/sap/ui/vbm/i18n/messagebundle_hi.properties +14 -0
  52. package/src/sap/ui/vbm/i18n/messagebundle_hr.properties +14 -0
  53. package/src/sap/ui/vbm/i18n/messagebundle_hu.properties +14 -0
  54. package/src/sap/ui/vbm/i18n/messagebundle_id.properties +14 -0
  55. package/src/sap/ui/vbm/i18n/messagebundle_it.properties +14 -0
  56. package/src/sap/ui/vbm/i18n/messagebundle_iw.properties +14 -0
  57. package/src/sap/ui/vbm/i18n/messagebundle_ja.properties +14 -0
  58. package/src/sap/ui/vbm/i18n/messagebundle_kk.properties +15 -0
  59. package/src/sap/ui/vbm/i18n/messagebundle_ko.properties +14 -0
  60. package/src/sap/ui/vbm/i18n/messagebundle_lt.properties +14 -0
  61. package/src/sap/ui/vbm/i18n/messagebundle_lv.properties +14 -0
  62. package/src/sap/ui/vbm/i18n/messagebundle_mk.properties +14 -0
  63. package/src/sap/ui/vbm/i18n/messagebundle_ms.properties +14 -0
  64. package/src/sap/ui/vbm/i18n/messagebundle_nl.properties +14 -0
  65. package/src/sap/ui/vbm/i18n/messagebundle_no.properties +14 -0
  66. package/src/sap/ui/vbm/i18n/messagebundle_pl.properties +14 -0
  67. package/src/sap/ui/vbm/i18n/messagebundle_pt.properties +14 -0
  68. package/src/sap/ui/vbm/i18n/messagebundle_pt_PT.properties +14 -0
  69. package/src/sap/ui/vbm/i18n/messagebundle_ro.properties +14 -0
  70. package/src/sap/ui/vbm/i18n/messagebundle_ru.properties +14 -0
  71. package/src/sap/ui/vbm/i18n/messagebundle_sk.properties +14 -0
  72. package/src/sap/ui/vbm/i18n/messagebundle_sl.properties +14 -0
  73. package/src/sap/ui/vbm/i18n/messagebundle_sr.properties +14 -0
  74. package/src/sap/ui/vbm/i18n/messagebundle_sv.properties +14 -0
  75. package/src/sap/ui/vbm/i18n/messagebundle_th.properties +14 -0
  76. package/src/sap/ui/vbm/i18n/messagebundle_tr.properties +14 -0
  77. package/src/sap/ui/vbm/i18n/messagebundle_uk.properties +14 -0
  78. package/src/sap/ui/vbm/i18n/messagebundle_vi.properties +14 -0
  79. package/src/sap/ui/vbm/i18n/messagebundle_zh_CN.properties +14 -0
  80. package/src/sap/ui/vbm/i18n/messagebundle_zh_TW.properties +14 -0
  81. package/src/sap/ui/vbm/lib/sapnavigation.js +7 -3
  82. package/src/sap/ui/vbm/lib/sapscale.js +1 -1
  83. package/src/sap/ui/vbm/lib/saputilities.js +11 -5
  84. package/src/sap/ui/vbm/lib/sapvbmenu.js +6 -1
  85. package/src/sap/ui/vbm/library.js +13 -7
  86. package/src/sap/ui/vbm/themes/base/ContainerBase.less +45 -0
  87. package/src/sap/ui/vbm/themes/base/ContainerLegendItem.less +46 -0
  88. package/src/sap/ui/vbm/themes/base/ListPanel.less +43 -0
  89. package/src/sap/ui/vbm/themes/base/ListPanelStack.less +30 -0
  90. package/src/sap/ui/vbm/themes/base/MapContainer.less +210 -0
  91. package/src/sap/ui/vbm/themes/base/fonts/map-container.eot +0 -0
  92. package/src/sap/ui/vbm/themes/base/fonts/map-container.svg +13 -0
  93. package/src/sap/ui/vbm/themes/base/fonts/map-container.ttf +0 -0
  94. package/src/sap/ui/vbm/themes/base/fonts/map-container.woff +0 -0
  95. package/src/sap/ui/vbm/themes/base/library.source.less +5 -0
@@ -0,0 +1,514 @@
1
+ /*!
2
+ * SAP UI development toolkit for HTML5 (SAPUI5) (c) Copyright 2009-2012 SAP AG. All rights reserved
3
+ */
4
+
5
+ // Provides control sap.ui.vbm.MapContainer.
6
+ sap.ui.define([
7
+ "./ContainerBase",
8
+ "sap/ui/core/IconPool",
9
+ "sap/ui/vbm/lib/sapvbi",
10
+ "sap/ui/Device",
11
+ "./MapContainerRenderer",
12
+ "./MapContainerButtonType",
13
+ "./getResourceBundle"
14
+ ], function(
15
+ ContainerBase,
16
+ IconPool,
17
+ sapvbi,
18
+ Device,
19
+ MapContainerRenderer,
20
+ MapContainerButtonType,
21
+ getResourceBundle
22
+ ) {
23
+ "use strict";
24
+
25
+ /**
26
+ * Constructor for a new MapContainer.
27
+ *
28
+ * @param {string} [sId] id for the new control, generated automatically if no id is given
29
+ * @param {object} [mSettings] initial settings for the new control
30
+ * @class Abstract Constructor for a new Container.
31
+ * @extends sap.ui.vbm.ContainerBase
32
+ * @author SAP SE
33
+ * @constructor
34
+ * @public
35
+ * @alias sap.ui.vbm.MapContainer
36
+ * @ui5-metamodel This control/element also will be described in the UI5 (legacy) designtime metamodel
37
+ */
38
+ var MapContainer = ContainerBase.extend("sap.ui.vbm.MapContainer", /** @lends sap.ui.vbm.MapContainer.prototype */ {
39
+ metadata: {
40
+
41
+ library: "sap.ui.vbm",
42
+ properties: {
43
+ /**
44
+ * Show navbar
45
+ */
46
+ "showNavbar": {
47
+ type: "boolean",
48
+ group: "Misc",
49
+ defaultValue: true
50
+ },
51
+ /**
52
+ * Controls the visibility of the home button
53
+ */
54
+ "showHome": {
55
+ type: "boolean",
56
+ group: "Misc",
57
+ defaultValue: true
58
+ },
59
+ /**
60
+ * Controls the visibility of the Map Layer Select
61
+ */
62
+ "showMapLayer": {
63
+ type: "boolean",
64
+ group: "Misc",
65
+ defaultValue: true
66
+ },
67
+ /**
68
+ * Controls the visibility of the rectangular zoom button
69
+ */
70
+ "showRectangularZoom": {
71
+ type: "boolean",
72
+ group: "Misc",
73
+ defaultValue: true
74
+ },
75
+ /**
76
+ * Controls the visibility of the zoom buttons
77
+ */
78
+ "showZoom": {
79
+ type: "boolean",
80
+ group: "Misc",
81
+ defaultValue: true
82
+ }
83
+ },
84
+ aggregations: {
85
+ /**
86
+ * List Panel aggregation
87
+ */
88
+ "listPanelStack": {
89
+ type: "sap.ui.vk.ListPanelStack",
90
+ multiple: false
91
+ },
92
+ /**
93
+ * hidden scroll container aggregation needed for binding
94
+ */
95
+ "scrollCont": {
96
+ type: "sap.m.ScrollContainer",
97
+ multiple: false,
98
+ visibility: "hidden"
99
+ }
100
+ },
101
+ associations: {},
102
+ events: {},
103
+
104
+ renderer: MapContainerRenderer
105
+
106
+ }
107
+ });
108
+
109
+ // ...........................................................................//
110
+ // This file defines behavior for the control,...............................//
111
+ // ...........................................................................//
112
+ // Public API functions
113
+ // ............................................................................//
114
+
115
+ // ........................................................................//
116
+ // Implementation of UI5 Interface functions
117
+ // ........................................................................//
118
+
119
+ MapContainer.prototype.init = function() {
120
+ // call super init
121
+ ContainerBase.prototype.init.apply(this, arguments);
122
+
123
+ // create model and set the data
124
+ var oModel = new sap.ui.model.json.JSONModel();
125
+ oModel.setData({
126
+ rectZoom: false
127
+ });
128
+ this.setModel(oModel, "rectZoom");
129
+
130
+ // navbar
131
+ this._oNavbar = new sap.m.Toolbar({
132
+ // Use ToolbarDesign.Auto
133
+ width: "auto"
134
+ });
135
+ // scroll container for list panel stack
136
+ this._oScrollCont = new sap.m.ScrollContainer({
137
+ horizontal: false,
138
+ vertical: true,
139
+ focusable: false
140
+ });
141
+ this.setAggregation("scrollCont", this._oScrollCont, /* bSuppressInvalidate= */ true);
142
+
143
+ // create potential navbar buttons
144
+ this._oHomeButton = new sap.m.Button({
145
+ icon: "sap-icon://home",
146
+ type: sap.m.ButtonType.Transparent,
147
+ tooltip: getResourceBundle().getText("MAPCONTAINER_HOME"),
148
+ press: this._onNavbarHome.bind(this)
149
+ });
150
+ this._oRectZoomButton = new sap.m.ToggleButton({
151
+ icon: "sap-icon://draw-rectangle",
152
+ type: sap.m.ButtonType.Transparent,
153
+ pressed: "{rectZoom>/rectZoom}",
154
+ tooltip: getResourceBundle().getText("MAPCONTAINER_RECT_ZOOM")
155
+ }).setModel(oModel, "rectZoom");
156
+ this._oZoomInButton = new sap.m.Button({
157
+ icon: "sap-icon://add",
158
+ type: sap.m.ButtonType.Transparent,
159
+ tooltip: getResourceBundle().getText("MAPCONTAINER_ZOOMIN"),
160
+ press: this._onNavbarZoomIn.bind(this)
161
+ });
162
+ this._oZoomOutButton = new sap.m.Button({
163
+ icon: "sap-icon://less",
164
+ type: sap.m.ButtonType.Transparent,
165
+ tooltip: getResourceBundle().getText("MAPCONTAINER_ZOOMOUT"),
166
+ press: this._onNavbarZoomOut.bind(this)
167
+ });
168
+
169
+ // Menu buttons for ListPanelStack on mobile phone
170
+ if (Device.system.phone) {
171
+ this._oMenuOpenButton = new sap.m.Button({
172
+ layoutData: new sap.m.OverflowToolbarLayoutData({
173
+ priority: sap.m.OverflowToolbarPriority.NeverOverflow
174
+ }),
175
+ icon: "sap-icon://menu2",
176
+ type: sap.m.ButtonType.Transparent,
177
+ tooltip: getResourceBundle().getText("CONTAINERBASE_MENU"),
178
+ press: function() {
179
+ this._bSegmentedButtonSaveSelectState = true;
180
+ this._showListPanelStack();
181
+ }.bind(this)
182
+ });
183
+ this._oMenuCloseButton = new sap.m.Button({
184
+ type: sap.m.ButtonType.Transparent,
185
+ icon: "sap-icon://nav-back",
186
+ press: function() {
187
+ this._bSegmentedButtonSaveSelectState = true;
188
+ this._hideListPanelStack();
189
+ }.bind(this)
190
+ });
191
+ }
192
+
193
+ this.addStyleClass("sapUiVkMapContainer");
194
+ };
195
+
196
+ MapContainer.prototype.exit = function() {
197
+ if (this._oNavbar) {
198
+ this._oNavbar.destroy();
199
+ this._oNavbar = undefined;
200
+ }
201
+ if (this._oScrollCont) {
202
+ this._oScrollCont.destroy();
203
+ this._oScrollCont = undefined;
204
+ }
205
+ // call super exit
206
+ ContainerBase.prototype.exit.apply(this, arguments);
207
+ };
208
+
209
+ // delegate listPanelStack aggregation to ScrollContainer content aggregation
210
+ MapContainer.prototype.getListPanelStack = function() {
211
+ return this._oScrollCont.getContent()[0];
212
+ };
213
+
214
+ MapContainer.prototype.setListPanelStack = function(oPanel) {
215
+ if (Device.system.phone) {
216
+ // Do not allow to collapse List Panel Stack on mobile phones, since it is rendered in a side container there
217
+ oPanel.setCollapsible(false);
218
+ oPanel.setWidth("100%");
219
+ }
220
+ this._oScrollCont.removeAllContent();
221
+ return this._oScrollCont.addContent(oPanel);
222
+ };
223
+
224
+ // ...............................................................................
225
+ // Redefined functions
226
+ // ...............................................................................
227
+
228
+ MapContainer.prototype.onBeforeRendering = function() {
229
+ // call super implementation
230
+ ContainerBase.prototype.onBeforeRendering.apply(this, arguments);
231
+
232
+ this._oNavbar.removeAllContent();
233
+ // repopulate navbar buttons according current settings
234
+
235
+ this._shouldRenderMapLayerSwitch = false;
236
+
237
+ var content = this.getSelectedContent();
238
+ if (content !== null) {
239
+ var control = content.getContent();
240
+ this._isInstanceGeoAnalytic = control instanceof sap.ui.vbm.GeoMap || control instanceof sap.ui.vbm.AnalyticMap;
241
+ if (this._isInstanceGeoAnalytic) {
242
+ if (this.getShowHome()) {
243
+ this._oNavbar.addContent(this._oHomeButton);
244
+ }
245
+ if (!Device.system.phone && this.getShowRectangularZoom()) {
246
+ this._oNavbar.addContent(this._oRectZoomButton);
247
+ }
248
+ if (this.getShowZoom()) {
249
+ this._oNavbar.addContent(this._oZoomInButton);
250
+ this._oNavbar.addContent(this._oZoomOutButton);
251
+ }
252
+ this._shouldRenderListPanel = true;
253
+ } else {
254
+ this._shouldRenderListPanel = false;
255
+ }
256
+ this._isSupportingMapLayerSwitch = control instanceof sap.ui.vbm.GeoMap && !(control instanceof sap.ui.vbm.AnalyticMap);
257
+ if (this._isSupportingMapLayerSwitch && control.getMapConfiguration() !== null && this.getShowMapLayer()) {
258
+
259
+ var config = control.getMapConfiguration();
260
+ var layers = [].concat(config.MapLayerStacks);
261
+
262
+ if (layers.length > 1) {
263
+
264
+ this._currentText = new sap.m.Text().addStyleClass("mapLayerSelectedText");
265
+ this.addDependent(this._currentText); // bind life/render cycle to MapContainer
266
+
267
+ this._box = new sap.m.HBox().addStyleClass("mapContainerHboxPopover");
268
+
269
+ this._popover = new sap.m.Popover({
270
+ enableScrolling: false,
271
+ placement: sap.m.PlacementType.Horizontal,
272
+ content: this._box,
273
+ showHeader: false
274
+ });
275
+
276
+ this._selectionMap = new sap.m.Image({
277
+ press: function(event) {
278
+ if (this._popover.isOpen()) {
279
+ this._popover.close();
280
+ } else {
281
+ this._popover.openBy(this._selectionMap);
282
+ }
283
+ }.bind(this)
284
+ }).addStyleClass("mapLayerPopoverItem");
285
+ this.addDependent(this._selectionMap); // bind life/render cycle to MapContainer
286
+
287
+ this._shouldRenderMapLayerSwitch = true;
288
+ }
289
+ }
290
+ }
291
+ };
292
+
293
+ MapContainer.prototype.onAfterRendering = function() {
294
+ if (Device.system.phone) {
295
+ // append ListPanelStackWrapper to control div to be a sibling of the content wrapper
296
+ var oListPanelWrapperDiv = document.getElementById(this.getId() + "-LPW");
297
+ this.getDomRef().appendChild(oListPanelWrapperDiv);
298
+ }
299
+
300
+ // call super implementation
301
+ ContainerBase.prototype.onAfterRendering.apply(this, arguments);
302
+
303
+ if (this._shouldRenderMapLayerSwitch) {
304
+ var control = this.getSelectedContent().getContent();
305
+ var config = control.getMapConfiguration();
306
+ var layers = [].concat(config.MapLayerStacks);
307
+ // Access the scene to use getPreviewImage callback
308
+ var scene = control.mVBIContext.GetMainScene();
309
+
310
+ layers.forEach(function(v) {
311
+ var currentMapLayerStack = control.mVBIContext.m_MapLayerStackManager.GetMapLayerStack(v.name);
312
+
313
+ var item = new sap.m.Image({
314
+ alt: v.name,
315
+ press: function(event) {
316
+ this._popover.close();
317
+ this._currentText.setText(v.name);
318
+ this._selectionMap.setAlt(v.name);
319
+ control.setRefMapLayerStack(v.name);
320
+
321
+ if (item.getSrc()) {
322
+ this._selectionMap.setSrc(item.getSrc());
323
+ } else {
324
+ scene.GetPreviewImage(currentMapLayerStack, function(img) {
325
+ this._selectionMap.setSrc(img.src);
326
+ }.bind(this));
327
+ }
328
+ }.bind(this)
329
+ }).addStyleClass("layerType");
330
+
331
+ // set the source of items in popover
332
+ scene.GetPreviewImage(currentMapLayerStack, function(img) {
333
+ item.setSrc(img.src);
334
+ });
335
+
336
+ var itemText = new sap.m.Text({ text: v.name }).addStyleClass("mapLayerPopoverItemText");
337
+
338
+ var verticalLayout = new sap.ui.layout.VerticalLayout();
339
+ verticalLayout.addContent(item);
340
+ verticalLayout.addContent(itemText);
341
+
342
+ this._box.addItem(verticalLayout);
343
+ }, this);
344
+
345
+ this._currentText.setText(control.getRefMapLayerStack());
346
+ this._selectionMap.setAlt(control.getRefMapLayerStack());
347
+
348
+ // set tile of selected map layer stack on initial load
349
+ scene.GetPreviewImage(scene.m_MapLayerStack, function(img) {
350
+ this._selectionMap.setSrc(img.src);
351
+ }.bind(this));
352
+ }
353
+ };
354
+
355
+ /**
356
+ * Set custom item on the MapContainer toolbar.
357
+ * All custom items added between selection segment button and setting button.
358
+ *
359
+ * @param {object} item Item configuration object.
360
+ * @param {string} item.id Id of the item for future references.
361
+ * @param {int} item.index Relative index of an item across all custom items.
362
+ * @param {boolean} item.visible Visibility of an item.
363
+ * @param {boolean} item.active Active item or not.
364
+ * @param {string} item.text Text of an item.
365
+ * @param {string} item.tooltip Tooltip of an item.
366
+ * @param {boolean} item.overflow If true create Overflow button or standard if false.
367
+ * @param {sap.ui.core.URI} item.icon Icon of an item.
368
+ * @param {sap.ui.core.URI} item.activeIcon Alternative icon of an item, see {@link sap.m.Button} for details.
369
+ * @param {string} item.type The {@link sap.ui.vk.MapContainerButtonType} enum.
370
+ * @param {function} item.press Callback function which is called when item gets pressed.
371
+ * @param {boolean} item.toggled sets the initial pressed state for a {@link sap.ui.vk.MapContainerButtonType} Toggle button. This does not fire the pressed event handler. It should be used if pressed logic is activated by application code on first load.
372
+
373
+ * @returns {object} Item configuration object
374
+ * @public
375
+ * @ui5-metamodel This method also will be described in the UI5 (legacy) designtime metamodel
376
+ */
377
+ MapContainer.prototype.setToolbarItem = function(item) {
378
+ if (!item || !item.id) {
379
+ return null;
380
+ }
381
+ var obj;
382
+
383
+ for (var i = 0; i < this._customButtons.length; ++i) {
384
+ if (item.id === this._customButtons[i].id) {
385
+ obj = this._customButtons[i];
386
+ obj.index = i; // update index as it may be out of sync
387
+ this._customButtons.splice(i, 1); // remove it now to add later
388
+ break;
389
+ }
390
+ }
391
+ if (!obj) { // new item -> use default parameters
392
+ obj = {
393
+ id: item.id,
394
+ visible: true,
395
+ active: true,
396
+ index: this._customButtons.length, // add to the end
397
+ type: MapContainerButtonType.Click // click by default
398
+ };
399
+ }
400
+ // override parameters
401
+ if ("index" in item) {
402
+ obj.index = item.index;
403
+ }
404
+ if ("visible" in item) {
405
+ obj.visible = item.visible;
406
+ }
407
+ if ("overflow" in item) {
408
+ obj.overflow = item.overflow;
409
+ }
410
+ if ("active" in item) {
411
+ obj.active = item.active;
412
+ }
413
+ if ("text" in item) {
414
+ obj.text = item.text;
415
+ }
416
+ if ("tooltip" in item) {
417
+ obj.tooltip = item.tooltip;
418
+ }
419
+ if ("icon" in item) {
420
+ obj.icon = item.icon;
421
+ }
422
+ if ("activeIcon" in item) {
423
+ obj.activeIcon = item.activeIcon;
424
+ }
425
+ if ("press" in item) {
426
+ obj.press = item.press;
427
+ }
428
+ if ("toggled" in item) {
429
+ // Track changes to toggled state so that we know whether the data value or the existing button state should be persisted
430
+ obj.toggled = item.toggled;
431
+ if (obj.button) {
432
+ obj.button.setPressed(item.toggled);
433
+ }
434
+ }
435
+ if ("type" in item) {
436
+ obj.type = item.type;
437
+ }
438
+ // normalize index
439
+ if (obj.index > this._customButtons.length) {
440
+ obj.index = this._customButtons.length;
441
+ } else if (obj.index < 0) {
442
+ obj.index = 0;
443
+ }
444
+ this._customButtons.splice(obj.index, 0, obj); // add ("back" if exists) to the array
445
+ this.invalidate();
446
+
447
+ return obj;
448
+ };
449
+
450
+ MapContainer.prototype.setSelectedContent = function(oContent) {
451
+ var oOldControl;
452
+ if (this._oSelectedContent) {
453
+ if ((oOldControl = this._oSelectedContent.getContent()) instanceof sap.ui.vbm.GeoMap) {
454
+ oOldControl.unbindProperty("rectZoom", "rectZoom>/rectZoom");
455
+ }
456
+ }
457
+ // call super implementation
458
+ ContainerBase.prototype.setSelectedContent.apply(this, arguments);
459
+
460
+ var oNewControl = this._oSelectedContent.getContent();
461
+ if (oNewControl instanceof sap.ui.vbm.GeoMap) {
462
+ oNewControl.bindProperty("rectZoom", "rectZoom>/rectZoom");
463
+ }
464
+ };
465
+
466
+ MapContainer.prototype._addToolbarContent = function() {
467
+ if (Device.system.phone) {
468
+ this._oToolbar.addContent(this._oMenuOpenButton);
469
+ }
470
+ // call super implementation
471
+ ContainerBase.prototype._addToolbarContent.apply(this, arguments);
472
+ };
473
+
474
+ // ...............................................................................
475
+ // Internal functions
476
+ // ...............................................................................
477
+
478
+ MapContainer.prototype._onNavbarZoomIn = function(oEvent) {
479
+
480
+ var control = this.getSelectedContent().getContent();
481
+ if (control.getZoomlevel && control.setZoomlevel && control.setEnableAnimation) {
482
+ control.setEnableAnimation(true);
483
+ control.setZoomlevel(control.getZoomlevel() + 1);
484
+ }
485
+ };
486
+
487
+ MapContainer.prototype._onNavbarZoomOut = function(oEvent) {
488
+ var control = this.getSelectedContent().getContent();
489
+ if (control.getZoomlevel && control.setZoomlevel && control.setEnableAnimation) {
490
+ control.setEnableAnimation(true);
491
+ control.setZoomlevel(control.getZoomlevel() - 1);
492
+ }
493
+ };
494
+
495
+ MapContainer.prototype._onNavbarHome = function(oEvent) {
496
+ var control = this.getSelectedContent().getContent();
497
+ if (control.goToStartPosition) {
498
+ control.goToStartPosition();
499
+ }
500
+ };
501
+
502
+ MapContainer.prototype._showListPanelStack = function() {
503
+ jQuery("#" + this.getId() + "-LPW").addClass("sapUiVkMapContainerLPWIn");
504
+ jQuery("#" + this.getId() + "-wrapper").addClass("sapUiVkMapContainerMapOut");
505
+ };
506
+
507
+ MapContainer.prototype._hideListPanelStack = function() {
508
+ jQuery("#" + this.getId() + "-LPW").removeClass("sapUiVkMapContainerLPWIn");
509
+ jQuery("#" + this.getId() + "-wrapper").removeClass("sapUiVkMapContainerMapOut");
510
+ };
511
+
512
+ return MapContainer;
513
+
514
+ });
@@ -0,0 +1,23 @@
1
+ /*!
2
+ * SAP UI development toolkit for HTML5 (SAPUI5) (c) Copyright 2009-2012 SAP AG. All rights reserved
3
+ */
4
+
5
+ // Provides type sap.ui.vbm.MapContainerButtonType.
6
+ sap.ui.define([], function() {
7
+ "use strict";
8
+
9
+ /**
10
+ * Types of custom buttons supported on the MapContainer toolbar
11
+ * @enum {string}
12
+ * @readonly
13
+ * @alias sap.ui.vbm.MapContainerButtonType
14
+ * @public
15
+ */
16
+ var MapContainerButtonType = {
17
+ Click: "Click",
18
+ Toggle: "Toggle"
19
+ };
20
+
21
+ return MapContainerButtonType;
22
+
23
+ }, /* bExport= */ true);
@@ -0,0 +1,67 @@
1
+ /*!
2
+ * SAP UI development toolkit for HTML5 (SAPUI5) (c) Copyright 2009-2012 SAP AG. All rights reserved
3
+ */
4
+
5
+ sap.ui.define([
6
+ "./ContainerBaseRenderer", "sap/ui/core/Renderer", "sap/ui/Device"
7
+ ], function(BaseContainerRenderer, Renderer, Device) {
8
+ "use strict";
9
+
10
+ /*
11
+ * @class MapContainer renderer. @static
12
+ */
13
+ var MapContainerRenderer = Renderer.extend(BaseContainerRenderer);
14
+
15
+ MapContainerRenderer.apiVersion = 2;
16
+
17
+ MapContainerRenderer.writeToolbarArea = function(oRm, oControl) {
18
+ oRm.openStart("div");
19
+ oRm.class("sapUiVkMapContainerOverlay");
20
+ oRm.attr("role", sap.ui.core.AccessibleRole.Presentation);
21
+ oRm.openEnd();
22
+ if (oControl.getShowNavbar()) {
23
+ oRm.openStart("div");
24
+ oRm.class("sapUiVkMapContainerNavbarArea");
25
+ oRm.attr("role", sap.ui.core.AccessibleRole.Presentation);
26
+ oRm.openEnd();
27
+
28
+ // navbar
29
+ if (oControl.getShowMapLayer() && oControl._shouldRenderMapLayerSwitch) {
30
+ oRm.renderControl(oControl._currentText);
31
+ oRm.renderControl(oControl._selectionMap);
32
+ }
33
+ oRm.openStart("div");
34
+ oRm.class("sapUiVkMapContainerNavbarContainer");
35
+ oRm.attr("role", sap.ui.core.AccessibleRole.Navigation);
36
+ oRm.openEnd();
37
+ oRm.renderControl(oControl._oNavbar);
38
+ oRm.close("div");// end navbar
39
+ oRm.close("div");// end navbar
40
+ }
41
+
42
+ // list panel
43
+ if (!Device.system.phone && oControl._shouldRenderListPanel) {
44
+ oControl._oScrollCont.addStyleClass("sapUiVkMapContainerListPanelArea");
45
+ oRm.renderControl(oControl._oScrollCont);
46
+ }
47
+
48
+ BaseContainerRenderer.writeToolbarArea(oRm, oControl);
49
+
50
+ oRm.close("div");
51
+ if (Device.system.phone) {
52
+ oRm.openStart("div");
53
+ oRm.attr("id", oControl.getId() + "-LPW");
54
+ oRm.class("sapUiVkMapContainerLPW");
55
+ oRm.openEnd();
56
+ // close button
57
+ oRm.renderControl(oControl._oMenuCloseButton);
58
+ // list panel
59
+ oControl._oScrollCont.addStyleClass("sapUiVkMapContainerListPanelArea");
60
+ oRm.renderControl(oControl._oScrollCont);
61
+ oRm.close("div");// end list panel container
62
+ }
63
+ };
64
+
65
+ return MapContainerRenderer;
66
+
67
+ }, /* bExport= */true);
@@ -23,7 +23,7 @@ sap.ui.define([
23
23
  *
24
24
  * @public
25
25
  * @author SAP SE
26
- * @version 1.119.0
26
+ * @version 1.121.0
27
27
  * @extends sap.ui.core.Control
28
28
  * @alias sap.ui.vbm.Viewport
29
29
  */
@@ -197,8 +197,22 @@ sap.ui.define([
197
197
  var aVO = this.getItems();
198
198
  for (var nJ = 0, len = aVO.length; nJ < len; ++nJ) {
199
199
  oData.E.push(aVO[nJ].getDataElement());
200
- }
201
200
 
201
+ //Special handling for TM Transportation Cockpit
202
+ if (this.mEventRegistry.click !== undefined) {
203
+ if (this.mEventRegistry.click[0].oListener !== undefined && this.mEventRegistry.click[0].oListener._data !== undefined) {
204
+ var spots = this.mEventRegistry.click[0].oListener._data.Spots || null;
205
+ if (spots !== null) {
206
+ spots.forEach(function (item) {
207
+ var key = item.Key;
208
+ if (key === oData.E[nJ].Key) {
209
+ oData.E[nJ]['VB:s'] = item.select;
210
+ }
211
+ });
212
+ }
213
+ }
214
+ }
215
+ }
202
216
  return oData;
203
217
  };
204
218
 
@@ -2,6 +2,8 @@
2
2
  * ! SAP UI development toolkit for HTML5 (SAPUI5) (c) Copyright 2009-2012 SAP AG. All rights reserved
3
3
  */
4
4
 
5
+
6
+
5
7
  // Provides control sap.ui.vbm.VoBase.
6
8
  sap.ui.define([
7
9
  "sap/ui/core/Element",
@@ -398,6 +400,8 @@ sap.ui.define([
398
400
  }
399
401
  oElement['VB:s'] = this.getSelect(); // always bound
400
402
 
403
+ oElement.Key = this.mProperties.key;// for handling TM spots
404
+
401
405
  var tt = this.getTooltip();
402
406
 
403
407
  if (tt instanceof sap.ui.core.TooltipBase) {
@@ -83,7 +83,7 @@ sap.ui.define([
83
83
  *
84
84
  * @private
85
85
  * @author SAP SE
86
- * @version 1.119.0
86
+ * @version 1.121.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.119.0
32
+ * @version 1.121.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.119.0
380
+ * @version 1.121.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.119.0
35
+ * @version 1.121.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 */ {