@syncfusion/ej2-maps 19.4.56 → 19.4.57-105067
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/.eslintrc.json +18 -3
- package/.github/PULL_REQUEST_TEMPLATE/Bug.md +72 -72
- package/.github/PULL_REQUEST_TEMPLATE/Feature.md +49 -49
- package/CHANGELOG.md +441 -439
- package/README.md +73 -73
- 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 +1161 -638
- package/dist/es6/ej2-maps.es2015.js.map +1 -1
- package/dist/es6/ej2-maps.es5.js +1200 -678
- 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/dist/ts/maps/layers/bing-map.ts +50 -0
- package/dist/ts/maps/layers/bubble.ts +290 -0
- package/dist/ts/maps/layers/color-mapping.ts +226 -0
- package/dist/ts/maps/layers/data-label.ts +418 -0
- package/dist/ts/maps/layers/layer-panel.ts +1480 -0
- package/dist/ts/maps/layers/legend.ts +2236 -0
- package/dist/ts/maps/layers/marker.ts +453 -0
- package/dist/ts/maps/layers/navigation-selected-line.ts +167 -0
- package/dist/ts/maps/maps.ts +2886 -0
- package/dist/ts/maps/model/base.ts +1843 -0
- package/dist/ts/maps/model/constants.ts +200 -0
- package/dist/ts/maps/model/export-image.ts +178 -0
- package/dist/ts/maps/model/export-pdf.ts +170 -0
- package/dist/ts/maps/model/interface.ts +823 -0
- package/dist/ts/maps/model/print.ts +104 -0
- package/dist/ts/maps/model/theme.ts +554 -0
- package/dist/ts/maps/user-interaction/annotation.ts +127 -0
- package/dist/ts/maps/user-interaction/highlight.ts +233 -0
- package/dist/ts/maps/user-interaction/selection.ts +321 -0
- package/dist/ts/maps/user-interaction/tooltip.ts +387 -0
- package/dist/ts/maps/user-interaction/zoom.ts +1767 -0
- package/dist/ts/maps/utils/enum.ts +368 -0
- package/dist/ts/maps/utils/helper.ts +3421 -0
- package/helper/e2e/index.js +3 -3
- package/helper/e2e/maps-helper.js +13 -13
- package/license +9 -9
- package/package.json +85 -85
- package/src/maps/layers/bing-map.d.ts +4 -0
- package/src/maps/layers/bing-map.js +16 -3
- package/src/maps/layers/bubble.d.ts +1 -2
- package/src/maps/layers/bubble.js +7 -12
- package/src/maps/layers/data-label.d.ts +1 -4
- package/src/maps/layers/data-label.js +32 -35
- package/src/maps/layers/layer-panel.d.ts +18 -1
- package/src/maps/layers/layer-panel.js +226 -72
- package/src/maps/layers/legend.d.ts +5 -2
- package/src/maps/layers/legend.js +170 -61
- package/src/maps/layers/marker.d.ts +2 -4
- package/src/maps/layers/marker.js +49 -48
- package/src/maps/layers/navigation-selected-line.d.ts +1 -2
- package/src/maps/layers/navigation-selected-line.js +7 -13
- package/src/maps/maps-model.d.ts +259 -251
- package/src/maps/maps.d.ts +24 -3
- package/src/maps/maps.js +152 -90
- package/src/maps/model/base-model.d.ts +1025 -1021
- package/src/maps/model/base.d.ts +5 -1
- package/src/maps/model/base.js +24 -24
- package/src/maps/model/constants.d.ts +6 -0
- package/src/maps/model/constants.js +6 -0
- package/src/maps/model/export-image.d.ts +2 -4
- package/src/maps/model/export-image.js +26 -32
- package/src/maps/model/export-pdf.d.ts +4 -6
- package/src/maps/model/export-pdf.js +27 -35
- package/src/maps/model/interface.d.ts +34 -26
- package/src/maps/model/print.d.ts +2 -5
- package/src/maps/model/print.js +33 -21
- package/src/maps/model/theme.js +7 -4
- package/src/maps/user-interaction/annotation.d.ts +1 -2
- package/src/maps/user-interaction/annotation.js +3 -4
- package/src/maps/user-interaction/highlight.d.ts +1 -2
- package/src/maps/user-interaction/highlight.js +11 -10
- package/src/maps/user-interaction/selection.d.ts +1 -2
- package/src/maps/user-interaction/selection.js +42 -19
- package/src/maps/user-interaction/tooltip.d.ts +3 -5
- package/src/maps/user-interaction/tooltip.js +27 -14
- package/src/maps/user-interaction/zoom.d.ts +3 -8
- package/src/maps/user-interaction/zoom.js +282 -162
- package/src/maps/utils/enum.d.ts +5 -1
- package/src/maps/utils/helper.d.ts +1 -1
- package/src/maps/utils/helper.js +62 -31
|
@@ -735,6 +735,8 @@ function drawSymbols(shape, imageUrl, location, markerID, shapeCustom, markerCol
|
|
|
735
735
|
const opacity = shapeCustom['opacity'];
|
|
736
736
|
let rectOptions;
|
|
737
737
|
const pathOptions = new PathOption(markerID, fill, borderWidth, borderColor, opacity, borderOpacity, dashArray, '');
|
|
738
|
+
size.width = typeof (size.width) === 'string' ? parseInt(size.width, 10) : size.width;
|
|
739
|
+
size.height = typeof (size.height) === 'string' ? parseInt(size.height, 10) : size.height;
|
|
738
740
|
if (shape === 'Circle') {
|
|
739
741
|
const radius = (size.width + size.height) / 4;
|
|
740
742
|
const circleOptions = new CircleOption(markerID, fill, border, opacity, location.x, location.y, radius, dashArray);
|
|
@@ -952,8 +954,8 @@ function clusterTemplate(currentLayer, markerTemplate, maps, layerIndex, markerC
|
|
|
952
954
|
shapeCustom['borderWidth'] = eventArg.border.width;
|
|
953
955
|
shapeCustom['borderOpacity'] = isNullOrUndefined(eventArg.border.opacity) ? clusters.opacity : eventArg.border.opacity;
|
|
954
956
|
}
|
|
955
|
-
tempX = (maps.isTileMap) ? tempX : (markerTemplate.id.indexOf('_Markers_Group') > -1) ? tempX :
|
|
956
|
-
tempY = (maps.isTileMap) ? tempY : (markerTemplate.id.indexOf('_Markers_Group') > -1) ? tempY :
|
|
957
|
+
tempX = (maps.isTileMap) ? tempX : (markerTemplate.id.indexOf('_Markers_Group') > -1) ? tempX : tempX + postionY - (eventArg.width / 2);
|
|
958
|
+
tempY = (maps.isTileMap) ? tempY : (markerTemplate.id.indexOf('_Markers_Group') > -1) ? tempY : tempY - (eventArg.height / 2);
|
|
957
959
|
if (maps.isTileMap && !maps.zoomSettings.enable) {
|
|
958
960
|
tempX = location.x;
|
|
959
961
|
tempY = location.y;
|
|
@@ -1032,12 +1034,15 @@ function clusterTemplate(currentLayer, markerTemplate, maps, layerIndex, markerC
|
|
|
1032
1034
|
getElementByID(maps.element.id + '_Secondary_Element').appendChild(markerCollection);
|
|
1033
1035
|
layerElement.appendChild(markerCollection);
|
|
1034
1036
|
}
|
|
1035
|
-
const markerCluster = document.getElementById(maps.element.id + '
|
|
1037
|
+
const markerCluster = document.getElementById(maps.element.id + '_LayerIndex_' + layerIndex + '_markerCluster');
|
|
1036
1038
|
if (!isNullOrUndefined(markerCluster)) {
|
|
1037
1039
|
markerCluster.remove();
|
|
1038
1040
|
}
|
|
1039
1041
|
if (zoomCheck) {
|
|
1040
|
-
document.getElementById(maps.element.id + '_Layer_Collections')
|
|
1042
|
+
let layerGroupElement = document.getElementById(maps.element.id + '_Layer_Collections');
|
|
1043
|
+
if (!isNullOrUndefined(layerGroupElement)) {
|
|
1044
|
+
layerGroupElement.appendChild(layerElement);
|
|
1045
|
+
}
|
|
1041
1046
|
}
|
|
1042
1047
|
});
|
|
1043
1048
|
}
|
|
@@ -1054,15 +1059,16 @@ function mergeSeparateCluster(sameMarkerData, maps, markerElement) {
|
|
|
1054
1059
|
const markerIndex = sameMarkerData[0].markerIndex;
|
|
1055
1060
|
const dataIndex = sameMarkerData[0].dataIndex;
|
|
1056
1061
|
const markerId = maps.element.id + '_LayerIndex_' + layerIndex + '_MarkerIndex_' + markerIndex;
|
|
1062
|
+
const marker = maps.layers[layerIndex].markerSettings[markerIndex];
|
|
1057
1063
|
const clusterId = markerId + '_dataIndex_' + dataIndex + '_cluster_' + clusterIndex;
|
|
1058
|
-
const clusterEle = getElement(clusterId);
|
|
1064
|
+
const clusterEle = maps.layers[layerIndex].markerClusterSettings.shape === 'Balloon' ? getElement(clusterId + '_Group') : getElement(clusterId);
|
|
1059
1065
|
const clusterEleLabel = getElement(clusterId + '_datalabel_' + clusterIndex);
|
|
1060
1066
|
clusterEle.setAttribute('visibility', 'visible');
|
|
1061
1067
|
clusterEleLabel.setAttribute('visibility', 'visible');
|
|
1062
1068
|
let markerEle;
|
|
1063
1069
|
const markerDataLength = sameMarkerData[0].data.length;
|
|
1064
1070
|
for (let i = 0; i < markerDataLength; i++) {
|
|
1065
|
-
markerEle = getElement(markerId + '_dataIndex_' + sameMarkerData[0].data[i]['index']);
|
|
1071
|
+
markerEle = marker.shape === 'Balloon' ? getElement(markerId + '_dataIndex_' + sameMarkerData[0].data[i]['index'] + '_Group') : getElement(markerId + '_dataIndex_' + sameMarkerData[0].data[i]['index']);
|
|
1066
1072
|
markerEle['style']['visibility'] = 'hidden';
|
|
1067
1073
|
}
|
|
1068
1074
|
removeElement(maps.element.id + '_LayerIndex_' + layerIndex + '_MarkerIndex_' + markerIndex + '_markerClusterConnectorLine');
|
|
@@ -1084,13 +1090,13 @@ function clusterSeparate(sameMarkerData, maps, markerElement, isDom) {
|
|
|
1084
1090
|
const getElementFunction = isDom ? getElement : markerElement.querySelector.bind(markerElement);
|
|
1085
1091
|
const getQueryConnect = isDom ? '' : '#';
|
|
1086
1092
|
const markerId = maps.element.id + '_LayerIndex_' + layerIndex + '_MarkerIndex_' + markerIndex;
|
|
1093
|
+
const marker = maps.layers[layerIndex].markerSettings[markerIndex];
|
|
1087
1094
|
const clusterId = markerId + '_dataIndex_' + dataIndex + '_cluster_' + clusterIndex;
|
|
1088
|
-
const clusterEle = getElementFunction(getQueryConnect + '' + clusterId);
|
|
1095
|
+
const clusterEle = maps.layers[layerIndex].markerClusterSettings.shape === 'Balloon' ? getElementFunction(getQueryConnect + '' + clusterId + '_Group') : getElementFunction(getQueryConnect + '' + clusterId);
|
|
1089
1096
|
const clusterEleLabel = getElementFunction(getQueryConnect + '' + clusterId + '_datalabel_' + clusterIndex);
|
|
1090
1097
|
clusterEle.setAttribute('visibility', 'hidden');
|
|
1091
1098
|
clusterEleLabel.setAttribute('visibility', 'hidden');
|
|
1092
|
-
|
|
1093
|
-
let markerEle = getElementFunction(getQueryConnect + '' + markerId + '_dataIndex_' + dataIndex);
|
|
1099
|
+
let markerEle = marker.shape === 'Balloon' ? getElementFunction(getQueryConnect + '' + markerId + '_dataIndex_' + dataIndex + '_Group') : getElementFunction(getQueryConnect + '' + markerId + '_dataIndex_' + dataIndex);
|
|
1094
1100
|
const height = markerEle.parentElement.id.indexOf('Template_Group') > -1 ? markerEle.getBoundingClientRect().height : marker.height;
|
|
1095
1101
|
const width = markerEle.parentElement.id.indexOf('Template_Group') > -1 ? markerEle.getBoundingClientRect().width : marker.width;
|
|
1096
1102
|
const centerX = +clusterEle.getAttribute('transform').split('translate(')[1].trim().split(' ')[0];
|
|
@@ -1126,7 +1132,7 @@ function clusterSeparate(sameMarkerData, maps, markerElement, isDom) {
|
|
|
1126
1132
|
const x1 = centerX + radius * Math.sin((Math.PI * 2 * newAngle) / 360);
|
|
1127
1133
|
const y1 = centerY + radius * Math.cos((Math.PI * 2 * newAngle) / 360);
|
|
1128
1134
|
path += start + 'L ' + (x1) + ' ' + y1 + ' ';
|
|
1129
|
-
markerEle = getElementFunction(getQueryConnect + '' + markerId + '_dataIndex_' + sameMarkerData[0].data[i]['index']);
|
|
1135
|
+
markerEle = marker.shape === 'Balloon' ? getElementFunction(getQueryConnect + '' + markerId + '_dataIndex_' + sameMarkerData[0].data[i]['index'] + '_Group') : getElementFunction(getQueryConnect + '' + markerId + '_dataIndex_' + sameMarkerData[0].data[i]['index']);
|
|
1130
1136
|
if (markerEle.parentElement.id.indexOf('Template_Group') > -1) {
|
|
1131
1137
|
markerEle['style']['transform'] = '';
|
|
1132
1138
|
markerEle['style']['left'] = maps.isTileMap ? x1 - (width / 2) + 'px' : (x1 - (width / 2) - 10) + 'px';
|
|
@@ -1147,7 +1153,12 @@ function clusterSeparate(sameMarkerData, maps, markerElement, isDom) {
|
|
|
1147
1153
|
markerElement = isDom ? getElementFunction(maps.element.id + '_Markers_Group') : markerElement;
|
|
1148
1154
|
const groupEle = maps.renderer.createGroup({ id: maps.element.id + '_LayerIndex_' + layerIndex + '_MarkerIndex_' + markerIndex + '_markerClusterConnectorLine' });
|
|
1149
1155
|
groupEle.appendChild(maps.renderer.drawPath(options));
|
|
1150
|
-
|
|
1156
|
+
if (marker.shape === 'Balloon') {
|
|
1157
|
+
markerElement.insertBefore(groupEle, markerElement.querySelector('#' + markerId + '_dataIndex_0_Group'));
|
|
1158
|
+
}
|
|
1159
|
+
else {
|
|
1160
|
+
markerElement.insertBefore(groupEle, markerElement.querySelector('#' + markerId + '_dataIndex_0'));
|
|
1161
|
+
}
|
|
1151
1162
|
}
|
|
1152
1163
|
/**
|
|
1153
1164
|
*
|
|
@@ -1174,6 +1185,7 @@ function marker(eventArgs, markerSettings, markerData, dataIndex, location, tran
|
|
|
1174
1185
|
dashArray: markerSettings.dashArray, borderOpacity: isNullOrUndefined(eventArgs.border.opacity) ? markerSettings.opacity :
|
|
1175
1186
|
eventArgs.border.opacity
|
|
1176
1187
|
};
|
|
1188
|
+
removeElement(markerID);
|
|
1177
1189
|
const ele = drawSymbols(eventArgs.shape, eventArgs.imageUrl, { x: 0, y: 0 }, markerID, shapeCustom, markerCollection, maps);
|
|
1178
1190
|
const x = (maps.isTileMap ? location.x : (location.x + transPoint.x) * scale) + offset.x;
|
|
1179
1191
|
const y = (maps.isTileMap ? location.y : (location.y + transPoint.y) * scale) + offset.y;
|
|
@@ -1204,7 +1216,7 @@ function marker(eventArgs, markerSettings, markerData, dataIndex, location, tran
|
|
|
1204
1216
|
*/
|
|
1205
1217
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1206
1218
|
function markerTemplate(eventArgs, templateFn, markerID, data, markerIndex, markerTemplate, location, transPoint, scale, offset, maps) {
|
|
1207
|
-
templateFn = getTemplateFunction(eventArgs.template);
|
|
1219
|
+
templateFn = getTemplateFunction(eventArgs.template, maps);
|
|
1208
1220
|
if (templateFn && (templateFn(data, maps, eventArgs.template, maps.element.id + '_MarkerTemplate' + markerIndex, false).length)) {
|
|
1209
1221
|
const templateElement = templateFn(data, maps, eventArgs.template, maps.element.id + '_MarkerTemplate' + markerIndex, false);
|
|
1210
1222
|
const markerElement = convertElement(templateElement, markerID, data, markerIndex, maps);
|
|
@@ -1551,7 +1563,7 @@ function drawBalloon(maps, options, size, location, type, element) {
|
|
|
1551
1563
|
const y = size.height / 30;
|
|
1552
1564
|
balloon.setAttribute('transform', 'translate(' + location.x + ', ' + location.y + ') scale(' + x + ', ' + y + ')');
|
|
1553
1565
|
if (type === 'Marker') {
|
|
1554
|
-
const g = maps.renderer.createGroup({ id: options.id });
|
|
1566
|
+
const g = maps.renderer.createGroup({ id: options.id + '_Group' });
|
|
1555
1567
|
appendShape(balloon, g);
|
|
1556
1568
|
pathElement = appendShape(g, element);
|
|
1557
1569
|
}
|
|
@@ -1966,7 +1978,12 @@ function getTranslate(mapObject, layer, animate) {
|
|
|
1966
1978
|
}
|
|
1967
1979
|
else {
|
|
1968
1980
|
if (isNullOrUndefined(mapObject.previousProjection) || mapObject.previousProjection !== mapObject.projectionType) {
|
|
1981
|
+
if (mapHeight === 0 || mapWidth === 0 || mapHeight === mapWidth) {
|
|
1982
|
+
mapWidth = size.width / 2;
|
|
1983
|
+
mapHeight = size.height;
|
|
1984
|
+
}
|
|
1969
1985
|
scaleFactor = parseFloat(Math.min(size.width / mapWidth, size.height / mapHeight).toFixed(2));
|
|
1986
|
+
scaleFactor = scaleFactor > 1.05 ? 1 : scaleFactor;
|
|
1970
1987
|
mapWidth *= scaleFactor;
|
|
1971
1988
|
mapHeight *= scaleFactor;
|
|
1972
1989
|
const widthDiff = min['x'] !== 0 && mapObject.translateType === 'layers' ? availSize.width - size.width : 0;
|
|
@@ -2015,8 +2032,9 @@ function getTranslate(mapObject, layer, animate) {
|
|
|
2015
2032
|
mapObject.zoomTranslatePoint.y = y;
|
|
2016
2033
|
}
|
|
2017
2034
|
else {
|
|
2018
|
-
if (!isNullOrUndefined(mapObject.previousProjection) && mapObject.mapScaleValue === 1 && !mapObject.zoomModule.isDragZoom) {
|
|
2035
|
+
if (!isNullOrUndefined(mapObject.previousProjection) && (mapObject.mapScaleValue === 1 || mapObject.mapScaleValue <= 1.05) && !mapObject.zoomModule.isDragZoom) {
|
|
2019
2036
|
scaleFactor = parseFloat(Math.min(size.width / mapWidth, size.height / mapHeight).toFixed(2));
|
|
2037
|
+
scaleFactor = scaleFactor > 1.05 ? 1 : scaleFactor;
|
|
2020
2038
|
mapWidth *= scaleFactor;
|
|
2021
2039
|
x = size.x + ((-(min['x'])) + ((size.width / 2) - (mapWidth / 2)));
|
|
2022
2040
|
mapHeight *= scaleFactor;
|
|
@@ -2173,6 +2191,8 @@ function getZoomTranslate(mapObject, layer, animate) {
|
|
|
2173
2191
|
}
|
|
2174
2192
|
}
|
|
2175
2193
|
scaleFactor = (mapObject.enablePersistence) ? (mapObject.mapScaleValue === 0 ? 1 : mapObject.mapScaleValue) : scaleFactor;
|
|
2194
|
+
mapObject.widthBeforeRefresh = mapObject.availableSize.width;
|
|
2195
|
+
mapObject.heightBeforeRefresh = mapObject.availableSize.height;
|
|
2176
2196
|
return { scale: animate ? 1 : scaleFactor, location: new Point(x, y) };
|
|
2177
2197
|
}
|
|
2178
2198
|
/**
|
|
@@ -2236,7 +2256,7 @@ function Internalize(maps, value) {
|
|
|
2236
2256
|
* @private
|
|
2237
2257
|
*/
|
|
2238
2258
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2239
|
-
function getTemplateFunction(template) {
|
|
2259
|
+
function getTemplateFunction(template, maps) {
|
|
2240
2260
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2241
2261
|
let templateFn = null;
|
|
2242
2262
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -2244,6 +2264,9 @@ function getTemplateFunction(template) {
|
|
|
2244
2264
|
if (document.querySelectorAll(template).length) {
|
|
2245
2265
|
templateFn = compile(document.querySelector(template).innerHTML.trim());
|
|
2246
2266
|
}
|
|
2267
|
+
else if (maps.isVue || maps.isVue3) {
|
|
2268
|
+
templateFn = compile(template);
|
|
2269
|
+
}
|
|
2247
2270
|
}
|
|
2248
2271
|
catch (e) {
|
|
2249
2272
|
templateFn = compile(template);
|
|
@@ -2646,6 +2669,7 @@ function createTooltip(id, text, top, left, fontSize) {
|
|
|
2646
2669
|
'left:' + left.toString() + 'px;' +
|
|
2647
2670
|
'color: #000000; ' +
|
|
2648
2671
|
'background:' + '#FFFFFF' + ';' +
|
|
2672
|
+
'z-index: 2;' +
|
|
2649
2673
|
'position:absolute;border:1px solid #707070;font-size:' + fontSize + ';border-radius:2px;';
|
|
2650
2674
|
if (!tooltip) {
|
|
2651
2675
|
tooltip = createElement('div', {
|
|
@@ -2834,6 +2858,7 @@ function changeBorderWidth(element, index, scale, maps) {
|
|
|
2834
2858
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2835
2859
|
const borderWidthValue = maps.layersCollection[index].shapeSettings.borderWidthValuePath;
|
|
2836
2860
|
const borderWidth = maps.layersCollection[index].shapeSettings.border.width;
|
|
2861
|
+
const circleRadius = maps.layersCollection[index].shapeSettings.circleRadius;
|
|
2837
2862
|
if (maps.layersCollection[index].shapeSettings.borderWidthValuePath) {
|
|
2838
2863
|
value = checkShapeDataFields(
|
|
2839
2864
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -2846,13 +2871,16 @@ function changeBorderWidth(element, index, scale, maps) {
|
|
|
2846
2871
|
currentStroke = (isNullOrUndefined(borderWidth) ? 0 : borderWidth);
|
|
2847
2872
|
}
|
|
2848
2873
|
}
|
|
2874
|
+
else {
|
|
2875
|
+
currentStroke = (isNullOrUndefined(borderWidth) ? 0 : borderWidth);
|
|
2876
|
+
}
|
|
2849
2877
|
}
|
|
2850
2878
|
else {
|
|
2851
2879
|
currentStroke = (isNullOrUndefined(borderWidth) ? 0 : borderWidth);
|
|
2852
2880
|
}
|
|
2853
2881
|
childNode.setAttribute('stroke-width', (currentStroke / scale).toString());
|
|
2854
|
-
if (element.id.indexOf('
|
|
2855
|
-
childNode.setAttribute('
|
|
2882
|
+
if (element.id.indexOf('_Point') > -1 || element.id.indexOf('_MultiPoint') > -1) {
|
|
2883
|
+
childNode.setAttribute('r', (circleRadius / scale).toString());
|
|
2856
2884
|
}
|
|
2857
2885
|
}
|
|
2858
2886
|
}
|
|
@@ -3045,7 +3073,10 @@ function animate(element, delay, duration, process, end) {
|
|
|
3045
3073
|
else {
|
|
3046
3074
|
window.cancelAnimationFrame(clearAnimation);
|
|
3047
3075
|
end.call(this, { element: element });
|
|
3048
|
-
element.
|
|
3076
|
+
if (element.id.indexOf('Marker') > -1) {
|
|
3077
|
+
let markerElement = getElementByID(element.id.split('_Layer')[0] + '_Markers_Group');
|
|
3078
|
+
markerElement.setAttribute('style', markerStyle);
|
|
3079
|
+
}
|
|
3049
3080
|
}
|
|
3050
3081
|
};
|
|
3051
3082
|
clearAnimation = window.requestAnimationFrame(startAnimation);
|
|
@@ -3372,11 +3403,11 @@ function getShapeColor(theme) {
|
|
|
3372
3403
|
themePalette = ['#5ECB9B', '#A860F1', '#EBA844', '#557EF7', '#E9599B',
|
|
3373
3404
|
'#BFC529', '#3BC6CF', '#7A68EC', '#74B706', '#EA6266'];
|
|
3374
3405
|
break;
|
|
3375
|
-
case '
|
|
3406
|
+
case 'fluent':
|
|
3376
3407
|
themePalette = ['#614570', '#4C6FB1', '#CC6952', '#3F579A', '#4EA09B',
|
|
3377
3408
|
'#6E7A89', '#D4515C', '#E6AF5D', '#639751', '#9D4D69'];
|
|
3378
3409
|
break;
|
|
3379
|
-
case '
|
|
3410
|
+
case 'fluentdark':
|
|
3380
3411
|
themePalette = ['#8AB113', '#2A72D5', '#43B786', '#584EC6', '#E85F9C',
|
|
3381
3412
|
'#6E7A89', '#EA6266', '#EBA844', '#26BC7A', '#BC4870'];
|
|
3382
3413
|
break;
|
|
@@ -3517,6 +3548,7 @@ function getThemeStyle(theme) {
|
|
|
3517
3548
|
backgroundColor: color,
|
|
3518
3549
|
areaBackgroundColor: color,
|
|
3519
3550
|
titleFontColor: '#FFFFFF',
|
|
3551
|
+
titleFontSize: '14px',
|
|
3520
3552
|
subTitleFontColor: '#FFFFFF',
|
|
3521
3553
|
legendTitleFontColor: '#DADADA',
|
|
3522
3554
|
legendTextColor: '#DADADA',
|
|
@@ -3536,6 +3568,7 @@ function getThemeStyle(theme) {
|
|
|
3536
3568
|
backgroundColor: '#000000',
|
|
3537
3569
|
areaBackgroundColor: '#000000',
|
|
3538
3570
|
titleFontColor: '#FFFFFF',
|
|
3571
|
+
titleFontSize: '14px',
|
|
3539
3572
|
subTitleFontColor: '#FFFFFF',
|
|
3540
3573
|
legendTitleFontColor: '#FFFFFF',
|
|
3541
3574
|
legendTextColor: '#FFFFFF',
|
|
@@ -3665,7 +3698,7 @@ function getThemeStyle(theme) {
|
|
|
3665
3698
|
shapeFill: '#495057'
|
|
3666
3699
|
};
|
|
3667
3700
|
break;
|
|
3668
|
-
case '
|
|
3701
|
+
case 'fluent':
|
|
3669
3702
|
style = {
|
|
3670
3703
|
backgroundColor: 'rgba(255,255,255, 0.0)',
|
|
3671
3704
|
areaBackgroundColor: 'rgba(255,255,255, 0.0)',
|
|
@@ -3688,7 +3721,7 @@ function getThemeStyle(theme) {
|
|
|
3688
3721
|
shapeFill: '#F3F2F1'
|
|
3689
3722
|
};
|
|
3690
3723
|
break;
|
|
3691
|
-
case '
|
|
3724
|
+
case 'fluentdark':
|
|
3692
3725
|
style = {
|
|
3693
3726
|
backgroundColor: 'rgba(255,255,255, 0.0)',
|
|
3694
3727
|
areaBackgroundColor: 'rgba(255,255,255, 0.0)',
|
|
@@ -3716,6 +3749,7 @@ function getThemeStyle(theme) {
|
|
|
3716
3749
|
backgroundColor: '#FFFFFF',
|
|
3717
3750
|
areaBackgroundColor: '#FFFFFF',
|
|
3718
3751
|
titleFontColor: '#424242',
|
|
3752
|
+
titleFontSize: '14px',
|
|
3719
3753
|
subTitleFontColor: '#424242',
|
|
3720
3754
|
legendTitleFontColor: '#757575',
|
|
3721
3755
|
legendTextColor: '#757575',
|
|
@@ -3734,12 +3768,12 @@ function getThemeStyle(theme) {
|
|
|
3734
3768
|
return style;
|
|
3735
3769
|
}
|
|
3736
3770
|
|
|
3737
|
-
var __decorate$1 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
3738
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3739
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
3740
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
3741
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3742
|
-
};
|
|
3771
|
+
var __decorate$1 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
3772
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3773
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
3774
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
3775
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3776
|
+
};
|
|
3743
3777
|
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
|
3744
3778
|
/**
|
|
3745
3779
|
* Maps base document
|
|
@@ -4134,7 +4168,7 @@ __decorate$1([
|
|
|
4134
4168
|
class SubTitleSettings extends CommonTitleSettings {
|
|
4135
4169
|
}
|
|
4136
4170
|
__decorate$1([
|
|
4137
|
-
Complex({ size:
|
|
4171
|
+
Complex({ size: null, fontWeight: null, fontFamily: null }, Font)
|
|
4138
4172
|
], SubTitleSettings.prototype, "textStyle", void 0);
|
|
4139
4173
|
__decorate$1([
|
|
4140
4174
|
Property('Center')
|
|
@@ -4145,7 +4179,7 @@ __decorate$1([
|
|
|
4145
4179
|
class TitleSettings extends CommonTitleSettings {
|
|
4146
4180
|
}
|
|
4147
4181
|
__decorate$1([
|
|
4148
|
-
Complex({ size:
|
|
4182
|
+
Complex({ size: null, fontWeight: null, fontFamily: null }, Font)
|
|
4149
4183
|
], TitleSettings.prototype, "textStyle", void 0);
|
|
4150
4184
|
__decorate$1([
|
|
4151
4185
|
Property('Center')
|
|
@@ -4274,7 +4308,7 @@ __decorate$1([
|
|
|
4274
4308
|
Property('')
|
|
4275
4309
|
], LegendSettings.prototype, "height", void 0);
|
|
4276
4310
|
__decorate$1([
|
|
4277
|
-
Complex({}, Font)
|
|
4311
|
+
Complex({ fontFamily: null }, Font)
|
|
4278
4312
|
], LegendSettings.prototype, "textStyle", void 0);
|
|
4279
4313
|
__decorate$1([
|
|
4280
4314
|
Property(15)
|
|
@@ -4295,7 +4329,7 @@ __decorate$1([
|
|
|
4295
4329
|
Complex({}, CommonTitleSettings)
|
|
4296
4330
|
], LegendSettings.prototype, "title", void 0);
|
|
4297
4331
|
__decorate$1([
|
|
4298
|
-
Complex(Theme.legendTitleFont, Font)
|
|
4332
|
+
Complex({ size: Theme.legendTitleFont.size, color: Theme.legendTitleFont.color, fontStyle: Theme.legendTitleFont.fontStyle, fontWeight: Theme.legendTitleFont.fontWeight, fontFamily: null }, Font)
|
|
4299
4333
|
], LegendSettings.prototype, "titleStyle", void 0);
|
|
4300
4334
|
__decorate$1([
|
|
4301
4335
|
Property('Bottom')
|
|
@@ -4538,7 +4572,7 @@ __decorate$1([
|
|
|
4538
4572
|
Property('Geometry')
|
|
4539
4573
|
], LayerSettings.prototype, "layerType", void 0);
|
|
4540
4574
|
__decorate$1([
|
|
4541
|
-
Property('
|
|
4575
|
+
Property('')
|
|
4542
4576
|
], LayerSettings.prototype, "urlTemplate", void 0);
|
|
4543
4577
|
__decorate$1([
|
|
4544
4578
|
Property(true)
|
|
@@ -4617,101 +4651,102 @@ class Marker {
|
|
|
4617
4651
|
this.trackElements = [];
|
|
4618
4652
|
this.sameMarkerData = [];
|
|
4619
4653
|
}
|
|
4620
|
-
markerRender(layerElement, layerIndex, factor, type) {
|
|
4654
|
+
markerRender(maps, layerElement, layerIndex, factor, type) {
|
|
4621
4655
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4622
4656
|
let templateFn;
|
|
4623
4657
|
let markerCount = 0;
|
|
4624
4658
|
let nullCount = 0;
|
|
4625
4659
|
let markerTemplateCount = 0;
|
|
4626
|
-
|
|
4627
|
-
const currentLayer =
|
|
4628
|
-
this.markerSVGObject =
|
|
4629
|
-
id:
|
|
4660
|
+
maps.translateType = 'marker';
|
|
4661
|
+
const currentLayer = maps.layersCollection[layerIndex];
|
|
4662
|
+
this.markerSVGObject = maps.renderer.createGroup({
|
|
4663
|
+
id: maps.element.id + '_Markers_Group',
|
|
4630
4664
|
class: 'GroupElement',
|
|
4631
4665
|
style: 'pointer-events: auto;'
|
|
4632
4666
|
});
|
|
4633
4667
|
const markerTemplateEle = createElement('div', {
|
|
4634
|
-
id:
|
|
4635
|
-
className:
|
|
4668
|
+
id: maps.element.id + '_LayerIndex_' + layerIndex + '_Markers_Template_Group',
|
|
4669
|
+
className: maps.element.id + '_template',
|
|
4636
4670
|
styles: 'overflow: hidden; position: absolute;pointer-events: none;' +
|
|
4637
|
-
'top:' +
|
|
4638
|
-
'left:' +
|
|
4639
|
-
'height:' +
|
|
4640
|
-
'width:' +
|
|
4671
|
+
'top:' + maps.mapAreaRect.y + 'px;' +
|
|
4672
|
+
'left:' + maps.mapAreaRect.x + 'px;' +
|
|
4673
|
+
'height:' + maps.mapAreaRect.height + 'px;' +
|
|
4674
|
+
'width:' + maps.mapAreaRect.width + 'px;'
|
|
4641
4675
|
});
|
|
4642
4676
|
currentLayer.markerSettings.map((markerSettings, markerIndex) => {
|
|
4643
4677
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4644
4678
|
const markerData = markerSettings.dataSource;
|
|
4645
4679
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4646
4680
|
Array.prototype.forEach.call(markerData, (data, dataIndex) => {
|
|
4647
|
-
|
|
4681
|
+
maps.markerNullCount = markerIndex > 0 && dataIndex === 0 ? 0 : maps.markerNullCount;
|
|
4648
4682
|
let eventArgs = {
|
|
4649
4683
|
cancel: false, name: markerRendering, fill: markerSettings.fill, height: markerSettings.height,
|
|
4650
4684
|
width: markerSettings.width, imageUrl: markerSettings.imageUrl, shape: markerSettings.shape,
|
|
4651
|
-
template: markerSettings.template, data: data, maps:
|
|
4685
|
+
template: markerSettings.template, data: data, maps: maps, marker: markerSettings,
|
|
4652
4686
|
border: markerSettings.border, colorValuePath: markerSettings.colorValuePath,
|
|
4653
4687
|
shapeValuePath: markerSettings.shapeValuePath, imageUrlValuePath: markerSettings.imageUrlValuePath
|
|
4654
4688
|
};
|
|
4655
|
-
|
|
4689
|
+
maps.trigger('markerRendering', eventArgs, (MarkerArgs) => {
|
|
4656
4690
|
eventArgs = markerColorChoose(eventArgs, data);
|
|
4657
4691
|
eventArgs = markerShapeChoose(eventArgs, data);
|
|
4658
4692
|
const lng = (!isNullOrUndefined(markerSettings.longitudeValuePath)) ?
|
|
4659
4693
|
Number(getValueFromObject(data, markerSettings.longitudeValuePath)) : !isNullOrUndefined(data['longitude']) ?
|
|
4660
|
-
parseFloat(data['longitude']) : !isNullOrUndefined(data['Longitude']) ? parseFloat(data['Longitude']) :
|
|
4694
|
+
parseFloat(data['longitude']) : !isNullOrUndefined(data['Longitude']) ? parseFloat(data['Longitude']) : null;
|
|
4661
4695
|
const lat = (!isNullOrUndefined(markerSettings.latitudeValuePath)) ?
|
|
4662
4696
|
Number(getValueFromObject(data, markerSettings.latitudeValuePath)) : !isNullOrUndefined(data['latitude']) ?
|
|
4663
|
-
parseFloat(data['latitude']) : !isNullOrUndefined(data['Latitude']) ? parseFloat(data['Latitude']) :
|
|
4697
|
+
parseFloat(data['latitude']) : !isNullOrUndefined(data['Latitude']) ? parseFloat(data['Latitude']) : null;
|
|
4664
4698
|
const offset = markerSettings.offset;
|
|
4665
4699
|
if (!eventArgs.cancel && markerSettings.visible && !isNullOrUndefined(lng) && !isNullOrUndefined(lat)) {
|
|
4666
|
-
const markerID =
|
|
4700
|
+
const markerID = maps.element.id + '_LayerIndex_' + layerIndex + '_MarkerIndex_'
|
|
4667
4701
|
+ markerIndex + '_dataIndex_' + dataIndex;
|
|
4668
|
-
let location = (
|
|
4669
|
-
const animate$$1 = currentLayer.animationDuration !== 0 || isNullOrUndefined(
|
|
4702
|
+
let location = (maps.isTileMap) ? convertTileLatLongToPoint(new MapLocation(lng, lat), factor, maps.tileTranslatePoint, true) : convertGeoToPoint(lat, lng, factor, currentLayer, maps);
|
|
4703
|
+
const animate$$1 = currentLayer.animationDuration !== 0 || isNullOrUndefined(maps.zoomModule);
|
|
4670
4704
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4671
|
-
const translate = (
|
|
4672
|
-
!isNullOrUndefined(
|
|
4673
|
-
getZoomTranslate(
|
|
4674
|
-
getTranslate(
|
|
4675
|
-
const scale = type === 'AddMarker' ?
|
|
4676
|
-
const transPoint = type === 'AddMarker' ?
|
|
4705
|
+
const translate = (maps.isTileMap) ? (currentLayer.type === 'SubLayer' && isNullOrUndefined(maps.zoomModule)) ? location = convertTileLatLongToPoint(new MapLocation(lng, lat), maps.tileZoomLevel, maps.tileTranslatePoint, true) : new Object() :
|
|
4706
|
+
!isNullOrUndefined(maps.zoomModule) && maps.zoomSettings.zoomFactor > 1 ?
|
|
4707
|
+
getZoomTranslate(maps, currentLayer, animate$$1) :
|
|
4708
|
+
getTranslate(maps, currentLayer, animate$$1);
|
|
4709
|
+
const scale = type === 'AddMarker' ? maps.scale : translate['scale'];
|
|
4710
|
+
const transPoint = type === 'AddMarker' ? maps.translatePoint : translate['location'];
|
|
4677
4711
|
if (eventArgs.template && (!isNaN(location.x) && !isNaN(location.y))) {
|
|
4678
4712
|
markerTemplateCount++;
|
|
4679
|
-
markerTemplate(eventArgs, templateFn, markerID, data, markerIndex, markerTemplateEle, location, transPoint, scale, offset,
|
|
4713
|
+
markerTemplate(eventArgs, templateFn, markerID, data, markerIndex, markerTemplateEle, location, transPoint, scale, offset, maps);
|
|
4680
4714
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4681
|
-
|
|
4715
|
+
maps.renderReactTemplates();
|
|
4682
4716
|
}
|
|
4683
4717
|
else if (!eventArgs.template && (!isNaN(location.x) && !isNaN(location.y))) {
|
|
4684
4718
|
markerCount++;
|
|
4685
|
-
marker(eventArgs, markerSettings, markerData, dataIndex, location, transPoint, markerID, offset, scale,
|
|
4719
|
+
marker(eventArgs, markerSettings, markerData, dataIndex, location, transPoint, markerID, offset, scale, maps, this.markerSVGObject);
|
|
4686
4720
|
}
|
|
4687
4721
|
}
|
|
4688
4722
|
nullCount += (!isNaN(lat) && !isNaN(lng)) ? 0 : 1;
|
|
4689
4723
|
markerTemplateCount += (eventArgs.cancel) ? 1 : 0;
|
|
4690
4724
|
markerCount += (eventArgs.cancel) ? 1 : 0;
|
|
4691
|
-
|
|
4692
|
-
const markerDataLength = markerData.length -
|
|
4725
|
+
maps.markerNullCount = (isNullOrUndefined(lng) || isNullOrUndefined(lat)) ? maps.markerNullCount + 1 : maps.markerNullCount;
|
|
4726
|
+
const markerDataLength = markerData.length - maps.markerNullCount;
|
|
4693
4727
|
if (this.markerSVGObject.childElementCount === (markerDataLength - markerTemplateCount - nullCount) && (type !== 'Template')) {
|
|
4694
4728
|
layerElement.appendChild(this.markerSVGObject);
|
|
4695
4729
|
if (currentLayer.markerClusterSettings.allowClustering) {
|
|
4696
|
-
|
|
4697
|
-
|
|
4698
|
-
if (currentLayer.layerType
|
|
4699
|
-
|
|
4730
|
+
maps.svgObject.appendChild(this.markerSVGObject);
|
|
4731
|
+
maps.element.appendChild(maps.svgObject);
|
|
4732
|
+
if ((currentLayer.layerType === 'OSM' || (currentLayer.urlTemplate.indexOf('openstreetmap') !== -1 && isNullOrUndefined(currentLayer.shapeData)))
|
|
4733
|
+
&& maps.zoomSettings.enable) {
|
|
4734
|
+
layerElement.appendChild(this.markerSVGObject);
|
|
4700
4735
|
}
|
|
4701
4736
|
else {
|
|
4702
|
-
|
|
4737
|
+
clusterTemplate(currentLayer, this.markerSVGObject, maps, layerIndex, this.markerSVGObject, layerElement, true, false);
|
|
4703
4738
|
}
|
|
4704
4739
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4705
|
-
|
|
4740
|
+
maps.renderReactTemplates();
|
|
4706
4741
|
}
|
|
4707
4742
|
}
|
|
4708
|
-
if (markerTemplateEle.childElementCount === (
|
|
4709
|
-
getElementByID(
|
|
4710
|
-
if (
|
|
4743
|
+
if (markerTemplateEle.childElementCount === (markerDataLength - markerCount - nullCount) && getElementByID(maps.element.id + '_Secondary_Element')) {
|
|
4744
|
+
getElementByID(maps.element.id + '_Secondary_Element').appendChild(markerTemplateEle);
|
|
4745
|
+
if (maps.checkInitialRender) {
|
|
4711
4746
|
if (currentLayer.markerClusterSettings.allowClustering) {
|
|
4712
|
-
clusterTemplate(currentLayer, markerTemplateEle,
|
|
4747
|
+
clusterTemplate(currentLayer, markerTemplateEle, maps, layerIndex, this.markerSVGObject, layerElement, false, false);
|
|
4713
4748
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4714
|
-
|
|
4749
|
+
maps.renderReactTemplates();
|
|
4715
4750
|
}
|
|
4716
4751
|
}
|
|
4717
4752
|
}
|
|
@@ -4954,8 +4989,8 @@ class Marker {
|
|
|
4954
4989
|
}
|
|
4955
4990
|
if ((target.indexOf('_cluster_') > -1)) {
|
|
4956
4991
|
let isClusterSame = false;
|
|
4957
|
-
const clusterElement = document.getElementById(target.indexOf('_datalabel_') > -1 ? target.split('_datalabel_')[0] : target);
|
|
4958
|
-
const indexes = clusterElement.innerHTML.split(',').map(Number);
|
|
4992
|
+
const clusterElement = document.getElementById(target.indexOf('_datalabel_') > -1 ? layer.markerClusterSettings.shape === 'Balloon' ? target.split('_datalabel_')[0] + '_Group' : target.split('_datalabel_')[0] : layer.markerClusterSettings.shape === 'Balloon' ? target + '_Group' : target);
|
|
4993
|
+
const indexes = layer.markerClusterSettings.shape === 'Balloon' ? clusterElement.children[0].innerHTML.split(',').map(Number) : clusterElement.innerHTML.split(',').map(Number);
|
|
4959
4994
|
collection = [];
|
|
4960
4995
|
for (const i of indexes) {
|
|
4961
4996
|
collection.push({ data: marker$$1.dataSource[i], index: i });
|
|
@@ -5023,14 +5058,14 @@ class Marker {
|
|
|
5023
5058
|
/**
|
|
5024
5059
|
* To destroy the layers.
|
|
5025
5060
|
*
|
|
5026
|
-
* @param {Maps} maps - Specifies the instance of the map
|
|
5027
5061
|
* @returns {void}
|
|
5028
5062
|
* @private
|
|
5029
5063
|
*/
|
|
5030
|
-
destroy(
|
|
5031
|
-
|
|
5032
|
-
|
|
5033
|
-
|
|
5064
|
+
destroy() {
|
|
5065
|
+
this.maps = null;
|
|
5066
|
+
this.trackElements = [];
|
|
5067
|
+
this.markerSVGObject = null;
|
|
5068
|
+
this.sameMarkerData = [];
|
|
5034
5069
|
}
|
|
5035
5070
|
}
|
|
5036
5071
|
|
|
@@ -5055,6 +5090,12 @@ const loaded = 'loaded';
|
|
|
5055
5090
|
* @private
|
|
5056
5091
|
*/
|
|
5057
5092
|
const click = 'click';
|
|
5093
|
+
/**
|
|
5094
|
+
* Specifies the maps onclick event name.
|
|
5095
|
+
*
|
|
5096
|
+
* @private
|
|
5097
|
+
*/
|
|
5098
|
+
const onclick = 'onclick';
|
|
5058
5099
|
/**
|
|
5059
5100
|
* Specifies the maps right click event name.
|
|
5060
5101
|
*
|
|
@@ -5249,9 +5290,21 @@ class BingMap {
|
|
|
5249
5290
|
}
|
|
5250
5291
|
quadKey = quadKey + '' + digit;
|
|
5251
5292
|
}
|
|
5252
|
-
|
|
5253
|
-
|
|
5254
|
-
|
|
5293
|
+
if (!isNullOrUndefined(subDomains)) {
|
|
5294
|
+
const subDomain = subDomains[Math.min(parseInt(quadKey.substr(quadKey.length - 1, 1), 10), subDomains.length)];
|
|
5295
|
+
imageUrl = imageUrl.replace('{quadkey}', quadKey).replace('{subdomain}', subDomain);
|
|
5296
|
+
return imageUrl += '&mkt=' + language + '&ur=IN&Key=' + key;
|
|
5297
|
+
}
|
|
5298
|
+
else {
|
|
5299
|
+
return '';
|
|
5300
|
+
}
|
|
5301
|
+
}
|
|
5302
|
+
/**
|
|
5303
|
+
* @private
|
|
5304
|
+
*/
|
|
5305
|
+
destroy() {
|
|
5306
|
+
this.maps = null;
|
|
5307
|
+
this.subDomains = [];
|
|
5255
5308
|
}
|
|
5256
5309
|
}
|
|
5257
5310
|
|
|
@@ -5520,8 +5573,7 @@ class LayerPanel {
|
|
|
5520
5573
|
else {
|
|
5521
5574
|
this.clipRectElement = this.mapObject.renderer.drawClipPath(new RectOption(this.mapObject.element.id + '_MapArea_ClipRect', 'transparent', { width: 1, color: 'Gray' }, 1, {
|
|
5522
5575
|
x: this.mapObject.isTileMap ? 0 : areaRect.x, y: this.mapObject.isTileMap ? 0 : areaRect.y,
|
|
5523
|
-
width: areaRect.width, height:
|
|
5524
|
-
this.mapObject.legendModule.totalPages.length > 0 ? this.mapObject.legendModule.legendTotalRect.height : areaRect.height
|
|
5576
|
+
width: areaRect.width, height: areaRect.height
|
|
5525
5577
|
}));
|
|
5526
5578
|
}
|
|
5527
5579
|
this.layerGroup.appendChild(this.clipRectElement);
|
|
@@ -5532,6 +5584,14 @@ class LayerPanel {
|
|
|
5532
5584
|
this.currentLayer = layer;
|
|
5533
5585
|
this.processLayers(layer, index);
|
|
5534
5586
|
});
|
|
5587
|
+
if (!isNullOrUndefined(this.mapObject.legendModule) && this.mapObject.legendSettings.position === 'Float') {
|
|
5588
|
+
if (this.mapObject.isTileMap) {
|
|
5589
|
+
this.layerGroup.appendChild(this.mapObject.legendModule.legendGroup);
|
|
5590
|
+
}
|
|
5591
|
+
else {
|
|
5592
|
+
this.mapObject.svgObject.appendChild(this.mapObject.legendModule.legendGroup);
|
|
5593
|
+
}
|
|
5594
|
+
}
|
|
5535
5595
|
}
|
|
5536
5596
|
/**
|
|
5537
5597
|
* Tile rendering
|
|
@@ -5659,7 +5719,7 @@ class LayerPanel {
|
|
|
5659
5719
|
panel.layerObject.appendChild(panel.mapObject.navigationLineModule.renderNavigation(panel.currentLayer, panel.mapObject.tileZoomLevel, layerIndex));
|
|
5660
5720
|
}
|
|
5661
5721
|
if (panel.mapObject.markerModule) {
|
|
5662
|
-
panel.mapObject.markerModule.markerRender(panel.layerObject, layerIndex, panel.mapObject.tileZoomLevel, null);
|
|
5722
|
+
panel.mapObject.markerModule.markerRender(this.mapObject, panel.layerObject, layerIndex, panel.mapObject.tileZoomLevel, null);
|
|
5663
5723
|
}
|
|
5664
5724
|
panel.translateLayerElements(panel.layerObject, layerIndex);
|
|
5665
5725
|
panel.layerGroup.appendChild(panel.layerObject);
|
|
@@ -5690,9 +5750,21 @@ class LayerPanel {
|
|
|
5690
5750
|
};
|
|
5691
5751
|
this.mapObject.trigger('layerRendering', eventArgs, (observedArgs) => {
|
|
5692
5752
|
if (!eventArgs.cancel && eventArgs.visible) {
|
|
5693
|
-
if (layer.layerType
|
|
5753
|
+
if (layer.layerType === 'OSM') {
|
|
5754
|
+
layer.urlTemplate = 'https://a.tile.openstreetmap.org/level/tileX/tileY.png';
|
|
5755
|
+
}
|
|
5756
|
+
if (layer.layerType === 'Google') {
|
|
5757
|
+
layer.urlTemplate = 'https://mt1.google.com/vt/lyrs=m@129&hl=en&x=tileX&y=tileY&z=level';
|
|
5758
|
+
}
|
|
5759
|
+
if (layer.layerType !== 'Geometry' || (isNullOrUndefined(layer.shapeData) && !isNullOrUndefined(layer.urlTemplate) && layer.urlTemplate !== '')) {
|
|
5694
5760
|
if (layer.layerType !== 'Bing' || this.bing) {
|
|
5695
|
-
|
|
5761
|
+
if (!isNullOrUndefined(layer.urlTemplate) && layer.urlTemplate.indexOf('quadkey') > -1) {
|
|
5762
|
+
const bing = new BingMap(this.mapObject);
|
|
5763
|
+
this.bingMapCalculation(layer, layerIndex, this, bing);
|
|
5764
|
+
}
|
|
5765
|
+
else {
|
|
5766
|
+
this.renderTileLayer(this, layer, layerIndex);
|
|
5767
|
+
}
|
|
5696
5768
|
}
|
|
5697
5769
|
else if (layer.key && layer.key.length > 1) {
|
|
5698
5770
|
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
@@ -5725,7 +5797,7 @@ class LayerPanel {
|
|
|
5725
5797
|
proxy.renderTileLayer(proxy, layer, layerIndex, bing);
|
|
5726
5798
|
this.mapObject.arrangeTemplate();
|
|
5727
5799
|
if (this.mapObject.zoomModule && (this.mapObject.previousScale !== this.mapObject.scale)) {
|
|
5728
|
-
this.mapObject.zoomModule.applyTransform(true);
|
|
5800
|
+
this.mapObject.zoomModule.applyTransform(this.mapObject, true);
|
|
5729
5801
|
}
|
|
5730
5802
|
};
|
|
5731
5803
|
ajax.send();
|
|
@@ -5761,6 +5833,17 @@ class LayerPanel {
|
|
|
5761
5833
|
this.mapObject.baseMapBounds = null;
|
|
5762
5834
|
}
|
|
5763
5835
|
}
|
|
5836
|
+
bingMapCalculation(layer, layerIndex, proxy, bing) {
|
|
5837
|
+
bing.imageUrl = layer.urlTemplate;
|
|
5838
|
+
bing.subDomains = ['t0', 't1', 't2', 't3'];
|
|
5839
|
+
bing.maxZoom = '21';
|
|
5840
|
+
proxy.mapObject['bingMap'] = bing;
|
|
5841
|
+
proxy.renderTileLayer(proxy, layer, layerIndex, bing);
|
|
5842
|
+
this.mapObject.arrangeTemplate();
|
|
5843
|
+
if (this.mapObject.zoomModule && (this.mapObject.previousScale !== this.mapObject.scale)) {
|
|
5844
|
+
this.mapObject.zoomModule.applyTransform(this.mapObject, true);
|
|
5845
|
+
}
|
|
5846
|
+
}
|
|
5764
5847
|
bubbleCalculation(bubbleSettings, range) {
|
|
5765
5848
|
if (bubbleSettings.dataSource != null && bubbleSettings != null) {
|
|
5766
5849
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -5952,60 +6035,66 @@ class LayerPanel {
|
|
|
5952
6035
|
}
|
|
5953
6036
|
break;
|
|
5954
6037
|
case 'LineString':
|
|
5955
|
-
path += 'M ' + (currentShapeData[0]['point']['x']) + ' ' + (currentShapeData[0]['point']['y']);
|
|
5956
6038
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5957
|
-
currentShapeData.map((lineData) => {
|
|
5958
|
-
|
|
6039
|
+
currentShapeData.map((lineData, index) => {
|
|
6040
|
+
if (index === 0) {
|
|
6041
|
+
path += 'M ' + (lineData['point']['x']) + ' ' + (lineData['point']['y']);
|
|
6042
|
+
}
|
|
6043
|
+
else {
|
|
6044
|
+
path += 'L' + (lineData['point']['x']) + ' , ' + (lineData['point']['y']) + ' ';
|
|
6045
|
+
}
|
|
5959
6046
|
});
|
|
5960
6047
|
if (path.length > 3) {
|
|
5961
|
-
pathOptions = new PathOption(shapeID, 'transparent', !isNullOrUndefined(eventArgs.border.width) ? eventArgs.border.width : 1, eventArgs.
|
|
6048
|
+
pathOptions = new PathOption(shapeID, 'transparent', !isNullOrUndefined(eventArgs.border.width) ? eventArgs.border.width : 1, !isNullOrUndefined(eventArgs.fill) ? eventArgs.fill :
|
|
6049
|
+
eventArgs.border.color, opacity, eventArgs.border.opacity, shapeSettings.dashArray, path);
|
|
6050
|
+
pathEle = this.mapObject.renderer.drawPath(pathOptions);
|
|
6051
|
+
}
|
|
6052
|
+
break;
|
|
6053
|
+
case 'MultiLineString':
|
|
6054
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6055
|
+
currentShapeData.map((multilineData) => {
|
|
6056
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6057
|
+
multilineData.map((lineData, index) => {
|
|
6058
|
+
if (index === 0) {
|
|
6059
|
+
path += 'M ' + (lineData['point']['x']) + ' ' + (lineData['point']['y']);
|
|
6060
|
+
}
|
|
6061
|
+
else {
|
|
6062
|
+
path += 'L' + (lineData['point']['x']) + ' , ' + (lineData['point']['y']) + ' ';
|
|
6063
|
+
}
|
|
6064
|
+
});
|
|
6065
|
+
});
|
|
6066
|
+
if (path.length > 3) {
|
|
6067
|
+
pathOptions = new PathOption(shapeID, 'transparent', !isNullOrUndefined(eventArgs.border.width) ? eventArgs.border.width : 1, !isNullOrUndefined(eventArgs.fill) ? eventArgs.fill :
|
|
6068
|
+
eventArgs.border.color, opacity, eventArgs.border.opacity, shapeSettings.dashArray, path);
|
|
5962
6069
|
pathEle = this.mapObject.renderer.drawPath(pathOptions);
|
|
5963
6070
|
}
|
|
5964
6071
|
break;
|
|
5965
6072
|
case 'Point':
|
|
5966
6073
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5967
6074
|
const pointData = currentShapeData['point'];
|
|
5968
|
-
const circleRadius = (this.mapObject.layers[layerIndex].type !== 'SubLayer') ? shapeSettings.circleRadius : shapeSettings.circleRadius / this.currentFactor;
|
|
5969
|
-
circleOptions = new CircleOption(shapeID, eventArgs.fill, eventArgs.border, opacity, pointData['x'], pointData['y'], circleRadius,
|
|
6075
|
+
const circleRadius = (this.mapObject.layers[layerIndex].type !== 'SubLayer') ? shapeSettings.circleRadius : shapeSettings.circleRadius / (this.mapObject.isTileMap ? this.mapObject.scale : this.currentFactor);
|
|
6076
|
+
circleOptions = new CircleOption(shapeID, eventArgs.fill, eventArgs.border, opacity, pointData['x'], pointData['y'], circleRadius, shapeSettings.dashArray);
|
|
5970
6077
|
pathEle = this.mapObject.renderer.drawCircle(circleOptions);
|
|
5971
6078
|
break;
|
|
6079
|
+
case 'MultiPoint':
|
|
6080
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6081
|
+
currentShapeData.map((multiPointData, index) => {
|
|
6082
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6083
|
+
const pointData = multiPointData['point'];
|
|
6084
|
+
const circleRadius = (this.mapObject.layers[layerIndex].type !== 'SubLayer') ? shapeSettings.circleRadius : shapeSettings.circleRadius / (this.mapObject.isTileMap ? this.mapObject.scale : this.currentFactor);
|
|
6085
|
+
circleOptions = new CircleOption((shapeID + "_multiLine_" + index), eventArgs.fill, eventArgs.border, opacity, pointData['x'], pointData['y'], circleRadius, shapeSettings.dashArray);
|
|
6086
|
+
pathEle = this.mapObject.renderer.drawCircle(circleOptions);
|
|
6087
|
+
this.pathAttributeCalculate(groupElement, pathEle, drawingType, currentShapeData, i);
|
|
6088
|
+
});
|
|
6089
|
+
break;
|
|
5972
6090
|
case 'Path':
|
|
5973
6091
|
path = currentShapeData['point'];
|
|
5974
6092
|
pathOptions = new PathOption(shapeID, eventArgs.fill, eventArgs.border.width, eventArgs.border.color, opacity, eventArgs.border.opacity, shapeSettings.dashArray, path);
|
|
5975
6093
|
pathEle = this.mapObject.renderer.drawPath(pathOptions);
|
|
5976
6094
|
break;
|
|
5977
6095
|
}
|
|
5978
|
-
if (!isNullOrUndefined(pathEle)) {
|
|
5979
|
-
|
|
5980
|
-
this.currentLayer.shapePropertyPath : [this.currentLayer.shapePropertyPath]);
|
|
5981
|
-
let properties;
|
|
5982
|
-
for (let j = 0; j < property.length; j++) {
|
|
5983
|
-
if (!isNullOrUndefined(currentShapeData['property'])) {
|
|
5984
|
-
properties = property[j];
|
|
5985
|
-
break;
|
|
5986
|
-
}
|
|
5987
|
-
}
|
|
5988
|
-
pathEle.setAttribute('aria-label', ((!isNullOrUndefined(currentShapeData['property'])) ?
|
|
5989
|
-
(currentShapeData['property'][properties]) : ''));
|
|
5990
|
-
pathEle.setAttribute('tabindex', (this.mapObject.tabIndex + i + 3).toString());
|
|
5991
|
-
if (drawingType === 'LineString') {
|
|
5992
|
-
pathEle.setAttribute('style', 'outline:none');
|
|
5993
|
-
}
|
|
5994
|
-
maintainSelection(this.mapObject.selectedElementId, this.mapObject.shapeSelectionClass, pathEle, 'ShapeselectionMapStyle');
|
|
5995
|
-
if (this.mapObject.toggledShapeElementId) {
|
|
5996
|
-
for (let j = 0; j < this.mapObject.toggledShapeElementId.length; j++) {
|
|
5997
|
-
const styleProperty = this.mapObject.legendSettings.toggleLegendSettings.applyShapeSettings ?
|
|
5998
|
-
this.currentLayer.shapeSettings : this.mapObject.legendSettings.toggleLegendSettings;
|
|
5999
|
-
if (this.mapObject.toggledShapeElementId[j] === pathEle.id) {
|
|
6000
|
-
pathEle.setAttribute('fill', styleProperty.fill);
|
|
6001
|
-
pathEle.setAttribute('stroke', styleProperty.border.color);
|
|
6002
|
-
pathEle.setAttribute('fill-opacity', (styleProperty.opacity).toString());
|
|
6003
|
-
pathEle.setAttribute('stroke-opacity', (isNullOrUndefined(styleProperty.border.opacity) ? styleProperty.opacity : styleProperty.border.opacity).toString());
|
|
6004
|
-
pathEle.setAttribute('stroke-width', (styleProperty.border.width).toString());
|
|
6005
|
-
}
|
|
6006
|
-
}
|
|
6007
|
-
}
|
|
6008
|
-
groupElement.appendChild(pathEle);
|
|
6096
|
+
if (!isNullOrUndefined(pathEle) && drawingType !== 'MultiPoint') {
|
|
6097
|
+
this.pathAttributeCalculate(groupElement, pathEle, drawingType, currentShapeData, i);
|
|
6009
6098
|
}
|
|
6010
6099
|
if (i === this.currentLayer.layerData.length - 1) {
|
|
6011
6100
|
this.layerFeatures(layerIndex, colors, renderData, labelTemplateEle);
|
|
@@ -6019,6 +6108,50 @@ class LayerPanel {
|
|
|
6019
6108
|
this.layerFeatures(layerIndex, colors, renderData, labelTemplateEle);
|
|
6020
6109
|
}
|
|
6021
6110
|
}
|
|
6111
|
+
/**
|
|
6112
|
+
* layer features as bubble, marker, datalabel, navigation line.
|
|
6113
|
+
*
|
|
6114
|
+
* @param {groupElement} Element - Specifies the element to append the group
|
|
6115
|
+
* @param {pathEle} Element - Specifies the svg element
|
|
6116
|
+
* @param {drawingType} string - Specifies the data type
|
|
6117
|
+
* @param {currentShapeData} any - Specifies the layer of shapedata.
|
|
6118
|
+
* @param {index} number - Specifies the tab index.
|
|
6119
|
+
* @returns {void}
|
|
6120
|
+
*/
|
|
6121
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6122
|
+
pathAttributeCalculate(groupElement, pathEle, drawingType, currentShapeData, index) {
|
|
6123
|
+
const property = (Object.prototype.toString.call(this.currentLayer.shapePropertyPath) === '[object Array]' ?
|
|
6124
|
+
this.currentLayer.shapePropertyPath : [this.currentLayer.shapePropertyPath]);
|
|
6125
|
+
let properties;
|
|
6126
|
+
for (let j = 0; j < property.length; j++) {
|
|
6127
|
+
if (!isNullOrUndefined(currentShapeData['property'])) {
|
|
6128
|
+
properties = property[j];
|
|
6129
|
+
break;
|
|
6130
|
+
}
|
|
6131
|
+
}
|
|
6132
|
+
pathEle.setAttribute('aria-label', ((!isNullOrUndefined(currentShapeData['property'])) ?
|
|
6133
|
+
(currentShapeData['property'][properties]) : ''));
|
|
6134
|
+
pathEle.setAttribute('tabindex', (this.mapObject.tabIndex + index + 3).toString());
|
|
6135
|
+
pathEle.setAttribute('role', '');
|
|
6136
|
+
if (drawingType === 'LineString' || drawingType === 'MultiLineString') {
|
|
6137
|
+
pathEle.setAttribute('style', 'outline:none');
|
|
6138
|
+
}
|
|
6139
|
+
maintainSelection(this.mapObject.selectedElementId, this.mapObject.shapeSelectionClass, pathEle, 'ShapeselectionMapStyle');
|
|
6140
|
+
if (this.mapObject.toggledShapeElementId) {
|
|
6141
|
+
for (let j = 0; j < this.mapObject.toggledShapeElementId.length; j++) {
|
|
6142
|
+
const styleProperty = this.mapObject.legendSettings.toggleLegendSettings.applyShapeSettings ?
|
|
6143
|
+
this.currentLayer.shapeSettings : this.mapObject.legendSettings.toggleLegendSettings;
|
|
6144
|
+
if (this.mapObject.toggledShapeElementId[j] === pathEle.id) {
|
|
6145
|
+
pathEle.setAttribute('fill', styleProperty.fill);
|
|
6146
|
+
pathEle.setAttribute('stroke', styleProperty.border.color);
|
|
6147
|
+
pathEle.setAttribute('fill-opacity', (styleProperty.opacity).toString());
|
|
6148
|
+
pathEle.setAttribute('stroke-opacity', (isNullOrUndefined(styleProperty.border.opacity) ? styleProperty.opacity : styleProperty.border.opacity).toString());
|
|
6149
|
+
pathEle.setAttribute('stroke-width', (styleProperty.border.width).toString());
|
|
6150
|
+
}
|
|
6151
|
+
}
|
|
6152
|
+
}
|
|
6153
|
+
groupElement.appendChild(pathEle);
|
|
6154
|
+
}
|
|
6022
6155
|
/**
|
|
6023
6156
|
* layer features as bubble, marker, datalabel, navigation line.
|
|
6024
6157
|
*
|
|
@@ -6074,7 +6207,7 @@ class LayerPanel {
|
|
|
6074
6207
|
this.layerObject.appendChild(element);
|
|
6075
6208
|
});
|
|
6076
6209
|
if (this.mapObject.markerModule) {
|
|
6077
|
-
this.mapObject.markerModule.markerRender(this.layerObject, layerIndex, (this.mapObject.isTileMap ? Math.floor(this.currentFactor)
|
|
6210
|
+
this.mapObject.markerModule.markerRender(this.mapObject, this.layerObject, layerIndex, (this.mapObject.isTileMap ? Math.floor(this.currentFactor)
|
|
6078
6211
|
: this.currentFactor), null);
|
|
6079
6212
|
}
|
|
6080
6213
|
this.translateLayerElements(this.layerObject, layerIndex);
|
|
@@ -6200,7 +6333,8 @@ class LayerPanel {
|
|
|
6200
6333
|
break;
|
|
6201
6334
|
case 'linestring':
|
|
6202
6335
|
const extraSpace = !isNullOrUndefined(this.currentLayer.shapeSettings.border.width) ?
|
|
6203
|
-
this.currentLayer.shapeSettings.border.width
|
|
6336
|
+
(typeof (this.currentLayer.shapeSettings.border.width) === 'string' ?
|
|
6337
|
+
parseInt(this.currentLayer.shapeSettings.border.width, 10) : this.currentLayer.shapeSettings.border.width) : 1;
|
|
6204
6338
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6205
6339
|
coordinates.map((points, index) => {
|
|
6206
6340
|
latitude = points[1];
|
|
@@ -6215,31 +6349,61 @@ class LayerPanel {
|
|
|
6215
6349
|
newData['type'] = type;
|
|
6216
6350
|
this.currentLayer.layerData.push(newData);
|
|
6217
6351
|
break;
|
|
6218
|
-
case '
|
|
6219
|
-
|
|
6220
|
-
|
|
6221
|
-
|
|
6352
|
+
case 'multilinestring':
|
|
6353
|
+
const extraSpaces = !isNullOrUndefined(this.currentLayer.shapeSettings.border.width) ?
|
|
6354
|
+
(typeof (this.currentLayer.shapeSettings.border.width) === 'string' ?
|
|
6355
|
+
parseInt(this.currentLayer.shapeSettings.border.width, 10) : this.currentLayer.shapeSettings.border.width) : 1;
|
|
6356
|
+
const multiLineData = [];
|
|
6222
6357
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6223
|
-
coordinates.map((
|
|
6224
|
-
|
|
6358
|
+
coordinates.map((multiPoints) => {
|
|
6359
|
+
newData = [];
|
|
6360
|
+
multiPoints.map((points) => {
|
|
6225
6361
|
latitude = points[1];
|
|
6226
6362
|
longitude = points[0];
|
|
6227
|
-
arrayCollections = true;
|
|
6228
6363
|
const point = convertGeoToPoint(latitude, longitude, this.currentFactor, this.currentLayer, this.mapObject);
|
|
6229
|
-
this.
|
|
6230
|
-
|
|
6364
|
+
this.calculateBox(point, extraSpaces);
|
|
6365
|
+
newData.push({
|
|
6366
|
+
point: point, lat: latitude, lng: longitude
|
|
6231
6367
|
});
|
|
6232
|
-
}
|
|
6368
|
+
});
|
|
6369
|
+
multiLineData.push(newData);
|
|
6370
|
+
});
|
|
6371
|
+
multiLineData['property'] = properties;
|
|
6372
|
+
multiLineData['type'] = type;
|
|
6373
|
+
this.currentLayer.layerData.push(multiLineData);
|
|
6374
|
+
break;
|
|
6375
|
+
case 'point':
|
|
6376
|
+
const pointExtraSpace = (!isNullOrUndefined(this.currentLayer.shapeSettings.border.width) ?
|
|
6377
|
+
(typeof (this.currentLayer.shapeSettings.border.width) === 'string' ?
|
|
6378
|
+
parseInt(this.currentLayer.shapeSettings.border.width, 10) : this.currentLayer.shapeSettings.border.width) : 1) +
|
|
6379
|
+
(this.currentLayer.shapeSettings.circleRadius * 2);
|
|
6380
|
+
latitude = coordinates[1];
|
|
6381
|
+
longitude = coordinates[0];
|
|
6382
|
+
const point = convertGeoToPoint(latitude, longitude, this.currentFactor, this.currentLayer, this.mapObject);
|
|
6383
|
+
this.calculateBox(point, pointExtraSpace);
|
|
6384
|
+
this.currentLayer.layerData.push({
|
|
6385
|
+
point: point, type: type, lat: latitude, lng: longitude, property: properties
|
|
6233
6386
|
});
|
|
6234
|
-
|
|
6235
|
-
|
|
6236
|
-
|
|
6387
|
+
break;
|
|
6388
|
+
case 'multipoint': {
|
|
6389
|
+
const extraSpace = (!isNullOrUndefined(this.currentLayer.shapeSettings.border.width) ?
|
|
6390
|
+
(typeof (this.currentLayer.shapeSettings.border.width) === 'string' ?
|
|
6391
|
+
parseInt(this.currentLayer.shapeSettings.border.width, 10) : this.currentLayer.shapeSettings.border.width) : 1) +
|
|
6392
|
+
(this.currentLayer.shapeSettings.circleRadius * 2);
|
|
6393
|
+
newData = [];
|
|
6394
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6395
|
+
coordinates.map((points) => {
|
|
6396
|
+
latitude = points[1];
|
|
6397
|
+
longitude = points[0];
|
|
6237
6398
|
const point = convertGeoToPoint(latitude, longitude, this.currentFactor, this.currentLayer, this.mapObject);
|
|
6238
6399
|
this.calculateBox(point, extraSpace);
|
|
6239
|
-
|
|
6240
|
-
point: point,
|
|
6400
|
+
newData.push({
|
|
6401
|
+
point: point, lat: latitude, lng: longitude
|
|
6241
6402
|
});
|
|
6242
|
-
}
|
|
6403
|
+
});
|
|
6404
|
+
newData['property'] = properties;
|
|
6405
|
+
newData['type'] = type;
|
|
6406
|
+
this.currentLayer.layerData.push(newData);
|
|
6243
6407
|
break;
|
|
6244
6408
|
}
|
|
6245
6409
|
case 'path':
|
|
@@ -6251,12 +6415,12 @@ class LayerPanel {
|
|
|
6251
6415
|
}
|
|
6252
6416
|
calculateBox(point, extraSpace) {
|
|
6253
6417
|
if (isNullOrUndefined(this.rectBounds)) {
|
|
6254
|
-
this.rectBounds = { min: { x: point.x, y: point.y - extraSpace }, max: { x: point.x, y: point.y + extraSpace } };
|
|
6418
|
+
this.rectBounds = { min: { x: point.x - extraSpace, y: point.y - extraSpace }, max: { x: point.x + extraSpace, y: point.y + extraSpace } };
|
|
6255
6419
|
}
|
|
6256
6420
|
else {
|
|
6257
|
-
this.rectBounds['min']['x'] = Math.min(this.rectBounds['min']['x'], point.x);
|
|
6421
|
+
this.rectBounds['min']['x'] = Math.min(this.rectBounds['min']['x'], point.x - extraSpace);
|
|
6258
6422
|
this.rectBounds['min']['y'] = Math.min(this.rectBounds['min']['y'], point.y - extraSpace);
|
|
6259
|
-
this.rectBounds['max']['x'] = Math.max(this.rectBounds['max']['x'], point.x);
|
|
6423
|
+
this.rectBounds['max']['x'] = Math.max(this.rectBounds['max']['x'], point.x + extraSpace);
|
|
6260
6424
|
this.rectBounds['max']['y'] = Math.max(this.rectBounds['max']['y'], point.y + extraSpace);
|
|
6261
6425
|
}
|
|
6262
6426
|
}
|
|
@@ -6274,6 +6438,10 @@ class LayerPanel {
|
|
|
6274
6438
|
const end = convertGeoToPoint(bounds.latitude.max, bounds.longitude.max, null, layer, this.mapObject);
|
|
6275
6439
|
mapHeight = end.y - start.y;
|
|
6276
6440
|
mapWidth = end.x - start.x;
|
|
6441
|
+
if (mapHeight === 0 || mapWidth === 0) {
|
|
6442
|
+
mapWidth = mapSize.width / 2;
|
|
6443
|
+
mapHeight = mapSize.height;
|
|
6444
|
+
}
|
|
6277
6445
|
}
|
|
6278
6446
|
else {
|
|
6279
6447
|
mapHeight = mapWidth = 500;
|
|
@@ -6367,15 +6535,28 @@ class LayerPanel {
|
|
|
6367
6535
|
this.calculateRectBox(point[0]);
|
|
6368
6536
|
});
|
|
6369
6537
|
break;
|
|
6538
|
+
case 'multilinestring':
|
|
6539
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6540
|
+
coordinates.map((multiPoint, index) => {
|
|
6541
|
+
multiPoint.map((point, index) => {
|
|
6542
|
+
this.calculateRectBox(point, 'multilinestring', index === 0 ? true : false);
|
|
6543
|
+
});
|
|
6544
|
+
});
|
|
6545
|
+
break;
|
|
6370
6546
|
case 'linestring':
|
|
6371
6547
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6372
6548
|
coordinates.map((point, index) => {
|
|
6373
|
-
this.calculateRectBox(point, '
|
|
6549
|
+
this.calculateRectBox(point, 'linestring', index === 0 ? true : false);
|
|
6374
6550
|
});
|
|
6375
6551
|
break;
|
|
6376
6552
|
case 'point':
|
|
6377
6553
|
this.calculateRectBox(coordinates, 'point');
|
|
6378
6554
|
break;
|
|
6555
|
+
case 'multipoint':
|
|
6556
|
+
coordinates.map((point, index) => {
|
|
6557
|
+
this.calculateRectBox(point, 'multipoint', index === 0 ? true : false);
|
|
6558
|
+
});
|
|
6559
|
+
break;
|
|
6379
6560
|
}
|
|
6380
6561
|
}
|
|
6381
6562
|
});
|
|
@@ -6412,7 +6593,7 @@ class LayerPanel {
|
|
|
6412
6593
|
}
|
|
6413
6594
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6414
6595
|
calculateRectBox(coordinates, type, isFirstItem) {
|
|
6415
|
-
if (type !== '
|
|
6596
|
+
if ((type !== 'linestring' && type !== 'multilinestring') && (type !== 'point' && type !== 'multipoint')) {
|
|
6416
6597
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6417
6598
|
Array.prototype.forEach.call(coordinates, (currentCoords) => {
|
|
6418
6599
|
if (isNullOrUndefined(this.mapObject.baseMapBounds)) {
|
|
@@ -6481,7 +6662,7 @@ class LayerPanel {
|
|
|
6481
6662
|
const tile = new Tile(tileI % ycount, j);
|
|
6482
6663
|
tile.left = x;
|
|
6483
6664
|
tile.top = y;
|
|
6484
|
-
if (baseLayer.layerType === 'Bing') {
|
|
6665
|
+
if (baseLayer.layerType === 'Bing' || (bing && !isNullOrUndefined(baseLayer.urlTemplate) && baseLayer.urlTemplate !== '')) {
|
|
6485
6666
|
const key = baseLayer.key;
|
|
6486
6667
|
tile.src = bing.getBingMap(tile, key, baseLayer.bingMapType, userLang, bing.imageUrl, bing.subDomains);
|
|
6487
6668
|
}
|
|
@@ -6509,10 +6690,12 @@ class LayerPanel {
|
|
|
6509
6690
|
if (!(layer.type === 'SubLayer' && layer.visible)) {
|
|
6510
6691
|
continue;
|
|
6511
6692
|
}
|
|
6512
|
-
if (layer.layerType
|
|
6693
|
+
if ((layer.layerType !== 'Geometry' && layer.layerType !== 'GoogleStaticMap') || (layer.layerType === 'Geometry' &&
|
|
6694
|
+
isNullOrUndefined(layer.shapeData) && !isNullOrUndefined(layer.urlTemplate) && layer.urlTemplate !== '')) {
|
|
6513
6695
|
for (const baseTile of proxTiles) {
|
|
6514
6696
|
const subtile = extend({}, baseTile, {}, true);
|
|
6515
6697
|
if (layer.layerType === 'Bing') {
|
|
6698
|
+
bing = new BingMap(this.mapObject);
|
|
6516
6699
|
subtile.src = bing.getBingMap(subtile, layer.key, layer.bingMapType, userLang, bing.imageUrl, bing.subDomains);
|
|
6517
6700
|
}
|
|
6518
6701
|
else {
|
|
@@ -6557,7 +6740,7 @@ class LayerPanel {
|
|
|
6557
6740
|
else {
|
|
6558
6741
|
if (type !== 'Pan' && element1 && element) {
|
|
6559
6742
|
element1.appendChild(element.children[0]);
|
|
6560
|
-
if (!isNullOrUndefined(document.getElementById(this.mapObject.element.id + '_animated_tiles'))) {
|
|
6743
|
+
if (!this.mapObject.isAddLayer && !isNullOrUndefined(document.getElementById(this.mapObject.element.id + '_animated_tiles'))) {
|
|
6561
6744
|
document.getElementById(this.mapObject.element.id + '_animated_tiles').id =
|
|
6562
6745
|
this.mapObject.element.id + '_animated_tiles_old';
|
|
6563
6746
|
}
|
|
@@ -6571,7 +6754,10 @@ class LayerPanel {
|
|
|
6571
6754
|
let id = 0;
|
|
6572
6755
|
for (const tile of this.tiles) {
|
|
6573
6756
|
const imgElement = createElement('img');
|
|
6757
|
+
imgElement.setAttribute('height', '256px');
|
|
6758
|
+
imgElement.setAttribute('width', '256px');
|
|
6574
6759
|
imgElement.setAttribute('src', tile.src);
|
|
6760
|
+
imgElement.setAttribute('alt', this.mapObject.getLocalizedLabel('ImageNotFound'));
|
|
6575
6761
|
const mapId = this.mapObject.element.id;
|
|
6576
6762
|
imgElement.onload = () => {
|
|
6577
6763
|
if (document.getElementById(mapId + '_tile_' + id) && type === 'Pan') {
|
|
@@ -6679,7 +6865,7 @@ class LayerPanel {
|
|
|
6679
6865
|
'&zoom=' + zoom + '¢er=' + center + '&maptype=' + mapType + '&key=' + apikey;
|
|
6680
6866
|
document.getElementById(this.mapObject.element.id + '_tile_parent').innerHTML
|
|
6681
6867
|
= '<div id="' + this.mapObject.element.id + '_StaticGoogleMap"' + 'style="position:absolute; left:' + eleWidth + 'px; top:'
|
|
6682
|
-
+ eleHeight + 'px"><img src="' + staticMapString + '"></div>';
|
|
6868
|
+
+ eleHeight + 'px"><img src="' + staticMapString + '"' + 'alt="' + this.mapObject.getLocalizedLabel('ImageNotFound') + '"></div>';
|
|
6683
6869
|
}
|
|
6684
6870
|
/**
|
|
6685
6871
|
* To find the tile translate point
|
|
@@ -6737,6 +6923,27 @@ class LayerPanel {
|
|
|
6737
6923
|
this.mapObject.previousTileHeight = factorY;
|
|
6738
6924
|
return new Point(x, y);
|
|
6739
6925
|
}
|
|
6926
|
+
/**
|
|
6927
|
+
* @returns {void}
|
|
6928
|
+
* @private
|
|
6929
|
+
*/
|
|
6930
|
+
destroy() {
|
|
6931
|
+
this.mapObject = null;
|
|
6932
|
+
this.groupElements = [];
|
|
6933
|
+
this.layerObject = null;
|
|
6934
|
+
this.currentLayer = null;
|
|
6935
|
+
this.rectBounds = null;
|
|
6936
|
+
this.tiles = [];
|
|
6937
|
+
this.clipRectElement = null;
|
|
6938
|
+
this.tileSvgObject = null;
|
|
6939
|
+
this.ajaxModule = null;
|
|
6940
|
+
this.ajaxResponse = [];
|
|
6941
|
+
this.layerGroup = null;
|
|
6942
|
+
if (!isNullOrUndefined(this.bing)) {
|
|
6943
|
+
this.bing.destroy();
|
|
6944
|
+
}
|
|
6945
|
+
this.bing = null;
|
|
6946
|
+
}
|
|
6740
6947
|
}
|
|
6741
6948
|
|
|
6742
6949
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
@@ -6789,7 +6996,7 @@ class Annotations {
|
|
|
6789
6996
|
if (argsData.cancel) {
|
|
6790
6997
|
return;
|
|
6791
6998
|
}
|
|
6792
|
-
templateFn = getTemplateFunction(argsData.content);
|
|
6999
|
+
templateFn = getTemplateFunction(argsData.content, this.map);
|
|
6793
7000
|
if (templateFn && templateFn(this.map, this.map, argsData.content, this.map.element.id + '_ContentTemplate_' + annotationIndex).length) {
|
|
6794
7001
|
templateElement = Array.prototype.slice.call(templateFn(this.map, this.map, argsData.content, this.map.element.id + '_ContentTemplate_' + annotationIndex));
|
|
6795
7002
|
const length = templateElement.length;
|
|
@@ -6849,21 +7056,20 @@ class Annotations {
|
|
|
6849
7056
|
/**
|
|
6850
7057
|
* To destroy the annotation.
|
|
6851
7058
|
*
|
|
6852
|
-
* @param {Maps} map - Specifies the instance of the maps
|
|
6853
7059
|
* @returns {void}
|
|
6854
7060
|
* @private
|
|
6855
7061
|
*/
|
|
6856
|
-
destroy(
|
|
6857
|
-
|
|
7062
|
+
destroy() {
|
|
7063
|
+
this.map = null;
|
|
6858
7064
|
}
|
|
6859
7065
|
}
|
|
6860
7066
|
|
|
6861
|
-
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
6862
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
6863
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
6864
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6865
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6866
|
-
};
|
|
7067
|
+
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
7068
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
7069
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
7070
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
7071
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7072
|
+
};
|
|
6867
7073
|
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
|
6868
7074
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
6869
7075
|
/* eslint-disable radix */
|
|
@@ -6901,6 +7107,10 @@ let Maps = class Maps extends Component {
|
|
|
6901
7107
|
* Resize the map
|
|
6902
7108
|
*/
|
|
6903
7109
|
this.isResize = false;
|
|
7110
|
+
/**
|
|
7111
|
+
* @private
|
|
7112
|
+
*/
|
|
7113
|
+
this.isReset = false;
|
|
6904
7114
|
/** @private */
|
|
6905
7115
|
this.baseSize = new Size(0, 0);
|
|
6906
7116
|
/** @public */
|
|
@@ -7052,6 +7262,7 @@ let Maps = class Maps extends Component {
|
|
|
7052
7262
|
this.renderArea();
|
|
7053
7263
|
this.processRequestJsonData();
|
|
7054
7264
|
this.renderComplete();
|
|
7265
|
+
this.isAddLayer = !this.isTileMap ? false : this.isAddLayer;
|
|
7055
7266
|
}
|
|
7056
7267
|
/**
|
|
7057
7268
|
* To Initialize the control rendering.
|
|
@@ -7184,16 +7395,7 @@ let Maps = class Maps extends Component {
|
|
|
7184
7395
|
}
|
|
7185
7396
|
renderMap() {
|
|
7186
7397
|
if (this.legendModule && this.legendSettings.visible) {
|
|
7187
|
-
|
|
7188
|
-
this.legendModule.renderLegend();
|
|
7189
|
-
}
|
|
7190
|
-
else {
|
|
7191
|
-
const layerCount = this.layersCollection.length - 1;
|
|
7192
|
-
if (!this.layersCollection[layerCount].isBaseLayer) {
|
|
7193
|
-
this.isTileMapSubLayer = true;
|
|
7194
|
-
this.legendModule.renderLegend();
|
|
7195
|
-
}
|
|
7196
|
-
}
|
|
7398
|
+
this.legendModule.renderLegend();
|
|
7197
7399
|
}
|
|
7198
7400
|
this.createTile();
|
|
7199
7401
|
if (this.zoomSettings.enable && this.zoomModule) {
|
|
@@ -7204,7 +7406,9 @@ let Maps = class Maps extends Component {
|
|
|
7204
7406
|
this.dataLabelShape = [];
|
|
7205
7407
|
}
|
|
7206
7408
|
this.mapLayerPanel.measureLayerPanel();
|
|
7207
|
-
|
|
7409
|
+
if (!isNullOrUndefined(this.svgObject)) {
|
|
7410
|
+
this.element.appendChild(this.svgObject);
|
|
7411
|
+
}
|
|
7208
7412
|
const position = this.getExtraPosition();
|
|
7209
7413
|
for (let i = 0; i < this.layers.length; i++) {
|
|
7210
7414
|
if (position.x !== 0 || position.y !== 0) {
|
|
@@ -7276,12 +7480,16 @@ let Maps = class Maps extends Component {
|
|
|
7276
7480
|
bottom = svg.bottom - tile.bottom - element.offsetTop;
|
|
7277
7481
|
top = parseFloat(tileElement.style.top) + element.offsetTop;
|
|
7278
7482
|
}
|
|
7279
|
-
top = (bottom <= 11) ? top : (top * 2);
|
|
7280
|
-
left = (bottom <= 11) ? left : (left * 2);
|
|
7483
|
+
top = (bottom <= 11) ? top : (!isNullOrUndefined(this.legendModule) && this.legendSettings.position === 'Bottom') ? this.mapAreaRect.y : (top * 2);
|
|
7484
|
+
left = (bottom <= 11) ? left : !isNullOrUndefined(this.legendModule) ? left : (left * 2);
|
|
7281
7485
|
tileElement.style.top = top + 'px';
|
|
7282
7486
|
tileElement.style.left = left + 'px';
|
|
7283
7487
|
tileElement1.style.top = top + 'px';
|
|
7284
7488
|
tileElement1.style.left = left + 'px';
|
|
7489
|
+
if (!isNullOrUndefined(this.legendModule) && this.legendModule.totalPages.length > 0) {
|
|
7490
|
+
tileElement.style.height = tileElement1.style.height = this.legendModule.legendTotalRect.height + 'px';
|
|
7491
|
+
tileElement.style.width = tileElement1.style.width = this.legendModule.legendTotalRect.width + 'px';
|
|
7492
|
+
}
|
|
7285
7493
|
}
|
|
7286
7494
|
this.arrangeTemplate();
|
|
7287
7495
|
if (this.annotationsModule) {
|
|
@@ -7389,6 +7597,7 @@ let Maps = class Maps extends Component {
|
|
|
7389
7597
|
*/
|
|
7390
7598
|
addTabIndex() {
|
|
7391
7599
|
this.element.setAttribute('aria-label', this.description || 'Maps Element');
|
|
7600
|
+
this.element.setAttribute('role', '');
|
|
7392
7601
|
this.element.setAttribute('tabindex', this.tabIndex.toString());
|
|
7393
7602
|
}
|
|
7394
7603
|
// private setSecondaryElementPosition(): void {
|
|
@@ -7407,12 +7616,21 @@ let Maps = class Maps extends Component {
|
|
|
7407
7616
|
this.zoomModule.layerCollectionEle = getElementByID(this.element.id + '_Layer_Collections');
|
|
7408
7617
|
}
|
|
7409
7618
|
if (this.isTileMap && getElementByID(this.element.id + '_Tile_SVG') && getElementByID(this.element.id + '_tile_parent')) {
|
|
7410
|
-
|
|
7411
|
-
|
|
7619
|
+
let tileElement = getElementByID(this.element.id + '_tile_parent');
|
|
7620
|
+
let tileSvgElement = getElementByID(this.element.id + '_Tile_SVG');
|
|
7621
|
+
const tileSvgParentElement = getElementByID(this.element.id + '_Tile_SVG_Parent');
|
|
7622
|
+
const tileRect = tileElement.getBoundingClientRect();
|
|
7623
|
+
const tileSvgRect = tileSvgElement.getBoundingClientRect();
|
|
7412
7624
|
left = (tileRect.left - tileSvgRect.left);
|
|
7413
7625
|
top = (tileRect.top - tileSvgRect.top);
|
|
7414
|
-
|
|
7415
|
-
|
|
7626
|
+
tileSvgParentElement.style.left = left + 'px';
|
|
7627
|
+
tileSvgParentElement.style.top = top + 'px';
|
|
7628
|
+
if (!isNullOrUndefined(this.legendModule) && this.legendModule.totalPages.length > 0) {
|
|
7629
|
+
tileElement.style.width = tileSvgElement.style.width = this.legendModule.legendTotalRect.width.toString();
|
|
7630
|
+
tileElement.style.height = tileSvgElement.style.height = this.legendModule.legendTotalRect.height.toString();
|
|
7631
|
+
tileSvgParentElement.style.width = this.legendModule.legendTotalRect.width + 'px';
|
|
7632
|
+
tileSvgParentElement.style.height = this.legendModule.legendTotalRect.height + 'px';
|
|
7633
|
+
}
|
|
7416
7634
|
const markerTemplateElements = document.getElementsByClassName('template');
|
|
7417
7635
|
if (!isNullOrUndefined(markerTemplateElements) && markerTemplateElements.length > 0) {
|
|
7418
7636
|
for (let i = 0; i < markerTemplateElements.length; i++) {
|
|
@@ -7430,7 +7648,7 @@ let Maps = class Maps extends Component {
|
|
|
7430
7648
|
if (!isNullOrUndefined(elements) && elements.childElementCount > 0) {
|
|
7431
7649
|
for (let i = 0; i < elements.childNodes.length; i++) {
|
|
7432
7650
|
const childElement = elements.childNodes[i];
|
|
7433
|
-
if (childElement.tagName === 'g') {
|
|
7651
|
+
if (childElement.tagName === 'g' && childElement.id.indexOf('_Legend_Group') == -1) {
|
|
7434
7652
|
const layerIndex = parseFloat(childElement.id.split('_LayerIndex_')[1].split('_')[0]);
|
|
7435
7653
|
for (let j = 0; j < childElement.childNodes.length; j++) {
|
|
7436
7654
|
const childNode = childElement.childNodes[j];
|
|
@@ -7444,7 +7662,7 @@ let Maps = class Maps extends Component {
|
|
|
7444
7662
|
}
|
|
7445
7663
|
}
|
|
7446
7664
|
if (this.zoomModule && (this.previousScale !== this.scale)) {
|
|
7447
|
-
this.zoomModule.applyTransform(true);
|
|
7665
|
+
this.zoomModule.applyTransform(this, true);
|
|
7448
7666
|
}
|
|
7449
7667
|
}
|
|
7450
7668
|
}
|
|
@@ -7467,7 +7685,7 @@ let Maps = class Maps extends Component {
|
|
|
7467
7685
|
}
|
|
7468
7686
|
const templateElements = document.getElementsByClassName(this.element.id + '_template');
|
|
7469
7687
|
if (!isNullOrUndefined(templateElements) && templateElements.length > 0 &&
|
|
7470
|
-
getElementByID(this.element.id + '_Layer_Collections') && this.
|
|
7688
|
+
getElementByID(this.element.id + '_Layer_Collections') && !this.isTileMap) {
|
|
7471
7689
|
for (let i = 0; i < templateElements.length; i++) {
|
|
7472
7690
|
let offSetLetValue = 0;
|
|
7473
7691
|
let offSetTopValue = 0;
|
|
@@ -7502,10 +7720,7 @@ let Maps = class Maps extends Component {
|
|
|
7502
7720
|
const mainLayer = this.layersCollection[0];
|
|
7503
7721
|
const padding = 0;
|
|
7504
7722
|
if (mainLayer.isBaseLayer && (mainLayer.layerType === 'OSM' || mainLayer.layerType === 'Bing' ||
|
|
7505
|
-
mainLayer.layerType === 'GoogleStaticMap' || mainLayer.layerType === 'Google')) {
|
|
7506
|
-
if (mainLayer.layerType === 'Google') {
|
|
7507
|
-
mainLayer.urlTemplate = 'https://mt1.google.com/vt/lyrs=m@129&hl=en&x=tileX&y=tileY&z=level';
|
|
7508
|
-
}
|
|
7723
|
+
mainLayer.layerType === 'GoogleStaticMap' || mainLayer.layerType === 'Google' || (!isNullOrUndefined(mainLayer.urlTemplate) && mainLayer.urlTemplate !== ''))) {
|
|
7509
7724
|
removeElement(this.element.id + '_tile_parent');
|
|
7510
7725
|
removeElement(this.element.id + '_tiles');
|
|
7511
7726
|
removeElement('animated_tiles');
|
|
@@ -7552,7 +7767,7 @@ let Maps = class Maps extends Component {
|
|
|
7552
7767
|
const baseLayer = mainLayers[i];
|
|
7553
7768
|
if (baseLayer.visible && baseIndex === i) {
|
|
7554
7769
|
baseLayer.isBaseLayer = true;
|
|
7555
|
-
this.isTileMap = (baseLayer.layerType === 'Geometry') ? false : true;
|
|
7770
|
+
this.isTileMap = (baseLayer.layerType === 'Geometry' && !isNullOrUndefined(baseLayer.shapeData)) ? false : true;
|
|
7556
7771
|
this.layersCollection.push(baseLayer);
|
|
7557
7772
|
break;
|
|
7558
7773
|
}
|
|
@@ -7599,12 +7814,19 @@ let Maps = class Maps extends Component {
|
|
|
7599
7814
|
* @private
|
|
7600
7815
|
*/
|
|
7601
7816
|
renderTitle(title, type, bounds, groupEle) {
|
|
7602
|
-
const style =
|
|
7817
|
+
const style = {
|
|
7818
|
+
size: title.textStyle.size,
|
|
7819
|
+
color: title.textStyle.color,
|
|
7820
|
+
fontFamily: title.textStyle.fontFamily,
|
|
7821
|
+
fontWeight: title.textStyle.fontWeight,
|
|
7822
|
+
fontStyle: title.textStyle.fontStyle,
|
|
7823
|
+
opacity: title.textStyle.opacity
|
|
7824
|
+
};
|
|
7603
7825
|
let height;
|
|
7604
7826
|
const width = Math.abs((this.margin.left + this.margin.right) - this.availableSize.width);
|
|
7605
|
-
style.fontFamily =
|
|
7827
|
+
style.fontFamily = !isNullOrUndefined(style.fontFamily) ? style.fontFamily : this.themeStyle.fontFamily;
|
|
7606
7828
|
style.fontWeight = style.fontWeight || this.themeStyle.titleFontWeight;
|
|
7607
|
-
style.size = this.themeStyle.titleFontSize
|
|
7829
|
+
style.size = type === 'title' ? (style.size || this.themeStyle.titleFontSize) : (style.size || Theme.mapsSubTitleFont.size);
|
|
7608
7830
|
if (title.text) {
|
|
7609
7831
|
if (isNullOrUndefined(groupEle)) {
|
|
7610
7832
|
groupEle = this.renderer.createGroup({ id: this.element.id + '_Title_Group' });
|
|
@@ -7617,6 +7839,7 @@ let Maps = class Maps extends Component {
|
|
|
7617
7839
|
const titleBounds = new Rect(location.x, location.y, elementSize.width, elementSize.height);
|
|
7618
7840
|
const element = renderTextElement(options, style, style.color || (type === 'title' ? this.themeStyle.titleFontColor : this.themeStyle.subTitleFontColor), groupEle);
|
|
7619
7841
|
element.setAttribute('aria-label', this.description || title.text);
|
|
7842
|
+
element.setAttribute('role', '');
|
|
7620
7843
|
if ((type === 'title' && !title.subtitleSettings.text) || (type === 'subtitle')) {
|
|
7621
7844
|
height = Math.abs((titleBounds.y + this.margin.bottom) - this.availableSize.height);
|
|
7622
7845
|
this.mapAreaRect = new Rect(this.margin.left, titleBounds.y + 10, width, height - 10);
|
|
@@ -7774,6 +7997,7 @@ let Maps = class Maps extends Component {
|
|
|
7774
7997
|
const id = event.target['id'];
|
|
7775
7998
|
event.preventDefault();
|
|
7776
7999
|
if (this.legendModule && (id.indexOf('_Left_Page_Rect') > -1 || id.indexOf('_Right_Page_Rect') > -1)) {
|
|
8000
|
+
this.mapAreaRect = this.legendModule.initialMapAreaRect;
|
|
7777
8001
|
this.legendModule.currentPage = (id.indexOf('_Left_Page_') > -1) ? (this.legendModule.currentPage - 1) :
|
|
7778
8002
|
(this.legendModule.currentPage + 1);
|
|
7779
8003
|
this.legendModule.legendGroup = this.renderer.createGroup({ id: this.element.id + '_Legend_Group' });
|
|
@@ -7837,24 +8061,35 @@ let Maps = class Maps extends Component {
|
|
|
7837
8061
|
latitude: latitude, longitude: longitude,
|
|
7838
8062
|
isShapeSelected: this.SelectedElement(targetEle)
|
|
7839
8063
|
};
|
|
7840
|
-
this.
|
|
7841
|
-
|
|
7842
|
-
|
|
7843
|
-
|
|
7844
|
-
|
|
7845
|
-
|
|
7846
|
-
|
|
7847
|
-
|
|
7848
|
-
|
|
7849
|
-
|
|
7850
|
-
|
|
7851
|
-
|
|
7852
|
-
|
|
7853
|
-
|
|
7854
|
-
|
|
7855
|
-
|
|
7856
|
-
|
|
7857
|
-
|
|
8064
|
+
if (this.onclick) {
|
|
8065
|
+
eventArgs.name = onclick;
|
|
8066
|
+
this.trigger('onclick', eventArgs, (mouseArgs) => {
|
|
8067
|
+
this.clickHandler(e, eventArgs, targetEle);
|
|
8068
|
+
});
|
|
8069
|
+
}
|
|
8070
|
+
else {
|
|
8071
|
+
this.trigger('click', eventArgs, (mouseArgs) => {
|
|
8072
|
+
this.clickHandler(e, eventArgs, targetEle);
|
|
8073
|
+
});
|
|
8074
|
+
}
|
|
8075
|
+
}
|
|
8076
|
+
}
|
|
8077
|
+
clickHandler(e, eventArgs, targetEle) {
|
|
8078
|
+
if (targetEle.id.indexOf('shapeIndex') > -1) {
|
|
8079
|
+
this.mergeCluster();
|
|
8080
|
+
if (getElement(this.element.id + '_mapsTooltip') &&
|
|
8081
|
+
this.mapsTooltipModule.tooltipTargetID.indexOf('_MarkerIndex_') > -1) {
|
|
8082
|
+
removeElement(this.element.id + '_mapsTooltip');
|
|
8083
|
+
}
|
|
8084
|
+
}
|
|
8085
|
+
if (this.markerModule) {
|
|
8086
|
+
this.markerModule.markerClusterClick(e);
|
|
8087
|
+
}
|
|
8088
|
+
if (!eventArgs.cancel) {
|
|
8089
|
+
this.notify(click, targetEle);
|
|
8090
|
+
}
|
|
8091
|
+
if (!eventArgs.cancel && targetEle.id.indexOf('shapeIndex') !== -1) {
|
|
8092
|
+
this.triggerShapeSelection(targetEle);
|
|
7858
8093
|
}
|
|
7859
8094
|
}
|
|
7860
8095
|
triggerShapeSelection(targetEle) {
|
|
@@ -7954,13 +8189,6 @@ let Maps = class Maps extends Component {
|
|
|
7954
8189
|
latitude = latLongValue.latitude;
|
|
7955
8190
|
longitude = latLongValue.longitude;
|
|
7956
8191
|
}
|
|
7957
|
-
const eventArgs = {
|
|
7958
|
-
cancel: false, name: click, target: targetId, x: e.clientX, y: e.clientY,
|
|
7959
|
-
latitude: latitude, longitude: longitude, isShapeSelected: this.SelectedElement(targetEle)
|
|
7960
|
-
};
|
|
7961
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
7962
|
-
this.trigger('click', eventArgs, (mouseArgs) => {
|
|
7963
|
-
});
|
|
7964
8192
|
}
|
|
7965
8193
|
this.titleTooltip(e, pageX, pageY, true);
|
|
7966
8194
|
if (!isNullOrUndefined(this.legendModule)) {
|
|
@@ -7968,7 +8196,7 @@ let Maps = class Maps extends Component {
|
|
|
7968
8196
|
}
|
|
7969
8197
|
}
|
|
7970
8198
|
this.notify(Browser.touchEndEvent, e);
|
|
7971
|
-
if (e.cancelable) {
|
|
8199
|
+
if (e.cancelable && !this.isTouch) {
|
|
7972
8200
|
e.preventDefault();
|
|
7973
8201
|
}
|
|
7974
8202
|
return false;
|
|
@@ -8122,14 +8350,14 @@ let Maps = class Maps extends Component {
|
|
|
8122
8350
|
removeElement(this.element.id + '_EJ2_LegendTitle_Tooltip');
|
|
8123
8351
|
}
|
|
8124
8352
|
if ((targetId === (this.element.id + '_Map_title')) && (event.target.textContent.indexOf('...') > -1)) {
|
|
8125
|
-
showTooltip(this.titleSettings.text, this.titleSettings.textStyle.size, x, y, this.element.offsetWidth, this.element.offsetHeight, this.element.id + '_EJ2_Title_Tooltip', getElement(this.element.id + '_Secondary_Element'), isTouch);
|
|
8353
|
+
showTooltip(this.titleSettings.text, this.titleSettings.textStyle.size || this.themeStyle.titleFontSize, x, y, this.element.offsetWidth, this.element.offsetHeight, this.element.id + '_EJ2_Title_Tooltip', getElement(this.element.id + '_Secondary_Element'), isTouch);
|
|
8126
8354
|
}
|
|
8127
8355
|
else {
|
|
8128
8356
|
removeElement(this.element.id + '_EJ2_Title_Tooltip');
|
|
8129
8357
|
}
|
|
8130
8358
|
}
|
|
8131
8359
|
/*
|
|
8132
|
-
|
|
8360
|
+
|
|
8133
8361
|
/**
|
|
8134
8362
|
* This method is used to perform operations while resizing the window.
|
|
8135
8363
|
*
|
|
@@ -8156,6 +8384,7 @@ let Maps = class Maps extends Component {
|
|
|
8156
8384
|
this.refreshing = true;
|
|
8157
8385
|
this.wireEVents();
|
|
8158
8386
|
this.render();
|
|
8387
|
+
this.refreshing = false;
|
|
8159
8388
|
}, 500);
|
|
8160
8389
|
}
|
|
8161
8390
|
}
|
|
@@ -8186,7 +8415,7 @@ let Maps = class Maps extends Component {
|
|
|
8186
8415
|
this.scale = zoomFactor;
|
|
8187
8416
|
this.translatePoint.x = ((mapRect.left < svgRect.left ? x : 0) + (size.width / 2) - (position.x * zoomFactor)) / zoomFactor;
|
|
8188
8417
|
this.translatePoint.y = ((mapRect.top < svgRect.top ? y : 0) + (size.height / 2) - (position.y * zoomFactor)) / zoomFactor;
|
|
8189
|
-
this.zoomModule.applyTransform();
|
|
8418
|
+
this.zoomModule.applyTransform(this);
|
|
8190
8419
|
}
|
|
8191
8420
|
else {
|
|
8192
8421
|
position = { x: size.width / 2, y: size.height / 2 };
|
|
@@ -8232,8 +8461,10 @@ let Maps = class Maps extends Component {
|
|
|
8232
8461
|
* @param {Object} layer - Specifies the layer for the maps.
|
|
8233
8462
|
*/
|
|
8234
8463
|
addLayer(layer) {
|
|
8235
|
-
|
|
8236
|
-
|
|
8464
|
+
let mapsLayer = this.layers;
|
|
8465
|
+
mapsLayer.push(layer);
|
|
8466
|
+
this.isAddLayer = true;
|
|
8467
|
+
this.layers = mapsLayer;
|
|
8237
8468
|
}
|
|
8238
8469
|
/**
|
|
8239
8470
|
* This method is used to remove a layer from map.
|
|
@@ -8242,8 +8473,9 @@ let Maps = class Maps extends Component {
|
|
|
8242
8473
|
* @returns {void}
|
|
8243
8474
|
*/
|
|
8244
8475
|
removeLayer(index) {
|
|
8245
|
-
this.layers
|
|
8246
|
-
|
|
8476
|
+
let mapsLayer = this.layers;
|
|
8477
|
+
mapsLayer.splice(index, 1);
|
|
8478
|
+
this.layers = mapsLayer;
|
|
8247
8479
|
}
|
|
8248
8480
|
/**
|
|
8249
8481
|
* This method is used to add markers dynamically in the maps.
|
|
@@ -8261,7 +8493,7 @@ let Maps = class Maps extends Component {
|
|
|
8261
8493
|
this.layersCollection[layerIndex].markerSettings.push(new MarkerSettings(this, 'markerSettings', newMarker));
|
|
8262
8494
|
}
|
|
8263
8495
|
const markerModule = new Marker(this);
|
|
8264
|
-
markerModule.markerRender(layerEle, layerIndex, this.mapLayerPanel['currentFactor'], 'AddMarker');
|
|
8496
|
+
markerModule.markerRender(this, layerEle, layerIndex, this.mapLayerPanel['currentFactor'], 'AddMarker');
|
|
8265
8497
|
this.arrangeTemplate();
|
|
8266
8498
|
}
|
|
8267
8499
|
}
|
|
@@ -8467,7 +8699,8 @@ let Maps = class Maps extends Component {
|
|
|
8467
8699
|
Zoom: 'Zoom',
|
|
8468
8700
|
ZoomOut: 'Zoom out',
|
|
8469
8701
|
Pan: 'Pan',
|
|
8470
|
-
Reset: 'Reset'
|
|
8702
|
+
Reset: 'Reset',
|
|
8703
|
+
ImageNotFound: 'Image Not Found'
|
|
8471
8704
|
};
|
|
8472
8705
|
}
|
|
8473
8706
|
/**
|
|
@@ -8475,6 +8708,7 @@ let Maps = class Maps extends Component {
|
|
|
8475
8708
|
*/
|
|
8476
8709
|
destroy() {
|
|
8477
8710
|
this.unWireEVents();
|
|
8711
|
+
super.destroy();
|
|
8478
8712
|
this.shapeSelectionItem = [];
|
|
8479
8713
|
this.toggledShapeElementId = [];
|
|
8480
8714
|
this.toggledLegendId = [];
|
|
@@ -8489,11 +8723,14 @@ let Maps = class Maps extends Component {
|
|
|
8489
8723
|
this.zoomLabelPositions = [];
|
|
8490
8724
|
this.mouseDownEvent = { x: null, y: null };
|
|
8491
8725
|
this.mouseClickEvent = { x: null, y: null };
|
|
8726
|
+
this.formatFunction = null;
|
|
8727
|
+
//TODO: Calling the below code throws spec issue.
|
|
8728
|
+
//this.renderer = null;
|
|
8729
|
+
this.availableSize = new Size(0, 0);
|
|
8492
8730
|
if (document.getElementById('mapsmeasuretext')) {
|
|
8493
8731
|
document.getElementById('mapsmeasuretext').remove();
|
|
8494
8732
|
}
|
|
8495
8733
|
this.removeSvg();
|
|
8496
|
-
super.destroy();
|
|
8497
8734
|
}
|
|
8498
8735
|
/**
|
|
8499
8736
|
* Gets component name
|
|
@@ -8526,6 +8763,7 @@ let Maps = class Maps extends Component {
|
|
|
8526
8763
|
onPropertyChanged(newProp, oldProp) {
|
|
8527
8764
|
let render = false;
|
|
8528
8765
|
let isMarker = false;
|
|
8766
|
+
let isLayer = false;
|
|
8529
8767
|
let isStaticMapType = false;
|
|
8530
8768
|
let layerEle;
|
|
8531
8769
|
if (newProp['layers']) {
|
|
@@ -8545,12 +8783,17 @@ let Maps = class Maps extends Component {
|
|
|
8545
8783
|
case 'legendSettings':
|
|
8546
8784
|
case 'baseLayerIndex':
|
|
8547
8785
|
if (prop === 'layers') {
|
|
8786
|
+
isLayer = true;
|
|
8548
8787
|
const layerPropLength = Object.keys(newProp.layers).length;
|
|
8549
8788
|
for (let x = 0; x < layerPropLength; x++) {
|
|
8550
8789
|
if (!isNullOrUndefined(newProp.layers[x])) {
|
|
8551
8790
|
const collection = Object.keys(newProp.layers[x]);
|
|
8552
8791
|
for (const collectionProp of collection) {
|
|
8553
|
-
if (collectionProp === '
|
|
8792
|
+
if ((collectionProp === 'layerType' && newProp.layers[x].layerType !== 'Geometry') || (isNullOrUndefined(this.layers[x].shapeData)
|
|
8793
|
+
&& !isNullOrUndefined(this.layers[x].urlTemplate) && this.layers[x].urlTemplate !== '')) {
|
|
8794
|
+
this.isReset = true;
|
|
8795
|
+
}
|
|
8796
|
+
else if (collectionProp === 'markerSettings') {
|
|
8554
8797
|
isMarker = true;
|
|
8555
8798
|
}
|
|
8556
8799
|
else if (collectionProp === 'staticMapType') {
|
|
@@ -8564,7 +8807,7 @@ let Maps = class Maps extends Component {
|
|
|
8564
8807
|
break;
|
|
8565
8808
|
case 'zoomSettings':
|
|
8566
8809
|
if (!isNullOrUndefined(oldProp.zoomSettings)) {
|
|
8567
|
-
if (newProp.zoomSettings.zoomFactor !== oldProp.zoomSettings.zoomFactor) {
|
|
8810
|
+
if (newProp.zoomSettings.zoomFactor !== oldProp.zoomSettings.zoomFactor && !isLayer) {
|
|
8568
8811
|
render = false;
|
|
8569
8812
|
}
|
|
8570
8813
|
else if (newProp.zoomSettings.shouldZoomInitially !== oldProp.zoomSettings.shouldZoomInitially) {
|
|
@@ -8799,7 +9042,7 @@ let Maps = class Maps extends Component {
|
|
|
8799
9042
|
*/
|
|
8800
9043
|
print(id) {
|
|
8801
9044
|
if ((this.allowPrint) && (this.printModule)) {
|
|
8802
|
-
this.printModule.print(id);
|
|
9045
|
+
this.printModule.print(this, id);
|
|
8803
9046
|
}
|
|
8804
9047
|
}
|
|
8805
9048
|
/**
|
|
@@ -8817,16 +9060,38 @@ let Maps = class Maps extends Component {
|
|
|
8817
9060
|
}
|
|
8818
9061
|
if ((type !== 'PDF') && (this.allowImageExport) && (this.imageExportModule)) {
|
|
8819
9062
|
return new Promise((resolve, reject) => {
|
|
8820
|
-
resolve(this.imageExportModule.export(type, fileName, allowDownload));
|
|
9063
|
+
resolve(this.imageExportModule.export(this, type, fileName, allowDownload));
|
|
8821
9064
|
});
|
|
8822
9065
|
}
|
|
8823
9066
|
else if ((this.allowPdfExport) && (this.pdfExportModule)) {
|
|
8824
9067
|
return new Promise((resolve, reject) => {
|
|
8825
|
-
resolve(this.pdfExportModule.export(type, fileName, allowDownload, orientation));
|
|
9068
|
+
resolve(this.pdfExportModule.export(this, type, fileName, allowDownload, orientation));
|
|
8826
9069
|
});
|
|
8827
9070
|
}
|
|
8828
9071
|
return null;
|
|
8829
9072
|
}
|
|
9073
|
+
/**
|
|
9074
|
+
* This method is used to get the Bing maps URL.
|
|
9075
|
+
*
|
|
9076
|
+
* @param {string} url - Specifies the URL of the maps.
|
|
9077
|
+
* @returns {Promise<string>} - Returns the processed Bing URL as Promise.
|
|
9078
|
+
*/
|
|
9079
|
+
getBingUrlTemplate(url) {
|
|
9080
|
+
const promise = new Promise((resolve, reject) => {
|
|
9081
|
+
const ajax = new Ajax({
|
|
9082
|
+
url: url
|
|
9083
|
+
});
|
|
9084
|
+
ajax.onSuccess = (json) => {
|
|
9085
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9086
|
+
const jsonObject = JSON.parse(json);
|
|
9087
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9088
|
+
const resource = jsonObject['resourceSets'][0]['resources'][0];
|
|
9089
|
+
resolve(resource['imageUrl']);
|
|
9090
|
+
};
|
|
9091
|
+
ajax.send();
|
|
9092
|
+
});
|
|
9093
|
+
return promise;
|
|
9094
|
+
}
|
|
8830
9095
|
/**
|
|
8831
9096
|
* To find visibility of layers and markers for required modules load.
|
|
8832
9097
|
*
|
|
@@ -9027,6 +9292,9 @@ __decorate([
|
|
|
9027
9292
|
__decorate([
|
|
9028
9293
|
Event()
|
|
9029
9294
|
], Maps.prototype, "click", void 0);
|
|
9295
|
+
__decorate([
|
|
9296
|
+
Event()
|
|
9297
|
+
], Maps.prototype, "onclick", void 0);
|
|
9030
9298
|
__decorate([
|
|
9031
9299
|
Event()
|
|
9032
9300
|
], Maps.prototype, "doubleClick", void 0);
|
|
@@ -9170,12 +9438,8 @@ class Bubble {
|
|
|
9170
9438
|
isNaN(shapeData[layer.shapeDataPath]) ? shapeData[layer.shapeDataPath].toLowerCase() : shapeData[layer.shapeDataPath];
|
|
9171
9439
|
const shapePathValue = !isNullOrUndefined(shape[shapePath]) && isNaN(shape[shapePath])
|
|
9172
9440
|
? shape[shapePath].toLowerCase() : shape[shapePath];
|
|
9173
|
-
if (shapeDataLayerPathValue === shapePathValue && layerData[i].type !== 'LineString') {
|
|
9174
|
-
if (layerData[i]['
|
|
9175
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9176
|
-
shapePoints.push(this.getPoints(layerData[i], []));
|
|
9177
|
-
}
|
|
9178
|
-
else if (!layerData[i]['_isMultiPolygon']) {
|
|
9441
|
+
if (shapeDataLayerPathValue === shapePathValue && (layerData[i].type !== 'LineString' && layerData[i].type !== 'MultiLineString' && layerData[i]['type'] !== 'Point' && layerData[i]['type'] !== 'MultiPoint')) {
|
|
9442
|
+
if (!layerData[i]['_isMultiPolygon']) {
|
|
9179
9443
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9180
9444
|
shapePoints.push(this.getPoints(layerData[i], []));
|
|
9181
9445
|
currentLength = shapePoints[shapePoints.length - 1].length;
|
|
@@ -9259,7 +9523,7 @@ class Bubble {
|
|
|
9259
9523
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9260
9524
|
let translate;
|
|
9261
9525
|
const animate$$1 = layer.animationDuration !== 0 || isNullOrUndefined(this.maps.zoomModule);
|
|
9262
|
-
if (this.maps.zoomSettings.zoomFactor > 1 && !isNullOrUndefined(this.maps.zoomModule)) {
|
|
9526
|
+
if (this.maps.zoomSettings.zoomFactor > 1 && !isNullOrUndefined(this.maps.zoomModule) && !this.maps.isTileMap) {
|
|
9263
9527
|
translate = getZoomTranslate(this.maps, layer, animate$$1);
|
|
9264
9528
|
}
|
|
9265
9529
|
else {
|
|
@@ -9376,14 +9640,13 @@ class Bubble {
|
|
|
9376
9640
|
/**
|
|
9377
9641
|
* To destroy the bubble.
|
|
9378
9642
|
*
|
|
9379
|
-
* @param {Maps} maps - Specifies the instance of the maps.
|
|
9380
9643
|
* @returns {void}
|
|
9381
9644
|
* @private
|
|
9382
9645
|
*/
|
|
9383
|
-
destroy(
|
|
9384
|
-
|
|
9385
|
-
|
|
9386
|
-
|
|
9646
|
+
destroy() {
|
|
9647
|
+
this.bubbleCollection = [];
|
|
9648
|
+
//TODO: Calling the below code throws spec issue.
|
|
9649
|
+
//this.maps = null;
|
|
9387
9650
|
}
|
|
9388
9651
|
}
|
|
9389
9652
|
|
|
@@ -9480,7 +9743,7 @@ class DataLabel {
|
|
|
9480
9743
|
let shapeWidth;
|
|
9481
9744
|
const scaleZoomValue = !isNullOrUndefined(this.maps.scale) ? Math.floor(this.maps.scale) : 1;
|
|
9482
9745
|
const zoomLabelsPosition = this.maps.zoomSettings.enable ? !isNullOrUndefined(this.maps.zoomShapeCollection) &&
|
|
9483
|
-
this.maps.zoomShapeCollection.length > 0 : this.maps.zoomSettings.enable;
|
|
9746
|
+
this.maps.zoomShapeCollection.length > 0 && !this.maps.isAddLayer : this.maps.zoomSettings.enable;
|
|
9484
9747
|
this.maps.translateType = 'labels';
|
|
9485
9748
|
for (let j = 0; j < properties.length; j++) {
|
|
9486
9749
|
if (shapeProperties[properties[j]]) {
|
|
@@ -9498,7 +9761,7 @@ class DataLabel {
|
|
|
9498
9761
|
layer.dataSource, layer.shapeDataPath, shapeData['properties'][propertyPath], layer.shapeDataPath);
|
|
9499
9762
|
if (!isNullOrUndefined(shapes['property'])) {
|
|
9500
9763
|
shapePoint = [[]];
|
|
9501
|
-
if (!layerData[index]['_isMultiPolygon'] && layerData[index]['type'] !== 'Point') {
|
|
9764
|
+
if (!layerData[index]['_isMultiPolygon'] && layerData[index]['type'] !== 'Point' && layerData[index]['type'] !== 'MultiPoint') {
|
|
9502
9765
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9503
9766
|
shapePoint.push(this.getPoint(layerData[index], []));
|
|
9504
9767
|
currentLength = shapePoint[shapePoint.length - 1].length;
|
|
@@ -9507,21 +9770,9 @@ class DataLabel {
|
|
|
9507
9770
|
midIndex = shapePoint.length - 1;
|
|
9508
9771
|
}
|
|
9509
9772
|
}
|
|
9510
|
-
else {
|
|
9773
|
+
else if (layerData[index]['type'] !== 'Point' && layerData[index]['type'] !== 'MultiPoint') {
|
|
9511
9774
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9512
9775
|
const layer = layerData[index];
|
|
9513
|
-
if (layer['type'] === 'Point') {
|
|
9514
|
-
isPoint = true;
|
|
9515
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9516
|
-
const layerPoints = [];
|
|
9517
|
-
layerPoints.push(this.getPoint(layerData, []));
|
|
9518
|
-
shapePoint = layerPoints;
|
|
9519
|
-
currentLength = shapePoint[shapePoint.length - 1].length;
|
|
9520
|
-
if (pointsLength < currentLength) {
|
|
9521
|
-
pointsLength = currentLength;
|
|
9522
|
-
midIndex = shapePoint.length - 1;
|
|
9523
|
-
}
|
|
9524
|
-
}
|
|
9525
9776
|
for (let j = 0; j < layer.length; j++) {
|
|
9526
9777
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9527
9778
|
shapePoint.push(this.getPoint(layer[j], []));
|
|
@@ -9591,7 +9842,7 @@ class DataLabel {
|
|
|
9591
9842
|
const eventargs = {
|
|
9592
9843
|
name: dataLabelRendering, maps: this.maps, cancel: false, border: { color: dataLabel.border.color,
|
|
9593
9844
|
width: dataLabel.border.width, opacity: dataLabel.border.opacity }, datalabel: dataLabel,
|
|
9594
|
-
fill: dataLabel.fill, template: dataLabel.template, text: text
|
|
9845
|
+
fill: dataLabel.fill, template: dataLabel.template, text: text, offsetX: 0, offsetY: 0
|
|
9595
9846
|
};
|
|
9596
9847
|
this.maps.trigger('dataLabelRendering', eventargs, (labelArgs) => {
|
|
9597
9848
|
if (eventargs.cancel) {
|
|
@@ -9636,13 +9887,13 @@ class DataLabel {
|
|
|
9636
9887
|
this.value[index] = { rightWidth: xpositionEnds, leftWidth: xpositionStart, heightTop: start, heightBottom: end };
|
|
9637
9888
|
let labelElement;
|
|
9638
9889
|
if (eventargs.template !== '') {
|
|
9639
|
-
templateFn = getTemplateFunction(eventargs.template);
|
|
9890
|
+
templateFn = getTemplateFunction(eventargs.template, this.maps);
|
|
9640
9891
|
const templateElement = templateFn ? templateFn(!isNullOrUndefined(datasrcObj) ?
|
|
9641
9892
|
datasrcObj : shapeData['properties'], this.maps, eventargs.template, this.maps.element.id + '_LabelTemplate', false) : document.createElement('div');
|
|
9642
9893
|
templateElement.innerHTML = !templateFn ? eventargs.template : '';
|
|
9643
9894
|
labelElement = convertElementFromLabel(templateElement, labelId, !isNullOrUndefined(datasrcObj) ? datasrcObj : shapeData['properties'], index, this.maps);
|
|
9644
|
-
labelElement.style.left = ((Math.abs(this.maps.baseMapRectBounds['min']['x'] - location['x'])) * scale) + 'px';
|
|
9645
|
-
labelElement.style.top = ((Math.abs(this.maps.baseMapRectBounds['min']['y'] - location['y'])) * scale) + 'px';
|
|
9895
|
+
labelElement.style.left = ((Math.abs(this.maps.baseMapRectBounds['min']['x'] - location['x'])) * scale) + labelArgs.offsetX + 'px';
|
|
9896
|
+
labelElement.style.top = ((Math.abs(this.maps.baseMapRectBounds['min']['y'] - location['y'])) * scale) + labelArgs.offsetY + 'px';
|
|
9646
9897
|
labelTemplateElement.appendChild(labelElement);
|
|
9647
9898
|
}
|
|
9648
9899
|
else {
|
|
@@ -9730,26 +9981,26 @@ class DataLabel {
|
|
|
9730
9981
|
y = ((location['y'] + transPoint['y']) * scale) - textSize['height'] / 2;
|
|
9731
9982
|
}
|
|
9732
9983
|
border.opacity = isNullOrUndefined(border.opacity) ? opacity : border.opacity;
|
|
9733
|
-
const rectOptions = new RectOption(this.maps.element.id + '_LayerIndex_' + layerIndex + '_shapeIndex_' + index + '_rectIndex_' + index, fill, border, opacity, new Rect(x, y, textSize['width'], textSize['height']), rx, ry);
|
|
9984
|
+
const rectOptions = new RectOption(this.maps.element.id + '_LayerIndex_' + layerIndex + '_shapeIndex_' + index + '_rectIndex_' + index, fill, border, opacity, new Rect((x + labelArgs.offsetX), (y + labelArgs.offsetY), textSize['width'], textSize['height']), rx, ry);
|
|
9734
9985
|
const rect = this.maps.renderer.drawRectangle(rectOptions);
|
|
9735
9986
|
group.appendChild(rect);
|
|
9736
9987
|
}
|
|
9737
9988
|
}
|
|
9738
9989
|
element = renderTextElement(options, style, style.color || this.maps.themeStyle.dataLabelFontColor, group);
|
|
9739
9990
|
if (zoomLabelsPosition && scaleZoomValue > 1 && !this.maps.zoomNotApplied) {
|
|
9740
|
-
element.setAttribute('transform', 'translate( ' + ((location['x'])) + ' '
|
|
9741
|
-
+ (((location['y']))) + ' )');
|
|
9991
|
+
element.setAttribute('transform', 'translate( ' + ((location['x'] + labelArgs.offsetX)) + ' '
|
|
9992
|
+
+ (((location['y'] + labelArgs.offsetY))) + ' )');
|
|
9742
9993
|
location['x'] = locationX;
|
|
9743
9994
|
location['y'] = locationY;
|
|
9744
9995
|
}
|
|
9745
9996
|
else {
|
|
9746
|
-
element.setAttribute('transform', 'translate( ' + ((location['x'] + transPoint.x) * scale) + ' '
|
|
9747
|
-
+ (((location['y'] + transPoint.y) * scale) + (elementSize.height / 4)) + ' )');
|
|
9997
|
+
element.setAttribute('transform', 'translate( ' + (((location['x'] + transPoint.x) * scale) + labelArgs.offsetX) + ' '
|
|
9998
|
+
+ ((((location['y'] + transPoint.y) * scale) + (elementSize.height / 4)) + labelArgs.offsetY) + ' )');
|
|
9748
9999
|
}
|
|
9749
10000
|
group.appendChild(element);
|
|
9750
10001
|
}
|
|
9751
10002
|
this.dataLabelCollections.push({
|
|
9752
|
-
location: { x: location['x'], y: location['y'] },
|
|
10003
|
+
location: { x: location['x'] + labelArgs.offsetX, y: location['y'] + labelArgs.offsetY },
|
|
9753
10004
|
element: isNullOrUndefined(labelElement) ? element : labelElement,
|
|
9754
10005
|
layerIndex: layerIndex,
|
|
9755
10006
|
shapeIndex: sublayerIndexLabel ? oldIndex : index,
|
|
@@ -9766,10 +10017,21 @@ class DataLabel {
|
|
|
9766
10017
|
}
|
|
9767
10018
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9768
10019
|
getPoint(shapes, points) {
|
|
9769
|
-
|
|
9770
|
-
|
|
9771
|
-
|
|
9772
|
-
|
|
10020
|
+
if (shapes['type'] === 'MultiLineString') {
|
|
10021
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10022
|
+
shapes.map((current) => {
|
|
10023
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10024
|
+
current.map((shape) => {
|
|
10025
|
+
points.push(new Point(shape['point']['x'], shape['point']['y']));
|
|
10026
|
+
});
|
|
10027
|
+
});
|
|
10028
|
+
}
|
|
10029
|
+
else {
|
|
10030
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10031
|
+
shapes.map((current, index) => {
|
|
10032
|
+
points.push(new Point(current['point']['x'], current['point']['y']));
|
|
10033
|
+
});
|
|
10034
|
+
}
|
|
9773
10035
|
return points;
|
|
9774
10036
|
}
|
|
9775
10037
|
/**
|
|
@@ -9781,16 +10043,14 @@ class DataLabel {
|
|
|
9781
10043
|
return 'DataLabel';
|
|
9782
10044
|
}
|
|
9783
10045
|
/**
|
|
9784
|
-
* To destroy the layers.
|
|
9785
10046
|
*
|
|
9786
|
-
* @param {Maps} maps - Specifies the instance of the maps.
|
|
9787
10047
|
* @returns {void}
|
|
9788
10048
|
* @private
|
|
9789
10049
|
*/
|
|
9790
|
-
destroy(
|
|
9791
|
-
|
|
9792
|
-
|
|
9793
|
-
|
|
10050
|
+
destroy() {
|
|
10051
|
+
this.dataLabelCollections = [];
|
|
10052
|
+
this.value = null;
|
|
10053
|
+
this.maps = null;
|
|
9794
10054
|
}
|
|
9795
10055
|
}
|
|
9796
10056
|
|
|
@@ -9941,14 +10201,11 @@ class NavigationLine {
|
|
|
9941
10201
|
/**
|
|
9942
10202
|
* To destroy the layers.
|
|
9943
10203
|
*
|
|
9944
|
-
* @param {Maps} maps - Specifies the instance of the map
|
|
9945
10204
|
* @returns {void}
|
|
9946
10205
|
* @private
|
|
9947
10206
|
*/
|
|
9948
|
-
destroy(
|
|
9949
|
-
|
|
9950
|
-
* Destroy method performed here
|
|
9951
|
-
*/
|
|
10207
|
+
destroy() {
|
|
10208
|
+
this.maps = null;
|
|
9952
10209
|
}
|
|
9953
10210
|
}
|
|
9954
10211
|
|
|
@@ -9961,6 +10218,10 @@ class Legend {
|
|
|
9961
10218
|
* @private
|
|
9962
10219
|
*/
|
|
9963
10220
|
this.legendBorderRect = new Rect(0, 0, 0, 0);
|
|
10221
|
+
/**
|
|
10222
|
+
* @private
|
|
10223
|
+
*/
|
|
10224
|
+
this.initialMapAreaRect = new Rect(0, 0, 0, 0);
|
|
9964
10225
|
/**
|
|
9965
10226
|
* @private
|
|
9966
10227
|
*/
|
|
@@ -10019,6 +10280,7 @@ class Legend {
|
|
|
10019
10280
|
this.heightIncrement = 0;
|
|
10020
10281
|
this.defsElement = this.maps.renderer.createDefs();
|
|
10021
10282
|
this.maps.svgObject.appendChild(this.defsElement);
|
|
10283
|
+
this.initialMapAreaRect = this.maps.mapAreaRect;
|
|
10022
10284
|
this.calculateLegendBounds();
|
|
10023
10285
|
this.drawLegend();
|
|
10024
10286
|
}
|
|
@@ -10056,9 +10318,9 @@ class Legend {
|
|
|
10056
10318
|
}
|
|
10057
10319
|
}
|
|
10058
10320
|
}
|
|
10059
|
-
|
|
10060
|
-
|
|
10061
|
-
|
|
10321
|
+
}
|
|
10322
|
+
if (legend.type === 'Markers') {
|
|
10323
|
+
this.getMarkersLegendCollections(layerIndex, layer.markerSettings);
|
|
10062
10324
|
}
|
|
10063
10325
|
});
|
|
10064
10326
|
if (this.legendCollection.length > 0) {
|
|
@@ -10249,8 +10511,9 @@ class Legend {
|
|
|
10249
10511
|
}
|
|
10250
10512
|
}
|
|
10251
10513
|
else {
|
|
10514
|
+
let padding = 10;
|
|
10252
10515
|
shapeX = shapeLocation[j - 1].x;
|
|
10253
|
-
shapeY = prevPositionY +
|
|
10516
|
+
shapeY = prevPositionY + padding + (shapeHeight / 2);
|
|
10254
10517
|
}
|
|
10255
10518
|
}
|
|
10256
10519
|
}
|
|
@@ -10353,7 +10616,14 @@ class Legend {
|
|
|
10353
10616
|
const legend = map.legendSettings;
|
|
10354
10617
|
const render = map.renderer;
|
|
10355
10618
|
let textOptions;
|
|
10356
|
-
const textFont =
|
|
10619
|
+
const textFont = {
|
|
10620
|
+
size: legend.textStyle.size,
|
|
10621
|
+
color: legend.textStyle.color,
|
|
10622
|
+
fontFamily: legend.textStyle.fontFamily,
|
|
10623
|
+
fontWeight: legend.textStyle.fontWeight,
|
|
10624
|
+
fontStyle: legend.textStyle.fontStyle,
|
|
10625
|
+
opacity: legend.textStyle.opacity
|
|
10626
|
+
};
|
|
10357
10627
|
this.legendGroup = render.createGroup({ id: map.element.id + '_Legend_Group' });
|
|
10358
10628
|
if (legend.mode === 'Interactive') {
|
|
10359
10629
|
for (let i = 0; i < this.legendRenderingCollections.length; i++) {
|
|
@@ -10369,7 +10639,7 @@ class Legend {
|
|
|
10369
10639
|
textFont.color = (textFont.color !== null) ? textFont.color : this.maps.themeStyle.legendTextColor;
|
|
10370
10640
|
const rectOptions = new RectOption(itemId, item['fill'], item['shapeBorder'], legend.opacity, bounds);
|
|
10371
10641
|
textOptions = new TextOption(textId, textLocation.x, textLocation.y, 'middle', item['text'], '', '');
|
|
10372
|
-
textFont.fontFamily =
|
|
10642
|
+
textFont.fontFamily = !isNullOrUndefined(textFont.fontFamily) ? textFont.fontFamily : this.maps.themeStyle.fontFamily;
|
|
10373
10643
|
textFont.size = map.themeStyle.legendFontSize || textFont.size;
|
|
10374
10644
|
renderTextElement(textOptions, textFont, textFont.color, this.legendGroup);
|
|
10375
10645
|
this.legendGroup.appendChild(render.drawRectangle(rectOptions));
|
|
@@ -10424,7 +10694,7 @@ class Legend {
|
|
|
10424
10694
|
};
|
|
10425
10695
|
legendTextStyle.color = (legendTextStyle.color !== null) ? legendTextStyle.color :
|
|
10426
10696
|
this.maps.themeStyle.legendTextColor;
|
|
10427
|
-
legendTextStyle.fontFamily =
|
|
10697
|
+
legendTextStyle.fontFamily = !isNullOrUndefined(legendTextStyle.fontFamily) ? legendTextStyle.fontFamily : this.maps.themeStyle.fontFamily;
|
|
10428
10698
|
legendTextStyle.size = map.themeStyle.legendFontSize || legendTextStyle.size;
|
|
10429
10699
|
if (i === 0) {
|
|
10430
10700
|
this.renderLegendBorder();
|
|
@@ -10500,7 +10770,9 @@ class Legend {
|
|
|
10500
10770
|
'opacity': 1,
|
|
10501
10771
|
'dominant-baseline': ''
|
|
10502
10772
|
};
|
|
10503
|
-
|
|
10773
|
+
let pagingTextElement = render.createText(pageTextOptions, pagingText);
|
|
10774
|
+
pagingTextElement.setAttribute('style', 'user-select: none;');
|
|
10775
|
+
pagingGroup.appendChild(pagingTextElement);
|
|
10504
10776
|
this.legendGroup.appendChild(pagingGroup);
|
|
10505
10777
|
}
|
|
10506
10778
|
this.legendToggle();
|
|
@@ -10512,6 +10784,7 @@ class Legend {
|
|
|
10512
10784
|
let shapeIndex;
|
|
10513
10785
|
let layerIndex;
|
|
10514
10786
|
let dataIndex;
|
|
10787
|
+
let pointIndex;
|
|
10515
10788
|
const legend = this.maps.legendSettings;
|
|
10516
10789
|
const textEle = legend.mode === 'Default' ? document.getElementById(targetElement.id.replace('Shape', 'Text')) :
|
|
10517
10790
|
document.getElementById(targetElement.id + '_Text');
|
|
@@ -10599,12 +10872,20 @@ class Legend {
|
|
|
10599
10872
|
}
|
|
10600
10873
|
if (enable) {
|
|
10601
10874
|
for (let j = 0; j < data.length; j++) {
|
|
10875
|
+
let shapeElement;
|
|
10602
10876
|
shapeIndex = data[j]['shapeIndex'];
|
|
10603
10877
|
layerIndex = data[j]['layerIndex'];
|
|
10604
10878
|
dataIndex = data[j]['dataIndex'];
|
|
10605
|
-
|
|
10606
|
-
|
|
10607
|
-
|
|
10879
|
+
pointIndex = data[j]['pointIndex'];
|
|
10880
|
+
if (pointIndex === -1) {
|
|
10881
|
+
shapeElement = document.getElementById(this.maps.element.id + '_LayerIndex_' +
|
|
10882
|
+
layerIndex + '_shapeIndex_' + shapeIndex + '_dataIndex_' + dataIndex);
|
|
10883
|
+
}
|
|
10884
|
+
else {
|
|
10885
|
+
shapeElement = document.getElementById(this.maps.element.id + '_LayerIndex_' +
|
|
10886
|
+
layerIndex + '_shapeIndex_' + shapeIndex + '_dataIndex_' + dataIndex + '_multiLine_' + pointIndex);
|
|
10887
|
+
}
|
|
10888
|
+
if (shapeElement !== null) {
|
|
10608
10889
|
let shapeMatch = true;
|
|
10609
10890
|
if (this.maps.legendSelectionCollection !== null) {
|
|
10610
10891
|
for (let i = 0; i < this.maps.legendSelectionCollection.length; i++) {
|
|
@@ -10621,13 +10902,13 @@ class Legend {
|
|
|
10621
10902
|
}
|
|
10622
10903
|
length = this.legendHighlightCollection.length;
|
|
10623
10904
|
const legendHighlightColor = this.legendHighlightCollection[length - 1]['legendOldFill'];
|
|
10624
|
-
this.legendHighlightCollection[length - 1]['MapShapeCollection']['Elements'].push(
|
|
10905
|
+
this.legendHighlightCollection[length - 1]['MapShapeCollection']['Elements'].push(shapeElement);
|
|
10625
10906
|
const shapeItemCount = this.legendHighlightCollection[length - 1]['MapShapeCollection']['Elements'].length - 1;
|
|
10626
|
-
const shapeOldFillColor =
|
|
10907
|
+
const shapeOldFillColor = shapeElement.getAttribute('fill');
|
|
10627
10908
|
this.legendHighlightCollection[length - 1]['shapeOldFillColor'].push(shapeOldFillColor);
|
|
10628
10909
|
const shapeOldColor = this.legendHighlightCollection[length - 1]['shapeOldFillColor'][shapeItemCount];
|
|
10629
10910
|
this.shapePreviousColor = this.legendHighlightCollection[length - 1]['shapeOldFillColor'];
|
|
10630
|
-
this.setColor(
|
|
10911
|
+
this.setColor(shapeElement, !isNullOrUndefined(module.fill) ? module.fill : shapeOldColor, module.opacity.toString(), module.border.color, module.border.width.toString(), 'highlight');
|
|
10631
10912
|
this.setColor(targetElement, !isNullOrUndefined(module.fill) ? module.fill : legendHighlightColor, module.opacity.toString(), module.border.color, module.border.width.toString(), 'highlight');
|
|
10632
10913
|
}
|
|
10633
10914
|
else if (value === 'selection') {
|
|
@@ -10650,12 +10931,12 @@ class Legend {
|
|
|
10650
10931
|
}
|
|
10651
10932
|
selectLength = this.maps.legendSelectionCollection.length;
|
|
10652
10933
|
const legendSelectionColor = this.maps.legendSelectionCollection[selectLength - 1]['legendOldFill'];
|
|
10653
|
-
this.maps.legendSelectionCollection[selectLength - 1]['MapShapeCollection']['Elements'].push(
|
|
10934
|
+
this.maps.legendSelectionCollection[selectLength - 1]['MapShapeCollection']['Elements'].push(shapeElement);
|
|
10654
10935
|
this.maps.legendSelectionCollection[selectLength - 1]['shapeOldFillColor'] = this.shapePreviousColor;
|
|
10655
10936
|
this.setColor(targetElement, !isNullOrUndefined(module.fill) ? module.fill : legendSelectionColor, module.opacity.toString(), module.border.color, module.border.width.toString(), 'selection');
|
|
10656
|
-
this.setColor(
|
|
10657
|
-
if (this.maps.selectedElementId.indexOf(
|
|
10658
|
-
this.maps.selectedElementId.push(
|
|
10937
|
+
this.setColor(shapeElement, !isNullOrUndefined(module.fill) ? module.fill : legendSelectionColor, module.opacity.toString(), module.border.color, module.border.width.toString(), 'selection');
|
|
10938
|
+
if (this.maps.selectedElementId.indexOf(shapeElement.getAttribute('id')) === -1) {
|
|
10939
|
+
this.maps.selectedElementId.push(shapeElement.getAttribute('id'));
|
|
10659
10940
|
}
|
|
10660
10941
|
if (j === data.length - 1) {
|
|
10661
10942
|
this.maps.legendSelection = false;
|
|
@@ -10670,14 +10951,15 @@ class Legend {
|
|
|
10670
10951
|
}
|
|
10671
10952
|
}
|
|
10672
10953
|
setColor(element, fill, opacity, borderColor, borderWidth, type) {
|
|
10954
|
+
const isLineStringShape = (element.parentElement.id.indexOf('LineString') > -1);
|
|
10673
10955
|
if (type === 'selection') {
|
|
10674
|
-
maintainStyleClass('ShapeselectionMap', 'ShapeselectionMapStyle', fill, opacity, borderColor, borderWidth, this.maps);
|
|
10675
|
-
element.setAttribute('class', 'ShapeselectionMapStyle');
|
|
10956
|
+
maintainStyleClass((isLineStringShape ? 'LineselectionMap' : 'ShapeselectionMap'), (isLineStringShape ? 'LineselectionMapStyle' : 'ShapeselectionMapStyle'), (isLineStringShape ? 'transparent' : fill), opacity, (isLineStringShape ? fill : borderColor), borderWidth, this.maps);
|
|
10957
|
+
element.setAttribute('class', isLineStringShape ? 'LineselectionMapStyle' : 'ShapeselectionMapStyle');
|
|
10676
10958
|
}
|
|
10677
10959
|
else {
|
|
10678
|
-
element.setAttribute('fill', fill);
|
|
10960
|
+
element.setAttribute('fill', isLineStringShape ? 'transparent' : fill);
|
|
10679
10961
|
element.setAttribute('fill-opacity', opacity);
|
|
10680
|
-
element.setAttribute('stroke', borderColor);
|
|
10962
|
+
element.setAttribute('stroke', isLineStringShape ? fill : borderColor);
|
|
10681
10963
|
element.setAttribute('stroke-width', (Number(borderWidth) / this.maps.scale).toString());
|
|
10682
10964
|
}
|
|
10683
10965
|
}
|
|
@@ -10720,7 +11002,8 @@ class Legend {
|
|
|
10720
11002
|
const dataCount = shapeElements.length;
|
|
10721
11003
|
for (let j = 0; j < dataCount; j++) {
|
|
10722
11004
|
const shapeElement = getElement(shapeElements[j]);
|
|
10723
|
-
if (shapeElement.getAttribute('class') === 'ShapeselectionMapStyle'
|
|
11005
|
+
if (shapeElement.getAttribute('class') === 'ShapeselectionMapStyle' ||
|
|
11006
|
+
shapeElement.getAttribute('class') === 'LineselectionMapStyle') {
|
|
10724
11007
|
removeClass(shapeElement);
|
|
10725
11008
|
const selectedElementIdIndex = this.maps.selectedElementId.indexOf(shapeElement.id);
|
|
10726
11009
|
if (selectedElementIdIndex !== -1) {
|
|
@@ -10798,12 +11081,14 @@ class Legend {
|
|
|
10798
11081
|
this.maps.legendSelectionClass = module;
|
|
10799
11082
|
}
|
|
10800
11083
|
else {
|
|
10801
|
-
if ((checkSelection <= 1) && targetElement.getAttribute('class') === 'ShapeselectionMapStyle'
|
|
11084
|
+
if ((checkSelection <= 1) && (targetElement.getAttribute('class') === 'ShapeselectionMapStyle'
|
|
11085
|
+
|| targetElement.getAttribute('class') === 'LineselectionMapStyle')) {
|
|
10802
11086
|
if (!this.maps.layers[layerIndex].selectionSettings.enableMultiSelect) {
|
|
10803
11087
|
this.maps.selectedLegendElementId.splice(selectionIndex, 1);
|
|
10804
11088
|
}
|
|
10805
11089
|
else {
|
|
10806
|
-
if (checkSelection <= 1 && targetElement.getAttribute('class') === 'ShapeselectionMapStyle'
|
|
11090
|
+
if (checkSelection <= 1 && (targetElement.getAttribute('class') === 'ShapeselectionMapStyle'
|
|
11091
|
+
|| targetElement.getAttribute('class') === 'LineselectionMapStyle')) {
|
|
10807
11092
|
this.maps.selectedLegendElementId.splice(selectionIndex, 1);
|
|
10808
11093
|
}
|
|
10809
11094
|
}
|
|
@@ -10890,7 +11175,8 @@ class Legend {
|
|
|
10890
11175
|
}
|
|
10891
11176
|
}
|
|
10892
11177
|
}
|
|
10893
|
-
if (selectionEle && (selectionEle['IsSelected'] && targetElement.getAttribute('class') === 'ShapeselectionMapStyle'
|
|
11178
|
+
if (selectionEle && (selectionEle['IsSelected'] && (targetElement.getAttribute('class') === 'ShapeselectionMapStyle'
|
|
11179
|
+
|| targetElement.getAttribute('class') === 'LineselectionMapStyle'))) {
|
|
10894
11180
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10895
11181
|
const element = this.maps.legendSelectionCollection[selectionEle['SelectionIndex']];
|
|
10896
11182
|
let multiSelection = 0;
|
|
@@ -10981,7 +11267,7 @@ class Legend {
|
|
|
10981
11267
|
}
|
|
10982
11268
|
for (let j = 0; j < this.maps.selectedLegendElementId.length; j++) {
|
|
10983
11269
|
const idIndex = this.maps.legendSettings.mode === 'Interactive' ?
|
|
10984
|
-
'
|
|
11270
|
+
this.maps.element.id + '_Legend_Index_' : this.maps.element.id + '_Legend_Shape_Index_';
|
|
10985
11271
|
const selectedElement = idIndex + this.maps.selectedLegendElementId[j];
|
|
10986
11272
|
const legendElement = document.getElementById(selectedElement);
|
|
10987
11273
|
if (!isNullOrUndefined(legendElement)) {
|
|
@@ -11033,6 +11319,7 @@ class Legend {
|
|
|
11033
11319
|
let shapeIndex;
|
|
11034
11320
|
let layerIndex;
|
|
11035
11321
|
let dataIndex;
|
|
11322
|
+
let pointIndex;
|
|
11036
11323
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11037
11324
|
const collection = this.maps.legendModule.legendCollection;
|
|
11038
11325
|
const legend = this.maps.legendSettings;
|
|
@@ -11045,15 +11332,23 @@ class Legend {
|
|
|
11045
11332
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11046
11333
|
const currentElement = { Elements: [] };
|
|
11047
11334
|
for (let j = 0; j < data.length; j++) {
|
|
11335
|
+
let shapeElement;
|
|
11048
11336
|
shapeIndex = data[j]['shapeIndex'];
|
|
11049
11337
|
layerIndex = data[j]['layerIndex'];
|
|
11050
11338
|
dataIndex = data[j]['dataIndex'];
|
|
11051
|
-
|
|
11052
|
-
|
|
11053
|
-
|
|
11339
|
+
pointIndex = data[j]['pointIndex'];
|
|
11340
|
+
if (pointIndex === -1) {
|
|
11341
|
+
shapeElement = document.getElementById(this.maps.element.id + '_LayerIndex_' +
|
|
11342
|
+
layerIndex + '_shapeIndex_' + shapeIndex + '_dataIndex_' + dataIndex);
|
|
11343
|
+
}
|
|
11344
|
+
else {
|
|
11345
|
+
shapeElement = document.getElementById(this.maps.element.id + '_LayerIndex_' +
|
|
11346
|
+
layerIndex + '_shapeIndex_' + shapeIndex + '_dataIndex_' + dataIndex + '_multiLine_' + pointIndex);
|
|
11347
|
+
}
|
|
11348
|
+
if (targetElement === shapeElement) {
|
|
11054
11349
|
process = true;
|
|
11055
11350
|
}
|
|
11056
|
-
elements.push(
|
|
11351
|
+
elements.push(shapeElement);
|
|
11057
11352
|
}
|
|
11058
11353
|
if (process) {
|
|
11059
11354
|
if (isNullOrUndefined(currentElement['LegendEle'])) {
|
|
@@ -11071,16 +11366,25 @@ class Legend {
|
|
|
11071
11366
|
let shapeIndex;
|
|
11072
11367
|
let layerIndex;
|
|
11073
11368
|
let dataIndex;
|
|
11369
|
+
let pointIndex;
|
|
11074
11370
|
const idIndex = parseFloat(targetElement.id.charAt(targetElement.id.length - 1));
|
|
11075
11371
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11076
11372
|
const data = this.maps.legendModule.legendCollection[idIndex]['data'];
|
|
11077
11373
|
const legendShapeElements = [];
|
|
11078
11374
|
for (let i = 0; i < data.length; i++) {
|
|
11375
|
+
let shapeElement;
|
|
11079
11376
|
shapeIndex = data[i]['shapeIndex'];
|
|
11080
11377
|
layerIndex = data[i]['layerIndex'];
|
|
11081
11378
|
dataIndex = data[i]['dataIndex'];
|
|
11082
|
-
|
|
11083
|
-
|
|
11379
|
+
pointIndex = data[i]['pointIndex'];
|
|
11380
|
+
if (pointIndex === -1) {
|
|
11381
|
+
shapeElement = document.getElementById(this.maps.element.id + '_LayerIndex_' +
|
|
11382
|
+
layerIndex + '_shapeIndex_' + shapeIndex + '_dataIndex_' + dataIndex);
|
|
11383
|
+
}
|
|
11384
|
+
else {
|
|
11385
|
+
shapeElement = document.getElementById(this.maps.element.id + '_LayerIndex_' +
|
|
11386
|
+
layerIndex + '_shapeIndex_' + shapeIndex + '_dataIndex_' + dataIndex + '_multiLine_' + pointIndex);
|
|
11387
|
+
}
|
|
11084
11388
|
if (!isNullOrUndefined(shapeElement)) {
|
|
11085
11389
|
legendShapeElements.push(shapeElement.id);
|
|
11086
11390
|
}
|
|
@@ -11148,9 +11452,11 @@ class Legend {
|
|
|
11148
11452
|
const renderOptions = new RectOption(map.element.id + '_Legend_Border', legend.background, legendBorder, 1, this.legendBorderRect, null, null, '', '');
|
|
11149
11453
|
this.legendGroup.appendChild(map.renderer.drawRectangle(renderOptions));
|
|
11150
11454
|
this.getLegendAlignment(map, this.legendBorderRect.width, this.legendBorderRect.height, legend);
|
|
11151
|
-
this.legendGroup.setAttribute('transform', 'translate( ' + (this.translate.x + (-
|
|
11455
|
+
this.legendGroup.setAttribute('transform', 'translate( ' + (this.translate.x + (-this.legendBorderRect.x)) + ' ' +
|
|
11152
11456
|
(this.translate.y + (-(this.legendBorderRect.y))) + ' )');
|
|
11153
|
-
|
|
11457
|
+
if (legend.position !== 'Float') {
|
|
11458
|
+
map.svgObject.appendChild(this.legendGroup);
|
|
11459
|
+
}
|
|
11154
11460
|
if (legendTitle) {
|
|
11155
11461
|
textStyle.color = (textStyle.color !== null) ? textStyle.color : this.maps.themeStyle.legendTitleFontColor;
|
|
11156
11462
|
textStyle.fontFamily = !isNullOrUndefined(textStyle.fontFamily) ? textStyle.fontFamily : this.maps.themeStyle.fontFamily;
|
|
@@ -11162,7 +11468,16 @@ class Legend {
|
|
|
11162
11468
|
this.currentPage = (e.target.id.indexOf('_Left_Page_') > -1) ? (this.currentPage - 1) :
|
|
11163
11469
|
(this.currentPage + 1);
|
|
11164
11470
|
this.legendGroup = this.maps.renderer.createGroup({ id: this.maps.element.id + '_Legend_Group' });
|
|
11471
|
+
this.maps.mapAreaRect = this.initialMapAreaRect;
|
|
11165
11472
|
this.drawLegendItem(this.currentPage);
|
|
11473
|
+
if (!isNullOrUndefined(this.maps.legendModule) && this.maps.legendSettings.position === 'Float') {
|
|
11474
|
+
if (this.maps.isTileMap) {
|
|
11475
|
+
this.maps.mapLayerPanel.layerGroup.appendChild(this.maps.legendModule.legendGroup);
|
|
11476
|
+
}
|
|
11477
|
+
else {
|
|
11478
|
+
this.maps.svgObject.appendChild(this.maps.legendModule.legendGroup);
|
|
11479
|
+
}
|
|
11480
|
+
}
|
|
11166
11481
|
if (querySelector(this.maps.element.id + '_Legend_Border', this.maps.element.id)) {
|
|
11167
11482
|
querySelector(this.maps.element.id + '_Legend_Border', this.maps.element.id).style.pointerEvents = 'none';
|
|
11168
11483
|
}
|
|
@@ -11180,53 +11495,60 @@ class Legend {
|
|
|
11180
11495
|
const areaWidth = totalRect.width;
|
|
11181
11496
|
const totalWidth = map.availableSize.width;
|
|
11182
11497
|
const totalHeight = map.availableSize.height;
|
|
11498
|
+
const locationX = !isNullOrUndefined(legend.location.x) ? legend.location.x : 0;
|
|
11499
|
+
const locationY = !isNullOrUndefined(legend.location.y) ? legend.location.y : 0;
|
|
11183
11500
|
if (legend.position === 'Float') {
|
|
11184
|
-
this.translate =
|
|
11501
|
+
this.translate = map.isTileMap ? new Point(locationX, locationY + (spacing / 4)) : new Point(locationX + map.mapAreaRect.x, locationY + map.mapAreaRect.y);
|
|
11502
|
+
this.legendTotalRect = map.mapAreaRect;
|
|
11185
11503
|
}
|
|
11186
11504
|
else {
|
|
11187
11505
|
switch (legend.position) {
|
|
11188
11506
|
case 'Top':
|
|
11189
11507
|
case 'Bottom':
|
|
11190
|
-
totalRect.height = (areaHeight - height);
|
|
11508
|
+
totalRect.height = (legend.position === 'Top') ? (areaHeight - height) : (areaHeight - height - (spacing * 2));
|
|
11191
11509
|
x = (totalWidth / 2) - (width / 2);
|
|
11192
11510
|
y = (legend.position === 'Top') ? areaY : (areaY + totalRect.height);
|
|
11193
|
-
totalRect.y = (legend.position === 'Top') ? areaY + height + spacing : areaY;
|
|
11511
|
+
totalRect.y = (legend.position === 'Top') ? areaY + height + (map.isTileMap ? (spacing / 2) : spacing) : areaY - (spacing / 2);
|
|
11194
11512
|
break;
|
|
11195
11513
|
case 'Left':
|
|
11196
11514
|
case 'Right':
|
|
11197
|
-
totalRect.width = (areaWidth - width);
|
|
11198
|
-
x = (legend.position === 'Left') ? areaX : (areaX + totalRect.width
|
|
11515
|
+
totalRect.width = (areaWidth - width - map.mapAreaRect.x);
|
|
11516
|
+
x = (legend.position === 'Left') ? areaX + (spacing / 2) : (areaX + totalRect.width + spacing);
|
|
11199
11517
|
y = (totalHeight / 2) - (height / 2);
|
|
11200
|
-
totalRect.x = (legend.position === 'Left') ? areaX + width : areaX;
|
|
11518
|
+
totalRect.x = (legend.position === 'Left') ? areaX + width + spacing : areaX;
|
|
11201
11519
|
break;
|
|
11202
11520
|
}
|
|
11203
11521
|
switch (legend.alignment) {
|
|
11204
11522
|
case 'Near':
|
|
11205
11523
|
if (legend.position === 'Top' || legend.position === 'Bottom') {
|
|
11206
|
-
x = totalRect.x;
|
|
11524
|
+
x = totalRect.x - (legend.mode === 'Interactive' ? spacing : 0);
|
|
11207
11525
|
}
|
|
11208
11526
|
else {
|
|
11209
|
-
y = totalRect.y;
|
|
11527
|
+
y = totalRect.y - (!(legend.height && legend.width) && legend.mode === 'Interactive' ? map.mapAreaRect.x : 0);
|
|
11210
11528
|
}
|
|
11211
11529
|
break;
|
|
11212
11530
|
case 'Far':
|
|
11213
11531
|
if (legend.position === 'Top' || legend.position === 'Bottom') {
|
|
11214
|
-
x = (totalWidth - width) - spacing;
|
|
11532
|
+
x = (totalWidth - width) - (legend.mode === 'Interactive' ? 0 : spacing);
|
|
11215
11533
|
}
|
|
11216
11534
|
else {
|
|
11217
|
-
y = totalHeight - height;
|
|
11535
|
+
y = totalHeight - height - (legend.mode === 'Default' ? spacing : 0);
|
|
11218
11536
|
}
|
|
11219
11537
|
break;
|
|
11220
11538
|
}
|
|
11221
11539
|
if ((legend.height || legend.width) && legend.mode !== 'Interactive') {
|
|
11222
|
-
this.legendTotalRect = map.totalRect = totalRect;
|
|
11540
|
+
this.legendTotalRect = map.mapAreaRect = map.totalRect = totalRect;
|
|
11223
11541
|
}
|
|
11224
11542
|
else {
|
|
11543
|
+
map.totalRect = null;
|
|
11225
11544
|
if ((legend.height || legend.width) && legend.mode === 'Interactive') {
|
|
11226
11545
|
map.totalRect = totalRect;
|
|
11227
11546
|
}
|
|
11228
11547
|
this.legendTotalRect = map.mapAreaRect = totalRect;
|
|
11229
11548
|
}
|
|
11549
|
+
if (legend.position === 'Left') {
|
|
11550
|
+
map.mapAreaRect.width = totalRect.width;
|
|
11551
|
+
}
|
|
11230
11552
|
this.translate = new Point(x, y);
|
|
11231
11553
|
}
|
|
11232
11554
|
}
|
|
@@ -11243,7 +11565,7 @@ class Legend {
|
|
|
11243
11565
|
data[this.maps.legendSettings.showLegendPath];
|
|
11244
11566
|
if (marker$$1.visible && showLegend && (!isNullOrUndefined(data['latitude'])) && (!isNullOrUndefined(data['longitude']))) {
|
|
11245
11567
|
if (marker$$1.template) {
|
|
11246
|
-
templateFn = getTemplateFunction(marker$$1.template);
|
|
11568
|
+
templateFn = getTemplateFunction(marker$$1.template, this.maps);
|
|
11247
11569
|
const templateElement = templateFn(this.maps);
|
|
11248
11570
|
const markerEle = isNullOrUndefined(templateElement.childElementCount) ? templateElement[0] :
|
|
11249
11571
|
templateElement;
|
|
@@ -11347,6 +11669,13 @@ class Legend {
|
|
|
11347
11669
|
borderColor: legend.shapeBorder.color, borderWidth: legend.shapeBorder.width
|
|
11348
11670
|
});
|
|
11349
11671
|
}
|
|
11672
|
+
else {
|
|
11673
|
+
for (let i = 0; i < this.legendCollection.length; i++) {
|
|
11674
|
+
if (this.legendCollection[i]['text'] === legendText && this.legendCollection[i]['fill'] === legendFill) {
|
|
11675
|
+
this.legendCollection[i].data.push(newColllection[0]);
|
|
11676
|
+
}
|
|
11677
|
+
}
|
|
11678
|
+
}
|
|
11350
11679
|
}
|
|
11351
11680
|
}
|
|
11352
11681
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -11541,15 +11870,16 @@ class Legend {
|
|
|
11541
11870
|
const width = 10;
|
|
11542
11871
|
const direction = (legend.orientation === 'None') ? (legend.position === 'Top' || legend.position === 'Bottom')
|
|
11543
11872
|
? 'Horizontal' : 'Vertical' : legend.orientation;
|
|
11873
|
+
rect.y = legend.position === 'Float' && this.maps.isTileMap ? rect.y - this.maps.mapAreaRect.y : rect.y;
|
|
11544
11874
|
if (direction === 'Horizontal') {
|
|
11545
11875
|
if (!legend.invertedPointer) {
|
|
11546
|
-
locX = rect.x + (rect.width / 2);
|
|
11876
|
+
locX = rect.x + (rect.width / 2) - (legend.position === 'Float' && this.maps.isTileMap ? this.maps.mapAreaRect.x : 0);
|
|
11547
11877
|
locY = rect.y;
|
|
11548
11878
|
path = ' M ' + locX + ' ' + locY + ' L ' + (locX - width) + ' ' + (locY - height) +
|
|
11549
11879
|
' L ' + (locX + width) + ' ' + (locY - height) + ' Z ';
|
|
11550
11880
|
}
|
|
11551
11881
|
else {
|
|
11552
|
-
locX = rect.x + (rect.width / 2);
|
|
11882
|
+
locX = rect.x + (rect.width / 2) - (legend.position === 'Float' && this.maps.isTileMap ? this.maps.mapAreaRect.x : 0);
|
|
11553
11883
|
locY = rect.y + (rect.height);
|
|
11554
11884
|
path = ' M ' + locX + ' ' + locY + ' L ' + (locX - width) + ' ' + (locY + height) +
|
|
11555
11885
|
' L ' + (locX + width) + ' ' + (locY + height) + ' Z ';
|
|
@@ -11557,20 +11887,25 @@ class Legend {
|
|
|
11557
11887
|
}
|
|
11558
11888
|
else {
|
|
11559
11889
|
if (!legend.invertedPointer) {
|
|
11560
|
-
locX = rect.x +
|
|
11890
|
+
locX = rect.x + rect.width - (legend.position === 'Float' && this.maps.isTileMap ? this.maps.mapAreaRect.x : 0);
|
|
11561
11891
|
locY = rect.y + (rect.height / 2);
|
|
11562
11892
|
path = ' M ' + locX + ' ' + locY + ' L ' + (locX + width) + ' ' + (locY - height) +
|
|
11563
11893
|
' L ' + (locX + width) + ' ' + (locY + height) + ' z ';
|
|
11564
11894
|
}
|
|
11565
11895
|
else {
|
|
11566
|
-
locX = rect.x;
|
|
11896
|
+
locX = rect.x - (legend.position === 'Float' && this.maps.isTileMap ? this.maps.mapAreaRect.x : 0);
|
|
11567
11897
|
locY = rect.y + (rect.height / 2);
|
|
11568
11898
|
path = ' M ' + locX + ' ' + locY + ' L ' + (locX - width) + ' ' + (locY - height) +
|
|
11569
11899
|
' L ' + (locX - width) + ' ' + (locY + height) + ' z ';
|
|
11570
11900
|
}
|
|
11571
11901
|
}
|
|
11572
11902
|
const pathOptions = new PathOption(id, fill, strokeWidth, stroke, 1, 1, '', path);
|
|
11573
|
-
|
|
11903
|
+
if (legend.position === 'Float' && this.maps.isTileMap) {
|
|
11904
|
+
this.maps.mapLayerPanel.layerGroup.appendChild(this.maps.renderer.drawPath(pathOptions));
|
|
11905
|
+
}
|
|
11906
|
+
else {
|
|
11907
|
+
this.maps.svgObject.appendChild(this.maps.renderer.drawPath(pathOptions));
|
|
11908
|
+
}
|
|
11574
11909
|
}
|
|
11575
11910
|
wireEvents(element) {
|
|
11576
11911
|
EventHandler.add(element, Browser.touchStartEvent, this.changeNextPage, this);
|
|
@@ -11627,6 +11962,9 @@ class Legend {
|
|
|
11627
11962
|
'_BubbleIndex_' + j + '_dataIndex_' + shape['dataIndex'], this.maps.element.id) : querySelector(this.maps.element.id + '_LayerIndex_' + shape['layerIndex'] +
|
|
11628
11963
|
'_MarkerIndex_' + shape['markerIndex'] + '_dataIndex_' + shape['dataIndex'], this.maps.element.id);
|
|
11629
11964
|
if (!isNullOrUndefined(shape['shape']) && shape['shape'] === 'Balloon') {
|
|
11965
|
+
mapElement = this.maps.legendSettings.type === 'Bubbles' ? querySelector(this.maps.element.id + '_LayerIndex_' + shape['layerIndex'] +
|
|
11966
|
+
'_BubbleIndex_' + j + '_dataIndex_' + shape['dataIndex'] + '_Group', this.maps.element.id) : querySelector(this.maps.element.id + '_LayerIndex_' + shape['layerIndex'] +
|
|
11967
|
+
'_MarkerIndex_' + shape['markerIndex'] + '_dataIndex_' + shape['dataIndex'] + '_Group', this.maps.element.id);
|
|
11630
11968
|
mapElement = mapElement.children[0];
|
|
11631
11969
|
}
|
|
11632
11970
|
if (isVisible && mapElement !== null) {
|
|
@@ -11768,6 +12106,9 @@ class Legend {
|
|
|
11768
12106
|
'_BubbleIndex_' + j + '_dataIndex_' + mapdata['dataIndex'], this.maps.element.id) : querySelector(this.maps.element.id + '_LayerIndex_' + mapdata['layerIndex'] +
|
|
11769
12107
|
'_MarkerIndex_' + j + '_dataIndex_' + mapdata['dataIndex'], this.maps.element.id);
|
|
11770
12108
|
if (!isNullOrUndefined(mapdata['shape']) && mapdata['shape'] === 'Balloon') {
|
|
12109
|
+
LegendInteractive = this.maps.legendSettings.type === 'Bubbles' ? querySelector(this.maps.element.id + '_LayerIndex_' + mapdata['layerIndex'] +
|
|
12110
|
+
'_BubbleIndex_' + j + '_dataIndex_' + mapdata['dataIndex'] + '_Group', this.maps.element.id) : querySelector(this.maps.element.id + '_LayerIndex_' + mapdata['layerIndex'] +
|
|
12111
|
+
'_MarkerIndex_' + j + '_dataIndex_' + mapdata['dataIndex'] + '_Group', this.maps.element.id);
|
|
11771
12112
|
LegendInteractive = LegendInteractive.children[0];
|
|
11772
12113
|
}
|
|
11773
12114
|
if (isVisible && LegendInteractive !== null) {
|
|
@@ -11931,10 +12272,20 @@ class Legend {
|
|
|
11931
12272
|
const shapeDataValueCase = !isNullOrUndefined(shapeData['properties'][shapePath])
|
|
11932
12273
|
&& isNaN(shapeData['properties'][shapePath]) ? shapeData['properties'][shapePath].toLowerCase() : shapeData['properties'][shapePath];
|
|
11933
12274
|
if (shapeDataValueCase === dataPathValueCase) {
|
|
11934
|
-
|
|
11935
|
-
|
|
11936
|
-
|
|
11937
|
-
|
|
12275
|
+
if (shapeData['geometry']['type'] != 'MultiPoint') {
|
|
12276
|
+
legendData.push({
|
|
12277
|
+
layerIndex: layerIndex, shapeIndex: i, dataIndex: dataIndex,
|
|
12278
|
+
name: data[dataPath], value: value, pointIndex: -1
|
|
12279
|
+
});
|
|
12280
|
+
}
|
|
12281
|
+
else {
|
|
12282
|
+
for (let j = 0; j < shapeData['geometry'].coordinates.length; j++) {
|
|
12283
|
+
legendData.push({
|
|
12284
|
+
layerIndex: layerIndex, shapeIndex: i, dataIndex: dataIndex,
|
|
12285
|
+
name: data[dataPath], value: value, pointIndex: j
|
|
12286
|
+
});
|
|
12287
|
+
}
|
|
12288
|
+
}
|
|
11938
12289
|
}
|
|
11939
12290
|
}
|
|
11940
12291
|
}
|
|
@@ -11980,15 +12331,30 @@ class Legend {
|
|
|
11980
12331
|
/**
|
|
11981
12332
|
* To destroy the legend.
|
|
11982
12333
|
*
|
|
11983
|
-
* @param {Maps} maps - Specifies the instance of the maps
|
|
11984
12334
|
* @returns {void}
|
|
11985
12335
|
* @private
|
|
11986
12336
|
*/
|
|
11987
|
-
destroy(
|
|
11988
|
-
|
|
11989
|
-
|
|
11990
|
-
|
|
12337
|
+
destroy() {
|
|
12338
|
+
this.legendCollection = [];
|
|
12339
|
+
this.legendRenderingCollections = [];
|
|
12340
|
+
this.translate = null;
|
|
12341
|
+
this.legendBorderRect = null;
|
|
12342
|
+
this.initialMapAreaRect = null;
|
|
12343
|
+
this.legendTotalRect = null;
|
|
12344
|
+
this.totalPages = [];
|
|
12345
|
+
this.legendItemRect = null;
|
|
12346
|
+
this.legendGroup = null;
|
|
12347
|
+
this.shapeHighlightCollection = [];
|
|
12348
|
+
this.legendHighlightCollection = [];
|
|
12349
|
+
this.shapePreviousColor = [];
|
|
12350
|
+
this.selectedNonLegendShapes = [];
|
|
12351
|
+
this.legendLinearGradient = null;
|
|
12352
|
+
this.currentLayer = null;
|
|
12353
|
+
this.defsElement = null;
|
|
12354
|
+
this.legendElement = [];
|
|
12355
|
+
this.oldShapeElement = null;
|
|
11991
12356
|
this.removeEventListener();
|
|
12357
|
+
this.maps = null;
|
|
11992
12358
|
}
|
|
11993
12359
|
}
|
|
11994
12360
|
|
|
@@ -12045,7 +12411,8 @@ class Highlight {
|
|
|
12045
12411
|
targetEle.getAttribute('class') !== 'ShapeselectionMapStyle' && !isTouch &&
|
|
12046
12412
|
targetEle.getAttribute('class') !== 'MarkerselectionMapStyle' &&
|
|
12047
12413
|
targetEle.getAttribute('class') !== 'BubbleselectionMapStyle' &&
|
|
12048
|
-
targetEle.getAttribute('class') !== 'navigationlineselectionMapStyle'
|
|
12414
|
+
targetEle.getAttribute('class') !== 'navigationlineselectionMapStyle' &&
|
|
12415
|
+
targetEle.getAttribute('class') !== 'LineselectionMapStyle') {
|
|
12049
12416
|
layerIndex = parseInt(targetEle.id.split('_LayerIndex_')[1].split('_')[0], 10);
|
|
12050
12417
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12051
12418
|
let shapeData;
|
|
@@ -12055,8 +12422,9 @@ class Highlight {
|
|
|
12055
12422
|
let dataIndex;
|
|
12056
12423
|
if (targetEle.id.indexOf('shapeIndex') > -1) {
|
|
12057
12424
|
shapeIn = parseInt(targetEle.id.split('_shapeIndex_')[1].split('_')[0], 10);
|
|
12058
|
-
shapeData = this.maps.layers[layerIndex].shapeData['features']
|
|
12059
|
-
this.maps.
|
|
12425
|
+
shapeData = this.maps.layers[layerIndex].shapeData['features'] &&
|
|
12426
|
+
!isNullOrUndefined(this.maps.layersCollection[layerIndex].layerData[shapeIn]) ?
|
|
12427
|
+
this.maps.layersCollection[layerIndex].layerData[shapeIn]['property'] : null;
|
|
12060
12428
|
dataIndex = parseInt(targetEle.id.split('_dataIndex_')[1].split('_')[0], 10);
|
|
12061
12429
|
data = isNullOrUndefined(dataIndex) ? null : this.maps.layers[layerIndex].dataSource[dataIndex];
|
|
12062
12430
|
this.highlightSettings = this.maps.layers[layerIndex].highlightSettings;
|
|
@@ -12128,7 +12496,8 @@ class Highlight {
|
|
|
12128
12496
|
*/
|
|
12129
12497
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12130
12498
|
handleHighlight(targetElement, layerIndex, data, shapeData) {
|
|
12131
|
-
if (this.maps.legendSettings.visible && targetElement.id.indexOf('_MarkerIndex_') === -1 && this.maps.legendModule
|
|
12499
|
+
if (this.maps.legendSettings.visible && targetElement.id.indexOf('_MarkerIndex_') === -1 && this.maps.legendModule
|
|
12500
|
+
&& this.maps.legendSettings.type === 'Layers') {
|
|
12132
12501
|
this.maps.legendModule.shapeHighLightAndSelection(targetElement, data, this.highlightSettings, 'highlight', layerIndex);
|
|
12133
12502
|
}
|
|
12134
12503
|
const selectHighLight = targetElement.id.indexOf('shapeIndex') > -1 && (this.maps.legendSettings.visible && this.maps.legendModule) ?
|
|
@@ -12146,7 +12515,7 @@ class Highlight {
|
|
|
12146
12515
|
isMarkerSelect = this.maps.layers[layerIndex].markerSettings[marker$$1].highlightSettings.enable;
|
|
12147
12516
|
}
|
|
12148
12517
|
const border = {
|
|
12149
|
-
color: (targetEle.parentElement.id.indexOf('LineString') === -1) ? this.highlightSettings.border.color : (this.highlightSettings.
|
|
12518
|
+
color: (targetEle.parentElement.id.indexOf('LineString') === -1) ? this.highlightSettings.border.color : (this.highlightSettings.fill || this.highlightSettings.border.color),
|
|
12150
12519
|
width: (targetEle.parentElement.id.indexOf('LineString') === -1) ? (this.highlightSettings.border.width / (isMarkerSelect ? 1 : this.maps.scale)) : (this.highlightSettings.border.width / this.maps.scale),
|
|
12151
12520
|
opacity: this.highlightSettings.border.opacity
|
|
12152
12521
|
};
|
|
@@ -12202,15 +12571,13 @@ class Highlight {
|
|
|
12202
12571
|
/**
|
|
12203
12572
|
* To destroy the highlight.
|
|
12204
12573
|
*
|
|
12205
|
-
* @param {Maps} maps - Specifies the maps instance
|
|
12206
12574
|
* @returns {void}
|
|
12207
12575
|
* @private
|
|
12208
12576
|
*/
|
|
12209
|
-
destroy(
|
|
12210
|
-
|
|
12211
|
-
* Destroy method performed here
|
|
12212
|
-
*/
|
|
12577
|
+
destroy() {
|
|
12578
|
+
this.highlightSettings = null;
|
|
12213
12579
|
this.removeEventListener();
|
|
12580
|
+
this.maps = null;
|
|
12214
12581
|
}
|
|
12215
12582
|
}
|
|
12216
12583
|
|
|
@@ -12230,7 +12597,6 @@ class Selection {
|
|
|
12230
12597
|
addEventListener() {
|
|
12231
12598
|
if (!this.maps.isDestroyed) {
|
|
12232
12599
|
this.maps.on(click, this.mouseClick, this);
|
|
12233
|
-
this.maps.on(Browser.touchEndEvent, this.mouseClick, this);
|
|
12234
12600
|
}
|
|
12235
12601
|
}
|
|
12236
12602
|
/**
|
|
@@ -12243,7 +12609,6 @@ class Selection {
|
|
|
12243
12609
|
return;
|
|
12244
12610
|
}
|
|
12245
12611
|
this.maps.off(click, this.mouseClick);
|
|
12246
|
-
this.maps.off(Browser.touchEndEvent, this.mouseClick);
|
|
12247
12612
|
}
|
|
12248
12613
|
mouseClick(targetElement) {
|
|
12249
12614
|
if (!isNullOrUndefined(targetElement['type']) && targetElement['type'].indexOf('touch') !== -1 &&
|
|
@@ -12261,8 +12626,12 @@ class Selection {
|
|
|
12261
12626
|
const layerIndex = parseInt(targetElement.id.split('_LayerIndex_')[1].split('_')[0], 10);
|
|
12262
12627
|
if (targetElement.id.indexOf('shapeIndex') > -1) {
|
|
12263
12628
|
shapeIndex = parseInt(targetElement.id.split('_shapeIndex_')[1].split('_')[0], 10);
|
|
12264
|
-
shapeData = this.maps.layers[layerIndex].shapeData['features']
|
|
12265
|
-
this.maps.layers[layerIndex].shapeData['features'][
|
|
12629
|
+
shapeData = !isNullOrUndefined(this.maps.layers[layerIndex].shapeData['features'])
|
|
12630
|
+
&& this.maps.layers[layerIndex].shapeData['features']['length'] > shapeIndex ?
|
|
12631
|
+
this.maps.layers[layerIndex].shapeData['features'][shapeIndex]['properties'] :
|
|
12632
|
+
!isNullOrUndefined(this.maps.layers[layerIndex].shapeData['geometries'])
|
|
12633
|
+
&& this.maps.layers[layerIndex].shapeData['geometries']['length'] > shapeIndex ?
|
|
12634
|
+
this.maps.layers[layerIndex].shapeData['geometries'][shapeIndex]['properties'] : null;
|
|
12266
12635
|
dataIndex = parseInt(targetElement.id.split('_dataIndex_')[1].split('_')[0], 10);
|
|
12267
12636
|
data = isNullOrUndefined(dataIndex) ? null : this.maps.layers[layerIndex].dataSource[dataIndex];
|
|
12268
12637
|
this.selectionsettings = this.maps.layers[layerIndex].selectionSettings;
|
|
@@ -12342,15 +12711,17 @@ class Selection {
|
|
|
12342
12711
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12343
12712
|
selectMap(targetElement, shapeData, data) {
|
|
12344
12713
|
const layerIndex = parseInt(targetElement.id.split('_LayerIndex_')[1].split('_')[0], 10);
|
|
12714
|
+
const isLineStringShape = targetElement.parentElement.id.indexOf('LineString') > -1;
|
|
12345
12715
|
const selectionsettings = this.selectionsettings;
|
|
12346
12716
|
const border = {
|
|
12347
|
-
color: (
|
|
12348
|
-
width:
|
|
12717
|
+
color: isLineStringShape ? (this.selectionsettings.fill || this.selectionsettings.border.color) : this.selectionsettings.border.color,
|
|
12718
|
+
width: isLineStringShape ? (this.selectionsettings.border.width / this.maps.scale) :
|
|
12719
|
+
(this.selectionsettings.border.width / (this.selectionType === 'Marker' ? 1 : this.maps.scale)),
|
|
12349
12720
|
opacity: this.selectionsettings.border.opacity
|
|
12350
12721
|
};
|
|
12351
12722
|
const eventArgs = {
|
|
12352
12723
|
opacity: this.selectionsettings.opacity,
|
|
12353
|
-
fill:
|
|
12724
|
+
fill: isLineStringShape ? 'transparent' : (this.selectionType !== 'navigationline' ? this.selectionsettings.fill : 'none'),
|
|
12354
12725
|
border: border,
|
|
12355
12726
|
name: itemSelection,
|
|
12356
12727
|
target: targetElement.id,
|
|
@@ -12362,7 +12733,8 @@ class Selection {
|
|
|
12362
12733
|
this.maps.trigger('itemSelection', eventArgs, (observedArgs) => {
|
|
12363
12734
|
eventArgs.border.opacity = isNullOrUndefined(this.selectionsettings.border.opacity) ? this.selectionsettings.opacity : this.selectionsettings.border.opacity;
|
|
12364
12735
|
if (!eventArgs.cancel) {
|
|
12365
|
-
if (targetElement.getAttribute('class') === this.selectionType + 'selectionMapStyle'
|
|
12736
|
+
if (targetElement.getAttribute('class') === this.selectionType + 'selectionMapStyle'
|
|
12737
|
+
|| targetElement.getAttribute('class') === 'LineselectionMapStyle') {
|
|
12366
12738
|
removeClass(targetElement);
|
|
12367
12739
|
this.removedSelectionList(targetElement);
|
|
12368
12740
|
for (let m = 0; m < this.maps.shapeSelectionItem.length; m++) {
|
|
@@ -12381,14 +12753,23 @@ class Selection {
|
|
|
12381
12753
|
else {
|
|
12382
12754
|
const layetElement = getElementByID(this.maps.element.id + '_Layer_Collections');
|
|
12383
12755
|
if (!this.selectionsettings.enableMultiSelect &&
|
|
12384
|
-
layetElement.getElementsByClassName(this.selectionType + 'selectionMapStyle').length > 0
|
|
12385
|
-
|
|
12756
|
+
(layetElement.getElementsByClassName(this.selectionType + 'selectionMapStyle').length > 0 ||
|
|
12757
|
+
layetElement.getElementsByClassName('LineselectionMapStyle').length > 0)) {
|
|
12758
|
+
let eleCount = layetElement.getElementsByClassName(this.selectionType + 'selectionMapStyle').length;
|
|
12386
12759
|
let ele;
|
|
12387
12760
|
for (let k = 0; k < eleCount; k++) {
|
|
12388
12761
|
ele = layetElement.getElementsByClassName(this.selectionType + 'selectionMapStyle')[0];
|
|
12389
12762
|
removeClass(ele);
|
|
12390
12763
|
this.removedSelectionList(ele);
|
|
12391
12764
|
}
|
|
12765
|
+
if (layetElement.getElementsByClassName('LineselectionMapStyle').length > 0) {
|
|
12766
|
+
eleCount = layetElement.getElementsByClassName('LineselectionMapStyle').length;
|
|
12767
|
+
for (let k = 0; k < eleCount; k++) {
|
|
12768
|
+
ele = layetElement.getElementsByClassName('LineselectionMapStyle')[0];
|
|
12769
|
+
removeClass(ele);
|
|
12770
|
+
this.removedSelectionList(ele);
|
|
12771
|
+
}
|
|
12772
|
+
}
|
|
12392
12773
|
if (this.selectionType === 'Shape') {
|
|
12393
12774
|
this.maps.shapeSelectionItem = [];
|
|
12394
12775
|
const selectionLength = this.maps.selectedElementId.length;
|
|
@@ -12406,13 +12787,24 @@ class Selection {
|
|
|
12406
12787
|
ele.setAttribute('stroke', this.maps.layers[layerIndex].navigationLineSettings[index].color);
|
|
12407
12788
|
}
|
|
12408
12789
|
}
|
|
12409
|
-
if (!
|
|
12410
|
-
|
|
12790
|
+
if (!isLineStringShape) {
|
|
12791
|
+
if (!getElement(this.selectionType + 'selectionMap')) {
|
|
12792
|
+
document.body.appendChild(createStyle(this.selectionType + 'selectionMap', this.selectionType + 'selectionMapStyle', eventArgs));
|
|
12793
|
+
}
|
|
12794
|
+
else {
|
|
12795
|
+
customizeStyle(this.selectionType + 'selectionMap', this.selectionType + 'selectionMapStyle', eventArgs);
|
|
12796
|
+
}
|
|
12797
|
+
targetElement.setAttribute('class', this.selectionType + 'selectionMapStyle');
|
|
12411
12798
|
}
|
|
12412
12799
|
else {
|
|
12413
|
-
|
|
12800
|
+
if (!getElement('LineselectionMap')) {
|
|
12801
|
+
document.body.appendChild(createStyle('LineselectionMap', 'LineselectionMapStyle', eventArgs));
|
|
12802
|
+
}
|
|
12803
|
+
else {
|
|
12804
|
+
customizeStyle('LineselectionMap', 'LineselectionMapStyle', eventArgs);
|
|
12805
|
+
}
|
|
12806
|
+
targetElement.setAttribute('class', 'LineselectionMapStyle');
|
|
12414
12807
|
}
|
|
12415
|
-
targetElement.setAttribute('class', this.selectionType + 'selectionMapStyle');
|
|
12416
12808
|
if (targetElement.getAttribute('class') === 'ShapeselectionMapStyle') {
|
|
12417
12809
|
this.maps.shapeSelectionClass = getElement(this.selectionType + 'selectionMap');
|
|
12418
12810
|
this.maps.selectedElementId.push(targetElement.getAttribute('id'));
|
|
@@ -12481,15 +12873,13 @@ class Selection {
|
|
|
12481
12873
|
/**
|
|
12482
12874
|
* To destroy the selection.
|
|
12483
12875
|
*
|
|
12484
|
-
* @param {Maps} maps - Specifies the maps instance.
|
|
12485
12876
|
* @returns {void}
|
|
12486
12877
|
* @private
|
|
12487
12878
|
*/
|
|
12488
|
-
destroy(
|
|
12489
|
-
|
|
12490
|
-
* Destroy method performed here
|
|
12491
|
-
*/
|
|
12879
|
+
destroy() {
|
|
12880
|
+
this.selectionsettings = null;
|
|
12492
12881
|
this.removeEventListener();
|
|
12882
|
+
this.maps = null;
|
|
12493
12883
|
}
|
|
12494
12884
|
}
|
|
12495
12885
|
|
|
@@ -12672,7 +13062,7 @@ class MapsTooltip {
|
|
|
12672
13062
|
options: tooltipOption,
|
|
12673
13063
|
fill: option.fill,
|
|
12674
13064
|
maps: this.maps,
|
|
12675
|
-
element: target, eventArgs: e
|
|
13065
|
+
element: target, eventArgs: e, content: !isNullOrUndefined(currentData) ? currentData.toString() : ''
|
|
12676
13066
|
};
|
|
12677
13067
|
this.maps.trigger(tooltipRender, tooltipArgs, (args) => {
|
|
12678
13068
|
if (!tooltipArgs.cancel && option.visible && !isNullOrUndefined(currentData) &&
|
|
@@ -12690,7 +13080,7 @@ class MapsTooltip {
|
|
|
12690
13080
|
header: '',
|
|
12691
13081
|
data: option['data'],
|
|
12692
13082
|
template: option['template'],
|
|
12693
|
-
content: [currentData.toString()],
|
|
13083
|
+
content: tooltipArgs.content.toString() != currentData.toString() ? [tooltipArgs.content.toString()] : [currentData.toString()],
|
|
12694
13084
|
shapes: [],
|
|
12695
13085
|
location: option['location'],
|
|
12696
13086
|
palette: [markerFill],
|
|
@@ -12706,7 +13096,7 @@ class MapsTooltip {
|
|
|
12706
13096
|
header: '',
|
|
12707
13097
|
data: tooltipArgs.options['data'],
|
|
12708
13098
|
template: tooltipArgs.options['template'],
|
|
12709
|
-
content: [currentData.toString()],
|
|
13099
|
+
content: tooltipArgs.content.toString() != currentData.toString() ? [tooltipArgs.content.toString()] : [currentData.toString()],
|
|
12710
13100
|
shapes: [],
|
|
12711
13101
|
location: tooltipArgs.options['location'],
|
|
12712
13102
|
palette: [markerFill],
|
|
@@ -12716,6 +13106,10 @@ class MapsTooltip {
|
|
|
12716
13106
|
fill: tooltipArgs.fill || this.maps.themeStyle.tooltipFillColor
|
|
12717
13107
|
});
|
|
12718
13108
|
}
|
|
13109
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13110
|
+
if (this.maps.isVue || this.maps.isVue3) {
|
|
13111
|
+
this.svgTooltip.controlInstance = this.maps;
|
|
13112
|
+
}
|
|
12719
13113
|
this.svgTooltip.opacity = this.maps.themeStyle.tooltipFillOpacity || this.svgTooltip.opacity;
|
|
12720
13114
|
this.svgTooltip.appendTo(tooltipEle);
|
|
12721
13115
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -12729,9 +13123,7 @@ class MapsTooltip {
|
|
|
12729
13123
|
}
|
|
12730
13124
|
}
|
|
12731
13125
|
else {
|
|
12732
|
-
this.
|
|
12733
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12734
|
-
this.maps.clearTemplate();
|
|
13126
|
+
this.clearTooltip();
|
|
12735
13127
|
}
|
|
12736
13128
|
});
|
|
12737
13129
|
if (this.svgTooltip) {
|
|
@@ -12746,9 +13138,7 @@ class MapsTooltip {
|
|
|
12746
13138
|
});
|
|
12747
13139
|
}
|
|
12748
13140
|
else {
|
|
12749
|
-
this.
|
|
12750
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12751
|
-
this.maps.clearTemplate();
|
|
13141
|
+
this.clearTooltip();
|
|
12752
13142
|
}
|
|
12753
13143
|
}
|
|
12754
13144
|
else {
|
|
@@ -12758,9 +13148,7 @@ class MapsTooltip {
|
|
|
12758
13148
|
this.maps.notify(click, this);
|
|
12759
13149
|
}
|
|
12760
13150
|
else {
|
|
12761
|
-
this.
|
|
12762
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12763
|
-
this.maps.clearTemplate();
|
|
13151
|
+
this.clearTooltip();
|
|
12764
13152
|
}
|
|
12765
13153
|
}
|
|
12766
13154
|
}
|
|
@@ -12804,8 +13192,18 @@ class MapsTooltip {
|
|
|
12804
13192
|
}
|
|
12805
13193
|
}
|
|
12806
13194
|
removeTooltip() {
|
|
13195
|
+
let isTooltipRemoved = false;
|
|
12807
13196
|
if (document.getElementsByClassName('EJ2-maps-Tooltip').length > 0) {
|
|
12808
13197
|
remove(document.getElementsByClassName('EJ2-maps-Tooltip')[0]);
|
|
13198
|
+
isTooltipRemoved = true;
|
|
13199
|
+
}
|
|
13200
|
+
return isTooltipRemoved;
|
|
13201
|
+
}
|
|
13202
|
+
clearTooltip() {
|
|
13203
|
+
const isTooltipRemoved = this.removeTooltip();
|
|
13204
|
+
if (isTooltipRemoved) {
|
|
13205
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13206
|
+
this.maps.clearTemplate();
|
|
12809
13207
|
}
|
|
12810
13208
|
}
|
|
12811
13209
|
// eslint-disable-next-line valid-jsdoc
|
|
@@ -12854,12 +13252,17 @@ class MapsTooltip {
|
|
|
12854
13252
|
/**
|
|
12855
13253
|
* To destroy the tooltip.
|
|
12856
13254
|
*
|
|
12857
|
-
* @param {Maps} maps Specifies the maps instance
|
|
12858
13255
|
* @returns {void}
|
|
12859
13256
|
* @private
|
|
12860
13257
|
*/
|
|
12861
|
-
destroy(
|
|
13258
|
+
destroy() {
|
|
13259
|
+
if (!isNullOrUndefined(this.svgTooltip)) {
|
|
13260
|
+
this.svgTooltip.destroy();
|
|
13261
|
+
}
|
|
13262
|
+
this.svgTooltip = null;
|
|
12862
13263
|
this.removeEventListener();
|
|
13264
|
+
//TODO: Calling the below code throws spec issue.
|
|
13265
|
+
//this.maps = null;
|
|
12863
13266
|
}
|
|
12864
13267
|
}
|
|
12865
13268
|
|
|
@@ -12872,7 +13275,6 @@ class Zoom {
|
|
|
12872
13275
|
this.mouseEnter = false;
|
|
12873
13276
|
this.isTouch = false;
|
|
12874
13277
|
this.rectZoomingStart = false;
|
|
12875
|
-
this.pinchRect = new Rect(0, 0, 0, 0);
|
|
12876
13278
|
this.browserName = Browser.info.name;
|
|
12877
13279
|
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
12878
13280
|
this.isPointer = Browser.isPointer;
|
|
@@ -12881,8 +13283,6 @@ class Zoom {
|
|
|
12881
13283
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12882
13284
|
this.startTouches = [];
|
|
12883
13285
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12884
|
-
this.shapeZoomLocation = [];
|
|
12885
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12886
13286
|
this.intersect = [];
|
|
12887
13287
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12888
13288
|
this.mouseDownLatLong = { x: 0, y: 0 };
|
|
@@ -12898,7 +13298,6 @@ class Zoom {
|
|
|
12898
13298
|
this.selectionColor = this.maps.zoomSettings.selectionColor;
|
|
12899
13299
|
this.fillColor = this.maps.zoomSettings.color;
|
|
12900
13300
|
this.addEventListener();
|
|
12901
|
-
this.groupElements = [];
|
|
12902
13301
|
}
|
|
12903
13302
|
/**
|
|
12904
13303
|
* To perform zooming for maps
|
|
@@ -12921,24 +13320,43 @@ class Zoom {
|
|
|
12921
13320
|
const minZoom = map.zoomSettings.minZoom;
|
|
12922
13321
|
newZoomFactor = (minZoom > newZoomFactor && type === 'ZoomIn') ? minZoom + 1 : newZoomFactor;
|
|
12923
13322
|
const prevTilePoint = map.tileTranslatePoint;
|
|
12924
|
-
if ((!map.isTileMap) && (type === 'ZoomIn' ? newZoomFactor >= minZoom && newZoomFactor <= maxZoom : newZoomFactor >= minZoom)
|
|
13323
|
+
if ((!map.isTileMap) && ((type === 'ZoomIn' ? newZoomFactor >= minZoom && newZoomFactor <= maxZoom : newZoomFactor >= minZoom)
|
|
13324
|
+
|| map.isReset)) {
|
|
12925
13325
|
const availSize = map.mapAreaRect;
|
|
12926
13326
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12927
13327
|
const minBounds = map.baseMapRectBounds['min'];
|
|
12928
13328
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12929
13329
|
const maxBounds = map.baseMapRectBounds['max'];
|
|
12930
|
-
|
|
12931
|
-
|
|
12932
|
-
|
|
12933
|
-
let
|
|
12934
|
-
|
|
12935
|
-
|
|
12936
|
-
|
|
12937
|
-
|
|
12938
|
-
|
|
13330
|
+
let mapTotalWidth = Math.abs(minBounds['x'] - maxBounds['x']);
|
|
13331
|
+
let mapTotalHeight = Math.abs(minBounds['y'] - maxBounds['y']);
|
|
13332
|
+
let translatePointX;
|
|
13333
|
+
let translatePointY;
|
|
13334
|
+
if (newZoomFactor < 1.2 && map.projectionType !== 'Eckert5') {
|
|
13335
|
+
if (mapTotalWidth === 0 || mapTotalHeight === 0 || mapTotalWidth === mapTotalHeight) {
|
|
13336
|
+
mapTotalWidth = availSize.width / 2;
|
|
13337
|
+
mapTotalHeight = availSize.height;
|
|
13338
|
+
}
|
|
13339
|
+
newZoomFactor = parseFloat(Math.min(availSize.width / mapTotalWidth, availSize.height / mapTotalHeight).toFixed(2));
|
|
13340
|
+
newZoomFactor = newZoomFactor > 1.05 ? 1 : newZoomFactor;
|
|
13341
|
+
map.translatePoint = this.calculateInitalZoomTranslatePoint(newZoomFactor, mapTotalWidth, mapTotalHeight, availSize, minBounds, map);
|
|
13342
|
+
}
|
|
13343
|
+
else {
|
|
13344
|
+
const point = map.translatePoint;
|
|
13345
|
+
translatePointX = point.x - (((availSize.width / scale) - (availSize.width / newZoomFactor)) / (availSize.width / position.x));
|
|
13346
|
+
translatePointY = point.y - (((availSize.height / scale) - (availSize.height / newZoomFactor)) / (availSize.height / position.y));
|
|
13347
|
+
const currentHeight = Math.abs(map.baseMapRectBounds['max']['y'] - map.baseMapRectBounds['min']['y']) * newZoomFactor;
|
|
13348
|
+
translatePointX = (currentHeight < map.mapAreaRect.height) ? (availSize.x + ((-(minBounds['x'])) + ((availSize.width / 2) - (mapTotalWidth / 2)))) : translatePointX;
|
|
13349
|
+
translatePointY = (currentHeight < map.mapAreaRect.height) ? (availSize.y + ((-(minBounds['y'])) + ((availSize.height / 2) - (mapTotalHeight / 2)))) : translatePointY;
|
|
13350
|
+
map.translatePoint = new Point(translatePointX, translatePointY);
|
|
13351
|
+
}
|
|
12939
13352
|
map.scale = newZoomFactor;
|
|
12940
|
-
this.triggerZoomEvent(prevTilePoint, prevLevel, type)
|
|
12941
|
-
|
|
13353
|
+
if (this.triggerZoomEvent(prevTilePoint, prevLevel, type)) {
|
|
13354
|
+
map.translatePoint = map.previousPoint;
|
|
13355
|
+
map.scale = map.mapScaleValue = map.previousScale;
|
|
13356
|
+
}
|
|
13357
|
+
else {
|
|
13358
|
+
this.applyTransform(map);
|
|
13359
|
+
}
|
|
12942
13360
|
}
|
|
12943
13361
|
else if ((map.isTileMap) && (newZoomFactor >= minZoom && newZoomFactor <= maxZoom)) {
|
|
12944
13362
|
this.getTileTranslatePosition(prevLevel, newZoomFactor, position, type);
|
|
@@ -12955,34 +13373,49 @@ class Zoom {
|
|
|
12955
13373
|
}
|
|
12956
13374
|
map.translatePoint.y = (map.tileTranslatePoint.y - (0.01 * map.mapScaleValue)) / map.scale;
|
|
12957
13375
|
map.translatePoint.x = (map.tileTranslatePoint.x - (0.01 * map.mapScaleValue)) / map.scale;
|
|
12958
|
-
this.triggerZoomEvent(prevTilePoint, prevLevel, type)
|
|
12959
|
-
|
|
12960
|
-
|
|
12961
|
-
|
|
12962
|
-
|
|
12963
|
-
document.getElementById(this.maps.element.id + '_LayerIndex_1').style.display = 'none';
|
|
13376
|
+
if (this.triggerZoomEvent(prevTilePoint, prevLevel, type)) {
|
|
13377
|
+
map.translatePoint = map.tileTranslatePoint = new Point(0, 0);
|
|
13378
|
+
map.scale = map.previousScale;
|
|
13379
|
+
map.tileZoomLevel = prevLevel;
|
|
13380
|
+
map.zoomSettings.zoomFactor = map.previousScale;
|
|
12964
13381
|
}
|
|
12965
|
-
|
|
12966
|
-
|
|
12967
|
-
|
|
12968
|
-
|
|
12969
|
-
setTimeout(() => {
|
|
12970
|
-
// if (type === 'ZoomOut') {
|
|
12971
|
-
// element1.removeChild(element1.children[element1.childElementCount - 1]);
|
|
12972
|
-
// if (element1.childElementCount) {
|
|
12973
|
-
// element1.removeChild(element1.children[element1.childElementCount - 1]);
|
|
12974
|
-
// } else {
|
|
12975
|
-
// element1 = element1;
|
|
12976
|
-
// }
|
|
12977
|
-
// }
|
|
12978
|
-
this.applyTransform();
|
|
13382
|
+
else {
|
|
13383
|
+
if (document.querySelector('.GroupElement')) {
|
|
13384
|
+
document.querySelector('.GroupElement').style.display = 'none';
|
|
13385
|
+
}
|
|
12979
13386
|
if (document.getElementById(this.maps.element.id + '_LayerIndex_1')) {
|
|
12980
|
-
document.getElementById(this.maps.element.id + '_LayerIndex_1').style.display = '
|
|
13387
|
+
document.getElementById(this.maps.element.id + '_LayerIndex_1').style.display = 'none';
|
|
12981
13388
|
}
|
|
12982
|
-
|
|
13389
|
+
this.markerLineAnimation(map);
|
|
13390
|
+
map.mapLayerPanel.generateTiles(newZoomFactor, map.tileTranslatePoint, type + 'wheel', null, position);
|
|
13391
|
+
const element1 = document.getElementById(this.maps.element.id + '_tiles');
|
|
13392
|
+
const animationDuration = this.maps.layersCollection[0].animationDuration;
|
|
13393
|
+
setTimeout(() => {
|
|
13394
|
+
// if (type === 'ZoomOut') {
|
|
13395
|
+
// element1.removeChild(element1.children[element1.childElementCount - 1]);
|
|
13396
|
+
// if (element1.childElementCount) {
|
|
13397
|
+
// element1.removeChild(element1.children[element1.childElementCount - 1]);
|
|
13398
|
+
// } else {
|
|
13399
|
+
// element1 = element1;
|
|
13400
|
+
// }
|
|
13401
|
+
// }
|
|
13402
|
+
this.applyTransform(this.maps);
|
|
13403
|
+
if (document.getElementById(this.maps.element.id + '_LayerIndex_1')) {
|
|
13404
|
+
document.getElementById(this.maps.element.id + '_LayerIndex_1').style.display = 'block';
|
|
13405
|
+
}
|
|
13406
|
+
}, animationDuration);
|
|
13407
|
+
}
|
|
12983
13408
|
}
|
|
12984
13409
|
this.maps.zoomNotApplied = false;
|
|
12985
13410
|
}
|
|
13411
|
+
calculateInitalZoomTranslatePoint(newZoomFactor, mapTotalWidth, mapTotalHeight, availSize, minBounds, map) {
|
|
13412
|
+
mapTotalWidth *= newZoomFactor;
|
|
13413
|
+
mapTotalHeight *= newZoomFactor;
|
|
13414
|
+
let widthDiff = minBounds['x'] !== 0 && map.translateType === 'layers' ? map.availableSize.width - availSize.width : 0;
|
|
13415
|
+
var translatePointX = availSize.x + ((-(minBounds['x'])) + ((availSize.width / 2) - (mapTotalWidth / 2))) - widthDiff;
|
|
13416
|
+
var translatePointY = availSize.y + ((-(minBounds['y'])) + ((availSize.height / 2) - (mapTotalHeight / 2)));
|
|
13417
|
+
return new Point(translatePointX, translatePointY);
|
|
13418
|
+
}
|
|
12986
13419
|
triggerZoomEvent(prevTilePoint, prevLevel, type) {
|
|
12987
13420
|
const map = this.maps;
|
|
12988
13421
|
let zoomArgs;
|
|
@@ -13001,6 +13434,7 @@ class Zoom {
|
|
|
13001
13434
|
};
|
|
13002
13435
|
}
|
|
13003
13436
|
map.trigger('zoom', zoomArgs);
|
|
13437
|
+
return zoomArgs.cancel;
|
|
13004
13438
|
}
|
|
13005
13439
|
getTileTranslatePosition(prevLevel, currentLevel, position, type) {
|
|
13006
13440
|
const map = this.maps;
|
|
@@ -13026,6 +13460,7 @@ class Zoom {
|
|
|
13026
13460
|
const zoomRect = this.zoomingRect;
|
|
13027
13461
|
const maxZoom = map.zoomSettings.maxZoom;
|
|
13028
13462
|
const minZoom = map.zoomSettings.minZoom;
|
|
13463
|
+
let isZoomCancelled;
|
|
13029
13464
|
if (zoomRect.height > 0 && zoomRect.width > 0) {
|
|
13030
13465
|
const x = this.zoomingRect.x + (this.zoomingRect.width / 2);
|
|
13031
13466
|
const y = this.zoomingRect.y + (this.zoomingRect.height / 2);
|
|
@@ -13038,7 +13473,11 @@ class Zoom {
|
|
|
13038
13473
|
const translatePointY = translatePoint.y - (((size.height / scale) - (size.height / zoomCalculationFactor)) / (size.height / y));
|
|
13039
13474
|
map.translatePoint = new Point(translatePointX, translatePointY);
|
|
13040
13475
|
map.scale = zoomCalculationFactor;
|
|
13041
|
-
this.triggerZoomEvent(prevTilePoint, prevLevel, '');
|
|
13476
|
+
isZoomCancelled = this.triggerZoomEvent(prevTilePoint, prevLevel, '');
|
|
13477
|
+
if (isZoomCancelled) {
|
|
13478
|
+
map.translatePoint = map.previousPoint;
|
|
13479
|
+
map.scale = map.previousScale;
|
|
13480
|
+
}
|
|
13042
13481
|
}
|
|
13043
13482
|
else {
|
|
13044
13483
|
zoomCalculationFactor = prevLevel + (Math.round(prevLevel + (((size.width / zoomRect.width) + (size.height / zoomRect.height)) / 2)));
|
|
@@ -13051,13 +13490,21 @@ class Zoom {
|
|
|
13051
13490
|
map.translatePoint.y = (map.tileTranslatePoint.y - (0.5 * Math.pow(2, zoomCalculationFactor))) /
|
|
13052
13491
|
(Math.pow(2, zoomCalculationFactor));
|
|
13053
13492
|
map.scale = (Math.pow(2, zoomCalculationFactor));
|
|
13054
|
-
this.triggerZoomEvent(prevTilePoint, prevLevel, '');
|
|
13055
|
-
|
|
13493
|
+
isZoomCancelled = this.triggerZoomEvent(prevTilePoint, prevLevel, '');
|
|
13494
|
+
if (isZoomCancelled) {
|
|
13495
|
+
map.translatePoint = map.tileTranslatePoint = new Point(0, 0);
|
|
13496
|
+
map.scale = map.tileZoomLevel = map.zoomSettings.zoomFactor = prevLevel;
|
|
13497
|
+
}
|
|
13498
|
+
else {
|
|
13499
|
+
map.mapLayerPanel.generateTiles(zoomCalculationFactor, map.tileTranslatePoint);
|
|
13500
|
+
}
|
|
13501
|
+
}
|
|
13502
|
+
if (!isZoomCancelled) {
|
|
13503
|
+
map.mapScaleValue = zoomCalculationFactor;
|
|
13504
|
+
this.applyTransform(map, true);
|
|
13505
|
+
this.maps.zoomNotApplied = false;
|
|
13506
|
+
this.zoomingRect = null;
|
|
13056
13507
|
}
|
|
13057
|
-
map.mapScaleValue = zoomCalculationFactor;
|
|
13058
|
-
this.applyTransform(true);
|
|
13059
|
-
this.maps.zoomNotApplied = false;
|
|
13060
|
-
this.zoomingRect = null;
|
|
13061
13508
|
}
|
|
13062
13509
|
}
|
|
13063
13510
|
setInteraction(newInteraction) {
|
|
@@ -13085,23 +13532,41 @@ class Zoom {
|
|
|
13085
13532
|
this.lastScale = scale;
|
|
13086
13533
|
this.pinchFactor *= newScale;
|
|
13087
13534
|
this.pinchFactor = Math.min(this.maps.zoomSettings.maxZoom, Math.max(this.pinchFactor, this.maps.zoomSettings.minZoom));
|
|
13088
|
-
|
|
13535
|
+
let zoomCalculationFactor = this.pinchFactor;
|
|
13536
|
+
let isZoomCancelled;
|
|
13089
13537
|
if (!map.isTileMap) {
|
|
13090
13538
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13091
13539
|
const minBounds = map.baseMapRectBounds['min'];
|
|
13092
13540
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13093
13541
|
const maxBounds = map.baseMapRectBounds['max'];
|
|
13094
|
-
|
|
13095
|
-
|
|
13542
|
+
let mapTotalHeight = Math.abs(minBounds['y'] - maxBounds['y']);
|
|
13543
|
+
let mapTotalWidth = Math.abs(minBounds['x'] - maxBounds['x']);
|
|
13096
13544
|
const translatePoint = map.translatePoint;
|
|
13097
|
-
|
|
13098
|
-
let
|
|
13099
|
-
|
|
13100
|
-
|
|
13101
|
-
|
|
13102
|
-
|
|
13545
|
+
let translatePointX;
|
|
13546
|
+
let translatePointY;
|
|
13547
|
+
if (zoomCalculationFactor < 1.2 && map.projectionType !== 'Eckert5') {
|
|
13548
|
+
if (mapTotalWidth === 0 || mapTotalHeight === 0 || mapTotalWidth === mapTotalHeight) {
|
|
13549
|
+
mapTotalWidth = availSize.width / 2;
|
|
13550
|
+
mapTotalHeight = availSize.height;
|
|
13551
|
+
}
|
|
13552
|
+
zoomCalculationFactor = parseFloat(Math.min(availSize.width / mapTotalWidth, availSize.height / mapTotalHeight).toFixed(2));
|
|
13553
|
+
zoomCalculationFactor = zoomCalculationFactor > 1.05 ? 1 : zoomCalculationFactor;
|
|
13554
|
+
map.translatePoint = this.calculateInitalZoomTranslatePoint(zoomCalculationFactor, mapTotalWidth, mapTotalHeight, availSize, minBounds, map);
|
|
13555
|
+
}
|
|
13556
|
+
else {
|
|
13557
|
+
const currentHeight = Math.abs(map.baseMapRectBounds['max']['y'] - map.baseMapRectBounds['min']['y']) * zoomCalculationFactor;
|
|
13558
|
+
translatePointX = translatePoint.x - (((availSize.width / map.scale) - (availSize.width / zoomCalculationFactor)) / (availSize.width / touchCenter.x));
|
|
13559
|
+
translatePointY = translatePoint.y - (((availSize.height / map.scale) - (availSize.height / zoomCalculationFactor)) / (availSize.height / touchCenter.y));
|
|
13560
|
+
translatePointX = (currentHeight < map.mapAreaRect.height) ? (availSize.x + ((-(minBounds['x'])) + ((availSize.width / 2) - (mapTotalWidth / 2)))) : translatePointX;
|
|
13561
|
+
translatePointY = (currentHeight < map.mapAreaRect.height) ? (availSize.y + ((-(minBounds['y'])) + ((availSize.height / 2) - (mapTotalHeight / 2)))) : translatePointY;
|
|
13562
|
+
map.translatePoint = new Point(translatePointX, translatePointY);
|
|
13563
|
+
}
|
|
13103
13564
|
map.scale = zoomCalculationFactor;
|
|
13104
|
-
this.triggerZoomEvent(prevTilePoint, prevLevel, '');
|
|
13565
|
+
isZoomCancelled = this.triggerZoomEvent(prevTilePoint, prevLevel, '');
|
|
13566
|
+
if (isZoomCancelled) {
|
|
13567
|
+
map.translatePoint = map.previousPoint;
|
|
13568
|
+
map.scale = map.previousScale;
|
|
13569
|
+
}
|
|
13105
13570
|
}
|
|
13106
13571
|
else {
|
|
13107
13572
|
const newTileFactor = zoomCalculationFactor;
|
|
@@ -13112,10 +13577,20 @@ class Zoom {
|
|
|
13112
13577
|
map.translatePoint.y = (map.tileTranslatePoint.y - (0.5 * Math.pow(2, newTileFactor))) /
|
|
13113
13578
|
(Math.pow(2, newTileFactor));
|
|
13114
13579
|
map.scale = (Math.pow(2, newTileFactor));
|
|
13115
|
-
this.triggerZoomEvent(prevTilePoint, prevLevel, '');
|
|
13116
|
-
|
|
13580
|
+
isZoomCancelled = this.triggerZoomEvent(prevTilePoint, prevLevel, '');
|
|
13581
|
+
if (isZoomCancelled) {
|
|
13582
|
+
map.translatePoint = map.tileTranslatePoint = new Point(0, 0);
|
|
13583
|
+
map.scale = map.previousScale;
|
|
13584
|
+
map.tileZoomLevel = prevLevel;
|
|
13585
|
+
map.zoomSettings.zoomFactor = map.previousScale;
|
|
13586
|
+
}
|
|
13587
|
+
else {
|
|
13588
|
+
map.mapLayerPanel.generateTiles(newTileFactor, map.tileTranslatePoint);
|
|
13589
|
+
}
|
|
13590
|
+
}
|
|
13591
|
+
if (!isZoomCancelled) {
|
|
13592
|
+
this.applyTransform(map);
|
|
13117
13593
|
}
|
|
13118
|
-
this.applyTransform();
|
|
13119
13594
|
}
|
|
13120
13595
|
drawZoomRectangle() {
|
|
13121
13596
|
const map = this.maps;
|
|
@@ -13161,17 +13636,17 @@ class Zoom {
|
|
|
13161
13636
|
zoomAnimate(element, 0, duration, new MapLocation(x, y), scale, this.maps.mapAreaRect, this.maps);
|
|
13162
13637
|
}
|
|
13163
13638
|
}
|
|
13164
|
-
applyTransform(animate$$1) {
|
|
13639
|
+
applyTransform(maps, animate$$1) {
|
|
13165
13640
|
let layerIndex;
|
|
13166
13641
|
this.templateCount = 0;
|
|
13167
13642
|
let markerStyle;
|
|
13168
|
-
const scale =
|
|
13169
|
-
const x =
|
|
13170
|
-
const y =
|
|
13643
|
+
const scale = maps.scale;
|
|
13644
|
+
const x = maps.translatePoint.x;
|
|
13645
|
+
const y = maps.translatePoint.y;
|
|
13171
13646
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13172
|
-
|
|
13173
|
-
if (document.getElementById(
|
|
13174
|
-
removeElement(
|
|
13647
|
+
maps.zoomShapeCollection = [];
|
|
13648
|
+
if (document.getElementById(maps.element.id + '_mapsTooltip')) {
|
|
13649
|
+
removeElement(maps.element.id + '_mapsTooltip');
|
|
13175
13650
|
}
|
|
13176
13651
|
if (this.layerCollectionEle) {
|
|
13177
13652
|
for (let i = 0; i < this.layerCollectionEle.childElementCount; i++) {
|
|
@@ -13179,30 +13654,29 @@ class Zoom {
|
|
|
13179
13654
|
if (layerElement.tagName === 'g') {
|
|
13180
13655
|
this.templateCount++;
|
|
13181
13656
|
this.index = layerElement.id.indexOf('_LayerIndex_') > -1 && parseFloat(layerElement.id.split('_LayerIndex_')[1].split('_')[0]);
|
|
13182
|
-
this.currentLayer =
|
|
13183
|
-
const factor =
|
|
13657
|
+
this.currentLayer = maps.layersCollection[this.index];
|
|
13658
|
+
const factor = maps.mapLayerPanel.calculateFactor(this.currentLayer);
|
|
13184
13659
|
for (let j = 0; j < layerElement.childElementCount; j++) {
|
|
13185
13660
|
let currentEle = layerElement.childNodes[j];
|
|
13186
13661
|
if (!(currentEle.id.indexOf('_Markers_Group') > -1) && (!(currentEle.id.indexOf('_bubble_Group') > -1))
|
|
13187
13662
|
&& (!(currentEle.id.indexOf('_dataLableIndex_Group') > -1))) {
|
|
13188
|
-
if (
|
|
13663
|
+
if (maps.isTileMap && (currentEle.id.indexOf('_line_Group') > -1)) {
|
|
13189
13664
|
currentEle.remove();
|
|
13190
13665
|
if (layerElement.children.length > 0 && layerElement.children[0]) {
|
|
13191
|
-
layerElement.insertBefore(
|
|
13666
|
+
layerElement.insertBefore(maps.navigationLineModule.renderNavigation(this.currentLayer, maps.tileZoomLevel, this.index), layerElement.children[1]);
|
|
13192
13667
|
}
|
|
13193
13668
|
else {
|
|
13194
|
-
layerElement.appendChild(
|
|
13669
|
+
layerElement.appendChild(maps.navigationLineModule.renderNavigation(this.currentLayer, maps.tileZoomLevel, this.index));
|
|
13195
13670
|
}
|
|
13196
13671
|
}
|
|
13197
|
-
else {
|
|
13198
|
-
changeBorderWidth(currentEle, this.index, scale,
|
|
13199
|
-
|
|
13672
|
+
else if (currentEle.id.indexOf('Legend') == -1) {
|
|
13673
|
+
changeBorderWidth(currentEle, this.index, scale, maps);
|
|
13674
|
+
maps.zoomTranslatePoint = maps.translatePoint;
|
|
13200
13675
|
this.animateTransform(currentEle, animate$$1, x, y, scale);
|
|
13201
|
-
this.shapeZoomLocation = currentEle.childNodes;
|
|
13202
13676
|
}
|
|
13203
13677
|
}
|
|
13204
13678
|
else if (currentEle.id.indexOf('_Markers_Group') > -1) {
|
|
13205
|
-
if (!this.isPanning) {
|
|
13679
|
+
if (!this.isPanning && !isNullOrUndefined(currentEle.childNodes[0])) {
|
|
13206
13680
|
this.markerTranslates(currentEle.childNodes[0], factor, x, y, scale, 'Marker', layerElement, animate$$1);
|
|
13207
13681
|
}
|
|
13208
13682
|
currentEle = layerElement.childNodes[j];
|
|
@@ -13221,11 +13695,11 @@ class Zoom {
|
|
|
13221
13695
|
markerSelectionValues['latitude'] ||
|
|
13222
13696
|
this.currentLayer.markerSettings[markerIndex].initialMarkerSelection[x]['longitude'] ===
|
|
13223
13697
|
markerSelectionValues['longitude']) {
|
|
13224
|
-
|
|
13698
|
+
maps.markerSelection(this.currentLayer.markerSettings[markerIndex].selectionSettings, maps, currentEle.children[k], this.currentLayer.markerSettings[markerIndex].dataSource[dataIndex]);
|
|
13225
13699
|
}
|
|
13226
13700
|
}
|
|
13227
|
-
if ((this.currentLayer.animationDuration > 0 || (
|
|
13228
|
-
if (
|
|
13701
|
+
if ((this.currentLayer.animationDuration > 0 || (maps.layersCollection[0].animationDuration > 0 && this.currentLayer.type === 'SubLayer')) && !this.isPanning) {
|
|
13702
|
+
if (maps.isTileMap) {
|
|
13229
13703
|
const groupElement = document.querySelector('.GroupElement');
|
|
13230
13704
|
if (groupElement && !(document.querySelector('.ClusterGroupElement')) && markerAnimation) {
|
|
13231
13705
|
groupElement.style.display = 'none';
|
|
@@ -13237,29 +13711,29 @@ class Zoom {
|
|
|
13237
13711
|
}
|
|
13238
13712
|
}
|
|
13239
13713
|
}
|
|
13240
|
-
if (this.isPanning &&
|
|
13241
|
-
clusterSeparate(
|
|
13714
|
+
if (this.isPanning && maps.markerModule.sameMarkerData.length > 0) {
|
|
13715
|
+
clusterSeparate(maps.markerModule.sameMarkerData, maps, currentEle, true);
|
|
13242
13716
|
}
|
|
13243
|
-
else if (
|
|
13244
|
-
|
|
13245
|
-
if (document.getElementById(
|
|
13246
|
-
removeElement(
|
|
13717
|
+
else if (maps.markerModule.sameMarkerData.length > 0) {
|
|
13718
|
+
maps.markerModule.sameMarkerData = [];
|
|
13719
|
+
if (document.getElementById(maps.element.id + '_mapsTooltip')) {
|
|
13720
|
+
removeElement(maps.element.id + '_mapsTooltip');
|
|
13247
13721
|
}
|
|
13248
13722
|
}
|
|
13249
|
-
if (document.getElementById(
|
|
13723
|
+
if (document.getElementById(maps.element.id + '_mapsTooltip') && maps.mapsTooltipModule.tooltipTargetID.indexOf('_MarkerIndex_')
|
|
13250
13724
|
&& !this.isPanning) {
|
|
13251
|
-
const mapsTooltip =
|
|
13725
|
+
const mapsTooltip = maps.mapsTooltipModule;
|
|
13252
13726
|
const tooltipElement = currentEle.querySelector('#' + mapsTooltip.tooltipTargetID);
|
|
13253
13727
|
if (!isNullOrUndefined(tooltipElement)) {
|
|
13254
13728
|
if (tooltipElement['style']['visibility'] === 'hidden') {
|
|
13255
|
-
removeElement(
|
|
13729
|
+
removeElement(maps.element.id + '_mapsTooltip');
|
|
13256
13730
|
}
|
|
13257
13731
|
else {
|
|
13258
13732
|
let x = parseFloat(tooltipElement.getAttribute('transform').split('(')[1].split(')')[0].split(' ')[1]);
|
|
13259
13733
|
let y = parseFloat(tooltipElement.getAttribute('transform').split('(')[1].split(')')[0].split(' ')[2]);
|
|
13260
|
-
if (
|
|
13261
|
-
x += +getElement(
|
|
13262
|
-
y += +getElement(
|
|
13734
|
+
if (maps.isTileMap) {
|
|
13735
|
+
x += +getElement(maps.element.id + '_tile_parent')['style']['left'].split('px')[0];
|
|
13736
|
+
y += +getElement(maps.element.id + '_tile_parent')['style']['top'].split('px')[0];
|
|
13263
13737
|
}
|
|
13264
13738
|
mapsTooltip.svgTooltip.location.x = x;
|
|
13265
13739
|
mapsTooltip.svgTooltip.location.y = y;
|
|
@@ -13277,9 +13751,9 @@ class Zoom {
|
|
|
13277
13751
|
layerIndex = parseFloat(childElement.id.split('_LayerIndex_')[1].split('_')[0]);
|
|
13278
13752
|
const bubleIndex = parseFloat(childElement.id.split('_BubbleIndex_')[1].split('_')[0]);
|
|
13279
13753
|
const dataIndex = parseFloat(childElement.id.split('_BubbleIndex_')[1].split('_')[2]);
|
|
13280
|
-
for (let l = 0; l <
|
|
13754
|
+
for (let l = 0; l < maps.bubbleModule.bubbleCollection.length; l++) {
|
|
13281
13755
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13282
|
-
const bubbleCollection =
|
|
13756
|
+
const bubbleCollection = maps.bubbleModule.bubbleCollection[l];
|
|
13283
13757
|
if (bubbleCollection['LayerIndex'] === layerIndex && bubbleCollection['BubbleIndex'] === bubleIndex &&
|
|
13284
13758
|
bubbleCollection['DataIndex'] === dataIndex) {
|
|
13285
13759
|
const centerX = bubbleCollection['center']['x'];
|
|
@@ -13298,24 +13772,25 @@ class Zoom {
|
|
|
13298
13772
|
}
|
|
13299
13773
|
}
|
|
13300
13774
|
}
|
|
13301
|
-
else if (currentEle.id.indexOf('_dataLableIndex_Group') > -1) {
|
|
13775
|
+
else if (currentEle.id.indexOf('_dataLableIndex_Group') > -1 && !isNullOrUndefined(maps.layers[this.index])) {
|
|
13302
13776
|
this.intersect = [];
|
|
13303
|
-
|
|
13304
|
-
|
|
13777
|
+
maps.zoomLabelPositions = [];
|
|
13778
|
+
maps.zoomLabelPositions = maps.dataLabelModule.dataLabelCollections;
|
|
13779
|
+
let labelAnimate = !maps.isTileMap && animate$$1;
|
|
13305
13780
|
for (let k = 0; k < currentEle.childElementCount; k++) {
|
|
13306
13781
|
if (currentEle.childNodes[k]['id'].indexOf('_LabelIndex_') > -1) {
|
|
13307
13782
|
const labelIndex = parseFloat(currentEle.childNodes[k]['id'].split('_LabelIndex_')[1].split('_')[0]);
|
|
13308
|
-
this.zoomshapewidth =
|
|
13309
|
-
|
|
13310
|
-
this.dataLabelTranslate(currentEle.childNodes[k], factor, x, y, scale, 'DataLabel',
|
|
13311
|
-
const dataLabel =
|
|
13783
|
+
this.zoomshapewidth = currentEle.childNodes[k].getBoundingClientRect();
|
|
13784
|
+
maps.zoomShapeCollection.push(this.zoomshapewidth);
|
|
13785
|
+
this.dataLabelTranslate(currentEle.childNodes[k], factor, x, y, scale, 'DataLabel', labelAnimate);
|
|
13786
|
+
const dataLabel = maps.layers[this.index].dataLabelSettings;
|
|
13312
13787
|
const border = dataLabel.border;
|
|
13313
13788
|
if (k > 0 && border['width'] > 1) {
|
|
13314
|
-
if (currentEle.childNodes[k - 1]['id'].indexOf('_rectIndex_') > -1) {
|
|
13315
|
-
const labelX = ((
|
|
13316
|
-
const labelY = ((
|
|
13789
|
+
if (currentEle.childNodes[k - 1]['id'].indexOf('_rectIndex_') > -1 && !isNullOrUndefined(maps.zoomLabelPositions[labelIndex])) {
|
|
13790
|
+
const labelX = ((maps.zoomLabelPositions[labelIndex]['location']['x'] + x) * scale);
|
|
13791
|
+
const labelY = ((maps.zoomLabelPositions[labelIndex]['location']['y'] + y) * scale);
|
|
13317
13792
|
const zoomtext = currentEle.childNodes[k]['innerHTML'];
|
|
13318
|
-
const style =
|
|
13793
|
+
const style = maps.layers[this.index].dataLabelSettings.textStyle;
|
|
13319
13794
|
const zoomtextSize = measureText(zoomtext, style);
|
|
13320
13795
|
const padding = 5;
|
|
13321
13796
|
const rectElement = currentEle.childNodes[k - 1];
|
|
@@ -13330,11 +13805,11 @@ class Zoom {
|
|
|
13330
13805
|
}
|
|
13331
13806
|
}
|
|
13332
13807
|
}
|
|
13333
|
-
|
|
13808
|
+
maps.arrangeTemplate();
|
|
13334
13809
|
}
|
|
13335
13810
|
if (!isNullOrUndefined(this.currentLayer)) {
|
|
13336
|
-
if (!animate$$1 || this.currentLayer.animationDuration === 0 ||
|
|
13337
|
-
this.processTemplate(x, y, scale,
|
|
13811
|
+
if (!animate$$1 || this.currentLayer.animationDuration === 0 || maps.isTileMap) {
|
|
13812
|
+
this.processTemplate(x, y, scale, maps);
|
|
13338
13813
|
}
|
|
13339
13814
|
}
|
|
13340
13815
|
}
|
|
@@ -13392,10 +13867,10 @@ class Zoom {
|
|
|
13392
13867
|
}
|
|
13393
13868
|
const lati = (!isNullOrUndefined(markerSettings.latitudeValuePath)) ?
|
|
13394
13869
|
Number(getValueFromObject(data, markerSettings.latitudeValuePath)) : !isNullOrUndefined(data['latitude']) ?
|
|
13395
|
-
parseFloat(data['latitude']) : !isNullOrUndefined(data['Latitude']) ? data['Latitude'] :
|
|
13870
|
+
parseFloat(data['latitude']) : !isNullOrUndefined(data['Latitude']) ? data['Latitude'] : null;
|
|
13396
13871
|
const long = (!isNullOrUndefined(markerSettings.longitudeValuePath)) ?
|
|
13397
13872
|
Number(getValueFromObject(data, markerSettings.longitudeValuePath)) : !isNullOrUndefined(data['longitude']) ?
|
|
13398
|
-
parseFloat(data['longitude']) : !isNullOrUndefined(data['Longitude']) ? data['Longitude'] :
|
|
13873
|
+
parseFloat(data['longitude']) : !isNullOrUndefined(data['Longitude']) ? data['Longitude'] : null;
|
|
13399
13874
|
const offset = markerSettings.offset;
|
|
13400
13875
|
if (!eventArgs.cancel && markerSettings.visible && !isNullOrUndefined(long) && !isNullOrUndefined(lati)) {
|
|
13401
13876
|
const markerID = this.maps.element.id + '_LayerIndex_' + layerIndex + '_MarkerIndex_'
|
|
@@ -13415,10 +13890,10 @@ class Zoom {
|
|
|
13415
13890
|
nullCount += (!isNaN(lati) && !isNaN(long)) ? 0 : 1;
|
|
13416
13891
|
markerTemplateCounts += (eventArgs.cancel) ? 1 : 0;
|
|
13417
13892
|
markerCounts += (eventArgs.cancel) ? 1 : 0;
|
|
13418
|
-
this.maps.markerNullCount = (
|
|
13419
|
-
? this.maps.markerNullCount : this.maps.markerNullCount
|
|
13893
|
+
this.maps.markerNullCount = (isNullOrUndefined(lati) || isNullOrUndefined(long))
|
|
13894
|
+
? this.maps.markerNullCount + 1 : this.maps.markerNullCount;
|
|
13420
13895
|
const markerDataLength = markerDatas.length - this.maps.markerNullCount;
|
|
13421
|
-
if (markerSVGObject.childElementCount === (
|
|
13896
|
+
if (markerSVGObject.childElementCount === (markerDataLength - markerTemplateCounts - nullCount) && (type !== 'Template')) {
|
|
13422
13897
|
layerElement.appendChild(markerSVGObject);
|
|
13423
13898
|
if (currentLayers.markerClusterSettings.allowClustering) {
|
|
13424
13899
|
this.maps.svgObject.appendChild(markerSVGObject);
|
|
@@ -13426,7 +13901,7 @@ class Zoom {
|
|
|
13426
13901
|
clusterTemplate(currentLayers, markerSVGObject, this.maps, layerIndex, markerSVGObject, layerElement, true, true);
|
|
13427
13902
|
}
|
|
13428
13903
|
}
|
|
13429
|
-
if (markerTemplateElements.childElementCount === (
|
|
13904
|
+
if (markerTemplateElements.childElementCount === (markerDataLength - markerCounts - nullCount) && getElementByID(this.maps.element.id + '_Secondary_Element')) {
|
|
13430
13905
|
getElementByID(this.maps.element.id + '_Secondary_Element').appendChild(markerTemplateElements);
|
|
13431
13906
|
if (scale >= 1) {
|
|
13432
13907
|
if (currentLayers.markerClusterSettings.allowClustering) {
|
|
@@ -13521,7 +13996,7 @@ class Zoom {
|
|
|
13521
13996
|
}
|
|
13522
13997
|
if (this.maps.layers[this.index].dataLabelSettings.smartLabelMode === 'Hide') {
|
|
13523
13998
|
if (scale > 1) {
|
|
13524
|
-
text = (this.
|
|
13999
|
+
text = ((this.maps.dataLabelShape[l] * scale) >= zoomtextSize['width']) ? zoomtext : '';
|
|
13525
14000
|
element.innerHTML = text;
|
|
13526
14001
|
}
|
|
13527
14002
|
else {
|
|
@@ -13531,7 +14006,7 @@ class Zoom {
|
|
|
13531
14006
|
}
|
|
13532
14007
|
if (this.maps.layers[this.index].dataLabelSettings.smartLabelMode === 'Trim') {
|
|
13533
14008
|
if (scale > 1) {
|
|
13534
|
-
zoomtrimLabel = textTrim(this.
|
|
14009
|
+
zoomtrimLabel = textTrim((this.maps.dataLabelShape[l] * scale), zoomtext, style);
|
|
13535
14010
|
text = zoomtrimLabel;
|
|
13536
14011
|
element.innerHTML = text;
|
|
13537
14012
|
}
|
|
@@ -13569,7 +14044,7 @@ class Zoom {
|
|
|
13569
14044
|
|| textLocations['heightTop'] > this.intersect[j]['heightBottom']) {
|
|
13570
14045
|
trimmedLable = !isNullOrUndefined(text) ? text : zoomtext;
|
|
13571
14046
|
if (scale > 1) {
|
|
13572
|
-
trimmedLable = textTrim(this.
|
|
14047
|
+
trimmedLable = textTrim((this.maps.dataLabelShape[l] * scale), trimmedLable, style);
|
|
13573
14048
|
}
|
|
13574
14049
|
element.innerHTML = trimmedLable;
|
|
13575
14050
|
}
|
|
@@ -13595,11 +14070,11 @@ class Zoom {
|
|
|
13595
14070
|
}
|
|
13596
14071
|
this.intersect.push(textLocations);
|
|
13597
14072
|
if (isNullOrUndefined(trimmedLable)) {
|
|
13598
|
-
trimmedLable = textTrim(this.
|
|
14073
|
+
trimmedLable = textTrim((this.maps.dataLabelShape[l] * scale), zoomtext, style);
|
|
13599
14074
|
element.innerHTML = trimmedLable;
|
|
13600
14075
|
}
|
|
13601
14076
|
}
|
|
13602
|
-
|
|
14077
|
+
if (animate$$1 || duration > 0) {
|
|
13603
14078
|
smoothTranslate(element, 0, duration, new MapLocation(labelX, labelY));
|
|
13604
14079
|
}
|
|
13605
14080
|
}
|
|
@@ -13720,7 +14195,7 @@ class Zoom {
|
|
|
13720
14195
|
const layerRect = getElementByID(map.element.id + '_Layer_Collections').getBoundingClientRect();
|
|
13721
14196
|
const elementRect = getElementByID(map.element.id + '_svg').getBoundingClientRect();
|
|
13722
14197
|
const panningXDirection = ((xDifference < 0 ? layerRect.left <= (elementRect.left + map.mapAreaRect.x) :
|
|
13723
|
-
((layerRect.left + layerRect.width
|
|
14198
|
+
((layerRect.left + layerRect.width + map.mapAreaRect.x) >= (elementRect.width))));
|
|
13724
14199
|
const panningYDirection = ((yDifference < 0 ? layerRect.top <= (elementRect.top + map.mapAreaRect.y) :
|
|
13725
14200
|
((layerRect.top + layerRect.height + legendHeight + map.margin.top) >= (elementRect.top + elementRect.height))));
|
|
13726
14201
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -13734,15 +14209,15 @@ class Zoom {
|
|
|
13734
14209
|
if (!panArgs.cancel) {
|
|
13735
14210
|
if (panningXDirection && panningYDirection) {
|
|
13736
14211
|
map.translatePoint = new Point(x, y);
|
|
13737
|
-
this.applyTransform();
|
|
14212
|
+
this.applyTransform(map);
|
|
13738
14213
|
}
|
|
13739
14214
|
else if (panningXDirection) {
|
|
13740
14215
|
map.translatePoint = new Point(x, map.translatePoint.y);
|
|
13741
|
-
this.applyTransform();
|
|
14216
|
+
this.applyTransform(map);
|
|
13742
14217
|
}
|
|
13743
14218
|
else if (panningYDirection) {
|
|
13744
14219
|
map.translatePoint = new Point(map.translatePoint.x, y);
|
|
13745
|
-
this.applyTransform();
|
|
14220
|
+
this.applyTransform(map);
|
|
13746
14221
|
}
|
|
13747
14222
|
}
|
|
13748
14223
|
this.maps.zoomNotApplied = false;
|
|
@@ -13770,7 +14245,7 @@ class Zoom {
|
|
|
13770
14245
|
};
|
|
13771
14246
|
map.trigger(pan, panArgs);
|
|
13772
14247
|
map.mapLayerPanel.generateTiles(map.tileZoomLevel, map.tileTranslatePoint, 'Pan');
|
|
13773
|
-
this.applyTransform();
|
|
14248
|
+
this.applyTransform(map);
|
|
13774
14249
|
}
|
|
13775
14250
|
map.zoomTranslatePoint = map.translatePoint;
|
|
13776
14251
|
this.mouseDownPoints = this.mouseMovePoints;
|
|
@@ -13782,7 +14257,7 @@ class Zoom {
|
|
|
13782
14257
|
(this.distanceX / this.maps.scale)) : this.maps.translatePoint.x;
|
|
13783
14258
|
this.maps.translatePoint.y = !isNullOrUndefined(this.distanceY) ? this.maps.translatePoint.y -
|
|
13784
14259
|
(this.distanceY / this.maps.scale) : this.maps.translatePoint.y;
|
|
13785
|
-
this.applyTransform(false);
|
|
14260
|
+
this.applyTransform(this.maps, false);
|
|
13786
14261
|
}
|
|
13787
14262
|
toolBarZooming(zoomFactor, type) {
|
|
13788
14263
|
const map = this.maps;
|
|
@@ -13809,20 +14284,38 @@ class Zoom {
|
|
|
13809
14284
|
const min = map.baseMapRectBounds['min'];
|
|
13810
14285
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13811
14286
|
const max = map.baseMapRectBounds['max'];
|
|
13812
|
-
|
|
13813
|
-
|
|
13814
|
-
let translatePointX
|
|
13815
|
-
let translatePointY
|
|
13816
|
-
|
|
13817
|
-
|
|
13818
|
-
|
|
13819
|
-
|
|
13820
|
-
|
|
13821
|
-
|
|
14287
|
+
let mapWidth = Math.abs(max['x'] - min['x']);
|
|
14288
|
+
let mapHeight = Math.abs(min['y'] - max['y']);
|
|
14289
|
+
let translatePointX;
|
|
14290
|
+
let translatePointY;
|
|
14291
|
+
if (zoomFactor < 1.2 && map.projectionType !== 'Eckert5') {
|
|
14292
|
+
if (mapHeight === 0 || mapWidth === 0 || mapHeight === mapWidth) {
|
|
14293
|
+
mapWidth = size.width / 2;
|
|
14294
|
+
mapHeight = size.height;
|
|
14295
|
+
}
|
|
14296
|
+
zoomFactor = parseFloat(Math.min(size.width / mapWidth, size.height / mapHeight).toFixed(2));
|
|
14297
|
+
zoomFactor = zoomFactor > 1.05 ? 1 : zoomFactor;
|
|
14298
|
+
map.translatePoint = this.calculateInitalZoomTranslatePoint(zoomFactor, mapWidth, mapHeight, size, min, map);
|
|
14299
|
+
}
|
|
14300
|
+
else {
|
|
14301
|
+
translatePointX = translatePoint.x - (((size.width / scale) - (size.width / zoomFactor)) / 2);
|
|
14302
|
+
translatePointY = translatePoint.y - (((size.height / scale) - (size.height / zoomFactor)) / 2);
|
|
14303
|
+
const currentHeight = Math.abs(map.baseMapRectBounds['max']['y'] - map.baseMapRectBounds['min']['y']) * zoomFactor;
|
|
14304
|
+
translatePointX = (currentHeight < map.mapAreaRect.height) ? (size.x + ((-(min['x'])) + ((size.width / 2) - (mapWidth / 2))))
|
|
14305
|
+
: translatePointX;
|
|
14306
|
+
translatePointY = (currentHeight < map.mapAreaRect.height) ? (size.y + ((-(min['y'])) + ((size.height / 2) - (mapHeight / 2))))
|
|
14307
|
+
: translatePointY;
|
|
14308
|
+
map.translatePoint = new Point(translatePointX, translatePointY);
|
|
14309
|
+
}
|
|
13822
14310
|
map.zoomTranslatePoint = map.translatePoint;
|
|
13823
14311
|
map.scale = zoomFactor;
|
|
13824
|
-
this.triggerZoomEvent(prevTilePoint, prevLevel, type)
|
|
13825
|
-
|
|
14312
|
+
if (this.triggerZoomEvent(prevTilePoint, prevLevel, type)) {
|
|
14313
|
+
map.translatePoint = map.zoomTranslatePoint = map.previousPoint;
|
|
14314
|
+
map.scale = map.previousScale;
|
|
14315
|
+
}
|
|
14316
|
+
else {
|
|
14317
|
+
this.applyTransform(map, true);
|
|
14318
|
+
}
|
|
13826
14319
|
}
|
|
13827
14320
|
else if ((map.isTileMap) && ((zoomFactor >= minZoom && zoomFactor <= maxZoom) || map.isReset)) {
|
|
13828
14321
|
let tileZoomFactor = prevLevel < minZoom && !map.isReset ? minZoom : zoomFactor;
|
|
@@ -13839,34 +14332,44 @@ class Zoom {
|
|
|
13839
14332
|
map.tileTranslatePoint.y = map.initialTileTranslate.y;
|
|
13840
14333
|
tileZoomFactor = map.tileZoomLevel = map.mapScaleValue = map.initialZoomLevel;
|
|
13841
14334
|
}
|
|
13842
|
-
this.triggerZoomEvent(prevTilePoint, prevLevel, type)
|
|
13843
|
-
|
|
13844
|
-
|
|
13845
|
-
|
|
13846
|
-
|
|
13847
|
-
}
|
|
13848
|
-
if (document.querySelector('.GroupElement')) {
|
|
13849
|
-
document.querySelector('.GroupElement').style.display = 'none';
|
|
14335
|
+
if (this.triggerZoomEvent(prevTilePoint, prevLevel, type)) {
|
|
14336
|
+
map.translatePoint = map.tileTranslatePoint = new Point(0, 0);
|
|
14337
|
+
map.scale = map.previousScale;
|
|
14338
|
+
map.tileZoomLevel = prevLevel;
|
|
14339
|
+
map.zoomSettings.zoomFactor = map.previousScale;
|
|
13850
14340
|
}
|
|
13851
|
-
|
|
13852
|
-
|
|
13853
|
-
|
|
13854
|
-
const animationDuration = this.maps.layersCollection[0].animationDuration;
|
|
13855
|
-
setTimeout(() => {
|
|
13856
|
-
this.applyTransform(true);
|
|
14341
|
+
else {
|
|
14342
|
+
map.translatePoint.y = (map.tileTranslatePoint.y - (0.01 * map.mapScaleValue)) / map.scale;
|
|
14343
|
+
map.translatePoint.x = (map.tileTranslatePoint.x - (0.01 * map.mapScaleValue)) / map.scale;
|
|
13857
14344
|
if (document.getElementById(this.maps.element.id + '_LayerIndex_1')) {
|
|
13858
|
-
document.getElementById(this.maps.element.id + '_LayerIndex_1').style.display = '
|
|
14345
|
+
document.getElementById(this.maps.element.id + '_LayerIndex_1').style.display = 'none';
|
|
13859
14346
|
}
|
|
13860
|
-
|
|
14347
|
+
if (document.querySelector('.GroupElement')) {
|
|
14348
|
+
document.querySelector('.GroupElement').style.display = 'none';
|
|
14349
|
+
}
|
|
14350
|
+
this.markerLineAnimation(map);
|
|
14351
|
+
map.mapLayerPanel.generateTiles(tileZoomFactor, map.tileTranslatePoint, type);
|
|
14352
|
+
const element1 = document.getElementById(this.maps.element.id + '_tiles');
|
|
14353
|
+
const animationDuration = this.maps.layersCollection[0].animationDuration;
|
|
14354
|
+
setTimeout(() => {
|
|
14355
|
+
this.applyTransform(this.maps, true);
|
|
14356
|
+
if (document.getElementById(this.maps.element.id + '_LayerIndex_1')) {
|
|
14357
|
+
document.getElementById(this.maps.element.id + '_LayerIndex_1').style.display = 'block';
|
|
14358
|
+
}
|
|
14359
|
+
this.maps.isAddLayer = false;
|
|
14360
|
+
}, animationDuration);
|
|
14361
|
+
}
|
|
13861
14362
|
}
|
|
13862
14363
|
this.maps.zoomNotApplied = false;
|
|
13863
14364
|
}
|
|
13864
14365
|
}
|
|
13865
14366
|
createZoomingToolbars() {
|
|
13866
14367
|
const map = this.maps;
|
|
14368
|
+
let zoomInElements;
|
|
14369
|
+
let zoomOutElements;
|
|
13867
14370
|
this.toolBarGroup = map.renderer.createGroup({
|
|
13868
14371
|
id: map.element.id + '_Zooming_KitCollection',
|
|
13869
|
-
opacity: map.theme.toLowerCase() === '
|
|
14372
|
+
opacity: map.theme.toLowerCase() === 'fluentdark' ? 0.6 : 0.3
|
|
13870
14373
|
});
|
|
13871
14374
|
const kitHeight = 16;
|
|
13872
14375
|
const kitWidth = 16;
|
|
@@ -13881,7 +14384,6 @@ class Zoom {
|
|
|
13881
14384
|
const toolBarLength = map.zoomSettings.toolbars.length;
|
|
13882
14385
|
const toolWidth = (map.zoomSettings.toolBarOrientation === 'Horizontal') ? (toolBarLength * kitWidth) + (toolBarLength * padding) : (kitWidth * 2);
|
|
13883
14386
|
const toolHeight = (map.zoomSettings.toolBarOrientation === 'Horizontal') ? (kitHeight * 2) : (toolBarLength * kitHeight) + (toolBarLength * padding);
|
|
13884
|
-
this.toolBarGroup.appendChild(map.renderer.drawRectangle(new RectOption(map.element.id + '_Zooming_Rect', 'transparent', { color: 'transparent', width: 1 }, 1, new Rect(0, 0, toolWidth, toolHeight), 0, 0)));
|
|
13885
14387
|
const defElement = map.renderer.createDefs();
|
|
13886
14388
|
defElement.innerHTML = shadowElement;
|
|
13887
14389
|
this.toolBarGroup.appendChild(defElement);
|
|
@@ -13930,13 +14432,13 @@ class Zoom {
|
|
|
13930
14432
|
case 'zoomin':
|
|
13931
14433
|
direction = 'M 8, 0 L 8, 16 M 0, 8 L 16, 8';
|
|
13932
14434
|
this.currentToolbarEle.appendChild(map.renderer.drawPath(new PathOption(map.element.id + '_Zooming_ToolBar_' + toolbar + '_Path', fill, 3, this.maps.themeStyle.zoomFillColor, 1, 1, null, direction)));
|
|
13933
|
-
|
|
14435
|
+
zoomInElements = this.currentToolbarEle;
|
|
13934
14436
|
this.wireEvents(this.currentToolbarEle, this.performToolBarAction);
|
|
13935
14437
|
break;
|
|
13936
14438
|
case 'zoomout':
|
|
13937
14439
|
direction = 'M 0, 8 L 16, 8';
|
|
13938
14440
|
this.currentToolbarEle.appendChild(map.renderer.drawPath(new PathOption(map.element.id + '_Zooming_ToolBar_' + toolbar, fill, 3, this.maps.themeStyle.zoomFillColor, 1, 1, null, direction)));
|
|
13939
|
-
|
|
14441
|
+
zoomOutElements = this.currentToolbarEle;
|
|
13940
14442
|
this.wireEvents(this.currentToolbarEle, this.performToolBarAction);
|
|
13941
14443
|
break;
|
|
13942
14444
|
case 'pan': {
|
|
@@ -14121,7 +14623,12 @@ class Zoom {
|
|
|
14121
14623
|
x = (size.width / 2) - (toolBarSize.width / 2);
|
|
14122
14624
|
break;
|
|
14123
14625
|
case 'Far':
|
|
14124
|
-
|
|
14626
|
+
if (!isNullOrUndefined(map.legendModule) && map.legendSettings.position === 'Left') {
|
|
14627
|
+
x = size.width + size.x - toolBarSize.width - padding;
|
|
14628
|
+
}
|
|
14629
|
+
else {
|
|
14630
|
+
x = (size.width - toolBarSize.width) - padding;
|
|
14631
|
+
}
|
|
14125
14632
|
break;
|
|
14126
14633
|
}
|
|
14127
14634
|
let extraPosition = map.getExtraPosition();
|
|
@@ -14177,6 +14684,7 @@ class Zoom {
|
|
|
14177
14684
|
}
|
|
14178
14685
|
else {
|
|
14179
14686
|
map.mapScaleValue = value - delta;
|
|
14687
|
+
map.isReset = (map.mapScaleValue < 1) ? true : false;
|
|
14180
14688
|
map.staticMapZoom = map.tileZoomLevel;
|
|
14181
14689
|
if (map.mapScaleValue === 1) {
|
|
14182
14690
|
map.markerCenterLatitude = null;
|
|
@@ -14270,14 +14778,14 @@ class Zoom {
|
|
|
14270
14778
|
if (document.getElementById(map.element.id + '_Zooming_ToolBar_Pan_Group')) {
|
|
14271
14779
|
if (!this.maps.zoomSettings.enablePanning) {
|
|
14272
14780
|
if (target.id.indexOf('_Zooming_ToolBar') > -1 || target.id.indexOf('_Zooming_Rect') > -1) {
|
|
14273
|
-
getElementByID(map.element.id + '_Zooming_ToolBar_Pan_Rect').setAttribute('opacity', map.theme.toLowerCase() === '
|
|
14274
|
-
getElementByID(map.element.id + '_Zooming_ToolBar_Pan').setAttribute('opacity', map.theme.toLowerCase() === '
|
|
14781
|
+
getElementByID(map.element.id + '_Zooming_ToolBar_Pan_Rect').setAttribute('opacity', map.theme.toLowerCase() === 'fluentdark' ? '0.6' : '0.3');
|
|
14782
|
+
getElementByID(map.element.id + '_Zooming_ToolBar_Pan').setAttribute('opacity', map.theme.toLowerCase() === 'fluentdark' ? '0.6' : '0.3');
|
|
14275
14783
|
}
|
|
14276
14784
|
}
|
|
14277
14785
|
}
|
|
14278
14786
|
}
|
|
14279
14787
|
else {
|
|
14280
|
-
getElementByID(map.element.id + '_Zooming_KitCollection').setAttribute('opacity', map.theme.toLowerCase() === '
|
|
14788
|
+
getElementByID(map.element.id + '_Zooming_KitCollection').setAttribute('opacity', map.theme.toLowerCase() === 'fluentdark' ? '0.6' : '0.3');
|
|
14281
14789
|
if (!this.maps.zoomSettings.enablePanning && document.getElementById(map.element.id + '_Zooming_ToolBar_Pan_Group')) {
|
|
14282
14790
|
getElementByID(map.element.id + '_Zooming_ToolBar_Pan_Rect').setAttribute('opacity', '1');
|
|
14283
14791
|
getElementByID(map.element.id + '_Zooming_ToolBar_Pan').setAttribute('opacity', '1');
|
|
@@ -14427,15 +14935,30 @@ class Zoom {
|
|
|
14427
14935
|
/**
|
|
14428
14936
|
* To destroy the zoom.
|
|
14429
14937
|
*
|
|
14430
|
-
* @param {Maps} maps - Specifies the instance of the maps.
|
|
14431
14938
|
* @returns {void}
|
|
14432
14939
|
* @private
|
|
14433
14940
|
*/
|
|
14434
|
-
destroy(
|
|
14941
|
+
destroy() {
|
|
14942
|
+
this.toolBarGroup = null;
|
|
14943
|
+
this.currentToolbarEle = null;
|
|
14944
|
+
this.zoomingRect = null;
|
|
14945
|
+
this.zoomElements = null;
|
|
14946
|
+
this.panElements = null;
|
|
14947
|
+
this.baseTranslatePoint = null;
|
|
14948
|
+
this.touchStartList = null;
|
|
14949
|
+
this.touchMoveList = null;
|
|
14950
|
+
this.previousTouchMoveList = null;
|
|
14951
|
+
this.mouseDownPoints = null;
|
|
14952
|
+
this.mouseMovePoints = null;
|
|
14953
|
+
this.startTouches = [];
|
|
14954
|
+
this.zoomshapewidth = null;
|
|
14955
|
+
this.intersect = [];
|
|
14956
|
+
this.mouseDownLatLong = null;
|
|
14957
|
+
this.mouseMoveLatLong = null;
|
|
14435
14958
|
this.removeEventListener();
|
|
14436
|
-
|
|
14437
|
-
|
|
14438
|
-
|
|
14959
|
+
//TODO: Calling the below code throws spec issue.
|
|
14960
|
+
//this.maps = null;
|
|
14961
|
+
this.currentLayer = null;
|
|
14439
14962
|
}
|
|
14440
14963
|
}
|
|
14441
14964
|
|
|
@@ -14451,9 +14974,7 @@ class Print {
|
|
|
14451
14974
|
*
|
|
14452
14975
|
* @param {Maps} control - Specifies the instance of the map
|
|
14453
14976
|
*/
|
|
14454
|
-
constructor(control) {
|
|
14455
|
-
this.control = control;
|
|
14456
|
-
}
|
|
14977
|
+
constructor(control) { }
|
|
14457
14978
|
/**
|
|
14458
14979
|
* To print the Maps
|
|
14459
14980
|
*
|
|
@@ -14461,16 +14982,16 @@ class Print {
|
|
|
14461
14982
|
* @returns {void}
|
|
14462
14983
|
* @private
|
|
14463
14984
|
*/
|
|
14464
|
-
print(elements) {
|
|
14465
|
-
|
|
14466
|
-
|
|
14467
|
-
|
|
14985
|
+
print(maps, elements) {
|
|
14986
|
+
let printWindow = window.open('', 'print', 'height=' + window.outerHeight + ',width=' + window.outerWidth + ',tabbar=no');
|
|
14987
|
+
printWindow.moveTo(0, 0);
|
|
14988
|
+
printWindow.resizeTo(screen.availWidth, screen.availHeight);
|
|
14468
14989
|
const argsData = {
|
|
14469
|
-
cancel: false, htmlContent: this.getHTMLContent(elements), name: beforePrint
|
|
14990
|
+
cancel: false, htmlContent: this.getHTMLContent(maps, elements), name: beforePrint
|
|
14470
14991
|
};
|
|
14471
|
-
|
|
14992
|
+
maps.trigger('beforePrint', argsData, (beforePrintArgs) => {
|
|
14472
14993
|
if (!argsData.cancel) {
|
|
14473
|
-
print(argsData.htmlContent,
|
|
14994
|
+
print(argsData.htmlContent, printWindow);
|
|
14474
14995
|
}
|
|
14475
14996
|
});
|
|
14476
14997
|
}
|
|
@@ -14481,10 +15002,29 @@ class Print {
|
|
|
14481
15002
|
* @returns {Element} - Returns the div element
|
|
14482
15003
|
* @private
|
|
14483
15004
|
*/
|
|
14484
|
-
getHTMLContent(elements) {
|
|
14485
|
-
const elementRect = getClientElement(this.control.element.id);
|
|
15005
|
+
getHTMLContent(maps, elements) {
|
|
14486
15006
|
let div = createElement('div');
|
|
14487
|
-
|
|
15007
|
+
let divElement = maps.element.cloneNode(true);
|
|
15008
|
+
if (maps.isTileMap) {
|
|
15009
|
+
for (let i = 0; i < divElement.childElementCount; i++) {
|
|
15010
|
+
if (divElement.children[i].id === maps.element.id + '_tile_parent') {
|
|
15011
|
+
divElement.children[i].style.removeProperty('height');
|
|
15012
|
+
divElement.children[i].style.removeProperty('width');
|
|
15013
|
+
divElement.children[i].style.removeProperty('top');
|
|
15014
|
+
divElement.children[i].style.removeProperty('left');
|
|
15015
|
+
divElement.children[i].style.removeProperty('right');
|
|
15016
|
+
divElement.children[i].style.removeProperty('overflow');
|
|
15017
|
+
const svgElement = document.getElementById(maps.element.id + '_Tile_SVG_Parent');
|
|
15018
|
+
divElement.children[i].children[0].style.overflow = 'hidden';
|
|
15019
|
+
divElement.children[i].children[0].style.position = 'absolute';
|
|
15020
|
+
divElement.children[i].children[0].style.height = svgElement.style.height;
|
|
15021
|
+
divElement.children[i].children[0].style.width = svgElement.style.width;
|
|
15022
|
+
divElement.children[i].children[0].style.left = svgElement.style.left;
|
|
15023
|
+
divElement.children[i].children[0].style.top = svgElement.style.top;
|
|
15024
|
+
break;
|
|
15025
|
+
}
|
|
15026
|
+
}
|
|
15027
|
+
}
|
|
14488
15028
|
if (elements) {
|
|
14489
15029
|
if (elements instanceof Array) {
|
|
14490
15030
|
Array.prototype.forEach.call(elements, (value) => {
|
|
@@ -14499,7 +15039,7 @@ class Print {
|
|
|
14499
15039
|
}
|
|
14500
15040
|
}
|
|
14501
15041
|
else {
|
|
14502
|
-
div.appendChild(
|
|
15042
|
+
div.appendChild(divElement);
|
|
14503
15043
|
}
|
|
14504
15044
|
return div;
|
|
14505
15045
|
}
|
|
@@ -14514,15 +15054,10 @@ class Print {
|
|
|
14514
15054
|
/**
|
|
14515
15055
|
* To destroy the print.
|
|
14516
15056
|
*
|
|
14517
|
-
* @param {Maps} maps - Specifies the instance of the maps
|
|
14518
15057
|
* @returns {void}
|
|
14519
15058
|
* @private
|
|
14520
15059
|
*/
|
|
14521
|
-
destroy(
|
|
14522
|
-
/**
|
|
14523
|
-
* Destroy method performed here
|
|
14524
|
-
*/
|
|
14525
|
-
}
|
|
15060
|
+
destroy() { }
|
|
14526
15061
|
}
|
|
14527
15062
|
|
|
14528
15063
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
@@ -14538,7 +15073,6 @@ class ImageExport {
|
|
|
14538
15073
|
* @param {Maps} control - Specifies the instance of the map
|
|
14539
15074
|
*/
|
|
14540
15075
|
constructor(control) {
|
|
14541
|
-
this.control = control;
|
|
14542
15076
|
}
|
|
14543
15077
|
/**
|
|
14544
15078
|
* To export the file as image/svg format
|
|
@@ -14549,29 +15083,28 @@ class ImageExport {
|
|
|
14549
15083
|
* @returns {Promise<string>} - Returns the promise string.
|
|
14550
15084
|
* @private
|
|
14551
15085
|
*/
|
|
14552
|
-
export(type, fileName, allowDownload) {
|
|
15086
|
+
export(maps, type, fileName, allowDownload) {
|
|
14553
15087
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
14554
15088
|
const promise = new Promise((resolve, reject) => {
|
|
14555
15089
|
const imageCanvasElement = createElement('canvas', {
|
|
14556
15090
|
id: 'ej2-canvas',
|
|
14557
15091
|
attrs: {
|
|
14558
|
-
'width':
|
|
14559
|
-
'height':
|
|
15092
|
+
'width': maps.availableSize.width.toString(),
|
|
15093
|
+
'height': maps.availableSize.height.toString()
|
|
14560
15094
|
}
|
|
14561
15095
|
});
|
|
14562
15096
|
const isDownload = !(Browser.userAgent.toString().indexOf('HeadlessChrome') > -1);
|
|
14563
|
-
const toolbarEle = document.getElementById(
|
|
14564
|
-
const svgParent = document.getElementById(
|
|
14565
|
-
const tileParent = document.getElementById(this.control.element.id + '_tile_parent');
|
|
15097
|
+
const toolbarEle = document.getElementById(maps.element.id + '_ToolBar');
|
|
15098
|
+
const svgParent = document.getElementById(maps.element.id + '_Tile_SVG_Parent');
|
|
14566
15099
|
let svgDataElement;
|
|
14567
15100
|
let tileSvg;
|
|
14568
|
-
let svgObject = getElementByID(
|
|
14569
|
-
if (!
|
|
15101
|
+
let svgObject = getElementByID(maps.element.id + '_svg').cloneNode(true);
|
|
15102
|
+
if (!maps.isTileMap) {
|
|
14570
15103
|
svgDataElement = '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">' +
|
|
14571
|
-
|
|
15104
|
+
maps.svgObject.outerHTML + '</svg>';
|
|
14572
15105
|
}
|
|
14573
15106
|
else {
|
|
14574
|
-
tileSvg = getElementByID(
|
|
15107
|
+
tileSvg = getElementByID(maps.element.id + '_Tile_SVG').cloneNode(true);
|
|
14575
15108
|
svgDataElement = '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">' +
|
|
14576
15109
|
svgObject.outerHTML + tileSvg.outerHTML + '</svg>';
|
|
14577
15110
|
}
|
|
@@ -14588,7 +15121,7 @@ class ImageExport {
|
|
|
14588
15121
|
else {
|
|
14589
15122
|
const image = new Image();
|
|
14590
15123
|
const ctxt = imageCanvasElement.getContext('2d');
|
|
14591
|
-
if (!
|
|
15124
|
+
if (!maps.isTileMap) {
|
|
14592
15125
|
image.onload = (() => {
|
|
14593
15126
|
ctxt.drawImage(image, 0, 0);
|
|
14594
15127
|
window.URL.revokeObjectURL(url);
|
|
@@ -14607,35 +15140,37 @@ class ImageExport {
|
|
|
14607
15140
|
image.src = url;
|
|
14608
15141
|
}
|
|
14609
15142
|
else {
|
|
14610
|
-
const
|
|
15143
|
+
const svgParentElement = document.getElementById(maps.element.id + '_MapAreaBorder');
|
|
15144
|
+
let top = parseFloat(svgParentElement.getAttribute('y'));
|
|
15145
|
+
let left = parseFloat(svgParentElement.getAttribute('x'));
|
|
14611
15146
|
const imgxHttp = new XMLHttpRequest();
|
|
14612
|
-
const imgTileLength =
|
|
15147
|
+
const imgTileLength = maps.mapLayerPanel.tiles.length;
|
|
14613
15148
|
for (let i = 0; i <= imgTileLength + 1; i++) {
|
|
14614
|
-
const tile = document.getElementById(
|
|
15149
|
+
const tile = document.getElementById(maps.element.id + '_tile_' + (i - 1));
|
|
14615
15150
|
const exportTileImg = new Image();
|
|
14616
15151
|
exportTileImg.crossOrigin = 'Anonymous';
|
|
14617
|
-
ctxt.fillStyle =
|
|
14618
|
-
ctxt.fillRect(0, 0,
|
|
14619
|
-
ctxt.font =
|
|
14620
|
-
let titleElement = document.getElementById(
|
|
15152
|
+
ctxt.fillStyle = maps.background ? maps.background : '#FFFFFF';
|
|
15153
|
+
ctxt.fillRect(0, 0, maps.availableSize.width, maps.availableSize.height);
|
|
15154
|
+
ctxt.font = maps.titleSettings.textStyle.size + ' Arial';
|
|
15155
|
+
let titleElement = document.getElementById(maps.element.id + '_Map_title');
|
|
14621
15156
|
if (!isNullOrUndefined(titleElement)) {
|
|
14622
15157
|
ctxt.fillStyle = titleElement.getAttribute('fill');
|
|
14623
|
-
ctxt.fillText(
|
|
15158
|
+
ctxt.fillText(maps.titleSettings.text, parseFloat(titleElement.getAttribute('x')), parseFloat(titleElement.getAttribute('y')));
|
|
14624
15159
|
}
|
|
14625
15160
|
exportTileImg.onload = (() => {
|
|
14626
15161
|
if (i === 0 || i === imgTileLength + 1) {
|
|
14627
15162
|
if (i === 0) {
|
|
14628
15163
|
ctxt.setTransform(1, 0, 0, 1, 0, 0);
|
|
14629
|
-
ctxt.rect(0,
|
|
15164
|
+
ctxt.rect(0, top, parseFloat(svgParent.style.width), parseFloat(svgParent.style.height));
|
|
14630
15165
|
ctxt.clip();
|
|
14631
15166
|
}
|
|
14632
15167
|
else {
|
|
14633
|
-
ctxt.setTransform(1, 0, 0, 1,
|
|
15168
|
+
ctxt.setTransform(1, 0, 0, 1, left, top);
|
|
14634
15169
|
}
|
|
14635
15170
|
}
|
|
14636
15171
|
else {
|
|
14637
|
-
ctxt.setTransform(1, 0, 0, 1, parseFloat(tile.style.left) +
|
|
14638
|
-
|
|
15172
|
+
ctxt.setTransform(1, 0, 0, 1, parseFloat(tile.style.left) + left, parseFloat(tile.style.top) +
|
|
15173
|
+
top);
|
|
14639
15174
|
}
|
|
14640
15175
|
ctxt.drawImage(exportTileImg, 0, 0);
|
|
14641
15176
|
if (i === imgTileLength + 1) {
|
|
@@ -14687,15 +15222,10 @@ class ImageExport {
|
|
|
14687
15222
|
/**
|
|
14688
15223
|
* To destroy the ImageExport.
|
|
14689
15224
|
*
|
|
14690
|
-
* @param {Maps} maps - Specifies the instance of the maps.
|
|
14691
15225
|
* @returns {void}
|
|
14692
15226
|
* @private
|
|
14693
15227
|
*/
|
|
14694
|
-
destroy(
|
|
14695
|
-
/**
|
|
14696
|
-
* Destroy method performed here
|
|
14697
|
-
*/
|
|
14698
|
-
}
|
|
15228
|
+
destroy() { }
|
|
14699
15229
|
}
|
|
14700
15230
|
|
|
14701
15231
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
@@ -14710,9 +15240,7 @@ class PdfExport {
|
|
|
14710
15240
|
*
|
|
14711
15241
|
* @param {Maps} control Specifies the instance of the map
|
|
14712
15242
|
*/
|
|
14713
|
-
constructor(
|
|
14714
|
-
this.control = control;
|
|
14715
|
-
}
|
|
15243
|
+
constructor() { }
|
|
14716
15244
|
/**
|
|
14717
15245
|
* To export the file as image/svg format
|
|
14718
15246
|
*
|
|
@@ -14723,25 +15251,24 @@ class PdfExport {
|
|
|
14723
15251
|
* @returns {Promise<string>} - Returns the promise string
|
|
14724
15252
|
* @private
|
|
14725
15253
|
*/
|
|
14726
|
-
export(type, fileName, allowDownload, orientation) {
|
|
15254
|
+
export(maps, type, fileName, allowDownload, orientation) {
|
|
14727
15255
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
14728
15256
|
const promise = new Promise((resolve, reject) => {
|
|
14729
15257
|
const canvasElement = createElement('canvas', {
|
|
14730
15258
|
id: 'ej2-canvas',
|
|
14731
15259
|
attrs: {
|
|
14732
|
-
'width':
|
|
14733
|
-
'height':
|
|
15260
|
+
'width': maps.availableSize.width.toString(),
|
|
15261
|
+
'height': maps.availableSize.height.toString()
|
|
14734
15262
|
}
|
|
14735
15263
|
});
|
|
14736
15264
|
orientation = isNullOrUndefined(orientation) ? PdfPageOrientation.Landscape : orientation;
|
|
14737
|
-
const svgParent = document.getElementById(
|
|
15265
|
+
const svgParent = document.getElementById(maps.element.id + '_Tile_SVG_Parent');
|
|
14738
15266
|
let svgData;
|
|
14739
|
-
const exportElement =
|
|
14740
|
-
const tileParent = document.getElementById(this.control.element.id + '_tile_parent');
|
|
15267
|
+
const exportElement = maps.svgObject.cloneNode(true);
|
|
14741
15268
|
const backgroundElement = exportElement.childNodes[0];
|
|
14742
15269
|
const backgroundColor = backgroundElement.getAttribute('fill');
|
|
14743
|
-
if ((
|
|
14744
|
-
&& (backgroundColor === 'rgba(255,255,255, 0.0)' || backgroundColor === 'transparent')) {
|
|
15270
|
+
if ((maps.theme === 'Tailwind' || maps.theme === 'TailwindDark' || maps.theme === 'Bootstrap5' || maps.theme === 'Bootstrap5Dark'
|
|
15271
|
+
|| maps.theme === 'Fluent' || maps.theme === 'FluentDark') && (backgroundColor === 'rgba(255,255,255, 0.0)' || backgroundColor === 'transparent')) {
|
|
14745
15272
|
exportElement.childNodes[0].setAttribute('fill', 'rgba(255,255,255, 1)');
|
|
14746
15273
|
}
|
|
14747
15274
|
const url = window.URL.createObjectURL(new Blob(type === 'SVG' ? [svgData] :
|
|
@@ -14749,7 +15276,7 @@ class PdfExport {
|
|
|
14749
15276
|
const pdfDocument = new PdfDocument();
|
|
14750
15277
|
const image = new Image();
|
|
14751
15278
|
const ctx = canvasElement.getContext('2d');
|
|
14752
|
-
if (!
|
|
15279
|
+
if (!maps.isTileMap) {
|
|
14753
15280
|
image.onload = (() => {
|
|
14754
15281
|
ctx.drawImage(image, 0, 0);
|
|
14755
15282
|
window.URL.revokeObjectURL(url);
|
|
@@ -14757,7 +15284,7 @@ class PdfExport {
|
|
|
14757
15284
|
let imageString = canvasElement.toDataURL('image/jpeg').replace('image/jpeg', 'image/octet-stream');
|
|
14758
15285
|
pdfDocument.pageSettings.orientation = orientation;
|
|
14759
15286
|
imageString = imageString.slice(imageString.indexOf(',') + 1);
|
|
14760
|
-
pdfDocument.pages.add().graphics.drawImage(new PdfBitmap(imageString), 0, 0, (
|
|
15287
|
+
pdfDocument.pages.add().graphics.drawImage(new PdfBitmap(imageString), 0, 0, (maps.availableSize.width - 60), maps.availableSize.height);
|
|
14761
15288
|
if (allowDownload) {
|
|
14762
15289
|
pdfDocument.save(fileName + '.pdf');
|
|
14763
15290
|
pdfDocument.destroy();
|
|
@@ -14770,35 +15297,36 @@ class PdfExport {
|
|
|
14770
15297
|
image.src = url;
|
|
14771
15298
|
}
|
|
14772
15299
|
else {
|
|
14773
|
-
const
|
|
15300
|
+
const svgParentElement = document.getElementById(maps.element.id + '_MapAreaBorder');
|
|
15301
|
+
let top = parseFloat(svgParentElement.getAttribute('y'));
|
|
15302
|
+
let left = parseFloat(svgParentElement.getAttribute('x'));
|
|
14774
15303
|
const xHttp = new XMLHttpRequest();
|
|
14775
|
-
const tileLength =
|
|
15304
|
+
const tileLength = maps.mapLayerPanel.tiles.length;
|
|
14776
15305
|
for (let i = 0; i <= tileLength + 1; i++) {
|
|
14777
|
-
const tile = document.getElementById(
|
|
15306
|
+
const tile = document.getElementById(maps.element.id + '_tile_' + (i - 1));
|
|
14778
15307
|
const tileImg = new Image();
|
|
14779
15308
|
tileImg.crossOrigin = 'Anonymous';
|
|
14780
|
-
ctx.fillStyle =
|
|
14781
|
-
ctx.fillRect(0, 0,
|
|
14782
|
-
ctx.font =
|
|
14783
|
-
let titleElement = document.getElementById(
|
|
15309
|
+
ctx.fillStyle = maps.background ? maps.background : '#FFFFFF';
|
|
15310
|
+
ctx.fillRect(0, 0, maps.availableSize.width, maps.availableSize.height);
|
|
15311
|
+
ctx.font = maps.titleSettings.textStyle.size + ' Arial';
|
|
15312
|
+
let titleElement = document.getElementById(maps.element.id + '_Map_title');
|
|
14784
15313
|
if (!isNullOrUndefined(titleElement)) {
|
|
14785
15314
|
ctx.fillStyle = titleElement.getAttribute('fill');
|
|
14786
|
-
ctx.fillText(
|
|
15315
|
+
ctx.fillText(maps.titleSettings.text, parseFloat(titleElement.getAttribute('x')), parseFloat(titleElement.getAttribute('y')));
|
|
14787
15316
|
}
|
|
14788
15317
|
tileImg.onload = (() => {
|
|
14789
15318
|
if (i === 0 || i === tileLength + 1) {
|
|
14790
15319
|
if (i === 0) {
|
|
14791
15320
|
ctx.setTransform(1, 0, 0, 1, 0, 0);
|
|
14792
|
-
ctx.rect(0,
|
|
15321
|
+
ctx.rect(0, top, parseFloat(svgParent.style.width), parseFloat(svgParent.style.height));
|
|
14793
15322
|
ctx.clip();
|
|
14794
15323
|
}
|
|
14795
15324
|
else {
|
|
14796
|
-
ctx.setTransform(1, 0, 0, 1,
|
|
15325
|
+
ctx.setTransform(1, 0, 0, 1, left, top);
|
|
14797
15326
|
}
|
|
14798
15327
|
}
|
|
14799
15328
|
else {
|
|
14800
|
-
ctx.setTransform(1, 0, 0, 1, parseFloat(tile.style.left) +
|
|
14801
|
-
(parseFloat(tileParent.style.top)) - extraSpace["top"]));
|
|
15329
|
+
ctx.setTransform(1, 0, 0, 1, parseFloat(tile.style.left) + left, parseFloat(tile.style.top) + top);
|
|
14802
15330
|
}
|
|
14803
15331
|
ctx.drawImage(tileImg, 0, 0);
|
|
14804
15332
|
if (i === tileLength + 1) {
|
|
@@ -14807,7 +15335,7 @@ class PdfExport {
|
|
|
14807
15335
|
let x = localStorage.getItem('saved-image-example');
|
|
14808
15336
|
pdfDocument.pageSettings.orientation = orientation;
|
|
14809
15337
|
x = x.slice(x.indexOf(',') + 1);
|
|
14810
|
-
pdfDocument.pages.add().graphics.drawImage(new PdfBitmap(x), 0, 0, (
|
|
15338
|
+
pdfDocument.pages.add().graphics.drawImage(new PdfBitmap(x), 0, 0, (maps.availableSize.width - 60), maps.availableSize.height);
|
|
14811
15339
|
if (allowDownload) {
|
|
14812
15340
|
pdfDocument.save(fileName + '.pdf');
|
|
14813
15341
|
pdfDocument.destroy();
|
|
@@ -14824,7 +15352,7 @@ class PdfExport {
|
|
|
14824
15352
|
}
|
|
14825
15353
|
else {
|
|
14826
15354
|
setTimeout(() => {
|
|
14827
|
-
let tileSvg = document.getElementById(
|
|
15355
|
+
let tileSvg = document.getElementById(maps.element.id + '_Tile_SVG');
|
|
14828
15356
|
tileImg.src = window.URL.createObjectURL(new Blob([(new XMLSerializer()).serializeToString(tileSvg)], { type: 'image/svg+xml' }));
|
|
14829
15357
|
}, 300);
|
|
14830
15358
|
}
|
|
@@ -14848,17 +15376,12 @@ class PdfExport {
|
|
|
14848
15376
|
return 'PdfExport';
|
|
14849
15377
|
}
|
|
14850
15378
|
/**
|
|
14851
|
-
* To destroy the
|
|
15379
|
+
* To destroy the PdfExport.
|
|
14852
15380
|
*
|
|
14853
|
-
* @param {Maps} maps - Specifies the instance of the maps.
|
|
14854
15381
|
* @returns {void}
|
|
14855
15382
|
* @private
|
|
14856
15383
|
*/
|
|
14857
|
-
destroy(
|
|
14858
|
-
/**
|
|
14859
|
-
* Destroy method performed here
|
|
14860
|
-
*/
|
|
14861
|
-
}
|
|
15384
|
+
destroy() { }
|
|
14862
15385
|
}
|
|
14863
15386
|
|
|
14864
15387
|
/**
|
|
@@ -14869,5 +15392,5 @@ class PdfExport {
|
|
|
14869
15392
|
* exporting all modules from maps index
|
|
14870
15393
|
*/
|
|
14871
15394
|
|
|
14872
|
-
export { Maps, load, loaded, click, rightClick, doubleClick, resize, tooltipRender, shapeSelected, shapeHighlight, mousemove, mouseup, mousedown, layerRendering, shapeRendering, markerRendering, markerClusterRendering, markerClick, markerClusterClick, markerMouseMove, markerClusterMouseMove, dataLabelRendering, bubbleRendering, bubbleClick, bubbleMouseMove, animationComplete, legendRendering, annotationRendering, itemSelection, itemHighlight, beforePrint, zoomIn, zoomOut, pan, Annotation, Arrow, Font, Border, CenterPosition, TooltipSettings, Margin, ConnectorLineSettings, MarkerClusterSettings, MarkerClusterData, ColorMappingSettings, InitialMarkerSelectionSettings, InitialShapeSelectionSettings, SelectionSettings, HighlightSettings, NavigationLineSettings, BubbleSettings, CommonTitleSettings, SubTitleSettings, TitleSettings, ZoomSettings, ToggleLegendSettings, LegendSettings, DataLabelSettings, ShapeSettings, MarkerBase, MarkerSettings, LayerSettings, Tile, MapsAreaSettings, Size, stringToNumber, calculateSize, createSvg, getMousePosition, degreesToRadians, radiansToDegrees, convertGeoToPoint, convertTileLatLongToPoint, xToCoordinate, yToCoordinate, aitoff, roundTo, sinci, acos, calculateBound, triggerDownload, Point, MinMax, GeoLocation, measureText, TextOption, PathOption, ColorValue, RectOption, CircleOption, PolygonOption, PolylineOption, LineOption, Line, MapLocation, Rect, PatternOptions, renderTextElement, convertElement, formatValue, convertStringToValue, convertElementFromLabel, drawSymbols, getValueFromObject, markerColorChoose, markerShapeChoose, clusterTemplate, mergeSeparateCluster, clusterSeparate, marker, markerTemplate, maintainSelection, maintainStyleClass, appendShape, drawCircle, drawRectangle, drawPath, drawPolygon, drawPolyline, drawLine, calculateShapes, drawDiamond, drawTriangle, drawCross, drawHorizontalLine, drawVerticalLine, drawStar, drawBalloon, drawPattern, getFieldData, checkShapeDataFields, checkPropertyPath, filter, getRatioOfBubble, findMidPointOfPolygon, isCustomPath, textTrim, findPosition, removeElement, calculateCenterFromPixel, getTranslate, getZoomTranslate, fixInitialScaleForTile, getElementByID, getClientElement, Internalize, getTemplateFunction, getElement, getShapeData, triggerShapeEvent, getElementsByClassName, querySelector, getTargetElement, createStyle, customizeStyle, triggerItemSelectionEvent, removeClass, elementAnimate, timeout, showTooltip, wordWrap, createTooltip, drawSymbol, renderLegendShape, getElementOffset, changeBorderWidth, changeNavaigationLineWidth, targetTouches, calculateScale, getDistance, getTouches, getTouchCenter, sum, zoomAnimate, animate, MapAjax, smoothTranslate, compareZoomFactor, calculateZoomLevel, processResult, LayerPanel, Bubble, BingMap, Marker, ColorMapping, DataLabel, NavigationLine, Legend, Highlight, Selection, MapsTooltip, Zoom, Annotations, Print, ImageExport, PdfExport };
|
|
15395
|
+
export { Maps, load, loaded, click, onclick, rightClick, doubleClick, resize, tooltipRender, shapeSelected, shapeHighlight, mousemove, mouseup, mousedown, layerRendering, shapeRendering, markerRendering, markerClusterRendering, markerClick, markerClusterClick, markerMouseMove, markerClusterMouseMove, dataLabelRendering, bubbleRendering, bubbleClick, bubbleMouseMove, animationComplete, legendRendering, annotationRendering, itemSelection, itemHighlight, beforePrint, zoomIn, zoomOut, pan, Annotation, Arrow, Font, Border, CenterPosition, TooltipSettings, Margin, ConnectorLineSettings, MarkerClusterSettings, MarkerClusterData, ColorMappingSettings, InitialMarkerSelectionSettings, InitialShapeSelectionSettings, SelectionSettings, HighlightSettings, NavigationLineSettings, BubbleSettings, CommonTitleSettings, SubTitleSettings, TitleSettings, ZoomSettings, ToggleLegendSettings, LegendSettings, DataLabelSettings, ShapeSettings, MarkerBase, MarkerSettings, LayerSettings, Tile, MapsAreaSettings, Size, stringToNumber, calculateSize, createSvg, getMousePosition, degreesToRadians, radiansToDegrees, convertGeoToPoint, convertTileLatLongToPoint, xToCoordinate, yToCoordinate, aitoff, roundTo, sinci, acos, calculateBound, triggerDownload, Point, MinMax, GeoLocation, measureText, TextOption, PathOption, ColorValue, RectOption, CircleOption, PolygonOption, PolylineOption, LineOption, Line, MapLocation, Rect, PatternOptions, renderTextElement, convertElement, formatValue, convertStringToValue, convertElementFromLabel, drawSymbols, getValueFromObject, markerColorChoose, markerShapeChoose, clusterTemplate, mergeSeparateCluster, clusterSeparate, marker, markerTemplate, maintainSelection, maintainStyleClass, appendShape, drawCircle, drawRectangle, drawPath, drawPolygon, drawPolyline, drawLine, calculateShapes, drawDiamond, drawTriangle, drawCross, drawHorizontalLine, drawVerticalLine, drawStar, drawBalloon, drawPattern, getFieldData, checkShapeDataFields, checkPropertyPath, filter, getRatioOfBubble, findMidPointOfPolygon, isCustomPath, textTrim, findPosition, removeElement, calculateCenterFromPixel, getTranslate, getZoomTranslate, fixInitialScaleForTile, getElementByID, getClientElement, Internalize, getTemplateFunction, getElement, getShapeData, triggerShapeEvent, getElementsByClassName, querySelector, getTargetElement, createStyle, customizeStyle, triggerItemSelectionEvent, removeClass, elementAnimate, timeout, showTooltip, wordWrap, createTooltip, drawSymbol, renderLegendShape, getElementOffset, changeBorderWidth, changeNavaigationLineWidth, targetTouches, calculateScale, getDistance, getTouches, getTouchCenter, sum, zoomAnimate, animate, MapAjax, smoothTranslate, compareZoomFactor, calculateZoomLevel, processResult, LayerPanel, Bubble, BingMap, Marker, ColorMapping, DataLabel, NavigationLine, Legend, Highlight, Selection, MapsTooltip, Zoom, Annotations, Print, ImageExport, PdfExport };
|
|
14873
15396
|
//# sourceMappingURL=ej2-maps.es2015.js.map
|