@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
package/src/maps/maps.js CHANGED
@@ -24,23 +24,24 @@ import { Component, NotifyPropertyChanges, Property, Ajax } from '@syncfusion/ej
24
24
  import { EventHandler, Browser, isNullOrUndefined, createElement, setValue, extend } from '@syncfusion/ej2-base';
25
25
  import { Event, remove, L10n, Collection, Internationalization, Complex } from '@syncfusion/ej2-base';
26
26
  import { SvgRenderer } from '@syncfusion/ej2-svg-base';
27
- import { Size, createSvg, Point, removeElement, triggerShapeEvent, showTooltip, checkShapeDataFields, getMousePosition, calculateSize } from './utils/helper';
27
+ import { Size, createSvg, Point, removeElement, triggerShapeEvent, showTooltip, checkShapeDataFields, MapLocation, getMousePosition, calculateSize } from './utils/helper';
28
28
  import { getElement, removeClass, getTranslate, triggerItemSelectionEvent, mergeSeparateCluster, customizeStyle, querySelector } from './utils/helper';
29
29
  import { createStyle } from './utils/helper';
30
30
  import { ZoomSettings, LegendSettings } from './model/base';
31
31
  import { LayerSettings, TitleSettings, Border, Margin, MapsAreaSettings, Annotation, CenterPosition } from './model/base';
32
32
  import { Marker } from './layers/marker';
33
- import { load, click, onclick, loaded, doubleClick, resize, shapeSelected, zoomIn } from './model/constants';
33
+ import { load, click, onclick, rightClick, loaded, doubleClick, resize, shapeSelected, zoomIn } from './model/constants';
34
34
  import { getThemeStyle, Theme } from './model/theme';
35
35
  import { LayerPanel } from './layers/layer-panel';
36
36
  import { Rect, RectOption, measureText, getElementByID, MapAjax, processResult, getElementsByClassName } from '../maps/utils/helper';
37
- import { findPosition, textTrim, TextOption, renderTextElement, calculateZoomLevel } from '../maps/utils/helper';
37
+ import { findPosition, textTrim, TextOption, renderTextElement, calculateZoomLevel, convertTileLatLongToPoint, convertGeoToPoint } from '../maps/utils/helper';
38
38
  import { Annotations } from '../maps/user-interaction/annotation';
39
39
  import { MarkerSettings } from './index';
40
40
  import { changeBorderWidth } from './index';
41
41
  import { DataManager, Query } from '@syncfusion/ej2-data';
42
42
  /**
43
- * Represents the Maps control.
43
+ * Represents the maps control. It is ideal for rendering maps from GeoJSON data or other map providers like OpenStreetMap, Google Maps, Bing Maps, etc that
44
+ * has rich feature set that includes markers, labels, bubbles and much more.
44
45
  * ```html
45
46
  * <div id="maps"/>
46
47
  * <script>
@@ -136,6 +137,8 @@ var Maps = /** @class */ (function (_super) {
136
137
  /** @private */
137
138
  _this.initialTileTranslate = new Point(0, 0);
138
139
  /** @private */
140
+ _this.markerDragId = '';
141
+ /** @private */
139
142
  _this.initialCheck = true;
140
143
  /** @private */
141
144
  _this.applyZoomReset = false;
@@ -144,8 +147,13 @@ var Maps = /** @class */ (function (_super) {
144
147
  /** @private */
145
148
  _this.markerClusterExpand = false;
146
149
  /** @private */
150
+ _this.mouseMoveId = '';
151
+ /** @private */
147
152
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
148
153
  _this.shapeSelectionItem = [];
154
+ /** @private */
155
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
156
+ _this.markerDragArgument = null;
149
157
  setValue('mergePersistData', _this.mergePersistMapsData, _this);
150
158
  return _this;
151
159
  }
@@ -154,7 +162,7 @@ var Maps = /** @class */ (function (_super) {
154
162
  *
155
163
  * Specifies whether the shape is selected in the maps or not.
156
164
  *
157
- * @returns {boolean} - Returns the boolean value.
165
+ * @returns {boolean} - Returns a boolean value to specify whether the shape is selected in the maps or not.
158
166
  */
159
167
  get: function () {
160
168
  return this.mapSelect;
@@ -201,6 +209,7 @@ var Maps = /** @class */ (function (_super) {
201
209
  *
202
210
  * @param {string} key - Specifies the key
203
211
  * @returns {string} - Returns the string value
212
+ * @private
204
213
  */
205
214
  Maps.prototype.getLocalizedLabel = function (key) {
206
215
  return this.localeObject.getConstant(key);
@@ -343,6 +352,7 @@ var Maps = /** @class */ (function (_super) {
343
352
  * @param {LayerSettings} layer - Specifies the layer for the maps.
344
353
  * @param {string} dataType - Specifies the data type for maps.
345
354
  * @returns {void}
355
+ * @private
346
356
  */
347
357
  Maps.prototype.processResponseJsonData = function (processType, data, layer, dataType) {
348
358
  this.serverProcess['response']++;
@@ -383,7 +393,6 @@ var Maps = /** @class */ (function (_super) {
383
393
  }
384
394
  if (!isNullOrUndefined(this.dataLabelModule)) {
385
395
  this.dataLabelModule.dataLabelCollections = [];
386
- this.dataLabelShape = [];
387
396
  }
388
397
  this.mapLayerPanel.measureLayerPanel();
389
398
  if (!isNullOrUndefined(this.svgObject)) {
@@ -486,6 +495,9 @@ var Maps = /** @class */ (function (_super) {
486
495
  }
487
496
  }
488
497
  this.zoomingChange();
498
+ if (this.zoomModule && this.isDevice) {
499
+ this.zoomModule.removeToolbarOpacity(this.isTileMap ? Math.round(this.tileZoomLevel) : this.mapScaleValue, this.element.id + '_Zooming_');
500
+ }
489
501
  if (!this.isZoomByPosition && !this.zoomNotApplied) {
490
502
  this.trigger(loaded, { maps: this, isResized: this.isResize });
491
503
  }
@@ -881,7 +893,7 @@ var Maps = /** @class */ (function (_super) {
881
893
  Maps.prototype.wireEVents = function () {
882
894
  //let cancelEvent: string = Browser.isPointer ? 'pointerleave' : 'mouseleave';
883
895
  EventHandler.add(this.element, 'click', this.mapsOnClick, this);
884
- // EventHandler.add(this.element, 'contextmenu', this.mapsOnRightClick, this);
896
+ EventHandler.add(this.element, 'contextmenu', this.mapsOnRightClick, this);
885
897
  EventHandler.add(this.element, 'dblclick', this.mapsOnDoubleClick, this);
886
898
  EventHandler.add(this.element, Browser.touchStartEvent, this.mouseDownOnMap, this);
887
899
  EventHandler.add(this.element, Browser.touchMoveEvent, this.mouseMoveOnMap, this);
@@ -901,7 +913,7 @@ var Maps = /** @class */ (function (_super) {
901
913
  Maps.prototype.unWireEVents = function () {
902
914
  //let cancelEvent: string = Browser.isPointer ? 'pointerleave' : 'mouseleave';
903
915
  EventHandler.remove(this.element, 'click', this.mapsOnClick);
904
- // EventHandler.remove(this.element, 'contextmenu', this.mapsOnRightClick);
916
+ EventHandler.remove(this.element, 'contextmenu', this.mapsOnRightClick);
905
917
  EventHandler.remove(this.element, 'dblclick', this.mapsOnDoubleClick);
906
918
  EventHandler.remove(this.element, Browser.touchStartEvent, this.mouseDownOnMap);
907
919
  EventHandler.remove(this.element, Browser.touchMoveEvent, this.mouseMoveOnMap);
@@ -917,6 +929,7 @@ var Maps = /** @class */ (function (_super) {
917
929
  *
918
930
  * @param {PointerEvent} e - Specifies the pointer event on maps.
919
931
  * @returns {void}
932
+ * @private
920
933
  */
921
934
  Maps.prototype.mouseLeaveOnMap = function (e) {
922
935
  if (document.getElementsByClassName('highlightMapStyle').length > 0 && this.legendModule) {
@@ -962,6 +975,7 @@ var Maps = /** @class */ (function (_super) {
962
975
  };
963
976
  Maps.prototype.keyDownHandler = function (event) {
964
977
  var zoom = this.zoomModule;
978
+ var id = event.target['id'];
965
979
  if ((event.code === 'ArrowUp' || event.code === 'ArrowDown' || event.code === 'ArrowLeft'
966
980
  || event.code === 'ArrowRight') && zoom) {
967
981
  var animatedTiles = document.getElementById(this.element.id + '_animated_tiles');
@@ -969,16 +983,18 @@ var Maps = /** @class */ (function (_super) {
969
983
  this.currentTiles = animatedTiles.cloneNode(true);
970
984
  }
971
985
  }
972
- if ((event.key === '+' || event.code === 'Equal') && zoom) {
986
+ if (this.zoomSettings.enable && zoom && (event.key === '+' || event.code === 'Equal')) {
973
987
  zoom.performZoomingByToolBar('zoomin');
974
988
  }
975
- else if ((event.key === '-' || event.code === 'Minus') && zoom) {
989
+ else if (this.zoomSettings.enable && zoom && (event.key === '-' || event.code === 'Minus')) {
976
990
  zoom.performZoomingByToolBar('zoomout');
977
991
  }
978
- else if (event['keyCode'] === 82 && zoom) {
992
+ else if (this.zoomSettings.enable && zoom && event['keyCode'] === 82) {
979
993
  zoom.performZoomingByToolBar('reset');
994
+ zoom.isPanning = false;
980
995
  }
981
- else if ((event.code === 'ArrowUp' || event.code === 'ArrowDown') && zoom) {
996
+ else if (this.zoomSettings.enable && this.zoomSettings.enablePanning && zoom
997
+ && (event.code === 'ArrowUp' || event.code === 'ArrowDown')) {
982
998
  event.preventDefault();
983
999
  zoom.mouseDownLatLong['x'] = 0;
984
1000
  zoom.mouseMoveLatLong['y'] = this.mapAreaRect.height / 7;
@@ -986,7 +1002,8 @@ var Maps = /** @class */ (function (_super) {
986
1002
  zoom.mouseMoveLatLong['y'], event);
987
1003
  zoom.mouseDownLatLong['y'] = zoom.mouseMoveLatLong['y'];
988
1004
  }
989
- else if ((event.code === 'ArrowLeft' || event.code === 'ArrowRight') && zoom) {
1005
+ else if (this.zoomSettings.enable && this.zoomSettings.enablePanning && zoom
1006
+ && (event.code === 'ArrowLeft' || event.code === 'ArrowRight')) {
990
1007
  event.preventDefault();
991
1008
  zoom.mouseDownLatLong['y'] = 0;
992
1009
  zoom.mouseMoveLatLong['x'] = this.mapAreaRect.width / 7;
@@ -994,7 +1011,7 @@ var Maps = /** @class */ (function (_super) {
994
1011
  zoom.mouseDownLatLong['x'] = zoom.mouseMoveLatLong['x'];
995
1012
  }
996
1013
  else if (event.code === 'Enter') {
997
- var id = event.target['id'];
1014
+ id = event.target['id'];
998
1015
  event.preventDefault();
999
1016
  if (this.legendModule && (id.indexOf('_Left_Page_Rect') > -1 || id.indexOf('_Right_Page_Rect') > -1)) {
1000
1017
  this.mapAreaRect = this.legendModule.initialMapAreaRect;
@@ -1024,6 +1041,9 @@ var Maps = /** @class */ (function (_super) {
1024
1041
  this.keyboardHighlightSelection(id, event.type);
1025
1042
  }
1026
1043
  }
1044
+ if (this.zoomModule) {
1045
+ this.zoomModule.removeToolbarOpacity(this.isTileMap ? Math.round(this.tileZoomLevel) : this.mapScaleValue, this.mouseMoveId);
1046
+ }
1027
1047
  };
1028
1048
  /**
1029
1049
  * Gets the selected element to be maintained or not.
@@ -1044,6 +1064,7 @@ var Maps = /** @class */ (function (_super) {
1044
1064
  *
1045
1065
  * @param {PointerEvent} e - Specifies the pointer event on maps.
1046
1066
  * @returns {void}
1067
+ * @private
1047
1068
  */
1048
1069
  Maps.prototype.mapsOnClick = function (e) {
1049
1070
  var _this = this;
@@ -1075,6 +1096,12 @@ var Maps = /** @class */ (function (_super) {
1075
1096
  });
1076
1097
  }
1077
1098
  }
1099
+ if (this.zoomModule) {
1100
+ this.zoomModule.removeToolbarOpacity(this.isTileMap ? Math.round(this.tileZoomLevel) : this.mapScaleValue, targetId);
1101
+ if (this.isDevice) {
1102
+ this.zoomModule.removeToolbarClass('', '', '', '', '');
1103
+ }
1104
+ }
1078
1105
  };
1079
1106
  Maps.prototype.clickHandler = function (e, eventArgs, targetEle) {
1080
1107
  if (targetEle.id.indexOf('shapeIndex') > -1) {
@@ -1106,6 +1133,27 @@ var Maps = /** @class */ (function (_super) {
1106
1133
  this.selectionModule.removedSelectionList(targetEle);
1107
1134
  }
1108
1135
  };
1136
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1137
+ Maps.prototype.getMarkerClickLocation = function (pageX, pageY, x, y, marker, isDragEnd) {
1138
+ document.getElementById(this.element.id + "_svg").style.cursor = 'grabbing';
1139
+ var targetElement = getElement(marker.targetId);
1140
+ var latLongValue = this.getClickLocation(marker.targetId, pageX, pageY, targetElement, x, y);
1141
+ var location = (this.isTileMap) ? convertTileLatLongToPoint(new MapLocation(latLongValue.longitude, latLongValue.latitude), this.scale, this.tileTranslatePoint, true) : convertGeoToPoint(latLongValue.latitude, latLongValue.longitude, this.mapLayerPanel.currentFactor, this.layersCollection[marker.layerIndex], this);
1142
+ var transPoint = this.translatePoint;
1143
+ var translateX = (this.isTileMap ? location.x : (location.x + transPoint.x) * this.scale);
1144
+ var translateY = (this.isTileMap ? location.y : (location.y + transPoint.y) * this.scale);
1145
+ if (this.markerDragArgument.shape !== 'Balloon') {
1146
+ targetElement.setAttribute('transform', 'translate( ' + translateX + ' ' + translateY + ' )');
1147
+ }
1148
+ else {
1149
+ targetElement.parentElement.setAttribute('transform', 'translate( ' + translateX + ' ' + translateY + ' )');
1150
+ }
1151
+ if (isDragEnd) {
1152
+ var markerSettings = this.layers[marker.layerIndex].markerSettings[marker.markerIndex];
1153
+ latLongValue = this.getClickLocation(marker.targetId, (pageX - markerSettings.offset.x), (pageY - markerSettings.offset.y), targetElement, (x - markerSettings.offset.x), (y - markerSettings.offset.y));
1154
+ }
1155
+ return latLongValue;
1156
+ };
1109
1157
  Maps.prototype.getClickLocation = function (targetId, pageX, pageY, targetElement, x, y) {
1110
1158
  var layerIndex = 0;
1111
1159
  var latLongValue;
@@ -1168,6 +1216,7 @@ var Maps = /** @class */ (function (_super) {
1168
1216
  *
1169
1217
  * @param {PointerEvent} e - Specifies the pointer event on maps.
1170
1218
  * @returns {boolean} - Returns the boolean value
1219
+ * @private
1171
1220
  */
1172
1221
  Maps.prototype.mouseEndOnMap = function (e) {
1173
1222
  var targetEle = e.target;
@@ -1178,13 +1227,16 @@ var Maps = /** @class */ (function (_super) {
1178
1227
  var pageY;
1179
1228
  var target;
1180
1229
  var touchArg;
1230
+ var layerX = 0;
1231
+ var layerY = 0;
1181
1232
  var rect = this.element.getBoundingClientRect();
1182
1233
  var element = e.target;
1183
1234
  if (e.type.indexOf('touch') !== -1) {
1184
1235
  this.isTouch = true;
1185
1236
  touchArg = e;
1186
- pageX = touchArg.changedTouches[0].pageX;
1237
+ layerX = pageX = touchArg.changedTouches[0].pageX;
1187
1238
  pageY = touchArg.changedTouches[0].pageY;
1239
+ layerY = pageY - (this.isTileMap ? 10 : 0);
1188
1240
  target = touchArg.target;
1189
1241
  this.mouseClickEvent = { x: pageX, y: pageY };
1190
1242
  }
@@ -1192,6 +1244,8 @@ var Maps = /** @class */ (function (_super) {
1192
1244
  this.isTouch = e.pointerType === 'touch';
1193
1245
  pageX = e.pageX;
1194
1246
  pageY = e.pageY;
1247
+ layerX = e['layerX'];
1248
+ layerY = e['layerY'] - (this.isTileMap ? 10 : 0);
1195
1249
  target = e.target;
1196
1250
  }
1197
1251
  if (this.isTileMap) {
@@ -1214,6 +1268,45 @@ var Maps = /** @class */ (function (_super) {
1214
1268
  if (e.cancelable && !this.isTouch) {
1215
1269
  e.preventDefault();
1216
1270
  }
1271
+ if (!isNullOrUndefined(this.markerDragArgument)) {
1272
+ var marker = this.markerDragArgument;
1273
+ this.mouseClickEvent['x'] = this.mouseDownEvent['x'];
1274
+ this.mouseClickEvent['y'] = this.mouseDownEvent['y'];
1275
+ var latLongValue = this.getMarkerClickLocation(pageX, pageY, layerX, layerY, this.markerDragArgument, true);
1276
+ var markerObject = this.layers[marker.layerIndex].markerSettings[marker.markerIndex];
1277
+ document.getElementById(this.element.id + "_svg").style.cursor = markerObject.enableDrag ? 'pointer' : 'grabbing';
1278
+ var dragEventArgs = {
1279
+ name: 'markerDragEnd', x: pageX, y: pageY,
1280
+ latitude: latLongValue.latitude, longitude: latLongValue.longitude,
1281
+ layerIndex: marker.layerIndex, markerIndex: marker.markerIndex,
1282
+ dataIndex: marker.dataIndex
1283
+ };
1284
+ if (isNullOrUndefined(markerObject.latitudeValuePath) && isNullOrUndefined(markerObject.longitudeValuePath)) {
1285
+ var data = markerObject.dataSource[marker.dataIndex];
1286
+ if (!isNullOrUndefined(data['Longitude']) && !isNullOrUndefined(data['Latitude'])) {
1287
+ markerObject.dataSource[marker.dataIndex].Latitude = dragEventArgs.latitude;
1288
+ markerObject.dataSource[marker.dataIndex].Longitude = dragEventArgs.longitude;
1289
+ }
1290
+ else {
1291
+ markerObject.dataSource[marker.dataIndex].latitude = dragEventArgs.latitude;
1292
+ markerObject.dataSource[marker.dataIndex].longitude = dragEventArgs.longitude;
1293
+ }
1294
+ }
1295
+ else {
1296
+ markerObject.dataSource[marker.dataIndex][markerObject.latitudeValuePath] = dragEventArgs.latitude;
1297
+ markerObject.dataSource[marker.dataIndex][markerObject.longitudeValuePath] = dragEventArgs.longitude;
1298
+ }
1299
+ this.markerDragId = '';
1300
+ this.markerDragArgument = null;
1301
+ this.trigger('markerDragEnd', dragEventArgs);
1302
+ }
1303
+ else {
1304
+ document.getElementById(this.element.id + "_svg").style.cursor = 'auto';
1305
+ }
1306
+ if (this.zoomModule && this.isDevice) {
1307
+ this.zoomModule.removeToolbarOpacity(this.isTileMap ? Math.round(this.tileZoomLevel) : this.scale, this.element.id + '_Zooming_');
1308
+ this.zoomModule.removeToolbarClass('', '', '', '', '');
1309
+ }
1217
1310
  return false;
1218
1311
  };
1219
1312
  /**
@@ -1221,6 +1314,7 @@ var Maps = /** @class */ (function (_super) {
1221
1314
  *
1222
1315
  * @param {PointerEvent} e - Specifies the pointer event on maps
1223
1316
  * @returns {void}
1317
+ * @private
1224
1318
  */
1225
1319
  Maps.prototype.mouseDownOnMap = function (e) {
1226
1320
  var pageX;
@@ -1231,8 +1325,12 @@ var Maps = /** @class */ (function (_super) {
1231
1325
  if (e.type.indexOf('touch') !== -1 && e.changedTouches) {
1232
1326
  this.mouseDownEvent = { x: e.changedTouches[0].pageX, y: e.changedTouches[0].pageY };
1233
1327
  }
1328
+ if (this.isDevice) {
1329
+ this.mapsTooltipModule.renderTooltip(e);
1330
+ }
1234
1331
  var rect = this.element.getBoundingClientRect();
1235
1332
  var element = e.target;
1333
+ this.markerDragId = element.id;
1236
1334
  var animatedTiles = document.getElementById(this.element.id + '_animated_tiles');
1237
1335
  if (this.isTileMap && !isNullOrUndefined(animatedTiles)) {
1238
1336
  this.currentTiles = animatedTiles.cloneNode(true);
@@ -1265,11 +1363,37 @@ var Maps = /** @class */ (function (_super) {
1265
1363
  this.markerModule.sameMarkerData = [];
1266
1364
  }
1267
1365
  };
1366
+ /**
1367
+ * @param {PointerEvent} e - Specifies the pointer event.
1368
+ * @returns {void}
1369
+ * @private
1370
+ */
1371
+ Maps.prototype.mapsOnRightClick = function (e) {
1372
+ var targetEle = e.target;
1373
+ var targetId = targetEle.id;
1374
+ var latitude = null;
1375
+ var longitude = null;
1376
+ this.mouseClickEvent = this.mouseDownEvent = { x: e.x, y: e.y };
1377
+ if (targetEle.id.indexOf('_ToolBar') === -1) {
1378
+ var latLongValue = this.getClickLocation(targetId, e.pageX, e.pageY, targetEle, e['layerX'], e['layerY']);
1379
+ if (!isNullOrUndefined(latLongValue)) {
1380
+ latitude = latLongValue.latitude;
1381
+ longitude = latLongValue.longitude;
1382
+ }
1383
+ var eventArgs = {
1384
+ cancel: false, name: rightClick, target: targetId, x: e.clientX, y: e.clientY,
1385
+ latitude: latitude, longitude: longitude,
1386
+ isShapeSelected: false
1387
+ };
1388
+ this.trigger('rightClick', eventArgs);
1389
+ }
1390
+ };
1268
1391
  /**
1269
1392
  * This method is used to perform operations when performing the double click operation on maps.
1270
1393
  *
1271
1394
  * @param {PointerEvent} e - Specifies the pointer event.
1272
1395
  * @returns {void}
1396
+ * @private
1273
1397
  */
1274
1398
  Maps.prototype.mapsOnDoubleClick = function (e) {
1275
1399
  this.notify('dblclick', e);
@@ -1305,6 +1429,7 @@ var Maps = /** @class */ (function (_super) {
1305
1429
  *
1306
1430
  * @param {PointerEvent} e - Specifies the pointer event on maps.
1307
1431
  * @returns {void}
1432
+ * @private
1308
1433
  */
1309
1434
  Maps.prototype.mouseMoveOnMap = function (e) {
1310
1435
  var pageX;
@@ -1324,6 +1449,9 @@ var Maps = /** @class */ (function (_super) {
1324
1449
  if (this.bubbleModule) {
1325
1450
  this.bubbleModule.bubbleMove(e);
1326
1451
  }
1452
+ if (target.id.indexOf('MarkerIndex') == -1) {
1453
+ document.getElementById(this.element.id + "_svg").style.cursor = 'auto';
1454
+ }
1327
1455
  this.onMouseMove(e);
1328
1456
  this.notify(Browser.touchMoveEvent, e);
1329
1457
  };
@@ -1332,19 +1460,42 @@ var Maps = /** @class */ (function (_super) {
1332
1460
  *
1333
1461
  * @param {PointerEvent} e - Specifies the pointer event on maps.
1334
1462
  * @returns {void}
1463
+ * @private
1335
1464
  */
1336
1465
  Maps.prototype.onMouseMove = function (e) {
1337
1466
  var element = e.target;
1467
+ this.mouseMoveId = element['id'];
1338
1468
  var pageX;
1339
1469
  var pageY;
1340
1470
  var target;
1341
1471
  var touchArg;
1342
- if (!this.isTouch) {
1472
+ var touches = null;
1473
+ var layerX = 0;
1474
+ var layerY = 0;
1475
+ if (e.type.indexOf('touch') == -1) {
1476
+ pageX = e.pageX;
1477
+ pageY = e.pageY;
1478
+ layerX = e['layerX'];
1479
+ layerY = e['layerY'] - (this.isTileMap ? 10 : 0);
1343
1480
  this.titleTooltip(e, e.pageX, e.pageY);
1344
1481
  if (!isNullOrUndefined(this.legendModule)) {
1345
1482
  this.legendTooltip(e, e.pageX, e.pageY, true);
1346
1483
  }
1347
1484
  }
1485
+ else {
1486
+ touches = e.touches;
1487
+ layerX = pageX = touches[0].clientX;
1488
+ layerY = pageY = touches[0].clientY - (this.isTileMap ? 10 : 0);
1489
+ }
1490
+ if (!isNullOrUndefined(this.markerDragArgument)) {
1491
+ var marker = this.markerDragArgument;
1492
+ this.mouseClickEvent['x'] = this.mouseDownEvent['x'];
1493
+ this.mouseClickEvent['y'] = this.mouseDownEvent['y'];
1494
+ this.getMarkerClickLocation(pageX, pageY, layerX, layerY, marker, false);
1495
+ }
1496
+ if (this.zoomModule) {
1497
+ this.zoomModule.removeToolbarOpacity(this.isTileMap ? Math.round(this.tileZoomLevel) : this.scale, e.target.id);
1498
+ }
1348
1499
  return false;
1349
1500
  };
1350
1501
  Maps.prototype.legendTooltip = function (event, x, y, isTouch) {
@@ -1427,10 +1578,8 @@ var Maps = /** @class */ (function (_super) {
1427
1578
  /**
1428
1579
  * This method is used to zoom the map by specifying the center position.
1429
1580
  *
1430
- * @param {number} centerPosition - Specifies the center position
1431
- * @param {number} centerPosition.latitude - Specifies the latitude value for the center position
1432
- * @param {number} centerPosition.longitude - Specifies the longitude value for the center position
1433
- * @param {number} zoomFactor - Specifies the zoom factor for maps.
1581
+ * @param {number} centerPosition - Specifies the location of the maps to be zoomed as geographical coordinates.
1582
+ * @param {number} zoomFactor - Specifies the zoom factor for the maps.
1434
1583
  * @returns {void}
1435
1584
  */
1436
1585
  Maps.prototype.zoomByPosition = function (centerPosition, zoomFactor) {
@@ -1467,8 +1616,8 @@ var Maps = /** @class */ (function (_super) {
1467
1616
  /**
1468
1617
  * This method is used to perform panning by specifying the direction.
1469
1618
  *
1470
- * @param {PanDirection} direction - Specifies the direction in which the panning is performed.
1471
- * @param {PointerEvent | TouchEvent} mouseLocation - Specifies the location of the mouse pointer in maps.
1619
+ * @param {PanDirection} direction - Specifies the direction in which the panning must be performed.
1620
+ * @param {PointerEvent | TouchEvent} mouseLocation - Specifies the location of the mouse pointer in maps in pixels.
1472
1621
  * @returns {void}
1473
1622
  */
1474
1623
  Maps.prototype.panByDirection = function (direction, mouseLocation) {
@@ -1497,7 +1646,7 @@ var Maps = /** @class */ (function (_super) {
1497
1646
  /**
1498
1647
  * This method is used to add the layers dynamically to the maps.
1499
1648
  *
1500
- * @param {Object} layer - Specifies the layer for the maps.
1649
+ * @param {Object} layer - Specifies the layer to be added in the maps.
1501
1650
  * @returns {void}
1502
1651
  */
1503
1652
  Maps.prototype.addLayer = function (layer) {
@@ -1509,7 +1658,7 @@ var Maps = /** @class */ (function (_super) {
1509
1658
  }
1510
1659
  };
1511
1660
  /**
1512
- * This method is used to remove a layer from map.
1661
+ * This method is used to remove a layer from the maps.
1513
1662
  *
1514
1663
  * @param {number} index - Specifies the index number of the layer to be removed.
1515
1664
  * @returns {void}
@@ -1523,7 +1672,7 @@ var Maps = /** @class */ (function (_super) {
1523
1672
  };
1524
1673
  /**
1525
1674
  * This method is used to add markers dynamically in the maps.
1526
- * If we provide the index value of the layer in which the marker to be added and the coordinates
1675
+ * If we provide the index value of the layer in which the marker to be added and the settings
1527
1676
  * of the marker as parameters, the marker will be added in the location.
1528
1677
  *
1529
1678
  * @param {number} layerIndex - Specifies the index number of the layer.
@@ -1545,12 +1694,12 @@ var Maps = /** @class */ (function (_super) {
1545
1694
  }
1546
1695
  };
1547
1696
  /**
1548
- * This method is used to select the geometric shape element in the maps component.
1697
+ * This method is used to select the geometric shape element in the maps.
1549
1698
  *
1550
1699
  * @param {number} layerIndex - Specifies the index of the layer in maps.
1551
1700
  * @param {string | string[]} propertyName - Specifies the property name from the data source.
1552
- * @param {string} name - Specifies the name of the shape that is selected.
1553
- * @param {boolean} enable - Specifies the shape selection to be enabled.
1701
+ * @param {string} name - Specifies the name of the shape, which is mapped from the data source, that is selected.
1702
+ * @param {boolean} enable - Specifies whether the shape should be selected or the selection should be removed.
1554
1703
  * @returns {void}
1555
1704
  */
1556
1705
  Maps.prototype.shapeSelection = function (layerIndex, propertyName, name, enable) {
@@ -1654,12 +1803,12 @@ var Maps = /** @class */ (function (_super) {
1654
1803
  }
1655
1804
  };
1656
1805
  /**
1657
- * This method is used to zoom the maps component based on the provided coordinates.
1806
+ * This method is used to zoom the maps based on the provided coordinates.
1658
1807
  *
1659
- * @param {number} minLatitude - Specifies the minimum latitude to be zoomed.
1660
- * @param {number} minLongitude - Specifies the minimum latitude to be zoomed.
1661
- * @param {number} maxLatitude - Specifies the maximum latitude to be zoomed.
1662
- * @param {number} maxLongitude - Specifies the maximum longitude to be zoomed.
1808
+ * @param {number} minLatitude - Specifies the minimum latitude of the location to be zoomed.
1809
+ * @param {number} minLongitude - Specifies the minimum latitude of the location to be zoomed.
1810
+ * @param {number} maxLatitude - Specifies the maximum latitude of the location to be zoomed.
1811
+ * @param {number} maxLongitude - Specifies the maximum longitude of the location to be zoomed.
1663
1812
  * @returns {void}
1664
1813
  */
1665
1814
  Maps.prototype.zoomToCoordinates = function (minLatitude, minLongitude, maxLatitude, maxLongitude) {
@@ -1702,7 +1851,7 @@ var Maps = /** @class */ (function (_super) {
1702
1851
  this.maxLatOfGivenLocation = maxLatitude;
1703
1852
  this.maxLongOfGivenLocation = maxLongitude;
1704
1853
  this.zoomNotApplied = true;
1705
- this.scaleOfGivenLocation = calculateZoomLevel(minLatitude, maxLatitude, minLongitude, maxLongitude, this.mapAreaRect.width, this.mapAreaRect.height, this);
1854
+ this.scaleOfGivenLocation = calculateZoomLevel(minLatitude, maxLatitude, minLongitude, maxLongitude, this.mapAreaRect.width, this.mapAreaRect.height, this, true);
1706
1855
  var zoomArgs = {
1707
1856
  cancel: false, name: 'zoom', type: zoomIn, maps: this,
1708
1857
  tileTranslatePoint: {}, translatePoint: {},
@@ -1736,7 +1885,7 @@ var Maps = /** @class */ (function (_super) {
1736
1885
  this.legendSelectionCollection = [];
1737
1886
  };
1738
1887
  /**
1739
- * This method is used to set culture for maps component.
1888
+ * This method is used to set culture for maps.
1740
1889
  *
1741
1890
  * @returns {void}
1742
1891
  */
@@ -1746,7 +1895,7 @@ var Maps = /** @class */ (function (_super) {
1746
1895
  this.localeObject = new L10n(this.getModuleName(), this.defaultLocalConstants, this.locale);
1747
1896
  };
1748
1897
  /**
1749
- * This method to set locale constants to the maps component.
1898
+ * This method to set locale constants to the maps.
1750
1899
  *
1751
1900
  * @returns {void}
1752
1901
  */
@@ -1762,7 +1911,7 @@ var Maps = /** @class */ (function (_super) {
1762
1911
  };
1763
1912
  };
1764
1913
  /**
1765
- * This method disposes the maps component.
1914
+ * This method destroys the maps. This method removes the events associated with the maps and disposes the objects created for rendering and updating the maps.
1766
1915
  *
1767
1916
  * @returns {void}
1768
1917
  */
@@ -1799,6 +1948,7 @@ var Maps = /** @class */ (function (_super) {
1799
1948
  * Gets component name
1800
1949
  *
1801
1950
  * @returns {string} - Returns the string value
1951
+ * @private
1802
1952
  */
1803
1953
  Maps.prototype.getModuleName = function () {
1804
1954
  return 'maps';
@@ -2113,7 +2263,7 @@ var Maps = /** @class */ (function (_super) {
2113
2263
  return isVisible;
2114
2264
  };
2115
2265
  /**
2116
- * This method handles the printing functionality for the maps component.
2266
+ * This method handles the printing functionality for the maps.
2117
2267
  *
2118
2268
  * @param {string[] | string | Element} id - Specifies the element to be printed.
2119
2269
  * @returns {void}
@@ -2124,13 +2274,13 @@ var Maps = /** @class */ (function (_super) {
2124
2274
  }
2125
2275
  };
2126
2276
  /**
2127
- * This method handles the export functionality for the maps component.
2277
+ * This method handles the export functionality for the maps.
2128
2278
  *
2129
2279
  * @param {ExportType} type - Specifies the type of the exported file.
2130
2280
  * @param {string} fileName - Specifies the name of the file with which the rendered maps need to be exported.
2131
- * @param {PdfPageOrientation} orientation - Specifies the orientation of the pdf document in exporting.
2132
- * @param {boolean} allowDownload - Specifies whether to download as a file or get as base64 string for the file
2133
- * @returns {Promise<string>} - Returns the string value.
2281
+ * @param {PdfPageOrientation} orientation - Specifies the orientation of the PDF document while exporting.
2282
+ * @param {boolean} allowDownload - Specifies whether to download as a file or get as base64 string for the file.
2283
+ * @returns {Promise<string>} - Specifies the base64 string of the exported image which is returned when the `allowDownload` is set to false.
2134
2284
  */
2135
2285
  Maps.prototype.export = function (type, fileName, orientation, allowDownload) {
2136
2286
  var _this = this;
@@ -2154,8 +2304,8 @@ var Maps = /** @class */ (function (_super) {
2154
2304
  /**
2155
2305
  * This method is used to get the Bing maps URL.
2156
2306
  *
2157
- * @param {string} url - Specifies the URL of the maps.
2158
- * @returns {Promise<string>} - Returns the processed Bing URL as Promise.
2307
+ * @param {string} url - Specifies the URL of the Bing maps along with the API key.
2308
+ * @returns {Promise<string>} - Returns the processed Bing URL as `Promise`.
2159
2309
  */
2160
2310
  Maps.prototype.getBingUrlTemplate = function (url) {
2161
2311
  var promise;
@@ -2246,20 +2396,20 @@ var Maps = /** @class */ (function (_super) {
2246
2396
  };
2247
2397
  };
2248
2398
  /**
2249
- * This method is used to get the geo location points.
2399
+ * This method is used to get the geographical coordinates for location points in pixels when shape maps are rendered in the maps.
2250
2400
  *
2251
- * @param {number} layerIndex - Specifies the index number of the layer of the map.
2252
- * @param {number} x - Specifies the x value.
2253
- * @param {number} y - Specifies the y value.
2254
- * @returns {GeoPosition}- Returns the geo position
2401
+ * @param {number} layerIndex - Specifies the index number of the layer of the maps.
2402
+ * @param {number} x - Specifies the x value in pixel.
2403
+ * @param {number} y - Specifies the y value in pixel.
2404
+ * @returns {GeoPosition}- Returns the geographical coordinates.
2255
2405
  */
2256
2406
  Maps.prototype.getGeoLocation = function (layerIndex, x, y) {
2257
2407
  var latitude = 0;
2258
2408
  var longitude = 0;
2259
2409
  if (!this.isDestroyed) {
2260
2410
  var container = document.getElementById(this.element.id);
2261
- var pageX = x - container.offsetLeft;
2262
- var pageY = y - container.offsetTop;
2411
+ var pageX = x - (isNullOrUndefined(this.markerDragArgument) ? container.offsetLeft : 0);
2412
+ var pageY = y - (isNullOrUndefined(this.markerDragArgument) ? container.offsetTop : 0);
2263
2413
  var currentLayer = this.layersCollection[layerIndex];
2264
2414
  var translate = getTranslate(this, currentLayer, false);
2265
2415
  var translatePoint = translate['location'];
@@ -2278,11 +2428,11 @@ var Maps = /** @class */ (function (_super) {
2278
2428
  return Math.min(Math.max(value, minVal), maxVal);
2279
2429
  };
2280
2430
  /**
2281
- * This method is used to get the geo location points when tile maps is rendered in the maps component.
2431
+ * This method is used to get the geographical coordinates for location points in pixels when an online map provider is rendered in the maps.
2282
2432
  *
2283
- * @param {number} x - Specifies the x value
2284
- * @param {number} y - Specifies the y value
2285
- * @returns {GeoPosition} - Returns the position
2433
+ * @param {number} x - Specifies the x value in pixel.
2434
+ * @param {number} y - Specifies the y value in pixel.
2435
+ * @returns {GeoPosition} - Returns the geographical coordinates.
2286
2436
  */
2287
2437
  Maps.prototype.getTileGeoLocation = function (x, y) {
2288
2438
  var latitude = 0;
@@ -2290,25 +2440,25 @@ var Maps = /** @class */ (function (_super) {
2290
2440
  if (!this.isDestroyed) {
2291
2441
  var container = document.getElementById(this.element.id);
2292
2442
  var ele = document.getElementById(this.element.id + '_tile_parent');
2293
- var latLong = this.pointToLatLong(x + this.mapAreaRect.x - (ele.offsetLeft - container.offsetLeft), y + this.mapAreaRect.y - (ele.offsetTop - container.offsetTop));
2443
+ var latLong = this.pointToLatLong(x + this.mapAreaRect.x - (ele.offsetLeft - (isNullOrUndefined(this.markerDragArgument) ? container.offsetLeft : 0)), y + this.mapAreaRect.y - (ele.offsetTop - (isNullOrUndefined(this.markerDragArgument) ? container.offsetTop : 0)));
2294
2444
  latitude = latLong['latitude'];
2295
2445
  longitude = latLong['longitude'];
2296
2446
  }
2297
2447
  return { latitude: latitude, longitude: longitude };
2298
2448
  };
2299
2449
  /**
2300
- * This method is used to convert the point to latitude and longitude in maps.
2450
+ * This method is used to convert the point in pixels to latitude and longitude in maps.
2301
2451
  *
2302
- * @param {number} pageX - Specifies the x value for the page.
2303
- * @param {number} pageY - Specifies the y value for the page.
2304
- * @returns {Object} - Returns the object.
2452
+ * @param {number} pageX - Specifies the x position value in pixels.
2453
+ * @param {number} pageY - Specifies the y position value in pixels.
2454
+ * @returns {Object} - Returns the latitude and longitude values.
2305
2455
  */
2306
2456
  Maps.prototype.pointToLatLong = function (pageX, pageY) {
2307
2457
  var latitude = 0;
2308
2458
  var longitude = 0;
2309
2459
  if (!this.isDestroyed) {
2310
2460
  var padding = this.layers[this.layers.length - 1].layerType === 'GoogleStaticMap' ? 0 : 10;
2311
- pageY = (this.zoomSettings.enable) ? pageY + padding : pageY;
2461
+ pageY = pageY + padding;
2312
2462
  var mapSize = 256 * Math.pow(2, this.tileZoomLevel);
2313
2463
  var x1 = (this.clip(pageX - (this.translatePoint.x * this.scale), 0, mapSize - 1) / mapSize) - 0.5;
2314
2464
  var y1 = 0.5 - (this.clip(pageY - (this.translatePoint.y * this.scale), 0, mapSize - 1) / mapSize);
@@ -2446,6 +2596,12 @@ var Maps = /** @class */ (function (_super) {
2446
2596
  __decorate([
2447
2597
  Event()
2448
2598
  ], Maps.prototype, "markerClick", void 0);
2599
+ __decorate([
2600
+ Event()
2601
+ ], Maps.prototype, "markerDragStart", void 0);
2602
+ __decorate([
2603
+ Event()
2604
+ ], Maps.prototype, "markerDragEnd", void 0);
2449
2605
  __decorate([
2450
2606
  Event()
2451
2607
  ], Maps.prototype, "markerClusterClick", void 0);