@syncfusion/ej2-maps 19.3.53 → 19.4.38
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/.github/PULL_REQUEST_TEMPLATE/Bug.md +72 -0
- package/.github/PULL_REQUEST_TEMPLATE/Feature.md +49 -0
- package/CHANGELOG.md +13 -0
- 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 +384 -226
- package/dist/es6/ej2-maps.es2015.js.map +1 -1
- package/dist/es6/ej2-maps.es5.js +381 -223
- 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 +12 -12
- package/src/maps/layers/bubble.d.ts +6 -0
- package/src/maps/layers/bubble.js +7 -1
- package/src/maps/layers/data-label.js +1 -0
- package/src/maps/layers/layer-panel.d.ts +2 -1
- package/src/maps/layers/layer-panel.js +86 -50
- package/src/maps/layers/legend.js +25 -13
- package/src/maps/layers/marker.js +2 -8
- package/src/maps/maps.js +1 -1
- package/src/maps/model/base.js +2 -2
- package/src/maps/model/theme.js +62 -5
- package/src/maps/user-interaction/highlight.js +4 -4
- package/src/maps/user-interaction/selection.js +10 -9
- package/src/maps/user-interaction/tooltip.js +9 -3
- package/src/maps/user-interaction/zoom.d.ts +1 -0
- package/src/maps/user-interaction/zoom.js +73 -42
- package/src/maps/utils/helper.d.ts +2 -0
- package/src/maps/utils/helper.js +104 -88
package/src/maps/utils/helper.js
CHANGED
|
@@ -878,15 +878,17 @@ export function markerShapeChoose(eventArgs, data) {
|
|
|
878
878
|
data[eventArgs.shapeValuePath]);
|
|
879
879
|
eventArgs.shape = shape;
|
|
880
880
|
if (data[eventArgs.shapeValuePath] === 'Image') {
|
|
881
|
-
eventArgs.imageUrl = (!isNullOrUndefined(eventArgs.imageUrlValuePath)
|
|
882
|
-
!isNullOrUndefined(data[eventArgs.imageUrlValuePath])
|
|
883
|
-
|
|
881
|
+
eventArgs.imageUrl = (!isNullOrUndefined(eventArgs.imageUrlValuePath)) ?
|
|
882
|
+
((eventArgs.imageUrlValuePath.indexOf('.') > -1) ? getValueFromObject(data, eventArgs.imageUrlValuePath).toString() : (!isNullOrUndefined(data[eventArgs.imageUrlValuePath]) ?
|
|
883
|
+
data[eventArgs.imageUrlValuePath] : eventArgs.imageUrl)) : eventArgs.imageUrl;
|
|
884
884
|
}
|
|
885
885
|
}
|
|
886
886
|
else {
|
|
887
887
|
var shapes = (!isNullOrUndefined(eventArgs.shapeValuePath)) ? ((eventArgs.shapeValuePath.indexOf('.') > -1) ? getValueFromObject(data, eventArgs.shapeValuePath).toString() : eventArgs.shape) : eventArgs.shape;
|
|
888
888
|
eventArgs.shape = shapes;
|
|
889
|
-
var shapeImage = (!isNullOrUndefined(eventArgs.imageUrlValuePath)) ?
|
|
889
|
+
var shapeImage = (!isNullOrUndefined(eventArgs.imageUrlValuePath)) ?
|
|
890
|
+
((eventArgs.imageUrlValuePath.indexOf('.') > -1) ? getValueFromObject(data, eventArgs.imageUrlValuePath).toString() : (!isNullOrUndefined(data[eventArgs.imageUrlValuePath]) ?
|
|
891
|
+
data[eventArgs.imageUrlValuePath] : eventArgs.imageUrl)) : eventArgs.imageUrl;
|
|
890
892
|
eventArgs.imageUrl = shapeImage;
|
|
891
893
|
}
|
|
892
894
|
return eventArgs;
|
|
@@ -1264,6 +1266,7 @@ export function marker(eventArgs, markerSettings, markerData, dataIndex, locatio
|
|
|
1264
1266
|
* @param {number} markerIndex - Specifies the marker index
|
|
1265
1267
|
* @param {HTMLElement} markerTemplate - Specifies the marker template element
|
|
1266
1268
|
* @param {Point} location - Specifies the location
|
|
1269
|
+
* @param {Point} transPoint - Specifies the translate point.
|
|
1267
1270
|
* @param {number} scale - Specifies the scale value
|
|
1268
1271
|
* @param {Point} offset - Specifies the offset value
|
|
1269
1272
|
* @param {Maps} maps - Specifies the instance of the maps
|
|
@@ -1759,6 +1762,7 @@ export function getRatioOfBubble(min, max, value, minValue, maxValue) {
|
|
|
1759
1762
|
*
|
|
1760
1763
|
* @param {MapLocation[]} points - Specifies the points
|
|
1761
1764
|
* @param {string} type - Specifies the type
|
|
1765
|
+
* @param {string} geometryType - Specified the type of the geometry
|
|
1762
1766
|
* @returns {any} - Specifies the object
|
|
1763
1767
|
*/
|
|
1764
1768
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -1977,9 +1981,9 @@ export function getTranslate(mapObject, layer, animate) {
|
|
|
1977
1981
|
mapObject.mapScaleValue = scaleFactor = zoomFactorValue = mapObject.scaleOfGivenLocation;
|
|
1978
1982
|
}
|
|
1979
1983
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1980
|
-
var min = mapObject.baseMapRectBounds['min'];
|
|
1984
|
+
var min = !isNullOrUndefined(mapObject.baseMapRectBounds) ? mapObject.baseMapRectBounds['min'] : null;
|
|
1981
1985
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1982
|
-
var max = mapObject.baseMapRectBounds['max'];
|
|
1986
|
+
var max = !isNullOrUndefined(mapObject.baseMapRectBounds) ? mapObject.baseMapRectBounds['max'] : null;
|
|
1983
1987
|
var zoomFactor = animate ? 1 : mapObject.mapScaleValue;
|
|
1984
1988
|
if (isNullOrUndefined(mapObject.currentShapeDataLength)) {
|
|
1985
1989
|
mapObject.currentShapeDataLength = !isNullOrUndefined(layer.shapeData['features'])
|
|
@@ -1989,111 +1993,113 @@ export function getTranslate(mapObject, layer, animate) {
|
|
|
1989
1993
|
var availSize = mapObject.availableSize;
|
|
1990
1994
|
var x;
|
|
1991
1995
|
var y;
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
y = -point.y + topPosition;
|
|
2006
|
-
scaleFactor = zoomFactor;
|
|
2007
|
-
}
|
|
2008
|
-
else {
|
|
2009
|
-
if (Math.floor(mapObject.scale) !== 1 && mapObject.zoomSettings.shouldZoomInitially || (mapObject.zoomNotApplied)) {
|
|
1996
|
+
if (!isNullOrUndefined(min) && !isNullOrUndefined(max)) {
|
|
1997
|
+
var mapWidth = Math.abs(max['x'] - min['x']);
|
|
1998
|
+
var mapHeight = Math.abs(min['y'] - max['y']);
|
|
1999
|
+
var factor = animate ? 1 : mapObject.markerZoomFactor === 1 ? mapObject.mapScaleValue : zoomFactorValue;
|
|
2000
|
+
center = mapObject.zoomSettings.shouldZoomInitially
|
|
2001
|
+
&& mapObject.markerZoomedState && !mapObject.zoomPersistence ? mapObject.markerZoomCenterPoint :
|
|
2002
|
+
mapObject.centerPosition;
|
|
2003
|
+
if ((!isNullOrUndefined(centerLongitude) && !isNullOrUndefined(centerLatitude)) || checkMethodeZoom) {
|
|
2004
|
+
var leftPosition = (((mapWidth + Math.abs(mapObject.mapAreaRect.width - mapWidth)) / 2) + mapObject.mapAreaRect.x) / factor;
|
|
2005
|
+
var topPosition = (((mapHeight + Math.abs(mapObject.mapAreaRect.height - mapHeight)) / 2) + mapObject.mapAreaRect.y) / factor;
|
|
2006
|
+
var point = checkMethodeZoom ? calculateCenterFromPixel(mapObject, layer) :
|
|
2007
|
+
convertGeoToPoint(centerLatitude, centerLongitude, mapObject.mapLayerPanel.calculateFactor(layer), layer, mapObject);
|
|
2008
|
+
if (isNullOrUndefined(mapObject.previousProjection) || mapObject.previousProjection !== mapObject.projectionType) {
|
|
2010
2009
|
x = -point.x + leftPosition;
|
|
2011
2010
|
y = -point.y + topPosition;
|
|
2011
|
+
scaleFactor = zoomFactor;
|
|
2012
2012
|
}
|
|
2013
2013
|
else {
|
|
2014
|
-
if (mapObject.zoomSettings.shouldZoomInitially || mapObject.zoomNotApplied) {
|
|
2014
|
+
if (Math.floor(mapObject.scale) !== 1 && mapObject.zoomSettings.shouldZoomInitially || (mapObject.zoomNotApplied)) {
|
|
2015
2015
|
x = -point.x + leftPosition;
|
|
2016
2016
|
y = -point.y + topPosition;
|
|
2017
|
-
scaleFactor = zoomFactor;
|
|
2018
2017
|
}
|
|
2019
2018
|
else {
|
|
2020
|
-
|
|
2021
|
-
|
|
2019
|
+
if (mapObject.zoomSettings.shouldZoomInitially || mapObject.zoomNotApplied) {
|
|
2020
|
+
x = -point.x + leftPosition;
|
|
2021
|
+
y = -point.y + topPosition;
|
|
2022
|
+
scaleFactor = zoomFactor;
|
|
2023
|
+
}
|
|
2024
|
+
else {
|
|
2025
|
+
x = mapObject.zoomTranslatePoint.x;
|
|
2026
|
+
y = mapObject.zoomTranslatePoint.y;
|
|
2027
|
+
}
|
|
2022
2028
|
}
|
|
2029
|
+
scaleFactor = mapObject.mapScaleValue;
|
|
2023
2030
|
}
|
|
2024
|
-
scaleFactor = mapObject.mapScaleValue;
|
|
2025
|
-
}
|
|
2026
|
-
}
|
|
2027
|
-
else {
|
|
2028
|
-
if (isNullOrUndefined(mapObject.previousProjection) || mapObject.previousProjection !== mapObject.projectionType) {
|
|
2029
|
-
scaleFactor = parseFloat(Math.min(size.width / mapWidth, size.height / mapHeight).toFixed(2));
|
|
2030
|
-
mapWidth *= scaleFactor;
|
|
2031
|
-
mapHeight *= scaleFactor;
|
|
2032
|
-
var widthDiff = min['x'] !== 0 && mapObject.translateType === 'layers' ? availSize.width - size.width : 0;
|
|
2033
|
-
x = size.x + ((-(min['x'])) + ((size.width / 2) - (mapWidth / 2))) - widthDiff;
|
|
2034
|
-
y = size.y + ((-(min['y'])) + ((size.height / 2) - (mapHeight / 2)));
|
|
2035
|
-
mapObject.previousTranslate = new Point(x, y);
|
|
2036
2031
|
}
|
|
2037
2032
|
else {
|
|
2038
|
-
if (
|
|
2033
|
+
if (isNullOrUndefined(mapObject.previousProjection) || mapObject.previousProjection !== mapObject.projectionType) {
|
|
2039
2034
|
scaleFactor = parseFloat(Math.min(size.width / mapWidth, size.height / mapHeight).toFixed(2));
|
|
2040
|
-
mapHeight *= scaleFactor;
|
|
2041
2035
|
mapWidth *= scaleFactor;
|
|
2036
|
+
mapHeight *= scaleFactor;
|
|
2037
|
+
var widthDiff = min['x'] !== 0 && mapObject.translateType === 'layers' ? availSize.width - size.width : 0;
|
|
2038
|
+
x = size.x + ((-(min['x'])) + ((size.width / 2) - (mapWidth / 2))) - widthDiff;
|
|
2042
2039
|
y = size.y + ((-(min['y'])) + ((size.height / 2) - (mapHeight / 2)));
|
|
2043
|
-
|
|
2040
|
+
mapObject.previousTranslate = new Point(x, y);
|
|
2044
2041
|
}
|
|
2045
2042
|
else {
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
mapWidth *= scale;
|
|
2053
|
-
y = size.y + ((-(min['y'])) + ((size.height / 2)
|
|
2054
|
-
- (mapHeight / 2)));
|
|
2055
|
-
scaleFactor = scale;
|
|
2056
|
-
x = size.x + ((-(min['x']))
|
|
2057
|
-
+ ((size.width / 2) - (mapWidth / 2)));
|
|
2058
|
-
}
|
|
2059
|
-
else if (mapObject.availableSize.height !== mapObject.heightBeforeRefresh || mapObject.widthBeforeRefresh !== mapObject.availableSize.width) {
|
|
2060
|
-
var cscaleFactor = parseFloat(Math.min(size.width / mapWidth, size.height / mapHeight).toFixed(2));
|
|
2061
|
-
var cmapWidth = mapWidth;
|
|
2062
|
-
cmapWidth *= cscaleFactor;
|
|
2063
|
-
var cmapHeight = mapHeight;
|
|
2064
|
-
cmapHeight *= cscaleFactor;
|
|
2065
|
-
var x1 = size.x + ((-(min['x'])) + ((size.width / 2) - (cmapWidth / 2)));
|
|
2066
|
-
var y1 = size.y + ((-(min['y'])) + ((size.height / 2) - (cmapHeight / 2)));
|
|
2067
|
-
var xdiff = (mapObject.translatePoint.x - mapObject.previousTranslate.x) / (mapObject.widthBeforeRefresh);
|
|
2068
|
-
var ydiff = (mapObject.translatePoint.y - mapObject.previousTranslate.y) / (mapObject.heightBeforeRefresh);
|
|
2069
|
-
var actxdiff = xdiff * (mapObject.availableSize.width);
|
|
2070
|
-
var actydiff = ydiff * (mapObject.availableSize.height);
|
|
2071
|
-
x = x1 + actxdiff;
|
|
2072
|
-
y = y1 + actydiff;
|
|
2073
|
-
mapObject.previousTranslate = new Point(x1, y1);
|
|
2074
|
-
mapObject.zoomTranslatePoint.x = x;
|
|
2075
|
-
mapObject.zoomTranslatePoint.y = y;
|
|
2043
|
+
if (!mapObject.zoomSettings.shouldZoomInitially && mapObject.markerZoomFactor === 1 && mapObject.mapScaleValue === 1) {
|
|
2044
|
+
scaleFactor = parseFloat(Math.min(size.width / mapWidth, size.height / mapHeight).toFixed(2));
|
|
2045
|
+
mapHeight *= scaleFactor;
|
|
2046
|
+
mapWidth *= scaleFactor;
|
|
2047
|
+
y = size.y + ((-(min['y'])) + ((size.height / 2) - (mapHeight / 2)));
|
|
2048
|
+
x = size.x + ((-(min['x'])) + ((size.width / 2) - (mapWidth / 2)));
|
|
2076
2049
|
}
|
|
2077
2050
|
else {
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
mapHeight
|
|
2083
|
-
|
|
2051
|
+
scaleFactor = mapObject.mapScaleValue < 1 ? mapObject.mapScaleValue + 1 : mapObject.mapScaleValue;
|
|
2052
|
+
mapObject.mapScaleValue = mapObject.zoomSettings.enable && mapObject.mapScaleValue !== 1 ? mapObject.mapScaleValue : 1;
|
|
2053
|
+
if ((mapObject.currentShapeDataLength !== (!isNullOrUndefined(layer.shapeData['features'])
|
|
2054
|
+
? layer.shapeData['features'].length : layer.shapeData['geometries'].length)) && layer.type !== 'SubLayer') {
|
|
2055
|
+
var scale = parseFloat(Math.min(size.height / mapHeight, size.width / mapWidth).toFixed(2));
|
|
2056
|
+
mapHeight *= scale;
|
|
2057
|
+
mapWidth *= scale;
|
|
2058
|
+
y = size.y + ((-(min['y'])) + ((size.height / 2)
|
|
2059
|
+
- (mapHeight / 2)));
|
|
2060
|
+
scaleFactor = scale;
|
|
2061
|
+
x = size.x + ((-(min['x']))
|
|
2062
|
+
+ ((size.width / 2) - (mapWidth / 2)));
|
|
2063
|
+
}
|
|
2064
|
+
else if (mapObject.availableSize.height !== mapObject.heightBeforeRefresh || mapObject.widthBeforeRefresh !== mapObject.availableSize.width) {
|
|
2065
|
+
var cscaleFactor = parseFloat(Math.min(size.width / mapWidth, size.height / mapHeight).toFixed(2));
|
|
2066
|
+
var cmapWidth = mapWidth;
|
|
2067
|
+
cmapWidth *= cscaleFactor;
|
|
2068
|
+
var cmapHeight = mapHeight;
|
|
2069
|
+
cmapHeight *= cscaleFactor;
|
|
2070
|
+
var x1 = size.x + ((-(min['x'])) + ((size.width / 2) - (cmapWidth / 2)));
|
|
2071
|
+
var y1 = size.y + ((-(min['y'])) + ((size.height / 2) - (cmapHeight / 2)));
|
|
2072
|
+
var xdiff = (mapObject.translatePoint.x - mapObject.previousTranslate.x) / (mapObject.widthBeforeRefresh);
|
|
2073
|
+
var ydiff = (mapObject.translatePoint.y - mapObject.previousTranslate.y) / (mapObject.heightBeforeRefresh);
|
|
2074
|
+
var actxdiff = xdiff * (mapObject.availableSize.width);
|
|
2075
|
+
var actydiff = ydiff * (mapObject.availableSize.height);
|
|
2076
|
+
x = x1 + actxdiff;
|
|
2077
|
+
y = y1 + actydiff;
|
|
2078
|
+
mapObject.previousTranslate = new Point(x1, y1);
|
|
2079
|
+
mapObject.zoomTranslatePoint.x = x;
|
|
2080
|
+
mapObject.zoomTranslatePoint.y = y;
|
|
2084
2081
|
}
|
|
2085
2082
|
else {
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2083
|
+
if (!isNullOrUndefined(mapObject.previousProjection) && mapObject.mapScaleValue === 1 && !mapObject.zoomModule.isDragZoom) {
|
|
2084
|
+
scaleFactor = parseFloat(Math.min(size.width / mapWidth, size.height / mapHeight).toFixed(2));
|
|
2085
|
+
mapWidth *= scaleFactor;
|
|
2086
|
+
x = size.x + ((-(min['x'])) + ((size.width / 2) - (mapWidth / 2)));
|
|
2087
|
+
mapHeight *= scaleFactor;
|
|
2088
|
+
y = size.y + ((-(min['y'])) + ((size.height / 2) - (mapHeight / 2)));
|
|
2089
|
+
}
|
|
2090
|
+
else {
|
|
2091
|
+
x = mapObject.zoomTranslatePoint.x;
|
|
2092
|
+
y = mapObject.zoomTranslatePoint.y;
|
|
2093
|
+
scaleFactor = mapObject.scale;
|
|
2094
|
+
}
|
|
2089
2095
|
}
|
|
2090
2096
|
}
|
|
2091
2097
|
}
|
|
2092
2098
|
}
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2099
|
+
if (!isNullOrUndefined(mapObject.translatePoint)) {
|
|
2100
|
+
x = (mapObject.enablePersistence && mapObject.translatePoint.x !== 0 && !mapObject.zoomNotApplied) ? mapObject.translatePoint.x : x;
|
|
2101
|
+
y = (mapObject.enablePersistence && mapObject.translatePoint.y !== 0 && !mapObject.zoomNotApplied) ? mapObject.translatePoint.y : y;
|
|
2102
|
+
}
|
|
2097
2103
|
}
|
|
2098
2104
|
scaleFactor = (mapObject.enablePersistence) ? ((mapObject.mapScaleValue >= 1) ? mapObject.mapScaleValue : 1) : scaleFactor;
|
|
2099
2105
|
mapObject.widthBeforeRefresh = mapObject.availableSize.width;
|
|
@@ -2532,6 +2538,12 @@ export function elementAnimate(element, delay, duration, point, maps, ele, radiu
|
|
|
2532
2538
|
delay: delay,
|
|
2533
2539
|
progress: function (args) {
|
|
2534
2540
|
if (args.timeStamp > args.delay) {
|
|
2541
|
+
if (maps.isTileMap && height === 0) {
|
|
2542
|
+
var layerGroupElement = document.querySelector('.GroupElement');
|
|
2543
|
+
if (!isNullOrUndefined(layerGroupElement)) {
|
|
2544
|
+
layerGroupElement.style.display = 'block';
|
|
2545
|
+
}
|
|
2546
|
+
}
|
|
2535
2547
|
height = ((args.timeStamp - args.delay) / args.duration);
|
|
2536
2548
|
element.setAttribute('transform', 'translate( ' + (centerX - (radius * height)) + ' ' + (centerY - (radius * height)) +
|
|
2537
2549
|
' ) scale(' + height + ')');
|
|
@@ -2867,6 +2879,7 @@ export function changeBorderWidth(element, index, scale, maps) {
|
|
|
2867
2879
|
var value = 0;
|
|
2868
2880
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2869
2881
|
var borderWidthValue = maps.layersCollection[index].shapeSettings.borderWidthValuePath;
|
|
2882
|
+
var borderWidth = maps.layersCollection[index].shapeSettings.border.width;
|
|
2870
2883
|
if (maps.layersCollection[index].shapeSettings.borderWidthValuePath) {
|
|
2871
2884
|
value = checkShapeDataFields(
|
|
2872
2885
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -2876,14 +2889,17 @@ export function changeBorderWidth(element, index, scale, maps) {
|
|
|
2876
2889
|
currentStroke = maps.layersCollection[index].dataSource[value][borderWidthValue];
|
|
2877
2890
|
}
|
|
2878
2891
|
else {
|
|
2879
|
-
currentStroke = (
|
|
2892
|
+
currentStroke = (isNullOrUndefined(borderWidth) ? 0 : borderWidth);
|
|
2880
2893
|
}
|
|
2881
2894
|
}
|
|
2882
2895
|
}
|
|
2883
2896
|
else {
|
|
2884
|
-
currentStroke = (
|
|
2897
|
+
currentStroke = (isNullOrUndefined(borderWidth) ? 0 : borderWidth);
|
|
2885
2898
|
}
|
|
2886
2899
|
childNode.setAttribute('stroke-width', (currentStroke / scale).toString());
|
|
2900
|
+
if (element.id.indexOf('_LineString') > -1 && isNullOrUndefined(currentStroke)) {
|
|
2901
|
+
childNode.setAttribute('stroke-width', (1 / scale).toString());
|
|
2902
|
+
}
|
|
2887
2903
|
}
|
|
2888
2904
|
}
|
|
2889
2905
|
}
|