@syncfusion/ej2-maps 31.2.2 → 32.1.19
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.
- package/.gitleaksignore +8 -8
- package/README.md +11 -2
- package/aceconfig.js +17 -0
- package/dist/ej2-maps.min.js +1 -10
- package/dist/ej2-maps.umd.min.js +1 -10
- package/dist/ej2-maps.umd.min.js.map +1 -1
- package/dist/es6/ej2-maps.es2015.js +87 -50
- package/dist/es6/ej2-maps.es2015.js.map +1 -1
- package/dist/es6/ej2-maps.es5.js +90 -53
- package/dist/es6/ej2-maps.es5.js.map +1 -1
- package/dist/global/ej2-maps.min.js +1 -10
- package/dist/global/ej2-maps.min.js.map +1 -1
- package/dist/global/index.d.ts +0 -9
- package/package.json +18 -53
- package/src/maps/layers/layer-panel.js +89 -52
- package/dist/ts/index.d.ts +0 -4
- package/dist/ts/index.ts +0 -4
- package/dist/ts/maps/index.d.ts +0 -28
- package/dist/ts/maps/index.ts +0 -28
- package/dist/ts/maps/layers/bing-map.d.ts +0 -21
- package/dist/ts/maps/layers/bing-map.ts +0 -51
- package/dist/ts/maps/layers/bubble.d.ts +0 -77
- package/dist/ts/maps/layers/bubble.ts +0 -304
- package/dist/ts/maps/layers/color-mapping.d.ts +0 -36
- package/dist/ts/maps/layers/color-mapping.ts +0 -230
- package/dist/ts/maps/layers/data-label.d.ts +0 -45
- package/dist/ts/maps/layers/data-label.ts +0 -457
- package/dist/ts/maps/layers/layer-panel.d.ts +0 -144
- package/dist/ts/maps/layers/layer-panel.ts +0 -1455
- package/dist/ts/maps/layers/legend.d.ts +0 -173
- package/dist/ts/maps/layers/legend.ts +0 -2465
- package/dist/ts/maps/layers/marker.d.ts +0 -105
- package/dist/ts/maps/layers/marker.ts +0 -632
- package/dist/ts/maps/layers/navigation-selected-line.d.ts +0 -33
- package/dist/ts/maps/layers/navigation-selected-line.ts +0 -171
- package/dist/ts/maps/layers/polygon.d.ts +0 -30
- package/dist/ts/maps/layers/polygon.ts +0 -68
- package/dist/ts/maps/maps-model.d.ts +0 -409
- package/dist/ts/maps/maps.d.ts +0 -1247
- package/dist/ts/maps/maps.ts +0 -3416
- package/dist/ts/maps/model/base-model.d.ts +0 -2107
- package/dist/ts/maps/model/base.d.ts +0 -1840
- package/dist/ts/maps/model/base.ts +0 -2257
- package/dist/ts/maps/model/constants.d.ts +0 -225
- package/dist/ts/maps/model/constants.ts +0 -226
- package/dist/ts/maps/model/export-image.d.ts +0 -39
- package/dist/ts/maps/model/export-image.ts +0 -194
- package/dist/ts/maps/model/export-pdf.d.ts +0 -40
- package/dist/ts/maps/model/export-pdf.ts +0 -183
- package/dist/ts/maps/model/interface.d.ts +0 -892
- package/dist/ts/maps/model/interface.ts +0 -929
- package/dist/ts/maps/model/print.d.ts +0 -45
- package/dist/ts/maps/model/print.ts +0 -125
- package/dist/ts/maps/model/theme.d.ts +0 -98
- package/dist/ts/maps/model/theme.ts +0 -919
- package/dist/ts/maps/user-interaction/annotation.d.ts +0 -27
- package/dist/ts/maps/user-interaction/annotation.ts +0 -133
- package/dist/ts/maps/user-interaction/highlight.d.ts +0 -63
- package/dist/ts/maps/user-interaction/highlight.ts +0 -272
- package/dist/ts/maps/user-interaction/selection.d.ts +0 -85
- package/dist/ts/maps/user-interaction/selection.ts +0 -342
- package/dist/ts/maps/user-interaction/tooltip.d.ts +0 -78
- package/dist/ts/maps/user-interaction/tooltip.ts +0 -500
- package/dist/ts/maps/user-interaction/zoom.d.ts +0 -334
- package/dist/ts/maps/user-interaction/zoom.ts +0 -2523
- package/dist/ts/maps/utils/enum.d.ts +0 -328
- package/dist/ts/maps/utils/enum.ts +0 -343
- package/dist/ts/maps/utils/helper.d.ts +0 -1318
- package/dist/ts/maps/utils/helper.ts +0 -3811
|
@@ -6363,35 +6363,40 @@ class LayerPanel {
|
|
|
6363
6363
|
}
|
|
6364
6364
|
this.rectBounds = null;
|
|
6365
6365
|
const shapeSettings = this.currentLayer.shapeSettings;
|
|
6366
|
-
|
|
6367
|
-
|
|
6368
|
-
|
|
6369
|
-
|
|
6366
|
+
for (let r = 0; r < renderData.length; r++) {
|
|
6367
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6368
|
+
const geometryData = renderData[r];
|
|
6369
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6370
|
+
const geom = geometryData['geometry'];
|
|
6371
|
+
const hasGeom = !isNullOrUndefined(geom);
|
|
6372
|
+
const hasCoords = !isNullOrUndefined(geometryData['coordinates']);
|
|
6373
|
+
if (hasGeom || hasCoords) {
|
|
6374
|
+
const type = hasGeom ? geom['type'] : geometryData['type'];
|
|
6370
6375
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6371
|
-
const coords =
|
|
6372
|
-
geometryData['coordinates'];
|
|
6376
|
+
const coords = hasGeom ? geom['coordinates'] : geometryData['coordinates'];
|
|
6373
6377
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6374
|
-
const data =
|
|
6378
|
+
const data = geom;
|
|
6375
6379
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6376
6380
|
const properties = geometryData['properties'];
|
|
6377
6381
|
this.generatePoints(type, coords, data, properties);
|
|
6378
6382
|
}
|
|
6379
|
-
}
|
|
6383
|
+
}
|
|
6380
6384
|
this.currentLayer.rectBounds = this.rectBounds;
|
|
6381
6385
|
if (isNullOrUndefined(this.mapObject.baseMapRectBounds) && this.currentLayer.isBaseLayer) {
|
|
6382
6386
|
this.mapObject.baseMapRectBounds = this.rectBounds;
|
|
6383
6387
|
}
|
|
6384
6388
|
const colors = (!isNullOrUndefined(shapeSettings.palette) && shapeSettings.palette.length > 1) ?
|
|
6385
6389
|
shapeSettings.palette : getShapeColor(this.mapObject.theme);
|
|
6390
|
+
const areaRect = this.mapObject.mapAreaRect;
|
|
6386
6391
|
const labelTemplateEle = createElement('div', {
|
|
6387
6392
|
id: this.mapObject.element.id + '_LayerIndex_' + layerIndex + '_Label_Template_Group',
|
|
6388
6393
|
className: this.mapObject.element.id + '_template'
|
|
6389
6394
|
});
|
|
6390
6395
|
labelTemplateEle.style.cssText = 'pointer-events: none; overflow: hidden; position: absolute;' +
|
|
6391
|
-
'top:' +
|
|
6392
|
-
'left:' +
|
|
6393
|
-
'height:' +
|
|
6394
|
-
'width:' +
|
|
6396
|
+
'top:' + areaRect.y + 'px;' +
|
|
6397
|
+
'left:' + areaRect.x + 'px;' +
|
|
6398
|
+
'height:' + areaRect.height + 'px;' +
|
|
6399
|
+
'width:' + areaRect.width + 'px;';
|
|
6395
6400
|
if (this.currentLayer.layerData.length !== 0) {
|
|
6396
6401
|
for (let i = 0; i < this.currentLayer.layerData.length; i++) {
|
|
6397
6402
|
let k;
|
|
@@ -6436,11 +6441,13 @@ class LayerPanel {
|
|
|
6436
6441
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6437
6442
|
this.currentLayer.dataSource, currentShapeData['property'], this.currentLayer.shapeDataPath, this.currentLayer.shapePropertyPath, this.currentLayer);
|
|
6438
6443
|
if (k !== null) {
|
|
6439
|
-
|
|
6440
|
-
|
|
6444
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6445
|
+
const currentDataSource = this.currentLayer.dataSource[k];
|
|
6446
|
+
if (currentDataSource[shapeSettings.borderColorValuePath]) {
|
|
6447
|
+
borderValue.color = currentDataSource[shapeSettings.borderColorValuePath];
|
|
6441
6448
|
}
|
|
6442
|
-
if (
|
|
6443
|
-
borderValue.width =
|
|
6449
|
+
if (currentDataSource[shapeSettings.borderWidthValuePath]) {
|
|
6450
|
+
borderValue.width = currentDataSource[shapeSettings.borderWidthValuePath];
|
|
6444
6451
|
}
|
|
6445
6452
|
}
|
|
6446
6453
|
}
|
|
@@ -6503,17 +6510,26 @@ class LayerPanel {
|
|
|
6503
6510
|
switch (drawingType) {
|
|
6504
6511
|
case 'Polygon':
|
|
6505
6512
|
if (!currentShapeData['_isMultiPolygon']) {
|
|
6506
|
-
path += 'M' + (currentShapeData[0]['point']['x']) + ' ' + (currentShapeData[0]['point']['y']);
|
|
6507
6513
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6508
|
-
|
|
6509
|
-
|
|
6510
|
-
|
|
6514
|
+
const shapeData = currentShapeData;
|
|
6515
|
+
if (shapeData.length > 0) {
|
|
6516
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6517
|
+
const firstPoint = shapeData[0]['point'];
|
|
6518
|
+
const pathSegments = ['M', String(firstPoint['x']), String(firstPoint['y'])];
|
|
6519
|
+
for (let index = 0; index < shapeData.length; index++) {
|
|
6520
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6521
|
+
const point = shapeData[index]['point'];
|
|
6522
|
+
pathSegments.push('L', String(point['x']), String(point['y']));
|
|
6523
|
+
}
|
|
6524
|
+
pathSegments.push('z');
|
|
6525
|
+
path = pathSegments.join(' ');
|
|
6526
|
+
}
|
|
6511
6527
|
}
|
|
6512
6528
|
else {
|
|
6513
6529
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6514
6530
|
path = this.generateMultiPolygonPath(currentShapeData);
|
|
6531
|
+
path += ' z ';
|
|
6515
6532
|
}
|
|
6516
|
-
path += ' z ';
|
|
6517
6533
|
if (path.length > 3) {
|
|
6518
6534
|
pathOptions = new PathOption(shapeID, eventArgs.fill, eventArgs.border.width, eventArgs.border.color, opacity, eventArgs.border.opacity, shapeSettings.dashArray, path);
|
|
6519
6535
|
pathEle = this.mapObject.renderer.drawPath(pathOptions);
|
|
@@ -6732,19 +6748,21 @@ class LayerPanel {
|
|
|
6732
6748
|
*/
|
|
6733
6749
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6734
6750
|
generateMultiPolygonPath(currentShapeData) {
|
|
6735
|
-
|
|
6736
|
-
|
|
6737
|
-
|
|
6738
|
-
|
|
6739
|
-
|
|
6740
|
-
|
|
6741
|
-
|
|
6742
|
-
|
|
6743
|
-
shape.
|
|
6744
|
-
|
|
6745
|
-
|
|
6751
|
+
const parts = [];
|
|
6752
|
+
for (const shape of currentShapeData) {
|
|
6753
|
+
if (!shape || shape.length === 0) {
|
|
6754
|
+
continue;
|
|
6755
|
+
}
|
|
6756
|
+
const startX = shape[0].point.x;
|
|
6757
|
+
const startY = shape[0].point.y;
|
|
6758
|
+
parts.push(`M${startX} ${startY}`);
|
|
6759
|
+
for (let i = 1; i < shape.length; i++) {
|
|
6760
|
+
const x = shape[i].point.x;
|
|
6761
|
+
const y = shape[i].point.y;
|
|
6762
|
+
parts.push(` L ${x} ${y}`);
|
|
6763
|
+
}
|
|
6746
6764
|
}
|
|
6747
|
-
return
|
|
6765
|
+
return parts.join(' ');
|
|
6748
6766
|
}
|
|
6749
6767
|
/**
|
|
6750
6768
|
* To render bubble.
|
|
@@ -7068,32 +7086,51 @@ class LayerPanel {
|
|
|
7068
7086
|
}
|
|
7069
7087
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
7070
7088
|
calculatePolygonBox(coordinates) {
|
|
7089
|
+
// Use a simple for-loop, cache frequent lookups, and update rectBounds once
|
|
7071
7090
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
7072
7091
|
const newData = [];
|
|
7073
7092
|
const bounds = this.mapObject.baseMapBounds;
|
|
7074
|
-
|
|
7075
|
-
|
|
7093
|
+
const lonMin = bounds.longitude.min;
|
|
7094
|
+
const lonMax = bounds.longitude.max;
|
|
7095
|
+
const latMin = bounds.latitude.min;
|
|
7096
|
+
const latMax = bounds.latitude.max;
|
|
7097
|
+
let minX;
|
|
7098
|
+
let minY;
|
|
7099
|
+
let maxX;
|
|
7100
|
+
let maxY;
|
|
7101
|
+
for (let i = 0; i < coordinates.length; i++) {
|
|
7102
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
7103
|
+
const currentPoint = coordinates[i];
|
|
7076
7104
|
const latitude = currentPoint[1];
|
|
7077
7105
|
const longitude = currentPoint[0];
|
|
7078
|
-
if (
|
|
7079
|
-
&& (latitude >= bounds.latitude.min && latitude <= bounds.latitude.max)) {
|
|
7106
|
+
if (longitude >= lonMin && longitude <= lonMax && latitude >= latMin && latitude <= latMax) {
|
|
7080
7107
|
const point = convertGeoToPoint(latitude, longitude, this.currentFactor, this.currentLayer, this.mapObject);
|
|
7081
|
-
if (
|
|
7082
|
-
|
|
7108
|
+
if (minX === undefined) {
|
|
7109
|
+
minX = maxX = point.x;
|
|
7110
|
+
minY = maxY = point.y;
|
|
7083
7111
|
}
|
|
7084
7112
|
else {
|
|
7085
|
-
|
|
7086
|
-
|
|
7087
|
-
|
|
7088
|
-
|
|
7089
|
-
|
|
7090
|
-
|
|
7091
|
-
|
|
7092
|
-
lat: latitude,
|
|
7093
|
-
lng: longitude
|
|
7094
|
-
});
|
|
7113
|
+
// Update local bounds only
|
|
7114
|
+
minX = Math.min(minX, point.x);
|
|
7115
|
+
minY = Math.min(minY, point.y);
|
|
7116
|
+
maxX = Math.max(maxX, point.x);
|
|
7117
|
+
maxY = Math.max(maxY, point.y);
|
|
7118
|
+
}
|
|
7119
|
+
newData.push({ point: point, lat: latitude, lng: longitude });
|
|
7095
7120
|
}
|
|
7096
|
-
}
|
|
7121
|
+
}
|
|
7122
|
+
// Apply the accumulated bounds once to reduce repeated property access
|
|
7123
|
+
if (newData.length) {
|
|
7124
|
+
if (isNullOrUndefined(this.rectBounds)) {
|
|
7125
|
+
this.rectBounds = { min: { x: minX, y: minY }, max: { x: maxX, y: maxY } };
|
|
7126
|
+
}
|
|
7127
|
+
else {
|
|
7128
|
+
this.rectBounds.min.x = Math.min(this.rectBounds.min.x, minX);
|
|
7129
|
+
this.rectBounds.min.y = Math.min(this.rectBounds.min.y, minY);
|
|
7130
|
+
this.rectBounds.max.x = Math.max(this.rectBounds.max.x, maxX);
|
|
7131
|
+
this.rectBounds.max.y = Math.max(this.rectBounds.max.y, maxY);
|
|
7132
|
+
}
|
|
7133
|
+
}
|
|
7097
7134
|
return newData;
|
|
7098
7135
|
}
|
|
7099
7136
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|