@syncfusion/ej2-maps 25.1.40 → 25.2.3

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 : 25.1.40
3
+ * version : 25.2.3
4
4
  * Copyright Syncfusion Inc. 2001 - 2023. 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@25.1.37",
3
+ "_id": "@syncfusion/ej2-maps@25.1.41",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-CWC04KDnHjmE6WI+jSrzsAM4JRyaZ++anTsS4BMOwpaFVRHg09afWT0/K9G7YXarS8LN7JW39jmD3p0NHJTUSA==",
5
+ "_integrity": "sha512-f3i1agwk554peX5JwF25nYx4Spy6FhCaRvPuvbQq0PIslntofQeqvtJCh8uiodToSusmNixIvo5dr/+bmtUwjQ==",
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": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-maps/-/ej2-maps-25.1.37.tgz",
27
- "_shasum": "4c429228b5fcee8b1e66f931c7d6802f702b1a28",
26
+ "_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-maps/-/ej2-maps-25.1.41.tgz",
27
+ "_shasum": "f7a46097b695e5576502c1e4508edfc587b91aa4",
28
28
  "_spec": "@syncfusion/ej2-maps@*",
29
29
  "_where": "/jenkins/workspace/elease-automation_release_25.1.1/packages/included",
30
30
  "author": {
@@ -35,13 +35,13 @@
35
35
  },
36
36
  "bundleDependencies": false,
37
37
  "dependencies": {
38
- "@syncfusion/ej2-base": "~25.1.35",
39
- "@syncfusion/ej2-buttons": "~25.1.39",
40
- "@syncfusion/ej2-compression": "~25.1.35",
41
- "@syncfusion/ej2-data": "~25.1.35",
42
- "@syncfusion/ej2-file-utils": "~25.1.35",
43
- "@syncfusion/ej2-pdf-export": "~25.1.38",
44
- "@syncfusion/ej2-svg-base": "~25.1.37"
38
+ "@syncfusion/ej2-base": "~25.2.3",
39
+ "@syncfusion/ej2-buttons": "~25.2.3",
40
+ "@syncfusion/ej2-compression": "~25.2.3",
41
+ "@syncfusion/ej2-data": "~25.2.3",
42
+ "@syncfusion/ej2-file-utils": "~25.2.3",
43
+ "@syncfusion/ej2-pdf-export": "~25.2.3",
44
+ "@syncfusion/ej2-svg-base": "~25.2.3"
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",
@@ -93,6 +93,6 @@
93
93
  "url": "git+https://github.com/syncfusion/ej2-javascript-ui-controls.git"
94
94
  },
95
95
  "typings": "index.d.ts",
96
- "version": "25.1.40",
96
+ "version": "25.2.3",
97
97
  "sideEffects": false
98
98
  }
@@ -188,7 +188,7 @@ var DataLabel = /** @class */ (function () {
188
188
  location['y'] = ((location['y'] + zoomTransPoint['y']) * scale);
189
189
  }
190
190
  location['y'] = (this.maps.projectionType === 'Mercator') || layer.geometryType === 'Normal' ? location['y'] : (-location['y']);
191
- if (!isNullOrUndefined(this.maps.format) && !isNaN(parseFloat(text))) {
191
+ if (!isNullOrUndefined(this.maps.format) && !isNaN(Number(text)) && !isNaN(parseFloat(text))) {
192
192
  if (this.maps.useGroupingSeparator) {
193
193
  text = Internalize(this.maps, parseFloat(text));
194
194
  if (!isNullOrUndefined(datasrcObj)) {
@@ -117,7 +117,6 @@ export declare class LayerPanel {
117
117
  calculateRectBox(coordinates: any[], type?: string, isFirstItem?: boolean): void;
118
118
  generateTiles(zoomLevel: number, tileTranslatePoint: Point, zoomType?: string, bing?: BingMap, position?: Point): void;
119
119
  arrangeTiles(type: string, x: number, y: number): void;
120
- private arrangeTilesLayer;
121
120
  /**
122
121
  * Animation for tile layers and hide the group element until the tile layer rendering
123
122
  *
@@ -1245,126 +1245,121 @@ var LayerPanel = /** @class */ (function () {
1245
1245
  };
1246
1246
  LayerPanel.prototype.arrangeTiles = function (type, x, y) {
1247
1247
  var _this = this;
1248
+ var element = document.getElementById(this.mapObject.element.id + '_tile_parent');
1249
+ var element1 = document.getElementById(this.mapObject.element.id + '_tiles');
1248
1250
  var timeOut;
1249
1251
  if (!isNullOrUndefined(type) && type !== 'Pan') {
1250
1252
  this.tileAnimation(type, x, y);
1251
1253
  timeOut = animationMode === 'Disable' ? 0 : (this.mapObject.layersCollection[0].animationDuration === 0 &&
1252
1254
  animationMode === 'Enable') ? 1000 : this.mapObject.layersCollection[0].animationDuration;
1253
1255
  }
1254
- if (this.mapObject.layers[this.mapObject.baseLayerIndex].layerType === 'GoogleStaticMap') {
1255
- this.renderGoogleMap(this.mapObject.layers[0].key, this.mapObject.staticMapZoom);
1256
- }
1257
1256
  else {
1258
- if (type === 'Pan') {
1259
- this.arrangeTilesLayer(type);
1260
- }
1261
- else {
1262
- setTimeout(function () {
1263
- _this.arrangeTilesLayer(type);
1264
- }, timeOut);
1265
- }
1266
- }
1267
- };
1268
- LayerPanel.prototype.arrangeTilesLayer = function (type) {
1269
- var element = document.getElementById(this.mapObject.element.id + '_tile_parent');
1270
- var element1 = document.getElementById(this.mapObject.element.id + '_tiles');
1271
- if (element) {
1272
- element.style.zIndex = '1';
1273
- }
1274
- if (element1) {
1275
- element1.style.zIndex = '0';
1257
+ timeOut = 0;
1276
1258
  }
1277
- var animateElement;
1278
- if (!document.getElementById(this.mapObject.element.id + '_animated_tiles') && element) {
1279
- animateElement = createElement('div', { id: this.mapObject.element.id + '_animated_tiles' });
1280
- element.appendChild(animateElement);
1259
+ if (this.mapObject.layers[this.mapObject.baseLayerIndex].layerType === 'GoogleStaticMap') {
1260
+ this.renderGoogleMap(this.mapObject.layers[0].key, this.mapObject.staticMapZoom);
1281
1261
  }
1282
1262
  else {
1283
- if (type !== 'Pan' && element1 && element) {
1284
- element1.appendChild(element.children[0]);
1285
- if (!this.mapObject.isAddLayer && !isNullOrUndefined(document.getElementById(this.mapObject.element.id + '_animated_tiles'))) {
1286
- document.getElementById(this.mapObject.element.id + '_animated_tiles').id =
1287
- this.mapObject.element.id + '_animated_tiles_old';
1288
- }
1289
- animateElement = createElement('div', { id: this.mapObject.element.id + '_animated_tiles' });
1290
- element.appendChild(animateElement);
1291
- }
1292
- else {
1293
- animateElement = element ? element.children[0] : null;
1294
- }
1295
- }
1296
- for (var id = 0; id < this.tiles.length; id++) {
1297
- var tile = this.tiles[id];
1298
- var imgElement = null;
1299
- var mapId = this.mapObject.element.id;
1300
- if (type === 'Pan') {
1301
- var child = document.getElementById(mapId + '_tile_' + id);
1302
- var isNewTile = false;
1303
- if (isNullOrUndefined(child)) {
1304
- isNewTile = true;
1305
- child = createElement('div', { id: mapId + '_tile_' + id });
1306
- imgElement = createElement('img');
1307
- }
1308
- else {
1309
- child.style.removeProperty('display');
1310
- imgElement = child.children[0];
1263
+ setTimeout(function () {
1264
+ if (element) {
1265
+ element.style.zIndex = '1';
1311
1266
  }
1312
- if (!isNewTile && imgElement && imgElement.src !== tile.src) {
1313
- imgElement.src = tile.src;
1267
+ if (element1) {
1268
+ element1.style.zIndex = '0';
1314
1269
  }
1315
- child.style.position = 'absolute';
1316
- child.style.left = tile.left + 'px';
1317
- child.style.top = tile.top + 'px';
1318
- child.style.height = tile.height + 'px';
1319
- child.style.width = tile.width + 'px';
1320
- if (isNewTile) {
1321
- imgElement.setAttribute('height', '256px');
1322
- imgElement.setAttribute('width', '256px');
1323
- imgElement.setAttribute('src', tile.src);
1324
- imgElement.setAttribute('alt', this.mapObject.getLocalizedLabel('ImageNotFound'));
1325
- imgElement.style.setProperty('user-select', 'none');
1326
- child.appendChild(imgElement);
1327
- animateElement.appendChild(child);
1328
- }
1329
- }
1330
- else {
1331
- imgElement = createElement('img');
1332
- imgElement.setAttribute('height', '256px');
1333
- imgElement.setAttribute('width', '256px');
1334
- imgElement.setAttribute('src', tile.src);
1335
- imgElement.style.setProperty('user-select', 'none');
1336
- imgElement.setAttribute('alt', this.mapObject.getLocalizedLabel('ImageNotFound'));
1337
- var child = createElement('div', { id: mapId + '_tile_' + id });
1338
- child.style.position = 'absolute';
1339
- child.style.left = tile.left + 'px';
1340
- child.style.top = tile.top + 'px';
1341
- child.style.height = tile.height + 'px';
1342
- child.style.width = tile.width + 'px';
1343
- child.appendChild(imgElement);
1344
- if (animateElement) {
1345
- animateElement.appendChild(child);
1270
+ var animateElement;
1271
+ if (!document.getElementById(_this.mapObject.element.id + '_animated_tiles') && element) {
1272
+ animateElement = createElement('div', { id: _this.mapObject.element.id + '_animated_tiles' });
1273
+ element.appendChild(animateElement);
1346
1274
  }
1347
- }
1348
- if (id === (this.tiles.length - 1) && document.getElementById(this.mapObject.element.id + '_animated_tiles_old')) {
1349
- removeElement(this.mapObject.element.id + '_animated_tiles_old');
1350
- }
1351
- }
1352
- if (!isNullOrUndefined(this.mapObject.currentTiles)) {
1353
- for (var l = this.tiles.length; l < animateElement.childElementCount; l++) {
1354
- var isExistingElement = false;
1355
- for (var a = 0; a < this.mapObject.currentTiles.childElementCount; a++) {
1356
- if (!isExistingElement &&
1357
- this.mapObject.currentTiles.children[a].id === animateElement.children[l].id) {
1358
- isExistingElement = true;
1275
+ else {
1276
+ if (type !== 'Pan' && element1 && element) {
1277
+ element1.appendChild(element.children[0]);
1278
+ if (!_this.mapObject.isAddLayer && !isNullOrUndefined(document.getElementById(_this.mapObject.element.id + '_animated_tiles'))) {
1279
+ document.getElementById(_this.mapObject.element.id + '_animated_tiles').id =
1280
+ _this.mapObject.element.id + '_animated_tiles_old';
1281
+ }
1282
+ animateElement = createElement('div', { id: _this.mapObject.element.id + '_animated_tiles' });
1283
+ element.appendChild(animateElement);
1284
+ }
1285
+ else {
1286
+ animateElement = element ? element.children[0] : null;
1359
1287
  }
1360
1288
  }
1361
- if (isExistingElement) {
1362
- animateElement.children[l].style.display = 'none';
1289
+ for (var id = 0; id < _this.tiles.length; id++) {
1290
+ var tile = _this.tiles[id];
1291
+ var imgElement = null;
1292
+ var mapId = _this.mapObject.element.id;
1293
+ if (type === 'Pan') {
1294
+ var child = document.getElementById(mapId + '_tile_' + id);
1295
+ var isNewTile = false;
1296
+ if (isNullOrUndefined(child)) {
1297
+ isNewTile = true;
1298
+ child = createElement('div', { id: mapId + '_tile_' + id });
1299
+ imgElement = createElement('img');
1300
+ }
1301
+ else {
1302
+ child.style.removeProperty('display');
1303
+ imgElement = child.children[0];
1304
+ }
1305
+ if (!isNewTile && imgElement && imgElement.src !== tile.src) {
1306
+ imgElement.src = tile.src;
1307
+ }
1308
+ child.style.position = 'absolute';
1309
+ child.style.left = tile.left + 'px';
1310
+ child.style.top = tile.top + 'px';
1311
+ child.style.height = tile.height + 'px';
1312
+ child.style.width = tile.width + 'px';
1313
+ if (isNewTile) {
1314
+ imgElement.setAttribute('height', '256px');
1315
+ imgElement.setAttribute('width', '256px');
1316
+ imgElement.setAttribute('src', tile.src);
1317
+ imgElement.setAttribute('alt', _this.mapObject.getLocalizedLabel('ImageNotFound'));
1318
+ imgElement.style.setProperty('user-select', 'none');
1319
+ child.appendChild(imgElement);
1320
+ animateElement.appendChild(child);
1321
+ }
1322
+ }
1323
+ else {
1324
+ imgElement = createElement('img');
1325
+ imgElement.setAttribute('height', '256px');
1326
+ imgElement.setAttribute('width', '256px');
1327
+ imgElement.setAttribute('src', tile.src);
1328
+ imgElement.style.setProperty('user-select', 'none');
1329
+ imgElement.setAttribute('alt', _this.mapObject.getLocalizedLabel('ImageNotFound'));
1330
+ var child = createElement('div', { id: mapId + '_tile_' + id });
1331
+ child.style.position = 'absolute';
1332
+ child.style.left = tile.left + 'px';
1333
+ child.style.top = tile.top + 'px';
1334
+ child.style.height = tile.height + 'px';
1335
+ child.style.width = tile.width + 'px';
1336
+ child.appendChild(imgElement);
1337
+ if (animateElement) {
1338
+ animateElement.appendChild(child);
1339
+ }
1340
+ }
1341
+ if (id === (_this.tiles.length - 1) && document.getElementById(_this.mapObject.element.id + '_animated_tiles_old')) {
1342
+ removeElement(_this.mapObject.element.id + '_animated_tiles_old');
1343
+ }
1363
1344
  }
1364
- else {
1365
- animateElement.removeChild(animateElement.children[l]);
1345
+ if (!isNullOrUndefined(_this.mapObject.currentTiles)) {
1346
+ for (var l = _this.tiles.length; l < animateElement.childElementCount; l++) {
1347
+ var isExistingElement = false;
1348
+ for (var a = 0; a < _this.mapObject.currentTiles.childElementCount; a++) {
1349
+ if (!isExistingElement &&
1350
+ _this.mapObject.currentTiles.children[a].id === animateElement.children[l].id) {
1351
+ isExistingElement = true;
1352
+ }
1353
+ }
1354
+ if (isExistingElement) {
1355
+ animateElement.children[l].style.display = 'none';
1356
+ }
1357
+ else {
1358
+ animateElement.removeChild(animateElement.children[l]);
1359
+ }
1360
+ }
1366
1361
  }
1367
- }
1362
+ }, timeOut);
1368
1363
  }
1369
1364
  };
1370
1365
  /**
@@ -15,6 +15,11 @@ export declare class Marker {
15
15
  */
16
16
  sameMarkerData: MarkerClusterData[];
17
17
  constructor(maps: Maps);
18
+ /**
19
+ * @private
20
+ * @returns {Maps} - Returns the instance of the map.
21
+ */
22
+ getMapsInstance(): Maps;
18
23
  markerRender(maps: Maps, layerElement: Element, layerIndex: number, factor: number, type: string): void;
19
24
  /**
20
25
  * To find zoom level for individual layers like India, USA.
@@ -14,6 +14,13 @@ var Marker = /** @class */ (function () {
14
14
  this.initialMarkerCluster = [];
15
15
  this.zoomedMarkerCluster = [];
16
16
  }
17
+ /**
18
+ * @private
19
+ * @returns {Maps} - Returns the instance of the map.
20
+ */
21
+ Marker.prototype.getMapsInstance = function () {
22
+ return this.maps;
23
+ };
17
24
  Marker.prototype.markerRender = function (maps, layerElement, layerIndex, factor, type) {
18
25
  var _this = this;
19
26
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
package/src/maps/maps.js CHANGED
@@ -235,7 +235,7 @@ var Maps = /** @class */ (function (_super) {
235
235
  this.trigger(load, { maps: this });
236
236
  this.createSVG();
237
237
  this.findBaseAndSubLayers();
238
- if (!isNullOrUndefined(this.markerModule)) {
238
+ if (!isNullOrUndefined(this.markerModule) && this.markerModule.getMapsInstance()) {
239
239
  this.markerModule.initializeMarkerClusterList();
240
240
  }
241
241
  this.createSecondaryElement();
@@ -1953,8 +1953,8 @@ export function findMidPointOfPolygon(points, type, geometryType) {
1953
1953
  sum = 0.5 * sum;
1954
1954
  // eslint-disable-next-line @typescript-eslint/tslint/config
1955
1955
  var pointValue = points.some(function (point) { return point.x < 5 && point.y < 5; }) && geometryType === 'Normal' ? 6 : 4;
1956
- xSum = (1 / (pointValue * sum)) * xSum;
1957
- ySum = (1 / (pointValue * sum)) * ySum;
1956
+ xSum = sum !== 0 ? (1 / (pointValue * sum)) * xSum : 0;
1957
+ ySum = sum !== 0 ? (1 / (pointValue * sum)) * ySum : 0;
1958
1958
  /* Code for finding nearest points in polygon related to midPoint*/
1959
1959
  var rightMinPoint = { x: 0, y: 0 };
1960
1960
  var rightMaxPoint = { x: 0, y: 0 };