@syncfusion/ej2-maps 20.3.47 → 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
  *
@@ -1634,7 +1635,7 @@ function checkShapeDataFields(dataSource, properties, dataPath, propertyPath, la
1634
1635
  dataSource[i][dataPath]);
1635
1636
  const shapePath = checkPropertyPath(shapeDataPath, propertyPath, properties);
1636
1637
  const shapeDataPathValue = !isNullOrUndefined(shapeDataPath) && isNaN(properties[shapePath])
1637
- ? shapeDataPath.toLowerCase() : shapeDataPath;
1638
+ ? (typeof shapeDataPath === 'string' ? shapeDataPath.toLowerCase() : shapeDataPath) : shapeDataPath;
1638
1639
  const propertiesShapePathValue = !isNullOrUndefined(properties[shapePath]) && isNaN(properties[shapePath])
1639
1640
  ? properties[shapePath].toLowerCase() : properties[shapePath];
1640
1641
  if (shapeDataPathValue === propertiesShapePathValue) {
@@ -1658,7 +1659,8 @@ function checkPropertyPath(shapeData, shapePropertyPath, shape) {
1658
1659
  const properties = (Object.prototype.toString.call(shapePropertyPath) === '[object Array]' ?
1659
1660
  shapePropertyPath : [shapePropertyPath]);
1660
1661
  for (let i = 0; i < properties.length; i++) {
1661
- const shapeDataValue = !isNullOrUndefined(shapeData) ? shapeData.toLowerCase() : shapeData;
1662
+ const shapeDataValue = !isNullOrUndefined(shapeData) && typeof shapeData === 'string' ?
1663
+ shapeData.toLowerCase() : shapeData;
1662
1664
  const shapePropertiesValue = !isNullOrUndefined(shape[properties[i]])
1663
1665
  && isNaN(shape[properties[i]])
1664
1666
  ? shape[properties[i]].toLowerCase() : shape[properties[i]];
@@ -2103,7 +2105,7 @@ function getZoomTranslate(mapObject, layer, animate) {
2103
2105
  mapObject.zoomSettings.zoomFactor ===
2104
2106
  mapObject.mapScaleValue ? mapObject.zoomSettings.zoomFactor :
2105
2107
  mapObject.zoomSettings.zoomFactor !== mapObject.mapScaleValue && !mapObject.centerPositionChanged ? mapObject.mapScaleValue : mapObject.zoomSettings.zoomFactor;
2106
- if (mapObject.zoomSettings.shouldZoomInitially) {
2108
+ if (mapObject.zoomSettings.shouldZoomInitially && !mapObject.isZoomByPosition) {
2107
2109
  mapObject.mapScaleValue = zoomFactorValue = scaleFactor = ((mapObject.enablePersistence || mapObject.zoomSettings.shouldZoomInitially) && mapObject.scale === 1)
2108
2110
  ? mapObject.scale : (isNullOrUndefined(mapObject.markerZoomFactor)) ? mapObject.mapScaleValue : mapObject.markerZoomFactor;
2109
2111
  zoomFactorValue = mapObject.mapScaleValue;
@@ -2137,6 +2139,10 @@ function getZoomTranslate(mapObject, layer, animate) {
2137
2139
  y = -point.y + topPosition;
2138
2140
  }
2139
2141
  else {
2142
+ if (mapObject.isZoomByPosition) {
2143
+ mapObject.zoomTranslatePoint.x = -point.x + leftPosition;
2144
+ mapObject.zoomTranslatePoint.y = -point.y + topPosition;
2145
+ }
2140
2146
  x = mapObject.zoomTranslatePoint.x;
2141
2147
  y = mapObject.zoomTranslatePoint.y;
2142
2148
  zoomFactorValue = zoomFactor;
@@ -2344,7 +2350,7 @@ function triggerShapeEvent(targetId, selection, maps, eventName) {
2344
2350
  target: targetId,
2345
2351
  maps: maps
2346
2352
  };
2347
- maps.trigger(eventName, eventArgs, (observedArgs) => {
2353
+ maps.trigger(eventName, eventArgs, () => {
2348
2354
  eventArgs.border.opacity = isNullOrUndefined(eventArgs.border.opacity) ? eventArgs.opacity : eventArgs.border.opacity;
2349
2355
  });
2350
2356
  return eventArgs;
@@ -2571,11 +2577,11 @@ function showTooltip(text, size, x, y, areaWidth, areaHeight, id, element, isTou
2571
2577
  }
2572
2578
  if (!tooltip) {
2573
2579
  tooltip = createElement('div', {
2574
- id: id,
2575
- styles: 'background-color: rgb(255, 255, 255) !important; color:black !important; ' +
2576
- 'position:absolute;border:1px solid rgb(0, 0, 0); padding-left:5px;' +
2577
- 'font-size:12px; font-family: "Segoe UI"; text-align:center'
2580
+ id: id
2578
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';
2579
2585
  }
2580
2586
  if (x < (areaWidth - width)) {
2581
2587
  // eslint-disable-next-line no-self-assign
@@ -2673,13 +2679,14 @@ function createTooltip(id, text, top, left, fontSize) {
2673
2679
  'position:absolute;border:1px solid #707070;font-size:' + fontSize + ';border-radius:2px;';
2674
2680
  if (!tooltip) {
2675
2681
  tooltip = createElement('div', {
2676
- id: id, innerHTML: '&nbsp;' + text + '&nbsp;', styles: style
2682
+ id: id, innerHTML: '&nbsp;' + text + '&nbsp;'
2677
2683
  });
2684
+ tooltip.style.cssText = style;
2678
2685
  document.body.appendChild(tooltip);
2679
2686
  }
2680
2687
  else {
2681
- tooltip.setAttribute('innerHTML', '&nbsp;' + text + '&nbsp;');
2682
- tooltip.setAttribute('styles', style);
2688
+ tooltip.innerHTML = '&nbsp;' + text + '&nbsp;';
2689
+ tooltip.style.cssText = style;
2683
2690
  }
2684
2691
  }
2685
2692
  /**
@@ -3075,7 +3082,7 @@ function animate(element, delay, duration, process, end) {
3075
3082
  end.call(this, { element: element });
3076
3083
  if (element.id.indexOf('Marker') > -1) {
3077
3084
  let markerElement = getElementByID(element.id.split('_Layer')[0] + '_Markers_Group');
3078
- markerElement.setAttribute('style', markerStyle);
3085
+ markerElement.style.cssText = markerStyle;
3079
3086
  }
3080
3087
  }
3081
3088
  };
@@ -4229,7 +4236,7 @@ __decorate$1([
4229
4236
  Property(false)
4230
4237
  ], ZoomSettings.prototype, "doubleClickZoom", void 0);
4231
4238
  __decorate$1([
4232
- Property(false)
4239
+ Property(true)
4233
4240
  ], ZoomSettings.prototype, "pinchZooming", void 0);
4234
4241
  __decorate$1([
4235
4242
  Property(false)
@@ -4661,18 +4668,18 @@ class Marker {
4661
4668
  const currentLayer = maps.layersCollection[layerIndex];
4662
4669
  this.markerSVGObject = maps.renderer.createGroup({
4663
4670
  id: maps.element.id + '_Markers_Group',
4664
- class: 'GroupElement',
4665
- style: 'pointer-events: auto;'
4671
+ class: 'GroupElement'
4666
4672
  });
4673
+ this.markerSVGObject.style.pointerEvents = 'auto';
4667
4674
  const markerTemplateEle = createElement('div', {
4668
4675
  id: maps.element.id + '_LayerIndex_' + layerIndex + '_Markers_Template_Group',
4669
- className: maps.element.id + '_template',
4670
- styles: 'overflow: hidden; position: absolute;pointer-events: none;' +
4671
- 'top:' + maps.mapAreaRect.y + 'px;' +
4672
- 'left:' + maps.mapAreaRect.x + 'px;' +
4673
- 'height:' + maps.mapAreaRect.height + 'px;' +
4674
- 'width:' + maps.mapAreaRect.width + 'px;'
4676
+ className: maps.element.id + '_template'
4675
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;';
4676
4683
  currentLayer.markerSettings.map((markerSettings, markerIndex) => {
4677
4684
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
4678
4685
  const markerData = markerSettings.dataSource;
@@ -4889,7 +4896,8 @@ class Marker {
4889
4896
  }
4890
4897
  if (this.maps.isTileMap && !this.maps.enablePersistence
4891
4898
  && this.maps.mapScaleValue <= 1) {
4892
- 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;
4893
4901
  if (this.maps.mapScaleValue === 1 && this.maps.markerZoomFactor === 1) {
4894
4902
  this.maps.tileTranslatePoint.x = 0;
4895
4903
  this.maps.tileTranslatePoint.y = 0;
@@ -5036,7 +5044,7 @@ class Marker {
5036
5044
  }
5037
5045
  const options = this.getMarker(targetId);
5038
5046
  if (this.maps.markerClusterExpand) {
5039
- e.target.setAttribute('style', 'cursor: pointer');
5047
+ e.target.style.cursor = 'pointer';
5040
5048
  }
5041
5049
  if (isNullOrUndefined(options)) {
5042
5050
  return;
@@ -5552,10 +5560,10 @@ class LayerPanel {
5552
5560
  height: areaRect.height
5553
5561
  });
5554
5562
  const parentElement = createElement('div', {
5555
- id: this.mapObject.element.id + '_Tile_SVG_Parent', styles: 'position: absolute; height: ' +
5556
- (areaRect.height) + 'px; width: '
5557
- + (areaRect.width) + 'px;'
5563
+ id: this.mapObject.element.id + '_Tile_SVG_Parent'
5558
5564
  });
5565
+ parentElement.style.cssText = 'position: absolute; height: ' + (areaRect.height) + 'px; width: ' +
5566
+ (areaRect.width) + 'px;';
5559
5567
  parentElement.appendChild(this.tileSvgObject);
5560
5568
  secondaryEle.appendChild(parentElement);
5561
5569
  }
@@ -5609,13 +5617,13 @@ class LayerPanel {
5609
5617
  (!isNullOrUndefined(panel.mapObject.tileZoomLevel) && panel.mapObject.tileZoomLevel !== 1)) ?
5610
5618
  false : true;
5611
5619
  if (isNullOrUndefined(panel.mapObject.previousCenterLatitude) &&
5612
- isNullOrUndefined(panel.mapObject.previousCenterLongitude)) {
5620
+ isNullOrUndefined(panel.mapObject.previousCenterLongitude) && !panel.mapObject.isZoomByPosition) {
5613
5621
  panel.mapObject.previousCenterLatitude = panel.mapObject.centerPosition.latitude;
5614
5622
  panel.mapObject.previousCenterLongitude = panel.mapObject.centerPosition.longitude;
5615
5623
  }
5616
- else if (panel.mapObject.previousCenterLatitude !==
5624
+ else if ((panel.mapObject.previousCenterLatitude !==
5617
5625
  panel.mapObject.centerPosition.latitude && panel.mapObject.previousCenterLongitude !==
5618
- panel.mapObject.centerPosition.longitude) {
5626
+ panel.mapObject.centerPosition.longitude) || panel.mapObject.isZoomByPosition) {
5619
5627
  panel.mapObject.centerPositionChanged = true;
5620
5628
  panel.mapObject.previousCenterLatitude = panel.mapObject.centerPosition.latitude;
5621
5629
  panel.mapObject.previousCenterLongitude = panel.mapObject.centerPosition.longitude;
@@ -5627,7 +5635,8 @@ class LayerPanel {
5627
5635
  let centerTileMap = center;
5628
5636
  if ((this.mapObject.isTileMap && panel.mapObject.markerModule) && panel.mapObject.zoomSettings.enable) {
5629
5637
  panel.mapObject.markerModule.calculateZoomCenterPositionAndFactor(this.mapObject.layersCollection);
5630
- if (!isNullOrUndefined(this.mapObject.markerCenterLatitude) && !isNullOrUndefined(this.mapObject.markerCenterLongitude)) {
5638
+ if (!isNullOrUndefined(this.mapObject.markerCenterLatitude) && !isNullOrUndefined(this.mapObject.markerCenterLongitude)
5639
+ && !panel.mapObject.isZoomByPosition) {
5631
5640
  centerTileMap = new Point(panel.mapObject.markerCenterLongitude, panel.mapObject.markerCenterLatitude);
5632
5641
  }
5633
5642
  }
@@ -5643,7 +5652,7 @@ class LayerPanel {
5643
5652
  else {
5644
5653
  center = { x: null, y: null };
5645
5654
  }
5646
- let zoomFactorValue = panel.mapObject.zoomSettings.shouldZoomInitially ?
5655
+ let zoomFactorValue = (panel.mapObject.zoomSettings.shouldZoomInitially && !panel.mapObject.isZoomByPosition) ?
5647
5656
  isNullOrUndefined(panel.mapObject.markerZoomFactor) ? 1 :
5648
5657
  panel.mapObject.markerZoomFactor : panel.mapObject.zoomSettings.zoomFactor;
5649
5658
  zoomFactorValue = (panel.mapObject.enablePersistence) ? ((isNullOrUndefined(panel.mapObject.mapScaleValue))
@@ -5897,13 +5906,13 @@ class LayerPanel {
5897
5906
  const colors = shapeSettings.palette.length > 1 ? shapeSettings.palette : getShapeColor(this.mapObject.theme);
5898
5907
  const labelTemplateEle = createElement('div', {
5899
5908
  id: this.mapObject.element.id + '_LayerIndex_' + layerIndex + '_Label_Template_Group',
5900
- className: this.mapObject.element.id + '_template',
5901
- styles: 'pointer-events: none; overflow: hidden; position: absolute;' +
5902
- 'top:' + this.mapObject.mapAreaRect.y + 'px;' +
5903
- 'left:' + this.mapObject.mapAreaRect.x + 'px;' +
5904
- 'height:' + this.mapObject.mapAreaRect.height + 'px;' +
5905
- 'width:' + this.mapObject.mapAreaRect.width + 'px;'
5909
+ className: this.mapObject.element.id + '_template'
5906
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;';
5907
5916
  if (this.currentLayer.layerData.length !== 0) {
5908
5917
  for (let i = 0; i < this.currentLayer.layerData.length; i++) {
5909
5918
  let k;
@@ -6131,10 +6140,10 @@ class LayerPanel {
6131
6140
  }
6132
6141
  pathEle.setAttribute('aria-label', ((!isNullOrUndefined(currentShapeData['property'])) ?
6133
6142
  (currentShapeData['property'][properties]) : ''));
6134
- pathEle.setAttribute('tabindex', (this.mapObject.tabIndex + index + 3).toString());
6143
+ pathEle.tabIndex = this.mapObject.tabIndex + index + 3;
6135
6144
  pathEle.setAttribute('role', '');
6136
6145
  if (drawingType === 'LineString' || drawingType === 'MultiLineString') {
6137
- pathEle.setAttribute('style', 'outline:none');
6146
+ pathEle.style.cssText = 'outline:none';
6138
6147
  }
6139
6148
  maintainSelection(this.mapObject.selectedElementId, this.mapObject.shapeSelectionClass, pathEle, 'ShapeselectionMapStyle');
6140
6149
  if (this.mapObject.toggledShapeElementId) {
@@ -6188,9 +6197,9 @@ class LayerPanel {
6188
6197
  this.mapObject.markerModule.calculateZoomCenterPositionAndFactor(this.mapObject.layersCollection);
6189
6198
  }
6190
6199
  const group = (this.mapObject.renderer.createGroup({
6191
- id: this.mapObject.element.id + '_LayerIndex_' + layerIndex + '_dataLableIndex_Group',
6192
- style: 'pointer-events: none;'
6200
+ id: this.mapObject.element.id + '_LayerIndex_' + layerIndex + '_dataLableIndex_Group'
6193
6201
  }));
6202
+ group.style.pointerEvents = 'none';
6194
6203
  if (this.mapObject.dataLabelModule && this.currentLayer.dataLabelSettings.visible) {
6195
6204
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
6196
6205
  const intersect = [];
@@ -6706,7 +6715,8 @@ class LayerPanel {
6706
6715
  }
6707
6716
  }
6708
6717
  }
6709
- 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) {
6710
6720
  this.arrangeTiles(zoomType, this.animateToZoomX, this.animateToZoomY);
6711
6721
  }
6712
6722
  }
@@ -6986,8 +6996,9 @@ class Annotations {
6986
6996
  const availSize = map.availableSize;
6987
6997
  const id = map.element.id + '_Annotation_' + annotationIndex;
6988
6998
  const childElement = createElement('div', {
6989
- id: map.element.id + '_Annotation_' + annotationIndex, styles: 'position: absolute; z-index:' + annotation.zIndex + ';'
6999
+ id: map.element.id + '_Annotation_' + annotationIndex
6990
7000
  });
7001
+ childElement.style.cssText = 'position: absolute; z-index:' + annotation.zIndex + ';';
6991
7002
  const argsData = {
6992
7003
  cancel: false, name: annotationRendering, content: annotation.content,
6993
7004
  annotation: annotation
@@ -7504,7 +7515,9 @@ let Maps = class Maps extends Component {
7504
7515
  }
7505
7516
  }
7506
7517
  this.zoomingChange();
7507
- this.trigger(loaded, { maps: this, isResized: this.isResize });
7518
+ if (!this.isZoomByPosition && !this.zoomNotApplied) {
7519
+ this.trigger(loaded, { maps: this, isResized: this.isResize });
7520
+ }
7508
7521
  this.isResize = false;
7509
7522
  }
7510
7523
  /**
@@ -7598,7 +7611,7 @@ let Maps = class Maps extends Component {
7598
7611
  addTabIndex() {
7599
7612
  this.element.setAttribute('aria-label', this.description || 'Maps Element');
7600
7613
  this.element.setAttribute('role', '');
7601
- this.element.setAttribute('tabindex', this.tabIndex.toString());
7614
+ this.element.tabIndex = this.tabIndex;
7602
7615
  }
7603
7616
  // private setSecondaryElementPosition(): void {
7604
7617
  // if (!this.isTileMap) {
@@ -7661,7 +7674,7 @@ let Maps = class Maps extends Component {
7661
7674
  }
7662
7675
  }
7663
7676
  }
7664
- if (this.zoomModule && (this.previousScale !== this.scale)) {
7677
+ if (this.zoomModule && ((this.previousScale !== this.scale) || this.zoomNotApplied || this.isZoomByPosition)) {
7665
7678
  this.zoomModule.applyTransform(this, true);
7666
7679
  }
7667
7680
  }
@@ -7669,9 +7682,9 @@ let Maps = class Maps extends Component {
7669
7682
  createSecondaryElement() {
7670
7683
  if (isNullOrUndefined(document.getElementById(this.element.id + '_Secondary_Element'))) {
7671
7684
  const secondaryElement = createElement('div', {
7672
- id: this.element.id + '_Secondary_Element',
7673
- styles: 'position: absolute;z-index:2;'
7685
+ id: this.element.id + '_Secondary_Element'
7674
7686
  });
7687
+ secondaryElement.style.cssText = 'position: absolute;z-index:2;';
7675
7688
  this.element.appendChild(secondaryElement);
7676
7689
  }
7677
7690
  }
@@ -7725,18 +7738,20 @@ let Maps = class Maps extends Component {
7725
7738
  removeElement(this.element.id + '_tiles');
7726
7739
  removeElement('animated_tiles');
7727
7740
  const ele = createElement('div', {
7728
- id: this.element.id + '_tile_parent', styles: 'position: absolute; left: ' +
7729
- (this.mapAreaRect.x) + 'px; right: ' + (this.margin.right) + 'px; top: '
7730
- + (this.mapAreaRect.y + padding) + 'px; height: ' +
7731
- (this.mapAreaRect.height) + 'px; width: '
7732
- + (this.mapAreaRect.width) + 'px; overflow: hidden;'
7741
+ id: this.element.id + '_tile_parent'
7733
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;';
7734
7748
  const ele1 = createElement('div', {
7735
- id: this.element.id + '_tiles', styles: 'position: absolute; left: ' +
7736
- (this.mapAreaRect.x) + 'px; right: ' + (this.margin.right) + 'px; top: '
7737
- + (this.mapAreaRect.y + padding) + 'px; height: ' + (this.mapAreaRect.height) + 'px; width: '
7738
- + (this.mapAreaRect.width) + 'px; overflow: hidden;'
7749
+ id: this.element.id + '_tiles'
7739
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;';
7740
7755
  this.element.appendChild(ele);
7741
7756
  this.element.appendChild(ele1);
7742
7757
  }
@@ -8218,9 +8233,6 @@ let Maps = class Maps extends Component {
8218
8233
  const markerModule = this.markerModule;
8219
8234
  if (element.id.indexOf('shapeIndex') > -1 || element.id.indexOf('Tile') > -1) {
8220
8235
  this.mergeCluster();
8221
- if (element.id.indexOf('shapeIndex') > -1) {
8222
- this.triggerShapeSelection(element);
8223
- }
8224
8236
  }
8225
8237
  if (markerModule) {
8226
8238
  markerModule.markerClick(e);
@@ -8400,32 +8412,30 @@ let Maps = class Maps extends Component {
8400
8412
  * @returns {void}
8401
8413
  */
8402
8414
  zoomByPosition(centerPosition, zoomFactor) {
8403
- const factor = this.mapLayerPanel.calculateFactor(this.layersCollection[0]);
8404
- let position;
8405
- const size = this.mapAreaRect;
8415
+ this.zoomNotApplied = false;
8416
+ let isRefresh = this.zoomSettings.zoomFactor == zoomFactor;
8406
8417
  if (!this.isTileMap && this.zoomModule) {
8407
8418
  if (!isNullOrUndefined(centerPosition)) {
8408
- position = convertGeoToPoint(centerPosition.latitude, centerPosition.longitude, factor, this.layersCollection[0], this);
8409
- const mapRect = document.getElementById(this.element.id + '_Layer_Collections').getBoundingClientRect();
8410
- const svgRect = this.svgObject.getBoundingClientRect();
8411
- const xDiff = Math.abs(mapRect.left - svgRect.left) / this.scale;
8412
- const yDiff = Math.abs(mapRect.top - svgRect.top) / this.scale;
8413
- const x = this.translatePoint.x + xDiff;
8414
- const y = this.translatePoint.y + yDiff;
8415
- this.scale = zoomFactor;
8416
- this.translatePoint.x = ((mapRect.left < svgRect.left ? x : 0) + (size.width / 2) - (position.x * zoomFactor)) / zoomFactor;
8417
- this.translatePoint.y = ((mapRect.top < svgRect.top ? y : 0) + (size.height / 2) - (position.y * zoomFactor)) / zoomFactor;
8418
- 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;
8419
8424
  }
8420
8425
  else {
8421
- position = { x: size.width / 2, y: size.height / 2 };
8422
- this.zoomModule.performZooming(position, zoomFactor, zoomFactor > this.scale ? 'ZoomIn' : 'ZoomOut');
8426
+ this.zoomSettings.zoomFactor = zoomFactor;
8427
+ this.isZoomByPosition = true;
8428
+ this.mapScaleValue = null;
8423
8429
  }
8424
8430
  }
8425
8431
  else if (this.zoomModule) {
8426
- this.tileZoomLevel = zoomFactor;
8427
- this.tileTranslatePoint = this.mapLayerPanel['panTileMap'](this.availableSize.width, this.availableSize.height, { x: centerPosition.longitude, y: centerPosition.latitude });
8428
- 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();
8429
8439
  }
8430
8440
  }
8431
8441
  /**
@@ -8538,7 +8548,7 @@ let Maps = class Maps extends Component {
8538
8548
  const propertyName = !isNullOrUndefined(shapeData[i]['properties'][popertyNameArray[j]])
8539
8549
  && isNaN(shapeData[i]['properties'][popertyNameArray[j]]) ?
8540
8550
  shapeData[i]['properties'][popertyNameArray[j]].toLowerCase() : shapeData[i]['properties'][popertyNameArray[j]];
8541
- const shapeName = !isNullOrUndefined(name) ? name.toLowerCase() : name;
8551
+ const shapeName = !isNullOrUndefined(name) && typeof name === 'string' ? name.toLowerCase() : name;
8542
8552
  let k;
8543
8553
  if (propertyName === shapeName) {
8544
8554
  if (!isNullOrUndefined(this.layers[layerIndex].shapeSettings.colorValuePath)) {
@@ -8616,6 +8626,11 @@ let Maps = class Maps extends Component {
8616
8626
  let centerLatitude;
8617
8627
  let centerLongtitude;
8618
8628
  let isTwoCoordinates = false;
8629
+ this.centerPosition = {
8630
+ latitude: null,
8631
+ longitude: null
8632
+ };
8633
+ this.isZoomByPosition = false;
8619
8634
  if (isNullOrUndefined(maxLatitude) && isNullOrUndefined(maxLongitude)
8620
8635
  || isNullOrUndefined(minLatitude) && isNullOrUndefined(minLongitude)) {
8621
8636
  minLatitude = isNullOrUndefined(minLatitude) ? 0 : minLatitude;
@@ -9668,10 +9683,10 @@ class DataLabel {
9668
9683
  for (let i = 0; i < dataSource.length; i++) {
9669
9684
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
9670
9685
  const data = dataSource[i];
9671
- const dataShapePathValue = !isNullOrUndefined(data[shapeDataPath]) && isNaN(data[shapeDataPath]) ?
9672
- data[shapeDataPath].toLowerCase() : data[shapeDataPath];
9673
- shapeName = !isNullOrUndefined(shapeName) ? shapeName.toString() : shapeName;
9674
- shapeNameValue = !isNullOrUndefined(shapeName) ? shapeName.toLowerCase() : shapeName;
9686
+ const dataShapePathValue = !isNullOrUndefined(data[shapeDataPath]) && isNaN(data[shapeDataPath]) &&
9687
+ typeof data[shapeDataPath] === 'string' ? data[shapeDataPath].toLowerCase() : data[shapeDataPath];
9688
+ shapeName = !isNullOrUndefined(shapeName) && typeof shapeName === 'string' ? shapeName.toString() : shapeName;
9689
+ shapeNameValue = !isNullOrUndefined(shapeName) && typeof shapeName === 'string' ? shapeName.toLowerCase() : shapeName;
9675
9690
  if ((dataShapePathValue) === shapeNameValue) {
9676
9691
  text = data;
9677
9692
  break;
@@ -9892,8 +9907,14 @@ class DataLabel {
9892
9907
  datasrcObj : shapeData['properties'], this.maps, eventargs.template, this.maps.element.id + '_LabelTemplate', false) : document.createElement('div');
9893
9908
  templateElement.innerHTML = !templateFn ? eventargs.template : '';
9894
9909
  labelElement = convertElementFromLabel(templateElement, labelId, !isNullOrUndefined(datasrcObj) ? datasrcObj : shapeData['properties'], index, this.maps);
9895
- labelElement.style.left = ((Math.abs(this.maps.baseMapRectBounds['min']['x'] - location['x'])) * scale) + labelArgs.offsetX + 'px';
9896
- 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
+ }
9897
9918
  labelTemplateElement.appendChild(labelElement);
9898
9919
  }
9899
9920
  else {
@@ -10133,51 +10154,49 @@ class NavigationLine {
10133
10154
  direction = 0;
10134
10155
  }
10135
10156
  }
10136
- if (point[j]['x'] !== point[j + 1]['x']) {
10137
- if (showArrow) {
10138
- arrowColor = arrowSettings['properties']['color'];
10139
- arrowSize = arrowSettings['properties']['size'];
10140
- offSetValue = (arrowSettings['properties']['offSet'] === undefined) ? 0 : arrowSettings['properties']['offSet'];
10141
- const divide = (Math.round(arrowSize / 2));
10142
- arrowPosition = arrowSettings['properties']['position'];
10143
- startArrow = (arrowPosition === 'Start') ? 'url(#triangle' + i + ')' : null;
10144
- endArrow = (arrowPosition === 'End') ? 'url(#triangle' + i + ')' : null;
10145
- if (offSet !== 0 && angle === 0) {
10146
- offSet = (arrowPosition === 'Start') ? offSetValue : -(offSetValue);
10147
- }
10148
- offSet = (isNullOrUndefined(offSet)) ? 0 : offSet;
10149
- const triId = this.maps.element.id + '_triangle';
10150
- const defElement = this.maps.renderer.createDefs();
10151
- defElement.innerHTML += '<marker id="' + 'triangle' + i + '"></marker>';
10152
- const markerEle = defElement.querySelector('#' + 'triangle' + i);
10153
- markerEle.setAttribute('markerWidth', (arrowSize.toString()));
10154
- markerEle.setAttribute('markerHeight', (arrowSize.toString()));
10155
- markerEle.setAttribute('refX', (divide - offSet).toString());
10156
- markerEle.setAttribute('refY', divide.toString());
10157
- markerEle.setAttribute('orient', 'auto');
10158
- const d2 = 'M 0,0 L 0,' + arrowSize + ' L ' + divide + ', ' + divide + ' Z';
10159
- pathOption = new PathOption(triId, arrowColor, width, color, 1, 1, dashArray, d2);
10160
- navigationEle = this.maps.renderer.drawPath(pathOption);
10161
- markerEle.appendChild(navigationEle);
10162
- defElement.appendChild(markerEle);
10163
- navigationGroup.appendChild(defElement);
10164
- }
10165
- angle = Math.abs(angle);
10166
- d = (angle === 0) ? 'M ' + point[j]['x'] + ',' + point[j]['y'] + 'L ' + point[j + 1]['x']
10167
- + ',' + point[j + 1]['y'] + ' ' :
10168
- 'M ' + point[j]['x'] + ',' + point[j]['y'] + ' A ' + (radius / 2 + (1 - angle) * radius / (angle * 10)) +
10169
- ' ' + (radius / 2 + (1 - angle) * radius / (angle * 10)) + ' ' + 0 + ',' + 0 + ','
10170
- + direction + ' , ' + point[j + 1]['x'] + ',' + point[j + 1]['y'] + ' ';
10171
- 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);
10172
10180
  navigationEle = this.maps.renderer.drawPath(pathOption);
10173
- if (!isNullOrUndefined(arrowPosition)) {
10174
- const position = (arrowPosition === 'Start') ? navigationEle.setAttribute('marker-start', startArrow)
10175
- : navigationEle.setAttribute('marker-end', endArrow);
10176
- }
10177
- maintainSelection(this.maps.selectedNavigationElementId, this.maps.navigationSelectionClass, navigationEle, 'navigationlineselectionMapStyle');
10178
- navigationGroup.appendChild(navigationEle);
10179
- group.appendChild(navigationGroup);
10180
- }
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);
10181
10200
  }
10182
10201
  point = [];
10183
10202
  }
@@ -10743,14 +10762,14 @@ class Legend {
10743
10762
  leftPageElement.appendChild(render.drawPath(leftPageOptions));
10744
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, '', '');
10745
10764
  let pathEle = render.drawRectangle(leftRectPageOptions);
10746
- pathEle.setAttribute('tabindex', ((page + 1) === 1 ? -1 : map.tabIndex + 1).toString());
10765
+ pathEle.tabIndex = (page + 1) === 1 ? -1 : (map.tabIndex + 1);
10747
10766
  leftPageElement.appendChild(pathEle);
10748
10767
  this.wireEvents(leftPageElement);
10749
10768
  const rightPageOptions = new PathOption(map.element.id + '_Right_Page', '#a6a6a6', 0, '#a6a6a6', ((page + 1) === this.totalPages.length ? 0.5 : 1), 1, '', rightPath);
10750
10769
  rightPageElement.appendChild(render.drawPath(rightPageOptions));
10751
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, '', '');
10752
10771
  pathEle = render.drawRectangle(rightRectPageOptions);
10753
- 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);
10754
10773
  rightPageElement.appendChild(pathEle);
10755
10774
  this.wireEvents(rightPageElement);
10756
10775
  pagingGroup.appendChild(leftPageElement);
@@ -10771,7 +10790,7 @@ class Legend {
10771
10790
  'dominant-baseline': ''
10772
10791
  };
10773
10792
  let pagingTextElement = render.createText(pageTextOptions, pagingText);
10774
- pagingTextElement.setAttribute('style', 'user-select: none;');
10793
+ pagingTextElement.style.cssText = 'user-select: none;';
10775
10794
  pagingGroup.appendChild(pagingTextElement);
10776
10795
  this.legendGroup.appendChild(pagingGroup);
10777
10796
  }
@@ -10905,11 +10924,14 @@ class Legend {
10905
10924
  this.legendHighlightCollection[length - 1]['MapShapeCollection']['Elements'].push(shapeElement);
10906
10925
  const shapeItemCount = this.legendHighlightCollection[length - 1]['MapShapeCollection']['Elements'].length - 1;
10907
10926
  const shapeOldFillColor = shapeElement.getAttribute('fill');
10927
+ const shapeOldOpacity = shapeElement.getAttribute('fill-opacity');
10908
10928
  this.legendHighlightCollection[length - 1]['shapeOldFillColor'].push(shapeOldFillColor);
10929
+ this.legendHighlightCollection[length - 1]['shapeOldOpacity'] = shapeOldOpacity;
10909
10930
  const shapeOldColor = this.legendHighlightCollection[length - 1]['shapeOldFillColor'][shapeItemCount];
10931
+ const shapeOldFillOpacity = this.legendHighlightCollection[length - 1]['shapeOldOpacity'];
10910
10932
  this.shapePreviousColor = this.legendHighlightCollection[length - 1]['shapeOldFillColor'];
10911
- this.setColor(shapeElement, !isNullOrUndefined(module.fill) ? module.fill : shapeOldColor, module.opacity.toString(), module.border.color, module.border.width.toString(), 'highlight');
10912
- 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');
10913
10935
  }
10914
10936
  else if (value === 'selection') {
10915
10937
  this.legendHighlightCollection = [];
@@ -10974,6 +10996,7 @@ class Legend {
10974
10996
  const length = collection.length;
10975
10997
  collection[length - 1]['MapShapeCollection'] = { Elements: [] };
10976
10998
  collection[length - 1]['shapeOldFillColor'] = [];
10999
+ collection[length - 1]['shapeOldOpacity'] = null;
10977
11000
  }
10978
11001
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
10979
11002
  removeLegend(collection) {
@@ -10985,7 +11008,8 @@ class Legend {
10985
11008
  for (let j = 0; j < dataCount; j++) {
10986
11009
  const shapeFillColor = item['legendOldFill'].indexOf('url') !== -1
10987
11010
  ? item['shapeOldFillColor'][j] : item['legendOldFill'];
10988
- 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');
10989
11013
  }
10990
11014
  }
10991
11015
  }
@@ -12267,10 +12291,11 @@ class Legend {
12267
12291
  const shapeData = layerData[i];
12268
12292
  const dataPathValue = (dataPath.indexOf('.') > -1) ? getValueFromObject(data, dataPath) : data[dataPath];
12269
12293
  const shapePath = checkPropertyPath(data[dataPath], shapePropertyPath, shapeData['properties']);
12270
- const dataPathValueCase = !isNullOrUndefined(dataPathValue)
12271
- ? dataPathValue.toLowerCase() : dataPathValue;
12294
+ const dataPathValueCase = !isNullOrUndefined(dataPathValue) &&
12295
+ typeof dataPathValue === 'string' ? dataPathValue.toLowerCase() : dataPathValue;
12272
12296
  const shapeDataValueCase = !isNullOrUndefined(shapeData['properties'][shapePath])
12273
- && isNaN(shapeData['properties'][shapePath]) ? shapeData['properties'][shapePath].toLowerCase() : shapeData['properties'][shapePath];
12297
+ && isNaN(shapeData['properties'][shapePath]) ?
12298
+ shapeData['properties'][shapePath].toLowerCase() : shapeData['properties'][shapePath];
12274
12299
  if (shapeDataValueCase === dataPathValueCase) {
12275
12300
  if (shapeData['geometry']['type'] != 'MultiPoint') {
12276
12301
  legendData.push({
@@ -12514,16 +12539,34 @@ class Highlight {
12514
12539
  const marker$$1 = parseInt(targetEle.id.split('_MarkerIndex_')[1].split('_')[0], 10);
12515
12540
  isMarkerSelect = this.maps.layers[layerIndex].markerSettings[marker$$1].highlightSettings.enable;
12516
12541
  }
12517
- const border = {
12518
- color: (targetEle.parentElement.id.indexOf('LineString') === -1) ? this.highlightSettings.border.color : (this.highlightSettings.fill || this.highlightSettings.border.color),
12519
- width: (targetEle.parentElement.id.indexOf('LineString') === -1) ? (this.highlightSettings.border.width / (isMarkerSelect ? 1 : this.maps.scale)) : (this.highlightSettings.border.width / this.maps.scale),
12520
- opacity: this.highlightSettings.border.opacity
12521
- };
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;
12522
12545
  const eventArgs = {
12523
12546
  opacity: this.highlightSettings.opacity,
12524
12547
  fill: (targetEle.parentElement.id.indexOf('LineString') === -1) ? (targetEle.id.indexOf('NavigationIndex') === -1 ? !isNullOrUndefined(this.highlightSettings.fill)
12525
12548
  ? this.highlightSettings.fill : targetEle.getAttribute('fill') : 'none') : 'transparent',
12526
- 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 },
12527
12570
  name: itemHighlight,
12528
12571
  target: targetEle.id,
12529
12572
  cancel: false,
@@ -12531,13 +12574,18 @@ class Highlight {
12531
12574
  data: data,
12532
12575
  maps: this.maps
12533
12576
  };
12534
- this.maps.trigger(itemHighlight, eventArgs, () => {
12535
- eventArgs.border.opacity = isNullOrUndefined(this.highlightSettings.border.opacity) ? this.highlightSettings.opacity : this.highlightSettings.border.opacity;
12536
- 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);
12537
12585
  });
12538
12586
  }
12539
12587
  highlightMap(targetEle, eventArgs) {
12540
- if (targetEle.getAttribute('class') === 'highlightMapStyle') {
12588
+ if (targetEle.getAttribute('class') === 'highlightMapStyle' || eventArgs.cancel) {
12541
12589
  return;
12542
12590
  }
12543
12591
  else {
@@ -13039,9 +13087,9 @@ class MapsTooltip {
13039
13087
  else {
13040
13088
  tooltipEle = createElement('div', {
13041
13089
  id: this.maps.element.id + '_mapsTooltip',
13042
- className: 'EJ2-maps-Tooltip',
13043
- styles: 'position: absolute;pointer-events:none;'
13090
+ className: 'EJ2-maps-Tooltip'
13044
13091
  });
13092
+ tooltipEle.style.cssText = 'position: absolute;pointer-events:none;';
13045
13093
  document.getElementById(this.maps.element.id + '_Secondary_Element').appendChild(tooltipEle);
13046
13094
  }
13047
13095
  if (option.template !== null && Object.keys(typeof option.template === 'object' ? option.template : {}).length === 1) {
@@ -13119,7 +13167,7 @@ class MapsTooltip {
13119
13167
  && tooltipTemplateElement.innerHTML.indexOf('</a>') !== -1) {
13120
13168
  let templateStyle = tooltipTemplateElement.getAttribute('style');
13121
13169
  templateStyle = templateStyle.replace('pointer-events: none;', 'position-events:all;');
13122
- tooltipTemplateElement.setAttribute('style', templateStyle);
13170
+ tooltipTemplateElement.style.cssText = templateStyle;
13123
13171
  }
13124
13172
  }
13125
13173
  else {
@@ -13707,7 +13755,7 @@ class Zoom {
13707
13755
  }
13708
13756
  else {
13709
13757
  markerStyle = 'visibility:hidden';
13710
- currentEle.setAttribute('style', markerStyle);
13758
+ currentEle.style.cssText = markerStyle;
13711
13759
  }
13712
13760
  }
13713
13761
  }
@@ -13823,22 +13871,22 @@ class Zoom {
13823
13871
  const layerIndex = parseInt((element ? element : layerElement).id.split('_LayerIndex_')[1].split('_')[0], 10);
13824
13872
  const markerSVGObject = this.maps.renderer.createGroup({
13825
13873
  id: this.maps.element.id + '_Markers_Group',
13826
- class: 'GroupElement',
13827
- style: 'pointer-events: auto;'
13874
+ class: 'GroupElement'
13828
13875
  });
13876
+ markerSVGObject.style.pointerEvents = 'auto';
13829
13877
  if (document.getElementById(markerSVGObject.id)) {
13830
13878
  removeElement(markerSVGObject.id);
13831
13879
  }
13832
13880
  const mapsAreaRect = this.maps.mapAreaRect;
13833
13881
  const markerTemplateElements = createElement('div', {
13834
13882
  id: this.maps.element.id + '_LayerIndex_' + layerIndex + '_Markers_Template_Group',
13835
- className: 'template',
13836
- styles: 'overflow: hidden; position: absolute;pointer-events: none;' +
13837
- 'top:' + mapsAreaRect.y + 'px;' +
13838
- 'left:' + mapsAreaRect.x + 'px;' +
13839
- 'height:' + mapsAreaRect.height + 'px;' +
13840
- 'width:' + mapsAreaRect.width + 'px;'
13883
+ className: 'template'
13841
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;';
13842
13890
  if (document.getElementById(markerTemplateElements.id)) {
13843
13891
  removeElement(markerTemplateElements.id);
13844
13892
  }
@@ -13969,16 +14017,26 @@ class Zoom {
13969
14017
  let labelX = label['location']['x'];
13970
14018
  let labelY = label['location']['y'];
13971
14019
  if (type === 'Template') {
13972
- const layerEle = getElementByID(this.maps.element.id + '_Layer_Collections');
13973
- labelX = ((Math.abs(this.maps.baseMapRectBounds['min']['x'] - labelX)) * scale);
13974
- labelY = ((Math.abs(this.maps.baseMapRectBounds['min']['y'] - labelY)) * scale);
13975
- const templateOffset = element.getBoundingClientRect();
13976
- const layerOffset = layerEle.getBoundingClientRect();
13977
- const elementOffset = element.parentElement.getBoundingClientRect();
13978
- const x = ((labelX) + (layerOffset.left - elementOffset.left) - (templateOffset.width / 2));
13979
- const y = ((labelY) + (layerOffset.top - elementOffset.top) - (templateOffset.height / 2));
13980
- element.style.left = x + 'px';
13981
- 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';
13982
14040
  }
13983
14041
  else {
13984
14042
  labelX = ((labelX + x) * scale);
@@ -14109,10 +14167,10 @@ class Zoom {
14109
14167
  if (element['style']['display'] !== 'none') {
14110
14168
  if ((staticMapOffset['x'] > templateOffset['x'] || staticMapOffset['x'] + staticMapOffsetWidth < templateOffset['x'] + templateOffset['width'])
14111
14169
  && (staticMapOffset['y'] > templateOffset['y'] || staticMapOffset['y'] + staticMapOffset['height'] < templateOffset['y'] + templateOffset['height'])) {
14112
- element['style']['display'] = 'none';
14170
+ element.style.display = 'none';
14113
14171
  }
14114
14172
  else if ((staticMapOffset['x'] > templateOffset['x'] || staticMapOffset['x'] + staticMapOffsetWidth < templateOffset['x'] + templateOffset['width'])) {
14115
- element['style']['display'] = 'none';
14173
+ element.style.display = 'none';
14116
14174
  }
14117
14175
  }
14118
14176
  }
@@ -14249,7 +14307,6 @@ class Zoom {
14249
14307
  }
14250
14308
  map.zoomTranslatePoint = map.translatePoint;
14251
14309
  this.mouseDownPoints = this.mouseMovePoints;
14252
- this.maps.zoomNotApplied = false;
14253
14310
  this.isSingleClick = false;
14254
14311
  }
14255
14312
  toAlignSublayer() {
@@ -14589,7 +14646,8 @@ class Zoom {
14589
14646
  alignToolBar() {
14590
14647
  const map = this.maps;
14591
14648
  const padding = 10;
14592
- 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';
14593
14651
  const rectSVGObject = map.renderer.createSvg({
14594
14652
  id: map.element.id + '_Zooming_ToolBar', width: 10, height: 10
14595
14653
  });