@syncfusion/ej2-maps 20.4.49 → 21.1.35

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.
Files changed (55) hide show
  1. package/CHANGELOG.md +4 -20
  2. package/dist/ej2-maps.min.js +2 -2
  3. package/dist/ej2-maps.umd.min.js +2 -2
  4. package/dist/ej2-maps.umd.min.js.map +1 -1
  5. package/dist/es6/ej2-maps.es2015.js +993 -236
  6. package/dist/es6/ej2-maps.es2015.js.map +1 -1
  7. package/dist/es6/ej2-maps.es5.js +1008 -236
  8. package/dist/es6/ej2-maps.es5.js.map +1 -1
  9. package/dist/global/ej2-maps.min.js +2 -2
  10. package/dist/global/ej2-maps.min.js.map +1 -1
  11. package/dist/global/index.d.ts +1 -1
  12. package/package.json +13 -13
  13. package/src/maps/layers/bubble.d.ts +2 -0
  14. package/src/maps/layers/bubble.js +2 -1
  15. package/src/maps/layers/color-mapping.d.ts +1 -0
  16. package/src/maps/layers/color-mapping.js +1 -0
  17. package/src/maps/layers/data-label.d.ts +1 -0
  18. package/src/maps/layers/data-label.js +9 -4
  19. package/src/maps/layers/layer-panel.js +1 -0
  20. package/src/maps/layers/legend.d.ts +2 -0
  21. package/src/maps/layers/legend.js +2 -0
  22. package/src/maps/layers/marker.d.ts +5 -0
  23. package/src/maps/layers/marker.js +42 -3
  24. package/src/maps/layers/navigation-selected-line.d.ts +1 -0
  25. package/src/maps/layers/navigation-selected-line.js +1 -0
  26. package/src/maps/maps-model.d.ts +47 -33
  27. package/src/maps/maps.d.ts +144 -88
  28. package/src/maps/maps.js +217 -61
  29. package/src/maps/model/base-model.d.ts +535 -230
  30. package/src/maps/model/base.d.ts +540 -263
  31. package/src/maps/model/base.js +168 -28
  32. package/src/maps/model/constants.d.ts +12 -0
  33. package/src/maps/model/constants.js +12 -0
  34. package/src/maps/model/export-image.d.ts +1 -1
  35. package/src/maps/model/export-image.js +1 -1
  36. package/src/maps/model/export-pdf.d.ts +2 -2
  37. package/src/maps/model/export-pdf.js +2 -2
  38. package/src/maps/model/interface.d.ts +137 -108
  39. package/src/maps/model/theme.d.ts +1 -0
  40. package/src/maps/model/theme.js +1 -0
  41. package/src/maps/user-interaction/annotation.d.ts +2 -0
  42. package/src/maps/user-interaction/annotation.js +2 -0
  43. package/src/maps/user-interaction/highlight.d.ts +1 -0
  44. package/src/maps/user-interaction/highlight.js +1 -0
  45. package/src/maps/user-interaction/selection.d.ts +1 -0
  46. package/src/maps/user-interaction/selection.js +1 -0
  47. package/src/maps/user-interaction/tooltip.d.ts +16 -0
  48. package/src/maps/user-interaction/tooltip.js +23 -6
  49. package/src/maps/user-interaction/zoom.d.ts +99 -3
  50. package/src/maps/user-interaction/zoom.js +405 -100
  51. package/src/maps/utils/enum.d.ts +105 -91
  52. package/src/maps/utils/helper.d.ts +76 -16
  53. package/src/maps/utils/helper.js +122 -37
  54. package/.eslintrc.json +0 -259
  55. package/tslint.json +0 -111
@@ -12,32 +12,44 @@ import { getValueFromObject } from '../utils/helper';
12
12
  */
13
13
  var Zoom = /** @class */ (function () {
14
14
  function Zoom(maps) {
15
+ /** @private */
15
16
  this.isPanning = false;
17
+ /** @private */
16
18
  this.mouseEnter = false;
19
+ /** @private */
17
20
  this.isTouch = false;
21
+ /** @private */
18
22
  this.rectZoomingStart = false;
23
+ /** @private */
19
24
  this.browserName = Browser.info.name;
20
25
  // eslint-disable-next-line @typescript-eslint/ban-types
26
+ /** @private */
21
27
  this.isPointer = Browser.isPointer;
22
28
  this.handled = false;
29
+ this.isPan = false;
30
+ this.isZoomFinal = false;
31
+ this.isZoomSelection = false;
23
32
  this.pinchFactor = 1;
24
33
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
25
34
  this.startTouches = [];
26
35
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
36
+ /** @private */
27
37
  this.intersect = [];
28
38
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
39
+ /** @private */
29
40
  this.mouseDownLatLong = { x: 0, y: 0 };
30
41
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
42
+ /** @private */
31
43
  this.mouseMoveLatLong = { x: 0, y: 0 };
32
- /**
33
- * @private
34
- */
44
+ /** @private */
35
45
  this.isSingleClick = false;
36
46
  this.maps = maps;
37
47
  this.wheelEvent = this.browserName === 'mozilla' ? (this.isPointer ? 'mousewheel' : 'DOMMouseScroll') : 'mousewheel';
38
48
  this.cancelEvent = this.isPointer ? 'pointerleave' : 'mouseleave';
39
- this.selectionColor = this.maps.zoomSettings.selectionColor;
40
- this.fillColor = this.maps.zoomSettings.color;
49
+ this.selectionColor = this.maps.zoomSettings.toolbarSettings.buttonSettings.selectionColor == null ?
50
+ this.maps.zoomSettings.selectionColor : this.maps.zoomSettings.toolbarSettings.buttonSettings.selectionColor;
51
+ this.fillColor = this.maps.zoomSettings.toolbarSettings.buttonSettings.color == null ? this.maps.zoomSettings.color :
52
+ this.maps.zoomSettings.toolbarSettings.buttonSettings.color;
41
53
  this.addEventListener();
42
54
  }
43
55
  /**
@@ -47,6 +59,7 @@ var Zoom = /** @class */ (function () {
47
59
  * @param {number} newZoomFactor - Specifies the zoom factor.
48
60
  * @param {string} type - Specifies the type.
49
61
  * @returns {void}
62
+ * @private
50
63
  */
51
64
  Zoom.prototype.performZooming = function (position, newZoomFactor, type) {
52
65
  var _this = this;
@@ -61,6 +74,7 @@ var Zoom = /** @class */ (function () {
61
74
  var maxZoom = map.zoomSettings.maxZoom;
62
75
  var minZoom = map.zoomSettings.minZoom;
63
76
  newZoomFactor = (minZoom > newZoomFactor && type === 'ZoomIn') ? minZoom + 1 : newZoomFactor;
77
+ newZoomFactor = maxZoom >= newZoomFactor ? newZoomFactor : maxZoom;
64
78
  var prevTilePoint = map.tileTranslatePoint;
65
79
  if ((!map.isTileMap) && ((type === 'ZoomIn' ? newZoomFactor >= minZoom && newZoomFactor <= maxZoom : newZoomFactor >= minZoom)
66
80
  || map.isReset)) {
@@ -149,6 +163,9 @@ var Zoom = /** @class */ (function () {
149
163
  }
150
164
  }
151
165
  this.maps.zoomNotApplied = false;
166
+ if (this.maps.isDevice) {
167
+ this.removeToolbarOpacity(map.isTileMap ? Math.round(map.tileZoomLevel) : map.scale, map.element.id + '_Zooming_');
168
+ }
152
169
  };
153
170
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
154
171
  Zoom.prototype.calculateInitalZoomTranslatePoint = function (newZoomFactor, mapTotalWidth, mapTotalHeight, availSize, minBounds, map) {
@@ -193,6 +210,9 @@ var Zoom = /** @class */ (function () {
193
210
  map.tileTranslatePoint.y = (currentLevel === 1) ? ((bounds.height / 2) - ((tileDefaultSize * 2) / 2) + (padding * 2)) :
194
211
  position.y - ((y * totalSize) / 100);
195
212
  };
213
+ /**
214
+ * @private
215
+ */
196
216
  Zoom.prototype.performRectZooming = function () {
197
217
  this.isDragZoom = true;
198
218
  var map = this.maps;
@@ -211,11 +231,14 @@ var Zoom = /** @class */ (function () {
211
231
  if (!map.isTileMap) {
212
232
  var scale = map.previousScale = map.scale;
213
233
  zoomCalculationFactor = scale + Math.round((((size.width / zoomRect.width) + (size.height / zoomRect.height)) / 2));
234
+ zoomCalculationFactor = zoomCalculationFactor < this.maps.zoomSettings.maxZoom ? zoomCalculationFactor : this.maps.zoomSettings.maxZoom;
214
235
  var translatePoint = map.previousPoint = map.translatePoint;
215
- var translatePointX = translatePoint.x - (((size.width / scale) - (size.width / zoomCalculationFactor)) / (size.width / x));
216
- var translatePointY = translatePoint.y - (((size.height / scale) - (size.height / zoomCalculationFactor)) / (size.height / y));
217
- map.translatePoint = new Point(translatePointX, translatePointY);
218
- map.scale = zoomCalculationFactor;
236
+ if (zoomCalculationFactor <= maxZoom) {
237
+ var translatePointX = translatePoint.x - (((size.width / scale) - (size.width / zoomCalculationFactor)) / (size.width / x));
238
+ var translatePointY = translatePoint.y - (((size.height / scale) - (size.height / zoomCalculationFactor)) / (size.height / y));
239
+ map.translatePoint = new Point(translatePointX, translatePointY);
240
+ }
241
+ map.scale = zoomCalculationFactor < this.maps.zoomSettings.maxZoom ? zoomCalculationFactor : this.maps.zoomSettings.maxZoom;
219
242
  isZoomCancelled = this.triggerZoomEvent(prevTilePoint, prevLevel, '');
220
243
  if (isZoomCancelled) {
221
244
  map.translatePoint = map.previousPoint;
@@ -249,6 +272,8 @@ var Zoom = /** @class */ (function () {
249
272
  this.zoomingRect = null;
250
273
  }
251
274
  }
275
+ this.isZoomFinal = this.isZoomSelection && Math.round(map.scale) === this.maps.zoomSettings.maxZoom;
276
+ this.removeToolbarOpacity(map.scale, this.maps.element.id + '_Zooming_');
252
277
  };
253
278
  Zoom.prototype.setInteraction = function (newInteraction) {
254
279
  this.lastScale = 1;
@@ -262,6 +287,9 @@ var Zoom = /** @class */ (function () {
262
287
  this.setInteraction(null);
263
288
  }
264
289
  };
290
+ /**
291
+ * @private
292
+ */
265
293
  Zoom.prototype.performPinchZooming = function (e) {
266
294
  var map = this.maps;
267
295
  var prevLevel = map.tileZoomLevel;
@@ -335,7 +363,13 @@ var Zoom = /** @class */ (function () {
335
363
  if (!isZoomCancelled) {
336
364
  this.applyTransform(map);
337
365
  }
366
+ if (Browser.isDevice) {
367
+ this.removeToolbarOpacity(map.isTileMap ? Math.round(map.tileZoomLevel) : map.scale, map.element.id + '_Zooming_');
368
+ }
338
369
  };
370
+ /**
371
+ * @private
372
+ */
339
373
  Zoom.prototype.drawZoomRectangle = function () {
340
374
  var map = this.maps;
341
375
  var down = this.mouseDownPoints;
@@ -353,7 +387,8 @@ var Zoom = /** @class */ (function () {
353
387
  var rectSVGObject = map.renderer.createSvg({
354
388
  id: map.element.id + '_Selection_Rect_Zooming',
355
389
  width: map.availableSize.width,
356
- height: map.availableSize.height
390
+ height: map.availableSize.height,
391
+ style: 'position: absolute;'
357
392
  });
358
393
  var rectOption = new RectOption(map.element.id + '_ZoomRect', '#d3d3d3', border, 0.5, this.zoomingRect, 0, 0, '', '3');
359
394
  rectSVGObject.appendChild(map.renderer.drawRectangle(rectOption));
@@ -380,6 +415,9 @@ var Zoom = /** @class */ (function () {
380
415
  zoomAnimate(element, 0, duration, new MapLocation(x, y), scale, this.maps.mapAreaRect, this.maps);
381
416
  }
382
417
  };
418
+ /**
419
+ * @private
420
+ */
383
421
  Zoom.prototype.applyTransform = function (maps, animate) {
384
422
  var layerIndex;
385
423
  this.templateCount = 0;
@@ -538,7 +576,7 @@ var Zoom = /** @class */ (function () {
538
576
  if (currentEle.childNodes[k - 1]['id'].indexOf('_rectIndex_') > -1 && !isNullOrUndefined(maps.zoomLabelPositions[labelIndex])) {
539
577
  var labelX = ((maps.zoomLabelPositions[labelIndex]['location']['x'] + x) * scale);
540
578
  var labelY = ((maps.zoomLabelPositions[labelIndex]['location']['y'] + y) * scale);
541
- var zoomtext = currentEle.childNodes[k]['innerHTML'];
579
+ var zoomtext = currentEle.childNodes[k]['textContent'];
542
580
  var style = maps.layers[this.index].dataLabelSettings.textStyle;
543
581
  var zoomtextSize = measureText(zoomtext, style);
544
582
  var padding = 5;
@@ -681,7 +719,7 @@ var Zoom = /** @class */ (function () {
681
719
  var datalabelTemplateElemement = getElementByID(maps.element.id + '_LayerIndex_'
682
720
  + i + '_Label_Template_Group');
683
721
  if ((!isNullOrUndefined(markerTemplateElement)) && markerTemplateElement.childElementCount > 0) {
684
- markerTemplateElement.style.visibility = "visible";
722
+ markerTemplateElement.style.visibility = 'visible';
685
723
  for (var k = 0; k < markerTemplateElement.childElementCount; k++) {
686
724
  this.markerTranslate(markerTemplateElement.childNodes[k], factor, x, y, scale, 'Template');
687
725
  }
@@ -755,23 +793,23 @@ var Zoom = /** @class */ (function () {
755
793
  if (this.maps.layers[this.index].dataLabelSettings.smartLabelMode === 'Hide') {
756
794
  if (scale > 1) {
757
795
  text = ((this.maps.dataLabelShape[l] * scale) >= zoomtextSize['width']) ? zoomtext : '';
758
- element.innerHTML = text;
796
+ element.textContent = text;
759
797
  }
760
798
  else {
761
799
  text = (this.maps.dataLabelShape[l] >= zoomtextSize['width']) ? zoomtext : '';
762
- element.innerHTML = text;
800
+ element.textContent = text;
763
801
  }
764
802
  }
765
803
  if (this.maps.layers[this.index].dataLabelSettings.smartLabelMode === 'Trim') {
766
804
  if (scale > 1) {
767
805
  zoomtrimLabel = textTrim((this.maps.dataLabelShape[l] * scale), zoomtext, style);
768
806
  text = zoomtrimLabel;
769
- element.innerHTML = text;
807
+ element.textContent = text;
770
808
  }
771
809
  else {
772
810
  zoomtrimLabel = textTrim(this.maps.dataLabelShape[l], zoomtext, style);
773
811
  text = zoomtrimLabel;
774
- element.innerHTML = text;
812
+ element.textContent = text;
775
813
  }
776
814
  }
777
815
  if (this.maps.layers[this.index].dataLabelSettings.intersectionAction === 'Hide') {
@@ -782,11 +820,11 @@ var Zoom = /** @class */ (function () {
782
820
  || textLocations['heightTop'] > this.intersect[m]['heightBottom']
783
821
  || textLocations['heightBottom'] < this.intersect[m]['heightTop']) {
784
822
  text = !isNullOrUndefined(text) ? text : zoomtext;
785
- element.innerHTML = text;
823
+ element.textContent = text;
786
824
  }
787
825
  else {
788
826
  text = '';
789
- element.innerHTML = text;
827
+ element.textContent = text;
790
828
  break;
791
829
  }
792
830
  }
@@ -804,7 +842,7 @@ var Zoom = /** @class */ (function () {
804
842
  if (scale > 1) {
805
843
  trimmedLable = textTrim((this.maps.dataLabelShape[l] * scale), trimmedLable, style);
806
844
  }
807
- element.innerHTML = trimmedLable;
845
+ element.textContent = trimmedLable;
808
846
  }
809
847
  else {
810
848
  if (textLocations['leftWidth'] > this.intersect[j]['leftWidth']) {
@@ -812,7 +850,7 @@ var Zoom = /** @class */ (function () {
812
850
  var difference = width - (textLocations['rightWidth'] - textLocations['leftWidth']);
813
851
  text = !isNullOrUndefined(text) ? text : zoomtext;
814
852
  trimmedLable = textTrim(difference, text, style);
815
- element.innerHTML = trimmedLable;
853
+ element.textContent = trimmedLable;
816
854
  break;
817
855
  }
818
856
  if (textLocations['leftWidth'] < this.intersect[j]['leftWidth']) {
@@ -820,7 +858,7 @@ var Zoom = /** @class */ (function () {
820
858
  var difference = Math.abs(width - (textLocations['rightWidth'] - textLocations['leftWidth']));
821
859
  text = !isNullOrUndefined(text) ? text : zoomtext;
822
860
  trimmedLable = textTrim(difference, text, style);
823
- element.innerHTML = trimmedLable;
861
+ element.textContent = trimmedLable;
824
862
  break;
825
863
  }
826
864
  }
@@ -829,7 +867,7 @@ var Zoom = /** @class */ (function () {
829
867
  this.intersect.push(textLocations);
830
868
  if (isNullOrUndefined(trimmedLable)) {
831
869
  trimmedLable = textTrim((this.maps.dataLabelShape[l] * scale), zoomtext, style);
832
- element.innerHTML = trimmedLable;
870
+ element.textContent = trimmedLable;
833
871
  }
834
872
  }
835
873
  if (animate || duration > 0) {
@@ -1022,6 +1060,9 @@ var Zoom = /** @class */ (function () {
1022
1060
  (this.distanceY / this.maps.scale) : this.maps.translatePoint.y;
1023
1061
  this.applyTransform(this.maps, false);
1024
1062
  };
1063
+ /**
1064
+ * @private
1065
+ */
1025
1066
  Zoom.prototype.toolBarZooming = function (zoomFactor, type) {
1026
1067
  var _this = this;
1027
1068
  var map = this.maps;
@@ -1040,10 +1081,10 @@ var Zoom = /** @class */ (function () {
1040
1081
  var prevTilePoint = map.tileTranslatePoint;
1041
1082
  map.previousProjection = map.projectionType;
1042
1083
  zoomFactor = (type === 'ZoomOut') ? (Math.round(zoomFactor) === 1 ? 1 : zoomFactor) : zoomFactor;
1043
- zoomFactor = (type === 'Reset') ? 1 : (Math.round(zoomFactor) === 0) ? 1 : zoomFactor;
1084
+ zoomFactor = (type === 'Reset') ? minZoom : (Math.round(zoomFactor) === 0) ? 1 : zoomFactor;
1044
1085
  zoomFactor = (minZoom > zoomFactor && type === 'ZoomIn') ? minZoom + 1 : zoomFactor;
1045
1086
  var zoomArgs;
1046
- if ((!map.isTileMap) && (type === 'ZoomIn' ? zoomFactor >= minZoom && zoomFactor <= maxZoom : zoomFactor >= minZoom
1087
+ if ((!map.isTileMap) && (type === 'ZoomIn' ? zoomFactor >= minZoom && Math.round(zoomFactor) <= maxZoom : zoomFactor >= minZoom
1047
1088
  || map.isReset)) {
1048
1089
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1049
1090
  var min = map.baseMapRectBounds['min'];
@@ -1132,6 +1173,9 @@ var Zoom = /** @class */ (function () {
1132
1173
  this.maps.zoomNotApplied = false;
1133
1174
  }
1134
1175
  };
1176
+ /**
1177
+ * @private
1178
+ */
1135
1179
  Zoom.prototype.createZoomingToolbars = function () {
1136
1180
  var map = this.maps;
1137
1181
  var zoomInElements;
@@ -1140,41 +1184,61 @@ var Zoom = /** @class */ (function () {
1140
1184
  id: map.element.id + '_Zooming_KitCollection',
1141
1185
  opacity: map.theme.toLowerCase() === 'fluentdark' ? 0.6 : 0.3
1142
1186
  });
1143
- var kitHeight = 16;
1144
- var kitWidth = 16;
1145
1187
  var xSpacing = 15;
1146
1188
  var ySpacing = 15;
1147
- var padding = 20;
1148
- var orientation = map.zoomSettings.toolBarOrientation;
1149
- var toolbarsCollection = map.zoomSettings.toolbars;
1189
+ var toolbar = map.zoomSettings.toolbarSettings;
1190
+ var button = map.zoomSettings.toolbarSettings.buttonSettings;
1191
+ this.maps.toolbarProperties = {
1192
+ toolBarOrientation: toolbar.orientation === 'Horizontal' ? map.zoomSettings.toolBarOrientation : toolbar.orientation,
1193
+ highlightColor: button.highlightColor == null ? map.zoomSettings.highlightColor : button.highlightColor,
1194
+ selectionColor: button.selectionColor == null ? map.zoomSettings.selectionColor : button.selectionColor,
1195
+ horizontalAlignment: toolbar.horizontalAlignment === 'Far' ? map.zoomSettings.horizontalAlignment : toolbar.horizontalAlignment,
1196
+ verticalAlignment: toolbar.verticalAlignment === 'Near' ? map.zoomSettings.verticalAlignment : toolbar.verticalAlignment,
1197
+ color: button.color == null ? map.zoomSettings.color : button.color,
1198
+ shapeOpacity: button.opacity !== 1 ? button.opacity : 1,
1199
+ borderOpacity: button.borderOpacity !== 1 ? button.borderOpacity : 1
1200
+ };
1201
+ var cx = button.radius / 4;
1202
+ var cy = button.radius / 4;
1203
+ var radius = button.radius / 2;
1204
+ var padding = button.padding;
1205
+ var orientation = this.maps.toolbarProperties.toolBarOrientation;
1206
+ var toolbarCollection = map.zoomSettings.toolbarSettings.buttonSettings.toolbarItems.map(function (value) { return value; });
1207
+ var toolbarsCollection = toolbarCollection.length === 3 ? map.zoomSettings.toolbars : toolbarCollection;
1208
+ xSpacing = (button.radius / 4) + (button.borderWidth / 2) + padding;
1209
+ ySpacing = (button.radius / 4) + (button.borderWidth / 2) + padding;
1150
1210
  var shadowElement = '<filter id="chart_shadow" height="130%"><feGaussianBlur in="SourceAlpha" stdDeviation="5"/>';
1151
1211
  shadowElement += '<feOffset dx="-3" dy="4" result="offsetblur"/><feComponentTransfer><feFuncA type="linear" slope="1"/>';
1152
1212
  shadowElement += '</feComponentTransfer><feMerge><feMergeNode/><feMergeNode in="SourceGraphic"/></feMerge></filter>';
1153
- var toolBarLength = map.zoomSettings.toolbars.length;
1154
- var toolWidth = (map.zoomSettings.toolBarOrientation === 'Horizontal') ? (toolBarLength * kitWidth) + (toolBarLength * padding) : (kitWidth * 2);
1155
- var toolHeight = (map.zoomSettings.toolBarOrientation === 'Horizontal') ? (kitHeight * 2) : (toolBarLength * kitHeight) + (toolBarLength * padding);
1213
+ var toolBarLength = toolbarCollection.length;
1214
+ var toolWidth = (orientation === 'Horizontal') ? ((toolBarLength * button.radius) + (toolBarLength * padding) + padding + (toolBarLength * button.borderWidth)) : (button.radius + button.borderWidth + (2 * padding));
1215
+ var toolHeight = (orientation === 'Horizontal') ? (button.radius + button.borderWidth + (2 * padding)) : ((toolBarLength * button.radius) + (toolBarLength * padding) + padding + (toolBarLength * button.borderWidth));
1156
1216
  var defElement = map.renderer.createDefs();
1157
1217
  defElement.innerHTML = shadowElement;
1158
1218
  this.toolBarGroup.appendChild(defElement);
1159
- var outerElement = map.renderer.drawRectangle(new RectOption(map.element.id + '_Zooming_Rect', 'transparent', { color: 'transparent', width: 1 }, 0.1, new Rect(0, 0, toolWidth, toolHeight), 0, 0));
1160
- outerElement.setAttribute('filter', 'url(#chart_shadow)');
1219
+ var outerElement = map.renderer.drawRectangle(new RectOption(map.element.id + '_Zooming_Rect', toolbar.backgroundColor, { color: toolbar.borderColor, width: toolbar.borderWidth, opacity: toolbar.borderOpacity }, toolbar.borderOpacity, new Rect((toolbar.borderWidth / 2), (toolbar.borderWidth / 2), (toolWidth - toolbar.borderWidth), (toolHeight - toolbar.borderWidth)), 0, 0));
1161
1220
  this.toolBarGroup.appendChild(outerElement);
1162
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1163
- var performFunction;
1221
+ var scaleX = (button.radius - (button.borderWidth / 2)) / 30;
1164
1222
  for (var i = 0; i < toolbarsCollection.length; i++) {
1223
+ if (i !== 0) {
1224
+ xSpacing = (map.toolbarProperties.toolBarOrientation === 'Horizontal') ? (xSpacing + (button.radius + padding) + button.borderWidth) : xSpacing;
1225
+ ySpacing = (map.toolbarProperties.toolBarOrientation === 'Horizontal') ? ySpacing : (ySpacing + (button.radius + padding) + button.borderWidth);
1226
+ }
1165
1227
  var toolbar_1 = toolbarsCollection[i];
1166
- var pathOptions = void 0;
1167
- var polyOptions = void 0;
1228
+ var pathStroke = !isNullOrUndefined(this.maps.toolbarProperties.color) ? this.maps.toolbarProperties.color : this.maps.themeStyle.zoomFillColor;
1229
+ var borderColor = button.borderColor || this.maps.themeStyle.zoomFillColor;
1168
1230
  this.currentToolbarEle = map.renderer.createGroup({
1169
1231
  id: map.element.id + '_Zooming_ToolBar_' + toolbar_1 + '_Group',
1170
1232
  transform: 'translate( ' + xSpacing + ' ' + ySpacing + ' ) '
1171
1233
  });
1172
1234
  this.currentToolbarEle.setAttribute('class', 'e-maps-toolbar');
1235
+ this.currentToolbarEle.appendChild(map.renderer.drawCircle(new CircleOption(map.element.id + '_Zooming_ToolBar_' + toolbar_1 + '_Rect', button.fill, { color: borderColor, width: button.borderWidth, opacity: button.borderOpacity }, button.opacity, cx, cy, radius, '')));
1173
1236
  var fillColor = '';
1174
- var fill = 'transparent';
1237
+ var opacity = 1;
1175
1238
  var direction = '';
1176
1239
  var polygonDirection = '';
1177
- this.selectionColor = this.maps.zoomSettings.selectionColor || this.maps.themeStyle.zoomSelectionColor;
1240
+ var fill = button.fill;
1241
+ this.selectionColor = this.maps.toolbarProperties.selectionColor || this.maps.themeStyle.zoomSelectionColor;
1178
1242
  switch (toolbar_1.toLowerCase()) {
1179
1243
  case 'zoom': {
1180
1244
  var fillColor_1 = void 0;
@@ -1182,36 +1246,51 @@ var Zoom = /** @class */ (function () {
1182
1246
  direction = 'M0.001,14.629L1.372,16l4.571-4.571v-0.685l0.228-0.274c1.051,0.868,2.423,1.417,3.885,1.417c3.291,0,';
1183
1247
  direction += '5.943-2.651,5.943-5.943S13.395,0,10.103,0S4.16,2.651,4.16,5.943c0,1.508,0.503,2.834,1.417,3.885l-0.274,0.228H4.571';
1184
1248
  direction = direction + 'L0.001,14.629L0.001,14.629z M5.943,5.943c0-2.285,1.828-4.114,4.114-4.114s4.114,1.828,4.114,';
1249
+ this.currentToolbarEle.setAttribute('class', (this.maps.zoomSettings.enableSelectionZooming ? 'e-maps-toolbar' : ''));
1185
1250
  if (this.maps.zoomSettings.enablePanning && !this.maps.zoomSettings.enableSelectionZooming) {
1186
1251
  fillColor_1 = fill;
1187
- strokeColor = this.maps.themeStyle.zoomFillColor;
1252
+ strokeColor = pathStroke;
1188
1253
  }
1189
1254
  else if (this.maps.zoomSettings.enablePanning && this.maps.zoomSettings.enableSelectionZooming) {
1190
1255
  fillColor_1 = fill;
1191
- strokeColor = this.maps.themeStyle.zoomFillColor;
1256
+ strokeColor = pathStroke;
1257
+ }
1258
+ else if (!this.maps.zoomSettings.enablePanning && !this.maps.zoomSettings.enableSelectionZooming) {
1259
+ fillColor_1 = fill;
1260
+ strokeColor = pathStroke;
1261
+ }
1262
+ else if (!this.maps.zoomSettings.enablePanning && this.maps.zoomSettings.enableSelectionZooming) {
1263
+ fillColor_1 = this.maps.themeStyle.zoomFillColor;
1264
+ strokeColor = pathStroke;
1192
1265
  }
1193
1266
  else if (!this.maps.zoomSettings.enablePanning && !this.maps.zoomSettings.enableSelectionZooming) {
1194
1267
  fillColor_1 = fill;
1195
- strokeColor = this.maps.themeStyle.zoomFillColor;
1268
+ strokeColor = pathStroke;
1196
1269
  }
1197
1270
  else {
1198
1271
  fillColor_1 = this.selectionColor;
1199
1272
  strokeColor = this.selectionColor;
1200
1273
  }
1201
- this.currentToolbarEle.appendChild(map.renderer.drawPath(new PathOption(map.element.id + '_Zooming_ToolBar_' + toolbar_1, fillColor_1, 1, strokeColor, 1, 1, null, direction + '4.114s-1.828,4.114-4.114,4.114S5.943,8.229,5.943,5.943z')));
1274
+ var zoomPath = map.renderer.drawPath(new PathOption(map.element.id + '_Zooming_ToolBar_' + toolbar_1, fillColor_1, 1, strokeColor, opacity, opacity, null, direction + '4.114s-1.828,4.114-4.114,4.114S5.943,8.229,5.943,5.943z'));
1275
+ zoomPath.setAttribute('transform', 'scale( ' + scaleX + ',' + scaleX + ' )');
1276
+ this.currentToolbarEle.appendChild(zoomPath);
1202
1277
  this.zoomElements = this.currentToolbarEle;
1203
1278
  this.wireEvents(this.currentToolbarEle, this.performToolBarAction);
1204
1279
  break;
1205
1280
  }
1206
1281
  case 'zoomin':
1207
1282
  direction = 'M 8, 0 L 8, 16 M 0, 8 L 16, 8';
1208
- this.currentToolbarEle.appendChild(map.renderer.drawPath(new PathOption(map.element.id + '_Zooming_ToolBar_' + toolbar_1 + '_Path', fill, 3, this.maps.themeStyle.zoomFillColor, 1, 1, null, direction)));
1283
+ var zoomInPath = map.renderer.drawPath(new PathOption(map.element.id + '_Zooming_ToolBar_' + toolbar_1 + '_Path', fill, 3, pathStroke, 1, 1, null, direction));
1284
+ zoomInPath.setAttribute('transform', 'scale( ' + scaleX + ',' + scaleX + ' )');
1285
+ this.currentToolbarEle.appendChild(zoomInPath);
1209
1286
  zoomInElements = this.currentToolbarEle;
1210
1287
  this.wireEvents(this.currentToolbarEle, this.performToolBarAction);
1211
1288
  break;
1212
1289
  case 'zoomout':
1213
1290
  direction = 'M 0, 8 L 16, 8';
1214
- this.currentToolbarEle.appendChild(map.renderer.drawPath(new PathOption(map.element.id + '_Zooming_ToolBar_' + toolbar_1, fill, 3, this.maps.themeStyle.zoomFillColor, 1, 1, null, direction)));
1291
+ var zoomOutPath = map.renderer.drawPath(new PathOption(map.element.id + '_Zooming_ToolBar_' + toolbar_1, fill, 3, pathStroke, 1, 1, null, direction));
1292
+ zoomOutPath.setAttribute('transform', 'scale( ' + scaleX + ',' + scaleX + ' )');
1293
+ this.currentToolbarEle.appendChild(zoomOutPath);
1215
1294
  zoomOutElements = this.currentToolbarEle;
1216
1295
  this.wireEvents(this.currentToolbarEle, this.performToolBarAction);
1217
1296
  break;
@@ -1219,17 +1298,20 @@ var Zoom = /** @class */ (function () {
1219
1298
  var color = void 0;
1220
1299
  direction = 'M5,3h2.3L7.275,5.875h1.4L8.65,3H11L8,0L5,3z M3,11V8.7l2.875,0.025v-1.4L3,7.35V5L0,8L3,';
1221
1300
  direction += '11z M11,13H8.7l0.025-2.875h-1.4L7.35,13H5l3,3L11,13z M13,5v2.3l-2.875-0.025v1.4L13,8.65V11l3-3L13,5z';
1301
+ this.currentToolbarEle.setAttribute('class', (this.maps.zoomSettings.enablePanning ? 'e-maps-toolbar' : ''));
1222
1302
  if (this.maps.zoomSettings.enablePanning && this.maps.zoomModule.isDragZoom) {
1223
- color = '#737373';
1303
+ color = this.selectionColor || this.maps.themeStyle.zoomFillColor;
1224
1304
  }
1225
1305
  else if (!this.maps.zoomSettings.enablePanning) {
1226
- color = '#737373';
1306
+ color = this.selectionColor || this.maps.themeStyle.zoomFillColor;
1227
1307
  this.currentToolbarEle.setAttribute('class', '');
1228
1308
  }
1229
1309
  else {
1230
- color = this.selectionColor;
1310
+ color = fill || this.maps.themeStyle.zoomFillColor;
1231
1311
  }
1232
- this.currentToolbarEle.appendChild(map.renderer.drawPath(new PathOption(map.element.id + '_Zooming_ToolBar_' + toolbar_1, color, 1, color, 1, 1, null, direction)));
1312
+ var panPath = map.renderer.drawPath(new PathOption(map.element.id + '_Zooming_ToolBar_' + toolbar_1, color, 1, pathStroke, opacity, opacity, null, direction));
1313
+ panPath.setAttribute('transform', 'scale( ' + scaleX + ',' + scaleX + ' )');
1314
+ this.currentToolbarEle.appendChild(panPath);
1233
1315
  this.panColor = color;
1234
1316
  this.panElements = this.currentToolbarEle;
1235
1317
  this.wireEvents(this.currentToolbarEle, this.performToolBarAction);
@@ -1239,16 +1321,18 @@ var Zoom = /** @class */ (function () {
1239
1321
  direction = 'M12.364,8h-2.182l2.909,3.25L16,8h-2.182c0-3.575-2.618-6.5-5.818-6.5c-1.128,0-2.218,0.366-3.091,';
1240
1322
  direction += '1.016l1.055,1.178C6.581,3.328,7.272,3.125,8,3.125C10.4,3.125,12.363,5.319,12.364,8L12.364,8z M11.091,';
1241
1323
  direction += '13.484l-1.055-1.178C9.419,12.672,8.728,12.875,8,12.875c-2.4,0-4.364-2.194-4.364-4.875h2.182L2.909,4.75L0,8h2.182c0,';
1242
- this.currentToolbarEle.appendChild(map.renderer.drawPath(new PathOption(map.element.id + '_Zooming_ToolBar_' + toolbar_1, this.fillColor, null, this.maps.themeStyle.zoomFillColor, 1, 1, null, direction + '3.575,2.618,6.5,5.818,6.5C9.128,14.5,10.219,14.134,11.091,13.484L11.091,13.484z')));
1324
+ var resetPath = map.renderer.drawPath(new PathOption(map.element.id + '_Zooming_ToolBar_' + toolbar_1, fill, null, pathStroke, 1, 1, null, direction + '3.575,2.618,6.5,5.818,6.5C9.128,14.5,10.219,14.134,11.091,13.484L11.091,13.484z'));
1325
+ resetPath.setAttribute('transform', 'scale( ' + scaleX + ',' + scaleX + ' )');
1326
+ this.currentToolbarEle.appendChild(resetPath);
1243
1327
  this.wireEvents(this.currentToolbarEle, this.performToolBarAction);
1244
1328
  break;
1245
1329
  }
1246
- this.currentToolbarEle.appendChild(map.renderer.drawCircle(new CircleOption(map.element.id + '_Zooming_ToolBar_' + toolbar_1 + '_Rect', fill, { color: this.maps.themeStyle.zoomFillColor, width: 1 }, 1, 8, 8, 16, '')));
1247
- xSpacing = (orientation === 'Horizontal') ? (xSpacing + (kitWidth + padding)) : xSpacing;
1248
- ySpacing = (orientation === 'Horizontal') ? ySpacing : (ySpacing + (kitHeight + padding));
1249
1330
  this.toolBarGroup.appendChild(this.currentToolbarEle);
1250
1331
  }
1251
1332
  };
1333
+ /**
1334
+ * @private
1335
+ */
1252
1336
  Zoom.prototype.performToolBarAction = function (e) {
1253
1337
  var target = e.target;
1254
1338
  e.stopImmediatePropagation();
@@ -1274,29 +1358,30 @@ var Zoom = /** @class */ (function () {
1274
1358
  Zoom.prototype.performZoomingByToolBar = function (type) {
1275
1359
  var map = this.maps;
1276
1360
  map.isReset = false;
1361
+ var scale = 0;
1362
+ var stateColor = this.fillColor || this.maps.themeStyle.zoomFillColor;
1277
1363
  switch (type.toLowerCase()) {
1278
1364
  case 'zoom':
1279
- this.panColor = this.fillColor;
1280
- this.zoomColor = this.selectionColor;
1281
- this.applySelection(this.zoomElements, this.selectionColor);
1282
- this.applySelection(this.panElements, this.fillColor);
1365
+ this.panColor = stateColor;
1366
+ this.zoomColor = this.maps.zoomSettings.enableSelectionZooming ? this.selectionColor : stateColor;
1367
+ this.applySelection(this.zoomElements, this.zoomColor);
1368
+ this.applySelection(this.panElements, this.panColor);
1369
+ this.isPan = false;
1370
+ this.isZoomSelection = this.maps.zoomSettings.enableSelectionZooming;
1283
1371
  break;
1284
1372
  case 'pan':
1285
- if (!this.maps.zoomSettings.enablePanning) {
1286
- this.panColor = '#737373';
1287
- }
1288
- else {
1289
- this.panColor = this.selectionColor;
1290
- }
1291
- this.zoomColor = this.fillColor;
1373
+ this.panColor = this.maps.zoomSettings.enablePanning ? this.selectionColor : stateColor;
1374
+ this.zoomColor = stateColor;
1292
1375
  if (!this.maps.zoomSettings.enablePanning) {
1293
1376
  this.applySelection(this.zoomElements, this.selectionColor);
1294
1377
  this.applySelection(this.panElements, this.panColor);
1295
1378
  }
1296
1379
  else {
1297
- this.applySelection(this.zoomElements, this.fillColor);
1380
+ this.applySelection(this.zoomElements, (this.fillColor || stateColor));
1298
1381
  this.applySelection(this.panElements, this.panColor);
1299
1382
  }
1383
+ this.isPan = this.maps.zoomSettings.enablePanning;
1384
+ this.isZoomSelection = false;
1300
1385
  break;
1301
1386
  case 'zoomin':
1302
1387
  map.staticMapZoom = map.tileZoomLevel;
@@ -1304,32 +1389,66 @@ var Zoom = /** @class */ (function () {
1304
1389
  map.staticMapZoom += 1;
1305
1390
  }
1306
1391
  this.toolBarZooming((map.isTileMap ? map.tileZoomLevel : map.scale) + 1, 'ZoomIn');
1392
+ scale = this.maps.isTileMap ? Math.round(this.maps.tileZoomLevel) : Math.round(this.maps.mapScaleValue);
1393
+ if (!this.isZoomSelection) {
1394
+ if (scale === map.zoomSettings.maxZoom || scale > 1 || (scale === 1 && this.maps.isTileMap)) {
1395
+ this.applySelection(this.zoomElements, stateColor);
1396
+ this.applySelection(this.panElements, map.zoomSettings.enablePanning ? this.selectionColor : stateColor);
1397
+ }
1398
+ else if (scale === 1 && !this.maps.isTileMap) {
1399
+ this.applySelection(this.zoomElements, stateColor);
1400
+ this.applySelection(this.panElements, stateColor);
1401
+ }
1402
+ }
1307
1403
  break;
1308
1404
  case 'zoomout':
1309
1405
  map.staticMapZoom = map.tileZoomLevel;
1310
1406
  map.markerCenterLatitude = null;
1311
1407
  map.markerCenterLongitude = null;
1312
1408
  this.toolBarZooming((map.isTileMap ? map.tileZoomLevel : map.scale) - 1, 'ZoomOut');
1409
+ scale = this.maps.isTileMap ? Math.round(this.maps.tileZoomLevel) : Math.round(this.maps.mapScaleValue);
1410
+ if (!this.isPan && this.isZoomSelection) {
1411
+ this.panColor = stateColor;
1412
+ this.zoomColor = this.selectionColor;
1413
+ this.applySelection(this.zoomElements, this.selectionColor);
1414
+ this.applySelection(this.panElements, this.panColor);
1415
+ }
1416
+ else {
1417
+ if (scale <= 1 && !map.isTileMap) {
1418
+ this.applySelection(this.panElements, stateColor);
1419
+ }
1420
+ else {
1421
+ this.applySelection(this.panElements, map.zoomSettings.enablePanning ? this.selectionColor : stateColor);
1422
+ }
1423
+ }
1313
1424
  break;
1314
1425
  case 'reset':
1315
1426
  map.staticMapZoom = map.zoomSettings.enable ? map.zoomSettings.zoomFactor : 0;
1316
1427
  map.markerCenterLatitude = null;
1317
1428
  map.markerCenterLongitude = null;
1318
- this.toolBarZooming(1, 'Reset');
1319
- if (!this.maps.zoomSettings.enablePanning) {
1320
- this.applySelection(this.zoomElements, this.selectionColor);
1321
- this.applySelection(this.panElements, '#737373');
1429
+ this.isZoomSelection = false;
1430
+ this.isPan = this.isPanning = map.zoomSettings.enablePanning;
1431
+ this.toolBarZooming(map.zoomSettings.minZoom, 'Reset');
1432
+ if ((this.isPan && !this.isZoomSelection) || (!this.isPan && this.isZoomSelection)) {
1433
+ if (!this.maps.zoomSettings.enablePanning) {
1434
+ this.applySelection(this.zoomElements, this.selectionColor);
1435
+ this.applySelection(this.panElements, stateColor);
1436
+ }
1437
+ else {
1438
+ this.applySelection(this.zoomElements, stateColor);
1439
+ this.applySelection(this.panElements, this.selectionColor);
1440
+ }
1322
1441
  }
1323
- else {
1324
- this.applySelection(this.zoomElements, this.fillColor);
1325
- this.applySelection(this.panElements, this.selectionColor);
1442
+ else if (!this.isPan && !this.isZoomSelection) {
1443
+ this.applySelection(this.zoomElements, stateColor);
1444
+ this.applySelection(this.panElements, stateColor);
1326
1445
  }
1327
1446
  }
1328
1447
  this.panningStyle(type.toLowerCase());
1329
1448
  };
1330
1449
  Zoom.prototype.panningStyle = function (toolbar) {
1331
1450
  var svg = getElementByID(this.maps.element.id + '_svg');
1332
- if (toolbar === 'pan' || this.isPanning) {
1451
+ if (toolbar === 'pan' || (this.isPanning && toolbar !== 'reset')) {
1333
1452
  svg.setAttribute('class', 'e-maps-panning');
1334
1453
  }
1335
1454
  else {
@@ -1344,22 +1463,50 @@ var Zoom = /** @class */ (function () {
1344
1463
  for (var i = 0; i < elements.childElementCount; i++) {
1345
1464
  childElement = elements.childNodes[i];
1346
1465
  if (childElement.tagName !== 'circle') {
1347
- childElement.setAttribute('fill', color);
1466
+ childElement.setAttribute('fill', (elements.id.indexOf('Pan') > -1 ? color : 'transparent'));
1348
1467
  childElement.setAttribute('stroke', color);
1349
1468
  }
1350
1469
  }
1351
1470
  };
1471
+ /**
1472
+ * @private
1473
+ */
1352
1474
  Zoom.prototype.showTooltip = function (e) {
1353
1475
  var text = e.target.id.split('_Zooming_ToolBar_')[1].split('_')[0];
1476
+ var tooltip = this.maps.zoomSettings.toolbarSettings.tooltipSettings;
1477
+ var tooltipSettings = {
1478
+ visible: tooltip.visible,
1479
+ fill: tooltip.fill,
1480
+ borderOpacity: tooltip.borderOpacity,
1481
+ borderWidth: tooltip.borderWidth,
1482
+ borderColor: tooltip.borderColor,
1483
+ fontColor: tooltip.fontColor,
1484
+ fontFamily: tooltip.fontFamily,
1485
+ fontStyle: tooltip.fontStyle,
1486
+ fontWeight: tooltip.fontWeight,
1487
+ fontSize: tooltip.fontSize || '10px',
1488
+ fontOpacity: tooltip.fontOpacity
1489
+ };
1490
+ tooltipSettings.fontFamily = this.maps.themeStyle.fontFamily;
1354
1491
  if (!this.isTouch) {
1355
- createTooltip('EJ2_Map_Toolbar_Tip', this.maps.getLocalizedLabel(text), (e.pageY + 10), (e.pageX + 10), '10px');
1492
+ createTooltip('EJ2_Map_Toolbar_Tip', this.maps.getLocalizedLabel(text), (e.pageY + 10), (e.pageX + 10), tooltipSettings);
1493
+ if (this.maps.isDevice) {
1494
+ clearTimeout(this.clearTimeout);
1495
+ this.clearTimeout = setTimeout(this.removeTooltip.bind(this), 2000);
1496
+ }
1356
1497
  }
1357
1498
  };
1499
+ /**
1500
+ * @private
1501
+ */
1358
1502
  Zoom.prototype.removeTooltip = function () {
1359
1503
  if (getElementByID('EJ2_Map_Toolbar_Tip')) {
1360
1504
  remove(getElementByID('EJ2_Map_Toolbar_Tip'));
1361
1505
  }
1362
1506
  };
1507
+ /**
1508
+ * @private
1509
+ */
1363
1510
  Zoom.prototype.alignToolBar = function () {
1364
1511
  var map = this.maps;
1365
1512
  var padding = 10;
@@ -1374,12 +1521,12 @@ var Zoom = /** @class */ (function () {
1374
1521
  getElementByID(map.element.id + '_Secondary_Element').appendChild(element);
1375
1522
  }
1376
1523
  var toolBarSize = this.toolBarGroup.getBoundingClientRect();
1377
- rectSVGObject.setAttribute('height', (toolBarSize.height + padding / 2).toString());
1378
- rectSVGObject.setAttribute('width', (toolBarSize.width + padding / 2).toString());
1524
+ rectSVGObject.setAttribute('height', (toolBarSize.height + map.zoomSettings.toolbarSettings.borderWidth).toString());
1525
+ rectSVGObject.setAttribute('width', (toolBarSize.width + map.zoomSettings.toolbarSettings.borderWidth).toString());
1379
1526
  var size = !isNullOrUndefined(map.totalRect) ? map.totalRect : map.mapAreaRect;
1380
1527
  var x = 0;
1381
1528
  var y = 0;
1382
- switch (map.zoomSettings.verticalAlignment) {
1529
+ switch (map.toolbarProperties.verticalAlignment) {
1383
1530
  case 'Near':
1384
1531
  y = size.y;
1385
1532
  break;
@@ -1390,7 +1537,7 @@ var Zoom = /** @class */ (function () {
1390
1537
  y = (size.height - toolBarSize.height) - padding;
1391
1538
  break;
1392
1539
  }
1393
- switch (map.zoomSettings.horizontalAlignment) {
1540
+ switch (map.toolbarProperties.horizontalAlignment) {
1394
1541
  case 'Near':
1395
1542
  x = size.x;
1396
1543
  break;
@@ -1409,7 +1556,7 @@ var Zoom = /** @class */ (function () {
1409
1556
  var extraPosition = map.getExtraPosition();
1410
1557
  element.style.left = x + extraPosition.x + 'px';
1411
1558
  element.style.top = y + extraPosition.y + 'px';
1412
- var color = this.maps.zoomSettings.highlightColor || this.maps.themeStyle.zoomSelectionColor;
1559
+ var color = this.maps.toolbarProperties.highlightColor || this.maps.themeStyle.zoomSelectionColor;
1413
1560
  var css = ' .e-maps-toolbar:hover > circle { stroke:' + color + '; } .e-maps-toolbar:hover > path { fill: ' + color + ' ; stroke: ' + color + '; }' +
1414
1561
  '.e-maps-toolbar:hover { cursor: pointer; } .e-maps-cursor-disable:hover { cursor: not-allowed; } .e-maps-panning:hover { cursor: pointer; } ' +
1415
1562
  '.e-maps-popup-close { display: block; opacity: 0; }';
@@ -1417,6 +1564,141 @@ var Zoom = /** @class */ (function () {
1417
1564
  style.appendChild(document.createTextNode(css));
1418
1565
  element.appendChild(style);
1419
1566
  };
1567
+ /**
1568
+ * @private
1569
+ */
1570
+ Zoom.prototype.removeToolbarOpacity = function (factor, id) {
1571
+ if (this.maps.zoomModule && this.maps.zoomSettings.enable) {
1572
+ if (getElementByID(this.maps.element.id + '_Zooming_KitCollection') && id.indexOf(this.maps.element.id + '_Zooming_') > -1) {
1573
+ if (this.maps.isDevice) {
1574
+ getElementByID(this.maps.element.id + '_Zooming_KitCollection').setAttribute('opacity', '1');
1575
+ this.removeToolbarClass('', '', '', '', '');
1576
+ }
1577
+ else {
1578
+ this.removeToolbarClass(this.maps.zoomSettings.enableSelectionZooming ? 'e-maps-toolbar' : '', 'e-maps-toolbar', 'e-maps-toolbar', this.maps.zoomSettings.enablePanning ? 'e-maps-toolbar' : '', 'e-maps-toolbar');
1579
+ }
1580
+ var toolbarShapeOpacity = this.maps.toolbarProperties.shapeOpacity;
1581
+ var toolbarButtonOpacity = this.maps.toolbarProperties.borderOpacity;
1582
+ if (this.maps.isTileMap && (factor <= 1.1 || this.maps.zoomSettings.minZoom === factor)) {
1583
+ if (!this.maps.isDevice) {
1584
+ this.removeToolbarClass(this.maps.zoomSettings.enableSelectionZooming ? 'e-maps-toolbar' : '', 'e-maps-toolbar', '', this.maps.zoomSettings.enablePanning ? 'e-maps-toolbar' : '', '');
1585
+ }
1586
+ if (this.maps.zoomSettings.enablePanning) {
1587
+ this.removePanColor(this.maps.toolbarProperties.selectionColor || this.maps.themeStyle.zoomSelectionColor);
1588
+ }
1589
+ if (this.isZoomSelection && this.maps.zoomSettings.enableSelectionZooming && !this.maps.isReset) {
1590
+ this.removeZoomColor(this.maps.toolbarProperties.selectionColor || this.maps.themeStyle.zoomSelectionColor);
1591
+ this.removePanColor(this.maps.toolbarProperties.color || this.maps.themeStyle.zoomFillColor);
1592
+ }
1593
+ this.removeZoomOpacity((this.maps.zoomSettings.enableSelectionZooming ? toolbarShapeOpacity : 0.3), (this.maps.zoomSettings.enableSelectionZooming ? toolbarButtonOpacity : 0.3), toolbarShapeOpacity, toolbarButtonOpacity, 0.3, 0.3, (this.maps.zoomSettings.enablePanning ? toolbarShapeOpacity : 0.3), (this.maps.zoomSettings.enablePanning ? toolbarButtonOpacity : 0.3), 0.3, 0.3);
1594
+ }
1595
+ else if ((factor <= 1.1 || this.maps.zoomSettings.minZoom === factor)) {
1596
+ if (!this.maps.isDevice) {
1597
+ this.removeToolbarClass(this.maps.zoomSettings.enableSelectionZooming ? 'e-maps-toolbar' : '', 'e-maps-toolbar', '', '', '');
1598
+ }
1599
+ if (!this.isZoomSelection && this.maps.zoomSettings.enablePanning) {
1600
+ this.removePanColor(this.maps.toolbarProperties.color || this.maps.themeStyle.zoomFillColor);
1601
+ }
1602
+ if (this.isZoomSelection && this.maps.zoomSettings.enableSelectionZooming && !this.maps.isReset) {
1603
+ this.removeZoomColor(this.maps.toolbarProperties.selectionColor || this.maps.themeStyle.zoomSelectionColor);
1604
+ this.removePanColor(this.maps.toolbarProperties.color || this.maps.themeStyle.zoomFillColor);
1605
+ }
1606
+ this.removeZoomOpacity((this.maps.zoomSettings.enableSelectionZooming ? toolbarShapeOpacity : 0.3), (this.maps.zoomSettings.enableSelectionZooming ? toolbarButtonOpacity : 0.3), toolbarShapeOpacity, toolbarButtonOpacity, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3);
1607
+ }
1608
+ else if (factor < this.maps.zoomSettings.maxZoom) {
1609
+ if (!this.maps.isDevice) {
1610
+ this.removeToolbarClass(this.maps.zoomSettings.enableSelectionZooming ? 'e-maps-toolbar' : '', 'e-maps-toolbar', 'e-maps-toolbar', this.maps.zoomSettings.enablePanning ? 'e-maps-toolbar' : '', 'e-maps-toolbar');
1611
+ }
1612
+ if (!this.maps.zoomModule.isZoomFinal) {
1613
+ this.removeZoomOpacity((this.maps.zoomSettings.enableSelectionZooming ? toolbarShapeOpacity : 0.3), (this.maps.zoomSettings.enableSelectionZooming ? toolbarButtonOpacity : 0.3), toolbarShapeOpacity, toolbarButtonOpacity, toolbarShapeOpacity, toolbarButtonOpacity, (this.maps.zoomSettings.enablePanning ? toolbarShapeOpacity : 0.3), (this.maps.zoomSettings.enablePanning ? toolbarButtonOpacity : 0.3), toolbarShapeOpacity, toolbarButtonOpacity);
1614
+ }
1615
+ else {
1616
+ this.maps.zoomModule.isZoomFinal = false;
1617
+ }
1618
+ if (this.isZoomSelection && this.maps.zoomSettings.enableSelectionZooming) {
1619
+ this.removeZoomColor(this.maps.toolbarProperties.selectionColor || this.maps.themeStyle.zoomSelectionColor);
1620
+ if (this.maps.zoomModule.isPan && this.maps.zoomSettings.enablePanning) {
1621
+ this.removePanColor(this.maps.toolbarProperties.color || this.maps.themeStyle.zoomFillColor);
1622
+ }
1623
+ }
1624
+ else if (!this.isZoomSelection && this.maps.zoomSettings.enablePanning) {
1625
+ this.removePanColor(this.maps.toolbarProperties.selectionColor || this.maps.themeStyle.zoomSelectionColor);
1626
+ if (this.maps.zoomSettings.enableSelectionZooming) {
1627
+ this.removeZoomColor(this.maps.toolbarProperties.color || this.maps.themeStyle.zoomFillColor);
1628
+ }
1629
+ }
1630
+ }
1631
+ else {
1632
+ if (!this.maps.isDevice) {
1633
+ this.removeToolbarClass('', '', 'e-maps-toolbar', this.maps.zoomSettings.enablePanning ? 'e-maps-toolbar' : '', 'e-maps-toolbar');
1634
+ }
1635
+ this.removeZoomOpacity(0.3, 0.3, 0.3, 0.3, toolbarShapeOpacity, toolbarButtonOpacity, (this.maps.zoomSettings.enablePanning ? toolbarShapeOpacity : 0.3), (this.maps.zoomSettings.enablePanning ? toolbarButtonOpacity : 0.3), toolbarShapeOpacity, toolbarButtonOpacity);
1636
+ if (this.maps.zoomSettings.enableSelectionZooming) {
1637
+ this.removeZoomColor(this.maps.toolbarProperties.color || this.maps.themeStyle.zoomFillColor);
1638
+ }
1639
+ if (!this.isZoomSelection && this.maps.zoomSettings.enablePanning) {
1640
+ this.removePanColor(this.maps.toolbarProperties.selectionColor || this.maps.themeStyle.zoomSelectionColor);
1641
+ }
1642
+ }
1643
+ }
1644
+ else {
1645
+ if (!this.maps.isDevice) {
1646
+ this.removePanColor(this.maps.toolbarProperties.color || this.maps.themeStyle.zoomFillColor);
1647
+ this.removeZoomColor(this.maps.toolbarProperties.color || this.maps.themeStyle.zoomFillColor);
1648
+ this.removeZoomOpacity(1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
1649
+ }
1650
+ }
1651
+ }
1652
+ };
1653
+ Zoom.prototype.setOpacity = function (circleId, pathId, circleOpacity, pathOpacity) {
1654
+ if (getElementByID(this.maps.element.id + circleId)) {
1655
+ getElementByID(this.maps.element.id + circleId).setAttribute('stroke-opacity', circleOpacity.toString());
1656
+ getElementByID(this.maps.element.id + circleId).setAttribute('fill-opacity', circleOpacity.toString());
1657
+ getElementByID(this.maps.element.id + pathId).setAttribute('stroke-opacity', pathOpacity.toString());
1658
+ getElementByID(this.maps.element.id + pathId).setAttribute('fill-opacity', pathOpacity.toString());
1659
+ }
1660
+ };
1661
+ Zoom.prototype.removeZoomOpacity = function (zoomOpacity, zoomStrokeOpacity, zoomInOpacity, zoomInStrokeOpacity, zoomOutOpacity, zoomOutStrokeOpacity, panOpacity, panStrokeOpacity, resetOpacity, resetStrokeOpacity) {
1662
+ this.setOpacity('_Zooming_ToolBar_Zoom_Rect', '_Zooming_ToolBar_Zoom', zoomStrokeOpacity, zoomOpacity);
1663
+ this.setOpacity('_Zooming_ToolBar_ZoomIn_Rect', '_Zooming_ToolBar_ZoomIn_Path', zoomInStrokeOpacity, zoomInOpacity);
1664
+ this.setOpacity('_Zooming_ToolBar_ZoomOut_Rect', '_Zooming_ToolBar_ZoomOut', zoomOutStrokeOpacity, zoomOutOpacity);
1665
+ this.setOpacity('_Zooming_ToolBar_Pan_Rect', '_Zooming_ToolBar_Pan', panStrokeOpacity, panOpacity);
1666
+ this.setOpacity('_Zooming_ToolBar_Reset_Rect', '_Zooming_ToolBar_Reset', resetStrokeOpacity, resetOpacity);
1667
+ };
1668
+ /**
1669
+ * @private
1670
+ */
1671
+ Zoom.prototype.removeToolbarClass = function (zoomClassStyle, zoomInClassStyle, zoomOutClassStyle, panClassStyle, resetClassStyle) {
1672
+ if (getElementByID(this.maps.element.id + '_Zooming_KitCollection')) {
1673
+ if (document.getElementById(this.maps.element.id + '_Zooming_ToolBar_ZoomIn_Group')) {
1674
+ getElementByID(this.maps.element.id + '_Zooming_ToolBar_ZoomIn_Group').setAttribute('class', zoomInClassStyle);
1675
+ }
1676
+ if (document.getElementById(this.maps.element.id + '_Zooming_ToolBar_ZoomOut_Group')) {
1677
+ getElementByID(this.maps.element.id + '_Zooming_ToolBar_ZoomOut_Group').setAttribute('class', zoomOutClassStyle);
1678
+ }
1679
+ if (document.getElementById(this.maps.element.id + '_Zooming_ToolBar_Reset_Group')) {
1680
+ getElementByID(this.maps.element.id + '_Zooming_ToolBar_Reset_Group').setAttribute('class', resetClassStyle);
1681
+ }
1682
+ if (document.getElementById(this.maps.element.id + '_Zooming_ToolBar_Zoom_Group') && this.maps.zoomSettings.enableSelectionZooming) {
1683
+ getElementByID(this.maps.element.id + '_Zooming_ToolBar_Zoom_Group').setAttribute('class', zoomClassStyle);
1684
+ }
1685
+ if (document.getElementById(this.maps.element.id + '_Zooming_ToolBar_Pan_Group') && this.maps.zoomSettings.enablePanning) {
1686
+ getElementByID(this.maps.element.id + '_Zooming_ToolBar_Pan_Group').setAttribute('class', panClassStyle);
1687
+ }
1688
+ }
1689
+ };
1690
+ Zoom.prototype.removePanColor = function (selectionColor) {
1691
+ if (getElementByID(this.maps.element.id + '_Zooming_ToolBar_Pan_Rect') && this.maps.zoomSettings.enablePanning) {
1692
+ getElementByID(this.maps.element.id + '_Zooming_ToolBar_Pan').setAttribute('fill', selectionColor);
1693
+ getElementByID(this.maps.element.id + '_Zooming_ToolBar_Pan').setAttribute('stroke', selectionColor);
1694
+ }
1695
+ };
1696
+ Zoom.prototype.removeZoomColor = function (selectionColor) {
1697
+ if (getElementByID(this.maps.element.id + '_Zooming_ToolBar_Zoom_Rect') && this.maps.zoomSettings.enableSelectionZooming) {
1698
+ getElementByID(this.maps.element.id + '_Zooming_ToolBar_Zoom').setAttribute('fill', 'transparent');
1699
+ getElementByID(this.maps.element.id + '_Zooming_ToolBar_Zoom').setAttribute('stroke', selectionColor);
1700
+ }
1701
+ };
1420
1702
  /**
1421
1703
  * To bind events.
1422
1704
  *
@@ -1431,6 +1713,9 @@ var Zoom = /** @class */ (function () {
1431
1713
  EventHandler.add(element, 'mouseover', this.showTooltip, this);
1432
1714
  EventHandler.add(element, 'mouseout', this.removeTooltip, this);
1433
1715
  };
1716
+ /**
1717
+ * @private
1718
+ */
1434
1719
  Zoom.prototype.mapMouseWheel = function (e) {
1435
1720
  if (this.maps.zoomSettings.enable && this.maps.zoomSettings.mouseWheelZoom) {
1436
1721
  var map = this.maps;
@@ -1471,8 +1756,13 @@ var Zoom = /** @class */ (function () {
1471
1756
  this.performZooming(position, (value - delta), direction);
1472
1757
  }
1473
1758
  }
1759
+ this.removeToolbarOpacity(map.mapScaleValue, (!this.maps.isDevice ? (!isNullOrUndefined(e.target) ? e.target['id'] :
1760
+ this.maps.element.id) : this.maps.element.id + '_Zooming_'));
1474
1761
  }
1475
1762
  };
1763
+ /**
1764
+ * @private
1765
+ */
1476
1766
  Zoom.prototype.doubleClick = function (e) {
1477
1767
  var pageX = e.pageX;
1478
1768
  var pageY = e.pageY;
@@ -1492,6 +1782,9 @@ var Zoom = /** @class */ (function () {
1492
1782
  }
1493
1783
  }
1494
1784
  };
1785
+ /**
1786
+ * @private
1787
+ */
1495
1788
  Zoom.prototype.mouseDownHandler = function (e) {
1496
1789
  var pageX;
1497
1790
  var pageY;
@@ -1511,15 +1804,15 @@ var Zoom = /** @class */ (function () {
1511
1804
  target = e.target;
1512
1805
  }
1513
1806
  if (!this.maps.zoomSettings.enablePanning) {
1514
- this.isPanning = this.panColor !== this.selectionColor ? this.maps.zoomSettings.enablePanning
1807
+ this.isPan = this.isPanning = this.panColor !== this.selectionColor ? this.maps.zoomSettings.enablePanning
1515
1808
  : this.zoomColor === this.selectionColor;
1516
1809
  }
1517
1810
  else {
1518
- this.isPanning = this.panColor === this.selectionColor ? this.maps.zoomSettings.enablePanning
1519
- : this.zoomColor !== this.selectionColor;
1811
+ this.isPan = this.isPanning = !this.isZoomSelection;
1520
1812
  }
1521
1813
  this.mouseDownLatLong = { x: pageX, y: pageY };
1522
- this.rectZoomingStart = ((!this.isPanning) && this.maps.zoomSettings.enable);
1814
+ var scale = this.maps.isTileMap ? Math.round(this.maps.tileZoomLevel) : Math.round(this.maps.mapScaleValue);
1815
+ this.rectZoomingStart = ((this.isZoomSelection && scale < this.maps.zoomSettings.maxZoom) && this.maps.zoomSettings.enable);
1523
1816
  this.mouseDownPoints = this.getMousePosition(pageX, pageY);
1524
1817
  if (this.isTouch) {
1525
1818
  this.firstMove = true;
@@ -1528,6 +1821,9 @@ var Zoom = /** @class */ (function () {
1528
1821
  }
1529
1822
  this.isSingleClick = true;
1530
1823
  };
1824
+ /**
1825
+ * @private
1826
+ */
1531
1827
  Zoom.prototype.mouseMoveHandler = function (e) {
1532
1828
  var pageX;
1533
1829
  var pageY;
@@ -1551,21 +1847,9 @@ var Zoom = /** @class */ (function () {
1551
1847
  if (getElementByID(map.element.id + '_Zooming_KitCollection')) {
1552
1848
  if (target.id.indexOf('_Zooming_') > -1) {
1553
1849
  getElementByID(map.element.id + '_Zooming_KitCollection').setAttribute('opacity', '1');
1554
- if (document.getElementById(map.element.id + '_Zooming_ToolBar_Pan_Group')) {
1555
- if (!this.maps.zoomSettings.enablePanning) {
1556
- if (target.id.indexOf('_Zooming_ToolBar') > -1 || target.id.indexOf('_Zooming_Rect') > -1) {
1557
- getElementByID(map.element.id + '_Zooming_ToolBar_Pan_Rect').setAttribute('opacity', map.theme.toLowerCase() === 'fluentdark' ? '0.6' : '0.3');
1558
- getElementByID(map.element.id + '_Zooming_ToolBar_Pan').setAttribute('opacity', map.theme.toLowerCase() === 'fluentdark' ? '0.6' : '0.3');
1559
- }
1560
- }
1561
- }
1562
1850
  }
1563
- else {
1851
+ else if (!map.isDevice) {
1564
1852
  getElementByID(map.element.id + '_Zooming_KitCollection').setAttribute('opacity', map.theme.toLowerCase() === 'fluentdark' ? '0.6' : '0.3');
1565
- if (!this.maps.zoomSettings.enablePanning && document.getElementById(map.element.id + '_Zooming_ToolBar_Pan_Group')) {
1566
- getElementByID(map.element.id + '_Zooming_ToolBar_Pan_Rect').setAttribute('opacity', '1');
1567
- getElementByID(map.element.id + '_Zooming_ToolBar_Pan').setAttribute('opacity', '1');
1568
- }
1569
1853
  }
1570
1854
  }
1571
1855
  if (this.isTouch) {
@@ -1587,7 +1871,7 @@ var Zoom = /** @class */ (function () {
1587
1871
  this.mouseMovePoints = this.getMousePosition(pageX, pageY);
1588
1872
  var targetId = e.target['id'];
1589
1873
  var targetEle = e.target;
1590
- if (zoom.enable && this.isPanning && ((Browser.isDevice && touches.length >= 1) || !Browser.isDevice)) {
1874
+ if (zoom.enable && this.isPanning && this.maps.markerDragId.indexOf('_MarkerIndex_') == -1 && ((Browser.isDevice && touches.length >= 1) || !Browser.isDevice)) {
1591
1875
  e.preventDefault();
1592
1876
  this.maps.element.style.cursor = 'pointer';
1593
1877
  this.mouseMoveLatLong = { x: pageX, y: pageY };
@@ -1601,11 +1885,19 @@ var Zoom = /** @class */ (function () {
1601
1885
  }
1602
1886
  if (this.isTouch ? (touches.length === 1 && this.rectZoomingStart) : this.rectZoomingStart) {
1603
1887
  e.preventDefault();
1604
- if (this.maps.zoomSettings.enableSelectionZooming) {
1888
+ var scale = this.maps.isTileMap ? Math.round(this.maps.tileZoomLevel) : Math.round(this.maps.mapScaleValue);
1889
+ if (this.maps.zoomSettings.enableSelectionZooming && scale < this.maps.zoomSettings.maxZoom) {
1605
1890
  this.drawZoomRectangle();
1606
1891
  }
1892
+ else {
1893
+ this.rectZoomingStart = false;
1894
+ this.isPan = true;
1895
+ }
1607
1896
  }
1608
1897
  };
1898
+ /**
1899
+ * @private
1900
+ */
1609
1901
  Zoom.prototype.mouseUpHandler = function (e) {
1610
1902
  var isDragZoom;
1611
1903
  var map = this.maps;
@@ -1630,6 +1922,9 @@ var Zoom = /** @class */ (function () {
1630
1922
  this.mouseMoveLatLong = { x: 0, y: 0 };
1631
1923
  this.mouseDownLatLong = { x: 0, y: 0 };
1632
1924
  };
1925
+ /**
1926
+ * @private
1927
+ */
1633
1928
  Zoom.prototype.mouseCancelHandler = function (e) {
1634
1929
  this.isPanning = false;
1635
1930
  this.isTouch = false;
@@ -1645,6 +1940,7 @@ var Zoom = /** @class */ (function () {
1645
1940
  *
1646
1941
  * @param {PointerEvent} e - Specifies the pointer event.
1647
1942
  * @returns {void}
1943
+ * @private
1648
1944
  */
1649
1945
  Zoom.prototype.click = function (e) {
1650
1946
  var map = this.maps;
@@ -1667,6 +1963,9 @@ var Zoom = /** @class */ (function () {
1667
1963
  }
1668
1964
  }
1669
1965
  };
1966
+ /**
1967
+ * @private
1968
+ */
1670
1969
  Zoom.prototype.getMousePosition = function (pageX, pageY) {
1671
1970
  var map = this.maps;
1672
1971
  var elementRect = map.element.getBoundingClientRect();
@@ -1678,6 +1977,9 @@ var Zoom = /** @class */ (function () {
1678
1977
  var positionY = elementRect.top + pageYOffset - clientTop;
1679
1978
  return new Point(Math.abs(pageX - positionX), Math.abs(pageY - positionY));
1680
1979
  };
1980
+ /**
1981
+ * @private
1982
+ */
1681
1983
  Zoom.prototype.addEventListener = function () {
1682
1984
  if (this.maps.isDestroyed) {
1683
1985
  return;
@@ -1690,6 +1992,9 @@ var Zoom = /** @class */ (function () {
1690
1992
  this.maps.on(Browser.touchEndEvent, this.mouseUpHandler, this);
1691
1993
  EventHandler.add(this.maps.element, this.cancelEvent, this.mouseCancelHandler, this);
1692
1994
  };
1995
+ /**
1996
+ * @private
1997
+ */
1693
1998
  Zoom.prototype.removeEventListener = function () {
1694
1999
  if (this.maps.isDestroyed) {
1695
2000
  return;