@syncfusion/ej2-maps 19.4.56 → 20.1.55

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 19.4.56
3
+ * version : 20.1.55
4
4
  * Copyright Syncfusion Inc. 2001 - 2020. All rights reserved.
5
5
  * Use of this code is subject to the terms of our license.
6
6
  * A copy of the current license can be obtained at any time by e-mailing
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "_from": "@syncfusion/ej2-maps@*",
3
- "_id": "@syncfusion/ej2-maps@19.4.55",
3
+ "_id": "@syncfusion/ej2-maps@20.1.48",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-q9a3UHN4IPE+Dj7luY6xOJVNcEKEpTSLOkaXdJdNxCf883wYbcX5oTu88Ab2Pbj8tIPwPJuvt5bt8b7bfBPJ/A==",
5
+ "_integrity": "sha512-Q9Bjk9kbgqAvOxaOLh3wnmOx6gYLBhcPPuOipozUN3uRcN7dS9SDcTfNM00eROJk8OlXSrnFZNG7T+HqInhgeQ==",
6
6
  "_location": "/@syncfusion/ej2-maps",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -23,8 +23,8 @@
23
23
  "/@syncfusion/ej2-react-maps",
24
24
  "/@syncfusion/ej2-vue-maps"
25
25
  ],
26
- "_resolved": "http://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-maps/-/ej2-maps-19.4.55.tgz",
27
- "_shasum": "68aeba0a91caa2c3c4aa2d6d01c2bc2e163e692c",
26
+ "_resolved": "http://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-maps/-/ej2-maps-20.1.48.tgz",
27
+ "_shasum": "75977d2b5ff33ae4dafe2fc6441182eee72f6586",
28
28
  "_spec": "@syncfusion/ej2-maps@*",
29
29
  "_where": "/jenkins/workspace/automation_release_19.1.0.1-ZPMUBNQ6AUYH6YGEFBPVYMEQLRRW2SLD4XCZ6GATNZJFYJ3RIAOA/packages/included",
30
30
  "author": {
@@ -35,13 +35,13 @@
35
35
  },
36
36
  "bundleDependencies": false,
37
37
  "dependencies": {
38
- "@syncfusion/ej2-base": "~19.4.52",
39
- "@syncfusion/ej2-buttons": "~19.4.55",
40
- "@syncfusion/ej2-compression": "~19.4.52",
41
- "@syncfusion/ej2-data": "~19.4.54",
42
- "@syncfusion/ej2-file-utils": "~19.4.52",
43
- "@syncfusion/ej2-pdf-export": "~19.4.52",
44
- "@syncfusion/ej2-svg-base": "~19.4.52"
38
+ "@syncfusion/ej2-base": "~20.1.55",
39
+ "@syncfusion/ej2-buttons": "~20.1.55",
40
+ "@syncfusion/ej2-compression": "~20.1.55",
41
+ "@syncfusion/ej2-data": "~20.1.55",
42
+ "@syncfusion/ej2-file-utils": "~20.1.55",
43
+ "@syncfusion/ej2-pdf-export": "~20.1.55",
44
+ "@syncfusion/ej2-svg-base": "~20.1.55"
45
45
  },
46
46
  "deprecated": false,
47
47
  "description": "The Maps component is used to visualize the geographical data and represent the statistical data of a particular geographical area on earth with user interactivity, and provides various customizing options",
@@ -80,6 +80,6 @@
80
80
  "url": "git+https://github.com/syncfusion/ej2-javascript-ui-controls.git"
81
81
  },
82
82
  "typings": "index.d.ts",
83
- "version": "19.4.56",
83
+ "version": "20.1.55",
84
84
  "sideEffects": false
85
85
  }
@@ -256,7 +256,7 @@ var DataLabel = /** @class */ (function () {
256
256
  _this.value[index] = { rightWidth: xpositionEnds, leftWidth: xpositionStart, heightTop: start, heightBottom: end };
257
257
  var labelElement;
258
258
  if (eventargs_1.template !== '') {
259
- templateFn = getTemplateFunction(eventargs_1.template);
259
+ templateFn = getTemplateFunction(eventargs_1.template, _this.maps);
260
260
  var templateElement = templateFn ? templateFn(!isNullOrUndefined(datasrcObj) ?
261
261
  datasrcObj : shapeData['properties'], _this.maps, eventargs_1.template, _this.maps.element.id + '_LabelTemplate', false) : document.createElement('div');
262
262
  templateElement.innerHTML = !templateFn ? eventargs_1.template : '';
@@ -1303,7 +1303,7 @@ var Legend = /** @class */ (function () {
1303
1303
  data[_this.maps.legendSettings.showLegendPath];
1304
1304
  if (marker.visible && showLegend && (!isNullOrUndefined(data['latitude'])) && (!isNullOrUndefined(data['longitude']))) {
1305
1305
  if (marker.template) {
1306
- templateFn = getTemplateFunction(marker.template);
1306
+ templateFn = getTemplateFunction(marker.template, _this.maps);
1307
1307
  var templateElement = templateFn(_this.maps);
1308
1308
  var markerEle = isNullOrUndefined(templateElement.childElementCount) ? templateElement[0] :
1309
1309
  templateElement;
@@ -53,10 +53,10 @@ var Marker = /** @class */ (function () {
53
53
  eventArgs = markerShapeChoose(eventArgs, data);
54
54
  var lng = (!isNullOrUndefined(markerSettings.longitudeValuePath)) ?
55
55
  Number(getValueFromObject(data, markerSettings.longitudeValuePath)) : !isNullOrUndefined(data['longitude']) ?
56
- parseFloat(data['longitude']) : !isNullOrUndefined(data['Longitude']) ? parseFloat(data['Longitude']) : 0;
56
+ parseFloat(data['longitude']) : !isNullOrUndefined(data['Longitude']) ? parseFloat(data['Longitude']) : null;
57
57
  var lat = (!isNullOrUndefined(markerSettings.latitudeValuePath)) ?
58
58
  Number(getValueFromObject(data, markerSettings.latitudeValuePath)) : !isNullOrUndefined(data['latitude']) ?
59
- parseFloat(data['latitude']) : !isNullOrUndefined(data['Latitude']) ? parseFloat(data['Latitude']) : 0;
59
+ parseFloat(data['latitude']) : !isNullOrUndefined(data['Latitude']) ? parseFloat(data['Latitude']) : null;
60
60
  var offset = markerSettings.offset;
61
61
  if (!eventArgs.cancel && markerSettings.visible && !isNullOrUndefined(lng) && !isNullOrUndefined(lat)) {
62
62
  var markerID = _this.maps.element.id + '_LayerIndex_' + layerIndex + '_MarkerIndex_'
@@ -101,7 +101,7 @@ var Marker = /** @class */ (function () {
101
101
  _this.maps.renderReactTemplates();
102
102
  }
103
103
  }
104
- if (markerTemplateEle.childElementCount === (markerData.length - markerCount - nullCount) && getElementByID(_this.maps.element.id + '_Secondary_Element')) {
104
+ if (markerTemplateEle.childElementCount === (markerDataLength - markerCount - nullCount) && getElementByID(_this.maps.element.id + '_Secondary_Element')) {
105
105
  getElementByID(_this.maps.element.id + '_Secondary_Element').appendChild(markerTemplateEle);
106
106
  if (_this.maps.checkInitialRender) {
107
107
  if (currentLayer.markerClusterSettings.allowClustering) {
@@ -354,7 +354,7 @@ var Marker = /** @class */ (function () {
354
354
  if ((target.indexOf('_cluster_') > -1)) {
355
355
  var isClusterSame = false;
356
356
  var clusterElement = document.getElementById(target.indexOf('_datalabel_') > -1 ? target.split('_datalabel_')[0] : target);
357
- var indexes = clusterElement.innerHTML.split(',').map(Number);
357
+ var indexes = layer.markerClusterSettings.shape === 'Balloon' ? clusterElement.children[0].innerHTML.split(',').map(Number) : clusterElement.innerHTML.split(',').map(Number);
358
358
  collection_1 = [];
359
359
  for (var _i = 0, indexes_1 = indexes; _i < indexes_1.length; _i++) {
360
360
  var i = indexes_1[_i];
package/src/maps/maps.js CHANGED
@@ -75,6 +75,10 @@ var Maps = /** @class */ (function (_super) {
75
75
  * Resize the map
76
76
  */
77
77
  _this.isResize = false;
78
+ /**
79
+ * @private
80
+ */
81
+ _this.isReset = false;
78
82
  /** @private */
79
83
  _this.baseSize = new Size(0, 0);
80
84
  /** @public */
@@ -1759,7 +1763,10 @@ var Maps = /** @class */ (function (_super) {
1759
1763
  var collection = Object.keys(newProp.layers[x]);
1760
1764
  for (var _b = 0, collection_1 = collection; _b < collection_1.length; _b++) {
1761
1765
  var collectionProp = collection_1[_b];
1762
- if (collectionProp === 'markerSettings') {
1766
+ if (collectionProp === 'layerType' && newProp.layers[x].layerType === 'OSM') {
1767
+ this.isReset = true;
1768
+ }
1769
+ else if (collectionProp === 'markerSettings') {
1763
1770
  isMarker = true;
1764
1771
  }
1765
1772
  else if (collectionProp === 'staticMapType') {
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable @typescript-eslint/no-unused-vars */
2
2
  import { createElement, Browser, isNullOrUndefined } from '@syncfusion/ej2-base';
3
- import { triggerDownload, getElementByID, getClientElement } from '../utils/helper';
3
+ import { triggerDownload, getElementByID } from '../utils/helper';
4
4
  /**
5
5
  * This module enables the export to Image functionality in Maps control.
6
6
  *
@@ -38,7 +38,6 @@ var ImageExport = /** @class */ (function () {
38
38
  var isDownload = !(Browser.userAgent.toString().indexOf('HeadlessChrome') > -1);
39
39
  var toolbarEle = document.getElementById(_this.control.element.id + '_ToolBar');
40
40
  var svgParent = document.getElementById(_this.control.element.id + '_Tile_SVG_Parent');
41
- var tileParent = document.getElementById(_this.control.element.id + '_tile_parent');
42
41
  var svgDataElement;
43
42
  var tileSvg;
44
43
  var svgObject = getElementByID(_this.control.element.id + '_svg').cloneNode(true);
@@ -83,7 +82,9 @@ var ImageExport = /** @class */ (function () {
83
82
  image_1.src = url;
84
83
  }
85
84
  else {
86
- var extraSpace_1 = getClientElement(_this.control.element.id);
85
+ var svgParentElement = document.getElementById(_this.control.element.id + '_MapAreaBorder');
86
+ var top_1 = parseFloat(svgParentElement.getAttribute('y'));
87
+ var left_1 = parseFloat(svgParentElement.getAttribute('x'));
87
88
  var imgxHttp = new XMLHttpRequest();
88
89
  var imgTileLength_1 = _this.control.mapLayerPanel.tiles.length;
89
90
  var _loop_1 = function (i) {
@@ -102,16 +103,17 @@ var ImageExport = /** @class */ (function () {
102
103
  if (i === 0 || i === imgTileLength_1 + 1) {
103
104
  if (i === 0) {
104
105
  ctxt_1.setTransform(1, 0, 0, 1, 0, 0);
105
- ctxt_1.rect(0, parseFloat(svgParent.style.top), parseFloat(svgParent.style.width), parseFloat(svgParent.style.height));
106
+ ctxt_1.rect(0, top_1, parseFloat(svgParent.style.width), parseFloat(svgParent.style.height));
106
107
  ctxt_1.clip();
107
108
  }
108
109
  else {
109
- ctxt_1.setTransform(1, 0, 0, 1, parseFloat(svgParent.style.left), (parseFloat(tileParent.style.top) - extraSpace_1["top"]));
110
+ ctxt_1.setTransform(1, 0, 0, 1, left_1, top_1);
110
111
  }
111
112
  }
112
113
  else {
113
- ctxt_1.setTransform(1, 0, 0, 1, parseFloat(tile.style.left) + _this.control.margin.left, parseFloat(tile.style.top) +
114
- (parseFloat(tileParent.style.top)) - extraSpace_1["top"]);
114
+ var tileParent = document.getElementById(_this.control.element.id + '_tile_parent');
115
+ ctxt_1.setTransform(1, 0, 0, 1, parseFloat(tile.style.left) + left_1, parseFloat(tile.style.top) +
116
+ top_1);
115
117
  }
116
118
  ctxt_1.drawImage(exportTileImg, 0, 0);
117
119
  if (i === imgTileLength_1 + 1) {
@@ -1,7 +1,6 @@
1
1
  /* eslint-disable @typescript-eslint/no-unused-vars */
2
2
  import { createElement, isNullOrUndefined } from '@syncfusion/ej2-base';
3
3
  import { PdfPageOrientation, PdfDocument, PdfBitmap } from '@syncfusion/ej2-pdf-export';
4
- import { getClientElement } from '../utils/helper';
5
4
  /**
6
5
  * This module enables the export to PDF functionality in Maps control.
7
6
  *
@@ -41,11 +40,10 @@ var PdfExport = /** @class */ (function () {
41
40
  var svgParent = document.getElementById(_this.control.element.id + '_Tile_SVG_Parent');
42
41
  var svgData;
43
42
  var exportElement = _this.control.svgObject.cloneNode(true);
44
- var tileParent = document.getElementById(_this.control.element.id + '_tile_parent');
45
43
  var backgroundElement = exportElement.childNodes[0];
46
44
  var backgroundColor = backgroundElement.getAttribute('fill');
47
- if ((_this.control.theme === 'Tailwind' || _this.control.theme === 'TailwindDark' || _this.control.theme === 'Bootstrap5' || _this.control.theme === 'Bootstrap5Dark')
48
- && (backgroundColor === 'rgba(255,255,255, 0.0)' || backgroundColor === 'transparent')) {
45
+ if ((_this.control.theme === 'Tailwind' || _this.control.theme === 'TailwindDark' || _this.control.theme === 'Bootstrap5' || _this.control.theme === 'Bootstrap5Dark'
46
+ || _this.control.theme === 'Fluent' || _this.control.theme === 'FluentDark') && (backgroundColor === 'rgba(255,255,255, 0.0)' || backgroundColor === 'transparent')) {
49
47
  exportElement.childNodes[0].setAttribute('fill', 'rgba(255,255,255, 1)');
50
48
  }
51
49
  var url = window.URL.createObjectURL(new Blob(type === 'SVG' ? [svgData] :
@@ -74,7 +72,9 @@ var PdfExport = /** @class */ (function () {
74
72
  image.src = url;
75
73
  }
76
74
  else {
77
- var extraSpace_1 = getClientElement(_this.control.element.id);
75
+ var svgParentElement = document.getElementById(_this.control.element.id + '_MapAreaBorder');
76
+ var top_1 = parseFloat(svgParentElement.getAttribute('y'));
77
+ var left_1 = parseFloat(svgParentElement.getAttribute('x'));
78
78
  var xHttp = new XMLHttpRequest();
79
79
  var tileLength_1 = _this.control.mapLayerPanel.tiles.length;
80
80
  var _loop_1 = function (i) {
@@ -93,16 +93,16 @@ var PdfExport = /** @class */ (function () {
93
93
  if (i === 0 || i === tileLength_1 + 1) {
94
94
  if (i === 0) {
95
95
  ctx.setTransform(1, 0, 0, 1, 0, 0);
96
- ctx.rect(0, parseFloat(svgParent.style.top), parseFloat(svgParent.style.width), parseFloat(svgParent.style.height));
96
+ ctx.rect(0, top_1, parseFloat(svgParent.style.width), parseFloat(svgParent.style.height));
97
97
  ctx.clip();
98
98
  }
99
99
  else {
100
- ctx.setTransform(1, 0, 0, 1, parseFloat(svgParent.style.left), (parseFloat(tileParent.style.top) - extraSpace_1["top"]));
100
+ ctx.setTransform(1, 0, 0, 1, left_1, top_1);
101
101
  }
102
102
  }
103
103
  else {
104
- ctx.setTransform(1, 0, 0, 1, parseFloat(tile.style.left) + _this.control.margin.left, (parseFloat(tile.style.top) +
105
- (parseFloat(tileParent.style.top)) - extraSpace_1["top"]));
104
+ var tileParent = document.getElementById(_this.control.element.id + '_tile_parent');
105
+ ctx.setTransform(1, 0, 0, 1, parseFloat(tile.style.left) + left_1, parseFloat(tile.style.top) + top_1);
106
106
  }
107
107
  ctx.drawImage(tileImg, 0, 0);
108
108
  if (i === tileLength_1 + 1) {
@@ -47,7 +47,27 @@ var Print = /** @class */ (function () {
47
47
  Print.prototype.getHTMLContent = function (elements) {
48
48
  var elementRect = getClientElement(this.control.element.id);
49
49
  var div = createElement('div');
50
- div.setAttribute("style", "margin-top:" + elementRect["top"] + "px");
50
+ var divElement = this.control.element.cloneNode(true);
51
+ if (this.control.isTileMap) {
52
+ for (var i = 0; i < divElement.childElementCount; i++) {
53
+ if (divElement.children[i].id === this.control.element.id + '_tile_parent') {
54
+ divElement.children[i].style.removeProperty('height');
55
+ divElement.children[i].style.removeProperty('width');
56
+ divElement.children[i].style.removeProperty('top');
57
+ divElement.children[i].style.removeProperty('left');
58
+ divElement.children[i].style.removeProperty('right');
59
+ divElement.children[i].style.removeProperty('overflow');
60
+ var svgElement = document.getElementById(this.control.element.id + '_Tile_SVG_Parent');
61
+ divElement.children[i].children[0].style.overflow = 'hidden';
62
+ divElement.children[i].children[0].style.position = 'absolute';
63
+ divElement.children[i].children[0].style.height = svgElement.style.height;
64
+ divElement.children[i].children[0].style.width = svgElement.style.width;
65
+ divElement.children[i].children[0].style.left = svgElement.style.left;
66
+ divElement.children[i].children[0].style.top = svgElement.style.top;
67
+ break;
68
+ }
69
+ }
70
+ }
51
71
  if (elements) {
52
72
  if (elements instanceof Array) {
53
73
  Array.prototype.forEach.call(elements, function (value) {
@@ -62,7 +82,7 @@ var Print = /** @class */ (function () {
62
82
  }
63
83
  }
64
84
  else {
65
- div.appendChild(this.control.element.cloneNode(true));
85
+ div.appendChild(divElement);
66
86
  }
67
87
  return div;
68
88
  };
@@ -183,11 +183,11 @@ export function getShapeColor(theme) {
183
183
  themePalette = ['#5ECB9B', '#A860F1', '#EBA844', '#557EF7', '#E9599B',
184
184
  '#BFC529', '#3BC6CF', '#7A68EC', '#74B706', '#EA6266'];
185
185
  break;
186
- case 'fluentui':
186
+ case 'fluent':
187
187
  themePalette = ['#614570', '#4C6FB1', '#CC6952', '#3F579A', '#4EA09B',
188
188
  '#6E7A89', '#D4515C', '#E6AF5D', '#639751', '#9D4D69'];
189
189
  break;
190
- case 'fluentuidark':
190
+ case 'fluentdark':
191
191
  themePalette = ['#8AB113', '#2A72D5', '#43B786', '#584EC6', '#E85F9C',
192
192
  '#6E7A89', '#EA6266', '#EBA844', '#26BC7A', '#BC4870'];
193
193
  break;
@@ -476,7 +476,7 @@ export function getThemeStyle(theme) {
476
476
  shapeFill: '#495057'
477
477
  };
478
478
  break;
479
- case 'fluentui':
479
+ case 'fluent':
480
480
  style = {
481
481
  backgroundColor: 'rgba(255,255,255, 0.0)',
482
482
  areaBackgroundColor: 'rgba(255,255,255, 0.0)',
@@ -499,7 +499,7 @@ export function getThemeStyle(theme) {
499
499
  shapeFill: '#F3F2F1'
500
500
  };
501
501
  break;
502
- case 'fluentuidark':
502
+ case 'fluentdark':
503
503
  style = {
504
504
  backgroundColor: 'rgba(255,255,255, 0.0)',
505
505
  areaBackgroundColor: 'rgba(255,255,255, 0.0)',
@@ -53,7 +53,7 @@ var Annotations = /** @class */ (function () {
53
53
  if (argsData.cancel) {
54
54
  return;
55
55
  }
56
- templateFn = getTemplateFunction(argsData.content);
56
+ templateFn = getTemplateFunction(argsData.content, _this.map);
57
57
  if (templateFn && templateFn(_this.map, _this.map, argsData.content, _this.map.element.id + '_ContentTemplate_' + annotationIndex).length) {
58
58
  templateElement = Array.prototype.slice.call(templateFn(_this.map, _this.map, argsData.content, _this.map.element.id + '_ContentTemplate_' + annotationIndex));
59
59
  var length_1 = templateElement.length;
@@ -27,7 +27,8 @@ export declare class MapsTooltip {
27
27
  private setTooltipContent;
28
28
  private formatter;
29
29
  mouseUpHandler(e: PointerEvent): void;
30
- removeTooltip(): void;
30
+ removeTooltip(): boolean;
31
+ private clearTooltip;
31
32
  /**
32
33
  * To bind events for tooltip module
33
34
  */
@@ -228,6 +228,10 @@ var MapsTooltip = /** @class */ (function () {
228
228
  fill: tooltipArgs.fill || _this.maps.themeStyle.tooltipFillColor
229
229
  });
230
230
  }
231
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
232
+ if (_this.maps.isVue || _this.maps.isVue3) {
233
+ _this.svgTooltip.controlInstance = _this.maps;
234
+ }
231
235
  _this.svgTooltip.opacity = _this.maps.themeStyle.tooltipFillOpacity || _this.svgTooltip.opacity;
232
236
  _this.svgTooltip.appendTo(tooltipEle);
233
237
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -241,9 +245,7 @@ var MapsTooltip = /** @class */ (function () {
241
245
  }
242
246
  }
243
247
  else {
244
- _this.removeTooltip();
245
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
246
- _this.maps.clearTemplate();
248
+ _this.clearTooltip();
247
249
  }
248
250
  });
249
251
  if (this.svgTooltip) {
@@ -258,9 +260,7 @@ var MapsTooltip = /** @class */ (function () {
258
260
  });
259
261
  }
260
262
  else {
261
- this.removeTooltip();
262
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
263
- this.maps.clearTemplate();
263
+ this.clearTooltip();
264
264
  }
265
265
  }
266
266
  else {
@@ -270,9 +270,7 @@ var MapsTooltip = /** @class */ (function () {
270
270
  this.maps.notify(click, this);
271
271
  }
272
272
  else {
273
- this.removeTooltip();
274
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
275
- this.maps.clearTemplate();
273
+ this.clearTooltip();
276
274
  }
277
275
  }
278
276
  };
@@ -318,8 +316,18 @@ var MapsTooltip = /** @class */ (function () {
318
316
  }
319
317
  };
320
318
  MapsTooltip.prototype.removeTooltip = function () {
319
+ var isTooltipRemoved = false;
321
320
  if (document.getElementsByClassName('EJ2-maps-Tooltip').length > 0) {
322
321
  remove(document.getElementsByClassName('EJ2-maps-Tooltip')[0]);
322
+ isTooltipRemoved = true;
323
+ }
324
+ return isTooltipRemoved;
325
+ };
326
+ MapsTooltip.prototype.clearTooltip = function () {
327
+ var isTooltipRemoved = this.removeTooltip();
328
+ if (isTooltipRemoved) {
329
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
330
+ this.maps.clearTemplate();
323
331
  }
324
332
  };
325
333
  // eslint-disable-next-line valid-jsdoc