@syncfusion/ej2-maps 20.3.49 → 20.3.56

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 20.3.49
3
+ * version : 20.3.56
4
4
  * Copyright Syncfusion Inc. 2001 - 2020. All rights reserved.
5
5
  * Use of this code is subject to the terms of our license.
6
6
  * A copy of the current license can be obtained at any time by e-mailing
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "_from": "@syncfusion/ej2-maps@*",
3
- "_id": "@syncfusion/ej2-maps@20.3.47",
3
+ "_id": "@syncfusion/ej2-maps@20.3.49",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-eM35NIkNhSwH73EarJVxZ5M1ED2F/t7BB23UD1Tgy9/ynEFhpFRlmRzT/YeiqlXgXJZLVW5DdwoUsc2w89TMBg==",
5
+ "_integrity": "sha512-6E8vnqs8aaMMU+TS8C7Gw+96rLQSKqZSKhX6Z61wZ45NoMjVid40BNsXSs5qrjsOMut8sTLuU59XgX54LYwUFg==",
6
6
  "_location": "/@syncfusion/ej2-maps",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -23,10 +23,10 @@
23
23
  "/@syncfusion/ej2-react-maps",
24
24
  "/@syncfusion/ej2-vue-maps"
25
25
  ],
26
- "_resolved": "http://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-maps/-/ej2-maps-20.3.47.tgz",
27
- "_shasum": "4368a4fe57801d7161bf61ac79f29fd3f05156ea",
26
+ "_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-maps/-/ej2-maps-20.3.49.tgz",
27
+ "_shasum": "9e978cff12c0f29b51d2eddec927f0f1f7f94e85",
28
28
  "_spec": "@syncfusion/ej2-maps@*",
29
- "_where": "/jenkins/workspace/automation_release_19.1.0.1-ZPMUBNQ6AUYH6YGEFBPVYMEQLRRW2SLD4XCZ6GATNZJFYJ3RIAOA/packages/included",
29
+ "_where": "/jenkins/workspace/ease-automation_release_19.1.0.1/packages/included",
30
30
  "author": {
31
31
  "name": "Syncfusion Inc."
32
32
  },
@@ -35,13 +35,13 @@
35
35
  },
36
36
  "bundleDependencies": false,
37
37
  "dependencies": {
38
- "@syncfusion/ej2-base": "~20.3.49",
39
- "@syncfusion/ej2-buttons": "~20.3.49",
40
- "@syncfusion/ej2-compression": "~20.3.47",
41
- "@syncfusion/ej2-data": "~20.3.47",
42
- "@syncfusion/ej2-file-utils": "~20.3.47",
43
- "@syncfusion/ej2-pdf-export": "~20.3.47",
44
- "@syncfusion/ej2-svg-base": "~20.3.47"
38
+ "@syncfusion/ej2-base": "~20.3.56",
39
+ "@syncfusion/ej2-buttons": "~20.3.56",
40
+ "@syncfusion/ej2-compression": "~20.3.56",
41
+ "@syncfusion/ej2-data": "~20.3.56",
42
+ "@syncfusion/ej2-file-utils": "~20.3.56",
43
+ "@syncfusion/ej2-pdf-export": "~20.3.56",
44
+ "@syncfusion/ej2-svg-base": "~20.3.56"
45
45
  },
46
46
  "deprecated": false,
47
47
  "description": "The Maps component is used to visualize the geographical data and represent the statistical data of a particular geographical area on earth with user interactivity, and provides various customizing options",
@@ -80,6 +80,6 @@
80
80
  "url": "git+https://github.com/syncfusion/ej2-javascript-ui-controls.git"
81
81
  },
82
82
  "typings": "index.d.ts",
83
- "version": "20.3.49",
83
+ "version": "20.3.56",
84
84
  "sideEffects": false
85
85
  }
@@ -249,8 +249,14 @@ var DataLabel = /** @class */ (function () {
249
249
  datasrcObj : shapeData['properties'], _this.maps, eventargs_1.template, _this.maps.element.id + '_LabelTemplate', false) : document.createElement('div');
250
250
  templateElement.innerHTML = !templateFn ? eventargs_1.template : '';
251
251
  labelElement = convertElementFromLabel(templateElement, labelId, !isNullOrUndefined(datasrcObj) ? datasrcObj : shapeData['properties'], index, _this.maps);
252
- labelElement.style.left = ((Math.abs(_this.maps.baseMapRectBounds['min']['x'] - location['x'])) * scale) + labelArgs.offsetX + 'px';
253
- labelElement.style.top = ((Math.abs(_this.maps.baseMapRectBounds['min']['y'] - location['y'])) * scale) + labelArgs.offsetY + 'px';
252
+ if (_this.maps.isTileMap) {
253
+ labelElement.style.left = (((location['x'] + transPoint['x']) * scale) - (textSize['width'] / 2)) + 'px';
254
+ labelElement.style.top = (((location['y'] + transPoint['y']) * scale) - textSize['height']) + 'px';
255
+ }
256
+ else {
257
+ labelElement.style.left = ((Math.abs(_this.maps.baseMapRectBounds['min']['x'] - location['x'])) * scale) + labelArgs.offsetX + 'px';
258
+ labelElement.style.top = ((Math.abs(_this.maps.baseMapRectBounds['min']['y'] - location['y'])) * scale) + labelArgs.offsetY + 'px';
259
+ }
254
260
  labelTemplateElement.appendChild(labelElement);
255
261
  }
256
262
  else {
@@ -35,10 +35,10 @@ var LayerPanel = /** @class */ (function () {
35
35
  height: areaRect.height
36
36
  });
37
37
  var parentElement = createElement('div', {
38
- id: this.mapObject.element.id + '_Tile_SVG_Parent', styles: 'position: absolute; height: ' +
39
- (areaRect.height) + 'px; width: '
40
- + (areaRect.width) + 'px;'
38
+ id: this.mapObject.element.id + '_Tile_SVG_Parent'
41
39
  });
40
+ parentElement.style.cssText = 'position: absolute; height: ' + (areaRect.height) + 'px; width: ' +
41
+ (areaRect.width) + 'px;';
42
42
  parentElement.appendChild(this.tileSvgObject);
43
43
  secondaryEle.appendChild(parentElement);
44
44
  }
@@ -92,13 +92,13 @@ var LayerPanel = /** @class */ (function () {
92
92
  (!isNullOrUndefined(panel.mapObject.tileZoomLevel) && panel.mapObject.tileZoomLevel !== 1)) ?
93
93
  false : true;
94
94
  if (isNullOrUndefined(panel.mapObject.previousCenterLatitude) &&
95
- isNullOrUndefined(panel.mapObject.previousCenterLongitude)) {
95
+ isNullOrUndefined(panel.mapObject.previousCenterLongitude) && !panel.mapObject.isZoomByPosition) {
96
96
  panel.mapObject.previousCenterLatitude = panel.mapObject.centerPosition.latitude;
97
97
  panel.mapObject.previousCenterLongitude = panel.mapObject.centerPosition.longitude;
98
98
  }
99
- else if (panel.mapObject.previousCenterLatitude !==
99
+ else if ((panel.mapObject.previousCenterLatitude !==
100
100
  panel.mapObject.centerPosition.latitude && panel.mapObject.previousCenterLongitude !==
101
- panel.mapObject.centerPosition.longitude) {
101
+ panel.mapObject.centerPosition.longitude) || panel.mapObject.isZoomByPosition) {
102
102
  panel.mapObject.centerPositionChanged = true;
103
103
  panel.mapObject.previousCenterLatitude = panel.mapObject.centerPosition.latitude;
104
104
  panel.mapObject.previousCenterLongitude = panel.mapObject.centerPosition.longitude;
@@ -110,7 +110,8 @@ var LayerPanel = /** @class */ (function () {
110
110
  var centerTileMap = center;
111
111
  if ((this.mapObject.isTileMap && panel.mapObject.markerModule) && panel.mapObject.zoomSettings.enable) {
112
112
  panel.mapObject.markerModule.calculateZoomCenterPositionAndFactor(this.mapObject.layersCollection);
113
- if (!isNullOrUndefined(this.mapObject.markerCenterLatitude) && !isNullOrUndefined(this.mapObject.markerCenterLongitude)) {
113
+ if (!isNullOrUndefined(this.mapObject.markerCenterLatitude) && !isNullOrUndefined(this.mapObject.markerCenterLongitude)
114
+ && !panel.mapObject.isZoomByPosition) {
114
115
  centerTileMap = new Point(panel.mapObject.markerCenterLongitude, panel.mapObject.markerCenterLatitude);
115
116
  }
116
117
  }
@@ -126,7 +127,7 @@ var LayerPanel = /** @class */ (function () {
126
127
  else {
127
128
  center = { x: null, y: null };
128
129
  }
129
- var zoomFactorValue = panel.mapObject.zoomSettings.shouldZoomInitially ?
130
+ var zoomFactorValue = (panel.mapObject.zoomSettings.shouldZoomInitially && !panel.mapObject.isZoomByPosition) ?
130
131
  isNullOrUndefined(panel.mapObject.markerZoomFactor) ? 1 :
131
132
  panel.mapObject.markerZoomFactor : panel.mapObject.zoomSettings.zoomFactor;
132
133
  zoomFactorValue = (panel.mapObject.enablePersistence) ? ((isNullOrUndefined(panel.mapObject.mapScaleValue))
@@ -382,13 +383,13 @@ var LayerPanel = /** @class */ (function () {
382
383
  var colors = shapeSettings.palette.length > 1 ? shapeSettings.palette : getShapeColor(this.mapObject.theme);
383
384
  var labelTemplateEle = createElement('div', {
384
385
  id: this.mapObject.element.id + '_LayerIndex_' + layerIndex + '_Label_Template_Group',
385
- className: this.mapObject.element.id + '_template',
386
- styles: 'pointer-events: none; overflow: hidden; position: absolute;' +
387
- 'top:' + this.mapObject.mapAreaRect.y + 'px;' +
388
- 'left:' + this.mapObject.mapAreaRect.x + 'px;' +
389
- 'height:' + this.mapObject.mapAreaRect.height + 'px;' +
390
- 'width:' + this.mapObject.mapAreaRect.width + 'px;'
386
+ className: this.mapObject.element.id + '_template'
391
387
  });
388
+ labelTemplateEle.style.cssText = 'pointer-events: none; overflow: hidden; position: absolute;' +
389
+ 'top:' + this.mapObject.mapAreaRect.y + 'px;' +
390
+ 'left:' + this.mapObject.mapAreaRect.x + 'px;' +
391
+ 'height:' + this.mapObject.mapAreaRect.height + 'px;' +
392
+ 'width:' + this.mapObject.mapAreaRect.width + 'px;';
392
393
  if (this.currentLayer.layerData.length !== 0) {
393
394
  var _loop_1 = function (i) {
394
395
  var k = void 0;
@@ -623,10 +624,10 @@ var LayerPanel = /** @class */ (function () {
623
624
  }
624
625
  pathEle.setAttribute('aria-label', ((!isNullOrUndefined(currentShapeData['property'])) ?
625
626
  (currentShapeData['property'][properties]) : ''));
626
- pathEle.setAttribute('tabindex', (this.mapObject.tabIndex + index + 3).toString());
627
+ pathEle.tabIndex = this.mapObject.tabIndex + index + 3;
627
628
  pathEle.setAttribute('role', '');
628
629
  if (drawingType === 'LineString' || drawingType === 'MultiLineString') {
629
- pathEle.setAttribute('style', 'outline:none');
630
+ pathEle.style.cssText = 'outline:none';
630
631
  }
631
632
  maintainSelection(this.mapObject.selectedElementId, this.mapObject.shapeSelectionClass, pathEle, 'ShapeselectionMapStyle');
632
633
  if (this.mapObject.toggledShapeElementId) {
@@ -685,9 +686,9 @@ var LayerPanel = /** @class */ (function () {
685
686
  this.mapObject.markerModule.calculateZoomCenterPositionAndFactor(this.mapObject.layersCollection);
686
687
  }
687
688
  var group = (this.mapObject.renderer.createGroup({
688
- id: this.mapObject.element.id + '_LayerIndex_' + layerIndex + '_dataLableIndex_Group',
689
- style: 'pointer-events: none;'
689
+ id: this.mapObject.element.id + '_LayerIndex_' + layerIndex + '_dataLableIndex_Group'
690
690
  }));
691
+ group.style.pointerEvents = 'none';
691
692
  if (this.mapObject.dataLabelModule && this.currentLayer.dataLabelSettings.visible) {
692
693
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
693
694
  var intersect_1 = [];
@@ -1209,7 +1210,8 @@ var LayerPanel = /** @class */ (function () {
1209
1210
  }
1210
1211
  }
1211
1212
  }
1212
- if (this.mapObject.previousScale !== this.mapObject.scale || this.mapObject.isReset) {
1213
+ if (this.mapObject.previousScale !== this.mapObject.scale || this.mapObject.isReset || this.mapObject.isZoomByPosition
1214
+ || this.mapObject.zoomNotApplied) {
1213
1215
  this.arrangeTiles(zoomType, this.animateToZoomX, this.animateToZoomY);
1214
1216
  }
1215
1217
  };
@@ -543,14 +543,14 @@ var Legend = /** @class */ (function () {
543
543
  leftPageElement.appendChild(render.drawPath(leftPageOptions));
544
544
  var leftRectPageOptions = new RectOption(map.element.id + '_Left_Page_Rect', 'transparent', {}, 1, new Rect(leftPageX - (width / 2), (locY - (height * 2)), width * 2, spacing * 2), null, null, '', '');
545
545
  var pathEle = render.drawRectangle(leftRectPageOptions);
546
- pathEle.setAttribute('tabindex', ((page + 1) === 1 ? -1 : map.tabIndex + 1).toString());
546
+ pathEle.tabIndex = (page + 1) === 1 ? -1 : (map.tabIndex + 1);
547
547
  leftPageElement.appendChild(pathEle);
548
548
  this.wireEvents(leftPageElement);
549
549
  var rightPageOptions = new PathOption(map.element.id + '_Right_Page', '#a6a6a6', 0, '#a6a6a6', ((page + 1) === this.totalPages.length ? 0.5 : 1), 1, '', rightPath);
550
550
  rightPageElement.appendChild(render.drawPath(rightPageOptions));
551
551
  var rightRectPageOptions = new RectOption(map.element.id + '_Right_Page_Rect', 'transparent', {}, 1, new Rect(rightPageX - spacing - (width / 2), (locY - (height * 2)), width * 2, spacing * 2), null, null, '', '');
552
552
  pathEle = render.drawRectangle(rightRectPageOptions);
553
- pathEle.setAttribute('tabindex', ((page + 1) === this.totalPages.length ? -1 : map.tabIndex + 2).toString());
553
+ pathEle.tabIndex = (page + 1) === this.totalPages.length ? -1 : (map.tabIndex + 2);
554
554
  rightPageElement.appendChild(pathEle);
555
555
  this.wireEvents(rightPageElement);
556
556
  pagingGroup.appendChild(leftPageElement);
@@ -571,7 +571,7 @@ var Legend = /** @class */ (function () {
571
571
  'dominant-baseline': ''
572
572
  };
573
573
  var pagingTextElement = render.createText(pageTextOptions, pagingText);
574
- pagingTextElement.setAttribute('style', 'user-select: none;');
574
+ pagingTextElement.style.cssText = 'user-select: none;';
575
575
  pagingGroup.appendChild(pagingTextElement);
576
576
  this.legendGroup.appendChild(pagingGroup);
577
577
  }
@@ -705,11 +705,14 @@ var Legend = /** @class */ (function () {
705
705
  this.legendHighlightCollection[length - 1]['MapShapeCollection']['Elements'].push(shapeElement);
706
706
  var shapeItemCount = this.legendHighlightCollection[length - 1]['MapShapeCollection']['Elements'].length - 1;
707
707
  var shapeOldFillColor = shapeElement.getAttribute('fill');
708
+ var shapeOldOpacity = shapeElement.getAttribute('fill-opacity');
708
709
  this.legendHighlightCollection[length - 1]['shapeOldFillColor'].push(shapeOldFillColor);
710
+ this.legendHighlightCollection[length - 1]['shapeOldOpacity'] = shapeOldOpacity;
709
711
  var shapeOldColor = this.legendHighlightCollection[length - 1]['shapeOldFillColor'][shapeItemCount];
712
+ var shapeOldFillOpacity = this.legendHighlightCollection[length - 1]['shapeOldOpacity'];
710
713
  this.shapePreviousColor = this.legendHighlightCollection[length - 1]['shapeOldFillColor'];
711
- this.setColor(shapeElement, !isNullOrUndefined(module.fill) ? module.fill : shapeOldColor, module.opacity.toString(), module.border.color, module.border.width.toString(), 'highlight');
712
- this.setColor(targetElement, !isNullOrUndefined(module.fill) ? module.fill : legendHighlightColor, module.opacity.toString(), module.border.color, module.border.width.toString(), 'highlight');
714
+ this.setColor(shapeElement, !isNullOrUndefined(module.fill) ? module.fill : shapeOldColor, isNullOrUndefined(module.opacity) ? shapeOldFillOpacity : module.opacity.toString(), module.border.color, module.border.width.toString(), 'highlight');
715
+ this.setColor(targetElement, !isNullOrUndefined(module.fill) ? module.fill : legendHighlightColor, isNullOrUndefined(module.opacity) ? shapeOldFillOpacity : module.opacity.toString(), module.border.color, module.border.width.toString(), 'highlight');
713
716
  }
714
717
  else if (value === 'selection') {
715
718
  this.legendHighlightCollection = [];
@@ -774,6 +777,7 @@ var Legend = /** @class */ (function () {
774
777
  var length = collection.length;
775
778
  collection[length - 1]['MapShapeCollection'] = { Elements: [] };
776
779
  collection[length - 1]['shapeOldFillColor'] = [];
780
+ collection[length - 1]['shapeOldOpacity'] = null;
777
781
  };
778
782
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
779
783
  Legend.prototype.removeLegend = function (collection) {
@@ -785,7 +789,8 @@ var Legend = /** @class */ (function () {
785
789
  for (var j = 0; j < dataCount; j++) {
786
790
  var shapeFillColor = item['legendOldFill'].indexOf('url') !== -1
787
791
  ? item['shapeOldFillColor'][j] : item['legendOldFill'];
788
- this.setColor(item['MapShapeCollection']['Elements'][j], shapeFillColor, item['shapeOpacity'], item['shapeOldBorderColor'], item['shapeOldBorderWidth'], 'highlight');
792
+ var shapeOpacity = !isNullOrUndefined(item['shapeOldOpacity']) ? item['shapeOldOpacity'] : item['shapeOpacity'];
793
+ this.setColor(item['MapShapeCollection']['Elements'][j], shapeFillColor, shapeOpacity, item['shapeOldBorderColor'], item['shapeOldBorderWidth'], 'highlight');
789
794
  }
790
795
  }
791
796
  };
@@ -23,18 +23,18 @@ var Marker = /** @class */ (function () {
23
23
  var currentLayer = maps.layersCollection[layerIndex];
24
24
  this.markerSVGObject = maps.renderer.createGroup({
25
25
  id: maps.element.id + '_Markers_Group',
26
- class: 'GroupElement',
27
- style: 'pointer-events: auto;'
26
+ class: 'GroupElement'
28
27
  });
28
+ this.markerSVGObject.style.pointerEvents = 'auto';
29
29
  var markerTemplateEle = createElement('div', {
30
30
  id: maps.element.id + '_LayerIndex_' + layerIndex + '_Markers_Template_Group',
31
- className: maps.element.id + '_template',
32
- styles: 'overflow: hidden; position: absolute;pointer-events: none;' +
33
- 'top:' + maps.mapAreaRect.y + 'px;' +
34
- 'left:' + maps.mapAreaRect.x + 'px;' +
35
- 'height:' + maps.mapAreaRect.height + 'px;' +
36
- 'width:' + maps.mapAreaRect.width + 'px;'
31
+ className: maps.element.id + '_template'
37
32
  });
33
+ markerTemplateEle.style.cssText = 'overflow: hidden; position: absolute;pointer-events: none;' +
34
+ 'top:' + maps.mapAreaRect.y + 'px;' +
35
+ 'left:' + maps.mapAreaRect.x + 'px;' +
36
+ 'height:' + maps.mapAreaRect.height + 'px;' +
37
+ 'width:' + maps.mapAreaRect.width + 'px;';
38
38
  currentLayer.markerSettings.map(function (markerSettings, markerIndex) {
39
39
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
40
40
  var markerData = markerSettings.dataSource;
@@ -254,7 +254,8 @@ var Marker = /** @class */ (function () {
254
254
  }
255
255
  if (this.maps.isTileMap && !this.maps.enablePersistence
256
256
  && this.maps.mapScaleValue <= 1) {
257
- this.maps.tileZoomLevel = this.maps.mapScaleValue === 0 ? 1 : this.maps.mapScaleValue;
257
+ this.maps.tileZoomLevel = this.maps.mapScaleValue === 0 ? (this.maps.isZoomByPosition ? this.maps.tileZoomLevel : 1)
258
+ : this.maps.mapScaleValue;
258
259
  if (this.maps.mapScaleValue === 1 && this.maps.markerZoomFactor === 1) {
259
260
  this.maps.tileTranslatePoint.x = 0;
260
261
  this.maps.tileTranslatePoint.y = 0;
@@ -402,7 +403,7 @@ var Marker = /** @class */ (function () {
402
403
  }
403
404
  var options = this.getMarker(targetId);
404
405
  if (this.maps.markerClusterExpand) {
405
- e.target.setAttribute('style', 'cursor: pointer');
406
+ e.target.style.cursor = 'pointer';
406
407
  }
407
408
  if (isNullOrUndefined(options)) {
408
409
  return;
@@ -80,51 +80,49 @@ var NavigationLine = /** @class */ (function () {
80
80
  direction = 0;
81
81
  }
82
82
  }
83
- if (point[j]['x'] !== point[j + 1]['x']) {
84
- if (showArrow) {
85
- arrowColor = arrowSettings['properties']['color'];
86
- arrowSize = arrowSettings['properties']['size'];
87
- offSetValue = (arrowSettings['properties']['offSet'] === undefined) ? 0 : arrowSettings['properties']['offSet'];
88
- var divide = (Math.round(arrowSize / 2));
89
- arrowPosition = arrowSettings['properties']['position'];
90
- startArrow = (arrowPosition === 'Start') ? 'url(#triangle' + i + ')' : null;
91
- endArrow = (arrowPosition === 'End') ? 'url(#triangle' + i + ')' : null;
92
- if (offSet !== 0 && angle === 0) {
93
- offSet = (arrowPosition === 'Start') ? offSetValue : -(offSetValue);
94
- }
95
- offSet = (isNullOrUndefined(offSet)) ? 0 : offSet;
96
- var triId = this.maps.element.id + '_triangle';
97
- var defElement = this.maps.renderer.createDefs();
98
- defElement.innerHTML += '<marker id="' + 'triangle' + i + '"></marker>';
99
- var markerEle = defElement.querySelector('#' + 'triangle' + i);
100
- markerEle.setAttribute('markerWidth', (arrowSize.toString()));
101
- markerEle.setAttribute('markerHeight', (arrowSize.toString()));
102
- markerEle.setAttribute('refX', (divide - offSet).toString());
103
- markerEle.setAttribute('refY', divide.toString());
104
- markerEle.setAttribute('orient', 'auto');
105
- var d2 = 'M 0,0 L 0,' + arrowSize + ' L ' + divide + ', ' + divide + ' Z';
106
- pathOption = new PathOption(triId, arrowColor, width, color, 1, 1, dashArray, d2);
107
- navigationEle = this.maps.renderer.drawPath(pathOption);
108
- markerEle.appendChild(navigationEle);
109
- defElement.appendChild(markerEle);
110
- navigationGroup.appendChild(defElement);
83
+ if (showArrow) {
84
+ arrowColor = arrowSettings['properties']['color'];
85
+ arrowSize = arrowSettings['properties']['size'];
86
+ offSetValue = (arrowSettings['properties']['offSet'] === undefined) ? 0 : arrowSettings['properties']['offSet'];
87
+ var divide = (Math.round(arrowSize / 2));
88
+ arrowPosition = arrowSettings['properties']['position'];
89
+ startArrow = (arrowPosition === 'Start') ? 'url(#triangle' + i + ')' : null;
90
+ endArrow = (arrowPosition === 'End') ? 'url(#triangle' + i + ')' : null;
91
+ if (offSet !== 0 && angle === 0) {
92
+ offSet = (arrowPosition === 'Start') ? offSetValue : -(offSetValue);
111
93
  }
112
- angle = Math.abs(angle);
113
- d = (angle === 0) ? 'M ' + point[j]['x'] + ',' + point[j]['y'] + 'L ' + point[j + 1]['x']
114
- + ',' + point[j + 1]['y'] + ' ' :
115
- 'M ' + point[j]['x'] + ',' + point[j]['y'] + ' A ' + (radius / 2 + (1 - angle) * radius / (angle * 10)) +
116
- ' ' + (radius / 2 + (1 - angle) * radius / (angle * 10)) + ' ' + 0 + ',' + 0 + ','
117
- + direction + ' , ' + point[j + 1]['x'] + ',' + point[j + 1]['y'] + ' ';
118
- pathOption = new PathOption(arcId, 'none', width, color, 1, 1, dashArray, d);
94
+ offSet = (isNullOrUndefined(offSet)) ? 0 : offSet;
95
+ var triId = this.maps.element.id + '_triangle';
96
+ var defElement = this.maps.renderer.createDefs();
97
+ defElement.innerHTML += '<marker id="' + 'triangle' + i + '"></marker>';
98
+ var markerEle = defElement.querySelector('#' + 'triangle' + i);
99
+ markerEle.setAttribute('markerWidth', (arrowSize.toString()));
100
+ markerEle.setAttribute('markerHeight', (arrowSize.toString()));
101
+ markerEle.setAttribute('refX', (divide - offSet).toString());
102
+ markerEle.setAttribute('refY', divide.toString());
103
+ markerEle.setAttribute('orient', 'auto');
104
+ var d2 = 'M 0,0 L 0,' + arrowSize + ' L ' + divide + ', ' + divide + ' Z';
105
+ pathOption = new PathOption(triId, arrowColor, width, color, 1, 1, dashArray, d2);
119
106
  navigationEle = this.maps.renderer.drawPath(pathOption);
120
- if (!isNullOrUndefined(arrowPosition)) {
121
- var position = (arrowPosition === 'Start') ? navigationEle.setAttribute('marker-start', startArrow)
122
- : navigationEle.setAttribute('marker-end', endArrow);
123
- }
124
- maintainSelection(this.maps.selectedNavigationElementId, this.maps.navigationSelectionClass, navigationEle, 'navigationlineselectionMapStyle');
125
- navigationGroup.appendChild(navigationEle);
126
- group.appendChild(navigationGroup);
107
+ markerEle.appendChild(navigationEle);
108
+ defElement.appendChild(markerEle);
109
+ navigationGroup.appendChild(defElement);
110
+ }
111
+ angle = Math.abs(angle);
112
+ d = (angle === 0) ? 'M ' + point[j]['x'] + ',' + point[j]['y'] + 'L ' + point[j + 1]['x']
113
+ + ',' + point[j + 1]['y'] + ' ' :
114
+ 'M ' + point[j]['x'] + ',' + point[j]['y'] + ' A ' + (radius / 2 + (1 - angle) * radius / (angle * 10)) +
115
+ ' ' + (radius / 2 + (1 - angle) * radius / (angle * 10)) + ' ' + 0 + ',' + 0 + ','
116
+ + direction + ' , ' + point[j + 1]['x'] + ',' + point[j + 1]['y'] + ' ';
117
+ pathOption = new PathOption(arcId, 'none', width, color, 1, 1, dashArray, d);
118
+ navigationEle = this.maps.renderer.drawPath(pathOption);
119
+ if (!isNullOrUndefined(arrowPosition)) {
120
+ var position = (arrowPosition === 'Start') ? navigationEle.setAttribute('marker-start', startArrow)
121
+ : navigationEle.setAttribute('marker-end', endArrow);
127
122
  }
123
+ maintainSelection(this.maps.selectedNavigationElementId, this.maps.navigationSelectionClass, navigationEle, 'navigationlineselectionMapStyle');
124
+ navigationGroup.appendChild(navigationEle);
125
+ group.appendChild(navigationGroup);
128
126
  }
129
127
  point = [];
130
128
  }
@@ -582,6 +582,8 @@ export declare class Maps extends Component<HTMLElement> implements INotifyPrope
582
582
  /** @private */
583
583
  tileZoomLevel: number;
584
584
  /** @private */
585
+ isZoomByPosition: boolean;
586
+ /** @private */
585
587
  tileZoomScale: number;
586
588
  /** @private */
587
589
  staticMapZoom: number;
package/src/maps/maps.js CHANGED
@@ -37,10 +37,9 @@ import { LayerSettings, TitleSettings, Border, Margin, MapsAreaSettings, Annotat
37
37
  import { Marker } from './layers/marker';
38
38
  import { load, click, onclick, loaded, doubleClick, resize, shapeSelected, zoomIn } from './model/constants';
39
39
  import { getThemeStyle, Theme } from './model/theme';
40
- import { BingMap } from './layers/bing-map';
41
40
  import { LayerPanel } from './layers/layer-panel';
42
41
  import { Rect, RectOption, measureText, getElementByID, MapAjax, processResult, getElementsByClassName } from '../maps/utils/helper';
43
- import { findPosition, textTrim, TextOption, renderTextElement, convertGeoToPoint, calculateZoomLevel } from '../maps/utils/helper';
42
+ import { findPosition, textTrim, TextOption, renderTextElement, calculateZoomLevel } from '../maps/utils/helper';
44
43
  import { Annotations } from '../maps/user-interaction/annotation';
45
44
  import { MarkerSettings } from './index';
46
45
  import { changeBorderWidth } from './index';
@@ -488,7 +487,9 @@ var Maps = /** @class */ (function (_super) {
488
487
  }
489
488
  }
490
489
  this.zoomingChange();
491
- this.trigger(loaded, { maps: this, isResized: this.isResize });
490
+ if (!this.isZoomByPosition && !this.zoomNotApplied) {
491
+ this.trigger(loaded, { maps: this, isResized: this.isResize });
492
+ }
492
493
  this.isResize = false;
493
494
  };
494
495
  /**
@@ -582,7 +583,7 @@ var Maps = /** @class */ (function (_super) {
582
583
  Maps.prototype.addTabIndex = function () {
583
584
  this.element.setAttribute('aria-label', this.description || 'Maps Element');
584
585
  this.element.setAttribute('role', '');
585
- this.element.setAttribute('tabindex', this.tabIndex.toString());
586
+ this.element.tabIndex = this.tabIndex;
586
587
  };
587
588
  // private setSecondaryElementPosition(): void {
588
589
  // if (!this.isTileMap) {
@@ -645,7 +646,7 @@ var Maps = /** @class */ (function (_super) {
645
646
  }
646
647
  }
647
648
  }
648
- if (this.zoomModule && (this.previousScale !== this.scale)) {
649
+ if (this.zoomModule && ((this.previousScale !== this.scale) || this.zoomNotApplied || this.isZoomByPosition)) {
649
650
  this.zoomModule.applyTransform(this, true);
650
651
  }
651
652
  }
@@ -653,9 +654,9 @@ var Maps = /** @class */ (function (_super) {
653
654
  Maps.prototype.createSecondaryElement = function () {
654
655
  if (isNullOrUndefined(document.getElementById(this.element.id + '_Secondary_Element'))) {
655
656
  var secondaryElement = createElement('div', {
656
- id: this.element.id + '_Secondary_Element',
657
- styles: 'position: absolute;z-index:2;'
657
+ id: this.element.id + '_Secondary_Element'
658
658
  });
659
+ secondaryElement.style.cssText = 'position: absolute;z-index:2;';
659
660
  this.element.appendChild(secondaryElement);
660
661
  }
661
662
  };
@@ -709,18 +710,20 @@ var Maps = /** @class */ (function (_super) {
709
710
  removeElement(this.element.id + '_tiles');
710
711
  removeElement('animated_tiles');
711
712
  var ele = createElement('div', {
712
- id: this.element.id + '_tile_parent', styles: 'position: absolute; left: ' +
713
- (this.mapAreaRect.x) + 'px; right: ' + (this.margin.right) + 'px; top: '
714
- + (this.mapAreaRect.y + padding) + 'px; height: ' +
715
- (this.mapAreaRect.height) + 'px; width: '
716
- + (this.mapAreaRect.width) + 'px; overflow: hidden;'
713
+ id: this.element.id + '_tile_parent'
717
714
  });
715
+ ele.style.cssText = 'position: absolute; left: ' +
716
+ (this.mapAreaRect.x) + 'px; right: ' + (this.margin.right) + 'px; top: '
717
+ + (this.mapAreaRect.y + padding) + 'px; height: ' +
718
+ (this.mapAreaRect.height) + 'px; width: '
719
+ + (this.mapAreaRect.width) + 'px; overflow: hidden;';
718
720
  var ele1 = createElement('div', {
719
- id: this.element.id + '_tiles', styles: 'position: absolute; left: ' +
720
- (this.mapAreaRect.x) + 'px; right: ' + (this.margin.right) + 'px; top: '
721
- + (this.mapAreaRect.y + padding) + 'px; height: ' + (this.mapAreaRect.height) + 'px; width: '
722
- + (this.mapAreaRect.width) + 'px; overflow: hidden;'
721
+ id: this.element.id + '_tiles'
723
722
  });
723
+ ele1.style.cssText = 'position: absolute; left: ' +
724
+ (this.mapAreaRect.x) + 'px; right: ' + (this.margin.right) + 'px; top: '
725
+ + (this.mapAreaRect.y + padding) + 'px; height: ' + (this.mapAreaRect.height) + 'px; width: '
726
+ + (this.mapAreaRect.width) + 'px; overflow: hidden;';
724
727
  this.element.appendChild(ele);
725
728
  this.element.appendChild(ele1);
726
729
  }
@@ -1208,9 +1211,6 @@ var Maps = /** @class */ (function (_super) {
1208
1211
  var markerModule = this.markerModule;
1209
1212
  if (element.id.indexOf('shapeIndex') > -1 || element.id.indexOf('Tile') > -1) {
1210
1213
  this.mergeCluster();
1211
- if (element.id.indexOf('shapeIndex') > -1) {
1212
- this.triggerShapeSelection(element);
1213
- }
1214
1214
  }
1215
1215
  if (markerModule) {
1216
1216
  markerModule.markerClick(e);
@@ -1399,32 +1399,30 @@ var Maps = /** @class */ (function (_super) {
1399
1399
  * @returns {void}
1400
1400
  */
1401
1401
  Maps.prototype.zoomByPosition = function (centerPosition, zoomFactor) {
1402
- var factor = this.mapLayerPanel.calculateFactor(this.layersCollection[0]);
1403
- var position;
1404
- var size = this.mapAreaRect;
1402
+ this.zoomNotApplied = false;
1403
+ var isRefresh = this.zoomSettings.zoomFactor == zoomFactor;
1405
1404
  if (!this.isTileMap && this.zoomModule) {
1406
1405
  if (!isNullOrUndefined(centerPosition)) {
1407
- position = convertGeoToPoint(centerPosition.latitude, centerPosition.longitude, factor, this.layersCollection[0], this);
1408
- var mapRect = document.getElementById(this.element.id + '_Layer_Collections').getBoundingClientRect();
1409
- var svgRect = this.svgObject.getBoundingClientRect();
1410
- var xDiff = Math.abs(mapRect.left - svgRect.left) / this.scale;
1411
- var yDiff = Math.abs(mapRect.top - svgRect.top) / this.scale;
1412
- var x = this.translatePoint.x + xDiff;
1413
- var y = this.translatePoint.y + yDiff;
1414
- this.scale = zoomFactor;
1415
- this.translatePoint.x = ((mapRect.left < svgRect.left ? x : 0) + (size.width / 2) - (position.x * zoomFactor)) / zoomFactor;
1416
- this.translatePoint.y = ((mapRect.top < svgRect.top ? y : 0) + (size.height / 2) - (position.y * zoomFactor)) / zoomFactor;
1417
- this.zoomModule.applyTransform(this);
1406
+ this.zoomSettings.zoomFactor = zoomFactor;
1407
+ isRefresh = this.centerPosition.latitude === centerPosition.latitude && this.centerPosition.longitude === centerPosition.longitude ? true : isRefresh;
1408
+ this.centerPosition = centerPosition;
1409
+ this.isZoomByPosition = true;
1410
+ this.mapScaleValue = null;
1418
1411
  }
1419
1412
  else {
1420
- position = { x: size.width / 2, y: size.height / 2 };
1421
- this.zoomModule.performZooming(position, zoomFactor, zoomFactor > this.scale ? 'ZoomIn' : 'ZoomOut');
1413
+ this.zoomSettings.zoomFactor = zoomFactor;
1414
+ this.isZoomByPosition = true;
1415
+ this.mapScaleValue = null;
1422
1416
  }
1423
1417
  }
1424
1418
  else if (this.zoomModule) {
1425
- this.tileZoomLevel = zoomFactor;
1426
- this.tileTranslatePoint = this.mapLayerPanel['panTileMap'](this.availableSize.width, this.availableSize.height, { x: centerPosition.longitude, y: centerPosition.latitude });
1427
- this.mapLayerPanel.generateTiles(zoomFactor, this.tileTranslatePoint, null, new BingMap(this));
1419
+ this.tileZoomLevel = this.zoomSettings.zoomFactor = zoomFactor;
1420
+ isRefresh = this.centerPosition.latitude === centerPosition.latitude && this.centerPosition.longitude === centerPosition.longitude ? true : isRefresh;
1421
+ this.centerPosition = centerPosition;
1422
+ this.isZoomByPosition = true;
1423
+ }
1424
+ if (isRefresh) {
1425
+ this.refresh();
1428
1426
  }
1429
1427
  };
1430
1428
  /**
@@ -1617,6 +1615,11 @@ var Maps = /** @class */ (function (_super) {
1617
1615
  var centerLatitude;
1618
1616
  var centerLongtitude;
1619
1617
  var isTwoCoordinates = false;
1618
+ this.centerPosition = {
1619
+ latitude: null,
1620
+ longitude: null
1621
+ };
1622
+ this.isZoomByPosition = false;
1620
1623
  if (isNullOrUndefined(maxLatitude) && isNullOrUndefined(maxLongitude)
1621
1624
  || isNullOrUndefined(minLatitude) && isNullOrUndefined(minLongitude)) {
1622
1625
  minLatitude = isNullOrUndefined(minLatitude) ? 0 : minLatitude;
@@ -598,7 +598,7 @@ var ZoomSettings = /** @class */ (function (_super) {
598
598
  Property(false)
599
599
  ], ZoomSettings.prototype, "doubleClickZoom", void 0);
600
600
  __decorate([
601
- Property(false)
601
+ Property(true)
602
602
  ], ZoomSettings.prototype, "pinchZooming", void 0);
603
603
  __decorate([
604
604
  Property(false)
@@ -43,8 +43,9 @@ var Annotations = /** @class */ (function () {
43
43
  var availSize = map.availableSize;
44
44
  var id = map.element.id + '_Annotation_' + annotationIndex;
45
45
  var childElement = createElement('div', {
46
- id: map.element.id + '_Annotation_' + annotationIndex, styles: 'position: absolute; z-index:' + annotation.zIndex + ';'
46
+ id: map.element.id + '_Annotation_' + annotationIndex
47
47
  });
48
+ childElement.style.cssText = 'position: absolute; z-index:' + annotation.zIndex + ';';
48
49
  var argsData = {
49
50
  cancel: false, name: annotationRendering, content: annotation.content,
50
51
  annotation: annotation