@syncfusion/ej2-maps 20.3.49 → 20.3.56

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.
@@ -614,9 +614,9 @@ function renderTextElement(option, style, color, parent, isMinus = false) {
614
614
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
615
615
  function convertElement(element, markerId, data, index, mapObj) {
616
616
  const childElement = createElement('div', {
617
- id: markerId,
618
- styles: 'position: absolute;pointer-events: auto;'
617
+ id: markerId
619
618
  });
619
+ childElement.style.cssText = 'position: absolute;pointer-events: auto;';
620
620
  let elementLength = element.length;
621
621
  while (elementLength > 0) {
622
622
  childElement.appendChild(element[0]);
@@ -702,11 +702,12 @@ function convertElementFromLabel(element, labelId, data, index, mapObj) {
702
702
  // eslint-disable-next-line @typescript-eslint/ban-types
703
703
  templateHtml = templateHtml.replace(new RegExp('{{:' + properties[i] + '}}', 'g'), data[properties[i].toString()]);
704
704
  }
705
- return createElement('div', {
705
+ let templateEle = createElement('div', {
706
706
  id: labelId,
707
- innerHTML: templateHtml,
708
- styles: 'position: absolute'
707
+ innerHTML: templateHtml
709
708
  });
709
+ templateEle.style.position = 'absolute';
710
+ return templateEle;
710
711
  }
711
712
  /**
712
713
  *
@@ -2104,7 +2105,7 @@ function getZoomTranslate(mapObject, layer, animate) {
2104
2105
  mapObject.zoomSettings.zoomFactor ===
2105
2106
  mapObject.mapScaleValue ? mapObject.zoomSettings.zoomFactor :
2106
2107
  mapObject.zoomSettings.zoomFactor !== mapObject.mapScaleValue && !mapObject.centerPositionChanged ? mapObject.mapScaleValue : mapObject.zoomSettings.zoomFactor;
2107
- if (mapObject.zoomSettings.shouldZoomInitially) {
2108
+ if (mapObject.zoomSettings.shouldZoomInitially && !mapObject.isZoomByPosition) {
2108
2109
  mapObject.mapScaleValue = zoomFactorValue = scaleFactor = ((mapObject.enablePersistence || mapObject.zoomSettings.shouldZoomInitially) && mapObject.scale === 1)
2109
2110
  ? mapObject.scale : (isNullOrUndefined(mapObject.markerZoomFactor)) ? mapObject.mapScaleValue : mapObject.markerZoomFactor;
2110
2111
  zoomFactorValue = mapObject.mapScaleValue;
@@ -2138,6 +2139,10 @@ function getZoomTranslate(mapObject, layer, animate) {
2138
2139
  y = -point.y + topPosition;
2139
2140
  }
2140
2141
  else {
2142
+ if (mapObject.isZoomByPosition) {
2143
+ mapObject.zoomTranslatePoint.x = -point.x + leftPosition;
2144
+ mapObject.zoomTranslatePoint.y = -point.y + topPosition;
2145
+ }
2141
2146
  x = mapObject.zoomTranslatePoint.x;
2142
2147
  y = mapObject.zoomTranslatePoint.y;
2143
2148
  zoomFactorValue = zoomFactor;
@@ -2345,7 +2350,7 @@ function triggerShapeEvent(targetId, selection, maps, eventName) {
2345
2350
  target: targetId,
2346
2351
  maps: maps
2347
2352
  };
2348
- maps.trigger(eventName, eventArgs, (observedArgs) => {
2353
+ maps.trigger(eventName, eventArgs, () => {
2349
2354
  eventArgs.border.opacity = isNullOrUndefined(eventArgs.border.opacity) ? eventArgs.opacity : eventArgs.border.opacity;
2350
2355
  });
2351
2356
  return eventArgs;
@@ -2572,11 +2577,11 @@ function showTooltip(text, size, x, y, areaWidth, areaHeight, id, element, isTou
2572
2577
  }
2573
2578
  if (!tooltip) {
2574
2579
  tooltip = createElement('div', {
2575
- id: id,
2576
- styles: 'background-color: rgb(255, 255, 255) !important; color:black !important; ' +
2577
- 'position:absolute;border:1px solid rgb(0, 0, 0); padding-left:5px;' +
2578
- 'font-size:12px; font-family: "Segoe UI"; text-align:center'
2580
+ id: id
2579
2581
  });
2582
+ tooltip.style.cssText = 'background-color: rgb(255, 255, 255) !important; color:black !important; ' +
2583
+ 'position:absolute;border:1px solid rgb(0, 0, 0); padding-left:5px;' +
2584
+ 'font-size:12px; font-family: "Segoe UI"; text-align:center';
2580
2585
  }
2581
2586
  if (x < (areaWidth - width)) {
2582
2587
  // eslint-disable-next-line no-self-assign
@@ -2674,13 +2679,14 @@ function createTooltip(id, text, top, left, fontSize) {
2674
2679
  'position:absolute;border:1px solid #707070;font-size:' + fontSize + ';border-radius:2px;';
2675
2680
  if (!tooltip) {
2676
2681
  tooltip = createElement('div', {
2677
- id: id, innerHTML: '&nbsp;' + text + '&nbsp;', styles: style
2682
+ id: id, innerHTML: '&nbsp;' + text + '&nbsp;'
2678
2683
  });
2684
+ tooltip.style.cssText = style;
2679
2685
  document.body.appendChild(tooltip);
2680
2686
  }
2681
2687
  else {
2682
- tooltip.setAttribute('innerHTML', '&nbsp;' + text + '&nbsp;');
2683
- tooltip.setAttribute('styles', style);
2688
+ tooltip.innerHTML = '&nbsp;' + text + '&nbsp;';
2689
+ tooltip.style.cssText = style;
2684
2690
  }
2685
2691
  }
2686
2692
  /**
@@ -3076,7 +3082,7 @@ function animate(element, delay, duration, process, end) {
3076
3082
  end.call(this, { element: element });
3077
3083
  if (element.id.indexOf('Marker') > -1) {
3078
3084
  let markerElement = getElementByID(element.id.split('_Layer')[0] + '_Markers_Group');
3079
- markerElement.setAttribute('style', markerStyle);
3085
+ markerElement.style.cssText = markerStyle;
3080
3086
  }
3081
3087
  }
3082
3088
  };
@@ -4230,7 +4236,7 @@ __decorate$1([
4230
4236
  Property(false)
4231
4237
  ], ZoomSettings.prototype, "doubleClickZoom", void 0);
4232
4238
  __decorate$1([
4233
- Property(false)
4239
+ Property(true)
4234
4240
  ], ZoomSettings.prototype, "pinchZooming", void 0);
4235
4241
  __decorate$1([
4236
4242
  Property(false)
@@ -4662,18 +4668,18 @@ class Marker {
4662
4668
  const currentLayer = maps.layersCollection[layerIndex];
4663
4669
  this.markerSVGObject = maps.renderer.createGroup({
4664
4670
  id: maps.element.id + '_Markers_Group',
4665
- class: 'GroupElement',
4666
- style: 'pointer-events: auto;'
4671
+ class: 'GroupElement'
4667
4672
  });
4673
+ this.markerSVGObject.style.pointerEvents = 'auto';
4668
4674
  const markerTemplateEle = createElement('div', {
4669
4675
  id: maps.element.id + '_LayerIndex_' + layerIndex + '_Markers_Template_Group',
4670
- className: maps.element.id + '_template',
4671
- styles: 'overflow: hidden; position: absolute;pointer-events: none;' +
4672
- 'top:' + maps.mapAreaRect.y + 'px;' +
4673
- 'left:' + maps.mapAreaRect.x + 'px;' +
4674
- 'height:' + maps.mapAreaRect.height + 'px;' +
4675
- 'width:' + maps.mapAreaRect.width + 'px;'
4676
+ className: maps.element.id + '_template'
4676
4677
  });
4678
+ markerTemplateEle.style.cssText = 'overflow: hidden; position: absolute;pointer-events: none;' +
4679
+ 'top:' + maps.mapAreaRect.y + 'px;' +
4680
+ 'left:' + maps.mapAreaRect.x + 'px;' +
4681
+ 'height:' + maps.mapAreaRect.height + 'px;' +
4682
+ 'width:' + maps.mapAreaRect.width + 'px;';
4677
4683
  currentLayer.markerSettings.map((markerSettings, markerIndex) => {
4678
4684
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
4679
4685
  const markerData = markerSettings.dataSource;
@@ -4890,7 +4896,8 @@ class Marker {
4890
4896
  }
4891
4897
  if (this.maps.isTileMap && !this.maps.enablePersistence
4892
4898
  && this.maps.mapScaleValue <= 1) {
4893
- this.maps.tileZoomLevel = this.maps.mapScaleValue === 0 ? 1 : this.maps.mapScaleValue;
4899
+ this.maps.tileZoomLevel = this.maps.mapScaleValue === 0 ? (this.maps.isZoomByPosition ? this.maps.tileZoomLevel : 1)
4900
+ : this.maps.mapScaleValue;
4894
4901
  if (this.maps.mapScaleValue === 1 && this.maps.markerZoomFactor === 1) {
4895
4902
  this.maps.tileTranslatePoint.x = 0;
4896
4903
  this.maps.tileTranslatePoint.y = 0;
@@ -5037,7 +5044,7 @@ class Marker {
5037
5044
  }
5038
5045
  const options = this.getMarker(targetId);
5039
5046
  if (this.maps.markerClusterExpand) {
5040
- e.target.setAttribute('style', 'cursor: pointer');
5047
+ e.target.style.cursor = 'pointer';
5041
5048
  }
5042
5049
  if (isNullOrUndefined(options)) {
5043
5050
  return;
@@ -5553,10 +5560,10 @@ class LayerPanel {
5553
5560
  height: areaRect.height
5554
5561
  });
5555
5562
  const parentElement = createElement('div', {
5556
- id: this.mapObject.element.id + '_Tile_SVG_Parent', styles: 'position: absolute; height: ' +
5557
- (areaRect.height) + 'px; width: '
5558
- + (areaRect.width) + 'px;'
5563
+ id: this.mapObject.element.id + '_Tile_SVG_Parent'
5559
5564
  });
5565
+ parentElement.style.cssText = 'position: absolute; height: ' + (areaRect.height) + 'px; width: ' +
5566
+ (areaRect.width) + 'px;';
5560
5567
  parentElement.appendChild(this.tileSvgObject);
5561
5568
  secondaryEle.appendChild(parentElement);
5562
5569
  }
@@ -5610,13 +5617,13 @@ class LayerPanel {
5610
5617
  (!isNullOrUndefined(panel.mapObject.tileZoomLevel) && panel.mapObject.tileZoomLevel !== 1)) ?
5611
5618
  false : true;
5612
5619
  if (isNullOrUndefined(panel.mapObject.previousCenterLatitude) &&
5613
- isNullOrUndefined(panel.mapObject.previousCenterLongitude)) {
5620
+ isNullOrUndefined(panel.mapObject.previousCenterLongitude) && !panel.mapObject.isZoomByPosition) {
5614
5621
  panel.mapObject.previousCenterLatitude = panel.mapObject.centerPosition.latitude;
5615
5622
  panel.mapObject.previousCenterLongitude = panel.mapObject.centerPosition.longitude;
5616
5623
  }
5617
- else if (panel.mapObject.previousCenterLatitude !==
5624
+ else if ((panel.mapObject.previousCenterLatitude !==
5618
5625
  panel.mapObject.centerPosition.latitude && panel.mapObject.previousCenterLongitude !==
5619
- panel.mapObject.centerPosition.longitude) {
5626
+ panel.mapObject.centerPosition.longitude) || panel.mapObject.isZoomByPosition) {
5620
5627
  panel.mapObject.centerPositionChanged = true;
5621
5628
  panel.mapObject.previousCenterLatitude = panel.mapObject.centerPosition.latitude;
5622
5629
  panel.mapObject.previousCenterLongitude = panel.mapObject.centerPosition.longitude;
@@ -5628,7 +5635,8 @@ class LayerPanel {
5628
5635
  let centerTileMap = center;
5629
5636
  if ((this.mapObject.isTileMap && panel.mapObject.markerModule) && panel.mapObject.zoomSettings.enable) {
5630
5637
  panel.mapObject.markerModule.calculateZoomCenterPositionAndFactor(this.mapObject.layersCollection);
5631
- if (!isNullOrUndefined(this.mapObject.markerCenterLatitude) && !isNullOrUndefined(this.mapObject.markerCenterLongitude)) {
5638
+ if (!isNullOrUndefined(this.mapObject.markerCenterLatitude) && !isNullOrUndefined(this.mapObject.markerCenterLongitude)
5639
+ && !panel.mapObject.isZoomByPosition) {
5632
5640
  centerTileMap = new Point(panel.mapObject.markerCenterLongitude, panel.mapObject.markerCenterLatitude);
5633
5641
  }
5634
5642
  }
@@ -5644,7 +5652,7 @@ class LayerPanel {
5644
5652
  else {
5645
5653
  center = { x: null, y: null };
5646
5654
  }
5647
- let zoomFactorValue = panel.mapObject.zoomSettings.shouldZoomInitially ?
5655
+ let zoomFactorValue = (panel.mapObject.zoomSettings.shouldZoomInitially && !panel.mapObject.isZoomByPosition) ?
5648
5656
  isNullOrUndefined(panel.mapObject.markerZoomFactor) ? 1 :
5649
5657
  panel.mapObject.markerZoomFactor : panel.mapObject.zoomSettings.zoomFactor;
5650
5658
  zoomFactorValue = (panel.mapObject.enablePersistence) ? ((isNullOrUndefined(panel.mapObject.mapScaleValue))
@@ -5898,13 +5906,13 @@ class LayerPanel {
5898
5906
  const colors = shapeSettings.palette.length > 1 ? shapeSettings.palette : getShapeColor(this.mapObject.theme);
5899
5907
  const labelTemplateEle = createElement('div', {
5900
5908
  id: this.mapObject.element.id + '_LayerIndex_' + layerIndex + '_Label_Template_Group',
5901
- className: this.mapObject.element.id + '_template',
5902
- styles: 'pointer-events: none; overflow: hidden; position: absolute;' +
5903
- 'top:' + this.mapObject.mapAreaRect.y + 'px;' +
5904
- 'left:' + this.mapObject.mapAreaRect.x + 'px;' +
5905
- 'height:' + this.mapObject.mapAreaRect.height + 'px;' +
5906
- 'width:' + this.mapObject.mapAreaRect.width + 'px;'
5909
+ className: this.mapObject.element.id + '_template'
5907
5910
  });
5911
+ labelTemplateEle.style.cssText = 'pointer-events: none; overflow: hidden; position: absolute;' +
5912
+ 'top:' + this.mapObject.mapAreaRect.y + 'px;' +
5913
+ 'left:' + this.mapObject.mapAreaRect.x + 'px;' +
5914
+ 'height:' + this.mapObject.mapAreaRect.height + 'px;' +
5915
+ 'width:' + this.mapObject.mapAreaRect.width + 'px;';
5908
5916
  if (this.currentLayer.layerData.length !== 0) {
5909
5917
  for (let i = 0; i < this.currentLayer.layerData.length; i++) {
5910
5918
  let k;
@@ -6132,10 +6140,10 @@ class LayerPanel {
6132
6140
  }
6133
6141
  pathEle.setAttribute('aria-label', ((!isNullOrUndefined(currentShapeData['property'])) ?
6134
6142
  (currentShapeData['property'][properties]) : ''));
6135
- pathEle.setAttribute('tabindex', (this.mapObject.tabIndex + index + 3).toString());
6143
+ pathEle.tabIndex = this.mapObject.tabIndex + index + 3;
6136
6144
  pathEle.setAttribute('role', '');
6137
6145
  if (drawingType === 'LineString' || drawingType === 'MultiLineString') {
6138
- pathEle.setAttribute('style', 'outline:none');
6146
+ pathEle.style.cssText = 'outline:none';
6139
6147
  }
6140
6148
  maintainSelection(this.mapObject.selectedElementId, this.mapObject.shapeSelectionClass, pathEle, 'ShapeselectionMapStyle');
6141
6149
  if (this.mapObject.toggledShapeElementId) {
@@ -6189,9 +6197,9 @@ class LayerPanel {
6189
6197
  this.mapObject.markerModule.calculateZoomCenterPositionAndFactor(this.mapObject.layersCollection);
6190
6198
  }
6191
6199
  const group = (this.mapObject.renderer.createGroup({
6192
- id: this.mapObject.element.id + '_LayerIndex_' + layerIndex + '_dataLableIndex_Group',
6193
- style: 'pointer-events: none;'
6200
+ id: this.mapObject.element.id + '_LayerIndex_' + layerIndex + '_dataLableIndex_Group'
6194
6201
  }));
6202
+ group.style.pointerEvents = 'none';
6195
6203
  if (this.mapObject.dataLabelModule && this.currentLayer.dataLabelSettings.visible) {
6196
6204
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
6197
6205
  const intersect = [];
@@ -6707,7 +6715,8 @@ class LayerPanel {
6707
6715
  }
6708
6716
  }
6709
6717
  }
6710
- if (this.mapObject.previousScale !== this.mapObject.scale || this.mapObject.isReset) {
6718
+ if (this.mapObject.previousScale !== this.mapObject.scale || this.mapObject.isReset || this.mapObject.isZoomByPosition
6719
+ || this.mapObject.zoomNotApplied) {
6711
6720
  this.arrangeTiles(zoomType, this.animateToZoomX, this.animateToZoomY);
6712
6721
  }
6713
6722
  }
@@ -6987,8 +6996,9 @@ class Annotations {
6987
6996
  const availSize = map.availableSize;
6988
6997
  const id = map.element.id + '_Annotation_' + annotationIndex;
6989
6998
  const childElement = createElement('div', {
6990
- id: map.element.id + '_Annotation_' + annotationIndex, styles: 'position: absolute; z-index:' + annotation.zIndex + ';'
6999
+ id: map.element.id + '_Annotation_' + annotationIndex
6991
7000
  });
7001
+ childElement.style.cssText = 'position: absolute; z-index:' + annotation.zIndex + ';';
6992
7002
  const argsData = {
6993
7003
  cancel: false, name: annotationRendering, content: annotation.content,
6994
7004
  annotation: annotation
@@ -7505,7 +7515,9 @@ let Maps = class Maps extends Component {
7505
7515
  }
7506
7516
  }
7507
7517
  this.zoomingChange();
7508
- this.trigger(loaded, { maps: this, isResized: this.isResize });
7518
+ if (!this.isZoomByPosition && !this.zoomNotApplied) {
7519
+ this.trigger(loaded, { maps: this, isResized: this.isResize });
7520
+ }
7509
7521
  this.isResize = false;
7510
7522
  }
7511
7523
  /**
@@ -7599,7 +7611,7 @@ let Maps = class Maps extends Component {
7599
7611
  addTabIndex() {
7600
7612
  this.element.setAttribute('aria-label', this.description || 'Maps Element');
7601
7613
  this.element.setAttribute('role', '');
7602
- this.element.setAttribute('tabindex', this.tabIndex.toString());
7614
+ this.element.tabIndex = this.tabIndex;
7603
7615
  }
7604
7616
  // private setSecondaryElementPosition(): void {
7605
7617
  // if (!this.isTileMap) {
@@ -7662,7 +7674,7 @@ let Maps = class Maps extends Component {
7662
7674
  }
7663
7675
  }
7664
7676
  }
7665
- if (this.zoomModule && (this.previousScale !== this.scale)) {
7677
+ if (this.zoomModule && ((this.previousScale !== this.scale) || this.zoomNotApplied || this.isZoomByPosition)) {
7666
7678
  this.zoomModule.applyTransform(this, true);
7667
7679
  }
7668
7680
  }
@@ -7670,9 +7682,9 @@ let Maps = class Maps extends Component {
7670
7682
  createSecondaryElement() {
7671
7683
  if (isNullOrUndefined(document.getElementById(this.element.id + '_Secondary_Element'))) {
7672
7684
  const secondaryElement = createElement('div', {
7673
- id: this.element.id + '_Secondary_Element',
7674
- styles: 'position: absolute;z-index:2;'
7685
+ id: this.element.id + '_Secondary_Element'
7675
7686
  });
7687
+ secondaryElement.style.cssText = 'position: absolute;z-index:2;';
7676
7688
  this.element.appendChild(secondaryElement);
7677
7689
  }
7678
7690
  }
@@ -7726,18 +7738,20 @@ let Maps = class Maps extends Component {
7726
7738
  removeElement(this.element.id + '_tiles');
7727
7739
  removeElement('animated_tiles');
7728
7740
  const ele = createElement('div', {
7729
- id: this.element.id + '_tile_parent', styles: 'position: absolute; left: ' +
7730
- (this.mapAreaRect.x) + 'px; right: ' + (this.margin.right) + 'px; top: '
7731
- + (this.mapAreaRect.y + padding) + 'px; height: ' +
7732
- (this.mapAreaRect.height) + 'px; width: '
7733
- + (this.mapAreaRect.width) + 'px; overflow: hidden;'
7741
+ id: this.element.id + '_tile_parent'
7734
7742
  });
7743
+ ele.style.cssText = 'position: absolute; left: ' +
7744
+ (this.mapAreaRect.x) + 'px; right: ' + (this.margin.right) + 'px; top: '
7745
+ + (this.mapAreaRect.y + padding) + 'px; height: ' +
7746
+ (this.mapAreaRect.height) + 'px; width: '
7747
+ + (this.mapAreaRect.width) + 'px; overflow: hidden;';
7735
7748
  const ele1 = createElement('div', {
7736
- id: this.element.id + '_tiles', styles: 'position: absolute; left: ' +
7737
- (this.mapAreaRect.x) + 'px; right: ' + (this.margin.right) + 'px; top: '
7738
- + (this.mapAreaRect.y + padding) + 'px; height: ' + (this.mapAreaRect.height) + 'px; width: '
7739
- + (this.mapAreaRect.width) + 'px; overflow: hidden;'
7749
+ id: this.element.id + '_tiles'
7740
7750
  });
7751
+ ele1.style.cssText = 'position: absolute; left: ' +
7752
+ (this.mapAreaRect.x) + 'px; right: ' + (this.margin.right) + 'px; top: '
7753
+ + (this.mapAreaRect.y + padding) + 'px; height: ' + (this.mapAreaRect.height) + 'px; width: '
7754
+ + (this.mapAreaRect.width) + 'px; overflow: hidden;';
7741
7755
  this.element.appendChild(ele);
7742
7756
  this.element.appendChild(ele1);
7743
7757
  }
@@ -8219,9 +8233,6 @@ let Maps = class Maps extends Component {
8219
8233
  const markerModule = this.markerModule;
8220
8234
  if (element.id.indexOf('shapeIndex') > -1 || element.id.indexOf('Tile') > -1) {
8221
8235
  this.mergeCluster();
8222
- if (element.id.indexOf('shapeIndex') > -1) {
8223
- this.triggerShapeSelection(element);
8224
- }
8225
8236
  }
8226
8237
  if (markerModule) {
8227
8238
  markerModule.markerClick(e);
@@ -8401,32 +8412,30 @@ let Maps = class Maps extends Component {
8401
8412
  * @returns {void}
8402
8413
  */
8403
8414
  zoomByPosition(centerPosition, zoomFactor) {
8404
- const factor = this.mapLayerPanel.calculateFactor(this.layersCollection[0]);
8405
- let position;
8406
- const size = this.mapAreaRect;
8415
+ this.zoomNotApplied = false;
8416
+ let isRefresh = this.zoomSettings.zoomFactor == zoomFactor;
8407
8417
  if (!this.isTileMap && this.zoomModule) {
8408
8418
  if (!isNullOrUndefined(centerPosition)) {
8409
- position = convertGeoToPoint(centerPosition.latitude, centerPosition.longitude, factor, this.layersCollection[0], this);
8410
- const mapRect = document.getElementById(this.element.id + '_Layer_Collections').getBoundingClientRect();
8411
- const svgRect = this.svgObject.getBoundingClientRect();
8412
- const xDiff = Math.abs(mapRect.left - svgRect.left) / this.scale;
8413
- const yDiff = Math.abs(mapRect.top - svgRect.top) / this.scale;
8414
- const x = this.translatePoint.x + xDiff;
8415
- const y = this.translatePoint.y + yDiff;
8416
- this.scale = zoomFactor;
8417
- this.translatePoint.x = ((mapRect.left < svgRect.left ? x : 0) + (size.width / 2) - (position.x * zoomFactor)) / zoomFactor;
8418
- this.translatePoint.y = ((mapRect.top < svgRect.top ? y : 0) + (size.height / 2) - (position.y * zoomFactor)) / zoomFactor;
8419
- this.zoomModule.applyTransform(this);
8419
+ this.zoomSettings.zoomFactor = zoomFactor;
8420
+ isRefresh = this.centerPosition.latitude === centerPosition.latitude && this.centerPosition.longitude === centerPosition.longitude ? true : isRefresh;
8421
+ this.centerPosition = centerPosition;
8422
+ this.isZoomByPosition = true;
8423
+ this.mapScaleValue = null;
8420
8424
  }
8421
8425
  else {
8422
- position = { x: size.width / 2, y: size.height / 2 };
8423
- this.zoomModule.performZooming(position, zoomFactor, zoomFactor > this.scale ? 'ZoomIn' : 'ZoomOut');
8426
+ this.zoomSettings.zoomFactor = zoomFactor;
8427
+ this.isZoomByPosition = true;
8428
+ this.mapScaleValue = null;
8424
8429
  }
8425
8430
  }
8426
8431
  else if (this.zoomModule) {
8427
- this.tileZoomLevel = zoomFactor;
8428
- this.tileTranslatePoint = this.mapLayerPanel['panTileMap'](this.availableSize.width, this.availableSize.height, { x: centerPosition.longitude, y: centerPosition.latitude });
8429
- this.mapLayerPanel.generateTiles(zoomFactor, this.tileTranslatePoint, null, new BingMap(this));
8432
+ this.tileZoomLevel = this.zoomSettings.zoomFactor = zoomFactor;
8433
+ isRefresh = this.centerPosition.latitude === centerPosition.latitude && this.centerPosition.longitude === centerPosition.longitude ? true : isRefresh;
8434
+ this.centerPosition = centerPosition;
8435
+ this.isZoomByPosition = true;
8436
+ }
8437
+ if (isRefresh) {
8438
+ this.refresh();
8430
8439
  }
8431
8440
  }
8432
8441
  /**
@@ -8617,6 +8626,11 @@ let Maps = class Maps extends Component {
8617
8626
  let centerLatitude;
8618
8627
  let centerLongtitude;
8619
8628
  let isTwoCoordinates = false;
8629
+ this.centerPosition = {
8630
+ latitude: null,
8631
+ longitude: null
8632
+ };
8633
+ this.isZoomByPosition = false;
8620
8634
  if (isNullOrUndefined(maxLatitude) && isNullOrUndefined(maxLongitude)
8621
8635
  || isNullOrUndefined(minLatitude) && isNullOrUndefined(minLongitude)) {
8622
8636
  minLatitude = isNullOrUndefined(minLatitude) ? 0 : minLatitude;
@@ -9893,8 +9907,14 @@ class DataLabel {
9893
9907
  datasrcObj : shapeData['properties'], this.maps, eventargs.template, this.maps.element.id + '_LabelTemplate', false) : document.createElement('div');
9894
9908
  templateElement.innerHTML = !templateFn ? eventargs.template : '';
9895
9909
  labelElement = convertElementFromLabel(templateElement, labelId, !isNullOrUndefined(datasrcObj) ? datasrcObj : shapeData['properties'], index, this.maps);
9896
- labelElement.style.left = ((Math.abs(this.maps.baseMapRectBounds['min']['x'] - location['x'])) * scale) + labelArgs.offsetX + 'px';
9897
- labelElement.style.top = ((Math.abs(this.maps.baseMapRectBounds['min']['y'] - location['y'])) * scale) + labelArgs.offsetY + 'px';
9910
+ if (this.maps.isTileMap) {
9911
+ labelElement.style.left = (((location['x'] + transPoint['x']) * scale) - (textSize['width'] / 2)) + 'px';
9912
+ labelElement.style.top = (((location['y'] + transPoint['y']) * scale) - textSize['height']) + 'px';
9913
+ }
9914
+ else {
9915
+ labelElement.style.left = ((Math.abs(this.maps.baseMapRectBounds['min']['x'] - location['x'])) * scale) + labelArgs.offsetX + 'px';
9916
+ labelElement.style.top = ((Math.abs(this.maps.baseMapRectBounds['min']['y'] - location['y'])) * scale) + labelArgs.offsetY + 'px';
9917
+ }
9898
9918
  labelTemplateElement.appendChild(labelElement);
9899
9919
  }
9900
9920
  else {
@@ -10134,51 +10154,49 @@ class NavigationLine {
10134
10154
  direction = 0;
10135
10155
  }
10136
10156
  }
10137
- if (point[j]['x'] !== point[j + 1]['x']) {
10138
- if (showArrow) {
10139
- arrowColor = arrowSettings['properties']['color'];
10140
- arrowSize = arrowSettings['properties']['size'];
10141
- offSetValue = (arrowSettings['properties']['offSet'] === undefined) ? 0 : arrowSettings['properties']['offSet'];
10142
- const divide = (Math.round(arrowSize / 2));
10143
- arrowPosition = arrowSettings['properties']['position'];
10144
- startArrow = (arrowPosition === 'Start') ? 'url(#triangle' + i + ')' : null;
10145
- endArrow = (arrowPosition === 'End') ? 'url(#triangle' + i + ')' : null;
10146
- if (offSet !== 0 && angle === 0) {
10147
- offSet = (arrowPosition === 'Start') ? offSetValue : -(offSetValue);
10148
- }
10149
- offSet = (isNullOrUndefined(offSet)) ? 0 : offSet;
10150
- const triId = this.maps.element.id + '_triangle';
10151
- const defElement = this.maps.renderer.createDefs();
10152
- defElement.innerHTML += '<marker id="' + 'triangle' + i + '"></marker>';
10153
- const markerEle = defElement.querySelector('#' + 'triangle' + i);
10154
- markerEle.setAttribute('markerWidth', (arrowSize.toString()));
10155
- markerEle.setAttribute('markerHeight', (arrowSize.toString()));
10156
- markerEle.setAttribute('refX', (divide - offSet).toString());
10157
- markerEle.setAttribute('refY', divide.toString());
10158
- markerEle.setAttribute('orient', 'auto');
10159
- const d2 = 'M 0,0 L 0,' + arrowSize + ' L ' + divide + ', ' + divide + ' Z';
10160
- pathOption = new PathOption(triId, arrowColor, width, color, 1, 1, dashArray, d2);
10161
- navigationEle = this.maps.renderer.drawPath(pathOption);
10162
- markerEle.appendChild(navigationEle);
10163
- defElement.appendChild(markerEle);
10164
- navigationGroup.appendChild(defElement);
10165
- }
10166
- angle = Math.abs(angle);
10167
- d = (angle === 0) ? 'M ' + point[j]['x'] + ',' + point[j]['y'] + 'L ' + point[j + 1]['x']
10168
- + ',' + point[j + 1]['y'] + ' ' :
10169
- 'M ' + point[j]['x'] + ',' + point[j]['y'] + ' A ' + (radius / 2 + (1 - angle) * radius / (angle * 10)) +
10170
- ' ' + (radius / 2 + (1 - angle) * radius / (angle * 10)) + ' ' + 0 + ',' + 0 + ','
10171
- + direction + ' , ' + point[j + 1]['x'] + ',' + point[j + 1]['y'] + ' ';
10172
- pathOption = new PathOption(arcId, 'none', width, color, 1, 1, dashArray, d);
10157
+ if (showArrow) {
10158
+ arrowColor = arrowSettings['properties']['color'];
10159
+ arrowSize = arrowSettings['properties']['size'];
10160
+ offSetValue = (arrowSettings['properties']['offSet'] === undefined) ? 0 : arrowSettings['properties']['offSet'];
10161
+ const divide = (Math.round(arrowSize / 2));
10162
+ arrowPosition = arrowSettings['properties']['position'];
10163
+ startArrow = (arrowPosition === 'Start') ? 'url(#triangle' + i + ')' : null;
10164
+ endArrow = (arrowPosition === 'End') ? 'url(#triangle' + i + ')' : null;
10165
+ if (offSet !== 0 && angle === 0) {
10166
+ offSet = (arrowPosition === 'Start') ? offSetValue : -(offSetValue);
10167
+ }
10168
+ offSet = (isNullOrUndefined(offSet)) ? 0 : offSet;
10169
+ const triId = this.maps.element.id + '_triangle';
10170
+ const defElement = this.maps.renderer.createDefs();
10171
+ defElement.innerHTML += '<marker id="' + 'triangle' + i + '"></marker>';
10172
+ const markerEle = defElement.querySelector('#' + 'triangle' + i);
10173
+ markerEle.setAttribute('markerWidth', (arrowSize.toString()));
10174
+ markerEle.setAttribute('markerHeight', (arrowSize.toString()));
10175
+ markerEle.setAttribute('refX', (divide - offSet).toString());
10176
+ markerEle.setAttribute('refY', divide.toString());
10177
+ markerEle.setAttribute('orient', 'auto');
10178
+ const d2 = 'M 0,0 L 0,' + arrowSize + ' L ' + divide + ', ' + divide + ' Z';
10179
+ pathOption = new PathOption(triId, arrowColor, width, color, 1, 1, dashArray, d2);
10173
10180
  navigationEle = this.maps.renderer.drawPath(pathOption);
10174
- if (!isNullOrUndefined(arrowPosition)) {
10175
- const position = (arrowPosition === 'Start') ? navigationEle.setAttribute('marker-start', startArrow)
10176
- : navigationEle.setAttribute('marker-end', endArrow);
10177
- }
10178
- maintainSelection(this.maps.selectedNavigationElementId, this.maps.navigationSelectionClass, navigationEle, 'navigationlineselectionMapStyle');
10179
- navigationGroup.appendChild(navigationEle);
10180
- group.appendChild(navigationGroup);
10181
- }
10181
+ markerEle.appendChild(navigationEle);
10182
+ defElement.appendChild(markerEle);
10183
+ navigationGroup.appendChild(defElement);
10184
+ }
10185
+ angle = Math.abs(angle);
10186
+ d = (angle === 0) ? 'M ' + point[j]['x'] + ',' + point[j]['y'] + 'L ' + point[j + 1]['x']
10187
+ + ',' + point[j + 1]['y'] + ' ' :
10188
+ 'M ' + point[j]['x'] + ',' + point[j]['y'] + ' A ' + (radius / 2 + (1 - angle) * radius / (angle * 10)) +
10189
+ ' ' + (radius / 2 + (1 - angle) * radius / (angle * 10)) + ' ' + 0 + ',' + 0 + ','
10190
+ + direction + ' , ' + point[j + 1]['x'] + ',' + point[j + 1]['y'] + ' ';
10191
+ pathOption = new PathOption(arcId, 'none', width, color, 1, 1, dashArray, d);
10192
+ navigationEle = this.maps.renderer.drawPath(pathOption);
10193
+ if (!isNullOrUndefined(arrowPosition)) {
10194
+ const position = (arrowPosition === 'Start') ? navigationEle.setAttribute('marker-start', startArrow)
10195
+ : navigationEle.setAttribute('marker-end', endArrow);
10196
+ }
10197
+ maintainSelection(this.maps.selectedNavigationElementId, this.maps.navigationSelectionClass, navigationEle, 'navigationlineselectionMapStyle');
10198
+ navigationGroup.appendChild(navigationEle);
10199
+ group.appendChild(navigationGroup);
10182
10200
  }
10183
10201
  point = [];
10184
10202
  }
@@ -10744,14 +10762,14 @@ class Legend {
10744
10762
  leftPageElement.appendChild(render.drawPath(leftPageOptions));
10745
10763
  const leftRectPageOptions = new RectOption(map.element.id + '_Left_Page_Rect', 'transparent', {}, 1, new Rect(leftPageX - (width / 2), (locY - (height * 2)), width * 2, spacing * 2), null, null, '', '');
10746
10764
  let pathEle = render.drawRectangle(leftRectPageOptions);
10747
- pathEle.setAttribute('tabindex', ((page + 1) === 1 ? -1 : map.tabIndex + 1).toString());
10765
+ pathEle.tabIndex = (page + 1) === 1 ? -1 : (map.tabIndex + 1);
10748
10766
  leftPageElement.appendChild(pathEle);
10749
10767
  this.wireEvents(leftPageElement);
10750
10768
  const rightPageOptions = new PathOption(map.element.id + '_Right_Page', '#a6a6a6', 0, '#a6a6a6', ((page + 1) === this.totalPages.length ? 0.5 : 1), 1, '', rightPath);
10751
10769
  rightPageElement.appendChild(render.drawPath(rightPageOptions));
10752
10770
  const rightRectPageOptions = new RectOption(map.element.id + '_Right_Page_Rect', 'transparent', {}, 1, new Rect(rightPageX - spacing - (width / 2), (locY - (height * 2)), width * 2, spacing * 2), null, null, '', '');
10753
10771
  pathEle = render.drawRectangle(rightRectPageOptions);
10754
- pathEle.setAttribute('tabindex', ((page + 1) === this.totalPages.length ? -1 : map.tabIndex + 2).toString());
10772
+ pathEle.tabIndex = (page + 1) === this.totalPages.length ? -1 : (map.tabIndex + 2);
10755
10773
  rightPageElement.appendChild(pathEle);
10756
10774
  this.wireEvents(rightPageElement);
10757
10775
  pagingGroup.appendChild(leftPageElement);
@@ -10772,7 +10790,7 @@ class Legend {
10772
10790
  'dominant-baseline': ''
10773
10791
  };
10774
10792
  let pagingTextElement = render.createText(pageTextOptions, pagingText);
10775
- pagingTextElement.setAttribute('style', 'user-select: none;');
10793
+ pagingTextElement.style.cssText = 'user-select: none;';
10776
10794
  pagingGroup.appendChild(pagingTextElement);
10777
10795
  this.legendGroup.appendChild(pagingGroup);
10778
10796
  }
@@ -10906,11 +10924,14 @@ class Legend {
10906
10924
  this.legendHighlightCollection[length - 1]['MapShapeCollection']['Elements'].push(shapeElement);
10907
10925
  const shapeItemCount = this.legendHighlightCollection[length - 1]['MapShapeCollection']['Elements'].length - 1;
10908
10926
  const shapeOldFillColor = shapeElement.getAttribute('fill');
10927
+ const shapeOldOpacity = shapeElement.getAttribute('fill-opacity');
10909
10928
  this.legendHighlightCollection[length - 1]['shapeOldFillColor'].push(shapeOldFillColor);
10929
+ this.legendHighlightCollection[length - 1]['shapeOldOpacity'] = shapeOldOpacity;
10910
10930
  const shapeOldColor = this.legendHighlightCollection[length - 1]['shapeOldFillColor'][shapeItemCount];
10931
+ const shapeOldFillOpacity = this.legendHighlightCollection[length - 1]['shapeOldOpacity'];
10911
10932
  this.shapePreviousColor = this.legendHighlightCollection[length - 1]['shapeOldFillColor'];
10912
- this.setColor(shapeElement, !isNullOrUndefined(module.fill) ? module.fill : shapeOldColor, module.opacity.toString(), module.border.color, module.border.width.toString(), 'highlight');
10913
- this.setColor(targetElement, !isNullOrUndefined(module.fill) ? module.fill : legendHighlightColor, module.opacity.toString(), module.border.color, module.border.width.toString(), 'highlight');
10933
+ this.setColor(shapeElement, !isNullOrUndefined(module.fill) ? module.fill : shapeOldColor, isNullOrUndefined(module.opacity) ? shapeOldFillOpacity : module.opacity.toString(), module.border.color, module.border.width.toString(), 'highlight');
10934
+ this.setColor(targetElement, !isNullOrUndefined(module.fill) ? module.fill : legendHighlightColor, isNullOrUndefined(module.opacity) ? shapeOldFillOpacity : module.opacity.toString(), module.border.color, module.border.width.toString(), 'highlight');
10914
10935
  }
10915
10936
  else if (value === 'selection') {
10916
10937
  this.legendHighlightCollection = [];
@@ -10975,6 +10996,7 @@ class Legend {
10975
10996
  const length = collection.length;
10976
10997
  collection[length - 1]['MapShapeCollection'] = { Elements: [] };
10977
10998
  collection[length - 1]['shapeOldFillColor'] = [];
10999
+ collection[length - 1]['shapeOldOpacity'] = null;
10978
11000
  }
10979
11001
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
10980
11002
  removeLegend(collection) {
@@ -10986,7 +11008,8 @@ class Legend {
10986
11008
  for (let j = 0; j < dataCount; j++) {
10987
11009
  const shapeFillColor = item['legendOldFill'].indexOf('url') !== -1
10988
11010
  ? item['shapeOldFillColor'][j] : item['legendOldFill'];
10989
- this.setColor(item['MapShapeCollection']['Elements'][j], shapeFillColor, item['shapeOpacity'], item['shapeOldBorderColor'], item['shapeOldBorderWidth'], 'highlight');
11011
+ const shapeOpacity = !isNullOrUndefined(item['shapeOldOpacity']) ? item['shapeOldOpacity'] : item['shapeOpacity'];
11012
+ this.setColor(item['MapShapeCollection']['Elements'][j], shapeFillColor, shapeOpacity, item['shapeOldBorderColor'], item['shapeOldBorderWidth'], 'highlight');
10990
11013
  }
10991
11014
  }
10992
11015
  }
@@ -12516,16 +12539,34 @@ class Highlight {
12516
12539
  const marker$$1 = parseInt(targetEle.id.split('_MarkerIndex_')[1].split('_')[0], 10);
12517
12540
  isMarkerSelect = this.maps.layers[layerIndex].markerSettings[marker$$1].highlightSettings.enable;
12518
12541
  }
12519
- const border = {
12520
- color: (targetEle.parentElement.id.indexOf('LineString') === -1) ? this.highlightSettings.border.color : (this.highlightSettings.fill || this.highlightSettings.border.color),
12521
- width: (targetEle.parentElement.id.indexOf('LineString') === -1) ? (this.highlightSettings.border.width / (isMarkerSelect ? 1 : this.maps.scale)) : (this.highlightSettings.border.width / this.maps.scale),
12522
- opacity: this.highlightSettings.border.opacity
12523
- };
12542
+ const borderColor = (targetEle.parentElement.id.indexOf('LineString') === -1) ? this.highlightSettings.border.color : (this.highlightSettings.fill || this.highlightSettings.border.color);
12543
+ const borderWidth = (targetEle.parentElement.id.indexOf('LineString') === -1) ? (this.highlightSettings.border.width / (isMarkerSelect ? 1 : this.maps.scale)) : (this.highlightSettings.border.width / this.maps.scale);
12544
+ const borderOpacity = isNullOrUndefined(this.highlightSettings.border.opacity) ? this.highlightSettings.opacity : this.highlightSettings.border.opacity;
12524
12545
  const eventArgs = {
12525
12546
  opacity: this.highlightSettings.opacity,
12526
12547
  fill: (targetEle.parentElement.id.indexOf('LineString') === -1) ? (targetEle.id.indexOf('NavigationIndex') === -1 ? !isNullOrUndefined(this.highlightSettings.fill)
12527
12548
  ? this.highlightSettings.fill : targetEle.getAttribute('fill') : 'none') : 'transparent',
12528
- border: border,
12549
+ border: { color: borderColor, width: borderWidth, opacity: borderOpacity },
12550
+ cancel: false
12551
+ };
12552
+ const shapeEventArgs = {
12553
+ opacity: eventArgs.opacity,
12554
+ fill: eventArgs.fill,
12555
+ border: { color: borderColor, width: borderWidth, opacity: borderOpacity },
12556
+ name: shapeHighlight,
12557
+ target: targetEle.id,
12558
+ cancel: false,
12559
+ shapeData: shapeData,
12560
+ data: data,
12561
+ maps: this.maps
12562
+ };
12563
+ if (targetEle.id.indexOf('shapeIndex') > -1) {
12564
+ this.maps.trigger(shapeHighlight, shapeEventArgs, () => { });
12565
+ }
12566
+ const itemEventArgs = {
12567
+ opacity: eventArgs.opacity,
12568
+ fill: eventArgs.fill,
12569
+ border: { color: borderColor, width: borderWidth, opacity: borderOpacity },
12529
12570
  name: itemHighlight,
12530
12571
  target: targetEle.id,
12531
12572
  cancel: false,
@@ -12533,13 +12574,18 @@ class Highlight {
12533
12574
  data: data,
12534
12575
  maps: this.maps
12535
12576
  };
12536
- this.maps.trigger(itemHighlight, eventArgs, () => {
12537
- eventArgs.border.opacity = isNullOrUndefined(this.highlightSettings.border.opacity) ? this.highlightSettings.opacity : this.highlightSettings.border.opacity;
12538
- this.highlightMap(targetEle, eventArgs);
12577
+ this.maps.trigger(itemHighlight, itemEventArgs, () => {
12578
+ itemEventArgs.cancel = eventArgs.cancel !== itemEventArgs.cancel ? itemEventArgs.cancel : targetEle.id.indexOf('shapeIndex') > -1 ? shapeEventArgs.cancel : eventArgs.cancel;
12579
+ itemEventArgs.fill = eventArgs.fill !== itemEventArgs.fill ? itemEventArgs.fill : targetEle.id.indexOf('shapeIndex') > -1 ? shapeEventArgs.fill : eventArgs.fill;
12580
+ itemEventArgs.opacity = eventArgs.opacity !== itemEventArgs.opacity ? itemEventArgs.opacity : targetEle.id.indexOf('shapeIndex') > -1 ? shapeEventArgs.opacity : eventArgs.opacity;
12581
+ itemEventArgs.border.color = eventArgs.border.color !== itemEventArgs.border.color ? itemEventArgs.border.color : targetEle.id.indexOf('shapeIndex') > -1 ? shapeEventArgs.border.color : eventArgs.border.color;
12582
+ itemEventArgs.border.width = eventArgs.border.width !== itemEventArgs.border.width ? itemEventArgs.border.width : targetEle.id.indexOf('shapeIndex') > -1 ? shapeEventArgs.border.width : eventArgs.border.width;
12583
+ itemEventArgs.border.opacity = eventArgs.border.opacity !== itemEventArgs.border.opacity ? itemEventArgs.border.opacity : targetEle.id.indexOf('shapeIndex') > -1 ? shapeEventArgs.border.opacity : eventArgs.border.opacity;
12584
+ this.highlightMap(targetEle, itemEventArgs);
12539
12585
  });
12540
12586
  }
12541
12587
  highlightMap(targetEle, eventArgs) {
12542
- if (targetEle.getAttribute('class') === 'highlightMapStyle') {
12588
+ if (targetEle.getAttribute('class') === 'highlightMapStyle' || eventArgs.cancel) {
12543
12589
  return;
12544
12590
  }
12545
12591
  else {
@@ -13041,9 +13087,9 @@ class MapsTooltip {
13041
13087
  else {
13042
13088
  tooltipEle = createElement('div', {
13043
13089
  id: this.maps.element.id + '_mapsTooltip',
13044
- className: 'EJ2-maps-Tooltip',
13045
- styles: 'position: absolute;pointer-events:none;'
13090
+ className: 'EJ2-maps-Tooltip'
13046
13091
  });
13092
+ tooltipEle.style.cssText = 'position: absolute;pointer-events:none;';
13047
13093
  document.getElementById(this.maps.element.id + '_Secondary_Element').appendChild(tooltipEle);
13048
13094
  }
13049
13095
  if (option.template !== null && Object.keys(typeof option.template === 'object' ? option.template : {}).length === 1) {
@@ -13121,7 +13167,7 @@ class MapsTooltip {
13121
13167
  && tooltipTemplateElement.innerHTML.indexOf('</a>') !== -1) {
13122
13168
  let templateStyle = tooltipTemplateElement.getAttribute('style');
13123
13169
  templateStyle = templateStyle.replace('pointer-events: none;', 'position-events:all;');
13124
- tooltipTemplateElement.setAttribute('style', templateStyle);
13170
+ tooltipTemplateElement.style.cssText = templateStyle;
13125
13171
  }
13126
13172
  }
13127
13173
  else {
@@ -13709,7 +13755,7 @@ class Zoom {
13709
13755
  }
13710
13756
  else {
13711
13757
  markerStyle = 'visibility:hidden';
13712
- currentEle.setAttribute('style', markerStyle);
13758
+ currentEle.style.cssText = markerStyle;
13713
13759
  }
13714
13760
  }
13715
13761
  }
@@ -13825,22 +13871,22 @@ class Zoom {
13825
13871
  const layerIndex = parseInt((element ? element : layerElement).id.split('_LayerIndex_')[1].split('_')[0], 10);
13826
13872
  const markerSVGObject = this.maps.renderer.createGroup({
13827
13873
  id: this.maps.element.id + '_Markers_Group',
13828
- class: 'GroupElement',
13829
- style: 'pointer-events: auto;'
13874
+ class: 'GroupElement'
13830
13875
  });
13876
+ markerSVGObject.style.pointerEvents = 'auto';
13831
13877
  if (document.getElementById(markerSVGObject.id)) {
13832
13878
  removeElement(markerSVGObject.id);
13833
13879
  }
13834
13880
  const mapsAreaRect = this.maps.mapAreaRect;
13835
13881
  const markerTemplateElements = createElement('div', {
13836
13882
  id: this.maps.element.id + '_LayerIndex_' + layerIndex + '_Markers_Template_Group',
13837
- className: 'template',
13838
- styles: 'overflow: hidden; position: absolute;pointer-events: none;' +
13839
- 'top:' + mapsAreaRect.y + 'px;' +
13840
- 'left:' + mapsAreaRect.x + 'px;' +
13841
- 'height:' + mapsAreaRect.height + 'px;' +
13842
- 'width:' + mapsAreaRect.width + 'px;'
13883
+ className: 'template'
13843
13884
  });
13885
+ markerTemplateElements.style.cssText = 'overflow: hidden; position: absolute;pointer-events: none;' +
13886
+ 'top:' + mapsAreaRect.y + 'px;' +
13887
+ 'left:' + mapsAreaRect.x + 'px;' +
13888
+ 'height:' + mapsAreaRect.height + 'px;' +
13889
+ 'width:' + mapsAreaRect.width + 'px;';
13844
13890
  if (document.getElementById(markerTemplateElements.id)) {
13845
13891
  removeElement(markerTemplateElements.id);
13846
13892
  }
@@ -13971,16 +14017,26 @@ class Zoom {
13971
14017
  let labelX = label['location']['x'];
13972
14018
  let labelY = label['location']['y'];
13973
14019
  if (type === 'Template') {
13974
- const layerEle = getElementByID(this.maps.element.id + '_Layer_Collections');
13975
- labelX = ((Math.abs(this.maps.baseMapRectBounds['min']['x'] - labelX)) * scale);
13976
- labelY = ((Math.abs(this.maps.baseMapRectBounds['min']['y'] - labelY)) * scale);
13977
- const templateOffset = element.getBoundingClientRect();
13978
- const layerOffset = layerEle.getBoundingClientRect();
13979
- const elementOffset = element.parentElement.getBoundingClientRect();
13980
- const x = ((labelX) + (layerOffset.left - elementOffset.left) - (templateOffset.width / 2));
13981
- const y = ((labelY) + (layerOffset.top - elementOffset.top) - (templateOffset.height / 2));
13982
- element.style.left = x + 'px';
13983
- element.style.top = y + 'px';
14020
+ let locationX = 0;
14021
+ let locationY = 0;
14022
+ if (this.maps.isTileMap) {
14023
+ zoomtext = label['dataLabelText'];
14024
+ zoomtextSize = measureText(zoomtext, style);
14025
+ locationX = ((labelX + x) * scale) - (zoomtextSize['width'] / 2);
14026
+ locationY = ((labelY + y) * scale) - (zoomtextSize['height']);
14027
+ }
14028
+ else {
14029
+ const layerEle = getElementByID(this.maps.element.id + '_Layer_Collections');
14030
+ labelX = ((Math.abs(this.maps.baseMapRectBounds['min']['x'] - labelX)) * scale);
14031
+ labelY = ((Math.abs(this.maps.baseMapRectBounds['min']['y'] - labelY)) * scale);
14032
+ const templateOffset = element.getBoundingClientRect();
14033
+ const layerOffset = layerEle.getBoundingClientRect();
14034
+ const elementOffset = element.parentElement.getBoundingClientRect();
14035
+ locationX = ((labelX) + (layerOffset.left - elementOffset.left));
14036
+ locationY = ((labelY) + (layerOffset.top - elementOffset.top));
14037
+ }
14038
+ element.style.left = locationX + 'px';
14039
+ element.style.top = locationY + 'px';
13984
14040
  }
13985
14041
  else {
13986
14042
  labelX = ((labelX + x) * scale);
@@ -14111,10 +14167,10 @@ class Zoom {
14111
14167
  if (element['style']['display'] !== 'none') {
14112
14168
  if ((staticMapOffset['x'] > templateOffset['x'] || staticMapOffset['x'] + staticMapOffsetWidth < templateOffset['x'] + templateOffset['width'])
14113
14169
  && (staticMapOffset['y'] > templateOffset['y'] || staticMapOffset['y'] + staticMapOffset['height'] < templateOffset['y'] + templateOffset['height'])) {
14114
- element['style']['display'] = 'none';
14170
+ element.style.display = 'none';
14115
14171
  }
14116
14172
  else if ((staticMapOffset['x'] > templateOffset['x'] || staticMapOffset['x'] + staticMapOffsetWidth < templateOffset['x'] + templateOffset['width'])) {
14117
- element['style']['display'] = 'none';
14173
+ element.style.display = 'none';
14118
14174
  }
14119
14175
  }
14120
14176
  }
@@ -14251,7 +14307,6 @@ class Zoom {
14251
14307
  }
14252
14308
  map.zoomTranslatePoint = map.translatePoint;
14253
14309
  this.mouseDownPoints = this.mouseMovePoints;
14254
- this.maps.zoomNotApplied = false;
14255
14310
  this.isSingleClick = false;
14256
14311
  }
14257
14312
  toAlignSublayer() {
@@ -14591,7 +14646,8 @@ class Zoom {
14591
14646
  alignToolBar() {
14592
14647
  const map = this.maps;
14593
14648
  const padding = 10;
14594
- const element = createElement('div', { id: map.element.id + '_ToolBar', styles: 'position:absolute;z-index:2' });
14649
+ const element = createElement('div', { id: map.element.id + '_ToolBar' });
14650
+ element.style.cssText = 'position:absolute;z-index:2';
14595
14651
  const rectSVGObject = map.renderer.createSvg({
14596
14652
  id: map.element.id + '_Zooming_ToolBar', width: 10, height: 10
14597
14653
  });