@syncfusion/ej2-maps 19.3.46 → 19.4.47
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 +34 -1
- package/README.md +1 -1
- 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 +478 -257
- package/dist/es6/ej2-maps.es2015.js.map +1 -1
- package/dist/es6/ej2-maps.es5.js +474 -253
- 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 +47 -18
- package/src/maps/layers/marker.js +2 -8
- package/src/maps/maps-model.d.ts +1 -1
- package/src/maps/maps.d.ts +5 -0
- package/src/maps/maps.js +42 -16
- package/src/maps/model/base-model.d.ts +7 -0
- package/src/maps/model/base.d.ts +6 -0
- package/src/maps/model/base.js +5 -2
- package/src/maps/model/interface.d.ts +1 -3
- 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 +76 -44
- package/src/maps/utils/enum.d.ts +3 -1
- package/src/maps/utils/helper.d.ts +4 -2
- package/src/maps/utils/helper.js +130 -98
package/src/maps/utils/helper.js
CHANGED
|
@@ -61,13 +61,15 @@ export function calculateSize(maps) {
|
|
|
61
61
|
var containerHeight = maps.element.clientHeight;
|
|
62
62
|
var containerElementWidth = stringToNumber(maps.element.style.width, containerWidth);
|
|
63
63
|
var containerElementHeight = stringToNumber(maps.element.style.height, containerHeight);
|
|
64
|
+
var availableSize = new Size(0, 0);
|
|
64
65
|
if (maps.width === '0px' || maps.width === '0%' || maps.height === '0%' || maps.height === '0px') {
|
|
65
|
-
|
|
66
|
+
availableSize = new Size(0, 0);
|
|
66
67
|
}
|
|
67
68
|
else {
|
|
68
|
-
|
|
69
|
+
availableSize = new Size(stringToNumber(maps.width, containerWidth) || containerWidth || containerElementWidth || 600, stringToNumber(maps.height, containerHeight) || containerHeight || containerElementHeight || (maps.isDevice ?
|
|
69
70
|
Math.min(window.innerWidth, window.innerHeight) : 450));
|
|
70
71
|
}
|
|
72
|
+
return availableSize;
|
|
71
73
|
}
|
|
72
74
|
/**
|
|
73
75
|
* Method to create svg for maps.
|
|
@@ -77,7 +79,7 @@ export function calculateSize(maps) {
|
|
|
77
79
|
*/
|
|
78
80
|
export function createSvg(maps) {
|
|
79
81
|
maps.renderer = new SvgRenderer(maps.element.id);
|
|
80
|
-
calculateSize(maps);
|
|
82
|
+
maps.availableSize = calculateSize(maps);
|
|
81
83
|
maps.svgObject = maps.renderer.createSvg({
|
|
82
84
|
id: maps.element.id + '_svg',
|
|
83
85
|
width: maps.availableSize.width,
|
|
@@ -876,17 +878,19 @@ export function markerShapeChoose(eventArgs, data) {
|
|
|
876
878
|
var shape = ((eventArgs.shapeValuePath.indexOf('.') > -1) ?
|
|
877
879
|
(getValueFromObject(data, eventArgs.shapeValuePath).toString()) :
|
|
878
880
|
data[eventArgs.shapeValuePath]);
|
|
879
|
-
eventArgs.shape = shape;
|
|
881
|
+
eventArgs.shape = (shape.toString() !== "") ? shape : eventArgs.shape;
|
|
880
882
|
if (data[eventArgs.shapeValuePath] === 'Image') {
|
|
881
|
-
eventArgs.imageUrl = (!isNullOrUndefined(eventArgs.imageUrlValuePath)
|
|
882
|
-
!isNullOrUndefined(data[eventArgs.imageUrlValuePath])
|
|
883
|
-
|
|
883
|
+
eventArgs.imageUrl = (!isNullOrUndefined(eventArgs.imageUrlValuePath)) ?
|
|
884
|
+
((eventArgs.imageUrlValuePath.indexOf('.') > -1) ? getValueFromObject(data, eventArgs.imageUrlValuePath).toString() : (!isNullOrUndefined(data[eventArgs.imageUrlValuePath]) ?
|
|
885
|
+
data[eventArgs.imageUrlValuePath] : eventArgs.imageUrl)) : eventArgs.imageUrl;
|
|
884
886
|
}
|
|
885
887
|
}
|
|
886
888
|
else {
|
|
887
889
|
var shapes = (!isNullOrUndefined(eventArgs.shapeValuePath)) ? ((eventArgs.shapeValuePath.indexOf('.') > -1) ? getValueFromObject(data, eventArgs.shapeValuePath).toString() : eventArgs.shape) : eventArgs.shape;
|
|
888
|
-
eventArgs.shape = shapes;
|
|
889
|
-
var shapeImage = (!isNullOrUndefined(eventArgs.imageUrlValuePath)) ?
|
|
890
|
+
eventArgs.shape = (shapes.toString() !== "") ? shapes : eventArgs.shape;
|
|
891
|
+
var shapeImage = (!isNullOrUndefined(eventArgs.imageUrlValuePath)) ?
|
|
892
|
+
((eventArgs.imageUrlValuePath.indexOf('.') > -1) ? getValueFromObject(data, eventArgs.imageUrlValuePath).toString() : (!isNullOrUndefined(data[eventArgs.imageUrlValuePath]) ?
|
|
893
|
+
data[eventArgs.imageUrlValuePath] : eventArgs.imageUrl)) : eventArgs.imageUrl;
|
|
890
894
|
eventArgs.imageUrl = shapeImage;
|
|
891
895
|
}
|
|
892
896
|
return eventArgs;
|
|
@@ -1264,6 +1268,7 @@ export function marker(eventArgs, markerSettings, markerData, dataIndex, locatio
|
|
|
1264
1268
|
* @param {number} markerIndex - Specifies the marker index
|
|
1265
1269
|
* @param {HTMLElement} markerTemplate - Specifies the marker template element
|
|
1266
1270
|
* @param {Point} location - Specifies the location
|
|
1271
|
+
* @param {Point} transPoint - Specifies the translate point.
|
|
1267
1272
|
* @param {number} scale - Specifies the scale value
|
|
1268
1273
|
* @param {Point} offset - Specifies the offset value
|
|
1269
1274
|
* @param {Maps} maps - Specifies the instance of the maps
|
|
@@ -1445,7 +1450,7 @@ export function calculateShapes(maps, shape, options, size, location, markerEle)
|
|
|
1445
1450
|
var tempGroup;
|
|
1446
1451
|
switch (shape) {
|
|
1447
1452
|
case 'Balloon':
|
|
1448
|
-
tempGroup = drawBalloon(maps, options, size, location, markerEle);
|
|
1453
|
+
tempGroup = drawBalloon(maps, options, size, location, 'Marker', markerEle);
|
|
1449
1454
|
break;
|
|
1450
1455
|
case 'Cross':
|
|
1451
1456
|
options.d = 'M ' + location.x + ' ' + (location.y - size.height / 2) + ' L ' + location.x + ' ' + (location.y + size.height
|
|
@@ -1603,9 +1608,10 @@ export function drawStar(maps, options, size, location, element) {
|
|
|
1603
1608
|
* @returns {Element} - Returns the element
|
|
1604
1609
|
* @private
|
|
1605
1610
|
*/
|
|
1606
|
-
export function drawBalloon(maps, options, size, location, element) {
|
|
1611
|
+
export function drawBalloon(maps, options, size, location, type, element) {
|
|
1607
1612
|
var width = size.width;
|
|
1608
1613
|
var height = size.height;
|
|
1614
|
+
var pathElement;
|
|
1609
1615
|
location.x -= width / 2;
|
|
1610
1616
|
location.y -= height;
|
|
1611
1617
|
options.d = 'M15,0C8.8,0,3.8,5,3.8,11.2C3.8,17.5,9.4,24.4,15,30c5.6-5.6,11.2-12.5,11.2-18.8C26.2,5,21.2,0,15,0z M15,16' +
|
|
@@ -1614,9 +1620,15 @@ export function drawBalloon(maps, options, size, location, element) {
|
|
|
1614
1620
|
var x = size.width / 30;
|
|
1615
1621
|
var y = size.height / 30;
|
|
1616
1622
|
balloon.setAttribute('transform', 'translate(' + location.x + ', ' + location.y + ') scale(' + x + ', ' + y + ')');
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1623
|
+
if (type === 'Marker') {
|
|
1624
|
+
var g = maps.renderer.createGroup({ id: options.id });
|
|
1625
|
+
appendShape(balloon, g);
|
|
1626
|
+
pathElement = appendShape(g, element);
|
|
1627
|
+
}
|
|
1628
|
+
else {
|
|
1629
|
+
pathElement = balloon;
|
|
1630
|
+
}
|
|
1631
|
+
return pathElement;
|
|
1620
1632
|
}
|
|
1621
1633
|
/**
|
|
1622
1634
|
* Internal rendering of Pattern
|
|
@@ -1759,6 +1771,7 @@ export function getRatioOfBubble(min, max, value, minValue, maxValue) {
|
|
|
1759
1771
|
*
|
|
1760
1772
|
* @param {MapLocation[]} points - Specifies the points
|
|
1761
1773
|
* @param {string} type - Specifies the type
|
|
1774
|
+
* @param {string} geometryType - Specified the type of the geometry
|
|
1762
1775
|
* @returns {any} - Specifies the object
|
|
1763
1776
|
*/
|
|
1764
1777
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -1977,9 +1990,9 @@ export function getTranslate(mapObject, layer, animate) {
|
|
|
1977
1990
|
mapObject.mapScaleValue = scaleFactor = zoomFactorValue = mapObject.scaleOfGivenLocation;
|
|
1978
1991
|
}
|
|
1979
1992
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1980
|
-
var min = mapObject.baseMapRectBounds['min'];
|
|
1993
|
+
var min = !isNullOrUndefined(mapObject.baseMapRectBounds) ? mapObject.baseMapRectBounds['min'] : null;
|
|
1981
1994
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1982
|
-
var max = mapObject.baseMapRectBounds['max'];
|
|
1995
|
+
var max = !isNullOrUndefined(mapObject.baseMapRectBounds) ? mapObject.baseMapRectBounds['max'] : null;
|
|
1983
1996
|
var zoomFactor = animate ? 1 : mapObject.mapScaleValue;
|
|
1984
1997
|
if (isNullOrUndefined(mapObject.currentShapeDataLength)) {
|
|
1985
1998
|
mapObject.currentShapeDataLength = !isNullOrUndefined(layer.shapeData['features'])
|
|
@@ -1989,111 +2002,113 @@ export function getTranslate(mapObject, layer, animate) {
|
|
|
1989
2002
|
var availSize = mapObject.availableSize;
|
|
1990
2003
|
var x;
|
|
1991
2004
|
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)) {
|
|
2005
|
+
if (!isNullOrUndefined(min) && !isNullOrUndefined(max)) {
|
|
2006
|
+
var mapWidth = Math.abs(max['x'] - min['x']);
|
|
2007
|
+
var mapHeight = Math.abs(min['y'] - max['y']);
|
|
2008
|
+
var factor = animate ? 1 : mapObject.markerZoomFactor === 1 ? mapObject.mapScaleValue : zoomFactorValue;
|
|
2009
|
+
center = mapObject.zoomSettings.shouldZoomInitially
|
|
2010
|
+
&& mapObject.markerZoomedState && !mapObject.zoomPersistence ? mapObject.markerZoomCenterPoint :
|
|
2011
|
+
mapObject.centerPosition;
|
|
2012
|
+
if ((!isNullOrUndefined(centerLongitude) && !isNullOrUndefined(centerLatitude)) || checkMethodeZoom) {
|
|
2013
|
+
var leftPosition = (((mapWidth + Math.abs(mapObject.mapAreaRect.width - mapWidth)) / 2) + mapObject.mapAreaRect.x) / factor;
|
|
2014
|
+
var topPosition = (((mapHeight + Math.abs(mapObject.mapAreaRect.height - mapHeight)) / 2) + mapObject.mapAreaRect.y) / factor;
|
|
2015
|
+
var point = checkMethodeZoom ? calculateCenterFromPixel(mapObject, layer) :
|
|
2016
|
+
convertGeoToPoint(centerLatitude, centerLongitude, mapObject.mapLayerPanel.calculateFactor(layer), layer, mapObject);
|
|
2017
|
+
if (isNullOrUndefined(mapObject.previousProjection) || mapObject.previousProjection !== mapObject.projectionType) {
|
|
2010
2018
|
x = -point.x + leftPosition;
|
|
2011
2019
|
y = -point.y + topPosition;
|
|
2020
|
+
scaleFactor = zoomFactor;
|
|
2012
2021
|
}
|
|
2013
2022
|
else {
|
|
2014
|
-
if (mapObject.zoomSettings.shouldZoomInitially || mapObject.zoomNotApplied) {
|
|
2023
|
+
if (Math.floor(mapObject.scale) !== 1 && mapObject.zoomSettings.shouldZoomInitially || (mapObject.zoomNotApplied)) {
|
|
2015
2024
|
x = -point.x + leftPosition;
|
|
2016
2025
|
y = -point.y + topPosition;
|
|
2017
|
-
scaleFactor = zoomFactor;
|
|
2018
2026
|
}
|
|
2019
2027
|
else {
|
|
2020
|
-
|
|
2021
|
-
|
|
2028
|
+
if (mapObject.zoomSettings.shouldZoomInitially || mapObject.zoomNotApplied) {
|
|
2029
|
+
x = -point.x + leftPosition;
|
|
2030
|
+
y = -point.y + topPosition;
|
|
2031
|
+
scaleFactor = zoomFactor;
|
|
2032
|
+
}
|
|
2033
|
+
else {
|
|
2034
|
+
x = mapObject.zoomTranslatePoint.x;
|
|
2035
|
+
y = mapObject.zoomTranslatePoint.y;
|
|
2036
|
+
}
|
|
2022
2037
|
}
|
|
2038
|
+
scaleFactor = mapObject.mapScaleValue;
|
|
2023
2039
|
}
|
|
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
2040
|
}
|
|
2037
2041
|
else {
|
|
2038
|
-
if (
|
|
2042
|
+
if (isNullOrUndefined(mapObject.previousProjection) || mapObject.previousProjection !== mapObject.projectionType) {
|
|
2039
2043
|
scaleFactor = parseFloat(Math.min(size.width / mapWidth, size.height / mapHeight).toFixed(2));
|
|
2040
|
-
mapHeight *= scaleFactor;
|
|
2041
2044
|
mapWidth *= scaleFactor;
|
|
2045
|
+
mapHeight *= scaleFactor;
|
|
2046
|
+
var widthDiff = min['x'] !== 0 && mapObject.translateType === 'layers' ? availSize.width - size.width : 0;
|
|
2047
|
+
x = size.x + ((-(min['x'])) + ((size.width / 2) - (mapWidth / 2))) - widthDiff;
|
|
2042
2048
|
y = size.y + ((-(min['y'])) + ((size.height / 2) - (mapHeight / 2)));
|
|
2043
|
-
|
|
2049
|
+
mapObject.previousTranslate = new Point(x, y);
|
|
2044
2050
|
}
|
|
2045
2051
|
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;
|
|
2052
|
+
if (!mapObject.zoomSettings.shouldZoomInitially && mapObject.markerZoomFactor === 1 && mapObject.mapScaleValue === 1) {
|
|
2053
|
+
scaleFactor = parseFloat(Math.min(size.width / mapWidth, size.height / mapHeight).toFixed(2));
|
|
2054
|
+
mapHeight *= scaleFactor;
|
|
2055
|
+
mapWidth *= scaleFactor;
|
|
2056
|
+
y = size.y + ((-(min['y'])) + ((size.height / 2) - (mapHeight / 2)));
|
|
2057
|
+
x = size.x + ((-(min['x'])) + ((size.width / 2) - (mapWidth / 2)));
|
|
2076
2058
|
}
|
|
2077
2059
|
else {
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
mapHeight
|
|
2083
|
-
|
|
2060
|
+
scaleFactor = mapObject.mapScaleValue < 1 ? mapObject.mapScaleValue + 1 : mapObject.mapScaleValue;
|
|
2061
|
+
mapObject.mapScaleValue = mapObject.zoomSettings.enable && mapObject.mapScaleValue !== 1 ? mapObject.mapScaleValue : 1;
|
|
2062
|
+
if ((mapObject.currentShapeDataLength !== (!isNullOrUndefined(layer.shapeData['features'])
|
|
2063
|
+
? layer.shapeData['features'].length : layer.shapeData['geometries'].length)) && layer.type !== 'SubLayer') {
|
|
2064
|
+
var scale = parseFloat(Math.min(size.height / mapHeight, size.width / mapWidth).toFixed(2));
|
|
2065
|
+
mapHeight *= scale;
|
|
2066
|
+
mapWidth *= scale;
|
|
2067
|
+
y = size.y + ((-(min['y'])) + ((size.height / 2)
|
|
2068
|
+
- (mapHeight / 2)));
|
|
2069
|
+
scaleFactor = scale;
|
|
2070
|
+
x = size.x + ((-(min['x']))
|
|
2071
|
+
+ ((size.width / 2) - (mapWidth / 2)));
|
|
2072
|
+
}
|
|
2073
|
+
else if (mapObject.availableSize.height !== mapObject.heightBeforeRefresh || mapObject.widthBeforeRefresh !== mapObject.availableSize.width) {
|
|
2074
|
+
var cscaleFactor = parseFloat(Math.min(size.width / mapWidth, size.height / mapHeight).toFixed(2));
|
|
2075
|
+
var cmapWidth = mapWidth;
|
|
2076
|
+
cmapWidth *= cscaleFactor;
|
|
2077
|
+
var cmapHeight = mapHeight;
|
|
2078
|
+
cmapHeight *= cscaleFactor;
|
|
2079
|
+
var x1 = size.x + ((-(min['x'])) + ((size.width / 2) - (cmapWidth / 2)));
|
|
2080
|
+
var y1 = size.y + ((-(min['y'])) + ((size.height / 2) - (cmapHeight / 2)));
|
|
2081
|
+
var xdiff = (mapObject.translatePoint.x - mapObject.previousTranslate.x) / (mapObject.widthBeforeRefresh);
|
|
2082
|
+
var ydiff = (mapObject.translatePoint.y - mapObject.previousTranslate.y) / (mapObject.heightBeforeRefresh);
|
|
2083
|
+
var actxdiff = xdiff * (mapObject.availableSize.width);
|
|
2084
|
+
var actydiff = ydiff * (mapObject.availableSize.height);
|
|
2085
|
+
x = x1 + actxdiff;
|
|
2086
|
+
y = y1 + actydiff;
|
|
2087
|
+
mapObject.previousTranslate = new Point(x1, y1);
|
|
2088
|
+
mapObject.zoomTranslatePoint.x = x;
|
|
2089
|
+
mapObject.zoomTranslatePoint.y = y;
|
|
2084
2090
|
}
|
|
2085
2091
|
else {
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2092
|
+
if (!isNullOrUndefined(mapObject.previousProjection) && mapObject.mapScaleValue === 1 && !mapObject.zoomModule.isDragZoom) {
|
|
2093
|
+
scaleFactor = parseFloat(Math.min(size.width / mapWidth, size.height / mapHeight).toFixed(2));
|
|
2094
|
+
mapWidth *= scaleFactor;
|
|
2095
|
+
x = size.x + ((-(min['x'])) + ((size.width / 2) - (mapWidth / 2)));
|
|
2096
|
+
mapHeight *= scaleFactor;
|
|
2097
|
+
y = size.y + ((-(min['y'])) + ((size.height / 2) - (mapHeight / 2)));
|
|
2098
|
+
}
|
|
2099
|
+
else {
|
|
2100
|
+
x = mapObject.zoomTranslatePoint.x;
|
|
2101
|
+
y = mapObject.zoomTranslatePoint.y;
|
|
2102
|
+
scaleFactor = mapObject.scale;
|
|
2103
|
+
}
|
|
2089
2104
|
}
|
|
2090
2105
|
}
|
|
2091
2106
|
}
|
|
2092
2107
|
}
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2108
|
+
if (!isNullOrUndefined(mapObject.translatePoint)) {
|
|
2109
|
+
x = (mapObject.enablePersistence && mapObject.translatePoint.x !== 0 && !mapObject.zoomNotApplied) ? mapObject.translatePoint.x : x;
|
|
2110
|
+
y = (mapObject.enablePersistence && mapObject.translatePoint.y !== 0 && !mapObject.zoomNotApplied) ? mapObject.translatePoint.y : y;
|
|
2111
|
+
}
|
|
2097
2112
|
}
|
|
2098
2113
|
scaleFactor = (mapObject.enablePersistence) ? ((mapObject.mapScaleValue >= 1) ? mapObject.mapScaleValue : 1) : scaleFactor;
|
|
2099
2114
|
mapObject.widthBeforeRefresh = mapObject.availableSize.width;
|
|
@@ -2532,6 +2547,12 @@ export function elementAnimate(element, delay, duration, point, maps, ele, radiu
|
|
|
2532
2547
|
delay: delay,
|
|
2533
2548
|
progress: function (args) {
|
|
2534
2549
|
if (args.timeStamp > args.delay) {
|
|
2550
|
+
if (maps.isTileMap && height === 0) {
|
|
2551
|
+
var layerGroupElement = document.querySelector('.GroupElement');
|
|
2552
|
+
if (!isNullOrUndefined(layerGroupElement)) {
|
|
2553
|
+
layerGroupElement.style.display = 'block';
|
|
2554
|
+
}
|
|
2555
|
+
}
|
|
2535
2556
|
height = ((args.timeStamp - args.delay) / args.duration);
|
|
2536
2557
|
element.setAttribute('transform', 'translate( ' + (centerX - (radius * height)) + ' ' + (centerY - (radius * height)) +
|
|
2537
2558
|
' ) scale(' + height + ')');
|
|
@@ -2732,6 +2753,8 @@ export function renderLegendShape(location, size, shape, options, url) {
|
|
|
2732
2753
|
var shapeY = location.y;
|
|
2733
2754
|
var x = location.x + (-shapeWidth / 2);
|
|
2734
2755
|
var y = location.y + (-shapeHeight / 2);
|
|
2756
|
+
options['stroke'] = (shape === 'HorizontalLine' || shape === 'VerticalLine' || shape === 'Cross') ? options['fill'] : options['stroke'];
|
|
2757
|
+
options['stroke-width'] = (options['stroke-width'] === 0 && (shape === 'HorizontalLine' || shape === 'VerticalLine' || shape === 'Cross')) ? 1 : options['stroke-width'];
|
|
2735
2758
|
switch (shape) {
|
|
2736
2759
|
case 'Circle':
|
|
2737
2760
|
case 'Bubble':
|
|
@@ -2743,6 +2766,11 @@ export function renderLegendShape(location, size, shape, options, url) {
|
|
|
2743
2766
|
+ (shapeY + (-shapeHeight / 2));
|
|
2744
2767
|
merge(options, { 'd': renderPath });
|
|
2745
2768
|
break;
|
|
2769
|
+
case 'HorizontalLine':
|
|
2770
|
+
renderPath = 'M' + ' ' + shapeX + ' ' + shapeY + ' ' + 'L' + ' ' + (shapeX + (shapeWidth / 2)) + ' '
|
|
2771
|
+
+ shapeY;
|
|
2772
|
+
merge(options, { 'd': renderPath });
|
|
2773
|
+
break;
|
|
2746
2774
|
case 'Diamond':
|
|
2747
2775
|
renderPath = 'M' + ' ' + x + ' ' + shapeY + ' ' +
|
|
2748
2776
|
'L' + ' ' + shapeX + ' ' + (shapeY + (-shapeHeight / 2)) + ' ' +
|
|
@@ -2867,6 +2895,7 @@ export function changeBorderWidth(element, index, scale, maps) {
|
|
|
2867
2895
|
var value = 0;
|
|
2868
2896
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2869
2897
|
var borderWidthValue = maps.layersCollection[index].shapeSettings.borderWidthValuePath;
|
|
2898
|
+
var borderWidth = maps.layersCollection[index].shapeSettings.border.width;
|
|
2870
2899
|
if (maps.layersCollection[index].shapeSettings.borderWidthValuePath) {
|
|
2871
2900
|
value = checkShapeDataFields(
|
|
2872
2901
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -2876,14 +2905,17 @@ export function changeBorderWidth(element, index, scale, maps) {
|
|
|
2876
2905
|
currentStroke = maps.layersCollection[index].dataSource[value][borderWidthValue];
|
|
2877
2906
|
}
|
|
2878
2907
|
else {
|
|
2879
|
-
currentStroke = (
|
|
2908
|
+
currentStroke = (isNullOrUndefined(borderWidth) ? 0 : borderWidth);
|
|
2880
2909
|
}
|
|
2881
2910
|
}
|
|
2882
2911
|
}
|
|
2883
2912
|
else {
|
|
2884
|
-
currentStroke = (
|
|
2913
|
+
currentStroke = (isNullOrUndefined(borderWidth) ? 0 : borderWidth);
|
|
2885
2914
|
}
|
|
2886
2915
|
childNode.setAttribute('stroke-width', (currentStroke / scale).toString());
|
|
2916
|
+
if (element.id.indexOf('_LineString') > -1 && isNullOrUndefined(currentStroke)) {
|
|
2917
|
+
childNode.setAttribute('stroke-width', (1 / scale).toString());
|
|
2918
|
+
}
|
|
2887
2919
|
}
|
|
2888
2920
|
}
|
|
2889
2921
|
}
|