@syncfusion/ej2-maps 25.2.5 → 26.1.41

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.
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 25.2.5
3
+ * version : 26.1.41
4
4
  * Copyright Syncfusion Inc. 2001 - 2023. All rights reserved.
5
5
  * Use of this code is subject to the terms of our license.
6
6
  * A copy of the current license can be obtained at any time by e-mailing
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "_from": "@syncfusion/ej2-maps@*",
3
- "_id": "@syncfusion/ej2-maps@25.2.4",
3
+ "_id": "@syncfusion/ej2-maps@26.1.35",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-ou/s4tco99cxQJFBGlZthR96dOnuc+4td4nf+N4JO+WjxIWVvW0gCWi1ZjY6UEICS+9/lCcoRMDKMBQmBQ3r1Q==",
5
+ "_integrity": "sha512-htJ3uDy7RsWCbLiAszuzXs1QUbFy5I3cZR1Nb/rCqImvXf3LWWbDamZYfvc+pQdWUEKwYBGOklWh6seVIE+dEg==",
6
6
  "_location": "/@syncfusion/ej2-maps",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -23,10 +23,10 @@
23
23
  "/@syncfusion/ej2-react-maps",
24
24
  "/@syncfusion/ej2-vue-maps"
25
25
  ],
26
- "_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-maps/-/ej2-maps-25.2.4.tgz",
27
- "_shasum": "86b6edff8a231ab6d079e6d9a9e486faa4dbd315",
26
+ "_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-maps/-/ej2-maps-26.1.35.tgz",
27
+ "_shasum": "5217ebc749b42700d49ec500b54655aedd20370f",
28
28
  "_spec": "@syncfusion/ej2-maps@*",
29
- "_where": "/jenkins/workspace/elease-automation_release_25.1.1/packages/included",
29
+ "_where": "/jenkins/workspace/elease-automation_release_26.1.1/packages/included",
30
30
  "author": {
31
31
  "name": "Syncfusion Inc."
32
32
  },
@@ -35,13 +35,13 @@
35
35
  },
36
36
  "bundleDependencies": false,
37
37
  "dependencies": {
38
- "@syncfusion/ej2-base": "~25.2.5",
39
- "@syncfusion/ej2-buttons": "~25.2.4",
40
- "@syncfusion/ej2-compression": "~25.2.3",
41
- "@syncfusion/ej2-data": "~25.2.3",
42
- "@syncfusion/ej2-file-utils": "~25.2.3",
43
- "@syncfusion/ej2-pdf-export": "~25.2.3",
44
- "@syncfusion/ej2-svg-base": "~25.2.5"
38
+ "@syncfusion/ej2-base": "~26.1.37",
39
+ "@syncfusion/ej2-buttons": "~26.1.40",
40
+ "@syncfusion/ej2-compression": "~26.1.35",
41
+ "@syncfusion/ej2-data": "~26.1.41",
42
+ "@syncfusion/ej2-file-utils": "~26.1.35",
43
+ "@syncfusion/ej2-pdf-export": "~26.1.35",
44
+ "@syncfusion/ej2-svg-base": "~26.1.39"
45
45
  },
46
46
  "deprecated": false,
47
47
  "description": "The Maps component is used to visualize the geographical data and represent the statistical data of a particular geographical area on earth with user interactivity, and provides various customizing options",
@@ -93,6 +93,6 @@
93
93
  "url": "git+https://github.com/syncfusion/ej2-javascript-ui-controls.git"
94
94
  },
95
95
  "typings": "index.d.ts",
96
- "version": "25.2.5",
96
+ "version": "26.1.41",
97
97
  "sideEffects": false
98
98
  }
@@ -1,5 +1,5 @@
1
1
  import { Maps } from '../maps';
2
- import { Tile, BingMapType } from '../index';
2
+ import { Tile } from '../index';
3
3
  /**
4
4
  * Bing map src doc
5
5
  */
@@ -12,7 +12,7 @@ export declare class BingMap {
12
12
  imageUrl: string;
13
13
  maxZoom: string;
14
14
  constructor(maps: Maps);
15
- getBingMap(tile: Tile, key: string, type: BingMapType, language: string, imageUrl: string, subDomains: string[]): string;
15
+ getBingMap(tile: Tile, key: string, type: string, language: string, imageUrl: string, subDomains: string[]): string;
16
16
  /**
17
17
  * @returns {void}
18
18
  * @private
@@ -1,7 +1,6 @@
1
1
  import { findMidPointOfPolygon, Rect, filter, getTemplateFunction, getZoomTranslate, getTranslate, RectOption, convertElementFromLabel, Point, TextOption, renderTextElement, textTrim, Internalize, measureTextElement } from '../utils/helper';
2
2
  import { isNullOrUndefined, Animation, animationMode } from '@syncfusion/ej2-base';
3
3
  import { dataLabelRendering } from '../model/constants';
4
- import { Theme } from '../model/theme';
5
4
  /**
6
5
  * DataLabel Module used to render the maps datalabel
7
6
  */
@@ -17,7 +16,7 @@ var DataLabel = /** @class */ (function () {
17
16
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
18
17
  var text;
19
18
  var shapeNameValue;
20
- for (var i = 0; i < dataSource.length; i++) {
19
+ for (var i = 0; i < (isNullOrUndefined(dataSource) ? 0 : dataSource.length); i++) {
21
20
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
22
21
  var data = dataSource[i];
23
22
  var dataShapePathValue = !isNullOrUndefined(data[shapeDataPath]) && isNaN(data[shapeDataPath]) &&
@@ -80,7 +79,8 @@ var DataLabel = /** @class */ (function () {
80
79
  var locationX;
81
80
  var locationY;
82
81
  style.fontFamily = this.maps.theme.toLowerCase() !== 'material' ? this.maps.themeStyle.labelFontFamily : style.fontFamily;
83
- style.fontWeight = style.fontWeight || this.maps.themeStyle.fontWeight || Theme.dataLabelFont.fontWeight;
82
+ style.fontWeight = style.fontWeight || this.maps.themeStyle.fontWeight;
83
+ style.size = style.size || this.maps.themeStyle.fontSize;
84
84
  shape = !isNullOrUndefined(shapes) ? shapes['property'] : null;
85
85
  var properties = (Object.prototype.toString.call(layer.shapePropertyPath) === '[object Array]' ?
86
86
  layer.shapePropertyPath : [layer.shapePropertyPath]);
@@ -141,7 +141,7 @@ var DataLabel = /** @class */ (function () {
141
141
  text = (!isNullOrUndefined(datasrcObj)) ? !isNullOrUndefined(datasrcObj[labelpath]) ?
142
142
  datasrcObj[labelpath].toString() : datasrcObj[layer.shapeDataPath] : shapeData['properties'][labelpath];
143
143
  if ((Object.prototype.toString.call(layer.shapePropertyPath) === '[object Array]') &&
144
- (isNullOrUndefined(text) && layer.dataSource['length'] === 0)) {
144
+ (isNullOrUndefined(text) && (!isNullOrUndefined(layer.dataSource) && layer.dataSource['length'] === 0))) {
145
145
  for (var l = 0; l < layer.shapePropertyPath.length; l++) {
146
146
  if (shapeData['properties'][layer.shapePropertyPath[l]]) {
147
147
  text = shapeData['properties'][layer.shapePropertyPath[l]];
@@ -152,7 +152,7 @@ var DataLabel = /** @class */ (function () {
152
152
  if (isNullOrUndefined(text) && (layer.dataLabelSettings.template !== '' && layer.dataSource['length'] === 0)) {
153
153
  text = shapeData['properties'][layer.shapePropertyPath];
154
154
  }
155
- if (isNullOrUndefined(text) && layer.dataSource['length'] > 0) {
155
+ if (isNullOrUndefined(text) && (!isNullOrUndefined(layer.dataSource) && layer.dataSource['length'] > 0)) {
156
156
  text = '';
157
157
  }
158
158
  var dataLabelText = text;
@@ -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) {
@@ -680,10 +627,12 @@ var LayerPanel = /** @class */ (function () {
680
627
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
681
628
  var bubbleDataSource = bubble_1.dataSource;
682
629
  this_2.mapObject.bubbleModule.bubbleCollection = [];
683
- bubbleDataSource.map(function (bubbleData, i) {
684
- _this.renderBubble(_this.currentLayer, bubbleData, colors[i % colors.length], range, j, i, bubbleG, layerIndex, bubble_1);
685
- });
686
- 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
+ }
687
636
  };
688
637
  var this_2 = this;
689
638
  for (var j = 0; j < length_1; j++) {
@@ -709,9 +658,13 @@ var LayerPanel = /** @class */ (function () {
709
658
  if (this.mapObject.navigationLineModule) {
710
659
  this.groupElements.push(this.mapObject.navigationLineModule.renderNavigation(this.currentLayer, this.currentFactor, layerIndex));
711
660
  }
712
- this.groupElements.map(function (element) {
713
- _this.layerObject.appendChild(element);
714
- });
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
+ }
715
668
  if (this.mapObject.markerModule) {
716
669
  this.mapObject.markerModule.markerRender(this.mapObject, this.layerObject, layerIndex, (this.mapObject.isTileMap ? Math.floor(this.currentFactor) :
717
670
  this.currentFactor), null);
@@ -802,7 +755,7 @@ var LayerPanel = /** @class */ (function () {
802
755
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
803
756
  var index = checkShapeDataFields(layer.dataSource, shape, layer.shapeDataPath, layer.shapePropertyPath, layer);
804
757
  var colorMapping = new ColorMapping(this.mapObject);
805
- if (isNullOrUndefined(layer.dataSource[index])) {
758
+ if (isNullOrUndefined(layer.dataSource) || isNullOrUndefined(layer.dataSource[index])) {
806
759
  return color;
807
760
  }
808
761
  return colorMapping.getShapeColorMapping(layer.shapeSettings, layer.dataSource[index], color);
@@ -1183,9 +1136,8 @@ var LayerPanel = /** @class */ (function () {
1183
1136
  var tile = new Tile(tileI % ycount, j);
1184
1137
  tile.left = Math.round(x);
1185
1138
  tile.top = Math.round(y);
1186
- if (baseLayer.layerType === 'Bing' || (bing && !isNullOrUndefined(baseLayer.urlTemplate) && baseLayer.urlTemplate !== '')) {
1187
- var key = baseLayer.key;
1188
- 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);
1189
1141
  }
1190
1142
  else {
1191
1143
  tile.src = this.urlTemplate.replace('level', zoomLevel.toString()).replace('tileX', tile.x.toString())
@@ -1212,14 +1164,13 @@ var LayerPanel = /** @class */ (function () {
1212
1164
  if (!(layer.type === 'SubLayer' && layer.visible)) {
1213
1165
  continue;
1214
1166
  }
1215
- if ((layer.layerType !== 'Geometry' && layer.layerType !== 'GoogleStaticMap') || (layer.layerType === 'Geometry' &&
1216
- isNullOrUndefined(layer.shapeData) && !isNullOrUndefined(layer.urlTemplate) && layer.urlTemplate !== '')) {
1167
+ if (isNullOrUndefined(layer.shapeData) && !isNullOrUndefined(layer.urlTemplate) && layer.urlTemplate !== '') {
1217
1168
  for (var _b = 0, proxTiles_1 = proxTiles; _b < proxTiles_1.length; _b++) {
1218
1169
  var baseTile = proxTiles_1[_b];
1219
1170
  var subtile = extend({}, baseTile, {}, true);
1220
- if (layer.layerType === 'Bing') {
1171
+ if (layer.urlTemplate.indexOf('quadkey')) {
1221
1172
  bing = new BingMap(this.mapObject);
1222
- 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);
1223
1174
  }
1224
1175
  else {
1225
1176
  subtile.src = layer.urlTemplate.replace('level', zoomLevel.toString()).replace('tileX', baseTile.x.toString())
@@ -1247,111 +1198,106 @@ var LayerPanel = /** @class */ (function () {
1247
1198
  else {
1248
1199
  timeOut = 0;
1249
1200
  }
1250
- if (this.mapObject.layers[this.mapObject.baseLayerIndex].layerType === 'GoogleStaticMap') {
1251
- this.renderGoogleMap(this.mapObject.layers[0].key, this.mapObject.staticMapZoom);
1252
- }
1253
- else {
1254
- setTimeout(function () {
1255
- if (element) {
1256
- element.style.zIndex = '1';
1257
- }
1258
- if (element1) {
1259
- element1.style.zIndex = '0';
1260
- }
1261
- var animateElement;
1262
- 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
+ }
1263
1220
  animateElement = createElement('div', { id: _this.mapObject.element.id + '_animated_tiles' });
1264
1221
  element.appendChild(animateElement);
1265
1222
  }
1266
1223
  else {
1267
- if (type !== 'Pan' && element1 && element) {
1268
- element1.appendChild(element.children[0]);
1269
- if (!_this.mapObject.isAddLayer && !isNullOrUndefined(document.getElementById(_this.mapObject.element.id + '_animated_tiles'))) {
1270
- document.getElementById(_this.mapObject.element.id + '_animated_tiles').id =
1271
- _this.mapObject.element.id + '_animated_tiles_old';
1272
- }
1273
- animateElement = createElement('div', { id: _this.mapObject.element.id + '_animated_tiles' });
1274
- 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');
1275
1238
  }
1276
1239
  else {
1277
- animateElement = element ? element.children[0] : null;
1240
+ child.style.removeProperty('display');
1241
+ imgElement = child.children[0];
1278
1242
  }
1279
- }
1280
- for (var id = 0; id < _this.tiles.length; id++) {
1281
- var tile = _this.tiles[id];
1282
- var imgElement = null;
1283
- var mapId = _this.mapObject.element.id;
1284
- if (type === 'Pan') {
1285
- var child = document.getElementById(mapId + '_tile_' + id);
1286
- var isNewTile = false;
1287
- if (isNullOrUndefined(child)) {
1288
- isNewTile = true;
1289
- child = createElement('div', { id: mapId + '_tile_' + id });
1290
- imgElement = createElement('img');
1291
- }
1292
- else {
1293
- child.style.removeProperty('display');
1294
- imgElement = child.children[0];
1295
- }
1296
- if (!isNewTile && imgElement && imgElement.src !== tile.src) {
1297
- imgElement.src = tile.src;
1298
- }
1299
- child.style.position = 'absolute';
1300
- child.style.left = tile.left + 'px';
1301
- child.style.top = tile.top + 'px';
1302
- child.style.height = tile.height + 'px';
1303
- child.style.width = tile.width + 'px';
1304
- if (isNewTile) {
1305
- imgElement.setAttribute('height', '256px');
1306
- imgElement.setAttribute('width', '256px');
1307
- imgElement.setAttribute('src', tile.src);
1308
- imgElement.setAttribute('alt', _this.mapObject.getLocalizedLabel('ImageNotFound'));
1309
- imgElement.style.setProperty('user-select', 'none');
1310
- child.appendChild(imgElement);
1311
- animateElement.appendChild(child);
1312
- }
1243
+ if (!isNewTile && imgElement && imgElement.src !== tile.src) {
1244
+ imgElement.src = tile.src;
1313
1245
  }
1314
- else {
1315
- 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) {
1316
1252
  imgElement.setAttribute('height', '256px');
1317
1253
  imgElement.setAttribute('width', '256px');
1318
1254
  imgElement.setAttribute('src', tile.src);
1319
- imgElement.style.setProperty('user-select', 'none');
1320
1255
  imgElement.setAttribute('alt', _this.mapObject.getLocalizedLabel('ImageNotFound'));
1321
- var child = createElement('div', { id: mapId + '_tile_' + id });
1322
- child.style.position = 'absolute';
1323
- child.style.left = tile.left + 'px';
1324
- child.style.top = tile.top + 'px';
1325
- child.style.height = tile.height + 'px';
1326
- child.style.width = tile.width + 'px';
1256
+ imgElement.style.setProperty('user-select', 'none');
1327
1257
  child.appendChild(imgElement);
1328
- if (animateElement) {
1329
- animateElement.appendChild(child);
1330
- }
1258
+ animateElement.appendChild(child);
1331
1259
  }
1332
- if (id === (_this.tiles.length - 1) && document.getElementById(_this.mapObject.element.id + '_animated_tiles_old')) {
1333
- 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);
1334
1277
  }
1335
1278
  }
1336
- if (!isNullOrUndefined(_this.mapObject.currentTiles)) {
1337
- for (var l = _this.tiles.length; l < animateElement.childElementCount; l++) {
1338
- var isExistingElement = false;
1339
- for (var a = 0; a < _this.mapObject.currentTiles.childElementCount; a++) {
1340
- if (!isExistingElement &&
1341
- _this.mapObject.currentTiles.children[a].id === animateElement.children[l].id) {
1342
- isExistingElement = true;
1343
- }
1344
- }
1345
- if (isExistingElement) {
1346
- animateElement.children[l].style.display = 'none';
1347
- }
1348
- else {
1349
- 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;
1350
1290
  }
1351
1291
  }
1292
+ if (isExistingElement) {
1293
+ animateElement.children[l].style.display = 'none';
1294
+ }
1295
+ else {
1296
+ animateElement.removeChild(animateElement.children[l]);
1297
+ }
1352
1298
  }
1353
- }, timeOut);
1354
- }
1299
+ }
1300
+ }, timeOut);
1355
1301
  };
1356
1302
  /**
1357
1303
  * Animation for tile layers and hide the group element until the tile layer rendering.
@@ -1426,7 +1372,7 @@ var LayerPanel = /** @class */ (function () {
1426
1372
  var eleWidth = mapWidth > 640 ? (mapWidth - 640) / 2 : 0;
1427
1373
  var eleHeight = mapHeight > 640 ? (mapHeight - 640) / 2 : 0;
1428
1374
  var center;
1429
- var mapType = (map.layers[map.layers.length - 1].staticMapType).toString().toLowerCase();
1375
+ var mapType = 'roadmap';
1430
1376
  if (map.centerPosition.latitude && map.centerPosition.longitude) {
1431
1377
  center = map.centerPosition.latitude.toString() + ',' + map.centerPosition.longitude.toString();
1432
1378
  }
@@ -1452,8 +1398,7 @@ var LayerPanel = /** @class */ (function () {
1452
1398
  this.mapObject.tileZoomLevel = this.mapObject.tileZoomScale;
1453
1399
  }
1454
1400
  var level = this.mapObject.tileZoomLevel;
1455
- var padding = this.mapObject.layers[this.mapObject.layers.length - 1].layerType !== 'GoogleStaticMap' ?
1456
- 20 : 0;
1401
+ var padding = 20;
1457
1402
  var x;
1458
1403
  var y;
1459
1404
  var totalSize = Math.pow(2, level) * 256;