@syncfusion/ej2-maps 31.2.2 → 31.2.12
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/README.md +11 -2
- package/dist/ej2-maps.min.js +2 -2
- package/dist/ej2-maps.umd.min.js +2 -2
- package/dist/ej2-maps.umd.min.js.map +1 -1
- package/dist/es6/ej2-maps.es2015.js +84 -53
- package/dist/es6/ej2-maps.es2015.js.map +1 -1
- package/dist/es6/ej2-maps.es5.js +87 -56
- package/dist/es6/ej2-maps.es5.js.map +1 -1
- package/dist/global/ej2-maps.min.js +2 -2
- package/dist/global/ej2-maps.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +18 -53
- package/src/maps/layers/layer-panel.js +86 -55
- 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,35 @@ class LayerPanel {
|
|
|
6363
6363
|
}
|
|
6364
6364
|
this.rectBounds = null;
|
|
6365
6365
|
const shapeSettings = this.currentLayer.shapeSettings;
|
|
6366
|
-
|
|
6367
|
-
|
|
6368
|
-
|
|
6369
|
-
|
|
6370
|
-
|
|
6371
|
-
|
|
6372
|
-
|
|
6373
|
-
|
|
6374
|
-
const data =
|
|
6375
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6366
|
+
for (let r = 0; r < renderData.length; r++) {
|
|
6367
|
+
const geometryData = renderData[r];
|
|
6368
|
+
const geom = geometryData['geometry'];
|
|
6369
|
+
const hasGeom = !isNullOrUndefined(geom);
|
|
6370
|
+
const hasCoords = !isNullOrUndefined(geometryData['coordinates']);
|
|
6371
|
+
if (hasGeom || hasCoords) {
|
|
6372
|
+
const type = hasGeom ? geom['type'] : geometryData['type'];
|
|
6373
|
+
const coords = hasGeom ? geom['coordinates'] : geometryData['coordinates'];
|
|
6374
|
+
const data = geom;
|
|
6376
6375
|
const properties = geometryData['properties'];
|
|
6377
6376
|
this.generatePoints(type, coords, data, properties);
|
|
6378
6377
|
}
|
|
6379
|
-
}
|
|
6378
|
+
}
|
|
6380
6379
|
this.currentLayer.rectBounds = this.rectBounds;
|
|
6381
6380
|
if (isNullOrUndefined(this.mapObject.baseMapRectBounds) && this.currentLayer.isBaseLayer) {
|
|
6382
6381
|
this.mapObject.baseMapRectBounds = this.rectBounds;
|
|
6383
6382
|
}
|
|
6384
6383
|
const colors = (!isNullOrUndefined(shapeSettings.palette) && shapeSettings.palette.length > 1) ?
|
|
6385
6384
|
shapeSettings.palette : getShapeColor(this.mapObject.theme);
|
|
6385
|
+
const areaRect = this.mapObject.mapAreaRect;
|
|
6386
6386
|
const labelTemplateEle = createElement('div', {
|
|
6387
6387
|
id: this.mapObject.element.id + '_LayerIndex_' + layerIndex + '_Label_Template_Group',
|
|
6388
6388
|
className: this.mapObject.element.id + '_template'
|
|
6389
6389
|
});
|
|
6390
6390
|
labelTemplateEle.style.cssText = 'pointer-events: none; overflow: hidden; position: absolute;' +
|
|
6391
|
-
'top:' +
|
|
6392
|
-
'left:' +
|
|
6393
|
-
'height:' +
|
|
6394
|
-
'width:' +
|
|
6391
|
+
'top:' + areaRect.y + 'px;' +
|
|
6392
|
+
'left:' + areaRect.x + 'px;' +
|
|
6393
|
+
'height:' + areaRect.height + 'px;' +
|
|
6394
|
+
'width:' + areaRect.width + 'px;';
|
|
6395
6395
|
if (this.currentLayer.layerData.length !== 0) {
|
|
6396
6396
|
for (let i = 0; i < this.currentLayer.layerData.length; i++) {
|
|
6397
6397
|
let k;
|
|
@@ -6436,11 +6436,12 @@ class LayerPanel {
|
|
|
6436
6436
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6437
6437
|
this.currentLayer.dataSource, currentShapeData['property'], this.currentLayer.shapeDataPath, this.currentLayer.shapePropertyPath, this.currentLayer);
|
|
6438
6438
|
if (k !== null) {
|
|
6439
|
-
|
|
6440
|
-
|
|
6439
|
+
const currentDataSource = this.currentLayer.dataSource[k];
|
|
6440
|
+
if (currentDataSource[shapeSettings.borderColorValuePath]) {
|
|
6441
|
+
borderValue.color = currentDataSource[shapeSettings.borderColorValuePath];
|
|
6441
6442
|
}
|
|
6442
|
-
if (
|
|
6443
|
-
borderValue.width =
|
|
6443
|
+
if (currentDataSource[shapeSettings.borderWidthValuePath]) {
|
|
6444
|
+
borderValue.width = currentDataSource[shapeSettings.borderWidthValuePath];
|
|
6444
6445
|
}
|
|
6445
6446
|
}
|
|
6446
6447
|
}
|
|
@@ -6503,17 +6504,26 @@ class LayerPanel {
|
|
|
6503
6504
|
switch (drawingType) {
|
|
6504
6505
|
case 'Polygon':
|
|
6505
6506
|
if (!currentShapeData['_isMultiPolygon']) {
|
|
6506
|
-
path += 'M' + (currentShapeData[0]['point']['x']) + ' ' + (currentShapeData[0]['point']['y']);
|
|
6507
6507
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6508
|
-
|
|
6509
|
-
|
|
6510
|
-
|
|
6508
|
+
const shapeData = currentShapeData;
|
|
6509
|
+
if (shapeData.length > 0) {
|
|
6510
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6511
|
+
const firstPoint = shapeData[0]['point'];
|
|
6512
|
+
const pathSegments = ['M', String(firstPoint['x']), String(firstPoint['y'])];
|
|
6513
|
+
for (let index = 0; index < shapeData.length; index++) {
|
|
6514
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6515
|
+
const point = shapeData[index]['point'];
|
|
6516
|
+
pathSegments.push('L', String(point['x']), String(point['y']));
|
|
6517
|
+
}
|
|
6518
|
+
pathSegments.push('z');
|
|
6519
|
+
path = pathSegments.join(' ');
|
|
6520
|
+
}
|
|
6511
6521
|
}
|
|
6512
6522
|
else {
|
|
6513
6523
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6514
6524
|
path = this.generateMultiPolygonPath(currentShapeData);
|
|
6525
|
+
path += ' z ';
|
|
6515
6526
|
}
|
|
6516
|
-
path += ' z ';
|
|
6517
6527
|
if (path.length > 3) {
|
|
6518
6528
|
pathOptions = new PathOption(shapeID, eventArgs.fill, eventArgs.border.width, eventArgs.border.color, opacity, eventArgs.border.opacity, shapeSettings.dashArray, path);
|
|
6519
6529
|
pathEle = this.mapObject.renderer.drawPath(pathOptions);
|
|
@@ -6732,19 +6742,21 @@ class LayerPanel {
|
|
|
6732
6742
|
*/
|
|
6733
6743
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6734
6744
|
generateMultiPolygonPath(currentShapeData) {
|
|
6735
|
-
|
|
6736
|
-
|
|
6737
|
-
|
|
6738
|
-
|
|
6739
|
-
|
|
6740
|
-
|
|
6741
|
-
|
|
6742
|
-
|
|
6743
|
-
shape.
|
|
6744
|
-
|
|
6745
|
-
|
|
6745
|
+
const parts = [];
|
|
6746
|
+
for (const shape of currentShapeData) {
|
|
6747
|
+
if (!shape || shape.length === 0) {
|
|
6748
|
+
continue;
|
|
6749
|
+
}
|
|
6750
|
+
const startX = shape[0].point.x;
|
|
6751
|
+
const startY = shape[0].point.y;
|
|
6752
|
+
parts.push(`M${startX} ${startY}`);
|
|
6753
|
+
for (let i = 1; i < shape.length; i++) {
|
|
6754
|
+
const x = shape[i].point.x;
|
|
6755
|
+
const y = shape[i].point.y;
|
|
6756
|
+
parts.push(` L ${x} ${y}`);
|
|
6757
|
+
}
|
|
6746
6758
|
}
|
|
6747
|
-
return
|
|
6759
|
+
return parts.join(' ');
|
|
6748
6760
|
}
|
|
6749
6761
|
/**
|
|
6750
6762
|
* To render bubble.
|
|
@@ -7068,32 +7080,51 @@ class LayerPanel {
|
|
|
7068
7080
|
}
|
|
7069
7081
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
7070
7082
|
calculatePolygonBox(coordinates) {
|
|
7083
|
+
// Use a simple for-loop, cache frequent lookups, and update rectBounds once
|
|
7071
7084
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
7072
7085
|
const newData = [];
|
|
7073
7086
|
const bounds = this.mapObject.baseMapBounds;
|
|
7074
|
-
|
|
7075
|
-
|
|
7087
|
+
const lonMin = bounds.longitude.min;
|
|
7088
|
+
const lonMax = bounds.longitude.max;
|
|
7089
|
+
const latMin = bounds.latitude.min;
|
|
7090
|
+
const latMax = bounds.latitude.max;
|
|
7091
|
+
let minX;
|
|
7092
|
+
let minY;
|
|
7093
|
+
let maxX;
|
|
7094
|
+
let maxY;
|
|
7095
|
+
for (let i = 0; i < coordinates.length; i++) {
|
|
7096
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
7097
|
+
const currentPoint = coordinates[i];
|
|
7076
7098
|
const latitude = currentPoint[1];
|
|
7077
7099
|
const longitude = currentPoint[0];
|
|
7078
|
-
if (
|
|
7079
|
-
&& (latitude >= bounds.latitude.min && latitude <= bounds.latitude.max)) {
|
|
7100
|
+
if (longitude >= lonMin && longitude <= lonMax && latitude >= latMin && latitude <= latMax) {
|
|
7080
7101
|
const point = convertGeoToPoint(latitude, longitude, this.currentFactor, this.currentLayer, this.mapObject);
|
|
7081
|
-
if (
|
|
7082
|
-
|
|
7102
|
+
if (minX === undefined) {
|
|
7103
|
+
minX = maxX = point.x;
|
|
7104
|
+
minY = maxY = point.y;
|
|
7083
7105
|
}
|
|
7084
7106
|
else {
|
|
7085
|
-
|
|
7086
|
-
|
|
7087
|
-
|
|
7088
|
-
|
|
7089
|
-
|
|
7090
|
-
|
|
7091
|
-
|
|
7092
|
-
lat: latitude,
|
|
7093
|
-
lng: longitude
|
|
7094
|
-
});
|
|
7107
|
+
// Update local bounds only
|
|
7108
|
+
minX = Math.min(minX, point.x);
|
|
7109
|
+
minY = Math.min(minY, point.y);
|
|
7110
|
+
maxX = Math.max(maxX, point.x);
|
|
7111
|
+
maxY = Math.max(maxY, point.y);
|
|
7112
|
+
}
|
|
7113
|
+
newData.push({ point: point, lat: latitude, lng: longitude });
|
|
7095
7114
|
}
|
|
7096
|
-
}
|
|
7115
|
+
}
|
|
7116
|
+
// Apply the accumulated bounds once to reduce repeated property access
|
|
7117
|
+
if (newData.length) {
|
|
7118
|
+
if (isNullOrUndefined(this.rectBounds)) {
|
|
7119
|
+
this.rectBounds = { min: { x: minX, y: minY }, max: { x: maxX, y: maxY } };
|
|
7120
|
+
}
|
|
7121
|
+
else {
|
|
7122
|
+
this.rectBounds.min.x = Math.min(this.rectBounds.min.x, minX);
|
|
7123
|
+
this.rectBounds.min.y = Math.min(this.rectBounds.min.y, minY);
|
|
7124
|
+
this.rectBounds.max.x = Math.max(this.rectBounds.max.x, maxX);
|
|
7125
|
+
this.rectBounds.max.y = Math.max(this.rectBounds.max.y, maxY);
|
|
7126
|
+
}
|
|
7127
|
+
}
|
|
7097
7128
|
return newData;
|
|
7098
7129
|
}
|
|
7099
7130
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|