@syncfusion/ej2-maps 20.1.59 → 20.2.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/maps/maps.js CHANGED
@@ -36,7 +36,7 @@ import { ZoomSettings, LegendSettings } from './model/base';
36
36
  import { LayerSettings, TitleSettings, Border, Margin, MapsAreaSettings, Annotation, CenterPosition } from './model/base';
37
37
  import { Marker } from './layers/marker';
38
38
  import { load, click, loaded, doubleClick, resize, shapeSelected, zoomIn } from './model/constants';
39
- import { getThemeStyle } from './model/theme';
39
+ import { getThemeStyle, Theme } from './model/theme';
40
40
  import { BingMap } from './layers/bing-map';
41
41
  import { LayerPanel } from './layers/layer-panel';
42
42
  import { Rect, RectOption, measureText, getElementByID, MapAjax, processResult, getElementsByClassName } from '../maps/utils/helper';
@@ -378,16 +378,7 @@ var Maps = /** @class */ (function (_super) {
378
378
  };
379
379
  Maps.prototype.renderMap = function () {
380
380
  if (this.legendModule && this.legendSettings.visible) {
381
- if (!this.isTileMap) {
382
- this.legendModule.renderLegend();
383
- }
384
- else {
385
- var layerCount = this.layersCollection.length - 1;
386
- if (!this.layersCollection[layerCount].isBaseLayer) {
387
- this.isTileMapSubLayer = true;
388
- this.legendModule.renderLegend();
389
- }
390
- }
381
+ this.legendModule.renderLegend();
391
382
  }
392
383
  this.createTile();
393
384
  if (this.zoomSettings.enable && this.zoomModule) {
@@ -470,12 +461,16 @@ var Maps = /** @class */ (function (_super) {
470
461
  bottom = svg.bottom - tile.bottom - element.offsetTop;
471
462
  top_1 = parseFloat(tileElement.style.top) + element.offsetTop;
472
463
  }
473
- top_1 = (bottom <= 11) ? top_1 : (top_1 * 2);
474
- left = (bottom <= 11) ? left : (left * 2);
464
+ top_1 = (bottom <= 11) ? top_1 : (!isNullOrUndefined(this.legendModule) && this.legendSettings.position === 'Bottom') ? this.mapAreaRect.y : (top_1 * 2);
465
+ left = (bottom <= 11) ? left : !isNullOrUndefined(this.legendModule) ? left : (left * 2);
475
466
  tileElement.style.top = top_1 + 'px';
476
467
  tileElement.style.left = left + 'px';
477
468
  tileElement1.style.top = top_1 + 'px';
478
469
  tileElement1.style.left = left + 'px';
470
+ if (!isNullOrUndefined(this.legendModule) && this.legendModule.totalPages.length > 0) {
471
+ tileElement.style.height = tileElement1.style.height = this.legendModule.legendTotalRect.height + 'px';
472
+ tileElement.style.width = tileElement1.style.width = this.legendModule.legendTotalRect.width + 'px';
473
+ }
479
474
  }
480
475
  this.arrangeTemplate();
481
476
  if (this.annotationsModule) {
@@ -601,12 +596,21 @@ var Maps = /** @class */ (function (_super) {
601
596
  this.zoomModule.layerCollectionEle = getElementByID(this.element.id + '_Layer_Collections');
602
597
  }
603
598
  if (this.isTileMap && getElementByID(this.element.id + '_Tile_SVG') && getElementByID(this.element.id + '_tile_parent')) {
604
- var tileRect = getElementByID(this.element.id + '_tile_parent').getBoundingClientRect();
605
- var tileSvgRect = getElementByID(this.element.id + '_Tile_SVG').getBoundingClientRect();
599
+ var tileElement = getElementByID(this.element.id + '_tile_parent');
600
+ var tileSvgElement = getElementByID(this.element.id + '_Tile_SVG');
601
+ var tileSvgParentElement = getElementByID(this.element.id + '_Tile_SVG_Parent');
602
+ var tileRect = tileElement.getBoundingClientRect();
603
+ var tileSvgRect = tileSvgElement.getBoundingClientRect();
606
604
  left = (tileRect.left - tileSvgRect.left);
607
605
  top = (tileRect.top - tileSvgRect.top);
608
- getElementByID(this.element.id + '_Tile_SVG_Parent').style.left = left + 'px';
609
- getElementByID(this.element.id + '_Tile_SVG_Parent').style.top = top + 'px';
606
+ tileSvgParentElement.style.left = left + 'px';
607
+ tileSvgParentElement.style.top = top + 'px';
608
+ if (!isNullOrUndefined(this.legendModule) && this.legendModule.totalPages.length > 0) {
609
+ tileElement.style.width = tileSvgElement.style.width = this.legendModule.legendTotalRect.width.toString();
610
+ tileElement.style.height = tileSvgElement.style.height = this.legendModule.legendTotalRect.height.toString();
611
+ tileSvgParentElement.style.width = this.legendModule.legendTotalRect.width + 'px';
612
+ tileSvgParentElement.style.height = this.legendModule.legendTotalRect.height + 'px';
613
+ }
610
614
  var markerTemplateElements = document.getElementsByClassName('template');
611
615
  if (!isNullOrUndefined(markerTemplateElements) && markerTemplateElements.length > 0) {
612
616
  for (var i = 0; i < markerTemplateElements.length; i++) {
@@ -624,7 +628,7 @@ var Maps = /** @class */ (function (_super) {
624
628
  if (!isNullOrUndefined(elements) && elements.childElementCount > 0) {
625
629
  for (var i = 0; i < elements.childNodes.length; i++) {
626
630
  var childElement = elements.childNodes[i];
627
- if (childElement.tagName === 'g') {
631
+ if (childElement.tagName === 'g' && childElement.id.indexOf('_Legend_Group') == -1) {
628
632
  var layerIndex = parseFloat(childElement.id.split('_LayerIndex_')[1].split('_')[0]);
629
633
  for (var j = 0; j < childElement.childNodes.length; j++) {
630
634
  var childNode = childElement.childNodes[j];
@@ -661,7 +665,7 @@ var Maps = /** @class */ (function (_super) {
661
665
  }
662
666
  var templateElements = document.getElementsByClassName(this.element.id + '_template');
663
667
  if (!isNullOrUndefined(templateElements) && templateElements.length > 0 &&
664
- getElementByID(this.element.id + '_Layer_Collections') && this.layers[this.layers.length - 1].layerType !== 'OSM') {
668
+ getElementByID(this.element.id + '_Layer_Collections') && !this.isTileMap) {
665
669
  for (var i = 0; i < templateElements.length; i++) {
666
670
  var offSetLetValue = 0;
667
671
  var offSetTopValue = 0;
@@ -696,10 +700,7 @@ var Maps = /** @class */ (function (_super) {
696
700
  var mainLayer = this.layersCollection[0];
697
701
  var padding = 0;
698
702
  if (mainLayer.isBaseLayer && (mainLayer.layerType === 'OSM' || mainLayer.layerType === 'Bing' ||
699
- mainLayer.layerType === 'GoogleStaticMap' || mainLayer.layerType === 'Google')) {
700
- if (mainLayer.layerType === 'Google') {
701
- mainLayer.urlTemplate = 'https://mt1.google.com/vt/lyrs=m@129&hl=en&x=tileX&y=tileY&z=level';
702
- }
703
+ mainLayer.layerType === 'GoogleStaticMap' || mainLayer.layerType === 'Google' || (!isNullOrUndefined(mainLayer.urlTemplate) && mainLayer.urlTemplate !== ''))) {
703
704
  removeElement(this.element.id + '_tile_parent');
704
705
  removeElement(this.element.id + '_tiles');
705
706
  removeElement('animated_tiles');
@@ -747,7 +748,7 @@ var Maps = /** @class */ (function (_super) {
747
748
  var baseLayer = mainLayers[i];
748
749
  if (baseLayer.visible && baseIndex === i) {
749
750
  baseLayer.isBaseLayer = true;
750
- this.isTileMap = (baseLayer.layerType === 'Geometry') ? false : true;
751
+ this.isTileMap = (baseLayer.layerType === 'Geometry' && !isNullOrUndefined(baseLayer.shapeData)) ? false : true;
751
752
  this.layersCollection.push(baseLayer);
752
753
  break;
753
754
  }
@@ -794,12 +795,19 @@ var Maps = /** @class */ (function (_super) {
794
795
  * @private
795
796
  */
796
797
  Maps.prototype.renderTitle = function (title, type, bounds, groupEle) {
797
- var style = title.textStyle;
798
+ var style = {
799
+ size: title.textStyle.size,
800
+ color: title.textStyle.color,
801
+ fontFamily: title.textStyle.fontFamily,
802
+ fontWeight: title.textStyle.fontWeight,
803
+ fontStyle: title.textStyle.fontStyle,
804
+ opacity: title.textStyle.opacity
805
+ };
798
806
  var height;
799
807
  var width = Math.abs((this.margin.left + this.margin.right) - this.availableSize.width);
800
- style.fontFamily = this.themeStyle.fontFamily || style.fontFamily;
808
+ style.fontFamily = !isNullOrUndefined(style.fontFamily) ? style.fontFamily : this.themeStyle.fontFamily;
801
809
  style.fontWeight = style.fontWeight || this.themeStyle.titleFontWeight;
802
- style.size = this.themeStyle.titleFontSize || style.size;
810
+ style.size = type === 'title' ? (style.size || this.themeStyle.titleFontSize) : (style.size || Theme.mapsSubTitleFont.size);
803
811
  if (title.text) {
804
812
  if (isNullOrUndefined(groupEle)) {
805
813
  groupEle = this.renderer.createGroup({ id: this.element.id + '_Title_Group' });
@@ -969,6 +977,7 @@ var Maps = /** @class */ (function (_super) {
969
977
  var id = event.target['id'];
970
978
  event.preventDefault();
971
979
  if (this.legendModule && (id.indexOf('_Left_Page_Rect') > -1 || id.indexOf('_Right_Page_Rect') > -1)) {
980
+ this.mapAreaRect = this.legendModule.initialMapAreaRect;
972
981
  this.legendModule.currentPage = (id.indexOf('_Left_Page_') > -1) ? (this.legendModule.currentPage - 1) :
973
982
  (this.legendModule.currentPage + 1);
974
983
  this.legendModule.legendGroup = this.renderer.createGroup({ id: this.element.id + '_Legend_Group' });
@@ -1330,7 +1339,7 @@ var Maps = /** @class */ (function (_super) {
1330
1339
  removeElement(this.element.id + '_EJ2_LegendTitle_Tooltip');
1331
1340
  }
1332
1341
  if ((targetId === (this.element.id + '_Map_title')) && (event.target.textContent.indexOf('...') > -1)) {
1333
- 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);
1342
+ 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);
1334
1343
  }
1335
1344
  else {
1336
1345
  removeElement(this.element.id + '_EJ2_Title_Tooltip');
@@ -1764,7 +1773,8 @@ var Maps = /** @class */ (function (_super) {
1764
1773
  var collection = Object.keys(newProp.layers[x]);
1765
1774
  for (var _b = 0, collection_1 = collection; _b < collection_1.length; _b++) {
1766
1775
  var collectionProp = collection_1[_b];
1767
- if (collectionProp === 'layerType' && newProp.layers[x].layerType === 'OSM') {
1776
+ if ((collectionProp === 'layerType' && newProp.layers[x].layerType !== 'Geometry') || (isNullOrUndefined(this.layers[x].shapeData)
1777
+ && !isNullOrUndefined(this.layers[x].urlTemplate) && this.layers[x].urlTemplate !== '')) {
1768
1778
  this.isReset = true;
1769
1779
  }
1770
1780
  else if (collectionProp === 'markerSettings') {
@@ -2047,6 +2057,28 @@ var Maps = /** @class */ (function (_super) {
2047
2057
  }
2048
2058
  return null;
2049
2059
  };
2060
+ /**
2061
+ * This method is used to get the Bing maps URL.
2062
+ *
2063
+ * @param {string} url - Specifies the URL of the maps.
2064
+ * @returns {Promise<string>} - Returns the processed Bing URL as Promise.
2065
+ */
2066
+ Maps.prototype.getBingUrlTemplate = function (url) {
2067
+ var promise = new Promise(function (resolve, reject) {
2068
+ var ajax = new Ajax({
2069
+ url: url
2070
+ });
2071
+ ajax.onSuccess = function (json) {
2072
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2073
+ var jsonObject = JSON.parse(json);
2074
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2075
+ var resource = jsonObject['resourceSets'][0]['resources'][0];
2076
+ resolve(resource['imageUrl']);
2077
+ };
2078
+ ajax.send();
2079
+ });
2080
+ return promise;
2081
+ };
2050
2082
  /**
2051
2083
  * To find visibility of layers and markers for required modules load.
2052
2084
  *
@@ -1559,6 +1559,7 @@ export interface LayerSettingsModel {
1559
1559
  * Sets and gets the Bing map type for the layer. If you use shape data with BingMapType without using layer type as Bing,
1560
1560
  * then the map will render based on shape data since default layer type will be set as Geometry.
1561
1561
  *
1562
+
1562
1563
  * @default Aerial
1563
1564
  */
1564
1565
  bingMapType?: BingMapType;
@@ -1566,6 +1567,7 @@ export interface LayerSettingsModel {
1566
1567
  /**
1567
1568
  * Sets and gets the type of the static maps.
1568
1569
  *
1570
+
1569
1571
  * @default RoadMap
1570
1572
  */
1571
1573
  staticMapType?: StaticMapType;
@@ -1573,6 +1575,7 @@ export interface LayerSettingsModel {
1573
1575
  /**
1574
1576
  * Sets and gets the key for the tile map layer in maps.
1575
1577
  *
1578
+
1576
1579
  * @default ''
1577
1580
  */
1578
1581
  key?: string;
@@ -1581,6 +1584,7 @@ export interface LayerSettingsModel {
1581
1584
  * Sets and gets the type of the layer in maps. If we use layer type with shape data property in layer of the maps
1582
1585
  * then map will render based on the provided layer type.
1583
1586
  *
1587
+
1584
1588
  * @default Geometry
1585
1589
  */
1586
1590
  layerType?: ShapeLayerType;
@@ -1588,7 +1592,7 @@ export interface LayerSettingsModel {
1588
1592
  /**
1589
1593
  * Sets and gets the template for the map using the url.
1590
1594
  *
1591
- * @default 'https://a.tile.openstreetmap.org/level/tileX/tileY.png'
1595
+ * @default ''
1592
1596
  */
1593
1597
  urlTemplate?: string;
1594
1598
 
@@ -1333,18 +1333,21 @@ export declare class LayerSettings extends ChildProperty<LayerSettings> {
1333
1333
  * Sets and gets the Bing map type for the layer. If you use shape data with BingMapType without using layer type as Bing,
1334
1334
  * then the map will render based on shape data since default layer type will be set as Geometry.
1335
1335
  *
1336
+
1336
1337
  * @default Aerial
1337
1338
  */
1338
1339
  bingMapType: BingMapType;
1339
1340
  /**
1340
1341
  * Sets and gets the type of the static maps.
1341
1342
  *
1343
+
1342
1344
  * @default RoadMap
1343
1345
  */
1344
1346
  staticMapType: StaticMapType;
1345
1347
  /**
1346
1348
  * Sets and gets the key for the tile map layer in maps.
1347
1349
  *
1350
+
1348
1351
  * @default ''
1349
1352
  */
1350
1353
  key: string;
@@ -1352,13 +1355,14 @@ export declare class LayerSettings extends ChildProperty<LayerSettings> {
1352
1355
  * Sets and gets the type of the layer in maps. If we use layer type with shape data property in layer of the maps
1353
1356
  * then map will render based on the provided layer type.
1354
1357
  *
1358
+
1355
1359
  * @default Geometry
1356
1360
  */
1357
1361
  layerType: ShapeLayerType;
1358
1362
  /**
1359
1363
  * Sets and gets the template for the map using the url.
1360
1364
  *
1361
- * @default 'https://a.tile.openstreetmap.org/level/tileX/tileY.png'
1365
+ * @default ''
1362
1366
  */
1363
1367
  urlTemplate: string;
1364
1368
  /**
@@ -525,7 +525,7 @@ var SubTitleSettings = /** @class */ (function (_super) {
525
525
  return _super !== null && _super.apply(this, arguments) || this;
526
526
  }
527
527
  __decorate([
528
- Complex({ size: Theme.mapsSubTitleFont.size, fontWeight: null }, Font)
528
+ Complex({ size: null, fontWeight: null, fontFamily: null }, Font)
529
529
  ], SubTitleSettings.prototype, "textStyle", void 0);
530
530
  __decorate([
531
531
  Property('Center')
@@ -542,7 +542,7 @@ var TitleSettings = /** @class */ (function (_super) {
542
542
  return _super !== null && _super.apply(this, arguments) || this;
543
543
  }
544
544
  __decorate([
545
- Complex({ size: Theme.mapsTitleFont.size, fontWeight: null }, Font)
545
+ Complex({ size: null, fontWeight: null, fontFamily: null }, Font)
546
546
  ], TitleSettings.prototype, "textStyle", void 0);
547
547
  __decorate([
548
548
  Property('Center')
@@ -689,7 +689,7 @@ var LegendSettings = /** @class */ (function (_super) {
689
689
  Property('')
690
690
  ], LegendSettings.prototype, "height", void 0);
691
691
  __decorate([
692
- Complex({}, Font)
692
+ Complex({ fontFamily: null }, Font)
693
693
  ], LegendSettings.prototype, "textStyle", void 0);
694
694
  __decorate([
695
695
  Property(15)
@@ -710,7 +710,7 @@ var LegendSettings = /** @class */ (function (_super) {
710
710
  Complex({}, CommonTitleSettings)
711
711
  ], LegendSettings.prototype, "title", void 0);
712
712
  __decorate([
713
- Complex(Theme.legendTitleFont, Font)
713
+ Complex({ size: Theme.legendTitleFont.size, color: Theme.legendTitleFont.color, fontStyle: Theme.legendTitleFont.fontStyle, fontWeight: Theme.legendTitleFont.fontWeight, fontFamily: null }, Font)
714
714
  ], LegendSettings.prototype, "titleStyle", void 0);
715
715
  __decorate([
716
716
  Property('Bottom')
@@ -978,7 +978,7 @@ var LayerSettings = /** @class */ (function (_super) {
978
978
  Property('Geometry')
979
979
  ], LayerSettings.prototype, "layerType", void 0);
980
980
  __decorate([
981
- Property('https://a.tile.openstreetmap.org/level/tileX/tileY.png')
981
+ Property('')
982
982
  ], LayerSettings.prototype, "urlTemplate", void 0);
983
983
  __decorate([
984
984
  Property(true)
@@ -328,6 +328,7 @@ export function getThemeStyle(theme) {
328
328
  backgroundColor: color,
329
329
  areaBackgroundColor: color,
330
330
  titleFontColor: '#FFFFFF',
331
+ titleFontSize: '14px',
331
332
  subTitleFontColor: '#FFFFFF',
332
333
  legendTitleFontColor: '#DADADA',
333
334
  legendTextColor: '#DADADA',
@@ -347,6 +348,7 @@ export function getThemeStyle(theme) {
347
348
  backgroundColor: '#000000',
348
349
  areaBackgroundColor: '#000000',
349
350
  titleFontColor: '#FFFFFF',
351
+ titleFontSize: '14px',
350
352
  subTitleFontColor: '#FFFFFF',
351
353
  legendTitleFontColor: '#FFFFFF',
352
354
  legendTextColor: '#FFFFFF',
@@ -527,6 +529,7 @@ export function getThemeStyle(theme) {
527
529
  backgroundColor: '#FFFFFF',
528
530
  areaBackgroundColor: '#FFFFFF',
529
531
  titleFontColor: '#424242',
532
+ titleFontSize: '14px',
530
533
  subTitleFontColor: '#424242',
531
534
  legendTitleFontColor: '#757575',
532
535
  legendTextColor: '#757575',
@@ -54,7 +54,8 @@ var Highlight = /** @class */ (function () {
54
54
  targetEle.getAttribute('class') !== 'ShapeselectionMapStyle' && !isTouch &&
55
55
  targetEle.getAttribute('class') !== 'MarkerselectionMapStyle' &&
56
56
  targetEle.getAttribute('class') !== 'BubbleselectionMapStyle' &&
57
- targetEle.getAttribute('class') !== 'navigationlineselectionMapStyle') {
57
+ targetEle.getAttribute('class') !== 'navigationlineselectionMapStyle' &&
58
+ targetEle.getAttribute('class') !== 'LineselectionMapStyle') {
58
59
  layerIndex = parseInt(targetEle.id.split('_LayerIndex_')[1].split('_')[0], 10);
59
60
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
60
61
  var shapeData = void 0;
@@ -64,8 +65,9 @@ var Highlight = /** @class */ (function () {
64
65
  var dataIndex = void 0;
65
66
  if (targetEle.id.indexOf('shapeIndex') > -1) {
66
67
  shapeIn = parseInt(targetEle.id.split('_shapeIndex_')[1].split('_')[0], 10);
67
- shapeData = this.maps.layers[layerIndex].shapeData['features'] ?
68
- this.maps.layers[layerIndex].shapeData['features'][shapeIn]['properties'] : null;
68
+ shapeData = this.maps.layers[layerIndex].shapeData['features'] &&
69
+ !isNullOrUndefined(this.maps.layersCollection[layerIndex].layerData[shapeIn]) ?
70
+ this.maps.layersCollection[layerIndex].layerData[shapeIn]['property'] : null;
69
71
  dataIndex = parseInt(targetEle.id.split('_dataIndex_')[1].split('_')[0], 10);
70
72
  data = isNullOrUndefined(dataIndex) ? null : this.maps.layers[layerIndex].dataSource[dataIndex];
71
73
  this.highlightSettings = this.maps.layers[layerIndex].highlightSettings;
@@ -137,7 +139,8 @@ var Highlight = /** @class */ (function () {
137
139
  */
138
140
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
139
141
  Highlight.prototype.handleHighlight = function (targetElement, layerIndex, data, shapeData) {
140
- if (this.maps.legendSettings.visible && targetElement.id.indexOf('_MarkerIndex_') === -1 && this.maps.legendModule) {
142
+ if (this.maps.legendSettings.visible && targetElement.id.indexOf('_MarkerIndex_') === -1 && this.maps.legendModule
143
+ && this.maps.legendSettings.type === 'Layers') {
141
144
  this.maps.legendModule.shapeHighLightAndSelection(targetElement, data, this.highlightSettings, 'highlight', layerIndex);
142
145
  }
143
146
  var selectHighLight = targetElement.id.indexOf('shapeIndex') > -1 && (this.maps.legendSettings.visible && this.maps.legendModule) ?
@@ -156,7 +159,7 @@ var Highlight = /** @class */ (function () {
156
159
  isMarkerSelect = this.maps.layers[layerIndex].markerSettings[marker].highlightSettings.enable;
157
160
  }
158
161
  var border = {
159
- color: (targetEle.parentElement.id.indexOf('LineString') === -1) ? this.highlightSettings.border.color : (this.highlightSettings.border.color || this.highlightSettings.fill),
162
+ color: (targetEle.parentElement.id.indexOf('LineString') === -1) ? this.highlightSettings.border.color : (this.highlightSettings.fill || this.highlightSettings.border.color),
160
163
  width: (targetEle.parentElement.id.indexOf('LineString') === -1) ? (this.highlightSettings.border.width / (isMarkerSelect ? 1 : this.maps.scale)) : (this.highlightSettings.border.width / this.maps.scale),
161
164
  opacity: this.highlightSettings.border.opacity
162
165
  };
@@ -48,8 +48,12 @@ var Selection = /** @class */ (function () {
48
48
  var layerIndex = parseInt(targetElement.id.split('_LayerIndex_')[1].split('_')[0], 10);
49
49
  if (targetElement.id.indexOf('shapeIndex') > -1) {
50
50
  shapeIndex = parseInt(targetElement.id.split('_shapeIndex_')[1].split('_')[0], 10);
51
- shapeData = this.maps.layers[layerIndex].shapeData['features']['length'] > shapeIndex ?
52
- this.maps.layers[layerIndex].shapeData['features'][shapeIndex]['properties'] : null;
51
+ shapeData = !isNullOrUndefined(this.maps.layers[layerIndex].shapeData['features'])
52
+ && this.maps.layers[layerIndex].shapeData['features']['length'] > shapeIndex ?
53
+ this.maps.layers[layerIndex].shapeData['features'][shapeIndex]['properties'] :
54
+ !isNullOrUndefined(this.maps.layers[layerIndex].shapeData['geometries'])
55
+ && this.maps.layers[layerIndex].shapeData['geometries']['length'] > shapeIndex ?
56
+ this.maps.layers[layerIndex].shapeData['geometries'][shapeIndex]['properties'] : null;
53
57
  dataIndex = parseInt(targetElement.id.split('_dataIndex_')[1].split('_')[0], 10);
54
58
  data = isNullOrUndefined(dataIndex) ? null : this.maps.layers[layerIndex].dataSource[dataIndex];
55
59
  this.selectionsettings = this.maps.layers[layerIndex].selectionSettings;
@@ -133,15 +137,17 @@ var Selection = /** @class */ (function () {
133
137
  var parentElement;
134
138
  var children;
135
139
  var selectionClass;
140
+ var isLineStringShape = targetElement.parentElement.id.indexOf('LineString') > -1;
136
141
  var selectionsettings = this.selectionsettings;
137
142
  var border = {
138
- color: (targetElement.parentElement.id.indexOf('LineString') === -1) ? this.selectionsettings.border.color : (this.selectionsettings.border.color || this.selectionsettings.fill),
139
- 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),
143
+ color: isLineStringShape ? (this.selectionsettings.fill || this.selectionsettings.border.color) : this.selectionsettings.border.color,
144
+ width: isLineStringShape ? (this.selectionsettings.border.width / this.maps.scale) :
145
+ (this.selectionsettings.border.width / (this.selectionType === 'Marker' ? 1 : this.maps.scale)),
140
146
  opacity: this.selectionsettings.border.opacity
141
147
  };
142
148
  var eventArgs = {
143
149
  opacity: this.selectionsettings.opacity,
144
- fill: (targetElement.parentElement.id.indexOf('LineString') === -1) ? (this.selectionType !== 'navigationline' ? this.selectionsettings.fill : 'none') : 'transparent',
150
+ fill: isLineStringShape ? 'transparent' : (this.selectionType !== 'navigationline' ? this.selectionsettings.fill : 'none'),
145
151
  border: border,
146
152
  name: itemSelection,
147
153
  target: targetElement.id,
@@ -153,7 +159,8 @@ var Selection = /** @class */ (function () {
153
159
  this.maps.trigger('itemSelection', eventArgs, function (observedArgs) {
154
160
  eventArgs.border.opacity = isNullOrUndefined(_this.selectionsettings.border.opacity) ? _this.selectionsettings.opacity : _this.selectionsettings.border.opacity;
155
161
  if (!eventArgs.cancel) {
156
- if (targetElement.getAttribute('class') === _this.selectionType + 'selectionMapStyle') {
162
+ if (targetElement.getAttribute('class') === _this.selectionType + 'selectionMapStyle'
163
+ || targetElement.getAttribute('class') === 'LineselectionMapStyle') {
157
164
  removeClass(targetElement);
158
165
  _this.removedSelectionList(targetElement);
159
166
  for (var m = 0; m < _this.maps.shapeSelectionItem.length; m++) {
@@ -172,7 +179,8 @@ var Selection = /** @class */ (function () {
172
179
  else {
173
180
  var layetElement = getElementByID(_this.maps.element.id + '_Layer_Collections');
174
181
  if (!_this.selectionsettings.enableMultiSelect &&
175
- layetElement.getElementsByClassName(_this.selectionType + 'selectionMapStyle').length > 0) {
182
+ (layetElement.getElementsByClassName(_this.selectionType + 'selectionMapStyle').length > 0 ||
183
+ layetElement.getElementsByClassName('LineselectionMapStyle').length > 0)) {
176
184
  var eleCount = layetElement.getElementsByClassName(_this.selectionType + 'selectionMapStyle').length;
177
185
  var ele = void 0;
178
186
  for (var k = 0; k < eleCount; k++) {
@@ -180,6 +188,14 @@ var Selection = /** @class */ (function () {
180
188
  removeClass(ele);
181
189
  _this.removedSelectionList(ele);
182
190
  }
191
+ if (layetElement.getElementsByClassName('LineselectionMapStyle').length > 0) {
192
+ eleCount = layetElement.getElementsByClassName('LineselectionMapStyle').length;
193
+ for (var k = 0; k < eleCount; k++) {
194
+ ele = layetElement.getElementsByClassName('LineselectionMapStyle')[0];
195
+ removeClass(ele);
196
+ _this.removedSelectionList(ele);
197
+ }
198
+ }
183
199
  if (_this.selectionType === 'Shape') {
184
200
  _this.maps.shapeSelectionItem = [];
185
201
  var selectionLength = _this.maps.selectedElementId.length;
@@ -197,13 +213,24 @@ var Selection = /** @class */ (function () {
197
213
  ele.setAttribute('stroke', _this.maps.layers[layerIndex_2].navigationLineSettings[index].color);
198
214
  }
199
215
  }
200
- if (!getElement(_this.selectionType + 'selectionMap')) {
201
- document.body.appendChild(createStyle(_this.selectionType + 'selectionMap', _this.selectionType + 'selectionMapStyle', eventArgs));
216
+ if (!isLineStringShape) {
217
+ if (!getElement(_this.selectionType + 'selectionMap')) {
218
+ document.body.appendChild(createStyle(_this.selectionType + 'selectionMap', _this.selectionType + 'selectionMapStyle', eventArgs));
219
+ }
220
+ else {
221
+ customizeStyle(_this.selectionType + 'selectionMap', _this.selectionType + 'selectionMapStyle', eventArgs);
222
+ }
223
+ targetElement.setAttribute('class', _this.selectionType + 'selectionMapStyle');
202
224
  }
203
225
  else {
204
- customizeStyle(_this.selectionType + 'selectionMap', _this.selectionType + 'selectionMapStyle', eventArgs);
226
+ if (!getElement('LineselectionMap')) {
227
+ document.body.appendChild(createStyle('LineselectionMap', 'LineselectionMapStyle', eventArgs));
228
+ }
229
+ else {
230
+ customizeStyle('LineselectionMap', 'LineselectionMapStyle', eventArgs);
231
+ }
232
+ targetElement.setAttribute('class', 'LineselectionMapStyle');
205
233
  }
206
- targetElement.setAttribute('class', _this.selectionType + 'selectionMapStyle');
207
234
  if (targetElement.getAttribute('class') === 'ShapeselectionMapStyle') {
208
235
  _this.maps.shapeSelectionClass = getElement(_this.selectionType + 'selectionMap');
209
236
  _this.maps.selectedElementId.push(targetElement.getAttribute('id'));
@@ -44,7 +44,6 @@ export declare class Zoom {
44
44
  private lastScale;
45
45
  private pinchFactor;
46
46
  private startTouches;
47
- private shapeZoomLocation;
48
47
  private zoomshapewidth;
49
48
  private index;
50
49
  intersect: any[];
@@ -69,6 +68,7 @@ export declare class Zoom {
69
68
  * @returns {void}
70
69
  */
71
70
  performZooming(position: Point, newZoomFactor: number, type: string): void;
71
+ private calculateInitalZoomTranslatePoint;
72
72
  private triggerZoomEvent;
73
73
  private getTileTranslatePosition;
74
74
  performRectZooming(): void;