@syncfusion/ej2-maps 20.1.55 → 20.2.38

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' });
@@ -7979,7 +8135,7 @@ let Maps = class Maps extends Component {
7979
8135
  }
7980
8136
  }
7981
8137
  this.notify(Browser.touchEndEvent, e);
7982
- if (e.cancelable) {
8138
+ if (e.cancelable && !this.isTouch) {
7983
8139
  e.preventDefault();
7984
8140
  }
7985
8141
  return false;
@@ -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');
@@ -8167,6 +8323,7 @@ let Maps = class Maps extends Component {
8167
8323
  this.refreshing = true;
8168
8324
  this.wireEVents();
8169
8325
  this.render();
8326
+ this.refreshing = false;
8170
8327
  }, 500);
8171
8328
  }
8172
8329
  }
@@ -8561,7 +8718,8 @@ let Maps = class Maps extends Component {
8561
8718
  if (!isNullOrUndefined(newProp.layers[x])) {
8562
8719
  const collection = Object.keys(newProp.layers[x]);
8563
8720
  for (const collectionProp of collection) {
8564
- 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 !== '')) {
8565
8723
  this.isReset = true;
8566
8724
  }
8567
8725
  else if (collectionProp === 'markerSettings') {
@@ -8841,6 +8999,28 @@ let Maps = class Maps extends Component {
8841
8999
  }
8842
9000
  return null;
8843
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
+ }
8844
9024
  /**
8845
9025
  * To find visibility of layers and markers for required modules load.
8846
9026
  *
@@ -9184,12 +9364,8 @@ class Bubble {
9184
9364
  isNaN(shapeData[layer.shapeDataPath]) ? shapeData[layer.shapeDataPath].toLowerCase() : shapeData[layer.shapeDataPath];
9185
9365
  const shapePathValue = !isNullOrUndefined(shape[shapePath]) && isNaN(shape[shapePath])
9186
9366
  ? shape[shapePath].toLowerCase() : shape[shapePath];
9187
- if (shapeDataLayerPathValue === shapePathValue && layerData[i].type !== 'LineString') {
9188
- if (layerData[i]['type'] === 'Point') {
9189
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
9190
- shapePoints.push(this.getPoints(layerData[i], []));
9191
- }
9192
- 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']) {
9193
9369
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
9194
9370
  shapePoints.push(this.getPoints(layerData[i], []));
9195
9371
  currentLength = shapePoints[shapePoints.length - 1].length;
@@ -9512,7 +9688,7 @@ class DataLabel {
9512
9688
  layer.dataSource, layer.shapeDataPath, shapeData['properties'][propertyPath], layer.shapeDataPath);
9513
9689
  if (!isNullOrUndefined(shapes['property'])) {
9514
9690
  shapePoint = [[]];
9515
- if (!layerData[index]['_isMultiPolygon'] && layerData[index]['type'] !== 'Point') {
9691
+ if (!layerData[index]['_isMultiPolygon'] && layerData[index]['type'] !== 'Point' && layerData[index]['type'] !== 'MultiPoint') {
9516
9692
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
9517
9693
  shapePoint.push(this.getPoint(layerData[index], []));
9518
9694
  currentLength = shapePoint[shapePoint.length - 1].length;
@@ -9521,21 +9697,9 @@ class DataLabel {
9521
9697
  midIndex = shapePoint.length - 1;
9522
9698
  }
9523
9699
  }
9524
- else {
9700
+ else if (layerData[index]['type'] !== 'Point' && layerData[index]['type'] !== 'MultiPoint') {
9525
9701
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
9526
9702
  const layer = layerData[index];
9527
- if (layer['type'] === 'Point') {
9528
- isPoint = true;
9529
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
9530
- const layerPoints = [];
9531
- layerPoints.push(this.getPoint(layerData, []));
9532
- shapePoint = layerPoints;
9533
- currentLength = shapePoint[shapePoint.length - 1].length;
9534
- if (pointsLength < currentLength) {
9535
- pointsLength = currentLength;
9536
- midIndex = shapePoint.length - 1;
9537
- }
9538
- }
9539
9703
  for (let j = 0; j < layer.length; j++) {
9540
9704
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
9541
9705
  shapePoint.push(this.getPoint(layer[j], []));
@@ -9780,10 +9944,21 @@ class DataLabel {
9780
9944
  }
9781
9945
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
9782
9946
  getPoint(shapes, points) {
9783
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
9784
- shapes.map((current, index) => {
9785
- points.push(new Point(current['point']['x'], current['point']['y']));
9786
- });
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
+ }
9787
9962
  return points;
9788
9963
  }
9789
9964
  /**
@@ -9975,6 +10150,10 @@ class Legend {
9975
10150
  * @private
9976
10151
  */
9977
10152
  this.legendBorderRect = new Rect(0, 0, 0, 0);
10153
+ /**
10154
+ * @private
10155
+ */
10156
+ this.initialMapAreaRect = new Rect(0, 0, 0, 0);
9978
10157
  /**
9979
10158
  * @private
9980
10159
  */
@@ -10033,6 +10212,7 @@ class Legend {
10033
10212
  this.heightIncrement = 0;
10034
10213
  this.defsElement = this.maps.renderer.createDefs();
10035
10214
  this.maps.svgObject.appendChild(this.defsElement);
10215
+ this.initialMapAreaRect = this.maps.mapAreaRect;
10036
10216
  this.calculateLegendBounds();
10037
10217
  this.drawLegend();
10038
10218
  }
@@ -10070,9 +10250,9 @@ class Legend {
10070
10250
  }
10071
10251
  }
10072
10252
  }
10073
- else {
10074
- this.getMarkersLegendCollections(layerIndex, layer.markerSettings);
10075
- }
10253
+ }
10254
+ if (legend.type === 'Markers') {
10255
+ this.getMarkersLegendCollections(layerIndex, layer.markerSettings);
10076
10256
  }
10077
10257
  });
10078
10258
  if (this.legendCollection.length > 0) {
@@ -10263,8 +10443,9 @@ class Legend {
10263
10443
  }
10264
10444
  }
10265
10445
  else {
10446
+ let padding = 10;
10266
10447
  shapeX = shapeLocation[j - 1].x;
10267
- shapeY = prevPositionY + topPadding + (shapeHeight / 2);
10448
+ shapeY = prevPositionY + padding + (shapeHeight / 2);
10268
10449
  }
10269
10450
  }
10270
10451
  }
@@ -10367,7 +10548,14 @@ class Legend {
10367
10548
  const legend = map.legendSettings;
10368
10549
  const render = map.renderer;
10369
10550
  let textOptions;
10370
- 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
+ };
10371
10559
  this.legendGroup = render.createGroup({ id: map.element.id + '_Legend_Group' });
10372
10560
  if (legend.mode === 'Interactive') {
10373
10561
  for (let i = 0; i < this.legendRenderingCollections.length; i++) {
@@ -10383,7 +10571,7 @@ class Legend {
10383
10571
  textFont.color = (textFont.color !== null) ? textFont.color : this.maps.themeStyle.legendTextColor;
10384
10572
  const rectOptions = new RectOption(itemId, item['fill'], item['shapeBorder'], legend.opacity, bounds);
10385
10573
  textOptions = new TextOption(textId, textLocation.x, textLocation.y, 'middle', item['text'], '', '');
10386
- textFont.fontFamily = map.themeStyle.fontFamily || textFont.fontFamily;
10574
+ textFont.fontFamily = !isNullOrUndefined(textFont.fontFamily) ? textFont.fontFamily : this.maps.themeStyle.fontFamily;
10387
10575
  textFont.size = map.themeStyle.legendFontSize || textFont.size;
10388
10576
  renderTextElement(textOptions, textFont, textFont.color, this.legendGroup);
10389
10577
  this.legendGroup.appendChild(render.drawRectangle(rectOptions));
@@ -10438,7 +10626,7 @@ class Legend {
10438
10626
  };
10439
10627
  legendTextStyle.color = (legendTextStyle.color !== null) ? legendTextStyle.color :
10440
10628
  this.maps.themeStyle.legendTextColor;
10441
- legendTextStyle.fontFamily = map.themeStyle.fontFamily || legendTextStyle.fontFamily;
10629
+ legendTextStyle.fontFamily = !isNullOrUndefined(legendTextStyle.fontFamily) ? legendTextStyle.fontFamily : this.maps.themeStyle.fontFamily;
10442
10630
  legendTextStyle.size = map.themeStyle.legendFontSize || legendTextStyle.size;
10443
10631
  if (i === 0) {
10444
10632
  this.renderLegendBorder();
@@ -10514,7 +10702,9 @@ class Legend {
10514
10702
  'opacity': 1,
10515
10703
  'dominant-baseline': ''
10516
10704
  };
10517
- pagingGroup.appendChild(render.createText(pageTextOptions, pagingText));
10705
+ let pagingTextElement = render.createText(pageTextOptions, pagingText);
10706
+ pagingTextElement.setAttribute('style', 'user-select: none;');
10707
+ pagingGroup.appendChild(pagingTextElement);
10518
10708
  this.legendGroup.appendChild(pagingGroup);
10519
10709
  }
10520
10710
  this.legendToggle();
@@ -10526,6 +10716,7 @@ class Legend {
10526
10716
  let shapeIndex;
10527
10717
  let layerIndex;
10528
10718
  let dataIndex;
10719
+ let pointIndex;
10529
10720
  const legend = this.maps.legendSettings;
10530
10721
  const textEle = legend.mode === 'Default' ? document.getElementById(targetElement.id.replace('Shape', 'Text')) :
10531
10722
  document.getElementById(targetElement.id + '_Text');
@@ -10613,12 +10804,20 @@ class Legend {
10613
10804
  }
10614
10805
  if (enable) {
10615
10806
  for (let j = 0; j < data.length; j++) {
10807
+ let shapeElement;
10616
10808
  shapeIndex = data[j]['shapeIndex'];
10617
10809
  layerIndex = data[j]['layerIndex'];
10618
10810
  dataIndex = data[j]['dataIndex'];
10619
- const shapeEle = document.getElementById(this.maps.element.id + '_LayerIndex_' +
10620
- layerIndex + '_shapeIndex_' + shapeIndex + '_dataIndex_' + dataIndex);
10621
- 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) {
10622
10821
  let shapeMatch = true;
10623
10822
  if (this.maps.legendSelectionCollection !== null) {
10624
10823
  for (let i = 0; i < this.maps.legendSelectionCollection.length; i++) {
@@ -10635,13 +10834,13 @@ class Legend {
10635
10834
  }
10636
10835
  length = this.legendHighlightCollection.length;
10637
10836
  const legendHighlightColor = this.legendHighlightCollection[length - 1]['legendOldFill'];
10638
- this.legendHighlightCollection[length - 1]['MapShapeCollection']['Elements'].push(shapeEle);
10837
+ this.legendHighlightCollection[length - 1]['MapShapeCollection']['Elements'].push(shapeElement);
10639
10838
  const shapeItemCount = this.legendHighlightCollection[length - 1]['MapShapeCollection']['Elements'].length - 1;
10640
- const shapeOldFillColor = shapeEle.getAttribute('fill');
10839
+ const shapeOldFillColor = shapeElement.getAttribute('fill');
10641
10840
  this.legendHighlightCollection[length - 1]['shapeOldFillColor'].push(shapeOldFillColor);
10642
10841
  const shapeOldColor = this.legendHighlightCollection[length - 1]['shapeOldFillColor'][shapeItemCount];
10643
10842
  this.shapePreviousColor = this.legendHighlightCollection[length - 1]['shapeOldFillColor'];
10644
- 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');
10645
10844
  this.setColor(targetElement, !isNullOrUndefined(module.fill) ? module.fill : legendHighlightColor, module.opacity.toString(), module.border.color, module.border.width.toString(), 'highlight');
10646
10845
  }
10647
10846
  else if (value === 'selection') {
@@ -10664,12 +10863,12 @@ class Legend {
10664
10863
  }
10665
10864
  selectLength = this.maps.legendSelectionCollection.length;
10666
10865
  const legendSelectionColor = this.maps.legendSelectionCollection[selectLength - 1]['legendOldFill'];
10667
- this.maps.legendSelectionCollection[selectLength - 1]['MapShapeCollection']['Elements'].push(shapeEle);
10866
+ this.maps.legendSelectionCollection[selectLength - 1]['MapShapeCollection']['Elements'].push(shapeElement);
10668
10867
  this.maps.legendSelectionCollection[selectLength - 1]['shapeOldFillColor'] = this.shapePreviousColor;
10669
10868
  this.setColor(targetElement, !isNullOrUndefined(module.fill) ? module.fill : legendSelectionColor, module.opacity.toString(), module.border.color, module.border.width.toString(), 'selection');
10670
- this.setColor(shapeEle, !isNullOrUndefined(module.fill) ? module.fill : legendSelectionColor, module.opacity.toString(), module.border.color, module.border.width.toString(), 'selection');
10671
- if (this.maps.selectedElementId.indexOf(shapeEle.getAttribute('id')) === -1) {
10672
- 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'));
10673
10872
  }
10674
10873
  if (j === data.length - 1) {
10675
10874
  this.maps.legendSelection = false;
@@ -10684,14 +10883,15 @@ class Legend {
10684
10883
  }
10685
10884
  }
10686
10885
  setColor(element, fill, opacity, borderColor, borderWidth, type) {
10886
+ const isLineStringShape = (element.parentElement.id.indexOf('LineString') > -1);
10687
10887
  if (type === 'selection') {
10688
- maintainStyleClass('ShapeselectionMap', 'ShapeselectionMapStyle', fill, opacity, borderColor, borderWidth, this.maps);
10689
- 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');
10690
10890
  }
10691
10891
  else {
10692
- element.setAttribute('fill', fill);
10892
+ element.setAttribute('fill', isLineStringShape ? 'transparent' : fill);
10693
10893
  element.setAttribute('fill-opacity', opacity);
10694
- element.setAttribute('stroke', borderColor);
10894
+ element.setAttribute('stroke', isLineStringShape ? fill : borderColor);
10695
10895
  element.setAttribute('stroke-width', (Number(borderWidth) / this.maps.scale).toString());
10696
10896
  }
10697
10897
  }
@@ -10734,7 +10934,8 @@ class Legend {
10734
10934
  const dataCount = shapeElements.length;
10735
10935
  for (let j = 0; j < dataCount; j++) {
10736
10936
  const shapeElement = getElement(shapeElements[j]);
10737
- if (shapeElement.getAttribute('class') === 'ShapeselectionMapStyle') {
10937
+ if (shapeElement.getAttribute('class') === 'ShapeselectionMapStyle' ||
10938
+ shapeElement.getAttribute('class') === 'LineselectionMapStyle') {
10738
10939
  removeClass(shapeElement);
10739
10940
  const selectedElementIdIndex = this.maps.selectedElementId.indexOf(shapeElement.id);
10740
10941
  if (selectedElementIdIndex !== -1) {
@@ -10812,12 +11013,14 @@ class Legend {
10812
11013
  this.maps.legendSelectionClass = module;
10813
11014
  }
10814
11015
  else {
10815
- if ((checkSelection <= 1) && targetElement.getAttribute('class') === 'ShapeselectionMapStyle') {
11016
+ if ((checkSelection <= 1) && (targetElement.getAttribute('class') === 'ShapeselectionMapStyle'
11017
+ || targetElement.getAttribute('class') === 'LineselectionMapStyle')) {
10816
11018
  if (!this.maps.layers[layerIndex].selectionSettings.enableMultiSelect) {
10817
11019
  this.maps.selectedLegendElementId.splice(selectionIndex, 1);
10818
11020
  }
10819
11021
  else {
10820
- if (checkSelection <= 1 && targetElement.getAttribute('class') === 'ShapeselectionMapStyle') {
11022
+ if (checkSelection <= 1 && (targetElement.getAttribute('class') === 'ShapeselectionMapStyle'
11023
+ || targetElement.getAttribute('class') === 'LineselectionMapStyle')) {
10821
11024
  this.maps.selectedLegendElementId.splice(selectionIndex, 1);
10822
11025
  }
10823
11026
  }
@@ -10904,7 +11107,8 @@ class Legend {
10904
11107
  }
10905
11108
  }
10906
11109
  }
10907
- if (selectionEle && (selectionEle['IsSelected'] && targetElement.getAttribute('class') === 'ShapeselectionMapStyle')) {
11110
+ if (selectionEle && (selectionEle['IsSelected'] && (targetElement.getAttribute('class') === 'ShapeselectionMapStyle'
11111
+ || targetElement.getAttribute('class') === 'LineselectionMapStyle'))) {
10908
11112
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
10909
11113
  const element = this.maps.legendSelectionCollection[selectionEle['SelectionIndex']];
10910
11114
  let multiSelection = 0;
@@ -10995,7 +11199,7 @@ class Legend {
10995
11199
  }
10996
11200
  for (let j = 0; j < this.maps.selectedLegendElementId.length; j++) {
10997
11201
  const idIndex = this.maps.legendSettings.mode === 'Interactive' ?
10998
- 'container_Legend_Index_' : 'container_Legend_Shape_Index_';
11202
+ this.maps.element.id + '_Legend_Index_' : this.maps.element.id + '_Legend_Shape_Index_';
10999
11203
  const selectedElement = idIndex + this.maps.selectedLegendElementId[j];
11000
11204
  const legendElement = document.getElementById(selectedElement);
11001
11205
  if (!isNullOrUndefined(legendElement)) {
@@ -11047,6 +11251,7 @@ class Legend {
11047
11251
  let shapeIndex;
11048
11252
  let layerIndex;
11049
11253
  let dataIndex;
11254
+ let pointIndex;
11050
11255
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
11051
11256
  const collection = this.maps.legendModule.legendCollection;
11052
11257
  const legend = this.maps.legendSettings;
@@ -11059,15 +11264,23 @@ class Legend {
11059
11264
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
11060
11265
  const currentElement = { Elements: [] };
11061
11266
  for (let j = 0; j < data.length; j++) {
11267
+ let shapeElement;
11062
11268
  shapeIndex = data[j]['shapeIndex'];
11063
11269
  layerIndex = data[j]['layerIndex'];
11064
11270
  dataIndex = data[j]['dataIndex'];
11065
- const shapeEle = document.getElementById(this.maps.element.id + '_LayerIndex_' +
11066
- layerIndex + '_shapeIndex_' + shapeIndex + '_dataIndex_' + dataIndex);
11067
- 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) {
11068
11281
  process = true;
11069
11282
  }
11070
- elements.push(shapeEle);
11283
+ elements.push(shapeElement);
11071
11284
  }
11072
11285
  if (process) {
11073
11286
  if (isNullOrUndefined(currentElement['LegendEle'])) {
@@ -11085,16 +11298,25 @@ class Legend {
11085
11298
  let shapeIndex;
11086
11299
  let layerIndex;
11087
11300
  let dataIndex;
11301
+ let pointIndex;
11088
11302
  const idIndex = parseFloat(targetElement.id.charAt(targetElement.id.length - 1));
11089
11303
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
11090
11304
  const data = this.maps.legendModule.legendCollection[idIndex]['data'];
11091
11305
  const legendShapeElements = [];
11092
11306
  for (let i = 0; i < data.length; i++) {
11307
+ let shapeElement;
11093
11308
  shapeIndex = data[i]['shapeIndex'];
11094
11309
  layerIndex = data[i]['layerIndex'];
11095
11310
  dataIndex = data[i]['dataIndex'];
11096
- const shapeElement = document.getElementById(this.maps.element.id + '_LayerIndex_' +
11097
- 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
+ }
11098
11320
  if (!isNullOrUndefined(shapeElement)) {
11099
11321
  legendShapeElements.push(shapeElement.id);
11100
11322
  }
@@ -11162,9 +11384,11 @@ class Legend {
11162
11384
  const renderOptions = new RectOption(map.element.id + '_Legend_Border', legend.background, legendBorder, 1, this.legendBorderRect, null, null, '', '');
11163
11385
  this.legendGroup.appendChild(map.renderer.drawRectangle(renderOptions));
11164
11386
  this.getLegendAlignment(map, this.legendBorderRect.width, this.legendBorderRect.height, legend);
11165
- this.legendGroup.setAttribute('transform', 'translate( ' + (this.translate.x + (-(this.legendBorderRect.x))) + ' ' +
11387
+ this.legendGroup.setAttribute('transform', 'translate( ' + (this.translate.x + (-this.legendBorderRect.x)) + ' ' +
11166
11388
  (this.translate.y + (-(this.legendBorderRect.y))) + ' )');
11167
- map.svgObject.appendChild(this.legendGroup);
11389
+ if (legend.position !== 'Float') {
11390
+ map.svgObject.appendChild(this.legendGroup);
11391
+ }
11168
11392
  if (legendTitle) {
11169
11393
  textStyle.color = (textStyle.color !== null) ? textStyle.color : this.maps.themeStyle.legendTitleFontColor;
11170
11394
  textStyle.fontFamily = !isNullOrUndefined(textStyle.fontFamily) ? textStyle.fontFamily : this.maps.themeStyle.fontFamily;
@@ -11176,7 +11400,16 @@ class Legend {
11176
11400
  this.currentPage = (e.target.id.indexOf('_Left_Page_') > -1) ? (this.currentPage - 1) :
11177
11401
  (this.currentPage + 1);
11178
11402
  this.legendGroup = this.maps.renderer.createGroup({ id: this.maps.element.id + '_Legend_Group' });
11403
+ this.maps.mapAreaRect = this.initialMapAreaRect;
11179
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
+ }
11180
11413
  if (querySelector(this.maps.element.id + '_Legend_Border', this.maps.element.id)) {
11181
11414
  querySelector(this.maps.element.id + '_Legend_Border', this.maps.element.id).style.pointerEvents = 'none';
11182
11415
  }
@@ -11194,53 +11427,60 @@ class Legend {
11194
11427
  const areaWidth = totalRect.width;
11195
11428
  const totalWidth = map.availableSize.width;
11196
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;
11197
11432
  if (legend.position === 'Float') {
11198
- 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;
11199
11435
  }
11200
11436
  else {
11201
11437
  switch (legend.position) {
11202
11438
  case 'Top':
11203
11439
  case 'Bottom':
11204
- totalRect.height = (areaHeight - height);
11440
+ totalRect.height = (legend.position === 'Top') ? (areaHeight - height) : (areaHeight - height - (spacing * 2));
11205
11441
  x = (totalWidth / 2) - (width / 2);
11206
11442
  y = (legend.position === 'Top') ? areaY : (areaY + totalRect.height);
11207
- 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);
11208
11444
  break;
11209
11445
  case 'Left':
11210
11446
  case 'Right':
11211
- totalRect.width = (areaWidth - width);
11212
- 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);
11213
11449
  y = (totalHeight / 2) - (height / 2);
11214
- totalRect.x = (legend.position === 'Left') ? areaX + width : areaX;
11450
+ totalRect.x = (legend.position === 'Left') ? areaX + width + spacing : areaX;
11215
11451
  break;
11216
11452
  }
11217
11453
  switch (legend.alignment) {
11218
11454
  case 'Near':
11219
11455
  if (legend.position === 'Top' || legend.position === 'Bottom') {
11220
- x = totalRect.x;
11456
+ x = totalRect.x - (legend.mode === 'Interactive' ? spacing : 0);
11221
11457
  }
11222
11458
  else {
11223
- y = totalRect.y;
11459
+ y = totalRect.y - (!(legend.height && legend.width) && legend.mode === 'Interactive' ? map.mapAreaRect.x : 0);
11224
11460
  }
11225
11461
  break;
11226
11462
  case 'Far':
11227
11463
  if (legend.position === 'Top' || legend.position === 'Bottom') {
11228
- x = (totalWidth - width) - spacing;
11464
+ x = (totalWidth - width) - (legend.mode === 'Interactive' ? 0 : spacing);
11229
11465
  }
11230
11466
  else {
11231
- y = totalHeight - height;
11467
+ y = totalHeight - height - (legend.mode === 'Default' ? spacing : 0);
11232
11468
  }
11233
11469
  break;
11234
11470
  }
11235
11471
  if ((legend.height || legend.width) && legend.mode !== 'Interactive') {
11236
- this.legendTotalRect = map.totalRect = totalRect;
11472
+ this.legendTotalRect = map.mapAreaRect = map.totalRect = totalRect;
11237
11473
  }
11238
11474
  else {
11475
+ map.totalRect = null;
11239
11476
  if ((legend.height || legend.width) && legend.mode === 'Interactive') {
11240
11477
  map.totalRect = totalRect;
11241
11478
  }
11242
11479
  this.legendTotalRect = map.mapAreaRect = totalRect;
11243
11480
  }
11481
+ if (legend.position === 'Left') {
11482
+ map.mapAreaRect.width = totalRect.width;
11483
+ }
11244
11484
  this.translate = new Point(x, y);
11245
11485
  }
11246
11486
  }
@@ -11361,6 +11601,13 @@ class Legend {
11361
11601
  borderColor: legend.shapeBorder.color, borderWidth: legend.shapeBorder.width
11362
11602
  });
11363
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
+ }
11364
11611
  }
11365
11612
  }
11366
11613
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -11555,15 +11802,16 @@ class Legend {
11555
11802
  const width = 10;
11556
11803
  const direction = (legend.orientation === 'None') ? (legend.position === 'Top' || legend.position === 'Bottom')
11557
11804
  ? 'Horizontal' : 'Vertical' : legend.orientation;
11805
+ rect.y = legend.position === 'Float' && this.maps.isTileMap ? rect.y - this.maps.mapAreaRect.y : rect.y;
11558
11806
  if (direction === 'Horizontal') {
11559
11807
  if (!legend.invertedPointer) {
11560
- locX = rect.x + (rect.width / 2);
11808
+ locX = rect.x + (rect.width / 2) - (legend.position === 'Float' && this.maps.isTileMap ? this.maps.mapAreaRect.x : 0);
11561
11809
  locY = rect.y;
11562
11810
  path = ' M ' + locX + ' ' + locY + ' L ' + (locX - width) + ' ' + (locY - height) +
11563
11811
  ' L ' + (locX + width) + ' ' + (locY - height) + ' Z ';
11564
11812
  }
11565
11813
  else {
11566
- locX = rect.x + (rect.width / 2);
11814
+ locX = rect.x + (rect.width / 2) - (legend.position === 'Float' && this.maps.isTileMap ? this.maps.mapAreaRect.x : 0);
11567
11815
  locY = rect.y + (rect.height);
11568
11816
  path = ' M ' + locX + ' ' + locY + ' L ' + (locX - width) + ' ' + (locY + height) +
11569
11817
  ' L ' + (locX + width) + ' ' + (locY + height) + ' Z ';
@@ -11571,20 +11819,25 @@ class Legend {
11571
11819
  }
11572
11820
  else {
11573
11821
  if (!legend.invertedPointer) {
11574
- locX = rect.x + (rect.width);
11822
+ locX = rect.x + rect.width - (legend.position === 'Float' && this.maps.isTileMap ? this.maps.mapAreaRect.x : 0);
11575
11823
  locY = rect.y + (rect.height / 2);
11576
11824
  path = ' M ' + locX + ' ' + locY + ' L ' + (locX + width) + ' ' + (locY - height) +
11577
11825
  ' L ' + (locX + width) + ' ' + (locY + height) + ' z ';
11578
11826
  }
11579
11827
  else {
11580
- locX = rect.x;
11828
+ locX = rect.x - (legend.position === 'Float' && this.maps.isTileMap ? this.maps.mapAreaRect.x : 0);
11581
11829
  locY = rect.y + (rect.height / 2);
11582
11830
  path = ' M ' + locX + ' ' + locY + ' L ' + (locX - width) + ' ' + (locY - height) +
11583
11831
  ' L ' + (locX - width) + ' ' + (locY + height) + ' z ';
11584
11832
  }
11585
11833
  }
11586
11834
  const pathOptions = new PathOption(id, fill, strokeWidth, stroke, 1, 1, '', path);
11587
- 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
+ }
11588
11841
  }
11589
11842
  wireEvents(element) {
11590
11843
  EventHandler.add(element, Browser.touchStartEvent, this.changeNextPage, this);
@@ -11945,10 +12198,20 @@ class Legend {
11945
12198
  const shapeDataValueCase = !isNullOrUndefined(shapeData['properties'][shapePath])
11946
12199
  && isNaN(shapeData['properties'][shapePath]) ? shapeData['properties'][shapePath].toLowerCase() : shapeData['properties'][shapePath];
11947
12200
  if (shapeDataValueCase === dataPathValueCase) {
11948
- legendData.push({
11949
- layerIndex: layerIndex, shapeIndex: i, dataIndex: dataIndex,
11950
- name: data[dataPath], value: value
11951
- });
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
+ }
11952
12215
  }
11953
12216
  }
11954
12217
  }
@@ -12059,7 +12322,8 @@ class Highlight {
12059
12322
  targetEle.getAttribute('class') !== 'ShapeselectionMapStyle' && !isTouch &&
12060
12323
  targetEle.getAttribute('class') !== 'MarkerselectionMapStyle' &&
12061
12324
  targetEle.getAttribute('class') !== 'BubbleselectionMapStyle' &&
12062
- targetEle.getAttribute('class') !== 'navigationlineselectionMapStyle') {
12325
+ targetEle.getAttribute('class') !== 'navigationlineselectionMapStyle' &&
12326
+ targetEle.getAttribute('class') !== 'LineselectionMapStyle') {
12063
12327
  layerIndex = parseInt(targetEle.id.split('_LayerIndex_')[1].split('_')[0], 10);
12064
12328
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
12065
12329
  let shapeData;
@@ -12069,8 +12333,9 @@ class Highlight {
12069
12333
  let dataIndex;
12070
12334
  if (targetEle.id.indexOf('shapeIndex') > -1) {
12071
12335
  shapeIn = parseInt(targetEle.id.split('_shapeIndex_')[1].split('_')[0], 10);
12072
- shapeData = this.maps.layers[layerIndex].shapeData['features'] ?
12073
- 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;
12074
12339
  dataIndex = parseInt(targetEle.id.split('_dataIndex_')[1].split('_')[0], 10);
12075
12340
  data = isNullOrUndefined(dataIndex) ? null : this.maps.layers[layerIndex].dataSource[dataIndex];
12076
12341
  this.highlightSettings = this.maps.layers[layerIndex].highlightSettings;
@@ -12142,7 +12407,8 @@ class Highlight {
12142
12407
  */
12143
12408
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
12144
12409
  handleHighlight(targetElement, layerIndex, data, shapeData) {
12145
- 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') {
12146
12412
  this.maps.legendModule.shapeHighLightAndSelection(targetElement, data, this.highlightSettings, 'highlight', layerIndex);
12147
12413
  }
12148
12414
  const selectHighLight = targetElement.id.indexOf('shapeIndex') > -1 && (this.maps.legendSettings.visible && this.maps.legendModule) ?
@@ -12160,7 +12426,7 @@ class Highlight {
12160
12426
  isMarkerSelect = this.maps.layers[layerIndex].markerSettings[marker$$1].highlightSettings.enable;
12161
12427
  }
12162
12428
  const border = {
12163
- 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),
12164
12430
  width: (targetEle.parentElement.id.indexOf('LineString') === -1) ? (this.highlightSettings.border.width / (isMarkerSelect ? 1 : this.maps.scale)) : (this.highlightSettings.border.width / this.maps.scale),
12165
12431
  opacity: this.highlightSettings.border.opacity
12166
12432
  };
@@ -12275,8 +12541,12 @@ class Selection {
12275
12541
  const layerIndex = parseInt(targetElement.id.split('_LayerIndex_')[1].split('_')[0], 10);
12276
12542
  if (targetElement.id.indexOf('shapeIndex') > -1) {
12277
12543
  shapeIndex = parseInt(targetElement.id.split('_shapeIndex_')[1].split('_')[0], 10);
12278
- shapeData = this.maps.layers[layerIndex].shapeData['features']['length'] > shapeIndex ?
12279
- 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;
12280
12550
  dataIndex = parseInt(targetElement.id.split('_dataIndex_')[1].split('_')[0], 10);
12281
12551
  data = isNullOrUndefined(dataIndex) ? null : this.maps.layers[layerIndex].dataSource[dataIndex];
12282
12552
  this.selectionsettings = this.maps.layers[layerIndex].selectionSettings;
@@ -12356,15 +12626,17 @@ class Selection {
12356
12626
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
12357
12627
  selectMap(targetElement, shapeData, data) {
12358
12628
  const layerIndex = parseInt(targetElement.id.split('_LayerIndex_')[1].split('_')[0], 10);
12629
+ const isLineStringShape = targetElement.parentElement.id.indexOf('LineString') > -1;
12359
12630
  const selectionsettings = this.selectionsettings;
12360
12631
  const border = {
12361
- color: (targetElement.parentElement.id.indexOf('LineString') === -1) ? this.selectionsettings.border.color : (this.selectionsettings.border.color || this.selectionsettings.fill),
12362
- 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)),
12363
12635
  opacity: this.selectionsettings.border.opacity
12364
12636
  };
12365
12637
  const eventArgs = {
12366
12638
  opacity: this.selectionsettings.opacity,
12367
- 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'),
12368
12640
  border: border,
12369
12641
  name: itemSelection,
12370
12642
  target: targetElement.id,
@@ -12376,7 +12648,8 @@ class Selection {
12376
12648
  this.maps.trigger('itemSelection', eventArgs, (observedArgs) => {
12377
12649
  eventArgs.border.opacity = isNullOrUndefined(this.selectionsettings.border.opacity) ? this.selectionsettings.opacity : this.selectionsettings.border.opacity;
12378
12650
  if (!eventArgs.cancel) {
12379
- if (targetElement.getAttribute('class') === this.selectionType + 'selectionMapStyle') {
12651
+ if (targetElement.getAttribute('class') === this.selectionType + 'selectionMapStyle'
12652
+ || targetElement.getAttribute('class') === 'LineselectionMapStyle') {
12380
12653
  removeClass(targetElement);
12381
12654
  this.removedSelectionList(targetElement);
12382
12655
  for (let m = 0; m < this.maps.shapeSelectionItem.length; m++) {
@@ -12395,14 +12668,23 @@ class Selection {
12395
12668
  else {
12396
12669
  const layetElement = getElementByID(this.maps.element.id + '_Layer_Collections');
12397
12670
  if (!this.selectionsettings.enableMultiSelect &&
12398
- layetElement.getElementsByClassName(this.selectionType + 'selectionMapStyle').length > 0) {
12399
- 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;
12400
12674
  let ele;
12401
12675
  for (let k = 0; k < eleCount; k++) {
12402
12676
  ele = layetElement.getElementsByClassName(this.selectionType + 'selectionMapStyle')[0];
12403
12677
  removeClass(ele);
12404
12678
  this.removedSelectionList(ele);
12405
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
+ }
12406
12688
  if (this.selectionType === 'Shape') {
12407
12689
  this.maps.shapeSelectionItem = [];
12408
12690
  const selectionLength = this.maps.selectedElementId.length;
@@ -12420,13 +12702,24 @@ class Selection {
12420
12702
  ele.setAttribute('stroke', this.maps.layers[layerIndex].navigationLineSettings[index].color);
12421
12703
  }
12422
12704
  }
12423
- if (!getElement(this.selectionType + 'selectionMap')) {
12424
- 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');
12425
12713
  }
12426
12714
  else {
12427
- 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');
12428
12722
  }
12429
- targetElement.setAttribute('class', this.selectionType + 'selectionMapStyle');
12430
12723
  if (targetElement.getAttribute('class') === 'ShapeselectionMapStyle') {
12431
12724
  this.maps.shapeSelectionClass = getElement(this.selectionType + 'selectionMap');
12432
12725
  this.maps.selectedElementId.push(targetElement.getAttribute('id'));
@@ -12903,8 +13196,6 @@ class Zoom {
12903
13196
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
12904
13197
  this.startTouches = [];
12905
13198
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
12906
- this.shapeZoomLocation = [];
12907
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
12908
13199
  this.intersect = [];
12909
13200
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
12910
13201
  this.mouseDownLatLong = { x: 0, y: 0 };
@@ -12943,25 +13234,38 @@ class Zoom {
12943
13234
  const minZoom = map.zoomSettings.minZoom;
12944
13235
  newZoomFactor = (minZoom > newZoomFactor && type === 'ZoomIn') ? minZoom + 1 : newZoomFactor;
12945
13236
  const prevTilePoint = map.tileTranslatePoint;
12946
- 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)) {
12947
13239
  const availSize = map.mapAreaRect;
12948
13240
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
12949
13241
  const minBounds = map.baseMapRectBounds['min'];
12950
13242
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
12951
13243
  const maxBounds = map.baseMapRectBounds['max'];
12952
- const mapTotalWidth = Math.abs(minBounds['x'] - maxBounds['x']);
12953
- const mapTotalHeight = Math.abs(minBounds['y'] - maxBounds['y']);
12954
- const point = map.translatePoint;
12955
- let translatePointX = point.x - (((availSize.width / scale) - (availSize.width / newZoomFactor)) / (availSize.width / position.x));
12956
- let translatePointY = point.y - (((availSize.height / scale) - (availSize.height / newZoomFactor)) / (availSize.height / position.y));
12957
- const currentHeight = Math.abs(map.baseMapRectBounds['max']['y'] - map.baseMapRectBounds['min']['y']) * newZoomFactor;
12958
- translatePointX = (currentHeight < map.mapAreaRect.height) ? (availSize.x + ((-(minBounds['x'])) + ((availSize.width / 2) - (mapTotalWidth / 2)))) : translatePointX;
12959
- translatePointY = (currentHeight < map.mapAreaRect.height) ? (availSize.y + ((-(minBounds['y'])) + ((availSize.height / 2) - (mapTotalHeight / 2)))) : translatePointY;
12960
- 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
+ }
12961
13265
  map.scale = newZoomFactor;
12962
13266
  if (this.triggerZoomEvent(prevTilePoint, prevLevel, type)) {
12963
13267
  map.translatePoint = map.previousPoint;
12964
- map.scale = map.previousScale;
13268
+ map.scale = map.mapScaleValue = map.previousScale;
12965
13269
  }
12966
13270
  else {
12967
13271
  this.applyTransform();
@@ -13017,6 +13321,14 @@ class Zoom {
13017
13321
  }
13018
13322
  this.maps.zoomNotApplied = false;
13019
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
+ }
13020
13332
  triggerZoomEvent(prevTilePoint, prevLevel, type) {
13021
13333
  const map = this.maps;
13022
13334
  let zoomArgs;
@@ -13133,22 +13445,34 @@ class Zoom {
13133
13445
  this.lastScale = scale;
13134
13446
  this.pinchFactor *= newScale;
13135
13447
  this.pinchFactor = Math.min(this.maps.zoomSettings.maxZoom, Math.max(this.pinchFactor, this.maps.zoomSettings.minZoom));
13136
- const zoomCalculationFactor = this.pinchFactor;
13448
+ let zoomCalculationFactor = this.pinchFactor;
13137
13449
  let isZoomCancelled;
13138
13450
  if (!map.isTileMap) {
13139
13451
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
13140
13452
  const minBounds = map.baseMapRectBounds['min'];
13141
13453
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
13142
13454
  const maxBounds = map.baseMapRectBounds['max'];
13143
- const mapTotalHeight = Math.abs(minBounds['y'] - maxBounds['y']);
13144
- 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']);
13145
13457
  const translatePoint = map.translatePoint;
13146
- const currentHeight = Math.abs(map.baseMapRectBounds['max']['y'] - map.baseMapRectBounds['min']['y']) * zoomCalculationFactor;
13147
- let translatePointX = translatePoint.x - (((availSize.width / map.scale) - (availSize.width / zoomCalculationFactor)) / (availSize.width / touchCenter.x));
13148
- let translatePointY = translatePoint.y - (((availSize.height / map.scale) - (availSize.height / zoomCalculationFactor)) / (availSize.height / touchCenter.y));
13149
- translatePointX = (currentHeight < map.mapAreaRect.height) ? (availSize.x + ((-(minBounds['x'])) + ((availSize.width / 2) - (mapTotalWidth / 2)))) : translatePointX;
13150
- translatePointY = (currentHeight < map.mapAreaRect.height) ? (availSize.y + ((-(minBounds['y'])) + ((availSize.height / 2) - (mapTotalHeight / 2)))) : translatePointY;
13151
- 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
+ }
13152
13476
  map.scale = zoomCalculationFactor;
13153
13477
  isZoomCancelled = this.triggerZoomEvent(prevTilePoint, prevLevel, '');
13154
13478
  if (isZoomCancelled) {
@@ -13257,11 +13581,10 @@ class Zoom {
13257
13581
  layerElement.appendChild(this.maps.navigationLineModule.renderNavigation(this.currentLayer, this.maps.tileZoomLevel, this.index));
13258
13582
  }
13259
13583
  }
13260
- else {
13584
+ else if (currentEle.id.indexOf('Legend') == -1) {
13261
13585
  changeBorderWidth(currentEle, this.index, scale, this.maps);
13262
13586
  this.maps.zoomTranslatePoint = this.maps.translatePoint;
13263
13587
  this.animateTransform(currentEle, animate$$1, x, y, scale);
13264
- this.shapeZoomLocation = currentEle.childNodes;
13265
13588
  }
13266
13589
  }
13267
13590
  else if (currentEle.id.indexOf('_Markers_Group') > -1) {
@@ -13368,7 +13691,7 @@ class Zoom {
13368
13691
  for (let k = 0; k < currentEle.childElementCount; k++) {
13369
13692
  if (currentEle.childNodes[k]['id'].indexOf('_LabelIndex_') > -1) {
13370
13693
  const labelIndex = parseFloat(currentEle.childNodes[k]['id'].split('_LabelIndex_')[1].split('_')[0]);
13371
- this.zoomshapewidth = this.shapeZoomLocation[labelIndex].getBoundingClientRect();
13694
+ this.zoomshapewidth = currentEle.childNodes[k].getBoundingClientRect();
13372
13695
  this.maps.zoomShapeCollection.push(this.zoomshapewidth);
13373
13696
  this.dataLabelTranslate(currentEle.childNodes[k], factor, x, y, scale, 'DataLabel', animate$$1);
13374
13697
  const dataLabel = this.maps.layers[this.index].dataLabelSettings;
@@ -13584,7 +13907,7 @@ class Zoom {
13584
13907
  }
13585
13908
  if (this.maps.layers[this.index].dataLabelSettings.smartLabelMode === 'Hide') {
13586
13909
  if (scale > 1) {
13587
- text = (this.zoomshapewidth['width'] >= zoomtextSize['width']) ? zoomtext : '';
13910
+ text = ((this.maps.dataLabelShape[l] * scale) >= zoomtextSize['width']) ? zoomtext : '';
13588
13911
  element.innerHTML = text;
13589
13912
  }
13590
13913
  else {
@@ -13594,7 +13917,7 @@ class Zoom {
13594
13917
  }
13595
13918
  if (this.maps.layers[this.index].dataLabelSettings.smartLabelMode === 'Trim') {
13596
13919
  if (scale > 1) {
13597
- zoomtrimLabel = textTrim(this.zoomshapewidth['width'], zoomtext, style);
13920
+ zoomtrimLabel = textTrim((this.maps.dataLabelShape[l] * scale), zoomtext, style);
13598
13921
  text = zoomtrimLabel;
13599
13922
  element.innerHTML = text;
13600
13923
  }
@@ -13632,7 +13955,7 @@ class Zoom {
13632
13955
  || textLocations['heightTop'] > this.intersect[j]['heightBottom']) {
13633
13956
  trimmedLable = !isNullOrUndefined(text) ? text : zoomtext;
13634
13957
  if (scale > 1) {
13635
- trimmedLable = textTrim(this.zoomshapewidth['width'], trimmedLable, style);
13958
+ trimmedLable = textTrim((this.maps.dataLabelShape[l] * scale), trimmedLable, style);
13636
13959
  }
13637
13960
  element.innerHTML = trimmedLable;
13638
13961
  }
@@ -13658,11 +13981,11 @@ class Zoom {
13658
13981
  }
13659
13982
  this.intersect.push(textLocations);
13660
13983
  if (isNullOrUndefined(trimmedLable)) {
13661
- trimmedLable = textTrim(this.zoomshapewidth['width'], zoomtext, style);
13984
+ trimmedLable = textTrim((this.maps.dataLabelShape[l] * scale), zoomtext, style);
13662
13985
  element.innerHTML = trimmedLable;
13663
13986
  }
13664
13987
  }
13665
- else {
13988
+ if (animate$$1 || duration > 0) {
13666
13989
  smoothTranslate(element, 0, duration, new MapLocation(labelX, labelY));
13667
13990
  }
13668
13991
  }
@@ -13783,7 +14106,7 @@ class Zoom {
13783
14106
  const layerRect = getElementByID(map.element.id + '_Layer_Collections').getBoundingClientRect();
13784
14107
  const elementRect = getElementByID(map.element.id + '_svg').getBoundingClientRect();
13785
14108
  const panningXDirection = ((xDifference < 0 ? layerRect.left <= (elementRect.left + map.mapAreaRect.x) :
13786
- ((layerRect.left + layerRect.width) >= (elementRect.left + elementRect.width) + map.mapAreaRect.x + map.margin.left)));
14109
+ ((layerRect.left + layerRect.width + map.mapAreaRect.x) >= (elementRect.width))));
13787
14110
  const panningYDirection = ((yDifference < 0 ? layerRect.top <= (elementRect.top + map.mapAreaRect.y) :
13788
14111
  ((layerRect.top + layerRect.height + legendHeight + map.margin.top) >= (elementRect.top + elementRect.height))));
13789
14112
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -13872,16 +14195,28 @@ class Zoom {
13872
14195
  const min = map.baseMapRectBounds['min'];
13873
14196
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
13874
14197
  const max = map.baseMapRectBounds['max'];
13875
- const mapWidth = Math.abs(max['x'] - min['x']);
13876
- const mapHeight = Math.abs(min['y'] - max['y']);
13877
- let translatePointX = translatePoint.x - (((size.width / scale) - (size.width / zoomFactor)) / 2);
13878
- let translatePointY = translatePoint.y - (((size.height / scale) - (size.height / zoomFactor)) / 2);
13879
- const currentHeight = Math.abs(map.baseMapRectBounds['max']['y'] - map.baseMapRectBounds['min']['y']) * zoomFactor;
13880
- translatePointX = (currentHeight < map.mapAreaRect.height) ? (size.x + ((-(min['x'])) + ((size.width / 2) - (mapWidth / 2))))
13881
- : translatePointX;
13882
- translatePointY = (currentHeight < map.mapAreaRect.height) ? (size.y + ((-(min['y'])) + ((size.height / 2) - (mapHeight / 2))))
13883
- : translatePointY;
13884
- 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
+ }
13885
14220
  map.zoomTranslatePoint = map.translatePoint;
13886
14221
  map.scale = zoomFactor;
13887
14222
  if (this.triggerZoomEvent(prevTilePoint, prevLevel, type)) {
@@ -14196,7 +14531,12 @@ class Zoom {
14196
14531
  x = (size.width / 2) - (toolBarSize.width / 2);
14197
14532
  break;
14198
14533
  case 'Far':
14199
- 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
+ }
14200
14540
  break;
14201
14541
  }
14202
14542
  let extraPosition = map.getExtraPosition();
@@ -14252,6 +14592,7 @@ class Zoom {
14252
14592
  }
14253
14593
  else {
14254
14594
  map.mapScaleValue = value - delta;
14595
+ map.isReset = (map.mapScaleValue < 1) ? true : false;
14255
14596
  map.staticMapZoom = map.tileZoomLevel;
14256
14597
  if (map.mapScaleValue === 1) {
14257
14598
  map.markerCenterLatitude = null;