@syncfusion/ej2-maps 20.1.59 → 20.2.36

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.
@@ -735,6 +735,8 @@ function drawSymbols(shape, imageUrl, location, markerID, shapeCustom, markerCol
735
735
  const opacity = shapeCustom['opacity'];
736
736
  let rectOptions;
737
737
  const pathOptions = new PathOption(markerID, fill, borderWidth, borderColor, opacity, borderOpacity, dashArray, '');
738
+ size.width = typeof (size.width) === 'string' ? parseInt(size.width, 10) : size.width;
739
+ size.height = typeof (size.height) === 'string' ? parseInt(size.height, 10) : size.height;
738
740
  if (shape === 'Circle') {
739
741
  const radius = (size.width + size.height) / 4;
740
742
  const circleOptions = new CircleOption(markerID, fill, border, opacity, location.x, location.y, radius, dashArray);
@@ -1966,6 +1968,10 @@ function getTranslate(mapObject, layer, animate) {
1966
1968
  }
1967
1969
  else {
1968
1970
  if (isNullOrUndefined(mapObject.previousProjection) || mapObject.previousProjection !== mapObject.projectionType) {
1971
+ if (mapHeight === 0 || mapWidth === 0 || mapHeight === mapWidth) {
1972
+ mapWidth = size.width / 2;
1973
+ mapHeight = size.height;
1974
+ }
1969
1975
  scaleFactor = parseFloat(Math.min(size.width / mapWidth, size.height / mapHeight).toFixed(2));
1970
1976
  mapWidth *= scaleFactor;
1971
1977
  mapHeight *= scaleFactor;
@@ -2015,7 +2021,7 @@ function getTranslate(mapObject, layer, animate) {
2015
2021
  mapObject.zoomTranslatePoint.y = y;
2016
2022
  }
2017
2023
  else {
2018
- if (!isNullOrUndefined(mapObject.previousProjection) && mapObject.mapScaleValue === 1 && !mapObject.zoomModule.isDragZoom) {
2024
+ if (!isNullOrUndefined(mapObject.previousProjection) && (mapObject.mapScaleValue === 1 || mapObject.mapScaleValue <= 1.05) && !mapObject.zoomModule.isDragZoom) {
2019
2025
  scaleFactor = parseFloat(Math.min(size.width / mapWidth, size.height / mapHeight).toFixed(2));
2020
2026
  mapWidth *= scaleFactor;
2021
2027
  x = size.x + ((-(min['x'])) + ((size.width / 2) - (mapWidth / 2)));
@@ -2838,6 +2844,7 @@ function changeBorderWidth(element, index, scale, maps) {
2838
2844
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
2839
2845
  const borderWidthValue = maps.layersCollection[index].shapeSettings.borderWidthValuePath;
2840
2846
  const borderWidth = maps.layersCollection[index].shapeSettings.border.width;
2847
+ const circleRadius = maps.layersCollection[index].shapeSettings.circleRadius;
2841
2848
  if (maps.layersCollection[index].shapeSettings.borderWidthValuePath) {
2842
2849
  value = checkShapeDataFields(
2843
2850
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -2858,8 +2865,8 @@ function changeBorderWidth(element, index, scale, maps) {
2858
2865
  currentStroke = (isNullOrUndefined(borderWidth) ? 0 : borderWidth);
2859
2866
  }
2860
2867
  childNode.setAttribute('stroke-width', (currentStroke / scale).toString());
2861
- if (element.id.indexOf('_LineString') > -1 && isNullOrUndefined(currentStroke)) {
2862
- childNode.setAttribute('stroke-width', (1 / scale).toString());
2868
+ if (element.id.indexOf('_Point') > -1 || element.id.indexOf('_MultiPoint') > -1) {
2869
+ childNode.setAttribute('r', (circleRadius / scale).toString());
2863
2870
  }
2864
2871
  }
2865
2872
  }
@@ -3524,6 +3531,7 @@ function getThemeStyle(theme) {
3524
3531
  backgroundColor: color,
3525
3532
  areaBackgroundColor: color,
3526
3533
  titleFontColor: '#FFFFFF',
3534
+ titleFontSize: '14px',
3527
3535
  subTitleFontColor: '#FFFFFF',
3528
3536
  legendTitleFontColor: '#DADADA',
3529
3537
  legendTextColor: '#DADADA',
@@ -3543,6 +3551,7 @@ function getThemeStyle(theme) {
3543
3551
  backgroundColor: '#000000',
3544
3552
  areaBackgroundColor: '#000000',
3545
3553
  titleFontColor: '#FFFFFF',
3554
+ titleFontSize: '14px',
3546
3555
  subTitleFontColor: '#FFFFFF',
3547
3556
  legendTitleFontColor: '#FFFFFF',
3548
3557
  legendTextColor: '#FFFFFF',
@@ -3723,6 +3732,7 @@ function getThemeStyle(theme) {
3723
3732
  backgroundColor: '#FFFFFF',
3724
3733
  areaBackgroundColor: '#FFFFFF',
3725
3734
  titleFontColor: '#424242',
3735
+ titleFontSize: '14px',
3726
3736
  subTitleFontColor: '#424242',
3727
3737
  legendTitleFontColor: '#757575',
3728
3738
  legendTextColor: '#757575',
@@ -4141,7 +4151,7 @@ __decorate$1([
4141
4151
  class SubTitleSettings extends CommonTitleSettings {
4142
4152
  }
4143
4153
  __decorate$1([
4144
- Complex({ size: Theme.mapsSubTitleFont.size, fontWeight: null }, Font)
4154
+ Complex({ size: null, fontWeight: null, fontFamily: null }, Font)
4145
4155
  ], SubTitleSettings.prototype, "textStyle", void 0);
4146
4156
  __decorate$1([
4147
4157
  Property('Center')
@@ -4152,7 +4162,7 @@ __decorate$1([
4152
4162
  class TitleSettings extends CommonTitleSettings {
4153
4163
  }
4154
4164
  __decorate$1([
4155
- Complex({ size: Theme.mapsTitleFont.size, fontWeight: null }, Font)
4165
+ Complex({ size: null, fontWeight: null, fontFamily: null }, Font)
4156
4166
  ], TitleSettings.prototype, "textStyle", void 0);
4157
4167
  __decorate$1([
4158
4168
  Property('Center')
@@ -4281,7 +4291,7 @@ __decorate$1([
4281
4291
  Property('')
4282
4292
  ], LegendSettings.prototype, "height", void 0);
4283
4293
  __decorate$1([
4284
- Complex({}, Font)
4294
+ Complex({ fontFamily: null }, Font)
4285
4295
  ], LegendSettings.prototype, "textStyle", void 0);
4286
4296
  __decorate$1([
4287
4297
  Property(15)
@@ -4302,7 +4312,7 @@ __decorate$1([
4302
4312
  Complex({}, CommonTitleSettings)
4303
4313
  ], LegendSettings.prototype, "title", void 0);
4304
4314
  __decorate$1([
4305
- Complex(Theme.legendTitleFont, Font)
4315
+ Complex({ size: Theme.legendTitleFont.size, color: Theme.legendTitleFont.color, fontStyle: Theme.legendTitleFont.fontStyle, fontWeight: Theme.legendTitleFont.fontWeight, fontFamily: null }, Font)
4306
4316
  ], LegendSettings.prototype, "titleStyle", void 0);
4307
4317
  __decorate$1([
4308
4318
  Property('Bottom')
@@ -4545,7 +4555,7 @@ __decorate$1([
4545
4555
  Property('Geometry')
4546
4556
  ], LayerSettings.prototype, "layerType", void 0);
4547
4557
  __decorate$1([
4548
- Property('https://a.tile.openstreetmap.org/level/tileX/tileY.png')
4558
+ Property('')
4549
4559
  ], LayerSettings.prototype, "urlTemplate", void 0);
4550
4560
  __decorate$1([
4551
4561
  Property(true)
@@ -4702,11 +4712,12 @@ class Marker {
4702
4712
  if (currentLayer.markerClusterSettings.allowClustering) {
4703
4713
  this.maps.svgObject.appendChild(this.markerSVGObject);
4704
4714
  this.maps.element.appendChild(this.maps.svgObject);
4705
- if (currentLayer.layerType !== 'OSM' || !this.maps.zoomSettings.enable) {
4706
- clusterTemplate(currentLayer, this.markerSVGObject, this.maps, layerIndex, this.markerSVGObject, layerElement, true, false);
4715
+ if ((currentLayer.layerType === 'OSM' || (currentLayer.urlTemplate.indexOf('openstreetmap') !== -1 && isNullOrUndefined(currentLayer.shapeData)))
4716
+ && this.maps.zoomSettings.enable) {
4717
+ layerElement.appendChild(this.markerSVGObject);
4707
4718
  }
4708
4719
  else {
4709
- layerElement.appendChild(this.markerSVGObject);
4720
+ clusterTemplate(currentLayer, this.markerSVGObject, this.maps, layerIndex, this.markerSVGObject, layerElement, true, false);
4710
4721
  }
4711
4722
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
4712
4723
  this.maps.renderReactTemplates();
@@ -5256,9 +5267,14 @@ class BingMap {
5256
5267
  }
5257
5268
  quadKey = quadKey + '' + digit;
5258
5269
  }
5259
- const subDomain = subDomains[Math.min(parseInt(quadKey.substr(quadKey.length - 1, 1), 10), subDomains.length)];
5260
- imageUrl = imageUrl.replace('{quadkey}', quadKey).replace('{subdomain}', subDomain);
5261
- return imageUrl += '&mkt=' + language + '&ur=IN&Key=' + key;
5270
+ if (!isNullOrUndefined(subDomains)) {
5271
+ const subDomain = subDomains[Math.min(parseInt(quadKey.substr(quadKey.length - 1, 1), 10), subDomains.length)];
5272
+ imageUrl = imageUrl.replace('{quadkey}', quadKey).replace('{subdomain}', subDomain);
5273
+ return imageUrl += '&mkt=' + language + '&ur=IN&Key=' + key;
5274
+ }
5275
+ else {
5276
+ return '';
5277
+ }
5262
5278
  }
5263
5279
  }
5264
5280
 
@@ -5527,8 +5543,7 @@ class LayerPanel {
5527
5543
  else {
5528
5544
  this.clipRectElement = this.mapObject.renderer.drawClipPath(new RectOption(this.mapObject.element.id + '_MapArea_ClipRect', 'transparent', { width: 1, color: 'Gray' }, 1, {
5529
5545
  x: this.mapObject.isTileMap ? 0 : areaRect.x, y: this.mapObject.isTileMap ? 0 : areaRect.y,
5530
- width: areaRect.width, height: (areaRect.height < 0) ? 0 : !isNullOrUndefined(this.mapObject.legendModule) &&
5531
- this.mapObject.legendModule.totalPages.length > 0 ? this.mapObject.legendModule.legendTotalRect.height : areaRect.height
5546
+ width: areaRect.width, height: areaRect.height
5532
5547
  }));
5533
5548
  }
5534
5549
  this.layerGroup.appendChild(this.clipRectElement);
@@ -5539,6 +5554,14 @@ class LayerPanel {
5539
5554
  this.currentLayer = layer;
5540
5555
  this.processLayers(layer, index);
5541
5556
  });
5557
+ if (!isNullOrUndefined(this.mapObject.legendModule) && this.mapObject.legendSettings.position === 'Float') {
5558
+ if (this.mapObject.isTileMap) {
5559
+ this.layerGroup.appendChild(this.mapObject.legendModule.legendGroup);
5560
+ }
5561
+ else {
5562
+ this.mapObject.svgObject.appendChild(this.mapObject.legendModule.legendGroup);
5563
+ }
5564
+ }
5542
5565
  }
5543
5566
  /**
5544
5567
  * Tile rendering
@@ -5697,9 +5720,21 @@ class LayerPanel {
5697
5720
  };
5698
5721
  this.mapObject.trigger('layerRendering', eventArgs, (observedArgs) => {
5699
5722
  if (!eventArgs.cancel && eventArgs.visible) {
5700
- if (layer.layerType !== 'Geometry') {
5723
+ if (layer.layerType === 'OSM') {
5724
+ layer.urlTemplate = 'https://a.tile.openstreetmap.org/level/tileX/tileY.png';
5725
+ }
5726
+ if (layer.layerType === 'Google') {
5727
+ layer.urlTemplate = 'https://mt1.google.com/vt/lyrs=m@129&hl=en&x=tileX&y=tileY&z=level';
5728
+ }
5729
+ if (layer.layerType !== 'Geometry' || (isNullOrUndefined(layer.shapeData) && !isNullOrUndefined(layer.urlTemplate) && layer.urlTemplate !== '')) {
5701
5730
  if (layer.layerType !== 'Bing' || this.bing) {
5702
- this.renderTileLayer(this, layer, layerIndex);
5731
+ if (!isNullOrUndefined(layer.urlTemplate) && layer.urlTemplate.indexOf('quadkey') > -1) {
5732
+ const bing = new BingMap(this.mapObject);
5733
+ this.bingMapCalculation(layer, layerIndex, this, bing);
5734
+ }
5735
+ else {
5736
+ this.renderTileLayer(this, layer, layerIndex);
5737
+ }
5703
5738
  }
5704
5739
  else if (layer.key && layer.key.length > 1) {
5705
5740
  // eslint-disable-next-line @typescript-eslint/no-this-alias
@@ -5768,6 +5803,17 @@ class LayerPanel {
5768
5803
  this.mapObject.baseMapBounds = null;
5769
5804
  }
5770
5805
  }
5806
+ bingMapCalculation(layer, layerIndex, proxy, bing) {
5807
+ bing.imageUrl = layer.urlTemplate;
5808
+ bing.subDomains = ['t0', 't1', 't2', 't3'];
5809
+ bing.maxZoom = '21';
5810
+ proxy.mapObject['bingMap'] = bing;
5811
+ proxy.renderTileLayer(proxy, layer, layerIndex, bing);
5812
+ this.mapObject.arrangeTemplate();
5813
+ if (this.mapObject.zoomModule && (this.mapObject.previousScale !== this.mapObject.scale)) {
5814
+ this.mapObject.zoomModule.applyTransform(true);
5815
+ }
5816
+ }
5771
5817
  bubbleCalculation(bubbleSettings, range) {
5772
5818
  if (bubbleSettings.dataSource != null && bubbleSettings != null) {
5773
5819
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -5959,60 +6005,66 @@ class LayerPanel {
5959
6005
  }
5960
6006
  break;
5961
6007
  case 'LineString':
5962
- path += 'M ' + (currentShapeData[0]['point']['x']) + ' ' + (currentShapeData[0]['point']['y']);
5963
6008
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
5964
- currentShapeData.map((lineData) => {
5965
- path += 'L' + (lineData['point']['x']) + ' , ' + (lineData['point']['y']) + ' ';
6009
+ currentShapeData.map((lineData, index) => {
6010
+ if (index === 0) {
6011
+ path += 'M ' + (lineData['point']['x']) + ' ' + (lineData['point']['y']);
6012
+ }
6013
+ else {
6014
+ path += 'L' + (lineData['point']['x']) + ' , ' + (lineData['point']['y']) + ' ';
6015
+ }
5966
6016
  });
5967
6017
  if (path.length > 3) {
5968
- pathOptions = new PathOption(shapeID, 'transparent', !isNullOrUndefined(eventArgs.border.width) ? eventArgs.border.width : 1, eventArgs.border.color, opacity, eventArgs.border.opacity, shapeSettings.dashArray, path);
6018
+ pathOptions = new PathOption(shapeID, 'transparent', !isNullOrUndefined(eventArgs.border.width) ? eventArgs.border.width : 1, !isNullOrUndefined(eventArgs.fill) ? eventArgs.fill :
6019
+ eventArgs.border.color, opacity, eventArgs.border.opacity, shapeSettings.dashArray, path);
6020
+ pathEle = this.mapObject.renderer.drawPath(pathOptions);
6021
+ }
6022
+ break;
6023
+ case 'MultiLineString':
6024
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
6025
+ currentShapeData.map((multilineData) => {
6026
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
6027
+ multilineData.map((lineData, index) => {
6028
+ if (index === 0) {
6029
+ path += 'M ' + (lineData['point']['x']) + ' ' + (lineData['point']['y']);
6030
+ }
6031
+ else {
6032
+ path += 'L' + (lineData['point']['x']) + ' , ' + (lineData['point']['y']) + ' ';
6033
+ }
6034
+ });
6035
+ });
6036
+ if (path.length > 3) {
6037
+ pathOptions = new PathOption(shapeID, 'transparent', !isNullOrUndefined(eventArgs.border.width) ? eventArgs.border.width : 1, !isNullOrUndefined(eventArgs.fill) ? eventArgs.fill :
6038
+ eventArgs.border.color, opacity, eventArgs.border.opacity, shapeSettings.dashArray, path);
5969
6039
  pathEle = this.mapObject.renderer.drawPath(pathOptions);
5970
6040
  }
5971
6041
  break;
5972
6042
  case 'Point':
5973
6043
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
5974
6044
  const pointData = currentShapeData['point'];
5975
- const circleRadius = (this.mapObject.layers[layerIndex].type !== 'SubLayer') ? shapeSettings.circleRadius : shapeSettings.circleRadius / this.currentFactor;
5976
- circleOptions = new CircleOption(shapeID, eventArgs.fill, eventArgs.border, opacity, pointData['x'], pointData['y'], circleRadius, null);
6045
+ const circleRadius = (this.mapObject.layers[layerIndex].type !== 'SubLayer') ? shapeSettings.circleRadius : shapeSettings.circleRadius / (this.mapObject.isTileMap ? this.mapObject.scale : this.currentFactor);
6046
+ circleOptions = new CircleOption(shapeID, eventArgs.fill, eventArgs.border, opacity, pointData['x'], pointData['y'], circleRadius, shapeSettings.dashArray);
5977
6047
  pathEle = this.mapObject.renderer.drawCircle(circleOptions);
5978
6048
  break;
6049
+ case 'MultiPoint':
6050
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
6051
+ currentShapeData.map((multiPointData, index) => {
6052
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
6053
+ const pointData = multiPointData['point'];
6054
+ const circleRadius = (this.mapObject.layers[layerIndex].type !== 'SubLayer') ? shapeSettings.circleRadius : shapeSettings.circleRadius / (this.mapObject.isTileMap ? this.mapObject.scale : this.currentFactor);
6055
+ circleOptions = new CircleOption((shapeID + "_multiLine_" + index), eventArgs.fill, eventArgs.border, opacity, pointData['x'], pointData['y'], circleRadius, shapeSettings.dashArray);
6056
+ pathEle = this.mapObject.renderer.drawCircle(circleOptions);
6057
+ this.pathAttributeCalculate(groupElement, pathEle, drawingType, currentShapeData, i);
6058
+ });
6059
+ break;
5979
6060
  case 'Path':
5980
6061
  path = currentShapeData['point'];
5981
6062
  pathOptions = new PathOption(shapeID, eventArgs.fill, eventArgs.border.width, eventArgs.border.color, opacity, eventArgs.border.opacity, shapeSettings.dashArray, path);
5982
6063
  pathEle = this.mapObject.renderer.drawPath(pathOptions);
5983
6064
  break;
5984
6065
  }
5985
- if (!isNullOrUndefined(pathEle)) {
5986
- const property = (Object.prototype.toString.call(this.currentLayer.shapePropertyPath) === '[object Array]' ?
5987
- this.currentLayer.shapePropertyPath : [this.currentLayer.shapePropertyPath]);
5988
- let properties;
5989
- for (let j = 0; j < property.length; j++) {
5990
- if (!isNullOrUndefined(currentShapeData['property'])) {
5991
- properties = property[j];
5992
- break;
5993
- }
5994
- }
5995
- pathEle.setAttribute('aria-label', ((!isNullOrUndefined(currentShapeData['property'])) ?
5996
- (currentShapeData['property'][properties]) : ''));
5997
- pathEle.setAttribute('tabindex', (this.mapObject.tabIndex + i + 3).toString());
5998
- if (drawingType === 'LineString') {
5999
- pathEle.setAttribute('style', 'outline:none');
6000
- }
6001
- maintainSelection(this.mapObject.selectedElementId, this.mapObject.shapeSelectionClass, pathEle, 'ShapeselectionMapStyle');
6002
- if (this.mapObject.toggledShapeElementId) {
6003
- for (let j = 0; j < this.mapObject.toggledShapeElementId.length; j++) {
6004
- const styleProperty = this.mapObject.legendSettings.toggleLegendSettings.applyShapeSettings ?
6005
- this.currentLayer.shapeSettings : this.mapObject.legendSettings.toggleLegendSettings;
6006
- if (this.mapObject.toggledShapeElementId[j] === pathEle.id) {
6007
- pathEle.setAttribute('fill', styleProperty.fill);
6008
- pathEle.setAttribute('stroke', styleProperty.border.color);
6009
- pathEle.setAttribute('fill-opacity', (styleProperty.opacity).toString());
6010
- pathEle.setAttribute('stroke-opacity', (isNullOrUndefined(styleProperty.border.opacity) ? styleProperty.opacity : styleProperty.border.opacity).toString());
6011
- pathEle.setAttribute('stroke-width', (styleProperty.border.width).toString());
6012
- }
6013
- }
6014
- }
6015
- groupElement.appendChild(pathEle);
6066
+ if (!isNullOrUndefined(pathEle) && drawingType !== 'MultiPoint') {
6067
+ this.pathAttributeCalculate(groupElement, pathEle, drawingType, currentShapeData, i);
6016
6068
  }
6017
6069
  if (i === this.currentLayer.layerData.length - 1) {
6018
6070
  this.layerFeatures(layerIndex, colors, renderData, labelTemplateEle);
@@ -6026,6 +6078,49 @@ class LayerPanel {
6026
6078
  this.layerFeatures(layerIndex, colors, renderData, labelTemplateEle);
6027
6079
  }
6028
6080
  }
6081
+ /**
6082
+ * layer features as bubble, marker, datalabel, navigation line.
6083
+ *
6084
+ * @param {groupElement} Element - Specifies the element to append the group
6085
+ * @param {pathEle} Element - Specifies the svg element
6086
+ * @param {drawingType} string - Specifies the data type
6087
+ * @param {currentShapeData} any - Specifies the layer of shapedata.
6088
+ * @param {index} number - Specifies the tab index.
6089
+ * @returns {void}
6090
+ */
6091
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
6092
+ pathAttributeCalculate(groupElement, pathEle, drawingType, currentShapeData, index) {
6093
+ const property = (Object.prototype.toString.call(this.currentLayer.shapePropertyPath) === '[object Array]' ?
6094
+ this.currentLayer.shapePropertyPath : [this.currentLayer.shapePropertyPath]);
6095
+ let properties;
6096
+ for (let j = 0; j < property.length; j++) {
6097
+ if (!isNullOrUndefined(currentShapeData['property'])) {
6098
+ properties = property[j];
6099
+ break;
6100
+ }
6101
+ }
6102
+ pathEle.setAttribute('aria-label', ((!isNullOrUndefined(currentShapeData['property'])) ?
6103
+ (currentShapeData['property'][properties]) : ''));
6104
+ pathEle.setAttribute('tabindex', (this.mapObject.tabIndex + index + 3).toString());
6105
+ if (drawingType === 'LineString' || drawingType === 'MultiLineString') {
6106
+ pathEle.setAttribute('style', 'outline:none');
6107
+ }
6108
+ maintainSelection(this.mapObject.selectedElementId, this.mapObject.shapeSelectionClass, pathEle, 'ShapeselectionMapStyle');
6109
+ if (this.mapObject.toggledShapeElementId) {
6110
+ for (let j = 0; j < this.mapObject.toggledShapeElementId.length; j++) {
6111
+ const styleProperty = this.mapObject.legendSettings.toggleLegendSettings.applyShapeSettings ?
6112
+ this.currentLayer.shapeSettings : this.mapObject.legendSettings.toggleLegendSettings;
6113
+ if (this.mapObject.toggledShapeElementId[j] === pathEle.id) {
6114
+ pathEle.setAttribute('fill', styleProperty.fill);
6115
+ pathEle.setAttribute('stroke', styleProperty.border.color);
6116
+ pathEle.setAttribute('fill-opacity', (styleProperty.opacity).toString());
6117
+ pathEle.setAttribute('stroke-opacity', (isNullOrUndefined(styleProperty.border.opacity) ? styleProperty.opacity : styleProperty.border.opacity).toString());
6118
+ pathEle.setAttribute('stroke-width', (styleProperty.border.width).toString());
6119
+ }
6120
+ }
6121
+ }
6122
+ groupElement.appendChild(pathEle);
6123
+ }
6029
6124
  /**
6030
6125
  * layer features as bubble, marker, datalabel, navigation line.
6031
6126
  *
@@ -6207,7 +6302,8 @@ class LayerPanel {
6207
6302
  break;
6208
6303
  case 'linestring':
6209
6304
  const extraSpace = !isNullOrUndefined(this.currentLayer.shapeSettings.border.width) ?
6210
- this.currentLayer.shapeSettings.border.width : 1;
6305
+ (typeof (this.currentLayer.shapeSettings.border.width) === 'string' ?
6306
+ parseInt(this.currentLayer.shapeSettings.border.width, 10) : this.currentLayer.shapeSettings.border.width) : 1;
6211
6307
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
6212
6308
  coordinates.map((points, index) => {
6213
6309
  latitude = points[1];
@@ -6222,31 +6318,61 @@ class LayerPanel {
6222
6318
  newData['type'] = type;
6223
6319
  this.currentLayer.layerData.push(newData);
6224
6320
  break;
6225
- case 'point': {
6226
- let arrayCollections = false;
6227
- const extraSpace = (!isNullOrUndefined(this.currentLayer.shapeSettings.border.width) ?
6228
- this.currentLayer.shapeSettings.border.width : 1) + (this.currentLayer.shapeSettings.circleRadius * 2);
6321
+ case 'multilinestring':
6322
+ const extraSpaces = !isNullOrUndefined(this.currentLayer.shapeSettings.border.width) ?
6323
+ (typeof (this.currentLayer.shapeSettings.border.width) === 'string' ?
6324
+ parseInt(this.currentLayer.shapeSettings.border.width, 10) : this.currentLayer.shapeSettings.border.width) : 1;
6325
+ const multiLineData = [];
6229
6326
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
6230
- coordinates.map((points, index) => {
6231
- if (Object.prototype.toString.call(points) === '[object Array]') {
6327
+ coordinates.map((multiPoints) => {
6328
+ newData = [];
6329
+ multiPoints.map((points) => {
6232
6330
  latitude = points[1];
6233
6331
  longitude = points[0];
6234
- arrayCollections = true;
6235
6332
  const point = convertGeoToPoint(latitude, longitude, this.currentFactor, this.currentLayer, this.mapObject);
6236
- this.currentLayer.layerData.push({
6237
- point: point, type: type, lat: latitude, lng: longitude, property: properties
6333
+ this.calculateBox(point, extraSpaces);
6334
+ newData.push({
6335
+ point: point, lat: latitude, lng: longitude
6238
6336
  });
6239
- }
6337
+ });
6338
+ multiLineData.push(newData);
6339
+ });
6340
+ multiLineData['property'] = properties;
6341
+ multiLineData['type'] = type;
6342
+ this.currentLayer.layerData.push(multiLineData);
6343
+ break;
6344
+ case 'point':
6345
+ const pointExtraSpace = (!isNullOrUndefined(this.currentLayer.shapeSettings.border.width) ?
6346
+ (typeof (this.currentLayer.shapeSettings.border.width) === 'string' ?
6347
+ parseInt(this.currentLayer.shapeSettings.border.width, 10) : this.currentLayer.shapeSettings.border.width) : 1) +
6348
+ (this.currentLayer.shapeSettings.circleRadius * 2);
6349
+ latitude = coordinates[1];
6350
+ longitude = coordinates[0];
6351
+ const point = convertGeoToPoint(latitude, longitude, this.currentFactor, this.currentLayer, this.mapObject);
6352
+ this.calculateBox(point, pointExtraSpace);
6353
+ this.currentLayer.layerData.push({
6354
+ point: point, type: type, lat: latitude, lng: longitude, property: properties
6240
6355
  });
6241
- if (!arrayCollections) {
6242
- latitude = coordinates[1];
6243
- longitude = coordinates[0];
6356
+ break;
6357
+ case 'multipoint': {
6358
+ const extraSpace = (!isNullOrUndefined(this.currentLayer.shapeSettings.border.width) ?
6359
+ (typeof (this.currentLayer.shapeSettings.border.width) === 'string' ?
6360
+ parseInt(this.currentLayer.shapeSettings.border.width, 10) : this.currentLayer.shapeSettings.border.width) : 1) +
6361
+ (this.currentLayer.shapeSettings.circleRadius * 2);
6362
+ newData = [];
6363
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
6364
+ coordinates.map((points) => {
6365
+ latitude = points[1];
6366
+ longitude = points[0];
6244
6367
  const point = convertGeoToPoint(latitude, longitude, this.currentFactor, this.currentLayer, this.mapObject);
6245
6368
  this.calculateBox(point, extraSpace);
6246
- this.currentLayer.layerData.push({
6247
- point: point, type: type, lat: latitude, lng: longitude, property: properties
6369
+ newData.push({
6370
+ point: point, lat: latitude, lng: longitude
6248
6371
  });
6249
- }
6372
+ });
6373
+ newData['property'] = properties;
6374
+ newData['type'] = type;
6375
+ this.currentLayer.layerData.push(newData);
6250
6376
  break;
6251
6377
  }
6252
6378
  case 'path':
@@ -6258,12 +6384,12 @@ class LayerPanel {
6258
6384
  }
6259
6385
  calculateBox(point, extraSpace) {
6260
6386
  if (isNullOrUndefined(this.rectBounds)) {
6261
- this.rectBounds = { min: { x: point.x, y: point.y - extraSpace }, max: { x: point.x, y: point.y + extraSpace } };
6387
+ this.rectBounds = { min: { x: point.x - extraSpace, y: point.y - extraSpace }, max: { x: point.x + extraSpace, y: point.y + extraSpace } };
6262
6388
  }
6263
6389
  else {
6264
- this.rectBounds['min']['x'] = Math.min(this.rectBounds['min']['x'], point.x);
6390
+ this.rectBounds['min']['x'] = Math.min(this.rectBounds['min']['x'], point.x - extraSpace);
6265
6391
  this.rectBounds['min']['y'] = Math.min(this.rectBounds['min']['y'], point.y - extraSpace);
6266
- this.rectBounds['max']['x'] = Math.max(this.rectBounds['max']['x'], point.x);
6392
+ this.rectBounds['max']['x'] = Math.max(this.rectBounds['max']['x'], point.x + extraSpace);
6267
6393
  this.rectBounds['max']['y'] = Math.max(this.rectBounds['max']['y'], point.y + extraSpace);
6268
6394
  }
6269
6395
  }
@@ -6281,6 +6407,10 @@ class LayerPanel {
6281
6407
  const end = convertGeoToPoint(bounds.latitude.max, bounds.longitude.max, null, layer, this.mapObject);
6282
6408
  mapHeight = end.y - start.y;
6283
6409
  mapWidth = end.x - start.x;
6410
+ if (mapHeight === 0 || mapWidth === 0) {
6411
+ mapWidth = mapSize.width / 2;
6412
+ mapHeight = mapSize.height;
6413
+ }
6284
6414
  }
6285
6415
  else {
6286
6416
  mapHeight = mapWidth = 500;
@@ -6374,15 +6504,28 @@ class LayerPanel {
6374
6504
  this.calculateRectBox(point[0]);
6375
6505
  });
6376
6506
  break;
6507
+ case 'multilinestring':
6508
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
6509
+ coordinates.map((multiPoint, index) => {
6510
+ multiPoint.map((point, index) => {
6511
+ this.calculateRectBox(point, 'multilinestring', index === 0 ? true : false);
6512
+ });
6513
+ });
6514
+ break;
6377
6515
  case 'linestring':
6378
6516
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
6379
6517
  coordinates.map((point, index) => {
6380
- this.calculateRectBox(point, 'LineString', index === 0 ? true : false);
6518
+ this.calculateRectBox(point, 'linestring', index === 0 ? true : false);
6381
6519
  });
6382
6520
  break;
6383
6521
  case 'point':
6384
6522
  this.calculateRectBox(coordinates, 'point');
6385
6523
  break;
6524
+ case 'multipoint':
6525
+ coordinates.map((point, index) => {
6526
+ this.calculateRectBox(point, 'multipoint', index === 0 ? true : false);
6527
+ });
6528
+ break;
6386
6529
  }
6387
6530
  }
6388
6531
  });
@@ -6419,7 +6562,7 @@ class LayerPanel {
6419
6562
  }
6420
6563
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
6421
6564
  calculateRectBox(coordinates, type, isFirstItem) {
6422
- if (type !== 'LineString' && type !== 'point') {
6565
+ if ((type !== 'linestring' && type !== 'multilinestring') && (type !== 'point' && type !== 'multipoint')) {
6423
6566
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
6424
6567
  Array.prototype.forEach.call(coordinates, (currentCoords) => {
6425
6568
  if (isNullOrUndefined(this.mapObject.baseMapBounds)) {
@@ -6488,7 +6631,7 @@ class LayerPanel {
6488
6631
  const tile = new Tile(tileI % ycount, j);
6489
6632
  tile.left = x;
6490
6633
  tile.top = y;
6491
- if (baseLayer.layerType === 'Bing') {
6634
+ if (baseLayer.layerType === 'Bing' || (bing && !isNullOrUndefined(baseLayer.urlTemplate) && baseLayer.urlTemplate !== '')) {
6492
6635
  const key = baseLayer.key;
6493
6636
  tile.src = bing.getBingMap(tile, key, baseLayer.bingMapType, userLang, bing.imageUrl, bing.subDomains);
6494
6637
  }
@@ -6516,10 +6659,12 @@ class LayerPanel {
6516
6659
  if (!(layer.type === 'SubLayer' && layer.visible)) {
6517
6660
  continue;
6518
6661
  }
6519
- if (layer.layerType === 'OSM' || layer.layerType === 'Bing') {
6662
+ if ((layer.layerType !== 'Geometry' && layer.layerType !== 'GoogleStaticMap') || (layer.layerType === 'Geometry' &&
6663
+ isNullOrUndefined(layer.shapeData) && !isNullOrUndefined(layer.urlTemplate) && layer.urlTemplate !== '')) {
6520
6664
  for (const baseTile of proxTiles) {
6521
6665
  const subtile = extend({}, baseTile, {}, true);
6522
6666
  if (layer.layerType === 'Bing') {
6667
+ bing = new BingMap(this.mapObject);
6523
6668
  subtile.src = bing.getBingMap(subtile, layer.key, layer.bingMapType, userLang, bing.imageUrl, bing.subDomains);
6524
6669
  }
6525
6670
  else {
@@ -6578,6 +6723,8 @@ class LayerPanel {
6578
6723
  let id = 0;
6579
6724
  for (const tile of this.tiles) {
6580
6725
  const imgElement = createElement('img');
6726
+ imgElement.setAttribute('height', '256px');
6727
+ imgElement.setAttribute('width', '256px');
6581
6728
  imgElement.setAttribute('src', tile.src);
6582
6729
  const mapId = this.mapObject.element.id;
6583
6730
  imgElement.onload = () => {
@@ -7195,16 +7342,7 @@ let Maps = class Maps extends Component {
7195
7342
  }
7196
7343
  renderMap() {
7197
7344
  if (this.legendModule && this.legendSettings.visible) {
7198
- if (!this.isTileMap) {
7199
- this.legendModule.renderLegend();
7200
- }
7201
- else {
7202
- const layerCount = this.layersCollection.length - 1;
7203
- if (!this.layersCollection[layerCount].isBaseLayer) {
7204
- this.isTileMapSubLayer = true;
7205
- this.legendModule.renderLegend();
7206
- }
7207
- }
7345
+ this.legendModule.renderLegend();
7208
7346
  }
7209
7347
  this.createTile();
7210
7348
  if (this.zoomSettings.enable && this.zoomModule) {
@@ -7287,12 +7425,16 @@ let Maps = class Maps extends Component {
7287
7425
  bottom = svg.bottom - tile.bottom - element.offsetTop;
7288
7426
  top = parseFloat(tileElement.style.top) + element.offsetTop;
7289
7427
  }
7290
- top = (bottom <= 11) ? top : (top * 2);
7291
- left = (bottom <= 11) ? left : (left * 2);
7428
+ top = (bottom <= 11) ? top : (!isNullOrUndefined(this.legendModule) && this.legendSettings.position === 'Bottom') ? this.mapAreaRect.y : (top * 2);
7429
+ left = (bottom <= 11) ? left : !isNullOrUndefined(this.legendModule) ? left : (left * 2);
7292
7430
  tileElement.style.top = top + 'px';
7293
7431
  tileElement.style.left = left + 'px';
7294
7432
  tileElement1.style.top = top + 'px';
7295
7433
  tileElement1.style.left = left + 'px';
7434
+ if (!isNullOrUndefined(this.legendModule) && this.legendModule.totalPages.length > 0) {
7435
+ tileElement.style.height = tileElement1.style.height = this.legendModule.legendTotalRect.height + 'px';
7436
+ tileElement.style.width = tileElement1.style.width = this.legendModule.legendTotalRect.width + 'px';
7437
+ }
7296
7438
  }
7297
7439
  this.arrangeTemplate();
7298
7440
  if (this.annotationsModule) {
@@ -7418,12 +7560,21 @@ let Maps = class Maps extends Component {
7418
7560
  this.zoomModule.layerCollectionEle = getElementByID(this.element.id + '_Layer_Collections');
7419
7561
  }
7420
7562
  if (this.isTileMap && getElementByID(this.element.id + '_Tile_SVG') && getElementByID(this.element.id + '_tile_parent')) {
7421
- const tileRect = getElementByID(this.element.id + '_tile_parent').getBoundingClientRect();
7422
- const tileSvgRect = getElementByID(this.element.id + '_Tile_SVG').getBoundingClientRect();
7563
+ let tileElement = getElementByID(this.element.id + '_tile_parent');
7564
+ let tileSvgElement = getElementByID(this.element.id + '_Tile_SVG');
7565
+ const tileSvgParentElement = getElementByID(this.element.id + '_Tile_SVG_Parent');
7566
+ const tileRect = tileElement.getBoundingClientRect();
7567
+ const tileSvgRect = tileSvgElement.getBoundingClientRect();
7423
7568
  left = (tileRect.left - tileSvgRect.left);
7424
7569
  top = (tileRect.top - tileSvgRect.top);
7425
- getElementByID(this.element.id + '_Tile_SVG_Parent').style.left = left + 'px';
7426
- getElementByID(this.element.id + '_Tile_SVG_Parent').style.top = top + 'px';
7570
+ tileSvgParentElement.style.left = left + 'px';
7571
+ tileSvgParentElement.style.top = top + 'px';
7572
+ if (!isNullOrUndefined(this.legendModule) && this.legendModule.totalPages.length > 0) {
7573
+ tileElement.style.width = tileSvgElement.style.width = this.legendModule.legendTotalRect.width.toString();
7574
+ tileElement.style.height = tileSvgElement.style.height = this.legendModule.legendTotalRect.height.toString();
7575
+ tileSvgParentElement.style.width = this.legendModule.legendTotalRect.width + 'px';
7576
+ tileSvgParentElement.style.height = this.legendModule.legendTotalRect.height + 'px';
7577
+ }
7427
7578
  const markerTemplateElements = document.getElementsByClassName('template');
7428
7579
  if (!isNullOrUndefined(markerTemplateElements) && markerTemplateElements.length > 0) {
7429
7580
  for (let i = 0; i < markerTemplateElements.length; i++) {
@@ -7441,7 +7592,7 @@ let Maps = class Maps extends Component {
7441
7592
  if (!isNullOrUndefined(elements) && elements.childElementCount > 0) {
7442
7593
  for (let i = 0; i < elements.childNodes.length; i++) {
7443
7594
  const childElement = elements.childNodes[i];
7444
- if (childElement.tagName === 'g') {
7595
+ if (childElement.tagName === 'g' && childElement.id.indexOf('_Legend_Group') == -1) {
7445
7596
  const layerIndex = parseFloat(childElement.id.split('_LayerIndex_')[1].split('_')[0]);
7446
7597
  for (let j = 0; j < childElement.childNodes.length; j++) {
7447
7598
  const childNode = childElement.childNodes[j];
@@ -7478,7 +7629,7 @@ let Maps = class Maps extends Component {
7478
7629
  }
7479
7630
  const templateElements = document.getElementsByClassName(this.element.id + '_template');
7480
7631
  if (!isNullOrUndefined(templateElements) && templateElements.length > 0 &&
7481
- getElementByID(this.element.id + '_Layer_Collections') && this.layers[this.layers.length - 1].layerType !== 'OSM') {
7632
+ getElementByID(this.element.id + '_Layer_Collections') && !this.isTileMap) {
7482
7633
  for (let i = 0; i < templateElements.length; i++) {
7483
7634
  let offSetLetValue = 0;
7484
7635
  let offSetTopValue = 0;
@@ -7513,10 +7664,7 @@ let Maps = class Maps extends Component {
7513
7664
  const mainLayer = this.layersCollection[0];
7514
7665
  const padding = 0;
7515
7666
  if (mainLayer.isBaseLayer && (mainLayer.layerType === 'OSM' || mainLayer.layerType === 'Bing' ||
7516
- mainLayer.layerType === 'GoogleStaticMap' || mainLayer.layerType === 'Google')) {
7517
- if (mainLayer.layerType === 'Google') {
7518
- mainLayer.urlTemplate = 'https://mt1.google.com/vt/lyrs=m@129&hl=en&x=tileX&y=tileY&z=level';
7519
- }
7667
+ mainLayer.layerType === 'GoogleStaticMap' || mainLayer.layerType === 'Google' || (!isNullOrUndefined(mainLayer.urlTemplate) && mainLayer.urlTemplate !== ''))) {
7520
7668
  removeElement(this.element.id + '_tile_parent');
7521
7669
  removeElement(this.element.id + '_tiles');
7522
7670
  removeElement('animated_tiles');
@@ -7563,7 +7711,7 @@ let Maps = class Maps extends Component {
7563
7711
  const baseLayer = mainLayers[i];
7564
7712
  if (baseLayer.visible && baseIndex === i) {
7565
7713
  baseLayer.isBaseLayer = true;
7566
- this.isTileMap = (baseLayer.layerType === 'Geometry') ? false : true;
7714
+ this.isTileMap = (baseLayer.layerType === 'Geometry' && !isNullOrUndefined(baseLayer.shapeData)) ? false : true;
7567
7715
  this.layersCollection.push(baseLayer);
7568
7716
  break;
7569
7717
  }
@@ -7610,12 +7758,19 @@ let Maps = class Maps extends Component {
7610
7758
  * @private
7611
7759
  */
7612
7760
  renderTitle(title, type, bounds, groupEle) {
7613
- const style = title.textStyle;
7761
+ const style = {
7762
+ size: title.textStyle.size,
7763
+ color: title.textStyle.color,
7764
+ fontFamily: title.textStyle.fontFamily,
7765
+ fontWeight: title.textStyle.fontWeight,
7766
+ fontStyle: title.textStyle.fontStyle,
7767
+ opacity: title.textStyle.opacity
7768
+ };
7614
7769
  let height;
7615
7770
  const width = Math.abs((this.margin.left + this.margin.right) - this.availableSize.width);
7616
- style.fontFamily = this.themeStyle.fontFamily || style.fontFamily;
7771
+ style.fontFamily = !isNullOrUndefined(style.fontFamily) ? style.fontFamily : this.themeStyle.fontFamily;
7617
7772
  style.fontWeight = style.fontWeight || this.themeStyle.titleFontWeight;
7618
- style.size = this.themeStyle.titleFontSize || style.size;
7773
+ style.size = type === 'title' ? (style.size || this.themeStyle.titleFontSize) : (style.size || Theme.mapsSubTitleFont.size);
7619
7774
  if (title.text) {
7620
7775
  if (isNullOrUndefined(groupEle)) {
7621
7776
  groupEle = this.renderer.createGroup({ id: this.element.id + '_Title_Group' });
@@ -7785,6 +7940,7 @@ let Maps = class Maps extends Component {
7785
7940
  const id = event.target['id'];
7786
7941
  event.preventDefault();
7787
7942
  if (this.legendModule && (id.indexOf('_Left_Page_Rect') > -1 || id.indexOf('_Right_Page_Rect') > -1)) {
7943
+ this.mapAreaRect = this.legendModule.initialMapAreaRect;
7788
7944
  this.legendModule.currentPage = (id.indexOf('_Left_Page_') > -1) ? (this.legendModule.currentPage - 1) :
7789
7945
  (this.legendModule.currentPage + 1);
7790
7946
  this.legendModule.legendGroup = this.renderer.createGroup({ id: this.element.id + '_Legend_Group' });
@@ -8133,7 +8289,7 @@ let Maps = class Maps extends Component {
8133
8289
  removeElement(this.element.id + '_EJ2_LegendTitle_Tooltip');
8134
8290
  }
8135
8291
  if ((targetId === (this.element.id + '_Map_title')) && (event.target.textContent.indexOf('...') > -1)) {
8136
- showTooltip(this.titleSettings.text, this.titleSettings.textStyle.size, x, y, this.element.offsetWidth, this.element.offsetHeight, this.element.id + '_EJ2_Title_Tooltip', getElement(this.element.id + '_Secondary_Element'), isTouch);
8292
+ showTooltip(this.titleSettings.text, this.titleSettings.textStyle.size || this.themeStyle.titleFontSize, x, y, this.element.offsetWidth, this.element.offsetHeight, this.element.id + '_EJ2_Title_Tooltip', getElement(this.element.id + '_Secondary_Element'), isTouch);
8137
8293
  }
8138
8294
  else {
8139
8295
  removeElement(this.element.id + '_EJ2_Title_Tooltip');
@@ -8562,7 +8718,8 @@ let Maps = class Maps extends Component {
8562
8718
  if (!isNullOrUndefined(newProp.layers[x])) {
8563
8719
  const collection = Object.keys(newProp.layers[x]);
8564
8720
  for (const collectionProp of collection) {
8565
- if (collectionProp === 'layerType' && newProp.layers[x].layerType === 'OSM') {
8721
+ if ((collectionProp === 'layerType' && newProp.layers[x].layerType !== 'Geometry') || (isNullOrUndefined(this.layers[x].shapeData)
8722
+ && !isNullOrUndefined(this.layers[x].urlTemplate) && this.layers[x].urlTemplate !== '')) {
8566
8723
  this.isReset = true;
8567
8724
  }
8568
8725
  else if (collectionProp === 'markerSettings') {
@@ -8842,6 +8999,28 @@ let Maps = class Maps extends Component {
8842
8999
  }
8843
9000
  return null;
8844
9001
  }
9002
+ /**
9003
+ * This method is used to get the Bing maps URL.
9004
+ *
9005
+ * @param {string} url - Specifies the URL of the maps.
9006
+ * @returns {Promise<string>} - Returns the processed Bing URL as Promise.
9007
+ */
9008
+ getBingUrlTemplate(url) {
9009
+ const promise = new Promise((resolve, reject) => {
9010
+ const ajax = new Ajax({
9011
+ url: url
9012
+ });
9013
+ ajax.onSuccess = (json) => {
9014
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
9015
+ const jsonObject = JSON.parse(json);
9016
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
9017
+ const resource = jsonObject['resourceSets'][0]['resources'][0];
9018
+ resolve(resource['imageUrl']);
9019
+ };
9020
+ ajax.send();
9021
+ });
9022
+ return promise;
9023
+ }
8845
9024
  /**
8846
9025
  * To find visibility of layers and markers for required modules load.
8847
9026
  *
@@ -9185,12 +9364,8 @@ class Bubble {
9185
9364
  isNaN(shapeData[layer.shapeDataPath]) ? shapeData[layer.shapeDataPath].toLowerCase() : shapeData[layer.shapeDataPath];
9186
9365
  const shapePathValue = !isNullOrUndefined(shape[shapePath]) && isNaN(shape[shapePath])
9187
9366
  ? shape[shapePath].toLowerCase() : shape[shapePath];
9188
- if (shapeDataLayerPathValue === shapePathValue && layerData[i].type !== 'LineString') {
9189
- if (layerData[i]['type'] === 'Point') {
9190
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
9191
- shapePoints.push(this.getPoints(layerData[i], []));
9192
- }
9193
- else if (!layerData[i]['_isMultiPolygon']) {
9367
+ if (shapeDataLayerPathValue === shapePathValue && (layerData[i].type !== 'LineString' && layerData[i].type !== 'MultiLineString' && layerData[i]['type'] !== 'Point' && layerData[i]['type'] !== 'MultiPoint')) {
9368
+ if (!layerData[i]['_isMultiPolygon']) {
9194
9369
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
9195
9370
  shapePoints.push(this.getPoints(layerData[i], []));
9196
9371
  currentLength = shapePoints[shapePoints.length - 1].length;
@@ -9513,7 +9688,7 @@ class DataLabel {
9513
9688
  layer.dataSource, layer.shapeDataPath, shapeData['properties'][propertyPath], layer.shapeDataPath);
9514
9689
  if (!isNullOrUndefined(shapes['property'])) {
9515
9690
  shapePoint = [[]];
9516
- if (!layerData[index]['_isMultiPolygon'] && layerData[index]['type'] !== 'Point') {
9691
+ if (!layerData[index]['_isMultiPolygon'] && layerData[index]['type'] !== 'Point' && layerData[index]['type'] !== 'MultiPoint') {
9517
9692
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
9518
9693
  shapePoint.push(this.getPoint(layerData[index], []));
9519
9694
  currentLength = shapePoint[shapePoint.length - 1].length;
@@ -9522,21 +9697,9 @@ class DataLabel {
9522
9697
  midIndex = shapePoint.length - 1;
9523
9698
  }
9524
9699
  }
9525
- else {
9700
+ else if (layerData[index]['type'] !== 'Point' && layerData[index]['type'] !== 'MultiPoint') {
9526
9701
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
9527
9702
  const layer = layerData[index];
9528
- if (layer['type'] === 'Point') {
9529
- isPoint = true;
9530
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
9531
- const layerPoints = [];
9532
- layerPoints.push(this.getPoint(layerData, []));
9533
- shapePoint = layerPoints;
9534
- currentLength = shapePoint[shapePoint.length - 1].length;
9535
- if (pointsLength < currentLength) {
9536
- pointsLength = currentLength;
9537
- midIndex = shapePoint.length - 1;
9538
- }
9539
- }
9540
9703
  for (let j = 0; j < layer.length; j++) {
9541
9704
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
9542
9705
  shapePoint.push(this.getPoint(layer[j], []));
@@ -9781,10 +9944,21 @@ class DataLabel {
9781
9944
  }
9782
9945
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
9783
9946
  getPoint(shapes, points) {
9784
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
9785
- shapes.map((current, index) => {
9786
- points.push(new Point(current['point']['x'], current['point']['y']));
9787
- });
9947
+ if (shapes['type'] === 'MultiLineString') {
9948
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
9949
+ shapes.map((current) => {
9950
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
9951
+ current.map((shape) => {
9952
+ points.push(new Point(shape['point']['x'], shape['point']['y']));
9953
+ });
9954
+ });
9955
+ }
9956
+ else {
9957
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
9958
+ shapes.map((current, index) => {
9959
+ points.push(new Point(current['point']['x'], current['point']['y']));
9960
+ });
9961
+ }
9788
9962
  return points;
9789
9963
  }
9790
9964
  /**
@@ -9976,6 +10150,10 @@ class Legend {
9976
10150
  * @private
9977
10151
  */
9978
10152
  this.legendBorderRect = new Rect(0, 0, 0, 0);
10153
+ /**
10154
+ * @private
10155
+ */
10156
+ this.initialMapAreaRect = new Rect(0, 0, 0, 0);
9979
10157
  /**
9980
10158
  * @private
9981
10159
  */
@@ -10034,6 +10212,7 @@ class Legend {
10034
10212
  this.heightIncrement = 0;
10035
10213
  this.defsElement = this.maps.renderer.createDefs();
10036
10214
  this.maps.svgObject.appendChild(this.defsElement);
10215
+ this.initialMapAreaRect = this.maps.mapAreaRect;
10037
10216
  this.calculateLegendBounds();
10038
10217
  this.drawLegend();
10039
10218
  }
@@ -10071,9 +10250,9 @@ class Legend {
10071
10250
  }
10072
10251
  }
10073
10252
  }
10074
- else {
10075
- this.getMarkersLegendCollections(layerIndex, layer.markerSettings);
10076
- }
10253
+ }
10254
+ if (legend.type === 'Markers') {
10255
+ this.getMarkersLegendCollections(layerIndex, layer.markerSettings);
10077
10256
  }
10078
10257
  });
10079
10258
  if (this.legendCollection.length > 0) {
@@ -10264,8 +10443,9 @@ class Legend {
10264
10443
  }
10265
10444
  }
10266
10445
  else {
10446
+ let padding = 10;
10267
10447
  shapeX = shapeLocation[j - 1].x;
10268
- shapeY = prevPositionY + topPadding + (shapeHeight / 2);
10448
+ shapeY = prevPositionY + padding + (shapeHeight / 2);
10269
10449
  }
10270
10450
  }
10271
10451
  }
@@ -10368,7 +10548,14 @@ class Legend {
10368
10548
  const legend = map.legendSettings;
10369
10549
  const render = map.renderer;
10370
10550
  let textOptions;
10371
- const textFont = legend.textStyle;
10551
+ const textFont = {
10552
+ size: legend.textStyle.size,
10553
+ color: legend.textStyle.color,
10554
+ fontFamily: legend.textStyle.fontFamily,
10555
+ fontWeight: legend.textStyle.fontWeight,
10556
+ fontStyle: legend.textStyle.fontStyle,
10557
+ opacity: legend.textStyle.opacity
10558
+ };
10372
10559
  this.legendGroup = render.createGroup({ id: map.element.id + '_Legend_Group' });
10373
10560
  if (legend.mode === 'Interactive') {
10374
10561
  for (let i = 0; i < this.legendRenderingCollections.length; i++) {
@@ -10384,7 +10571,7 @@ class Legend {
10384
10571
  textFont.color = (textFont.color !== null) ? textFont.color : this.maps.themeStyle.legendTextColor;
10385
10572
  const rectOptions = new RectOption(itemId, item['fill'], item['shapeBorder'], legend.opacity, bounds);
10386
10573
  textOptions = new TextOption(textId, textLocation.x, textLocation.y, 'middle', item['text'], '', '');
10387
- textFont.fontFamily = map.themeStyle.fontFamily || textFont.fontFamily;
10574
+ textFont.fontFamily = !isNullOrUndefined(textFont.fontFamily) ? textFont.fontFamily : this.maps.themeStyle.fontFamily;
10388
10575
  textFont.size = map.themeStyle.legendFontSize || textFont.size;
10389
10576
  renderTextElement(textOptions, textFont, textFont.color, this.legendGroup);
10390
10577
  this.legendGroup.appendChild(render.drawRectangle(rectOptions));
@@ -10439,7 +10626,7 @@ class Legend {
10439
10626
  };
10440
10627
  legendTextStyle.color = (legendTextStyle.color !== null) ? legendTextStyle.color :
10441
10628
  this.maps.themeStyle.legendTextColor;
10442
- legendTextStyle.fontFamily = map.themeStyle.fontFamily || legendTextStyle.fontFamily;
10629
+ legendTextStyle.fontFamily = !isNullOrUndefined(legendTextStyle.fontFamily) ? legendTextStyle.fontFamily : this.maps.themeStyle.fontFamily;
10443
10630
  legendTextStyle.size = map.themeStyle.legendFontSize || legendTextStyle.size;
10444
10631
  if (i === 0) {
10445
10632
  this.renderLegendBorder();
@@ -10515,7 +10702,9 @@ class Legend {
10515
10702
  'opacity': 1,
10516
10703
  'dominant-baseline': ''
10517
10704
  };
10518
- pagingGroup.appendChild(render.createText(pageTextOptions, pagingText));
10705
+ let pagingTextElement = render.createText(pageTextOptions, pagingText);
10706
+ pagingTextElement.setAttribute('style', 'user-select: none;');
10707
+ pagingGroup.appendChild(pagingTextElement);
10519
10708
  this.legendGroup.appendChild(pagingGroup);
10520
10709
  }
10521
10710
  this.legendToggle();
@@ -10527,6 +10716,7 @@ class Legend {
10527
10716
  let shapeIndex;
10528
10717
  let layerIndex;
10529
10718
  let dataIndex;
10719
+ let pointIndex;
10530
10720
  const legend = this.maps.legendSettings;
10531
10721
  const textEle = legend.mode === 'Default' ? document.getElementById(targetElement.id.replace('Shape', 'Text')) :
10532
10722
  document.getElementById(targetElement.id + '_Text');
@@ -10614,12 +10804,20 @@ class Legend {
10614
10804
  }
10615
10805
  if (enable) {
10616
10806
  for (let j = 0; j < data.length; j++) {
10807
+ let shapeElement;
10617
10808
  shapeIndex = data[j]['shapeIndex'];
10618
10809
  layerIndex = data[j]['layerIndex'];
10619
10810
  dataIndex = data[j]['dataIndex'];
10620
- const shapeEle = document.getElementById(this.maps.element.id + '_LayerIndex_' +
10621
- layerIndex + '_shapeIndex_' + shapeIndex + '_dataIndex_' + dataIndex);
10622
- if (shapeEle !== null) {
10811
+ pointIndex = data[j]['pointIndex'];
10812
+ if (pointIndex === -1) {
10813
+ shapeElement = document.getElementById(this.maps.element.id + '_LayerIndex_' +
10814
+ layerIndex + '_shapeIndex_' + shapeIndex + '_dataIndex_' + dataIndex);
10815
+ }
10816
+ else {
10817
+ shapeElement = document.getElementById(this.maps.element.id + '_LayerIndex_' +
10818
+ layerIndex + '_shapeIndex_' + shapeIndex + '_dataIndex_' + dataIndex + '_multiLine_' + pointIndex);
10819
+ }
10820
+ if (shapeElement !== null) {
10623
10821
  let shapeMatch = true;
10624
10822
  if (this.maps.legendSelectionCollection !== null) {
10625
10823
  for (let i = 0; i < this.maps.legendSelectionCollection.length; i++) {
@@ -10636,13 +10834,13 @@ class Legend {
10636
10834
  }
10637
10835
  length = this.legendHighlightCollection.length;
10638
10836
  const legendHighlightColor = this.legendHighlightCollection[length - 1]['legendOldFill'];
10639
- this.legendHighlightCollection[length - 1]['MapShapeCollection']['Elements'].push(shapeEle);
10837
+ this.legendHighlightCollection[length - 1]['MapShapeCollection']['Elements'].push(shapeElement);
10640
10838
  const shapeItemCount = this.legendHighlightCollection[length - 1]['MapShapeCollection']['Elements'].length - 1;
10641
- const shapeOldFillColor = shapeEle.getAttribute('fill');
10839
+ const shapeOldFillColor = shapeElement.getAttribute('fill');
10642
10840
  this.legendHighlightCollection[length - 1]['shapeOldFillColor'].push(shapeOldFillColor);
10643
10841
  const shapeOldColor = this.legendHighlightCollection[length - 1]['shapeOldFillColor'][shapeItemCount];
10644
10842
  this.shapePreviousColor = this.legendHighlightCollection[length - 1]['shapeOldFillColor'];
10645
- this.setColor(shapeEle, !isNullOrUndefined(module.fill) ? module.fill : shapeOldColor, module.opacity.toString(), module.border.color, module.border.width.toString(), 'highlight');
10843
+ this.setColor(shapeElement, !isNullOrUndefined(module.fill) ? module.fill : shapeOldColor, module.opacity.toString(), module.border.color, module.border.width.toString(), 'highlight');
10646
10844
  this.setColor(targetElement, !isNullOrUndefined(module.fill) ? module.fill : legendHighlightColor, module.opacity.toString(), module.border.color, module.border.width.toString(), 'highlight');
10647
10845
  }
10648
10846
  else if (value === 'selection') {
@@ -10665,12 +10863,12 @@ class Legend {
10665
10863
  }
10666
10864
  selectLength = this.maps.legendSelectionCollection.length;
10667
10865
  const legendSelectionColor = this.maps.legendSelectionCollection[selectLength - 1]['legendOldFill'];
10668
- this.maps.legendSelectionCollection[selectLength - 1]['MapShapeCollection']['Elements'].push(shapeEle);
10866
+ this.maps.legendSelectionCollection[selectLength - 1]['MapShapeCollection']['Elements'].push(shapeElement);
10669
10867
  this.maps.legendSelectionCollection[selectLength - 1]['shapeOldFillColor'] = this.shapePreviousColor;
10670
10868
  this.setColor(targetElement, !isNullOrUndefined(module.fill) ? module.fill : legendSelectionColor, module.opacity.toString(), module.border.color, module.border.width.toString(), 'selection');
10671
- this.setColor(shapeEle, !isNullOrUndefined(module.fill) ? module.fill : legendSelectionColor, module.opacity.toString(), module.border.color, module.border.width.toString(), 'selection');
10672
- if (this.maps.selectedElementId.indexOf(shapeEle.getAttribute('id')) === -1) {
10673
- this.maps.selectedElementId.push(shapeEle.getAttribute('id'));
10869
+ this.setColor(shapeElement, !isNullOrUndefined(module.fill) ? module.fill : legendSelectionColor, module.opacity.toString(), module.border.color, module.border.width.toString(), 'selection');
10870
+ if (this.maps.selectedElementId.indexOf(shapeElement.getAttribute('id')) === -1) {
10871
+ this.maps.selectedElementId.push(shapeElement.getAttribute('id'));
10674
10872
  }
10675
10873
  if (j === data.length - 1) {
10676
10874
  this.maps.legendSelection = false;
@@ -10685,14 +10883,15 @@ class Legend {
10685
10883
  }
10686
10884
  }
10687
10885
  setColor(element, fill, opacity, borderColor, borderWidth, type) {
10886
+ const isLineStringShape = (element.parentElement.id.indexOf('LineString') > -1);
10688
10887
  if (type === 'selection') {
10689
- maintainStyleClass('ShapeselectionMap', 'ShapeselectionMapStyle', fill, opacity, borderColor, borderWidth, this.maps);
10690
- element.setAttribute('class', 'ShapeselectionMapStyle');
10888
+ maintainStyleClass((isLineStringShape ? 'LineselectionMap' : 'ShapeselectionMap'), (isLineStringShape ? 'LineselectionMapStyle' : 'ShapeselectionMapStyle'), (isLineStringShape ? 'transparent' : fill), opacity, (isLineStringShape ? fill : borderColor), borderWidth, this.maps);
10889
+ element.setAttribute('class', isLineStringShape ? 'LineselectionMapStyle' : 'ShapeselectionMapStyle');
10691
10890
  }
10692
10891
  else {
10693
- element.setAttribute('fill', fill);
10892
+ element.setAttribute('fill', isLineStringShape ? 'transparent' : fill);
10694
10893
  element.setAttribute('fill-opacity', opacity);
10695
- element.setAttribute('stroke', borderColor);
10894
+ element.setAttribute('stroke', isLineStringShape ? fill : borderColor);
10696
10895
  element.setAttribute('stroke-width', (Number(borderWidth) / this.maps.scale).toString());
10697
10896
  }
10698
10897
  }
@@ -10735,7 +10934,8 @@ class Legend {
10735
10934
  const dataCount = shapeElements.length;
10736
10935
  for (let j = 0; j < dataCount; j++) {
10737
10936
  const shapeElement = getElement(shapeElements[j]);
10738
- if (shapeElement.getAttribute('class') === 'ShapeselectionMapStyle') {
10937
+ if (shapeElement.getAttribute('class') === 'ShapeselectionMapStyle' ||
10938
+ shapeElement.getAttribute('class') === 'LineselectionMapStyle') {
10739
10939
  removeClass(shapeElement);
10740
10940
  const selectedElementIdIndex = this.maps.selectedElementId.indexOf(shapeElement.id);
10741
10941
  if (selectedElementIdIndex !== -1) {
@@ -10813,12 +11013,14 @@ class Legend {
10813
11013
  this.maps.legendSelectionClass = module;
10814
11014
  }
10815
11015
  else {
10816
- if ((checkSelection <= 1) && targetElement.getAttribute('class') === 'ShapeselectionMapStyle') {
11016
+ if ((checkSelection <= 1) && (targetElement.getAttribute('class') === 'ShapeselectionMapStyle'
11017
+ || targetElement.getAttribute('class') === 'LineselectionMapStyle')) {
10817
11018
  if (!this.maps.layers[layerIndex].selectionSettings.enableMultiSelect) {
10818
11019
  this.maps.selectedLegendElementId.splice(selectionIndex, 1);
10819
11020
  }
10820
11021
  else {
10821
- if (checkSelection <= 1 && targetElement.getAttribute('class') === 'ShapeselectionMapStyle') {
11022
+ if (checkSelection <= 1 && (targetElement.getAttribute('class') === 'ShapeselectionMapStyle'
11023
+ || targetElement.getAttribute('class') === 'LineselectionMapStyle')) {
10822
11024
  this.maps.selectedLegendElementId.splice(selectionIndex, 1);
10823
11025
  }
10824
11026
  }
@@ -10905,7 +11107,8 @@ class Legend {
10905
11107
  }
10906
11108
  }
10907
11109
  }
10908
- if (selectionEle && (selectionEle['IsSelected'] && targetElement.getAttribute('class') === 'ShapeselectionMapStyle')) {
11110
+ if (selectionEle && (selectionEle['IsSelected'] && (targetElement.getAttribute('class') === 'ShapeselectionMapStyle'
11111
+ || targetElement.getAttribute('class') === 'LineselectionMapStyle'))) {
10909
11112
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
10910
11113
  const element = this.maps.legendSelectionCollection[selectionEle['SelectionIndex']];
10911
11114
  let multiSelection = 0;
@@ -10996,7 +11199,7 @@ class Legend {
10996
11199
  }
10997
11200
  for (let j = 0; j < this.maps.selectedLegendElementId.length; j++) {
10998
11201
  const idIndex = this.maps.legendSettings.mode === 'Interactive' ?
10999
- 'container_Legend_Index_' : 'container_Legend_Shape_Index_';
11202
+ this.maps.element.id + '_Legend_Index_' : this.maps.element.id + '_Legend_Shape_Index_';
11000
11203
  const selectedElement = idIndex + this.maps.selectedLegendElementId[j];
11001
11204
  const legendElement = document.getElementById(selectedElement);
11002
11205
  if (!isNullOrUndefined(legendElement)) {
@@ -11048,6 +11251,7 @@ class Legend {
11048
11251
  let shapeIndex;
11049
11252
  let layerIndex;
11050
11253
  let dataIndex;
11254
+ let pointIndex;
11051
11255
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
11052
11256
  const collection = this.maps.legendModule.legendCollection;
11053
11257
  const legend = this.maps.legendSettings;
@@ -11060,15 +11264,23 @@ class Legend {
11060
11264
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
11061
11265
  const currentElement = { Elements: [] };
11062
11266
  for (let j = 0; j < data.length; j++) {
11267
+ let shapeElement;
11063
11268
  shapeIndex = data[j]['shapeIndex'];
11064
11269
  layerIndex = data[j]['layerIndex'];
11065
11270
  dataIndex = data[j]['dataIndex'];
11066
- const shapeEle = document.getElementById(this.maps.element.id + '_LayerIndex_' +
11067
- layerIndex + '_shapeIndex_' + shapeIndex + '_dataIndex_' + dataIndex);
11068
- if (targetElement === shapeEle) {
11271
+ pointIndex = data[j]['pointIndex'];
11272
+ if (pointIndex === -1) {
11273
+ shapeElement = document.getElementById(this.maps.element.id + '_LayerIndex_' +
11274
+ layerIndex + '_shapeIndex_' + shapeIndex + '_dataIndex_' + dataIndex);
11275
+ }
11276
+ else {
11277
+ shapeElement = document.getElementById(this.maps.element.id + '_LayerIndex_' +
11278
+ layerIndex + '_shapeIndex_' + shapeIndex + '_dataIndex_' + dataIndex + '_multiLine_' + pointIndex);
11279
+ }
11280
+ if (targetElement === shapeElement) {
11069
11281
  process = true;
11070
11282
  }
11071
- elements.push(shapeEle);
11283
+ elements.push(shapeElement);
11072
11284
  }
11073
11285
  if (process) {
11074
11286
  if (isNullOrUndefined(currentElement['LegendEle'])) {
@@ -11086,16 +11298,25 @@ class Legend {
11086
11298
  let shapeIndex;
11087
11299
  let layerIndex;
11088
11300
  let dataIndex;
11301
+ let pointIndex;
11089
11302
  const idIndex = parseFloat(targetElement.id.charAt(targetElement.id.length - 1));
11090
11303
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
11091
11304
  const data = this.maps.legendModule.legendCollection[idIndex]['data'];
11092
11305
  const legendShapeElements = [];
11093
11306
  for (let i = 0; i < data.length; i++) {
11307
+ let shapeElement;
11094
11308
  shapeIndex = data[i]['shapeIndex'];
11095
11309
  layerIndex = data[i]['layerIndex'];
11096
11310
  dataIndex = data[i]['dataIndex'];
11097
- const shapeElement = document.getElementById(this.maps.element.id + '_LayerIndex_' +
11098
- layerIndex + '_shapeIndex_' + shapeIndex + '_dataIndex_' + dataIndex);
11311
+ pointIndex = data[i]['pointIndex'];
11312
+ if (pointIndex === -1) {
11313
+ shapeElement = document.getElementById(this.maps.element.id + '_LayerIndex_' +
11314
+ layerIndex + '_shapeIndex_' + shapeIndex + '_dataIndex_' + dataIndex);
11315
+ }
11316
+ else {
11317
+ shapeElement = document.getElementById(this.maps.element.id + '_LayerIndex_' +
11318
+ layerIndex + '_shapeIndex_' + shapeIndex + '_dataIndex_' + dataIndex + '_multiLine_' + pointIndex);
11319
+ }
11099
11320
  if (!isNullOrUndefined(shapeElement)) {
11100
11321
  legendShapeElements.push(shapeElement.id);
11101
11322
  }
@@ -11163,9 +11384,11 @@ class Legend {
11163
11384
  const renderOptions = new RectOption(map.element.id + '_Legend_Border', legend.background, legendBorder, 1, this.legendBorderRect, null, null, '', '');
11164
11385
  this.legendGroup.appendChild(map.renderer.drawRectangle(renderOptions));
11165
11386
  this.getLegendAlignment(map, this.legendBorderRect.width, this.legendBorderRect.height, legend);
11166
- this.legendGroup.setAttribute('transform', 'translate( ' + (this.translate.x + (-(this.legendBorderRect.x))) + ' ' +
11387
+ this.legendGroup.setAttribute('transform', 'translate( ' + (this.translate.x + (-this.legendBorderRect.x)) + ' ' +
11167
11388
  (this.translate.y + (-(this.legendBorderRect.y))) + ' )');
11168
- map.svgObject.appendChild(this.legendGroup);
11389
+ if (legend.position !== 'Float') {
11390
+ map.svgObject.appendChild(this.legendGroup);
11391
+ }
11169
11392
  if (legendTitle) {
11170
11393
  textStyle.color = (textStyle.color !== null) ? textStyle.color : this.maps.themeStyle.legendTitleFontColor;
11171
11394
  textStyle.fontFamily = !isNullOrUndefined(textStyle.fontFamily) ? textStyle.fontFamily : this.maps.themeStyle.fontFamily;
@@ -11177,7 +11400,16 @@ class Legend {
11177
11400
  this.currentPage = (e.target.id.indexOf('_Left_Page_') > -1) ? (this.currentPage - 1) :
11178
11401
  (this.currentPage + 1);
11179
11402
  this.legendGroup = this.maps.renderer.createGroup({ id: this.maps.element.id + '_Legend_Group' });
11403
+ this.maps.mapAreaRect = this.initialMapAreaRect;
11180
11404
  this.drawLegendItem(this.currentPage);
11405
+ if (!isNullOrUndefined(this.maps.legendModule) && this.maps.legendSettings.position === 'Float') {
11406
+ if (this.maps.isTileMap) {
11407
+ this.maps.mapLayerPanel.layerGroup.appendChild(this.maps.legendModule.legendGroup);
11408
+ }
11409
+ else {
11410
+ this.maps.svgObject.appendChild(this.maps.legendModule.legendGroup);
11411
+ }
11412
+ }
11181
11413
  if (querySelector(this.maps.element.id + '_Legend_Border', this.maps.element.id)) {
11182
11414
  querySelector(this.maps.element.id + '_Legend_Border', this.maps.element.id).style.pointerEvents = 'none';
11183
11415
  }
@@ -11195,53 +11427,60 @@ class Legend {
11195
11427
  const areaWidth = totalRect.width;
11196
11428
  const totalWidth = map.availableSize.width;
11197
11429
  const totalHeight = map.availableSize.height;
11430
+ const locationX = !isNullOrUndefined(legend.location.x) ? legend.location.x : 0;
11431
+ const locationY = !isNullOrUndefined(legend.location.y) ? legend.location.y : 0;
11198
11432
  if (legend.position === 'Float') {
11199
- this.translate = legend.location;
11433
+ this.translate = map.isTileMap ? new Point(locationX, locationY + (spacing / 4)) : new Point(locationX + map.mapAreaRect.x, locationY + map.mapAreaRect.y);
11434
+ this.legendTotalRect = map.mapAreaRect;
11200
11435
  }
11201
11436
  else {
11202
11437
  switch (legend.position) {
11203
11438
  case 'Top':
11204
11439
  case 'Bottom':
11205
- totalRect.height = (areaHeight - height);
11440
+ totalRect.height = (legend.position === 'Top') ? (areaHeight - height) : (areaHeight - height - (spacing * 2));
11206
11441
  x = (totalWidth / 2) - (width / 2);
11207
11442
  y = (legend.position === 'Top') ? areaY : (areaY + totalRect.height);
11208
- totalRect.y = (legend.position === 'Top') ? areaY + height + spacing : areaY;
11443
+ totalRect.y = (legend.position === 'Top') ? areaY + height + (map.isTileMap ? (spacing / 2) : spacing) : areaY - (spacing / 2);
11209
11444
  break;
11210
11445
  case 'Left':
11211
11446
  case 'Right':
11212
- totalRect.width = (areaWidth - width);
11213
- x = (legend.position === 'Left') ? areaX : (areaX + totalRect.width) - spacing;
11447
+ totalRect.width = (areaWidth - width - map.mapAreaRect.x);
11448
+ x = (legend.position === 'Left') ? areaX + (spacing / 2) : (areaX + totalRect.width + spacing);
11214
11449
  y = (totalHeight / 2) - (height / 2);
11215
- totalRect.x = (legend.position === 'Left') ? areaX + width : areaX;
11450
+ totalRect.x = (legend.position === 'Left') ? areaX + width + spacing : areaX;
11216
11451
  break;
11217
11452
  }
11218
11453
  switch (legend.alignment) {
11219
11454
  case 'Near':
11220
11455
  if (legend.position === 'Top' || legend.position === 'Bottom') {
11221
- x = totalRect.x;
11456
+ x = totalRect.x - (legend.mode === 'Interactive' ? spacing : 0);
11222
11457
  }
11223
11458
  else {
11224
- y = totalRect.y;
11459
+ y = totalRect.y - (!(legend.height && legend.width) && legend.mode === 'Interactive' ? map.mapAreaRect.x : 0);
11225
11460
  }
11226
11461
  break;
11227
11462
  case 'Far':
11228
11463
  if (legend.position === 'Top' || legend.position === 'Bottom') {
11229
- x = (totalWidth - width) - spacing;
11464
+ x = (totalWidth - width) - (legend.mode === 'Interactive' ? 0 : spacing);
11230
11465
  }
11231
11466
  else {
11232
- y = totalHeight - height;
11467
+ y = totalHeight - height - (legend.mode === 'Default' ? spacing : 0);
11233
11468
  }
11234
11469
  break;
11235
11470
  }
11236
11471
  if ((legend.height || legend.width) && legend.mode !== 'Interactive') {
11237
- this.legendTotalRect = map.totalRect = totalRect;
11472
+ this.legendTotalRect = map.mapAreaRect = map.totalRect = totalRect;
11238
11473
  }
11239
11474
  else {
11475
+ map.totalRect = null;
11240
11476
  if ((legend.height || legend.width) && legend.mode === 'Interactive') {
11241
11477
  map.totalRect = totalRect;
11242
11478
  }
11243
11479
  this.legendTotalRect = map.mapAreaRect = totalRect;
11244
11480
  }
11481
+ if (legend.position === 'Left') {
11482
+ map.mapAreaRect.width = totalRect.width;
11483
+ }
11245
11484
  this.translate = new Point(x, y);
11246
11485
  }
11247
11486
  }
@@ -11362,6 +11601,13 @@ class Legend {
11362
11601
  borderColor: legend.shapeBorder.color, borderWidth: legend.shapeBorder.width
11363
11602
  });
11364
11603
  }
11604
+ else {
11605
+ for (let i = 0; i < this.legendCollection.length; i++) {
11606
+ if (this.legendCollection[i]['text'] === legendText && this.legendCollection[i]['fill'] === legendFill) {
11607
+ this.legendCollection[i].data.push(newColllection[0]);
11608
+ }
11609
+ }
11610
+ }
11365
11611
  }
11366
11612
  }
11367
11613
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -11556,15 +11802,16 @@ class Legend {
11556
11802
  const width = 10;
11557
11803
  const direction = (legend.orientation === 'None') ? (legend.position === 'Top' || legend.position === 'Bottom')
11558
11804
  ? 'Horizontal' : 'Vertical' : legend.orientation;
11805
+ rect.y = legend.position === 'Float' && this.maps.isTileMap ? rect.y - this.maps.mapAreaRect.y : rect.y;
11559
11806
  if (direction === 'Horizontal') {
11560
11807
  if (!legend.invertedPointer) {
11561
- locX = rect.x + (rect.width / 2);
11808
+ locX = rect.x + (rect.width / 2) - (legend.position === 'Float' && this.maps.isTileMap ? this.maps.mapAreaRect.x : 0);
11562
11809
  locY = rect.y;
11563
11810
  path = ' M ' + locX + ' ' + locY + ' L ' + (locX - width) + ' ' + (locY - height) +
11564
11811
  ' L ' + (locX + width) + ' ' + (locY - height) + ' Z ';
11565
11812
  }
11566
11813
  else {
11567
- locX = rect.x + (rect.width / 2);
11814
+ locX = rect.x + (rect.width / 2) - (legend.position === 'Float' && this.maps.isTileMap ? this.maps.mapAreaRect.x : 0);
11568
11815
  locY = rect.y + (rect.height);
11569
11816
  path = ' M ' + locX + ' ' + locY + ' L ' + (locX - width) + ' ' + (locY + height) +
11570
11817
  ' L ' + (locX + width) + ' ' + (locY + height) + ' Z ';
@@ -11572,20 +11819,25 @@ class Legend {
11572
11819
  }
11573
11820
  else {
11574
11821
  if (!legend.invertedPointer) {
11575
- locX = rect.x + (rect.width);
11822
+ locX = rect.x + rect.width - (legend.position === 'Float' && this.maps.isTileMap ? this.maps.mapAreaRect.x : 0);
11576
11823
  locY = rect.y + (rect.height / 2);
11577
11824
  path = ' M ' + locX + ' ' + locY + ' L ' + (locX + width) + ' ' + (locY - height) +
11578
11825
  ' L ' + (locX + width) + ' ' + (locY + height) + ' z ';
11579
11826
  }
11580
11827
  else {
11581
- locX = rect.x;
11828
+ locX = rect.x - (legend.position === 'Float' && this.maps.isTileMap ? this.maps.mapAreaRect.x : 0);
11582
11829
  locY = rect.y + (rect.height / 2);
11583
11830
  path = ' M ' + locX + ' ' + locY + ' L ' + (locX - width) + ' ' + (locY - height) +
11584
11831
  ' L ' + (locX - width) + ' ' + (locY + height) + ' z ';
11585
11832
  }
11586
11833
  }
11587
11834
  const pathOptions = new PathOption(id, fill, strokeWidth, stroke, 1, 1, '', path);
11588
- this.maps.svgObject.appendChild(this.maps.renderer.drawPath(pathOptions));
11835
+ if (legend.position === 'Float' && this.maps.isTileMap) {
11836
+ this.maps.mapLayerPanel.layerGroup.appendChild(this.maps.renderer.drawPath(pathOptions));
11837
+ }
11838
+ else {
11839
+ this.maps.svgObject.appendChild(this.maps.renderer.drawPath(pathOptions));
11840
+ }
11589
11841
  }
11590
11842
  wireEvents(element) {
11591
11843
  EventHandler.add(element, Browser.touchStartEvent, this.changeNextPage, this);
@@ -11946,10 +12198,20 @@ class Legend {
11946
12198
  const shapeDataValueCase = !isNullOrUndefined(shapeData['properties'][shapePath])
11947
12199
  && isNaN(shapeData['properties'][shapePath]) ? shapeData['properties'][shapePath].toLowerCase() : shapeData['properties'][shapePath];
11948
12200
  if (shapeDataValueCase === dataPathValueCase) {
11949
- legendData.push({
11950
- layerIndex: layerIndex, shapeIndex: i, dataIndex: dataIndex,
11951
- name: data[dataPath], value: value
11952
- });
12201
+ if (shapeData['geometry']['type'] != 'MultiPoint') {
12202
+ legendData.push({
12203
+ layerIndex: layerIndex, shapeIndex: i, dataIndex: dataIndex,
12204
+ name: data[dataPath], value: value, pointIndex: -1
12205
+ });
12206
+ }
12207
+ else {
12208
+ for (let j = 0; j < shapeData['geometry'].coordinates.length; j++) {
12209
+ legendData.push({
12210
+ layerIndex: layerIndex, shapeIndex: i, dataIndex: dataIndex,
12211
+ name: data[dataPath], value: value, pointIndex: j
12212
+ });
12213
+ }
12214
+ }
11953
12215
  }
11954
12216
  }
11955
12217
  }
@@ -12060,7 +12322,8 @@ class Highlight {
12060
12322
  targetEle.getAttribute('class') !== 'ShapeselectionMapStyle' && !isTouch &&
12061
12323
  targetEle.getAttribute('class') !== 'MarkerselectionMapStyle' &&
12062
12324
  targetEle.getAttribute('class') !== 'BubbleselectionMapStyle' &&
12063
- targetEle.getAttribute('class') !== 'navigationlineselectionMapStyle') {
12325
+ targetEle.getAttribute('class') !== 'navigationlineselectionMapStyle' &&
12326
+ targetEle.getAttribute('class') !== 'LineselectionMapStyle') {
12064
12327
  layerIndex = parseInt(targetEle.id.split('_LayerIndex_')[1].split('_')[0], 10);
12065
12328
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
12066
12329
  let shapeData;
@@ -12070,8 +12333,9 @@ class Highlight {
12070
12333
  let dataIndex;
12071
12334
  if (targetEle.id.indexOf('shapeIndex') > -1) {
12072
12335
  shapeIn = parseInt(targetEle.id.split('_shapeIndex_')[1].split('_')[0], 10);
12073
- shapeData = this.maps.layers[layerIndex].shapeData['features'] ?
12074
- this.maps.layers[layerIndex].shapeData['features'][shapeIn]['properties'] : null;
12336
+ shapeData = this.maps.layers[layerIndex].shapeData['features'] &&
12337
+ !isNullOrUndefined(this.maps.layersCollection[layerIndex].layerData[shapeIn]) ?
12338
+ this.maps.layersCollection[layerIndex].layerData[shapeIn]['property'] : null;
12075
12339
  dataIndex = parseInt(targetEle.id.split('_dataIndex_')[1].split('_')[0], 10);
12076
12340
  data = isNullOrUndefined(dataIndex) ? null : this.maps.layers[layerIndex].dataSource[dataIndex];
12077
12341
  this.highlightSettings = this.maps.layers[layerIndex].highlightSettings;
@@ -12143,7 +12407,8 @@ class Highlight {
12143
12407
  */
12144
12408
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
12145
12409
  handleHighlight(targetElement, layerIndex, data, shapeData) {
12146
- if (this.maps.legendSettings.visible && targetElement.id.indexOf('_MarkerIndex_') === -1 && this.maps.legendModule) {
12410
+ if (this.maps.legendSettings.visible && targetElement.id.indexOf('_MarkerIndex_') === -1 && this.maps.legendModule
12411
+ && this.maps.legendSettings.type === 'Layers') {
12147
12412
  this.maps.legendModule.shapeHighLightAndSelection(targetElement, data, this.highlightSettings, 'highlight', layerIndex);
12148
12413
  }
12149
12414
  const selectHighLight = targetElement.id.indexOf('shapeIndex') > -1 && (this.maps.legendSettings.visible && this.maps.legendModule) ?
@@ -12161,7 +12426,7 @@ class Highlight {
12161
12426
  isMarkerSelect = this.maps.layers[layerIndex].markerSettings[marker$$1].highlightSettings.enable;
12162
12427
  }
12163
12428
  const border = {
12164
- color: (targetEle.parentElement.id.indexOf('LineString') === -1) ? this.highlightSettings.border.color : (this.highlightSettings.border.color || this.highlightSettings.fill),
12429
+ color: (targetEle.parentElement.id.indexOf('LineString') === -1) ? this.highlightSettings.border.color : (this.highlightSettings.fill || this.highlightSettings.border.color),
12165
12430
  width: (targetEle.parentElement.id.indexOf('LineString') === -1) ? (this.highlightSettings.border.width / (isMarkerSelect ? 1 : this.maps.scale)) : (this.highlightSettings.border.width / this.maps.scale),
12166
12431
  opacity: this.highlightSettings.border.opacity
12167
12432
  };
@@ -12276,8 +12541,12 @@ class Selection {
12276
12541
  const layerIndex = parseInt(targetElement.id.split('_LayerIndex_')[1].split('_')[0], 10);
12277
12542
  if (targetElement.id.indexOf('shapeIndex') > -1) {
12278
12543
  shapeIndex = parseInt(targetElement.id.split('_shapeIndex_')[1].split('_')[0], 10);
12279
- shapeData = this.maps.layers[layerIndex].shapeData['features']['length'] > shapeIndex ?
12280
- this.maps.layers[layerIndex].shapeData['features'][shapeIndex]['properties'] : null;
12544
+ shapeData = !isNullOrUndefined(this.maps.layers[layerIndex].shapeData['features'])
12545
+ && this.maps.layers[layerIndex].shapeData['features']['length'] > shapeIndex ?
12546
+ this.maps.layers[layerIndex].shapeData['features'][shapeIndex]['properties'] :
12547
+ !isNullOrUndefined(this.maps.layers[layerIndex].shapeData['geometries'])
12548
+ && this.maps.layers[layerIndex].shapeData['geometries']['length'] > shapeIndex ?
12549
+ this.maps.layers[layerIndex].shapeData['geometries'][shapeIndex]['properties'] : null;
12281
12550
  dataIndex = parseInt(targetElement.id.split('_dataIndex_')[1].split('_')[0], 10);
12282
12551
  data = isNullOrUndefined(dataIndex) ? null : this.maps.layers[layerIndex].dataSource[dataIndex];
12283
12552
  this.selectionsettings = this.maps.layers[layerIndex].selectionSettings;
@@ -12357,15 +12626,17 @@ class Selection {
12357
12626
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
12358
12627
  selectMap(targetElement, shapeData, data) {
12359
12628
  const layerIndex = parseInt(targetElement.id.split('_LayerIndex_')[1].split('_')[0], 10);
12629
+ const isLineStringShape = targetElement.parentElement.id.indexOf('LineString') > -1;
12360
12630
  const selectionsettings = this.selectionsettings;
12361
12631
  const border = {
12362
- color: (targetElement.parentElement.id.indexOf('LineString') === -1) ? this.selectionsettings.border.color : (this.selectionsettings.border.color || this.selectionsettings.fill),
12363
- width: (targetElement.parentElement.id.indexOf('LineString') === -1) ? (this.selectionsettings.border.width / (this.selectionType === 'Marker' ? 1 : this.maps.scale)) : (this.selectionsettings.border.width / this.maps.scale),
12632
+ color: isLineStringShape ? (this.selectionsettings.fill || this.selectionsettings.border.color) : this.selectionsettings.border.color,
12633
+ width: isLineStringShape ? (this.selectionsettings.border.width / this.maps.scale) :
12634
+ (this.selectionsettings.border.width / (this.selectionType === 'Marker' ? 1 : this.maps.scale)),
12364
12635
  opacity: this.selectionsettings.border.opacity
12365
12636
  };
12366
12637
  const eventArgs = {
12367
12638
  opacity: this.selectionsettings.opacity,
12368
- fill: (targetElement.parentElement.id.indexOf('LineString') === -1) ? (this.selectionType !== 'navigationline' ? this.selectionsettings.fill : 'none') : 'transparent',
12639
+ fill: isLineStringShape ? 'transparent' : (this.selectionType !== 'navigationline' ? this.selectionsettings.fill : 'none'),
12369
12640
  border: border,
12370
12641
  name: itemSelection,
12371
12642
  target: targetElement.id,
@@ -12377,7 +12648,8 @@ class Selection {
12377
12648
  this.maps.trigger('itemSelection', eventArgs, (observedArgs) => {
12378
12649
  eventArgs.border.opacity = isNullOrUndefined(this.selectionsettings.border.opacity) ? this.selectionsettings.opacity : this.selectionsettings.border.opacity;
12379
12650
  if (!eventArgs.cancel) {
12380
- if (targetElement.getAttribute('class') === this.selectionType + 'selectionMapStyle') {
12651
+ if (targetElement.getAttribute('class') === this.selectionType + 'selectionMapStyle'
12652
+ || targetElement.getAttribute('class') === 'LineselectionMapStyle') {
12381
12653
  removeClass(targetElement);
12382
12654
  this.removedSelectionList(targetElement);
12383
12655
  for (let m = 0; m < this.maps.shapeSelectionItem.length; m++) {
@@ -12396,14 +12668,23 @@ class Selection {
12396
12668
  else {
12397
12669
  const layetElement = getElementByID(this.maps.element.id + '_Layer_Collections');
12398
12670
  if (!this.selectionsettings.enableMultiSelect &&
12399
- layetElement.getElementsByClassName(this.selectionType + 'selectionMapStyle').length > 0) {
12400
- const eleCount = layetElement.getElementsByClassName(this.selectionType + 'selectionMapStyle').length;
12671
+ (layetElement.getElementsByClassName(this.selectionType + 'selectionMapStyle').length > 0 ||
12672
+ layetElement.getElementsByClassName('LineselectionMapStyle').length > 0)) {
12673
+ let eleCount = layetElement.getElementsByClassName(this.selectionType + 'selectionMapStyle').length;
12401
12674
  let ele;
12402
12675
  for (let k = 0; k < eleCount; k++) {
12403
12676
  ele = layetElement.getElementsByClassName(this.selectionType + 'selectionMapStyle')[0];
12404
12677
  removeClass(ele);
12405
12678
  this.removedSelectionList(ele);
12406
12679
  }
12680
+ if (layetElement.getElementsByClassName('LineselectionMapStyle').length > 0) {
12681
+ eleCount = layetElement.getElementsByClassName('LineselectionMapStyle').length;
12682
+ for (let k = 0; k < eleCount; k++) {
12683
+ ele = layetElement.getElementsByClassName('LineselectionMapStyle')[0];
12684
+ removeClass(ele);
12685
+ this.removedSelectionList(ele);
12686
+ }
12687
+ }
12407
12688
  if (this.selectionType === 'Shape') {
12408
12689
  this.maps.shapeSelectionItem = [];
12409
12690
  const selectionLength = this.maps.selectedElementId.length;
@@ -12421,13 +12702,24 @@ class Selection {
12421
12702
  ele.setAttribute('stroke', this.maps.layers[layerIndex].navigationLineSettings[index].color);
12422
12703
  }
12423
12704
  }
12424
- if (!getElement(this.selectionType + 'selectionMap')) {
12425
- document.body.appendChild(createStyle(this.selectionType + 'selectionMap', this.selectionType + 'selectionMapStyle', eventArgs));
12705
+ if (!isLineStringShape) {
12706
+ if (!getElement(this.selectionType + 'selectionMap')) {
12707
+ document.body.appendChild(createStyle(this.selectionType + 'selectionMap', this.selectionType + 'selectionMapStyle', eventArgs));
12708
+ }
12709
+ else {
12710
+ customizeStyle(this.selectionType + 'selectionMap', this.selectionType + 'selectionMapStyle', eventArgs);
12711
+ }
12712
+ targetElement.setAttribute('class', this.selectionType + 'selectionMapStyle');
12426
12713
  }
12427
12714
  else {
12428
- customizeStyle(this.selectionType + 'selectionMap', this.selectionType + 'selectionMapStyle', eventArgs);
12715
+ if (!getElement('LineselectionMap')) {
12716
+ document.body.appendChild(createStyle('LineselectionMap', 'LineselectionMapStyle', eventArgs));
12717
+ }
12718
+ else {
12719
+ customizeStyle('LineselectionMap', 'LineselectionMapStyle', eventArgs);
12720
+ }
12721
+ targetElement.setAttribute('class', 'LineselectionMapStyle');
12429
12722
  }
12430
- targetElement.setAttribute('class', this.selectionType + 'selectionMapStyle');
12431
12723
  if (targetElement.getAttribute('class') === 'ShapeselectionMapStyle') {
12432
12724
  this.maps.shapeSelectionClass = getElement(this.selectionType + 'selectionMap');
12433
12725
  this.maps.selectedElementId.push(targetElement.getAttribute('id'));
@@ -12904,8 +13196,6 @@ class Zoom {
12904
13196
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
12905
13197
  this.startTouches = [];
12906
13198
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
12907
- this.shapeZoomLocation = [];
12908
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
12909
13199
  this.intersect = [];
12910
13200
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
12911
13201
  this.mouseDownLatLong = { x: 0, y: 0 };
@@ -12944,25 +13234,38 @@ class Zoom {
12944
13234
  const minZoom = map.zoomSettings.minZoom;
12945
13235
  newZoomFactor = (minZoom > newZoomFactor && type === 'ZoomIn') ? minZoom + 1 : newZoomFactor;
12946
13236
  const prevTilePoint = map.tileTranslatePoint;
12947
- if ((!map.isTileMap) && (type === 'ZoomIn' ? newZoomFactor >= minZoom && newZoomFactor <= maxZoom : newZoomFactor >= minZoom)) {
13237
+ if ((!map.isTileMap) && ((type === 'ZoomIn' ? newZoomFactor >= minZoom && newZoomFactor <= maxZoom : newZoomFactor >= minZoom)
13238
+ || map.isReset)) {
12948
13239
  const availSize = map.mapAreaRect;
12949
13240
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
12950
13241
  const minBounds = map.baseMapRectBounds['min'];
12951
13242
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
12952
13243
  const maxBounds = map.baseMapRectBounds['max'];
12953
- const mapTotalWidth = Math.abs(minBounds['x'] - maxBounds['x']);
12954
- const mapTotalHeight = Math.abs(minBounds['y'] - maxBounds['y']);
12955
- const point = map.translatePoint;
12956
- let translatePointX = point.x - (((availSize.width / scale) - (availSize.width / newZoomFactor)) / (availSize.width / position.x));
12957
- let translatePointY = point.y - (((availSize.height / scale) - (availSize.height / newZoomFactor)) / (availSize.height / position.y));
12958
- const currentHeight = Math.abs(map.baseMapRectBounds['max']['y'] - map.baseMapRectBounds['min']['y']) * newZoomFactor;
12959
- translatePointX = (currentHeight < map.mapAreaRect.height) ? (availSize.x + ((-(minBounds['x'])) + ((availSize.width / 2) - (mapTotalWidth / 2)))) : translatePointX;
12960
- translatePointY = (currentHeight < map.mapAreaRect.height) ? (availSize.y + ((-(minBounds['y'])) + ((availSize.height / 2) - (mapTotalHeight / 2)))) : translatePointY;
12961
- map.translatePoint = new Point(translatePointX, translatePointY);
13244
+ let mapTotalWidth = Math.abs(minBounds['x'] - maxBounds['x']);
13245
+ let mapTotalHeight = Math.abs(minBounds['y'] - maxBounds['y']);
13246
+ let translatePointX;
13247
+ let translatePointY;
13248
+ if (newZoomFactor < 1.2 && map.projectionType !== 'Eckert5') {
13249
+ if (mapTotalWidth === 0 || mapTotalHeight === 0 || mapTotalWidth === mapTotalHeight) {
13250
+ mapTotalWidth = availSize.width / 2;
13251
+ mapTotalHeight = availSize.height;
13252
+ }
13253
+ newZoomFactor = parseFloat(Math.min(availSize.width / mapTotalWidth, availSize.height / mapTotalHeight).toFixed(2));
13254
+ map.translatePoint = this.calculateInitalZoomTranslatePoint(newZoomFactor, mapTotalWidth, mapTotalHeight, availSize, minBounds, map);
13255
+ }
13256
+ else {
13257
+ const point = map.translatePoint;
13258
+ translatePointX = point.x - (((availSize.width / scale) - (availSize.width / newZoomFactor)) / (availSize.width / position.x));
13259
+ translatePointY = point.y - (((availSize.height / scale) - (availSize.height / newZoomFactor)) / (availSize.height / position.y));
13260
+ const currentHeight = Math.abs(map.baseMapRectBounds['max']['y'] - map.baseMapRectBounds['min']['y']) * newZoomFactor;
13261
+ translatePointX = (currentHeight < map.mapAreaRect.height) ? (availSize.x + ((-(minBounds['x'])) + ((availSize.width / 2) - (mapTotalWidth / 2)))) : translatePointX;
13262
+ translatePointY = (currentHeight < map.mapAreaRect.height) ? (availSize.y + ((-(minBounds['y'])) + ((availSize.height / 2) - (mapTotalHeight / 2)))) : translatePointY;
13263
+ map.translatePoint = new Point(translatePointX, translatePointY);
13264
+ }
12962
13265
  map.scale = newZoomFactor;
12963
13266
  if (this.triggerZoomEvent(prevTilePoint, prevLevel, type)) {
12964
13267
  map.translatePoint = map.previousPoint;
12965
- map.scale = map.previousScale;
13268
+ map.scale = map.mapScaleValue = map.previousScale;
12966
13269
  }
12967
13270
  else {
12968
13271
  this.applyTransform();
@@ -13018,6 +13321,14 @@ class Zoom {
13018
13321
  }
13019
13322
  this.maps.zoomNotApplied = false;
13020
13323
  }
13324
+ calculateInitalZoomTranslatePoint(newZoomFactor, mapTotalWidth, mapTotalHeight, availSize, minBounds, map) {
13325
+ mapTotalWidth *= newZoomFactor;
13326
+ mapTotalHeight *= newZoomFactor;
13327
+ let widthDiff = minBounds['x'] !== 0 && map.translateType === 'layers' ? map.availableSize.width - availSize.width : 0;
13328
+ var translatePointX = availSize.x + ((-(minBounds['x'])) + ((availSize.width / 2) - (mapTotalWidth / 2))) - widthDiff;
13329
+ var translatePointY = availSize.y + ((-(minBounds['y'])) + ((availSize.height / 2) - (mapTotalHeight / 2)));
13330
+ return new Point(translatePointX, translatePointY);
13331
+ }
13021
13332
  triggerZoomEvent(prevTilePoint, prevLevel, type) {
13022
13333
  const map = this.maps;
13023
13334
  let zoomArgs;
@@ -13134,22 +13445,34 @@ class Zoom {
13134
13445
  this.lastScale = scale;
13135
13446
  this.pinchFactor *= newScale;
13136
13447
  this.pinchFactor = Math.min(this.maps.zoomSettings.maxZoom, Math.max(this.pinchFactor, this.maps.zoomSettings.minZoom));
13137
- const zoomCalculationFactor = this.pinchFactor;
13448
+ let zoomCalculationFactor = this.pinchFactor;
13138
13449
  let isZoomCancelled;
13139
13450
  if (!map.isTileMap) {
13140
13451
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
13141
13452
  const minBounds = map.baseMapRectBounds['min'];
13142
13453
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
13143
13454
  const maxBounds = map.baseMapRectBounds['max'];
13144
- const mapTotalHeight = Math.abs(minBounds['y'] - maxBounds['y']);
13145
- const mapTotalWidth = Math.abs(minBounds['x'] - maxBounds['x']);
13455
+ let mapTotalHeight = Math.abs(minBounds['y'] - maxBounds['y']);
13456
+ let mapTotalWidth = Math.abs(minBounds['x'] - maxBounds['x']);
13146
13457
  const translatePoint = map.translatePoint;
13147
- const currentHeight = Math.abs(map.baseMapRectBounds['max']['y'] - map.baseMapRectBounds['min']['y']) * zoomCalculationFactor;
13148
- let translatePointX = translatePoint.x - (((availSize.width / map.scale) - (availSize.width / zoomCalculationFactor)) / (availSize.width / touchCenter.x));
13149
- let translatePointY = translatePoint.y - (((availSize.height / map.scale) - (availSize.height / zoomCalculationFactor)) / (availSize.height / touchCenter.y));
13150
- translatePointX = (currentHeight < map.mapAreaRect.height) ? (availSize.x + ((-(minBounds['x'])) + ((availSize.width / 2) - (mapTotalWidth / 2)))) : translatePointX;
13151
- translatePointY = (currentHeight < map.mapAreaRect.height) ? (availSize.y + ((-(minBounds['y'])) + ((availSize.height / 2) - (mapTotalHeight / 2)))) : translatePointY;
13152
- map.translatePoint = new Point(translatePointX, translatePointY);
13458
+ let translatePointX;
13459
+ let translatePointY;
13460
+ if (zoomCalculationFactor < 1.2 && map.projectionType !== 'Eckert5') {
13461
+ if (mapTotalWidth === 0 || mapTotalHeight === 0 || mapTotalWidth === mapTotalHeight) {
13462
+ mapTotalWidth = availSize.width / 2;
13463
+ mapTotalHeight = availSize.height;
13464
+ }
13465
+ zoomCalculationFactor = parseFloat(Math.min(availSize.width / mapTotalWidth, availSize.height / mapTotalHeight).toFixed(2));
13466
+ map.translatePoint = this.calculateInitalZoomTranslatePoint(zoomCalculationFactor, mapTotalWidth, mapTotalHeight, availSize, minBounds, map);
13467
+ }
13468
+ else {
13469
+ const currentHeight = Math.abs(map.baseMapRectBounds['max']['y'] - map.baseMapRectBounds['min']['y']) * zoomCalculationFactor;
13470
+ translatePointX = translatePoint.x - (((availSize.width / map.scale) - (availSize.width / zoomCalculationFactor)) / (availSize.width / touchCenter.x));
13471
+ translatePointY = translatePoint.y - (((availSize.height / map.scale) - (availSize.height / zoomCalculationFactor)) / (availSize.height / touchCenter.y));
13472
+ translatePointX = (currentHeight < map.mapAreaRect.height) ? (availSize.x + ((-(minBounds['x'])) + ((availSize.width / 2) - (mapTotalWidth / 2)))) : translatePointX;
13473
+ translatePointY = (currentHeight < map.mapAreaRect.height) ? (availSize.y + ((-(minBounds['y'])) + ((availSize.height / 2) - (mapTotalHeight / 2)))) : translatePointY;
13474
+ map.translatePoint = new Point(translatePointX, translatePointY);
13475
+ }
13153
13476
  map.scale = zoomCalculationFactor;
13154
13477
  isZoomCancelled = this.triggerZoomEvent(prevTilePoint, prevLevel, '');
13155
13478
  if (isZoomCancelled) {
@@ -13258,11 +13581,10 @@ class Zoom {
13258
13581
  layerElement.appendChild(this.maps.navigationLineModule.renderNavigation(this.currentLayer, this.maps.tileZoomLevel, this.index));
13259
13582
  }
13260
13583
  }
13261
- else {
13584
+ else if (currentEle.id.indexOf('Legend') == -1) {
13262
13585
  changeBorderWidth(currentEle, this.index, scale, this.maps);
13263
13586
  this.maps.zoomTranslatePoint = this.maps.translatePoint;
13264
13587
  this.animateTransform(currentEle, animate$$1, x, y, scale);
13265
- this.shapeZoomLocation = currentEle.childNodes;
13266
13588
  }
13267
13589
  }
13268
13590
  else if (currentEle.id.indexOf('_Markers_Group') > -1) {
@@ -13369,7 +13691,7 @@ class Zoom {
13369
13691
  for (let k = 0; k < currentEle.childElementCount; k++) {
13370
13692
  if (currentEle.childNodes[k]['id'].indexOf('_LabelIndex_') > -1) {
13371
13693
  const labelIndex = parseFloat(currentEle.childNodes[k]['id'].split('_LabelIndex_')[1].split('_')[0]);
13372
- this.zoomshapewidth = this.shapeZoomLocation[labelIndex].getBoundingClientRect();
13694
+ this.zoomshapewidth = currentEle.childNodes[k].getBoundingClientRect();
13373
13695
  this.maps.zoomShapeCollection.push(this.zoomshapewidth);
13374
13696
  this.dataLabelTranslate(currentEle.childNodes[k], factor, x, y, scale, 'DataLabel', animate$$1);
13375
13697
  const dataLabel = this.maps.layers[this.index].dataLabelSettings;
@@ -13784,7 +14106,7 @@ class Zoom {
13784
14106
  const layerRect = getElementByID(map.element.id + '_Layer_Collections').getBoundingClientRect();
13785
14107
  const elementRect = getElementByID(map.element.id + '_svg').getBoundingClientRect();
13786
14108
  const panningXDirection = ((xDifference < 0 ? layerRect.left <= (elementRect.left + map.mapAreaRect.x) :
13787
- ((layerRect.left + layerRect.width) >= (elementRect.left + elementRect.width) + map.mapAreaRect.x + map.margin.left)));
14109
+ ((layerRect.left + layerRect.width + map.mapAreaRect.x) >= (elementRect.width))));
13788
14110
  const panningYDirection = ((yDifference < 0 ? layerRect.top <= (elementRect.top + map.mapAreaRect.y) :
13789
14111
  ((layerRect.top + layerRect.height + legendHeight + map.margin.top) >= (elementRect.top + elementRect.height))));
13790
14112
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -13873,16 +14195,28 @@ class Zoom {
13873
14195
  const min = map.baseMapRectBounds['min'];
13874
14196
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
13875
14197
  const max = map.baseMapRectBounds['max'];
13876
- const mapWidth = Math.abs(max['x'] - min['x']);
13877
- const mapHeight = Math.abs(min['y'] - max['y']);
13878
- let translatePointX = translatePoint.x - (((size.width / scale) - (size.width / zoomFactor)) / 2);
13879
- let translatePointY = translatePoint.y - (((size.height / scale) - (size.height / zoomFactor)) / 2);
13880
- const currentHeight = Math.abs(map.baseMapRectBounds['max']['y'] - map.baseMapRectBounds['min']['y']) * zoomFactor;
13881
- translatePointX = (currentHeight < map.mapAreaRect.height) ? (size.x + ((-(min['x'])) + ((size.width / 2) - (mapWidth / 2))))
13882
- : translatePointX;
13883
- translatePointY = (currentHeight < map.mapAreaRect.height) ? (size.y + ((-(min['y'])) + ((size.height / 2) - (mapHeight / 2))))
13884
- : translatePointY;
13885
- map.translatePoint = new Point(translatePointX, translatePointY);
14198
+ let mapWidth = Math.abs(max['x'] - min['x']);
14199
+ let mapHeight = Math.abs(min['y'] - max['y']);
14200
+ let translatePointX;
14201
+ let translatePointY;
14202
+ if (zoomFactor < 1.2 && map.projectionType !== 'Eckert5') {
14203
+ if (mapHeight === 0 || mapWidth === 0 || mapHeight === mapWidth) {
14204
+ mapWidth = size.width / 2;
14205
+ mapHeight = size.height;
14206
+ }
14207
+ zoomFactor = parseFloat(Math.min(size.width / mapWidth, size.height / mapHeight).toFixed(2));
14208
+ map.translatePoint = this.calculateInitalZoomTranslatePoint(zoomFactor, mapWidth, mapHeight, size, min, map);
14209
+ }
14210
+ else {
14211
+ translatePointX = translatePoint.x - (((size.width / scale) - (size.width / zoomFactor)) / 2);
14212
+ translatePointY = translatePoint.y - (((size.height / scale) - (size.height / zoomFactor)) / 2);
14213
+ const currentHeight = Math.abs(map.baseMapRectBounds['max']['y'] - map.baseMapRectBounds['min']['y']) * zoomFactor;
14214
+ translatePointX = (currentHeight < map.mapAreaRect.height) ? (size.x + ((-(min['x'])) + ((size.width / 2) - (mapWidth / 2))))
14215
+ : translatePointX;
14216
+ translatePointY = (currentHeight < map.mapAreaRect.height) ? (size.y + ((-(min['y'])) + ((size.height / 2) - (mapHeight / 2))))
14217
+ : translatePointY;
14218
+ map.translatePoint = new Point(translatePointX, translatePointY);
14219
+ }
13886
14220
  map.zoomTranslatePoint = map.translatePoint;
13887
14221
  map.scale = zoomFactor;
13888
14222
  if (this.triggerZoomEvent(prevTilePoint, prevLevel, type)) {
@@ -14197,7 +14531,12 @@ class Zoom {
14197
14531
  x = (size.width / 2) - (toolBarSize.width / 2);
14198
14532
  break;
14199
14533
  case 'Far':
14200
- x = (size.width - toolBarSize.width) - padding;
14534
+ if (!isNullOrUndefined(map.legendModule) && map.legendSettings.position === 'Left') {
14535
+ x = size.width + size.x - toolBarSize.width - padding;
14536
+ }
14537
+ else {
14538
+ x = (size.width - toolBarSize.width) - padding;
14539
+ }
14201
14540
  break;
14202
14541
  }
14203
14542
  let extraPosition = map.getExtraPosition();
@@ -14253,6 +14592,7 @@ class Zoom {
14253
14592
  }
14254
14593
  else {
14255
14594
  map.mapScaleValue = value - delta;
14595
+ map.isReset = (map.mapScaleValue < 1) ? true : false;
14256
14596
  map.staticMapZoom = map.tileZoomLevel;
14257
14597
  if (map.mapScaleValue === 1) {
14258
14598
  map.markerCenterLatitude = null;