@syncfusion/ej2-maps 25.2.4 → 26.1.35

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 (58) hide show
  1. package/.eslintrc.json +3 -2
  2. package/dist/ej2-maps.min.js +2 -2
  3. package/dist/ej2-maps.umd.min.js +2 -2
  4. package/dist/ej2-maps.umd.min.js.map +1 -1
  5. package/dist/es6/ej2-maps.es2015.js +1328 -1138
  6. package/dist/es6/ej2-maps.es2015.js.map +1 -1
  7. package/dist/es6/ej2-maps.es5.js +1375 -1180
  8. package/dist/es6/ej2-maps.es5.js.map +1 -1
  9. package/dist/global/ej2-maps.min.js +2 -2
  10. package/dist/global/ej2-maps.min.js.map +1 -1
  11. package/dist/global/index.d.ts +1 -1
  12. package/package.json +13 -13
  13. package/src/maps/layers/bing-map.d.ts +2 -2
  14. package/src/maps/layers/bubble.d.ts +3 -4
  15. package/src/maps/layers/bubble.js +3 -4
  16. package/src/maps/layers/color-mapping.d.ts +2 -2
  17. package/src/maps/layers/color-mapping.js +2 -2
  18. package/src/maps/layers/data-label.d.ts +1 -1
  19. package/src/maps/layers/data-label.js +6 -6
  20. package/src/maps/layers/layer-panel.d.ts +7 -7
  21. package/src/maps/layers/layer-panel.js +129 -193
  22. package/src/maps/layers/legend.d.ts +9 -0
  23. package/src/maps/layers/legend.js +147 -55
  24. package/src/maps/layers/marker.d.ts +8 -8
  25. package/src/maps/layers/marker.js +109 -105
  26. package/src/maps/layers/navigation-selected-line.d.ts +1 -1
  27. package/src/maps/layers/navigation-selected-line.js +2 -2
  28. package/src/maps/layers/polygon.d.ts +1 -1
  29. package/src/maps/layers/polygon.js +10 -7
  30. package/src/maps/maps.d.ts +24 -26
  31. package/src/maps/maps.js +39 -46
  32. package/src/maps/model/base-model.d.ts +20 -93
  33. package/src/maps/model/base.d.ts +19 -83
  34. package/src/maps/model/base.js +13 -40
  35. package/src/maps/model/constants.d.ts +0 -4
  36. package/src/maps/model/constants.js +0 -4
  37. package/src/maps/model/export-image.js +5 -2
  38. package/src/maps/model/export-pdf.js +5 -2
  39. package/src/maps/model/interface.d.ts +14 -1
  40. package/src/maps/model/interface.js +0 -1
  41. package/src/maps/model/print.d.ts +3 -3
  42. package/src/maps/model/print.js +8 -5
  43. package/src/maps/model/theme.d.ts +1 -1
  44. package/src/maps/model/theme.js +190 -15
  45. package/src/maps/user-interaction/annotation.d.ts +1 -2
  46. package/src/maps/user-interaction/annotation.js +1 -2
  47. package/src/maps/user-interaction/highlight.d.ts +4 -4
  48. package/src/maps/user-interaction/highlight.js +4 -4
  49. package/src/maps/user-interaction/selection.d.ts +5 -5
  50. package/src/maps/user-interaction/selection.js +5 -5
  51. package/src/maps/user-interaction/tooltip.d.ts +6 -6
  52. package/src/maps/user-interaction/tooltip.js +30 -13
  53. package/src/maps/user-interaction/zoom.d.ts +6 -4
  54. package/src/maps/user-interaction/zoom.js +50 -50
  55. package/src/maps/utils/enum.d.ts +7 -53
  56. package/src/maps/utils/helper.d.ts +87 -72
  57. package/src/maps/utils/helper.js +130 -102
  58. package/CHANGELOG.md +0 -632
@@ -1,7 +1,7 @@
1
1
  /* eslint-disable no-case-declarations */
2
2
  import { isNullOrUndefined, extend, createElement, Fetch, animationMode } from '@syncfusion/ej2-base';
3
3
  import { getShapeColor } from '../model/theme';
4
- import { GeoLocation, isCustomPath, convertGeoToPoint, Point, PathOption, Size, removeElement } from '../utils/helper';
4
+ import { GeoLocation, isCustomPath, convertGeoToPoint, Point, PathOption, Size, removeElement, maintainToggleSelection } from '../utils/helper';
5
5
  import { getElementByID, maintainSelection, getValueFromObject } from '../utils/helper';
6
6
  import { RectOption, getTranslate, convertTileLatLongToPoint, checkShapeDataFields, CircleOption } from '../utils/helper';
7
7
  import { getZoomTranslate, fixInitialScaleForTile } from '../utils/helper';
@@ -43,19 +43,10 @@ var LayerPanel = /** @class */ (function () {
43
43
  id: this.mapObject.element.id + '_Layer_Collections',
44
44
  'clip-path': 'url(#' + this.mapObject.element.id + '_MapArea_ClipRect)'
45
45
  }));
46
- if (this.mapObject.layers[this.mapObject.baseLayerIndex].layerType === 'GoogleStaticMap') {
47
- var staticMapSize = 640;
48
- this.clipRectElement = this.mapObject.renderer.drawClipPath(new RectOption(this.mapObject.element.id + '_MapArea_ClipRect', 'transparent', { width: 1, color: 'Gray' }, 1, {
49
- x: ((areaRect.width - staticMapSize) / 2), y: 0,
50
- width: staticMapSize, height: areaRect.height
51
- }));
52
- }
53
- else {
54
- this.clipRectElement = this.mapObject.renderer.drawClipPath(new RectOption(this.mapObject.element.id + '_MapArea_ClipRect', 'transparent', { width: 1, color: 'Gray' }, 1, {
55
- x: this.mapObject.isTileMap ? 0 : areaRect.x, y: this.mapObject.isTileMap ? 0 : areaRect.y,
56
- width: areaRect.width, height: areaRect.height
57
- }));
58
- }
46
+ this.clipRectElement = this.mapObject.renderer.drawClipPath(new RectOption(this.mapObject.element.id + '_MapArea_ClipRect', 'transparent', { width: 1, color: 'Gray' }, 1, {
47
+ x: this.mapObject.isTileMap ? 0 : areaRect.x, y: this.mapObject.isTileMap ? 0 : areaRect.y,
48
+ width: areaRect.width, height: areaRect.height
49
+ }));
59
50
  this.layerGroup.appendChild(this.clipRectElement);
60
51
  this.mapObject.baseMapBounds = null;
61
52
  this.mapObject.baseMapRectBounds = null;
@@ -189,8 +180,7 @@ var LayerPanel = /** @class */ (function () {
189
180
  && this.mapObject.availableSize.height > 512) {
190
181
  this.mapObject.applyZoomReset = true;
191
182
  this.mapObject.initialZoomLevel = Math.floor(this.mapObject.availableSize.height / 512);
192
- var padding = this.mapObject.layers[this.mapObject.baseLayerIndex].layerType !== 'GoogleStaticMap' ?
193
- 20 : 0;
183
+ var padding = 20;
194
184
  var totalSize = Math.pow(2, this.mapObject.initialZoomLevel) * 256;
195
185
  if (!isNullOrUndefined(this.mapObject.initialTileTranslate)) {
196
186
  this.mapObject.initialTileTranslate.x = (this.mapObject.availableSize.width / 2) - (totalSize / 2);
@@ -248,55 +238,13 @@ var LayerPanel = /** @class */ (function () {
248
238
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
249
239
  this.mapObject.trigger('layerRendering', eventArgs, function (observedArgs) {
250
240
  if (!eventArgs.cancel && eventArgs.visible) {
251
- if (layer.layerType === 'OSM') {
252
- layer.urlTemplate = 'https://a.tile.openstreetmap.org/level/tileX/tileY.png';
253
- }
254
- if (layer.layerType === 'Google') {
255
- layer.urlTemplate = 'https://mt1.google.com/vt/lyrs=m@129&hl=en&x=tileX&y=tileY&z=level';
256
- }
257
- if (layer.layerType !== 'Geometry' || (isNullOrUndefined(layer.shapeData) && !isNullOrUndefined(layer.urlTemplate) && layer.urlTemplate !== '')) {
258
- if (layer.layerType !== 'Bing' || _this.bing) {
259
- if (!isNullOrUndefined(layer.urlTemplate) && layer.urlTemplate.indexOf('quadkey') > -1) {
260
- var bing = new BingMap(_this.mapObject);
261
- _this.bingMapCalculation(layer, layerIndex, _this, bing);
262
- }
263
- else {
264
- _this.renderTileLayer(_this, layer, layerIndex);
265
- }
241
+ if ((isNullOrUndefined(layer.shapeData) && !isNullOrUndefined(layer.urlTemplate) && layer.urlTemplate !== '')) {
242
+ if (!isNullOrUndefined(layer.urlTemplate) && layer.urlTemplate.indexOf('quadkey') > -1) {
243
+ var bing = new BingMap(_this.mapObject);
244
+ _this.bingMapCalculation(layer, layerIndex, _this, bing);
266
245
  }
267
- else if (layer.key && layer.key.length > 1) {
268
- // eslint-disable-next-line @typescript-eslint/no-this-alias
269
- var proxy_1 = _this;
270
- var bing_1 = new BingMap(_this.mapObject);
271
- var bingType = layer.bingMapType === 'AerialWithLabel' ? 'AerialWithLabelsOnDemand' : layer.bingMapType;
272
- var url = 'https://dev.virtualearth.net/REST/V1/Imagery/Metadata/' + bingType;
273
- var ajax = new Fetch({
274
- url: url + '?output=json&include=ImageryProviders&urischeme=https&key=' + layer.key
275
- });
276
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
277
- ajax.onSuccess = function (json) {
278
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
279
- var resource = json['resourceSets'][0]['resources'][0];
280
- var imageUrl = resource['imageUrl'];
281
- var subDomains = resource['imageUrlSubdomains'];
282
- var maxZoom = resource['zoomMax'];
283
- if (imageUrl !== null && imageUrl !== undefined && imageUrl !== bing_1.imageUrl) {
284
- bing_1.imageUrl = imageUrl;
285
- }
286
- if (subDomains !== null && subDomains !== undefined && subDomains !== bing_1.subDomains) {
287
- bing_1.subDomains = subDomains;
288
- }
289
- if (maxZoom !== null && maxZoom !== undefined && maxZoom !== bing_1.maxZoom) {
290
- bing_1.maxZoom = maxZoom;
291
- }
292
- proxy_1.mapObject['bingMap'] = bing_1;
293
- proxy_1.renderTileLayer(proxy_1, layer, layerIndex, bing_1);
294
- _this.mapObject.arrangeTemplate();
295
- if (_this.mapObject.zoomModule && (_this.mapObject.previousScale !== _this.mapObject.scale)) {
296
- _this.mapObject.zoomModule.applyTransform(_this.mapObject, true);
297
- }
298
- };
299
- ajax.send();
246
+ else {
247
+ _this.renderTileLayer(_this, layer, layerIndex);
300
248
  }
301
249
  }
302
250
  else {
@@ -404,7 +352,7 @@ var LayerPanel = /** @class */ (function () {
404
352
  var _loop_1 = function (i) {
405
353
  var k = void 0;
406
354
  var borderValue = {
407
- color: shapeSettings.border.color,
355
+ color: shapeSettings.border.color || this_1.mapObject.themeStyle.shapeBorderColor,
408
356
  width: shapeSettings.border.width,
409
357
  opacity: shapeSettings.border.opacity
410
358
  };
@@ -469,21 +417,20 @@ var LayerPanel = /** @class */ (function () {
469
417
  if (!eventArgs.cancel) {
470
418
  eventArgs.fill = eventArgs.fill === '#A6A6A6' ? eventArgs.shape.fill ||
471
419
  _this.mapObject.themeStyle.shapeFill : eventArgs.fill;
472
- eventArgs.border.color = eventArgs.border.color === '#000000' ?
420
+ eventArgs.border.color = eventArgs.border.color === 'transparent' ?
473
421
  eventArgs.shape.border.color : eventArgs.border.color;
474
422
  eventArgs.border.width = eventArgs.border.width === 0 ? eventArgs.shape.border.width : eventArgs.border.width;
475
423
  if (isNullOrUndefined(shapeSettings.borderColorValuePath)) {
476
- _this.mapObject.layers[layerIndex].shapeSettings.border.color = eventArgs.border.color;
424
+ borderValue.color = eventArgs.border.color;
477
425
  }
478
426
  if (isNullOrUndefined(shapeSettings.borderWidthValuePath)) {
479
- _this.mapObject.layers[layerIndex].shapeSettings.border.width = eventArgs.border.width;
427
+ borderValue.width = eventArgs.border.width;
480
428
  }
481
429
  }
482
430
  else {
483
431
  eventArgs.fill = fill;
484
- eventArgs.border.color = shapeSettings.border.color;
432
+ eventArgs.border.color = shapeSettings.border.color || _this.mapObject.themeStyle.shapeBorderColor;
485
433
  eventArgs.border.width = shapeSettings.border.width;
486
- _this.mapObject.layers[layerIndex].shapeSettings.border = shapeSettings.border;
487
434
  }
488
435
  eventArgs.border.opacity = isNullOrUndefined(eventArgs.border.opacity) ? opacity : eventArgs.border.opacity;
489
436
  if (_this.groupElements.length < 1) {
@@ -643,18 +590,9 @@ var LayerPanel = /** @class */ (function () {
643
590
  pathEle.style.cssText = 'outline:none';
644
591
  }
645
592
  maintainSelection(this.mapObject.selectedElementId, this.mapObject.shapeSelectionClass, pathEle, 'ShapeselectionMapStyle');
646
- if (this.mapObject.toggledShapeElementId) {
647
- for (var j = 0; j < this.mapObject.toggledShapeElementId.length; j++) {
648
- var styleProperty = this.mapObject.legendSettings.toggleLegendSettings.applyShapeSettings ?
649
- this.currentLayer.shapeSettings : this.mapObject.legendSettings.toggleLegendSettings;
650
- if (this.mapObject.toggledShapeElementId[j] === pathEle.id) {
651
- pathEle.setAttribute('fill', styleProperty.fill);
652
- pathEle.setAttribute('stroke', styleProperty.border.color);
653
- pathEle.setAttribute('fill-opacity', (styleProperty.opacity).toString());
654
- pathEle.setAttribute('stroke-opacity', (isNullOrUndefined(styleProperty.border.opacity) ? styleProperty.opacity : styleProperty.border.opacity).toString());
655
- pathEle.setAttribute('stroke-width', (isNullOrUndefined(styleProperty.border.width) ? 0 : styleProperty.border.width).toString());
656
- }
657
- }
593
+ if (this.mapObject.legendSettings.toggleLegendSettings.enable && this.mapObject.legendSettings.type === 'Layers') {
594
+ maintainToggleSelection(this.mapObject.toggledElementId, pathEle, this.mapObject.legendSettings.toggleLegendSettings.applyShapeSettings ? this.currentLayer.shapeSettings
595
+ : this.mapObject.legendSettings.toggleLegendSettings);
658
596
  }
659
597
  groupElement.appendChild(pathEle);
660
598
  };
@@ -689,10 +627,12 @@ var LayerPanel = /** @class */ (function () {
689
627
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
690
628
  var bubbleDataSource = bubble_1.dataSource;
691
629
  this_2.mapObject.bubbleModule.bubbleCollection = [];
692
- bubbleDataSource.map(function (bubbleData, i) {
693
- _this.renderBubble(_this.currentLayer, bubbleData, colors[i % colors.length], range, j, i, bubbleG, layerIndex, bubble_1);
694
- });
695
- this_2.groupElements.push(bubbleG);
630
+ if (!isNullOrUndefined(bubbleDataSource) && bubbleDataSource.length > 0) {
631
+ bubbleDataSource.map(function (bubbleData, i) {
632
+ _this.renderBubble(_this.currentLayer, bubbleData, colors[i % colors.length], range, j, i, bubbleG, layerIndex, bubble_1);
633
+ });
634
+ this_2.groupElements.push(bubbleG);
635
+ }
696
636
  };
697
637
  var this_2 = this;
698
638
  for (var j = 0; j < length_1; j++) {
@@ -718,9 +658,13 @@ var LayerPanel = /** @class */ (function () {
718
658
  if (this.mapObject.navigationLineModule) {
719
659
  this.groupElements.push(this.mapObject.navigationLineModule.renderNavigation(this.currentLayer, this.currentFactor, layerIndex));
720
660
  }
721
- this.groupElements.map(function (element) {
722
- _this.layerObject.appendChild(element);
723
- });
661
+ if (!isNullOrUndefined(this.groupElements) && !isNullOrUndefined(this.layerObject)) {
662
+ this.groupElements.map(function (element) {
663
+ if (!isNullOrUndefined(element)) {
664
+ _this.layerObject.appendChild(element);
665
+ }
666
+ });
667
+ }
724
668
  if (this.mapObject.markerModule) {
725
669
  this.mapObject.markerModule.markerRender(this.mapObject, this.layerObject, layerIndex, (this.mapObject.isTileMap ? Math.floor(this.currentFactor) :
726
670
  this.currentFactor), null);
@@ -729,7 +673,7 @@ var LayerPanel = /** @class */ (function () {
729
673
  this.layerGroup.appendChild(this.layerObject);
730
674
  };
731
675
  /**
732
- * render datalabel
676
+ * render datalabel.
733
677
  *
734
678
  * @param {LayerSettings} layer - Specifies the layer
735
679
  * @param {number} layerIndex - Specifies the layer index
@@ -746,7 +690,7 @@ var LayerPanel = /** @class */ (function () {
746
690
  this.mapObject.dataLabelModule.renderLabel(layer, layerIndex, shape, layer.layerData, group, labelTemplateEle, shapeIndex, intersect);
747
691
  };
748
692
  /**
749
- * To render path for multipolygon
693
+ * To render path for multipolygon.
750
694
  *
751
695
  * @param {any[]} currentShapeData Specifies the current shape data
752
696
  * @returns {string} Returns the path
@@ -768,7 +712,7 @@ var LayerPanel = /** @class */ (function () {
768
712
  return path;
769
713
  };
770
714
  /**
771
- * To render bubble
715
+ * To render bubble.
772
716
  *
773
717
  * @param {LayerSettings} layer - Specifies the layer
774
718
  * @param {object} bubbleData - Specifies the bubble data
@@ -795,7 +739,7 @@ var LayerPanel = /** @class */ (function () {
795
739
  this.mapObject.bubbleModule.renderBubble(bubbleSettings, bubbleData, color, range, bubbleIndex, dataIndex, layerIndex, layer, group, this.mapObject.bubbleModule.id);
796
740
  };
797
741
  /**
798
- * To get the shape color from color mapping module
742
+ * To get the shape color from color mapping module.
799
743
  *
800
744
  * @param {LayerSettingsModel} layer - Specifies the layer
801
745
  * @param {any} shape - Specifies the shape
@@ -811,7 +755,7 @@ var LayerPanel = /** @class */ (function () {
811
755
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
812
756
  var index = checkShapeDataFields(layer.dataSource, shape, layer.shapeDataPath, layer.shapePropertyPath, layer);
813
757
  var colorMapping = new ColorMapping(this.mapObject);
814
- if (isNullOrUndefined(layer.dataSource[index])) {
758
+ if (isNullOrUndefined(layer.dataSource) || isNullOrUndefined(layer.dataSource[index])) {
815
759
  return color;
816
760
  }
817
761
  return colorMapping.getShapeColorMapping(layer.shapeSettings, layer.dataSource[index], color);
@@ -1192,9 +1136,8 @@ var LayerPanel = /** @class */ (function () {
1192
1136
  var tile = new Tile(tileI % ycount, j);
1193
1137
  tile.left = Math.round(x);
1194
1138
  tile.top = Math.round(y);
1195
- if (baseLayer.layerType === 'Bing' || (bing && !isNullOrUndefined(baseLayer.urlTemplate) && baseLayer.urlTemplate !== '')) {
1196
- var key = baseLayer.key;
1197
- tile.src = bing.getBingMap(tile, key, baseLayer.bingMapType, userLang, bing.imageUrl, bing.subDomains);
1139
+ if ((bing && !isNullOrUndefined(baseLayer.urlTemplate) && baseLayer.urlTemplate !== '')) {
1140
+ tile.src = bing.getBingMap(tile, '', '', userLang, bing.imageUrl, bing.subDomains);
1198
1141
  }
1199
1142
  else {
1200
1143
  tile.src = this.urlTemplate.replace('level', zoomLevel.toString()).replace('tileX', tile.x.toString())
@@ -1221,14 +1164,13 @@ var LayerPanel = /** @class */ (function () {
1221
1164
  if (!(layer.type === 'SubLayer' && layer.visible)) {
1222
1165
  continue;
1223
1166
  }
1224
- if ((layer.layerType !== 'Geometry' && layer.layerType !== 'GoogleStaticMap') || (layer.layerType === 'Geometry' &&
1225
- isNullOrUndefined(layer.shapeData) && !isNullOrUndefined(layer.urlTemplate) && layer.urlTemplate !== '')) {
1167
+ if (isNullOrUndefined(layer.shapeData) && !isNullOrUndefined(layer.urlTemplate) && layer.urlTemplate !== '') {
1226
1168
  for (var _b = 0, proxTiles_1 = proxTiles; _b < proxTiles_1.length; _b++) {
1227
1169
  var baseTile = proxTiles_1[_b];
1228
1170
  var subtile = extend({}, baseTile, {}, true);
1229
- if (layer.layerType === 'Bing') {
1171
+ if (layer.urlTemplate.indexOf('quadkey')) {
1230
1172
  bing = new BingMap(this.mapObject);
1231
- subtile.src = bing.getBingMap(subtile, layer.key, layer.bingMapType, userLang, bing.imageUrl, bing.subDomains);
1173
+ subtile.src = bing.getBingMap(subtile, '', '', userLang, bing.imageUrl, bing.subDomains);
1232
1174
  }
1233
1175
  else {
1234
1176
  subtile.src = layer.urlTemplate.replace('level', zoomLevel.toString()).replace('tileX', baseTile.x.toString())
@@ -1256,114 +1198,109 @@ var LayerPanel = /** @class */ (function () {
1256
1198
  else {
1257
1199
  timeOut = 0;
1258
1200
  }
1259
- if (this.mapObject.layers[this.mapObject.baseLayerIndex].layerType === 'GoogleStaticMap') {
1260
- this.renderGoogleMap(this.mapObject.layers[0].key, this.mapObject.staticMapZoom);
1261
- }
1262
- else {
1263
- setTimeout(function () {
1264
- if (element) {
1265
- element.style.zIndex = '1';
1266
- }
1267
- if (element1) {
1268
- element1.style.zIndex = '0';
1269
- }
1270
- var animateElement;
1271
- if (!document.getElementById(_this.mapObject.element.id + '_animated_tiles') && element) {
1201
+ setTimeout(function () {
1202
+ if (element) {
1203
+ element.style.zIndex = '1';
1204
+ }
1205
+ if (element1) {
1206
+ element1.style.zIndex = '0';
1207
+ }
1208
+ var animateElement;
1209
+ if (!document.getElementById(_this.mapObject.element.id + '_animated_tiles') && element) {
1210
+ animateElement = createElement('div', { id: _this.mapObject.element.id + '_animated_tiles' });
1211
+ element.appendChild(animateElement);
1212
+ }
1213
+ else {
1214
+ if (type !== 'Pan' && element1 && element) {
1215
+ element1.appendChild(element.children[0]);
1216
+ if (!_this.mapObject.isAddLayer && !isNullOrUndefined(document.getElementById(_this.mapObject.element.id + '_animated_tiles'))) {
1217
+ document.getElementById(_this.mapObject.element.id + '_animated_tiles').id =
1218
+ _this.mapObject.element.id + '_animated_tiles_old';
1219
+ }
1272
1220
  animateElement = createElement('div', { id: _this.mapObject.element.id + '_animated_tiles' });
1273
1221
  element.appendChild(animateElement);
1274
1222
  }
1275
1223
  else {
1276
- if (type !== 'Pan' && element1 && element) {
1277
- element1.appendChild(element.children[0]);
1278
- if (!_this.mapObject.isAddLayer && !isNullOrUndefined(document.getElementById(_this.mapObject.element.id + '_animated_tiles'))) {
1279
- document.getElementById(_this.mapObject.element.id + '_animated_tiles').id =
1280
- _this.mapObject.element.id + '_animated_tiles_old';
1281
- }
1282
- animateElement = createElement('div', { id: _this.mapObject.element.id + '_animated_tiles' });
1283
- element.appendChild(animateElement);
1224
+ animateElement = element ? element.children[0] : null;
1225
+ }
1226
+ }
1227
+ for (var id = 0; id < _this.tiles.length; id++) {
1228
+ var tile = _this.tiles[id];
1229
+ var imgElement = null;
1230
+ var mapId = _this.mapObject.element.id;
1231
+ if (type === 'Pan') {
1232
+ var child = document.getElementById(mapId + '_tile_' + id);
1233
+ var isNewTile = false;
1234
+ if (isNullOrUndefined(child)) {
1235
+ isNewTile = true;
1236
+ child = createElement('div', { id: mapId + '_tile_' + id });
1237
+ imgElement = createElement('img');
1284
1238
  }
1285
1239
  else {
1286
- animateElement = element ? element.children[0] : null;
1240
+ child.style.removeProperty('display');
1241
+ imgElement = child.children[0];
1287
1242
  }
1288
- }
1289
- for (var id = 0; id < _this.tiles.length; id++) {
1290
- var tile = _this.tiles[id];
1291
- var imgElement = null;
1292
- var mapId = _this.mapObject.element.id;
1293
- if (type === 'Pan') {
1294
- var child = document.getElementById(mapId + '_tile_' + id);
1295
- var isNewTile = false;
1296
- if (isNullOrUndefined(child)) {
1297
- isNewTile = true;
1298
- child = createElement('div', { id: mapId + '_tile_' + id });
1299
- imgElement = createElement('img');
1300
- }
1301
- else {
1302
- child.style.removeProperty('display');
1303
- imgElement = child.children[0];
1304
- }
1305
- if (!isNewTile && imgElement && imgElement.src !== tile.src) {
1306
- imgElement.src = tile.src;
1307
- }
1308
- child.style.position = 'absolute';
1309
- child.style.left = tile.left + 'px';
1310
- child.style.top = tile.top + 'px';
1311
- child.style.height = tile.height + 'px';
1312
- child.style.width = tile.width + 'px';
1313
- if (isNewTile) {
1314
- imgElement.setAttribute('height', '256px');
1315
- imgElement.setAttribute('width', '256px');
1316
- imgElement.setAttribute('src', tile.src);
1317
- imgElement.setAttribute('alt', _this.mapObject.getLocalizedLabel('ImageNotFound'));
1318
- imgElement.style.setProperty('user-select', 'none');
1319
- child.appendChild(imgElement);
1320
- animateElement.appendChild(child);
1321
- }
1243
+ if (!isNewTile && imgElement && imgElement.src !== tile.src) {
1244
+ imgElement.src = tile.src;
1322
1245
  }
1323
- else {
1324
- imgElement = createElement('img');
1246
+ child.style.position = 'absolute';
1247
+ child.style.left = tile.left + 'px';
1248
+ child.style.top = tile.top + 'px';
1249
+ child.style.height = tile.height + 'px';
1250
+ child.style.width = tile.width + 'px';
1251
+ if (isNewTile) {
1325
1252
  imgElement.setAttribute('height', '256px');
1326
1253
  imgElement.setAttribute('width', '256px');
1327
1254
  imgElement.setAttribute('src', tile.src);
1328
- imgElement.style.setProperty('user-select', 'none');
1329
1255
  imgElement.setAttribute('alt', _this.mapObject.getLocalizedLabel('ImageNotFound'));
1330
- var child = createElement('div', { id: mapId + '_tile_' + id });
1331
- child.style.position = 'absolute';
1332
- child.style.left = tile.left + 'px';
1333
- child.style.top = tile.top + 'px';
1334
- child.style.height = tile.height + 'px';
1335
- child.style.width = tile.width + 'px';
1256
+ imgElement.style.setProperty('user-select', 'none');
1336
1257
  child.appendChild(imgElement);
1337
- if (animateElement) {
1338
- animateElement.appendChild(child);
1339
- }
1258
+ animateElement.appendChild(child);
1340
1259
  }
1341
- if (id === (_this.tiles.length - 1) && document.getElementById(_this.mapObject.element.id + '_animated_tiles_old')) {
1342
- removeElement(_this.mapObject.element.id + '_animated_tiles_old');
1260
+ }
1261
+ else {
1262
+ imgElement = createElement('img');
1263
+ imgElement.setAttribute('height', '256px');
1264
+ imgElement.setAttribute('width', '256px');
1265
+ imgElement.setAttribute('src', tile.src);
1266
+ imgElement.style.setProperty('user-select', 'none');
1267
+ imgElement.setAttribute('alt', _this.mapObject.getLocalizedLabel('ImageNotFound'));
1268
+ var child = createElement('div', { id: mapId + '_tile_' + id });
1269
+ child.style.position = 'absolute';
1270
+ child.style.left = tile.left + 'px';
1271
+ child.style.top = tile.top + 'px';
1272
+ child.style.height = tile.height + 'px';
1273
+ child.style.width = tile.width + 'px';
1274
+ child.appendChild(imgElement);
1275
+ if (animateElement) {
1276
+ animateElement.appendChild(child);
1343
1277
  }
1344
1278
  }
1345
- if (!isNullOrUndefined(_this.mapObject.currentTiles)) {
1346
- for (var l = _this.tiles.length; l < animateElement.childElementCount; l++) {
1347
- var isExistingElement = false;
1348
- for (var a = 0; a < _this.mapObject.currentTiles.childElementCount; a++) {
1349
- if (!isExistingElement &&
1350
- _this.mapObject.currentTiles.children[a].id === animateElement.children[l].id) {
1351
- isExistingElement = true;
1352
- }
1353
- }
1354
- if (isExistingElement) {
1355
- animateElement.children[l].style.display = 'none';
1356
- }
1357
- else {
1358
- animateElement.removeChild(animateElement.children[l]);
1279
+ if (id === (_this.tiles.length - 1) && document.getElementById(_this.mapObject.element.id + '_animated_tiles_old')) {
1280
+ removeElement(_this.mapObject.element.id + '_animated_tiles_old');
1281
+ }
1282
+ }
1283
+ if (!isNullOrUndefined(_this.mapObject.currentTiles)) {
1284
+ for (var l = _this.tiles.length; l < animateElement.childElementCount; l++) {
1285
+ var isExistingElement = false;
1286
+ for (var a = 0; a < _this.mapObject.currentTiles.childElementCount; a++) {
1287
+ if (!isExistingElement &&
1288
+ _this.mapObject.currentTiles.children[a].id === animateElement.children[l].id) {
1289
+ isExistingElement = true;
1359
1290
  }
1360
1291
  }
1292
+ if (isExistingElement) {
1293
+ animateElement.children[l].style.display = 'none';
1294
+ }
1295
+ else {
1296
+ animateElement.removeChild(animateElement.children[l]);
1297
+ }
1361
1298
  }
1362
- }, timeOut);
1363
- }
1299
+ }
1300
+ }, timeOut);
1364
1301
  };
1365
1302
  /**
1366
- * Animation for tile layers and hide the group element until the tile layer rendering
1303
+ * Animation for tile layers and hide the group element until the tile layer rendering.
1367
1304
  *
1368
1305
  * @param {string} zoomType - Specifies the zoom type
1369
1306
  * @param {number} translateX - Specifies the x translate point
@@ -1392,7 +1329,7 @@ var LayerPanel = /** @class */ (function () {
1392
1329
  }
1393
1330
  };
1394
1331
  /**
1395
- * Static map rendering
1332
+ * Static map rendering.
1396
1333
  *
1397
1334
  * @param {string} apikey - Specifies the api key
1398
1335
  * @param {number} zoom - Specifies the zoom value
@@ -1435,7 +1372,7 @@ var LayerPanel = /** @class */ (function () {
1435
1372
  var eleWidth = mapWidth > 640 ? (mapWidth - 640) / 2 : 0;
1436
1373
  var eleHeight = mapHeight > 640 ? (mapHeight - 640) / 2 : 0;
1437
1374
  var center;
1438
- var mapType = (map.layers[map.layers.length - 1].staticMapType).toString().toLowerCase();
1375
+ var mapType = 'roadmap';
1439
1376
  if (map.centerPosition.latitude && map.centerPosition.longitude) {
1440
1377
  center = map.centerPosition.latitude.toString() + ',' + map.centerPosition.longitude.toString();
1441
1378
  }
@@ -1449,7 +1386,7 @@ var LayerPanel = /** @class */ (function () {
1449
1386
  + eleHeight + 'px"><img src="' + staticMapString + '"' + 'alt="' + this.mapObject.getLocalizedLabel('ImageNotFound') + '"></div>';
1450
1387
  };
1451
1388
  /**
1452
- * To find the tile translate point
1389
+ * To find the tile translate point.
1453
1390
  *
1454
1391
  * @param {number} factorX - Specifies the x factor
1455
1392
  * @param {number} factorY - Specifies the x factor
@@ -1461,8 +1398,7 @@ var LayerPanel = /** @class */ (function () {
1461
1398
  this.mapObject.tileZoomLevel = this.mapObject.tileZoomScale;
1462
1399
  }
1463
1400
  var level = this.mapObject.tileZoomLevel;
1464
- var padding = this.mapObject.layers[this.mapObject.layers.length - 1].layerType !== 'GoogleStaticMap' ?
1465
- 20 : 0;
1401
+ var padding = 20;
1466
1402
  var x;
1467
1403
  var y;
1468
1404
  var totalSize = Math.pow(2, level) * 256;
@@ -42,6 +42,7 @@ export declare class Legend {
42
42
  private heightIncrement;
43
43
  private widthIncrement;
44
44
  private textMaxWidth;
45
+ private arrowTimer;
45
46
  /**
46
47
  * @private
47
48
  */
@@ -110,6 +111,14 @@ export declare class Legend {
110
111
  * @private
111
112
  */
112
113
  drawLegendItem(page: number): void;
114
+ /**
115
+ * @param {number} legendIndex - Specifies the legend index.
116
+ * @param {Element} legendShapeElement - Specifies the legend shape element.
117
+ * @param {Element} legendTextElement - Specifies the legend text element.
118
+ * @returns {void}
119
+ * @private
120
+ */
121
+ maintainLegendToggle(legendIndex: number, legendShapeElement: Element, legendTextElement: Element): void;
113
122
  legendHighLightAndSelection(targetElement: Element, value: string): void;
114
123
  private setColor;
115
124
  pushCollection(targetElement: Element, collection: any[], oldElement: object, shapeSettings: ShapeSettings): void;