@syncfusion/ej2-maps 19.4.55 → 19.4.56-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 -430
- 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 +1205 -644
- package/dist/es6/ej2-maps.es2015.js.map +1 -1
- package/dist/es6/ej2-maps.es5.js +1243 -683
- 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 +164 -97
- 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 +34 -33
- package/src/maps/model/export-pdf.d.ts +4 -6
- package/src/maps/model/export-pdf.js +31 -32
- package/src/maps/model/interface.d.ts +34 -26
- package/src/maps/model/print.d.ts +2 -5
- package/src/maps/model/print.js +32 -18
- 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 +9 -1
- package/src/maps/utils/helper.js +82 -33
package/dist/es6/ej2-maps.es5.js
CHANGED
|
@@ -3,19 +3,19 @@ import { SvgRenderer, Tooltip } from '@syncfusion/ej2-svg-base';
|
|
|
3
3
|
import { DataManager, Query } from '@syncfusion/ej2-data';
|
|
4
4
|
import { PdfBitmap, PdfDocument, PdfPageOrientation } from '@syncfusion/ej2-pdf-export';
|
|
5
5
|
|
|
6
|
-
var __extends$1 = (undefined && undefined.__extends) || (function () {
|
|
7
|
-
var extendStatics = function (d, b) {
|
|
8
|
-
extendStatics = Object.setPrototypeOf ||
|
|
9
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
10
|
-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
11
|
-
return extendStatics(d, b);
|
|
12
|
-
};
|
|
13
|
-
return function (d, b) {
|
|
14
|
-
extendStatics(d, b);
|
|
15
|
-
function __() { this.constructor = d; }
|
|
16
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
17
|
-
};
|
|
18
|
-
})();
|
|
6
|
+
var __extends$1 = (undefined && undefined.__extends) || (function () {
|
|
7
|
+
var extendStatics = function (d, b) {
|
|
8
|
+
extendStatics = Object.setPrototypeOf ||
|
|
9
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
10
|
+
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
11
|
+
return extendStatics(d, b);
|
|
12
|
+
};
|
|
13
|
+
return function (d, b) {
|
|
14
|
+
extendStatics(d, b);
|
|
15
|
+
function __() { this.constructor = d; }
|
|
16
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
17
|
+
};
|
|
18
|
+
})();
|
|
19
19
|
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
|
20
20
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
21
21
|
/* eslint-disable max-len */
|
|
@@ -788,6 +788,8 @@ function drawSymbols(shape, imageUrl, location, markerID, shapeCustom, markerCol
|
|
|
788
788
|
var opacity = shapeCustom['opacity'];
|
|
789
789
|
var rectOptions;
|
|
790
790
|
var pathOptions = new PathOption(markerID, fill, borderWidth, borderColor, opacity, borderOpacity, dashArray, '');
|
|
791
|
+
size.width = typeof (size.width) === 'string' ? parseInt(size.width, 10) : size.width;
|
|
792
|
+
size.height = typeof (size.height) === 'string' ? parseInt(size.height, 10) : size.height;
|
|
791
793
|
if (shape === 'Circle') {
|
|
792
794
|
var radius = (size.width + size.height) / 4;
|
|
793
795
|
var circleOptions = new CircleOption(markerID, fill, border, opacity, location.x, location.y, radius, dashArray);
|
|
@@ -1005,8 +1007,8 @@ function clusterTemplate(currentLayer, markerTemplate, maps, layerIndex, markerC
|
|
|
1005
1007
|
shapeCustom['borderWidth'] = eventArg.border.width;
|
|
1006
1008
|
shapeCustom['borderOpacity'] = isNullOrUndefined(eventArg.border.opacity) ? clusters_1.opacity : eventArg.border.opacity;
|
|
1007
1009
|
}
|
|
1008
|
-
tempX = (maps.isTileMap) ? tempX : (markerTemplate.id.indexOf('_Markers_Group') > -1) ? tempX :
|
|
1009
|
-
tempY = (maps.isTileMap) ? tempY : (markerTemplate.id.indexOf('_Markers_Group') > -1) ? tempY :
|
|
1010
|
+
tempX = (maps.isTileMap) ? tempX : (markerTemplate.id.indexOf('_Markers_Group') > -1) ? tempX : tempX + postionY - (eventArg.width / 2);
|
|
1011
|
+
tempY = (maps.isTileMap) ? tempY : (markerTemplate.id.indexOf('_Markers_Group') > -1) ? tempY : tempY - (eventArg.height / 2);
|
|
1010
1012
|
if (maps.isTileMap && !maps.zoomSettings.enable) {
|
|
1011
1013
|
tempX = location_1.x;
|
|
1012
1014
|
tempY = location_1.y;
|
|
@@ -1085,12 +1087,15 @@ function clusterTemplate(currentLayer, markerTemplate, maps, layerIndex, markerC
|
|
|
1085
1087
|
getElementByID(maps.element.id + '_Secondary_Element').appendChild(markerCollection);
|
|
1086
1088
|
layerElement.appendChild(markerCollection);
|
|
1087
1089
|
}
|
|
1088
|
-
var markerCluster = document.getElementById(maps.element.id + '
|
|
1090
|
+
var markerCluster = document.getElementById(maps.element.id + '_LayerIndex_' + layerIndex + '_markerCluster');
|
|
1089
1091
|
if (!isNullOrUndefined(markerCluster)) {
|
|
1090
1092
|
markerCluster.remove();
|
|
1091
1093
|
}
|
|
1092
1094
|
if (zoomCheck) {
|
|
1093
|
-
document.getElementById(maps.element.id + '_Layer_Collections')
|
|
1095
|
+
var layerGroupElement = document.getElementById(maps.element.id + '_Layer_Collections');
|
|
1096
|
+
if (!isNullOrUndefined(layerGroupElement)) {
|
|
1097
|
+
layerGroupElement.appendChild(layerElement);
|
|
1098
|
+
}
|
|
1094
1099
|
}
|
|
1095
1100
|
});
|
|
1096
1101
|
}
|
|
@@ -1107,15 +1112,16 @@ function mergeSeparateCluster(sameMarkerData, maps, markerElement) {
|
|
|
1107
1112
|
var markerIndex = sameMarkerData[0].markerIndex;
|
|
1108
1113
|
var dataIndex = sameMarkerData[0].dataIndex;
|
|
1109
1114
|
var markerId = maps.element.id + '_LayerIndex_' + layerIndex + '_MarkerIndex_' + markerIndex;
|
|
1115
|
+
var marker = maps.layers[layerIndex].markerSettings[markerIndex];
|
|
1110
1116
|
var clusterId = markerId + '_dataIndex_' + dataIndex + '_cluster_' + clusterIndex;
|
|
1111
|
-
var clusterEle = getElement(clusterId);
|
|
1117
|
+
var clusterEle = maps.layers[layerIndex].markerClusterSettings.shape === 'Balloon' ? getElement(clusterId + '_Group') : getElement(clusterId);
|
|
1112
1118
|
var clusterEleLabel = getElement(clusterId + '_datalabel_' + clusterIndex);
|
|
1113
1119
|
clusterEle.setAttribute('visibility', 'visible');
|
|
1114
1120
|
clusterEleLabel.setAttribute('visibility', 'visible');
|
|
1115
1121
|
var markerEle;
|
|
1116
1122
|
var markerDataLength = sameMarkerData[0].data.length;
|
|
1117
1123
|
for (var i = 0; i < markerDataLength; i++) {
|
|
1118
|
-
markerEle = getElement(markerId + '_dataIndex_' + sameMarkerData[0].data[i]['index']);
|
|
1124
|
+
markerEle = marker.shape === 'Balloon' ? getElement(markerId + '_dataIndex_' + sameMarkerData[0].data[i]['index'] + '_Group') : getElement(markerId + '_dataIndex_' + sameMarkerData[0].data[i]['index']);
|
|
1119
1125
|
markerEle['style']['visibility'] = 'hidden';
|
|
1120
1126
|
}
|
|
1121
1127
|
removeElement(maps.element.id + '_LayerIndex_' + layerIndex + '_MarkerIndex_' + markerIndex + '_markerClusterConnectorLine');
|
|
@@ -1137,13 +1143,13 @@ function clusterSeparate(sameMarkerData, maps, markerElement, isDom) {
|
|
|
1137
1143
|
var getElementFunction = isDom ? getElement : markerElement.querySelector.bind(markerElement);
|
|
1138
1144
|
var getQueryConnect = isDom ? '' : '#';
|
|
1139
1145
|
var markerId = maps.element.id + '_LayerIndex_' + layerIndex + '_MarkerIndex_' + markerIndex;
|
|
1146
|
+
var marker = maps.layers[layerIndex].markerSettings[markerIndex];
|
|
1140
1147
|
var clusterId = markerId + '_dataIndex_' + dataIndex + '_cluster_' + clusterIndex;
|
|
1141
|
-
var clusterEle = getElementFunction(getQueryConnect + '' + clusterId);
|
|
1148
|
+
var clusterEle = maps.layers[layerIndex].markerClusterSettings.shape === 'Balloon' ? getElementFunction(getQueryConnect + '' + clusterId + '_Group') : getElementFunction(getQueryConnect + '' + clusterId);
|
|
1142
1149
|
var clusterEleLabel = getElementFunction(getQueryConnect + '' + clusterId + '_datalabel_' + clusterIndex);
|
|
1143
1150
|
clusterEle.setAttribute('visibility', 'hidden');
|
|
1144
1151
|
clusterEleLabel.setAttribute('visibility', 'hidden');
|
|
1145
|
-
var
|
|
1146
|
-
var markerEle = getElementFunction(getQueryConnect + '' + markerId + '_dataIndex_' + dataIndex);
|
|
1152
|
+
var markerEle = marker.shape === 'Balloon' ? getElementFunction(getQueryConnect + '' + markerId + '_dataIndex_' + dataIndex + '_Group') : getElementFunction(getQueryConnect + '' + markerId + '_dataIndex_' + dataIndex);
|
|
1147
1153
|
var height = markerEle.parentElement.id.indexOf('Template_Group') > -1 ? markerEle.getBoundingClientRect().height : marker.height;
|
|
1148
1154
|
var width = markerEle.parentElement.id.indexOf('Template_Group') > -1 ? markerEle.getBoundingClientRect().width : marker.width;
|
|
1149
1155
|
var centerX = +clusterEle.getAttribute('transform').split('translate(')[1].trim().split(' ')[0];
|
|
@@ -1179,7 +1185,7 @@ function clusterSeparate(sameMarkerData, maps, markerElement, isDom) {
|
|
|
1179
1185
|
var x1 = centerX + radius * Math.sin((Math.PI * 2 * newAngle) / 360);
|
|
1180
1186
|
var y1 = centerY + radius * Math.cos((Math.PI * 2 * newAngle) / 360);
|
|
1181
1187
|
path += start + 'L ' + (x1) + ' ' + y1 + ' ';
|
|
1182
|
-
markerEle = getElementFunction(getQueryConnect + '' + markerId + '_dataIndex_' + sameMarkerData[0].data[i]['index']);
|
|
1188
|
+
markerEle = marker.shape === 'Balloon' ? getElementFunction(getQueryConnect + '' + markerId + '_dataIndex_' + sameMarkerData[0].data[i]['index'] + '_Group') : getElementFunction(getQueryConnect + '' + markerId + '_dataIndex_' + sameMarkerData[0].data[i]['index']);
|
|
1183
1189
|
if (markerEle.parentElement.id.indexOf('Template_Group') > -1) {
|
|
1184
1190
|
markerEle['style']['transform'] = '';
|
|
1185
1191
|
markerEle['style']['left'] = maps.isTileMap ? x1 - (width / 2) + 'px' : (x1 - (width / 2) - 10) + 'px';
|
|
@@ -1200,7 +1206,12 @@ function clusterSeparate(sameMarkerData, maps, markerElement, isDom) {
|
|
|
1200
1206
|
markerElement = isDom ? getElementFunction(maps.element.id + '_Markers_Group') : markerElement;
|
|
1201
1207
|
var groupEle = maps.renderer.createGroup({ id: maps.element.id + '_LayerIndex_' + layerIndex + '_MarkerIndex_' + markerIndex + '_markerClusterConnectorLine' });
|
|
1202
1208
|
groupEle.appendChild(maps.renderer.drawPath(options));
|
|
1203
|
-
|
|
1209
|
+
if (marker.shape === 'Balloon') {
|
|
1210
|
+
markerElement.insertBefore(groupEle, markerElement.querySelector('#' + markerId + '_dataIndex_0_Group'));
|
|
1211
|
+
}
|
|
1212
|
+
else {
|
|
1213
|
+
markerElement.insertBefore(groupEle, markerElement.querySelector('#' + markerId + '_dataIndex_0'));
|
|
1214
|
+
}
|
|
1204
1215
|
}
|
|
1205
1216
|
/**
|
|
1206
1217
|
*
|
|
@@ -1227,6 +1238,7 @@ function marker(eventArgs, markerSettings, markerData, dataIndex, location, tran
|
|
|
1227
1238
|
dashArray: markerSettings.dashArray, borderOpacity: isNullOrUndefined(eventArgs.border.opacity) ? markerSettings.opacity :
|
|
1228
1239
|
eventArgs.border.opacity
|
|
1229
1240
|
};
|
|
1241
|
+
removeElement(markerID);
|
|
1230
1242
|
var ele = drawSymbols(eventArgs.shape, eventArgs.imageUrl, { x: 0, y: 0 }, markerID, shapeCustom, markerCollection, maps);
|
|
1231
1243
|
var x = (maps.isTileMap ? location.x : (location.x + transPoint.x) * scale) + offset.x;
|
|
1232
1244
|
var y = (maps.isTileMap ? location.y : (location.y + transPoint.y) * scale) + offset.y;
|
|
@@ -1257,7 +1269,7 @@ function marker(eventArgs, markerSettings, markerData, dataIndex, location, tran
|
|
|
1257
1269
|
*/
|
|
1258
1270
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1259
1271
|
function markerTemplate(eventArgs, templateFn, markerID, data, markerIndex, markerTemplate, location, transPoint, scale, offset, maps) {
|
|
1260
|
-
templateFn = getTemplateFunction(eventArgs.template);
|
|
1272
|
+
templateFn = getTemplateFunction(eventArgs.template, maps);
|
|
1261
1273
|
if (templateFn && (templateFn(data, maps, eventArgs.template, maps.element.id + '_MarkerTemplate' + markerIndex, false).length)) {
|
|
1262
1274
|
var templateElement = templateFn(data, maps, eventArgs.template, maps.element.id + '_MarkerTemplate' + markerIndex, false);
|
|
1263
1275
|
var markerElement = convertElement(templateElement, markerID, data, markerIndex, maps);
|
|
@@ -1293,8 +1305,10 @@ function maintainSelection(elementId, elementClass, element, className) {
|
|
|
1293
1305
|
if (elementId) {
|
|
1294
1306
|
for (var index = 0; index < elementId.length; index++) {
|
|
1295
1307
|
if (element.getAttribute('id') === elementId[index]) {
|
|
1296
|
-
if (
|
|
1297
|
-
|
|
1308
|
+
if (index === 0 || element.tagName === 'g') {
|
|
1309
|
+
if (!isNullOrUndefined(elementClass) && !isNullOrUndefined(elementClass.id)) {
|
|
1310
|
+
document.body.appendChild(elementClass);
|
|
1311
|
+
}
|
|
1298
1312
|
if (element.id.indexOf('_MarkerIndex_') > -1 && element.childElementCount > 0) {
|
|
1299
1313
|
element.children[0].setAttribute('class', className);
|
|
1300
1314
|
}
|
|
@@ -1602,7 +1616,7 @@ function drawBalloon(maps, options, size, location, type, element) {
|
|
|
1602
1616
|
var y = size.height / 30;
|
|
1603
1617
|
balloon.setAttribute('transform', 'translate(' + location.x + ', ' + location.y + ') scale(' + x + ', ' + y + ')');
|
|
1604
1618
|
if (type === 'Marker') {
|
|
1605
|
-
var g = maps.renderer.createGroup({ id: options.id });
|
|
1619
|
+
var g = maps.renderer.createGroup({ id: options.id + '_Group' });
|
|
1606
1620
|
appendShape(balloon, g);
|
|
1607
1621
|
pathElement = appendShape(g, element);
|
|
1608
1622
|
}
|
|
@@ -2020,7 +2034,12 @@ function getTranslate(mapObject, layer, animate) {
|
|
|
2020
2034
|
}
|
|
2021
2035
|
else {
|
|
2022
2036
|
if (isNullOrUndefined(mapObject.previousProjection) || mapObject.previousProjection !== mapObject.projectionType) {
|
|
2037
|
+
if (mapHeight === 0 || mapWidth === 0 || mapHeight === mapWidth) {
|
|
2038
|
+
mapWidth = size.width / 2;
|
|
2039
|
+
mapHeight = size.height;
|
|
2040
|
+
}
|
|
2023
2041
|
scaleFactor = parseFloat(Math.min(size.width / mapWidth, size.height / mapHeight).toFixed(2));
|
|
2042
|
+
scaleFactor = scaleFactor > 1.05 ? 1 : scaleFactor;
|
|
2024
2043
|
mapWidth *= scaleFactor;
|
|
2025
2044
|
mapHeight *= scaleFactor;
|
|
2026
2045
|
var widthDiff = min['x'] !== 0 && mapObject.translateType === 'layers' ? availSize.width - size.width : 0;
|
|
@@ -2069,8 +2088,9 @@ function getTranslate(mapObject, layer, animate) {
|
|
|
2069
2088
|
mapObject.zoomTranslatePoint.y = y;
|
|
2070
2089
|
}
|
|
2071
2090
|
else {
|
|
2072
|
-
if (!isNullOrUndefined(mapObject.previousProjection) && mapObject.mapScaleValue === 1 && !mapObject.zoomModule.isDragZoom) {
|
|
2091
|
+
if (!isNullOrUndefined(mapObject.previousProjection) && (mapObject.mapScaleValue === 1 || mapObject.mapScaleValue <= 1.05) && !mapObject.zoomModule.isDragZoom) {
|
|
2073
2092
|
scaleFactor = parseFloat(Math.min(size.width / mapWidth, size.height / mapHeight).toFixed(2));
|
|
2093
|
+
scaleFactor = scaleFactor > 1.05 ? 1 : scaleFactor;
|
|
2074
2094
|
mapWidth *= scaleFactor;
|
|
2075
2095
|
x = size.x + ((-(min['x'])) + ((size.width / 2) - (mapWidth / 2)));
|
|
2076
2096
|
mapHeight *= scaleFactor;
|
|
@@ -2227,6 +2247,8 @@ function getZoomTranslate(mapObject, layer, animate) {
|
|
|
2227
2247
|
}
|
|
2228
2248
|
}
|
|
2229
2249
|
scaleFactor = (mapObject.enablePersistence) ? (mapObject.mapScaleValue === 0 ? 1 : mapObject.mapScaleValue) : scaleFactor;
|
|
2250
|
+
mapObject.widthBeforeRefresh = mapObject.availableSize.width;
|
|
2251
|
+
mapObject.heightBeforeRefresh = mapObject.availableSize.height;
|
|
2230
2252
|
return { scale: animate ? 1 : scaleFactor, location: new Point(x, y) };
|
|
2231
2253
|
}
|
|
2232
2254
|
/**
|
|
@@ -2254,6 +2276,22 @@ function fixInitialScaleForTile(map) {
|
|
|
2254
2276
|
function getElementByID(id) {
|
|
2255
2277
|
return document.getElementById(id);
|
|
2256
2278
|
}
|
|
2279
|
+
/**
|
|
2280
|
+
* Function to get clientElement from id.
|
|
2281
|
+
*
|
|
2282
|
+
* @param {string} id - Specifies the id
|
|
2283
|
+
* @returns {Element} - Returns the element
|
|
2284
|
+
* @private
|
|
2285
|
+
*/
|
|
2286
|
+
function getClientElement(id) {
|
|
2287
|
+
var element = document.getElementById(id);
|
|
2288
|
+
if (!isNullOrUndefined(element)) {
|
|
2289
|
+
return element.getClientRects()[0];
|
|
2290
|
+
}
|
|
2291
|
+
else {
|
|
2292
|
+
return null;
|
|
2293
|
+
}
|
|
2294
|
+
}
|
|
2257
2295
|
/**
|
|
2258
2296
|
* To apply internalization
|
|
2259
2297
|
*
|
|
@@ -2274,7 +2312,7 @@ function Internalize(maps, value) {
|
|
|
2274
2312
|
* @private
|
|
2275
2313
|
*/
|
|
2276
2314
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2277
|
-
function getTemplateFunction(template) {
|
|
2315
|
+
function getTemplateFunction(template, maps) {
|
|
2278
2316
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2279
2317
|
var templateFn = null;
|
|
2280
2318
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -2282,6 +2320,9 @@ function getTemplateFunction(template) {
|
|
|
2282
2320
|
if (document.querySelectorAll(template).length) {
|
|
2283
2321
|
templateFn = compile(document.querySelector(template).innerHTML.trim());
|
|
2284
2322
|
}
|
|
2323
|
+
else if (maps.isVue || maps.isVue3) {
|
|
2324
|
+
templateFn = compile(template);
|
|
2325
|
+
}
|
|
2285
2326
|
}
|
|
2286
2327
|
catch (e) {
|
|
2287
2328
|
templateFn = compile(template);
|
|
@@ -2685,6 +2726,7 @@ function createTooltip(id, text, top, left, fontSize) {
|
|
|
2685
2726
|
'left:' + left.toString() + 'px;' +
|
|
2686
2727
|
'color: #000000; ' +
|
|
2687
2728
|
'background:' + '#FFFFFF' + ';' +
|
|
2729
|
+
'z-index: 2;' +
|
|
2688
2730
|
'position:absolute;border:1px solid #707070;font-size:' + fontSize + ';border-radius:2px;';
|
|
2689
2731
|
if (!tooltip) {
|
|
2690
2732
|
tooltip = createElement('div', {
|
|
@@ -2873,6 +2915,7 @@ function changeBorderWidth(element, index, scale, maps) {
|
|
|
2873
2915
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2874
2916
|
var borderWidthValue = maps.layersCollection[index].shapeSettings.borderWidthValuePath;
|
|
2875
2917
|
var borderWidth = maps.layersCollection[index].shapeSettings.border.width;
|
|
2918
|
+
var circleRadius = maps.layersCollection[index].shapeSettings.circleRadius;
|
|
2876
2919
|
if (maps.layersCollection[index].shapeSettings.borderWidthValuePath) {
|
|
2877
2920
|
value = checkShapeDataFields(
|
|
2878
2921
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -2885,13 +2928,16 @@ function changeBorderWidth(element, index, scale, maps) {
|
|
|
2885
2928
|
currentStroke = (isNullOrUndefined(borderWidth) ? 0 : borderWidth);
|
|
2886
2929
|
}
|
|
2887
2930
|
}
|
|
2931
|
+
else {
|
|
2932
|
+
currentStroke = (isNullOrUndefined(borderWidth) ? 0 : borderWidth);
|
|
2933
|
+
}
|
|
2888
2934
|
}
|
|
2889
2935
|
else {
|
|
2890
2936
|
currentStroke = (isNullOrUndefined(borderWidth) ? 0 : borderWidth);
|
|
2891
2937
|
}
|
|
2892
2938
|
childNode.setAttribute('stroke-width', (currentStroke / scale).toString());
|
|
2893
|
-
if (element.id.indexOf('
|
|
2894
|
-
childNode.setAttribute('
|
|
2939
|
+
if (element.id.indexOf('_Point') > -1 || element.id.indexOf('_MultiPoint') > -1) {
|
|
2940
|
+
childNode.setAttribute('r', (circleRadius / scale).toString());
|
|
2895
2941
|
}
|
|
2896
2942
|
}
|
|
2897
2943
|
}
|
|
@@ -3085,7 +3131,10 @@ function animate(element, delay, duration, process, end) {
|
|
|
3085
3131
|
else {
|
|
3086
3132
|
window.cancelAnimationFrame(clearAnimation);
|
|
3087
3133
|
end.call(_this, { element: element });
|
|
3088
|
-
element.
|
|
3134
|
+
if (element.id.indexOf('Marker') > -1) {
|
|
3135
|
+
var markerElement = getElementByID(element.id.split('_Layer')[0] + '_Markers_Group');
|
|
3136
|
+
markerElement.setAttribute('style', markerStyle);
|
|
3137
|
+
}
|
|
3089
3138
|
}
|
|
3090
3139
|
};
|
|
3091
3140
|
clearAnimation = window.requestAnimationFrame(startAnimation);
|
|
@@ -3413,11 +3462,11 @@ function getShapeColor(theme) {
|
|
|
3413
3462
|
themePalette = ['#5ECB9B', '#A860F1', '#EBA844', '#557EF7', '#E9599B',
|
|
3414
3463
|
'#BFC529', '#3BC6CF', '#7A68EC', '#74B706', '#EA6266'];
|
|
3415
3464
|
break;
|
|
3416
|
-
case '
|
|
3465
|
+
case 'fluent':
|
|
3417
3466
|
themePalette = ['#614570', '#4C6FB1', '#CC6952', '#3F579A', '#4EA09B',
|
|
3418
3467
|
'#6E7A89', '#D4515C', '#E6AF5D', '#639751', '#9D4D69'];
|
|
3419
3468
|
break;
|
|
3420
|
-
case '
|
|
3469
|
+
case 'fluentdark':
|
|
3421
3470
|
themePalette = ['#8AB113', '#2A72D5', '#43B786', '#584EC6', '#E85F9C',
|
|
3422
3471
|
'#6E7A89', '#EA6266', '#EBA844', '#26BC7A', '#BC4870'];
|
|
3423
3472
|
break;
|
|
@@ -3558,6 +3607,7 @@ function getThemeStyle(theme) {
|
|
|
3558
3607
|
backgroundColor: color,
|
|
3559
3608
|
areaBackgroundColor: color,
|
|
3560
3609
|
titleFontColor: '#FFFFFF',
|
|
3610
|
+
titleFontSize: '14px',
|
|
3561
3611
|
subTitleFontColor: '#FFFFFF',
|
|
3562
3612
|
legendTitleFontColor: '#DADADA',
|
|
3563
3613
|
legendTextColor: '#DADADA',
|
|
@@ -3577,6 +3627,7 @@ function getThemeStyle(theme) {
|
|
|
3577
3627
|
backgroundColor: '#000000',
|
|
3578
3628
|
areaBackgroundColor: '#000000',
|
|
3579
3629
|
titleFontColor: '#FFFFFF',
|
|
3630
|
+
titleFontSize: '14px',
|
|
3580
3631
|
subTitleFontColor: '#FFFFFF',
|
|
3581
3632
|
legendTitleFontColor: '#FFFFFF',
|
|
3582
3633
|
legendTextColor: '#FFFFFF',
|
|
@@ -3706,7 +3757,7 @@ function getThemeStyle(theme) {
|
|
|
3706
3757
|
shapeFill: '#495057'
|
|
3707
3758
|
};
|
|
3708
3759
|
break;
|
|
3709
|
-
case '
|
|
3760
|
+
case 'fluent':
|
|
3710
3761
|
style = {
|
|
3711
3762
|
backgroundColor: 'rgba(255,255,255, 0.0)',
|
|
3712
3763
|
areaBackgroundColor: 'rgba(255,255,255, 0.0)',
|
|
@@ -3729,7 +3780,7 @@ function getThemeStyle(theme) {
|
|
|
3729
3780
|
shapeFill: '#F3F2F1'
|
|
3730
3781
|
};
|
|
3731
3782
|
break;
|
|
3732
|
-
case '
|
|
3783
|
+
case 'fluentdark':
|
|
3733
3784
|
style = {
|
|
3734
3785
|
backgroundColor: 'rgba(255,255,255, 0.0)',
|
|
3735
3786
|
areaBackgroundColor: 'rgba(255,255,255, 0.0)',
|
|
@@ -3757,6 +3808,7 @@ function getThemeStyle(theme) {
|
|
|
3757
3808
|
backgroundColor: '#FFFFFF',
|
|
3758
3809
|
areaBackgroundColor: '#FFFFFF',
|
|
3759
3810
|
titleFontColor: '#424242',
|
|
3811
|
+
titleFontSize: '14px',
|
|
3760
3812
|
subTitleFontColor: '#424242',
|
|
3761
3813
|
legendTitleFontColor: '#757575',
|
|
3762
3814
|
legendTextColor: '#757575',
|
|
@@ -3775,25 +3827,25 @@ function getThemeStyle(theme) {
|
|
|
3775
3827
|
return style;
|
|
3776
3828
|
}
|
|
3777
3829
|
|
|
3778
|
-
var __extends$2 = (undefined && undefined.__extends) || (function () {
|
|
3779
|
-
var extendStatics = function (d, b) {
|
|
3780
|
-
extendStatics = Object.setPrototypeOf ||
|
|
3781
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
3782
|
-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
3783
|
-
return extendStatics(d, b);
|
|
3784
|
-
};
|
|
3785
|
-
return function (d, b) {
|
|
3786
|
-
extendStatics(d, b);
|
|
3787
|
-
function __() { this.constructor = d; }
|
|
3788
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
3789
|
-
};
|
|
3790
|
-
})();
|
|
3791
|
-
var __decorate$1 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
3792
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3793
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
3794
|
-
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;
|
|
3795
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3796
|
-
};
|
|
3830
|
+
var __extends$2 = (undefined && undefined.__extends) || (function () {
|
|
3831
|
+
var extendStatics = function (d, b) {
|
|
3832
|
+
extendStatics = Object.setPrototypeOf ||
|
|
3833
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
3834
|
+
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
3835
|
+
return extendStatics(d, b);
|
|
3836
|
+
};
|
|
3837
|
+
return function (d, b) {
|
|
3838
|
+
extendStatics(d, b);
|
|
3839
|
+
function __() { this.constructor = d; }
|
|
3840
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
3841
|
+
};
|
|
3842
|
+
})();
|
|
3843
|
+
var __decorate$1 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
3844
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3845
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
3846
|
+
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;
|
|
3847
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3848
|
+
};
|
|
3797
3849
|
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
|
3798
3850
|
/**
|
|
3799
3851
|
* Maps base document
|
|
@@ -4281,7 +4333,7 @@ var SubTitleSettings = /** @__PURE__ @class */ (function (_super) {
|
|
|
4281
4333
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
4282
4334
|
}
|
|
4283
4335
|
__decorate$1([
|
|
4284
|
-
Complex({ size:
|
|
4336
|
+
Complex({ size: null, fontWeight: null, fontFamily: null }, Font)
|
|
4285
4337
|
], SubTitleSettings.prototype, "textStyle", void 0);
|
|
4286
4338
|
__decorate$1([
|
|
4287
4339
|
Property('Center')
|
|
@@ -4297,7 +4349,7 @@ var TitleSettings = /** @__PURE__ @class */ (function (_super) {
|
|
|
4297
4349
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
4298
4350
|
}
|
|
4299
4351
|
__decorate$1([
|
|
4300
|
-
Complex({ size:
|
|
4352
|
+
Complex({ size: null, fontWeight: null, fontFamily: null }, Font)
|
|
4301
4353
|
], TitleSettings.prototype, "textStyle", void 0);
|
|
4302
4354
|
__decorate$1([
|
|
4303
4355
|
Property('Center')
|
|
@@ -4441,7 +4493,7 @@ var LegendSettings = /** @__PURE__ @class */ (function (_super) {
|
|
|
4441
4493
|
Property('')
|
|
4442
4494
|
], LegendSettings.prototype, "height", void 0);
|
|
4443
4495
|
__decorate$1([
|
|
4444
|
-
Complex({}, Font)
|
|
4496
|
+
Complex({ fontFamily: null }, Font)
|
|
4445
4497
|
], LegendSettings.prototype, "textStyle", void 0);
|
|
4446
4498
|
__decorate$1([
|
|
4447
4499
|
Property(15)
|
|
@@ -4462,7 +4514,7 @@ var LegendSettings = /** @__PURE__ @class */ (function (_super) {
|
|
|
4462
4514
|
Complex({}, CommonTitleSettings)
|
|
4463
4515
|
], LegendSettings.prototype, "title", void 0);
|
|
4464
4516
|
__decorate$1([
|
|
4465
|
-
Complex(Theme.legendTitleFont, Font)
|
|
4517
|
+
Complex({ size: Theme.legendTitleFont.size, color: Theme.legendTitleFont.color, fontStyle: Theme.legendTitleFont.fontStyle, fontWeight: Theme.legendTitleFont.fontWeight, fontFamily: null }, Font)
|
|
4466
4518
|
], LegendSettings.prototype, "titleStyle", void 0);
|
|
4467
4519
|
__decorate$1([
|
|
4468
4520
|
Property('Bottom')
|
|
@@ -4725,7 +4777,7 @@ var LayerSettings = /** @__PURE__ @class */ (function (_super) {
|
|
|
4725
4777
|
Property('Geometry')
|
|
4726
4778
|
], LayerSettings.prototype, "layerType", void 0);
|
|
4727
4779
|
__decorate$1([
|
|
4728
|
-
Property('
|
|
4780
|
+
Property('')
|
|
4729
4781
|
], LayerSettings.prototype, "urlTemplate", void 0);
|
|
4730
4782
|
__decorate$1([
|
|
4731
4783
|
Property(true)
|
|
@@ -4817,102 +4869,103 @@ var Marker = /** @__PURE__ @class */ (function () {
|
|
|
4817
4869
|
this.trackElements = [];
|
|
4818
4870
|
this.sameMarkerData = [];
|
|
4819
4871
|
}
|
|
4820
|
-
Marker.prototype.markerRender = function (layerElement, layerIndex, factor, type) {
|
|
4872
|
+
Marker.prototype.markerRender = function (maps, layerElement, layerIndex, factor, type) {
|
|
4821
4873
|
var _this = this;
|
|
4822
4874
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4823
4875
|
var templateFn;
|
|
4824
4876
|
var markerCount = 0;
|
|
4825
4877
|
var nullCount = 0;
|
|
4826
4878
|
var markerTemplateCount = 0;
|
|
4827
|
-
|
|
4828
|
-
var currentLayer =
|
|
4829
|
-
this.markerSVGObject =
|
|
4830
|
-
id:
|
|
4879
|
+
maps.translateType = 'marker';
|
|
4880
|
+
var currentLayer = maps.layersCollection[layerIndex];
|
|
4881
|
+
this.markerSVGObject = maps.renderer.createGroup({
|
|
4882
|
+
id: maps.element.id + '_Markers_Group',
|
|
4831
4883
|
class: 'GroupElement',
|
|
4832
4884
|
style: 'pointer-events: auto;'
|
|
4833
4885
|
});
|
|
4834
4886
|
var markerTemplateEle = createElement('div', {
|
|
4835
|
-
id:
|
|
4836
|
-
className:
|
|
4887
|
+
id: maps.element.id + '_LayerIndex_' + layerIndex + '_Markers_Template_Group',
|
|
4888
|
+
className: maps.element.id + '_template',
|
|
4837
4889
|
styles: 'overflow: hidden; position: absolute;pointer-events: none;' +
|
|
4838
|
-
'top:' +
|
|
4839
|
-
'left:' +
|
|
4840
|
-
'height:' +
|
|
4841
|
-
'width:' +
|
|
4890
|
+
'top:' + maps.mapAreaRect.y + 'px;' +
|
|
4891
|
+
'left:' + maps.mapAreaRect.x + 'px;' +
|
|
4892
|
+
'height:' + maps.mapAreaRect.height + 'px;' +
|
|
4893
|
+
'width:' + maps.mapAreaRect.width + 'px;'
|
|
4842
4894
|
});
|
|
4843
4895
|
currentLayer.markerSettings.map(function (markerSettings, markerIndex) {
|
|
4844
4896
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4845
4897
|
var markerData = markerSettings.dataSource;
|
|
4846
4898
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4847
4899
|
Array.prototype.forEach.call(markerData, function (data, dataIndex) {
|
|
4848
|
-
|
|
4900
|
+
maps.markerNullCount = markerIndex > 0 && dataIndex === 0 ? 0 : maps.markerNullCount;
|
|
4849
4901
|
var eventArgs = {
|
|
4850
4902
|
cancel: false, name: markerRendering, fill: markerSettings.fill, height: markerSettings.height,
|
|
4851
4903
|
width: markerSettings.width, imageUrl: markerSettings.imageUrl, shape: markerSettings.shape,
|
|
4852
|
-
template: markerSettings.template, data: data, maps:
|
|
4904
|
+
template: markerSettings.template, data: data, maps: maps, marker: markerSettings,
|
|
4853
4905
|
border: markerSettings.border, colorValuePath: markerSettings.colorValuePath,
|
|
4854
4906
|
shapeValuePath: markerSettings.shapeValuePath, imageUrlValuePath: markerSettings.imageUrlValuePath
|
|
4855
4907
|
};
|
|
4856
|
-
|
|
4908
|
+
maps.trigger('markerRendering', eventArgs, function (MarkerArgs) {
|
|
4857
4909
|
eventArgs = markerColorChoose(eventArgs, data);
|
|
4858
4910
|
eventArgs = markerShapeChoose(eventArgs, data);
|
|
4859
4911
|
var lng = (!isNullOrUndefined(markerSettings.longitudeValuePath)) ?
|
|
4860
4912
|
Number(getValueFromObject(data, markerSettings.longitudeValuePath)) : !isNullOrUndefined(data['longitude']) ?
|
|
4861
|
-
parseFloat(data['longitude']) : !isNullOrUndefined(data['Longitude']) ? parseFloat(data['Longitude']) :
|
|
4913
|
+
parseFloat(data['longitude']) : !isNullOrUndefined(data['Longitude']) ? parseFloat(data['Longitude']) : null;
|
|
4862
4914
|
var lat = (!isNullOrUndefined(markerSettings.latitudeValuePath)) ?
|
|
4863
4915
|
Number(getValueFromObject(data, markerSettings.latitudeValuePath)) : !isNullOrUndefined(data['latitude']) ?
|
|
4864
|
-
parseFloat(data['latitude']) : !isNullOrUndefined(data['Latitude']) ? parseFloat(data['Latitude']) :
|
|
4916
|
+
parseFloat(data['latitude']) : !isNullOrUndefined(data['Latitude']) ? parseFloat(data['Latitude']) : null;
|
|
4865
4917
|
var offset = markerSettings.offset;
|
|
4866
4918
|
if (!eventArgs.cancel && markerSettings.visible && !isNullOrUndefined(lng) && !isNullOrUndefined(lat)) {
|
|
4867
|
-
var markerID =
|
|
4919
|
+
var markerID = maps.element.id + '_LayerIndex_' + layerIndex + '_MarkerIndex_'
|
|
4868
4920
|
+ markerIndex + '_dataIndex_' + dataIndex;
|
|
4869
|
-
var location_1 = (
|
|
4870
|
-
var animate$$1 = currentLayer.animationDuration !== 0 || isNullOrUndefined(
|
|
4921
|
+
var location_1 = (maps.isTileMap) ? convertTileLatLongToPoint(new MapLocation(lng, lat), factor, maps.tileTranslatePoint, true) : convertGeoToPoint(lat, lng, factor, currentLayer, maps);
|
|
4922
|
+
var animate$$1 = currentLayer.animationDuration !== 0 || isNullOrUndefined(maps.zoomModule);
|
|
4871
4923
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4872
|
-
var translate = (
|
|
4873
|
-
!isNullOrUndefined(
|
|
4874
|
-
getZoomTranslate(
|
|
4875
|
-
getTranslate(
|
|
4876
|
-
var scale = type === 'AddMarker' ?
|
|
4877
|
-
var transPoint = type === 'AddMarker' ?
|
|
4924
|
+
var translate = (maps.isTileMap) ? (currentLayer.type === 'SubLayer' && isNullOrUndefined(maps.zoomModule)) ? location_1 = convertTileLatLongToPoint(new MapLocation(lng, lat), maps.tileZoomLevel, maps.tileTranslatePoint, true) : new Object() :
|
|
4925
|
+
!isNullOrUndefined(maps.zoomModule) && maps.zoomSettings.zoomFactor > 1 ?
|
|
4926
|
+
getZoomTranslate(maps, currentLayer, animate$$1) :
|
|
4927
|
+
getTranslate(maps, currentLayer, animate$$1);
|
|
4928
|
+
var scale = type === 'AddMarker' ? maps.scale : translate['scale'];
|
|
4929
|
+
var transPoint = type === 'AddMarker' ? maps.translatePoint : translate['location'];
|
|
4878
4930
|
if (eventArgs.template && (!isNaN(location_1.x) && !isNaN(location_1.y))) {
|
|
4879
4931
|
markerTemplateCount++;
|
|
4880
|
-
markerTemplate(eventArgs, templateFn, markerID, data, markerIndex, markerTemplateEle, location_1, transPoint, scale, offset,
|
|
4932
|
+
markerTemplate(eventArgs, templateFn, markerID, data, markerIndex, markerTemplateEle, location_1, transPoint, scale, offset, maps);
|
|
4881
4933
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4882
|
-
|
|
4934
|
+
maps.renderReactTemplates();
|
|
4883
4935
|
}
|
|
4884
4936
|
else if (!eventArgs.template && (!isNaN(location_1.x) && !isNaN(location_1.y))) {
|
|
4885
4937
|
markerCount++;
|
|
4886
|
-
marker(eventArgs, markerSettings, markerData, dataIndex, location_1, transPoint, markerID, offset, scale,
|
|
4938
|
+
marker(eventArgs, markerSettings, markerData, dataIndex, location_1, transPoint, markerID, offset, scale, maps, _this.markerSVGObject);
|
|
4887
4939
|
}
|
|
4888
4940
|
}
|
|
4889
4941
|
nullCount += (!isNaN(lat) && !isNaN(lng)) ? 0 : 1;
|
|
4890
4942
|
markerTemplateCount += (eventArgs.cancel) ? 1 : 0;
|
|
4891
4943
|
markerCount += (eventArgs.cancel) ? 1 : 0;
|
|
4892
|
-
|
|
4893
|
-
var markerDataLength = markerData.length -
|
|
4944
|
+
maps.markerNullCount = (isNullOrUndefined(lng) || isNullOrUndefined(lat)) ? maps.markerNullCount + 1 : maps.markerNullCount;
|
|
4945
|
+
var markerDataLength = markerData.length - maps.markerNullCount;
|
|
4894
4946
|
if (_this.markerSVGObject.childElementCount === (markerDataLength - markerTemplateCount - nullCount) && (type !== 'Template')) {
|
|
4895
4947
|
layerElement.appendChild(_this.markerSVGObject);
|
|
4896
4948
|
if (currentLayer.markerClusterSettings.allowClustering) {
|
|
4897
|
-
|
|
4898
|
-
|
|
4899
|
-
if (currentLayer.layerType
|
|
4900
|
-
|
|
4949
|
+
maps.svgObject.appendChild(_this.markerSVGObject);
|
|
4950
|
+
maps.element.appendChild(maps.svgObject);
|
|
4951
|
+
if ((currentLayer.layerType === 'OSM' || (currentLayer.urlTemplate.indexOf('openstreetmap') !== -1 && isNullOrUndefined(currentLayer.shapeData)))
|
|
4952
|
+
&& maps.zoomSettings.enable) {
|
|
4953
|
+
layerElement.appendChild(_this.markerSVGObject);
|
|
4901
4954
|
}
|
|
4902
4955
|
else {
|
|
4903
|
-
|
|
4956
|
+
clusterTemplate(currentLayer, _this.markerSVGObject, maps, layerIndex, _this.markerSVGObject, layerElement, true, false);
|
|
4904
4957
|
}
|
|
4905
4958
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4906
|
-
|
|
4959
|
+
maps.renderReactTemplates();
|
|
4907
4960
|
}
|
|
4908
4961
|
}
|
|
4909
|
-
if (markerTemplateEle.childElementCount === (
|
|
4910
|
-
getElementByID(
|
|
4911
|
-
if (
|
|
4962
|
+
if (markerTemplateEle.childElementCount === (markerDataLength - markerCount - nullCount) && getElementByID(maps.element.id + '_Secondary_Element')) {
|
|
4963
|
+
getElementByID(maps.element.id + '_Secondary_Element').appendChild(markerTemplateEle);
|
|
4964
|
+
if (maps.checkInitialRender) {
|
|
4912
4965
|
if (currentLayer.markerClusterSettings.allowClustering) {
|
|
4913
|
-
clusterTemplate(currentLayer, markerTemplateEle,
|
|
4966
|
+
clusterTemplate(currentLayer, markerTemplateEle, maps, layerIndex, _this.markerSVGObject, layerElement, false, false);
|
|
4914
4967
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4915
|
-
|
|
4968
|
+
maps.renderReactTemplates();
|
|
4916
4969
|
}
|
|
4917
4970
|
}
|
|
4918
4971
|
}
|
|
@@ -5155,8 +5208,8 @@ var Marker = /** @__PURE__ @class */ (function () {
|
|
|
5155
5208
|
}
|
|
5156
5209
|
if ((target.indexOf('_cluster_') > -1)) {
|
|
5157
5210
|
var isClusterSame = false;
|
|
5158
|
-
var clusterElement = document.getElementById(target.indexOf('_datalabel_') > -1 ? target.split('_datalabel_')[0] : target);
|
|
5159
|
-
var indexes = clusterElement.innerHTML.split(',').map(Number);
|
|
5211
|
+
var 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);
|
|
5212
|
+
var indexes = layer.markerClusterSettings.shape === 'Balloon' ? clusterElement.children[0].innerHTML.split(',').map(Number) : clusterElement.innerHTML.split(',').map(Number);
|
|
5160
5213
|
collection_1 = [];
|
|
5161
5214
|
for (var _i = 0, indexes_1 = indexes; _i < indexes_1.length; _i++) {
|
|
5162
5215
|
var i = indexes_1[_i];
|
|
@@ -5225,14 +5278,14 @@ var Marker = /** @__PURE__ @class */ (function () {
|
|
|
5225
5278
|
/**
|
|
5226
5279
|
* To destroy the layers.
|
|
5227
5280
|
*
|
|
5228
|
-
* @param {Maps} maps - Specifies the instance of the map
|
|
5229
5281
|
* @returns {void}
|
|
5230
5282
|
* @private
|
|
5231
5283
|
*/
|
|
5232
|
-
Marker.prototype.destroy = function (
|
|
5233
|
-
|
|
5234
|
-
|
|
5235
|
-
|
|
5284
|
+
Marker.prototype.destroy = function () {
|
|
5285
|
+
this.maps = null;
|
|
5286
|
+
this.trackElements = [];
|
|
5287
|
+
this.markerSVGObject = null;
|
|
5288
|
+
this.sameMarkerData = [];
|
|
5236
5289
|
};
|
|
5237
5290
|
return Marker;
|
|
5238
5291
|
}());
|
|
@@ -5258,6 +5311,12 @@ var loaded = 'loaded';
|
|
|
5258
5311
|
* @private
|
|
5259
5312
|
*/
|
|
5260
5313
|
var click = 'click';
|
|
5314
|
+
/**
|
|
5315
|
+
* Specifies the maps onclick event name.
|
|
5316
|
+
*
|
|
5317
|
+
* @private
|
|
5318
|
+
*/
|
|
5319
|
+
var onclick = 'onclick';
|
|
5261
5320
|
/**
|
|
5262
5321
|
* Specifies the maps right click event name.
|
|
5263
5322
|
*
|
|
@@ -5452,9 +5511,21 @@ var BingMap = /** @__PURE__ @class */ (function () {
|
|
|
5452
5511
|
}
|
|
5453
5512
|
quadKey = quadKey + '' + digit;
|
|
5454
5513
|
}
|
|
5455
|
-
|
|
5456
|
-
|
|
5457
|
-
|
|
5514
|
+
if (!isNullOrUndefined(subDomains)) {
|
|
5515
|
+
var subDomain = subDomains[Math.min(parseInt(quadKey.substr(quadKey.length - 1, 1), 10), subDomains.length)];
|
|
5516
|
+
imageUrl = imageUrl.replace('{quadkey}', quadKey).replace('{subdomain}', subDomain);
|
|
5517
|
+
return imageUrl += '&mkt=' + language + '&ur=IN&Key=' + key;
|
|
5518
|
+
}
|
|
5519
|
+
else {
|
|
5520
|
+
return '';
|
|
5521
|
+
}
|
|
5522
|
+
};
|
|
5523
|
+
/**
|
|
5524
|
+
* @private
|
|
5525
|
+
*/
|
|
5526
|
+
BingMap.prototype.destroy = function () {
|
|
5527
|
+
this.maps = null;
|
|
5528
|
+
this.subDomains = [];
|
|
5458
5529
|
};
|
|
5459
5530
|
return BingMap;
|
|
5460
5531
|
}());
|
|
@@ -5727,8 +5798,7 @@ var LayerPanel = /** @__PURE__ @class */ (function () {
|
|
|
5727
5798
|
else {
|
|
5728
5799
|
this.clipRectElement = this.mapObject.renderer.drawClipPath(new RectOption(this.mapObject.element.id + '_MapArea_ClipRect', 'transparent', { width: 1, color: 'Gray' }, 1, {
|
|
5729
5800
|
x: this.mapObject.isTileMap ? 0 : areaRect.x, y: this.mapObject.isTileMap ? 0 : areaRect.y,
|
|
5730
|
-
width: areaRect.width, height:
|
|
5731
|
-
this.mapObject.legendModule.totalPages.length > 0 ? this.mapObject.legendModule.legendTotalRect.height : areaRect.height
|
|
5801
|
+
width: areaRect.width, height: areaRect.height
|
|
5732
5802
|
}));
|
|
5733
5803
|
}
|
|
5734
5804
|
this.layerGroup.appendChild(this.clipRectElement);
|
|
@@ -5739,6 +5809,14 @@ var LayerPanel = /** @__PURE__ @class */ (function () {
|
|
|
5739
5809
|
_this.currentLayer = layer;
|
|
5740
5810
|
_this.processLayers(layer, index);
|
|
5741
5811
|
});
|
|
5812
|
+
if (!isNullOrUndefined(this.mapObject.legendModule) && this.mapObject.legendSettings.position === 'Float') {
|
|
5813
|
+
if (this.mapObject.isTileMap) {
|
|
5814
|
+
this.layerGroup.appendChild(this.mapObject.legendModule.legendGroup);
|
|
5815
|
+
}
|
|
5816
|
+
else {
|
|
5817
|
+
this.mapObject.svgObject.appendChild(this.mapObject.legendModule.legendGroup);
|
|
5818
|
+
}
|
|
5819
|
+
}
|
|
5742
5820
|
};
|
|
5743
5821
|
/**
|
|
5744
5822
|
* Tile rendering
|
|
@@ -5866,7 +5944,7 @@ var LayerPanel = /** @__PURE__ @class */ (function () {
|
|
|
5866
5944
|
panel.layerObject.appendChild(panel.mapObject.navigationLineModule.renderNavigation(panel.currentLayer, panel.mapObject.tileZoomLevel, layerIndex));
|
|
5867
5945
|
}
|
|
5868
5946
|
if (panel.mapObject.markerModule) {
|
|
5869
|
-
panel.mapObject.markerModule.markerRender(panel.layerObject, layerIndex, panel.mapObject.tileZoomLevel, null);
|
|
5947
|
+
panel.mapObject.markerModule.markerRender(this.mapObject, panel.layerObject, layerIndex, panel.mapObject.tileZoomLevel, null);
|
|
5870
5948
|
}
|
|
5871
5949
|
panel.translateLayerElements(panel.layerObject, layerIndex);
|
|
5872
5950
|
panel.layerGroup.appendChild(panel.layerObject);
|
|
@@ -5898,9 +5976,21 @@ var LayerPanel = /** @__PURE__ @class */ (function () {
|
|
|
5898
5976
|
};
|
|
5899
5977
|
this.mapObject.trigger('layerRendering', eventArgs, function (observedArgs) {
|
|
5900
5978
|
if (!eventArgs.cancel && eventArgs.visible) {
|
|
5901
|
-
if (layer.layerType
|
|
5979
|
+
if (layer.layerType === 'OSM') {
|
|
5980
|
+
layer.urlTemplate = 'https://a.tile.openstreetmap.org/level/tileX/tileY.png';
|
|
5981
|
+
}
|
|
5982
|
+
if (layer.layerType === 'Google') {
|
|
5983
|
+
layer.urlTemplate = 'https://mt1.google.com/vt/lyrs=m@129&hl=en&x=tileX&y=tileY&z=level';
|
|
5984
|
+
}
|
|
5985
|
+
if (layer.layerType !== 'Geometry' || (isNullOrUndefined(layer.shapeData) && !isNullOrUndefined(layer.urlTemplate) && layer.urlTemplate !== '')) {
|
|
5902
5986
|
if (layer.layerType !== 'Bing' || _this.bing) {
|
|
5903
|
-
|
|
5987
|
+
if (!isNullOrUndefined(layer.urlTemplate) && layer.urlTemplate.indexOf('quadkey') > -1) {
|
|
5988
|
+
var bing = new BingMap(_this.mapObject);
|
|
5989
|
+
_this.bingMapCalculation(layer, layerIndex, _this, bing);
|
|
5990
|
+
}
|
|
5991
|
+
else {
|
|
5992
|
+
_this.renderTileLayer(_this, layer, layerIndex);
|
|
5993
|
+
}
|
|
5904
5994
|
}
|
|
5905
5995
|
else if (layer.key && layer.key.length > 1) {
|
|
5906
5996
|
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
@@ -5933,7 +6023,7 @@ var LayerPanel = /** @__PURE__ @class */ (function () {
|
|
|
5933
6023
|
proxy_1.renderTileLayer(proxy_1, layer, layerIndex, bing_1);
|
|
5934
6024
|
_this.mapObject.arrangeTemplate();
|
|
5935
6025
|
if (_this.mapObject.zoomModule && (_this.mapObject.previousScale !== _this.mapObject.scale)) {
|
|
5936
|
-
_this.mapObject.zoomModule.applyTransform(true);
|
|
6026
|
+
_this.mapObject.zoomModule.applyTransform(_this.mapObject, true);
|
|
5937
6027
|
}
|
|
5938
6028
|
};
|
|
5939
6029
|
ajax.send();
|
|
@@ -5969,6 +6059,17 @@ var LayerPanel = /** @__PURE__ @class */ (function () {
|
|
|
5969
6059
|
this.mapObject.baseMapBounds = null;
|
|
5970
6060
|
}
|
|
5971
6061
|
};
|
|
6062
|
+
LayerPanel.prototype.bingMapCalculation = function (layer, layerIndex, proxy, bing) {
|
|
6063
|
+
bing.imageUrl = layer.urlTemplate;
|
|
6064
|
+
bing.subDomains = ['t0', 't1', 't2', 't3'];
|
|
6065
|
+
bing.maxZoom = '21';
|
|
6066
|
+
proxy.mapObject['bingMap'] = bing;
|
|
6067
|
+
proxy.renderTileLayer(proxy, layer, layerIndex, bing);
|
|
6068
|
+
this.mapObject.arrangeTemplate();
|
|
6069
|
+
if (this.mapObject.zoomModule && (this.mapObject.previousScale !== this.mapObject.scale)) {
|
|
6070
|
+
this.mapObject.zoomModule.applyTransform(this.mapObject, true);
|
|
6071
|
+
}
|
|
6072
|
+
};
|
|
5972
6073
|
LayerPanel.prototype.bubbleCalculation = function (bubbleSettings, range) {
|
|
5973
6074
|
if (bubbleSettings.dataSource != null && bubbleSettings != null) {
|
|
5974
6075
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -6161,60 +6262,66 @@ var LayerPanel = /** @__PURE__ @class */ (function () {
|
|
|
6161
6262
|
}
|
|
6162
6263
|
break;
|
|
6163
6264
|
case 'LineString':
|
|
6164
|
-
path += 'M ' + (currentShapeData[0]['point']['x']) + ' ' + (currentShapeData[0]['point']['y']);
|
|
6165
6265
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6166
|
-
currentShapeData.map(function (lineData) {
|
|
6167
|
-
|
|
6266
|
+
currentShapeData.map(function (lineData, index) {
|
|
6267
|
+
if (index === 0) {
|
|
6268
|
+
path += 'M ' + (lineData['point']['x']) + ' ' + (lineData['point']['y']);
|
|
6269
|
+
}
|
|
6270
|
+
else {
|
|
6271
|
+
path += 'L' + (lineData['point']['x']) + ' , ' + (lineData['point']['y']) + ' ';
|
|
6272
|
+
}
|
|
6168
6273
|
});
|
|
6169
6274
|
if (path.length > 3) {
|
|
6170
|
-
pathOptions = new PathOption(shapeID, 'transparent', !isNullOrUndefined(eventArgs.border.width) ? eventArgs.border.width : 1, eventArgs.
|
|
6275
|
+
pathOptions = new PathOption(shapeID, 'transparent', !isNullOrUndefined(eventArgs.border.width) ? eventArgs.border.width : 1, !isNullOrUndefined(eventArgs.fill) ? eventArgs.fill :
|
|
6276
|
+
eventArgs.border.color, opacity, eventArgs.border.opacity, shapeSettings.dashArray, path);
|
|
6277
|
+
pathEle = _this.mapObject.renderer.drawPath(pathOptions);
|
|
6278
|
+
}
|
|
6279
|
+
break;
|
|
6280
|
+
case 'MultiLineString':
|
|
6281
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6282
|
+
currentShapeData.map(function (multilineData) {
|
|
6283
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6284
|
+
multilineData.map(function (lineData, index) {
|
|
6285
|
+
if (index === 0) {
|
|
6286
|
+
path += 'M ' + (lineData['point']['x']) + ' ' + (lineData['point']['y']);
|
|
6287
|
+
}
|
|
6288
|
+
else {
|
|
6289
|
+
path += 'L' + (lineData['point']['x']) + ' , ' + (lineData['point']['y']) + ' ';
|
|
6290
|
+
}
|
|
6291
|
+
});
|
|
6292
|
+
});
|
|
6293
|
+
if (path.length > 3) {
|
|
6294
|
+
pathOptions = new PathOption(shapeID, 'transparent', !isNullOrUndefined(eventArgs.border.width) ? eventArgs.border.width : 1, !isNullOrUndefined(eventArgs.fill) ? eventArgs.fill :
|
|
6295
|
+
eventArgs.border.color, opacity, eventArgs.border.opacity, shapeSettings.dashArray, path);
|
|
6171
6296
|
pathEle = _this.mapObject.renderer.drawPath(pathOptions);
|
|
6172
6297
|
}
|
|
6173
6298
|
break;
|
|
6174
6299
|
case 'Point':
|
|
6175
6300
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6176
6301
|
var pointData = currentShapeData['point'];
|
|
6177
|
-
var circleRadius = (_this.mapObject.layers[layerIndex].type !== 'SubLayer') ? shapeSettings.circleRadius : shapeSettings.circleRadius / _this.currentFactor;
|
|
6178
|
-
circleOptions = new CircleOption(shapeID, eventArgs.fill, eventArgs.border, opacity, pointData['x'], pointData['y'], circleRadius,
|
|
6302
|
+
var circleRadius = (_this.mapObject.layers[layerIndex].type !== 'SubLayer') ? shapeSettings.circleRadius : shapeSettings.circleRadius / (_this.mapObject.isTileMap ? _this.mapObject.scale : _this.currentFactor);
|
|
6303
|
+
circleOptions = new CircleOption(shapeID, eventArgs.fill, eventArgs.border, opacity, pointData['x'], pointData['y'], circleRadius, shapeSettings.dashArray);
|
|
6179
6304
|
pathEle = _this.mapObject.renderer.drawCircle(circleOptions);
|
|
6180
6305
|
break;
|
|
6306
|
+
case 'MultiPoint':
|
|
6307
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6308
|
+
currentShapeData.map(function (multiPointData, index) {
|
|
6309
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6310
|
+
var pointData = multiPointData['point'];
|
|
6311
|
+
var circleRadius = (_this.mapObject.layers[layerIndex].type !== 'SubLayer') ? shapeSettings.circleRadius : shapeSettings.circleRadius / (_this.mapObject.isTileMap ? _this.mapObject.scale : _this.currentFactor);
|
|
6312
|
+
circleOptions = new CircleOption((shapeID + "_multiLine_" + index), eventArgs.fill, eventArgs.border, opacity, pointData['x'], pointData['y'], circleRadius, shapeSettings.dashArray);
|
|
6313
|
+
pathEle = _this.mapObject.renderer.drawCircle(circleOptions);
|
|
6314
|
+
_this.pathAttributeCalculate(groupElement, pathEle, drawingType, currentShapeData, i);
|
|
6315
|
+
});
|
|
6316
|
+
break;
|
|
6181
6317
|
case 'Path':
|
|
6182
6318
|
path = currentShapeData['point'];
|
|
6183
6319
|
pathOptions = new PathOption(shapeID, eventArgs.fill, eventArgs.border.width, eventArgs.border.color, opacity, eventArgs.border.opacity, shapeSettings.dashArray, path);
|
|
6184
6320
|
pathEle = _this.mapObject.renderer.drawPath(pathOptions);
|
|
6185
6321
|
break;
|
|
6186
6322
|
}
|
|
6187
|
-
if (!isNullOrUndefined(pathEle)) {
|
|
6188
|
-
|
|
6189
|
-
_this.currentLayer.shapePropertyPath : [_this.currentLayer.shapePropertyPath]);
|
|
6190
|
-
var properties = void 0;
|
|
6191
|
-
for (var j = 0; j < property.length; j++) {
|
|
6192
|
-
if (!isNullOrUndefined(currentShapeData['property'])) {
|
|
6193
|
-
properties = property[j];
|
|
6194
|
-
break;
|
|
6195
|
-
}
|
|
6196
|
-
}
|
|
6197
|
-
pathEle.setAttribute('aria-label', ((!isNullOrUndefined(currentShapeData['property'])) ?
|
|
6198
|
-
(currentShapeData['property'][properties]) : ''));
|
|
6199
|
-
pathEle.setAttribute('tabindex', (_this.mapObject.tabIndex + i + 3).toString());
|
|
6200
|
-
if (drawingType === 'LineString') {
|
|
6201
|
-
pathEle.setAttribute('style', 'outline:none');
|
|
6202
|
-
}
|
|
6203
|
-
maintainSelection(_this.mapObject.selectedElementId, _this.mapObject.shapeSelectionClass, pathEle, 'ShapeselectionMapStyle');
|
|
6204
|
-
if (_this.mapObject.toggledShapeElementId) {
|
|
6205
|
-
for (var j = 0; j < _this.mapObject.toggledShapeElementId.length; j++) {
|
|
6206
|
-
var styleProperty = _this.mapObject.legendSettings.toggleLegendSettings.applyShapeSettings ?
|
|
6207
|
-
_this.currentLayer.shapeSettings : _this.mapObject.legendSettings.toggleLegendSettings;
|
|
6208
|
-
if (_this.mapObject.toggledShapeElementId[j] === pathEle.id) {
|
|
6209
|
-
pathEle.setAttribute('fill', styleProperty.fill);
|
|
6210
|
-
pathEle.setAttribute('stroke', styleProperty.border.color);
|
|
6211
|
-
pathEle.setAttribute('fill-opacity', (styleProperty.opacity).toString());
|
|
6212
|
-
pathEle.setAttribute('stroke-opacity', (isNullOrUndefined(styleProperty.border.opacity) ? styleProperty.opacity : styleProperty.border.opacity).toString());
|
|
6213
|
-
pathEle.setAttribute('stroke-width', (styleProperty.border.width).toString());
|
|
6214
|
-
}
|
|
6215
|
-
}
|
|
6216
|
-
}
|
|
6217
|
-
groupElement.appendChild(pathEle);
|
|
6323
|
+
if (!isNullOrUndefined(pathEle) && drawingType !== 'MultiPoint') {
|
|
6324
|
+
_this.pathAttributeCalculate(groupElement, pathEle, drawingType, currentShapeData, i);
|
|
6218
6325
|
}
|
|
6219
6326
|
if (i === _this.currentLayer.layerData.length - 1) {
|
|
6220
6327
|
_this.layerFeatures(layerIndex, colors, renderData, labelTemplateEle);
|
|
@@ -6232,6 +6339,50 @@ var LayerPanel = /** @__PURE__ @class */ (function () {
|
|
|
6232
6339
|
this.layerFeatures(layerIndex, colors, renderData, labelTemplateEle);
|
|
6233
6340
|
}
|
|
6234
6341
|
};
|
|
6342
|
+
/**
|
|
6343
|
+
* layer features as bubble, marker, datalabel, navigation line.
|
|
6344
|
+
*
|
|
6345
|
+
* @param {groupElement} Element - Specifies the element to append the group
|
|
6346
|
+
* @param {pathEle} Element - Specifies the svg element
|
|
6347
|
+
* @param {drawingType} string - Specifies the data type
|
|
6348
|
+
* @param {currentShapeData} any - Specifies the layer of shapedata.
|
|
6349
|
+
* @param {index} number - Specifies the tab index.
|
|
6350
|
+
* @returns {void}
|
|
6351
|
+
*/
|
|
6352
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6353
|
+
LayerPanel.prototype.pathAttributeCalculate = function (groupElement, pathEle, drawingType, currentShapeData, index) {
|
|
6354
|
+
var property = (Object.prototype.toString.call(this.currentLayer.shapePropertyPath) === '[object Array]' ?
|
|
6355
|
+
this.currentLayer.shapePropertyPath : [this.currentLayer.shapePropertyPath]);
|
|
6356
|
+
var properties;
|
|
6357
|
+
for (var j = 0; j < property.length; j++) {
|
|
6358
|
+
if (!isNullOrUndefined(currentShapeData['property'])) {
|
|
6359
|
+
properties = property[j];
|
|
6360
|
+
break;
|
|
6361
|
+
}
|
|
6362
|
+
}
|
|
6363
|
+
pathEle.setAttribute('aria-label', ((!isNullOrUndefined(currentShapeData['property'])) ?
|
|
6364
|
+
(currentShapeData['property'][properties]) : ''));
|
|
6365
|
+
pathEle.setAttribute('tabindex', (this.mapObject.tabIndex + index + 3).toString());
|
|
6366
|
+
pathEle.setAttribute('role', '');
|
|
6367
|
+
if (drawingType === 'LineString' || drawingType === 'MultiLineString') {
|
|
6368
|
+
pathEle.setAttribute('style', 'outline:none');
|
|
6369
|
+
}
|
|
6370
|
+
maintainSelection(this.mapObject.selectedElementId, this.mapObject.shapeSelectionClass, pathEle, 'ShapeselectionMapStyle');
|
|
6371
|
+
if (this.mapObject.toggledShapeElementId) {
|
|
6372
|
+
for (var j = 0; j < this.mapObject.toggledShapeElementId.length; j++) {
|
|
6373
|
+
var styleProperty = this.mapObject.legendSettings.toggleLegendSettings.applyShapeSettings ?
|
|
6374
|
+
this.currentLayer.shapeSettings : this.mapObject.legendSettings.toggleLegendSettings;
|
|
6375
|
+
if (this.mapObject.toggledShapeElementId[j] === pathEle.id) {
|
|
6376
|
+
pathEle.setAttribute('fill', styleProperty.fill);
|
|
6377
|
+
pathEle.setAttribute('stroke', styleProperty.border.color);
|
|
6378
|
+
pathEle.setAttribute('fill-opacity', (styleProperty.opacity).toString());
|
|
6379
|
+
pathEle.setAttribute('stroke-opacity', (isNullOrUndefined(styleProperty.border.opacity) ? styleProperty.opacity : styleProperty.border.opacity).toString());
|
|
6380
|
+
pathEle.setAttribute('stroke-width', (styleProperty.border.width).toString());
|
|
6381
|
+
}
|
|
6382
|
+
}
|
|
6383
|
+
}
|
|
6384
|
+
groupElement.appendChild(pathEle);
|
|
6385
|
+
};
|
|
6235
6386
|
/**
|
|
6236
6387
|
* layer features as bubble, marker, datalabel, navigation line.
|
|
6237
6388
|
*
|
|
@@ -6292,7 +6443,7 @@ var LayerPanel = /** @__PURE__ @class */ (function () {
|
|
|
6292
6443
|
_this.layerObject.appendChild(element);
|
|
6293
6444
|
});
|
|
6294
6445
|
if (this.mapObject.markerModule) {
|
|
6295
|
-
this.mapObject.markerModule.markerRender(this.layerObject, layerIndex, (this.mapObject.isTileMap ? Math.floor(this.currentFactor)
|
|
6446
|
+
this.mapObject.markerModule.markerRender(this.mapObject, this.layerObject, layerIndex, (this.mapObject.isTileMap ? Math.floor(this.currentFactor)
|
|
6296
6447
|
: this.currentFactor), null);
|
|
6297
6448
|
}
|
|
6298
6449
|
this.translateLayerElements(this.layerObject, layerIndex);
|
|
@@ -6419,7 +6570,8 @@ var LayerPanel = /** @__PURE__ @class */ (function () {
|
|
|
6419
6570
|
break;
|
|
6420
6571
|
case 'linestring':
|
|
6421
6572
|
var extraSpace_1 = !isNullOrUndefined(this.currentLayer.shapeSettings.border.width) ?
|
|
6422
|
-
this.currentLayer.shapeSettings.border.width
|
|
6573
|
+
(typeof (this.currentLayer.shapeSettings.border.width) === 'string' ?
|
|
6574
|
+
parseInt(this.currentLayer.shapeSettings.border.width, 10) : this.currentLayer.shapeSettings.border.width) : 1;
|
|
6423
6575
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6424
6576
|
coordinates.map(function (points, index) {
|
|
6425
6577
|
latitude = points[1];
|
|
@@ -6434,31 +6586,61 @@ var LayerPanel = /** @__PURE__ @class */ (function () {
|
|
|
6434
6586
|
newData['type'] = type;
|
|
6435
6587
|
this.currentLayer.layerData.push(newData);
|
|
6436
6588
|
break;
|
|
6437
|
-
case '
|
|
6438
|
-
var
|
|
6439
|
-
|
|
6440
|
-
|
|
6589
|
+
case 'multilinestring':
|
|
6590
|
+
var extraSpaces_1 = !isNullOrUndefined(this.currentLayer.shapeSettings.border.width) ?
|
|
6591
|
+
(typeof (this.currentLayer.shapeSettings.border.width) === 'string' ?
|
|
6592
|
+
parseInt(this.currentLayer.shapeSettings.border.width, 10) : this.currentLayer.shapeSettings.border.width) : 1;
|
|
6593
|
+
var multiLineData_1 = [];
|
|
6441
6594
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6442
|
-
coordinates.map(function (
|
|
6443
|
-
|
|
6595
|
+
coordinates.map(function (multiPoints) {
|
|
6596
|
+
newData = [];
|
|
6597
|
+
multiPoints.map(function (points) {
|
|
6444
6598
|
latitude = points[1];
|
|
6445
6599
|
longitude = points[0];
|
|
6446
|
-
arrayCollections_1 = true;
|
|
6447
6600
|
var point = convertGeoToPoint(latitude, longitude, _this.currentFactor, _this.currentLayer, _this.mapObject);
|
|
6448
|
-
_this.
|
|
6449
|
-
|
|
6601
|
+
_this.calculateBox(point, extraSpaces_1);
|
|
6602
|
+
newData.push({
|
|
6603
|
+
point: point, lat: latitude, lng: longitude
|
|
6450
6604
|
});
|
|
6451
|
-
}
|
|
6605
|
+
});
|
|
6606
|
+
multiLineData_1.push(newData);
|
|
6607
|
+
});
|
|
6608
|
+
multiLineData_1['property'] = properties;
|
|
6609
|
+
multiLineData_1['type'] = type;
|
|
6610
|
+
this.currentLayer.layerData.push(multiLineData_1);
|
|
6611
|
+
break;
|
|
6612
|
+
case 'point':
|
|
6613
|
+
var pointExtraSpace = (!isNullOrUndefined(this.currentLayer.shapeSettings.border.width) ?
|
|
6614
|
+
(typeof (this.currentLayer.shapeSettings.border.width) === 'string' ?
|
|
6615
|
+
parseInt(this.currentLayer.shapeSettings.border.width, 10) : this.currentLayer.shapeSettings.border.width) : 1) +
|
|
6616
|
+
(this.currentLayer.shapeSettings.circleRadius * 2);
|
|
6617
|
+
latitude = coordinates[1];
|
|
6618
|
+
longitude = coordinates[0];
|
|
6619
|
+
var point = convertGeoToPoint(latitude, longitude, this.currentFactor, this.currentLayer, this.mapObject);
|
|
6620
|
+
this.calculateBox(point, pointExtraSpace);
|
|
6621
|
+
this.currentLayer.layerData.push({
|
|
6622
|
+
point: point, type: type, lat: latitude, lng: longitude, property: properties
|
|
6452
6623
|
});
|
|
6453
|
-
|
|
6454
|
-
|
|
6455
|
-
|
|
6456
|
-
|
|
6457
|
-
|
|
6458
|
-
this.currentLayer.
|
|
6459
|
-
|
|
6624
|
+
break;
|
|
6625
|
+
case 'multipoint': {
|
|
6626
|
+
var extraSpace_2 = (!isNullOrUndefined(this.currentLayer.shapeSettings.border.width) ?
|
|
6627
|
+
(typeof (this.currentLayer.shapeSettings.border.width) === 'string' ?
|
|
6628
|
+
parseInt(this.currentLayer.shapeSettings.border.width, 10) : this.currentLayer.shapeSettings.border.width) : 1) +
|
|
6629
|
+
(this.currentLayer.shapeSettings.circleRadius * 2);
|
|
6630
|
+
newData = [];
|
|
6631
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6632
|
+
coordinates.map(function (points) {
|
|
6633
|
+
latitude = points[1];
|
|
6634
|
+
longitude = points[0];
|
|
6635
|
+
var point = convertGeoToPoint(latitude, longitude, _this.currentFactor, _this.currentLayer, _this.mapObject);
|
|
6636
|
+
_this.calculateBox(point, extraSpace_2);
|
|
6637
|
+
newData.push({
|
|
6638
|
+
point: point, lat: latitude, lng: longitude
|
|
6460
6639
|
});
|
|
6461
|
-
}
|
|
6640
|
+
});
|
|
6641
|
+
newData['property'] = properties;
|
|
6642
|
+
newData['type'] = type;
|
|
6643
|
+
this.currentLayer.layerData.push(newData);
|
|
6462
6644
|
break;
|
|
6463
6645
|
}
|
|
6464
6646
|
case 'path':
|
|
@@ -6470,12 +6652,12 @@ var LayerPanel = /** @__PURE__ @class */ (function () {
|
|
|
6470
6652
|
};
|
|
6471
6653
|
LayerPanel.prototype.calculateBox = function (point, extraSpace) {
|
|
6472
6654
|
if (isNullOrUndefined(this.rectBounds)) {
|
|
6473
|
-
this.rectBounds = { min: { x: point.x, y: point.y - extraSpace }, max: { x: point.x, y: point.y + extraSpace } };
|
|
6655
|
+
this.rectBounds = { min: { x: point.x - extraSpace, y: point.y - extraSpace }, max: { x: point.x + extraSpace, y: point.y + extraSpace } };
|
|
6474
6656
|
}
|
|
6475
6657
|
else {
|
|
6476
|
-
this.rectBounds['min']['x'] = Math.min(this.rectBounds['min']['x'], point.x);
|
|
6658
|
+
this.rectBounds['min']['x'] = Math.min(this.rectBounds['min']['x'], point.x - extraSpace);
|
|
6477
6659
|
this.rectBounds['min']['y'] = Math.min(this.rectBounds['min']['y'], point.y - extraSpace);
|
|
6478
|
-
this.rectBounds['max']['x'] = Math.max(this.rectBounds['max']['x'], point.x);
|
|
6660
|
+
this.rectBounds['max']['x'] = Math.max(this.rectBounds['max']['x'], point.x + extraSpace);
|
|
6479
6661
|
this.rectBounds['max']['y'] = Math.max(this.rectBounds['max']['y'], point.y + extraSpace);
|
|
6480
6662
|
}
|
|
6481
6663
|
};
|
|
@@ -6493,6 +6675,10 @@ var LayerPanel = /** @__PURE__ @class */ (function () {
|
|
|
6493
6675
|
var end = convertGeoToPoint(bounds.latitude.max, bounds.longitude.max, null, layer, this.mapObject);
|
|
6494
6676
|
mapHeight = end.y - start.y;
|
|
6495
6677
|
mapWidth = end.x - start.x;
|
|
6678
|
+
if (mapHeight === 0 || mapWidth === 0) {
|
|
6679
|
+
mapWidth = mapSize.width / 2;
|
|
6680
|
+
mapHeight = mapSize.height;
|
|
6681
|
+
}
|
|
6496
6682
|
}
|
|
6497
6683
|
else {
|
|
6498
6684
|
mapHeight = mapWidth = 500;
|
|
@@ -6587,15 +6773,28 @@ var LayerPanel = /** @__PURE__ @class */ (function () {
|
|
|
6587
6773
|
_this.calculateRectBox(point[0]);
|
|
6588
6774
|
});
|
|
6589
6775
|
break;
|
|
6776
|
+
case 'multilinestring':
|
|
6777
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6778
|
+
coordinates.map(function (multiPoint, index) {
|
|
6779
|
+
multiPoint.map(function (point, index) {
|
|
6780
|
+
_this.calculateRectBox(point, 'multilinestring', index === 0 ? true : false);
|
|
6781
|
+
});
|
|
6782
|
+
});
|
|
6783
|
+
break;
|
|
6590
6784
|
case 'linestring':
|
|
6591
6785
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6592
6786
|
coordinates.map(function (point, index) {
|
|
6593
|
-
_this.calculateRectBox(point, '
|
|
6787
|
+
_this.calculateRectBox(point, 'linestring', index === 0 ? true : false);
|
|
6594
6788
|
});
|
|
6595
6789
|
break;
|
|
6596
6790
|
case 'point':
|
|
6597
6791
|
_this.calculateRectBox(coordinates, 'point');
|
|
6598
6792
|
break;
|
|
6793
|
+
case 'multipoint':
|
|
6794
|
+
coordinates.map(function (point, index) {
|
|
6795
|
+
_this.calculateRectBox(point, 'multipoint', index === 0 ? true : false);
|
|
6796
|
+
});
|
|
6797
|
+
break;
|
|
6599
6798
|
}
|
|
6600
6799
|
}
|
|
6601
6800
|
});
|
|
@@ -6634,7 +6833,7 @@ var LayerPanel = /** @__PURE__ @class */ (function () {
|
|
|
6634
6833
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6635
6834
|
LayerPanel.prototype.calculateRectBox = function (coordinates, type, isFirstItem) {
|
|
6636
6835
|
var _this = this;
|
|
6637
|
-
if (type !== '
|
|
6836
|
+
if ((type !== 'linestring' && type !== 'multilinestring') && (type !== 'point' && type !== 'multipoint')) {
|
|
6638
6837
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6639
6838
|
Array.prototype.forEach.call(coordinates, function (currentCoords) {
|
|
6640
6839
|
if (isNullOrUndefined(_this.mapObject.baseMapBounds)) {
|
|
@@ -6703,7 +6902,7 @@ var LayerPanel = /** @__PURE__ @class */ (function () {
|
|
|
6703
6902
|
var tile = new Tile(tileI % ycount, j);
|
|
6704
6903
|
tile.left = x;
|
|
6705
6904
|
tile.top = y;
|
|
6706
|
-
if (baseLayer.layerType === 'Bing') {
|
|
6905
|
+
if (baseLayer.layerType === 'Bing' || (bing && !isNullOrUndefined(baseLayer.urlTemplate) && baseLayer.urlTemplate !== '')) {
|
|
6707
6906
|
var key = baseLayer.key;
|
|
6708
6907
|
tile.src = bing.getBingMap(tile, key, baseLayer.bingMapType, userLang, bing.imageUrl, bing.subDomains);
|
|
6709
6908
|
}
|
|
@@ -6732,11 +6931,13 @@ var LayerPanel = /** @__PURE__ @class */ (function () {
|
|
|
6732
6931
|
if (!(layer.type === 'SubLayer' && layer.visible)) {
|
|
6733
6932
|
continue;
|
|
6734
6933
|
}
|
|
6735
|
-
if (layer.layerType
|
|
6934
|
+
if ((layer.layerType !== 'Geometry' && layer.layerType !== 'GoogleStaticMap') || (layer.layerType === 'Geometry' &&
|
|
6935
|
+
isNullOrUndefined(layer.shapeData) && !isNullOrUndefined(layer.urlTemplate) && layer.urlTemplate !== '')) {
|
|
6736
6936
|
for (var _b = 0, proxTiles_1 = proxTiles; _b < proxTiles_1.length; _b++) {
|
|
6737
6937
|
var baseTile = proxTiles_1[_b];
|
|
6738
6938
|
var subtile = extend({}, baseTile, {}, true);
|
|
6739
6939
|
if (layer.layerType === 'Bing') {
|
|
6940
|
+
bing = new BingMap(this.mapObject);
|
|
6740
6941
|
subtile.src = bing.getBingMap(subtile, layer.key, layer.bingMapType, userLang, bing.imageUrl, bing.subDomains);
|
|
6741
6942
|
}
|
|
6742
6943
|
else {
|
|
@@ -6782,7 +6983,7 @@ var LayerPanel = /** @__PURE__ @class */ (function () {
|
|
|
6782
6983
|
else {
|
|
6783
6984
|
if (type !== 'Pan' && element1 && element) {
|
|
6784
6985
|
element1.appendChild(element.children[0]);
|
|
6785
|
-
if (!isNullOrUndefined(document.getElementById(_this.mapObject.element.id + '_animated_tiles'))) {
|
|
6986
|
+
if (!_this.mapObject.isAddLayer && !isNullOrUndefined(document.getElementById(_this.mapObject.element.id + '_animated_tiles'))) {
|
|
6786
6987
|
document.getElementById(_this.mapObject.element.id + '_animated_tiles').id =
|
|
6787
6988
|
_this.mapObject.element.id + '_animated_tiles_old';
|
|
6788
6989
|
}
|
|
@@ -6796,7 +6997,10 @@ var LayerPanel = /** @__PURE__ @class */ (function () {
|
|
|
6796
6997
|
var id = 0;
|
|
6797
6998
|
var _loop_3 = function (tile) {
|
|
6798
6999
|
var imgElement = createElement('img');
|
|
7000
|
+
imgElement.setAttribute('height', '256px');
|
|
7001
|
+
imgElement.setAttribute('width', '256px');
|
|
6799
7002
|
imgElement.setAttribute('src', tile.src);
|
|
7003
|
+
imgElement.setAttribute('alt', _this.mapObject.getLocalizedLabel('ImageNotFound'));
|
|
6800
7004
|
var mapId = _this.mapObject.element.id;
|
|
6801
7005
|
imgElement.onload = function () {
|
|
6802
7006
|
if (document.getElementById(mapId + '_tile_' + id) && type === 'Pan') {
|
|
@@ -6908,7 +7112,7 @@ var LayerPanel = /** @__PURE__ @class */ (function () {
|
|
|
6908
7112
|
'&zoom=' + zoom + '¢er=' + center + '&maptype=' + mapType + '&key=' + apikey;
|
|
6909
7113
|
document.getElementById(this.mapObject.element.id + '_tile_parent').innerHTML
|
|
6910
7114
|
= '<div id="' + this.mapObject.element.id + '_StaticGoogleMap"' + 'style="position:absolute; left:' + eleWidth + 'px; top:'
|
|
6911
|
-
+ eleHeight + 'px"><img src="' + staticMapString + '"></div>';
|
|
7115
|
+
+ eleHeight + 'px"><img src="' + staticMapString + '"' + 'alt="' + this.mapObject.getLocalizedLabel('ImageNotFound') + '"></div>';
|
|
6912
7116
|
};
|
|
6913
7117
|
/**
|
|
6914
7118
|
* To find the tile translate point
|
|
@@ -6966,6 +7170,27 @@ var LayerPanel = /** @__PURE__ @class */ (function () {
|
|
|
6966
7170
|
this.mapObject.previousTileHeight = factorY;
|
|
6967
7171
|
return new Point(x, y);
|
|
6968
7172
|
};
|
|
7173
|
+
/**
|
|
7174
|
+
* @returns {void}
|
|
7175
|
+
* @private
|
|
7176
|
+
*/
|
|
7177
|
+
LayerPanel.prototype.destroy = function () {
|
|
7178
|
+
this.mapObject = null;
|
|
7179
|
+
this.groupElements = [];
|
|
7180
|
+
this.layerObject = null;
|
|
7181
|
+
this.currentLayer = null;
|
|
7182
|
+
this.rectBounds = null;
|
|
7183
|
+
this.tiles = [];
|
|
7184
|
+
this.clipRectElement = null;
|
|
7185
|
+
this.tileSvgObject = null;
|
|
7186
|
+
this.ajaxModule = null;
|
|
7187
|
+
this.ajaxResponse = [];
|
|
7188
|
+
this.layerGroup = null;
|
|
7189
|
+
if (!isNullOrUndefined(this.bing)) {
|
|
7190
|
+
this.bing.destroy();
|
|
7191
|
+
}
|
|
7192
|
+
this.bing = null;
|
|
7193
|
+
};
|
|
6969
7194
|
return LayerPanel;
|
|
6970
7195
|
}());
|
|
6971
7196
|
|
|
@@ -7021,7 +7246,7 @@ var Annotations = /** @__PURE__ @class */ (function () {
|
|
|
7021
7246
|
if (argsData.cancel) {
|
|
7022
7247
|
return;
|
|
7023
7248
|
}
|
|
7024
|
-
templateFn = getTemplateFunction(argsData.content);
|
|
7249
|
+
templateFn = getTemplateFunction(argsData.content, _this.map);
|
|
7025
7250
|
if (templateFn && templateFn(_this.map, _this.map, argsData.content, _this.map.element.id + '_ContentTemplate_' + annotationIndex).length) {
|
|
7026
7251
|
templateElement = Array.prototype.slice.call(templateFn(_this.map, _this.map, argsData.content, _this.map.element.id + '_ContentTemplate_' + annotationIndex));
|
|
7027
7252
|
var length_1 = templateElement.length;
|
|
@@ -7081,35 +7306,34 @@ var Annotations = /** @__PURE__ @class */ (function () {
|
|
|
7081
7306
|
/**
|
|
7082
7307
|
* To destroy the annotation.
|
|
7083
7308
|
*
|
|
7084
|
-
* @param {Maps} map - Specifies the instance of the maps
|
|
7085
7309
|
* @returns {void}
|
|
7086
7310
|
* @private
|
|
7087
7311
|
*/
|
|
7088
|
-
Annotations.prototype.destroy = function (
|
|
7089
|
-
|
|
7312
|
+
Annotations.prototype.destroy = function () {
|
|
7313
|
+
this.map = null;
|
|
7090
7314
|
};
|
|
7091
7315
|
return Annotations;
|
|
7092
7316
|
}());
|
|
7093
7317
|
|
|
7094
|
-
var __extends = (undefined && undefined.__extends) || (function () {
|
|
7095
|
-
var extendStatics = function (d, b) {
|
|
7096
|
-
extendStatics = Object.setPrototypeOf ||
|
|
7097
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
7098
|
-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
7099
|
-
return extendStatics(d, b);
|
|
7100
|
-
};
|
|
7101
|
-
return function (d, b) {
|
|
7102
|
-
extendStatics(d, b);
|
|
7103
|
-
function __() { this.constructor = d; }
|
|
7104
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
7105
|
-
};
|
|
7106
|
-
})();
|
|
7107
|
-
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
7108
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
7109
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
7110
|
-
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;
|
|
7111
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7112
|
-
};
|
|
7318
|
+
var __extends = (undefined && undefined.__extends) || (function () {
|
|
7319
|
+
var extendStatics = function (d, b) {
|
|
7320
|
+
extendStatics = Object.setPrototypeOf ||
|
|
7321
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
7322
|
+
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
7323
|
+
return extendStatics(d, b);
|
|
7324
|
+
};
|
|
7325
|
+
return function (d, b) {
|
|
7326
|
+
extendStatics(d, b);
|
|
7327
|
+
function __() { this.constructor = d; }
|
|
7328
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
7329
|
+
};
|
|
7330
|
+
})();
|
|
7331
|
+
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
7332
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
7333
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
7334
|
+
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;
|
|
7335
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7336
|
+
};
|
|
7113
7337
|
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
|
7114
7338
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
7115
7339
|
/* eslint-disable radix */
|
|
@@ -7148,6 +7372,10 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
|
|
|
7148
7372
|
* Resize the map
|
|
7149
7373
|
*/
|
|
7150
7374
|
_this.isResize = false;
|
|
7375
|
+
/**
|
|
7376
|
+
* @private
|
|
7377
|
+
*/
|
|
7378
|
+
_this.isReset = false;
|
|
7151
7379
|
/** @private */
|
|
7152
7380
|
_this.baseSize = new Size(0, 0);
|
|
7153
7381
|
/** @public */
|
|
@@ -7305,6 +7533,7 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
|
|
|
7305
7533
|
this.renderArea();
|
|
7306
7534
|
this.processRequestJsonData();
|
|
7307
7535
|
this.renderComplete();
|
|
7536
|
+
this.isAddLayer = !this.isTileMap ? false : this.isAddLayer;
|
|
7308
7537
|
};
|
|
7309
7538
|
/**
|
|
7310
7539
|
* To Initialize the control rendering.
|
|
@@ -7445,16 +7674,7 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
|
|
|
7445
7674
|
};
|
|
7446
7675
|
Maps.prototype.renderMap = function () {
|
|
7447
7676
|
if (this.legendModule && this.legendSettings.visible) {
|
|
7448
|
-
|
|
7449
|
-
this.legendModule.renderLegend();
|
|
7450
|
-
}
|
|
7451
|
-
else {
|
|
7452
|
-
var layerCount = this.layersCollection.length - 1;
|
|
7453
|
-
if (!this.layersCollection[layerCount].isBaseLayer) {
|
|
7454
|
-
this.isTileMapSubLayer = true;
|
|
7455
|
-
this.legendModule.renderLegend();
|
|
7456
|
-
}
|
|
7457
|
-
}
|
|
7677
|
+
this.legendModule.renderLegend();
|
|
7458
7678
|
}
|
|
7459
7679
|
this.createTile();
|
|
7460
7680
|
if (this.zoomSettings.enable && this.zoomModule) {
|
|
@@ -7465,7 +7685,9 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
|
|
|
7465
7685
|
this.dataLabelShape = [];
|
|
7466
7686
|
}
|
|
7467
7687
|
this.mapLayerPanel.measureLayerPanel();
|
|
7468
|
-
|
|
7688
|
+
if (!isNullOrUndefined(this.svgObject)) {
|
|
7689
|
+
this.element.appendChild(this.svgObject);
|
|
7690
|
+
}
|
|
7469
7691
|
var position = this.getExtraPosition();
|
|
7470
7692
|
for (var i = 0; i < this.layers.length; i++) {
|
|
7471
7693
|
if (position.x !== 0 || position.y !== 0) {
|
|
@@ -7488,12 +7710,14 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
|
|
|
7488
7710
|
this.checkInitialRender = false;
|
|
7489
7711
|
}
|
|
7490
7712
|
}
|
|
7491
|
-
|
|
7492
|
-
|
|
7493
|
-
&& this.layers[i].markerSettings[k].
|
|
7494
|
-
|
|
7495
|
-
|
|
7496
|
-
|
|
7713
|
+
if (!this.isResize) {
|
|
7714
|
+
for (var k = 0; k < this.layers[i].markerSettings.length; k++) {
|
|
7715
|
+
if (this.layers[i].markerSettings[k].selectionSettings && this.layers[i].markerSettings[k].selectionSettings.enable
|
|
7716
|
+
&& this.layers[i].markerSettings[k].initialMarkerSelection.length > 0) {
|
|
7717
|
+
var markerSelectionValues = this.layers[i].markerSettings[k].initialMarkerSelection;
|
|
7718
|
+
for (var j = 0; j < markerSelectionValues.length; j++) {
|
|
7719
|
+
this.markerInitialSelection(i, k, this.layers[i].markerSettings[k], markerSelectionValues[j].latitude, markerSelectionValues[j].longitude);
|
|
7720
|
+
}
|
|
7497
7721
|
}
|
|
7498
7722
|
}
|
|
7499
7723
|
}
|
|
@@ -7535,12 +7759,16 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
|
|
|
7535
7759
|
bottom = svg.bottom - tile.bottom - element.offsetTop;
|
|
7536
7760
|
top_1 = parseFloat(tileElement.style.top) + element.offsetTop;
|
|
7537
7761
|
}
|
|
7538
|
-
top_1 = (bottom <= 11) ? top_1 : (top_1 * 2);
|
|
7539
|
-
left = (bottom <= 11) ? left : (left * 2);
|
|
7762
|
+
top_1 = (bottom <= 11) ? top_1 : (!isNullOrUndefined(this.legendModule) && this.legendSettings.position === 'Bottom') ? this.mapAreaRect.y : (top_1 * 2);
|
|
7763
|
+
left = (bottom <= 11) ? left : !isNullOrUndefined(this.legendModule) ? left : (left * 2);
|
|
7540
7764
|
tileElement.style.top = top_1 + 'px';
|
|
7541
7765
|
tileElement.style.left = left + 'px';
|
|
7542
7766
|
tileElement1.style.top = top_1 + 'px';
|
|
7543
7767
|
tileElement1.style.left = left + 'px';
|
|
7768
|
+
if (!isNullOrUndefined(this.legendModule) && this.legendModule.totalPages.length > 0) {
|
|
7769
|
+
tileElement.style.height = tileElement1.style.height = this.legendModule.legendTotalRect.height + 'px';
|
|
7770
|
+
tileElement.style.width = tileElement1.style.width = this.legendModule.legendTotalRect.width + 'px';
|
|
7771
|
+
}
|
|
7544
7772
|
}
|
|
7545
7773
|
this.arrangeTemplate();
|
|
7546
7774
|
if (this.annotationsModule) {
|
|
@@ -7571,7 +7799,8 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
|
|
|
7571
7799
|
Maps.prototype.markerSelection = function (selectionSettings, map, targetElement, data) {
|
|
7572
7800
|
var border = {
|
|
7573
7801
|
color: selectionSettings.border.color,
|
|
7574
|
-
width: selectionSettings.border.width / map.scale
|
|
7802
|
+
width: selectionSettings.border.width / map.scale,
|
|
7803
|
+
opacity: selectionSettings.border.opacity
|
|
7575
7804
|
};
|
|
7576
7805
|
var markerSelectionProperties = {
|
|
7577
7806
|
opacity: selectionSettings.opacity,
|
|
@@ -7591,9 +7820,11 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
|
|
|
7591
7820
|
if (this.selectedMarkerElementId.length === 0 || selectionSettings.enableMultiSelect) {
|
|
7592
7821
|
if (targetElement.tagName === 'g') {
|
|
7593
7822
|
targetElement.children[0].setAttribute('class', 'MarkerselectionMapStyle');
|
|
7823
|
+
this.selectedMarkerElementId.push(targetElement.children[0].id);
|
|
7594
7824
|
}
|
|
7595
7825
|
else {
|
|
7596
7826
|
targetElement.setAttribute('class', 'MarkerselectionMapStyle');
|
|
7827
|
+
this.selectedMarkerElementId.push(targetElement.id);
|
|
7597
7828
|
}
|
|
7598
7829
|
}
|
|
7599
7830
|
};
|
|
@@ -7645,6 +7876,7 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
|
|
|
7645
7876
|
*/
|
|
7646
7877
|
Maps.prototype.addTabIndex = function () {
|
|
7647
7878
|
this.element.setAttribute('aria-label', this.description || 'Maps Element');
|
|
7879
|
+
this.element.setAttribute('role', '');
|
|
7648
7880
|
this.element.setAttribute('tabindex', this.tabIndex.toString());
|
|
7649
7881
|
};
|
|
7650
7882
|
// private setSecondaryElementPosition(): void {
|
|
@@ -7663,12 +7895,21 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
|
|
|
7663
7895
|
this.zoomModule.layerCollectionEle = getElementByID(this.element.id + '_Layer_Collections');
|
|
7664
7896
|
}
|
|
7665
7897
|
if (this.isTileMap && getElementByID(this.element.id + '_Tile_SVG') && getElementByID(this.element.id + '_tile_parent')) {
|
|
7666
|
-
var
|
|
7667
|
-
var
|
|
7898
|
+
var tileElement = getElementByID(this.element.id + '_tile_parent');
|
|
7899
|
+
var tileSvgElement = getElementByID(this.element.id + '_Tile_SVG');
|
|
7900
|
+
var tileSvgParentElement = getElementByID(this.element.id + '_Tile_SVG_Parent');
|
|
7901
|
+
var tileRect = tileElement.getBoundingClientRect();
|
|
7902
|
+
var tileSvgRect = tileSvgElement.getBoundingClientRect();
|
|
7668
7903
|
left = (tileRect.left - tileSvgRect.left);
|
|
7669
7904
|
top = (tileRect.top - tileSvgRect.top);
|
|
7670
|
-
|
|
7671
|
-
|
|
7905
|
+
tileSvgParentElement.style.left = left + 'px';
|
|
7906
|
+
tileSvgParentElement.style.top = top + 'px';
|
|
7907
|
+
if (!isNullOrUndefined(this.legendModule) && this.legendModule.totalPages.length > 0) {
|
|
7908
|
+
tileElement.style.width = tileSvgElement.style.width = this.legendModule.legendTotalRect.width.toString();
|
|
7909
|
+
tileElement.style.height = tileSvgElement.style.height = this.legendModule.legendTotalRect.height.toString();
|
|
7910
|
+
tileSvgParentElement.style.width = this.legendModule.legendTotalRect.width + 'px';
|
|
7911
|
+
tileSvgParentElement.style.height = this.legendModule.legendTotalRect.height + 'px';
|
|
7912
|
+
}
|
|
7672
7913
|
var markerTemplateElements = document.getElementsByClassName('template');
|
|
7673
7914
|
if (!isNullOrUndefined(markerTemplateElements) && markerTemplateElements.length > 0) {
|
|
7674
7915
|
for (var i = 0; i < markerTemplateElements.length; i++) {
|
|
@@ -7686,7 +7927,7 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
|
|
|
7686
7927
|
if (!isNullOrUndefined(elements) && elements.childElementCount > 0) {
|
|
7687
7928
|
for (var i = 0; i < elements.childNodes.length; i++) {
|
|
7688
7929
|
var childElement = elements.childNodes[i];
|
|
7689
|
-
if (childElement.tagName === 'g') {
|
|
7930
|
+
if (childElement.tagName === 'g' && childElement.id.indexOf('_Legend_Group') == -1) {
|
|
7690
7931
|
var layerIndex = parseFloat(childElement.id.split('_LayerIndex_')[1].split('_')[0]);
|
|
7691
7932
|
for (var j = 0; j < childElement.childNodes.length; j++) {
|
|
7692
7933
|
var childNode = childElement.childNodes[j];
|
|
@@ -7700,7 +7941,7 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
|
|
|
7700
7941
|
}
|
|
7701
7942
|
}
|
|
7702
7943
|
if (this.zoomModule && (this.previousScale !== this.scale)) {
|
|
7703
|
-
this.zoomModule.applyTransform(true);
|
|
7944
|
+
this.zoomModule.applyTransform(this, true);
|
|
7704
7945
|
}
|
|
7705
7946
|
}
|
|
7706
7947
|
};
|
|
@@ -7723,7 +7964,7 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
|
|
|
7723
7964
|
}
|
|
7724
7965
|
var templateElements = document.getElementsByClassName(this.element.id + '_template');
|
|
7725
7966
|
if (!isNullOrUndefined(templateElements) && templateElements.length > 0 &&
|
|
7726
|
-
getElementByID(this.element.id + '_Layer_Collections') && this.
|
|
7967
|
+
getElementByID(this.element.id + '_Layer_Collections') && !this.isTileMap) {
|
|
7727
7968
|
for (var i = 0; i < templateElements.length; i++) {
|
|
7728
7969
|
var offSetLetValue = 0;
|
|
7729
7970
|
var offSetTopValue = 0;
|
|
@@ -7758,10 +7999,7 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
|
|
|
7758
7999
|
var mainLayer = this.layersCollection[0];
|
|
7759
8000
|
var padding = 0;
|
|
7760
8001
|
if (mainLayer.isBaseLayer && (mainLayer.layerType === 'OSM' || mainLayer.layerType === 'Bing' ||
|
|
7761
|
-
mainLayer.layerType === 'GoogleStaticMap' || mainLayer.layerType === 'Google')) {
|
|
7762
|
-
if (mainLayer.layerType === 'Google') {
|
|
7763
|
-
mainLayer.urlTemplate = 'https://mt1.google.com/vt/lyrs=m@129&hl=en&x=tileX&y=tileY&z=level';
|
|
7764
|
-
}
|
|
8002
|
+
mainLayer.layerType === 'GoogleStaticMap' || mainLayer.layerType === 'Google' || (!isNullOrUndefined(mainLayer.urlTemplate) && mainLayer.urlTemplate !== ''))) {
|
|
7765
8003
|
removeElement(this.element.id + '_tile_parent');
|
|
7766
8004
|
removeElement(this.element.id + '_tiles');
|
|
7767
8005
|
removeElement('animated_tiles');
|
|
@@ -7809,7 +8047,7 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
|
|
|
7809
8047
|
var baseLayer = mainLayers[i];
|
|
7810
8048
|
if (baseLayer.visible && baseIndex === i) {
|
|
7811
8049
|
baseLayer.isBaseLayer = true;
|
|
7812
|
-
this.isTileMap = (baseLayer.layerType === 'Geometry') ? false : true;
|
|
8050
|
+
this.isTileMap = (baseLayer.layerType === 'Geometry' && !isNullOrUndefined(baseLayer.shapeData)) ? false : true;
|
|
7813
8051
|
this.layersCollection.push(baseLayer);
|
|
7814
8052
|
break;
|
|
7815
8053
|
}
|
|
@@ -7856,12 +8094,19 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
|
|
|
7856
8094
|
* @private
|
|
7857
8095
|
*/
|
|
7858
8096
|
Maps.prototype.renderTitle = function (title, type, bounds, groupEle) {
|
|
7859
|
-
var style =
|
|
8097
|
+
var style = {
|
|
8098
|
+
size: title.textStyle.size,
|
|
8099
|
+
color: title.textStyle.color,
|
|
8100
|
+
fontFamily: title.textStyle.fontFamily,
|
|
8101
|
+
fontWeight: title.textStyle.fontWeight,
|
|
8102
|
+
fontStyle: title.textStyle.fontStyle,
|
|
8103
|
+
opacity: title.textStyle.opacity
|
|
8104
|
+
};
|
|
7860
8105
|
var height;
|
|
7861
8106
|
var width = Math.abs((this.margin.left + this.margin.right) - this.availableSize.width);
|
|
7862
|
-
style.fontFamily =
|
|
8107
|
+
style.fontFamily = !isNullOrUndefined(style.fontFamily) ? style.fontFamily : this.themeStyle.fontFamily;
|
|
7863
8108
|
style.fontWeight = style.fontWeight || this.themeStyle.titleFontWeight;
|
|
7864
|
-
style.size = this.themeStyle.titleFontSize
|
|
8109
|
+
style.size = type === 'title' ? (style.size || this.themeStyle.titleFontSize) : (style.size || Theme.mapsSubTitleFont.size);
|
|
7865
8110
|
if (title.text) {
|
|
7866
8111
|
if (isNullOrUndefined(groupEle)) {
|
|
7867
8112
|
groupEle = this.renderer.createGroup({ id: this.element.id + '_Title_Group' });
|
|
@@ -7874,6 +8119,7 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
|
|
|
7874
8119
|
var titleBounds = new Rect(location_1.x, location_1.y, elementSize.width, elementSize.height);
|
|
7875
8120
|
var element = renderTextElement(options, style, style.color || (type === 'title' ? this.themeStyle.titleFontColor : this.themeStyle.subTitleFontColor), groupEle);
|
|
7876
8121
|
element.setAttribute('aria-label', this.description || title.text);
|
|
8122
|
+
element.setAttribute('role', '');
|
|
7877
8123
|
if ((type === 'title' && !title.subtitleSettings.text) || (type === 'subtitle')) {
|
|
7878
8124
|
height = Math.abs((titleBounds.y + this.margin.bottom) - this.availableSize.height);
|
|
7879
8125
|
this.mapAreaRect = new Rect(this.margin.left, titleBounds.y + 10, width, height - 10);
|
|
@@ -8031,6 +8277,7 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
|
|
|
8031
8277
|
var id = event.target['id'];
|
|
8032
8278
|
event.preventDefault();
|
|
8033
8279
|
if (this.legendModule && (id.indexOf('_Left_Page_Rect') > -1 || id.indexOf('_Right_Page_Rect') > -1)) {
|
|
8280
|
+
this.mapAreaRect = this.legendModule.initialMapAreaRect;
|
|
8034
8281
|
this.legendModule.currentPage = (id.indexOf('_Left_Page_') > -1) ? (this.legendModule.currentPage - 1) :
|
|
8035
8282
|
(this.legendModule.currentPage + 1);
|
|
8036
8283
|
this.legendModule.legendGroup = this.renderer.createGroup({ id: this.element.id + '_Legend_Group' });
|
|
@@ -8095,24 +8342,35 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
|
|
|
8095
8342
|
latitude: latitude, longitude: longitude,
|
|
8096
8343
|
isShapeSelected: this.SelectedElement(targetEle)
|
|
8097
8344
|
};
|
|
8098
|
-
this.
|
|
8099
|
-
|
|
8100
|
-
|
|
8101
|
-
|
|
8102
|
-
|
|
8103
|
-
|
|
8104
|
-
|
|
8105
|
-
|
|
8106
|
-
|
|
8107
|
-
|
|
8108
|
-
|
|
8109
|
-
|
|
8110
|
-
|
|
8111
|
-
|
|
8112
|
-
|
|
8113
|
-
|
|
8114
|
-
|
|
8115
|
-
|
|
8345
|
+
if (this.onclick) {
|
|
8346
|
+
eventArgs_1.name = onclick;
|
|
8347
|
+
this.trigger('onclick', eventArgs_1, function (mouseArgs) {
|
|
8348
|
+
_this.clickHandler(e, eventArgs_1, targetEle);
|
|
8349
|
+
});
|
|
8350
|
+
}
|
|
8351
|
+
else {
|
|
8352
|
+
this.trigger('click', eventArgs_1, function (mouseArgs) {
|
|
8353
|
+
_this.clickHandler(e, eventArgs_1, targetEle);
|
|
8354
|
+
});
|
|
8355
|
+
}
|
|
8356
|
+
}
|
|
8357
|
+
};
|
|
8358
|
+
Maps.prototype.clickHandler = function (e, eventArgs, targetEle) {
|
|
8359
|
+
if (targetEle.id.indexOf('shapeIndex') > -1) {
|
|
8360
|
+
this.mergeCluster();
|
|
8361
|
+
if (getElement(this.element.id + '_mapsTooltip') &&
|
|
8362
|
+
this.mapsTooltipModule.tooltipTargetID.indexOf('_MarkerIndex_') > -1) {
|
|
8363
|
+
removeElement(this.element.id + '_mapsTooltip');
|
|
8364
|
+
}
|
|
8365
|
+
}
|
|
8366
|
+
if (this.markerModule) {
|
|
8367
|
+
this.markerModule.markerClusterClick(e);
|
|
8368
|
+
}
|
|
8369
|
+
if (!eventArgs.cancel) {
|
|
8370
|
+
this.notify(click, targetEle);
|
|
8371
|
+
}
|
|
8372
|
+
if (!eventArgs.cancel && targetEle.id.indexOf('shapeIndex') !== -1) {
|
|
8373
|
+
this.triggerShapeSelection(targetEle);
|
|
8116
8374
|
}
|
|
8117
8375
|
};
|
|
8118
8376
|
Maps.prototype.triggerShapeSelection = function (targetEle) {
|
|
@@ -8212,13 +8470,6 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
|
|
|
8212
8470
|
latitude = latLongValue.latitude;
|
|
8213
8471
|
longitude = latLongValue.longitude;
|
|
8214
8472
|
}
|
|
8215
|
-
var eventArgs = {
|
|
8216
|
-
cancel: false, name: click, target: targetId, x: e.clientX, y: e.clientY,
|
|
8217
|
-
latitude: latitude, longitude: longitude, isShapeSelected: this.SelectedElement(targetEle)
|
|
8218
|
-
};
|
|
8219
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
8220
|
-
this.trigger('click', eventArgs, function (mouseArgs) {
|
|
8221
|
-
});
|
|
8222
8473
|
}
|
|
8223
8474
|
this.titleTooltip(e, pageX, pageY, true);
|
|
8224
8475
|
if (!isNullOrUndefined(this.legendModule)) {
|
|
@@ -8226,7 +8477,7 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
|
|
|
8226
8477
|
}
|
|
8227
8478
|
}
|
|
8228
8479
|
this.notify(Browser.touchEndEvent, e);
|
|
8229
|
-
if (e.cancelable) {
|
|
8480
|
+
if (e.cancelable && !this.isTouch) {
|
|
8230
8481
|
e.preventDefault();
|
|
8231
8482
|
}
|
|
8232
8483
|
return false;
|
|
@@ -8380,14 +8631,14 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
|
|
|
8380
8631
|
removeElement(this.element.id + '_EJ2_LegendTitle_Tooltip');
|
|
8381
8632
|
}
|
|
8382
8633
|
if ((targetId === (this.element.id + '_Map_title')) && (event.target.textContent.indexOf('...') > -1)) {
|
|
8383
|
-
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);
|
|
8634
|
+
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);
|
|
8384
8635
|
}
|
|
8385
8636
|
else {
|
|
8386
8637
|
removeElement(this.element.id + '_EJ2_Title_Tooltip');
|
|
8387
8638
|
}
|
|
8388
8639
|
};
|
|
8389
8640
|
/*
|
|
8390
|
-
|
|
8641
|
+
|
|
8391
8642
|
/**
|
|
8392
8643
|
* This method is used to perform operations while resizing the window.
|
|
8393
8644
|
*
|
|
@@ -8415,6 +8666,7 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
|
|
|
8415
8666
|
_this.refreshing = true;
|
|
8416
8667
|
_this.wireEVents();
|
|
8417
8668
|
_this.render();
|
|
8669
|
+
_this.refreshing = false;
|
|
8418
8670
|
}, 500);
|
|
8419
8671
|
}
|
|
8420
8672
|
}
|
|
@@ -8445,7 +8697,7 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
|
|
|
8445
8697
|
this.scale = zoomFactor;
|
|
8446
8698
|
this.translatePoint.x = ((mapRect.left < svgRect.left ? x : 0) + (size.width / 2) - (position.x * zoomFactor)) / zoomFactor;
|
|
8447
8699
|
this.translatePoint.y = ((mapRect.top < svgRect.top ? y : 0) + (size.height / 2) - (position.y * zoomFactor)) / zoomFactor;
|
|
8448
|
-
this.zoomModule.applyTransform();
|
|
8700
|
+
this.zoomModule.applyTransform(this);
|
|
8449
8701
|
}
|
|
8450
8702
|
else {
|
|
8451
8703
|
position = { x: size.width / 2, y: size.height / 2 };
|
|
@@ -8491,8 +8743,10 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
|
|
|
8491
8743
|
* @param {Object} layer - Specifies the layer for the maps.
|
|
8492
8744
|
*/
|
|
8493
8745
|
Maps.prototype.addLayer = function (layer) {
|
|
8494
|
-
|
|
8495
|
-
|
|
8746
|
+
var mapsLayer = this.layers;
|
|
8747
|
+
mapsLayer.push(layer);
|
|
8748
|
+
this.isAddLayer = true;
|
|
8749
|
+
this.layers = mapsLayer;
|
|
8496
8750
|
};
|
|
8497
8751
|
/**
|
|
8498
8752
|
* This method is used to remove a layer from map.
|
|
@@ -8501,8 +8755,9 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
|
|
|
8501
8755
|
* @returns {void}
|
|
8502
8756
|
*/
|
|
8503
8757
|
Maps.prototype.removeLayer = function (index) {
|
|
8504
|
-
this.layers
|
|
8505
|
-
|
|
8758
|
+
var mapsLayer = this.layers;
|
|
8759
|
+
mapsLayer.splice(index, 1);
|
|
8760
|
+
this.layers = mapsLayer;
|
|
8506
8761
|
};
|
|
8507
8762
|
/**
|
|
8508
8763
|
* This method is used to add markers dynamically in the maps.
|
|
@@ -8521,7 +8776,7 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
|
|
|
8521
8776
|
this.layersCollection[layerIndex].markerSettings.push(new MarkerSettings(this, 'markerSettings', newMarker));
|
|
8522
8777
|
}
|
|
8523
8778
|
var markerModule = new Marker(this);
|
|
8524
|
-
markerModule.markerRender(layerEle, layerIndex, this.mapLayerPanel['currentFactor'], 'AddMarker');
|
|
8779
|
+
markerModule.markerRender(this, layerEle, layerIndex, this.mapLayerPanel['currentFactor'], 'AddMarker');
|
|
8525
8780
|
this.arrangeTemplate();
|
|
8526
8781
|
}
|
|
8527
8782
|
};
|
|
@@ -8728,7 +8983,8 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
|
|
|
8728
8983
|
Zoom: 'Zoom',
|
|
8729
8984
|
ZoomOut: 'Zoom out',
|
|
8730
8985
|
Pan: 'Pan',
|
|
8731
|
-
Reset: 'Reset'
|
|
8986
|
+
Reset: 'Reset',
|
|
8987
|
+
ImageNotFound: 'Image Not Found'
|
|
8732
8988
|
};
|
|
8733
8989
|
};
|
|
8734
8990
|
/**
|
|
@@ -8736,6 +8992,7 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
|
|
|
8736
8992
|
*/
|
|
8737
8993
|
Maps.prototype.destroy = function () {
|
|
8738
8994
|
this.unWireEVents();
|
|
8995
|
+
_super.prototype.destroy.call(this);
|
|
8739
8996
|
this.shapeSelectionItem = [];
|
|
8740
8997
|
this.toggledShapeElementId = [];
|
|
8741
8998
|
this.toggledLegendId = [];
|
|
@@ -8750,11 +9007,14 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
|
|
|
8750
9007
|
this.zoomLabelPositions = [];
|
|
8751
9008
|
this.mouseDownEvent = { x: null, y: null };
|
|
8752
9009
|
this.mouseClickEvent = { x: null, y: null };
|
|
9010
|
+
this.formatFunction = null;
|
|
9011
|
+
//TODO: Calling the below code throws spec issue.
|
|
9012
|
+
//this.renderer = null;
|
|
9013
|
+
this.availableSize = new Size(0, 0);
|
|
8753
9014
|
if (document.getElementById('mapsmeasuretext')) {
|
|
8754
9015
|
document.getElementById('mapsmeasuretext').remove();
|
|
8755
9016
|
}
|
|
8756
9017
|
this.removeSvg();
|
|
8757
|
-
_super.prototype.destroy.call(this);
|
|
8758
9018
|
};
|
|
8759
9019
|
/**
|
|
8760
9020
|
* Gets component name
|
|
@@ -8787,6 +9047,7 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
|
|
|
8787
9047
|
Maps.prototype.onPropertyChanged = function (newProp, oldProp) {
|
|
8788
9048
|
var render = false;
|
|
8789
9049
|
var isMarker = false;
|
|
9050
|
+
var isLayer = false;
|
|
8790
9051
|
var isStaticMapType = false;
|
|
8791
9052
|
var layerEle;
|
|
8792
9053
|
if (newProp['layers']) {
|
|
@@ -8807,13 +9068,18 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
|
|
|
8807
9068
|
case 'legendSettings':
|
|
8808
9069
|
case 'baseLayerIndex':
|
|
8809
9070
|
if (prop === 'layers') {
|
|
9071
|
+
isLayer = true;
|
|
8810
9072
|
var layerPropLength = Object.keys(newProp.layers).length;
|
|
8811
9073
|
for (var x = 0; x < layerPropLength; x++) {
|
|
8812
9074
|
if (!isNullOrUndefined(newProp.layers[x])) {
|
|
8813
9075
|
var collection = Object.keys(newProp.layers[x]);
|
|
8814
9076
|
for (var _b = 0, collection_1 = collection; _b < collection_1.length; _b++) {
|
|
8815
9077
|
var collectionProp = collection_1[_b];
|
|
8816
|
-
if (collectionProp === '
|
|
9078
|
+
if ((collectionProp === 'layerType' && newProp.layers[x].layerType !== 'Geometry') || (isNullOrUndefined(this.layers[x].shapeData)
|
|
9079
|
+
&& !isNullOrUndefined(this.layers[x].urlTemplate) && this.layers[x].urlTemplate !== '')) {
|
|
9080
|
+
this.isReset = true;
|
|
9081
|
+
}
|
|
9082
|
+
else if (collectionProp === 'markerSettings') {
|
|
8817
9083
|
isMarker = true;
|
|
8818
9084
|
}
|
|
8819
9085
|
else if (collectionProp === 'staticMapType') {
|
|
@@ -8827,7 +9093,7 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
|
|
|
8827
9093
|
break;
|
|
8828
9094
|
case 'zoomSettings':
|
|
8829
9095
|
if (!isNullOrUndefined(oldProp.zoomSettings)) {
|
|
8830
|
-
if (newProp.zoomSettings.zoomFactor !== oldProp.zoomSettings.zoomFactor) {
|
|
9096
|
+
if (newProp.zoomSettings.zoomFactor !== oldProp.zoomSettings.zoomFactor && !isLayer) {
|
|
8831
9097
|
render = false;
|
|
8832
9098
|
}
|
|
8833
9099
|
else if (newProp.zoomSettings.shouldZoomInitially !== oldProp.zoomSettings.shouldZoomInitially) {
|
|
@@ -9064,7 +9330,7 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
|
|
|
9064
9330
|
*/
|
|
9065
9331
|
Maps.prototype.print = function (id) {
|
|
9066
9332
|
if ((this.allowPrint) && (this.printModule)) {
|
|
9067
|
-
this.printModule.print(id);
|
|
9333
|
+
this.printModule.print(this, id);
|
|
9068
9334
|
}
|
|
9069
9335
|
};
|
|
9070
9336
|
/**
|
|
@@ -9083,16 +9349,38 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
|
|
|
9083
9349
|
}
|
|
9084
9350
|
if ((type !== 'PDF') && (this.allowImageExport) && (this.imageExportModule)) {
|
|
9085
9351
|
return new Promise(function (resolve, reject) {
|
|
9086
|
-
resolve(_this.imageExportModule.export(type, fileName, allowDownload));
|
|
9352
|
+
resolve(_this.imageExportModule.export(_this, type, fileName, allowDownload));
|
|
9087
9353
|
});
|
|
9088
9354
|
}
|
|
9089
9355
|
else if ((this.allowPdfExport) && (this.pdfExportModule)) {
|
|
9090
9356
|
return new Promise(function (resolve, reject) {
|
|
9091
|
-
resolve(_this.pdfExportModule.export(type, fileName, allowDownload, orientation));
|
|
9357
|
+
resolve(_this.pdfExportModule.export(_this, type, fileName, allowDownload, orientation));
|
|
9092
9358
|
});
|
|
9093
9359
|
}
|
|
9094
9360
|
return null;
|
|
9095
9361
|
};
|
|
9362
|
+
/**
|
|
9363
|
+
* This method is used to get the Bing maps URL.
|
|
9364
|
+
*
|
|
9365
|
+
* @param {string} url - Specifies the URL of the maps.
|
|
9366
|
+
* @returns {Promise<string>} - Returns the processed Bing URL as Promise.
|
|
9367
|
+
*/
|
|
9368
|
+
Maps.prototype.getBingUrlTemplate = function (url) {
|
|
9369
|
+
var promise = new Promise(function (resolve, reject) {
|
|
9370
|
+
var ajax = new Ajax({
|
|
9371
|
+
url: url
|
|
9372
|
+
});
|
|
9373
|
+
ajax.onSuccess = function (json) {
|
|
9374
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9375
|
+
var jsonObject = JSON.parse(json);
|
|
9376
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9377
|
+
var resource = jsonObject['resourceSets'][0]['resources'][0];
|
|
9378
|
+
resolve(resource['imageUrl']);
|
|
9379
|
+
};
|
|
9380
|
+
ajax.send();
|
|
9381
|
+
});
|
|
9382
|
+
return promise;
|
|
9383
|
+
};
|
|
9096
9384
|
/**
|
|
9097
9385
|
* To find visibility of layers and markers for required modules load.
|
|
9098
9386
|
*
|
|
@@ -9301,6 +9589,9 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
|
|
|
9301
9589
|
__decorate([
|
|
9302
9590
|
Event()
|
|
9303
9591
|
], Maps.prototype, "click", void 0);
|
|
9592
|
+
__decorate([
|
|
9593
|
+
Event()
|
|
9594
|
+
], Maps.prototype, "onclick", void 0);
|
|
9304
9595
|
__decorate([
|
|
9305
9596
|
Event()
|
|
9306
9597
|
], Maps.prototype, "doubleClick", void 0);
|
|
@@ -9447,12 +9738,8 @@ var Bubble = /** @__PURE__ @class */ (function () {
|
|
|
9447
9738
|
isNaN(shapeData[layer.shapeDataPath]) ? shapeData[layer.shapeDataPath].toLowerCase() : shapeData[layer.shapeDataPath];
|
|
9448
9739
|
var shapePathValue = !isNullOrUndefined(shape[shapePath]) && isNaN(shape[shapePath])
|
|
9449
9740
|
? shape[shapePath].toLowerCase() : shape[shapePath];
|
|
9450
|
-
if (shapeDataLayerPathValue === shapePathValue && layerData[i].type !== 'LineString') {
|
|
9451
|
-
if (layerData[i]['
|
|
9452
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9453
|
-
shapePoints.push(this.getPoints(layerData[i], []));
|
|
9454
|
-
}
|
|
9455
|
-
else if (!layerData[i]['_isMultiPolygon']) {
|
|
9741
|
+
if (shapeDataLayerPathValue === shapePathValue && (layerData[i].type !== 'LineString' && layerData[i].type !== 'MultiLineString' && layerData[i]['type'] !== 'Point' && layerData[i]['type'] !== 'MultiPoint')) {
|
|
9742
|
+
if (!layerData[i]['_isMultiPolygon']) {
|
|
9456
9743
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9457
9744
|
shapePoints.push(this.getPoints(layerData[i], []));
|
|
9458
9745
|
currentLength = shapePoints[shapePoints.length - 1].length;
|
|
@@ -9536,7 +9823,7 @@ var Bubble = /** @__PURE__ @class */ (function () {
|
|
|
9536
9823
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9537
9824
|
var translate;
|
|
9538
9825
|
var animate$$1 = layer.animationDuration !== 0 || isNullOrUndefined(_this.maps.zoomModule);
|
|
9539
|
-
if (_this.maps.zoomSettings.zoomFactor > 1 && !isNullOrUndefined(_this.maps.zoomModule)) {
|
|
9826
|
+
if (_this.maps.zoomSettings.zoomFactor > 1 && !isNullOrUndefined(_this.maps.zoomModule) && !_this.maps.isTileMap) {
|
|
9540
9827
|
translate = getZoomTranslate(_this.maps, layer, animate$$1);
|
|
9541
9828
|
}
|
|
9542
9829
|
else {
|
|
@@ -9653,14 +9940,13 @@ var Bubble = /** @__PURE__ @class */ (function () {
|
|
|
9653
9940
|
/**
|
|
9654
9941
|
* To destroy the bubble.
|
|
9655
9942
|
*
|
|
9656
|
-
* @param {Maps} maps - Specifies the instance of the maps.
|
|
9657
9943
|
* @returns {void}
|
|
9658
9944
|
* @private
|
|
9659
9945
|
*/
|
|
9660
|
-
Bubble.prototype.destroy = function (
|
|
9661
|
-
|
|
9662
|
-
|
|
9663
|
-
|
|
9946
|
+
Bubble.prototype.destroy = function () {
|
|
9947
|
+
this.bubbleCollection = [];
|
|
9948
|
+
//TODO: Calling the below code throws spec issue.
|
|
9949
|
+
//this.maps = null;
|
|
9664
9950
|
};
|
|
9665
9951
|
return Bubble;
|
|
9666
9952
|
}());
|
|
@@ -9759,7 +10045,7 @@ var DataLabel = /** @__PURE__ @class */ (function () {
|
|
|
9759
10045
|
var shapeWidth;
|
|
9760
10046
|
var scaleZoomValue = !isNullOrUndefined(this.maps.scale) ? Math.floor(this.maps.scale) : 1;
|
|
9761
10047
|
var zoomLabelsPosition = this.maps.zoomSettings.enable ? !isNullOrUndefined(this.maps.zoomShapeCollection) &&
|
|
9762
|
-
this.maps.zoomShapeCollection.length > 0 : this.maps.zoomSettings.enable;
|
|
10048
|
+
this.maps.zoomShapeCollection.length > 0 && !this.maps.isAddLayer : this.maps.zoomSettings.enable;
|
|
9763
10049
|
this.maps.translateType = 'labels';
|
|
9764
10050
|
for (var j = 0; j < properties.length; j++) {
|
|
9765
10051
|
if (shapeProperties[properties[j]]) {
|
|
@@ -9777,7 +10063,7 @@ var DataLabel = /** @__PURE__ @class */ (function () {
|
|
|
9777
10063
|
layer.dataSource, layer.shapeDataPath, shapeData['properties'][propertyPath], layer.shapeDataPath);
|
|
9778
10064
|
if (!isNullOrUndefined(shapes['property'])) {
|
|
9779
10065
|
shapePoint = [[]];
|
|
9780
|
-
if (!layerData[index]['_isMultiPolygon'] && layerData[index]['type'] !== 'Point') {
|
|
10066
|
+
if (!layerData[index]['_isMultiPolygon'] && layerData[index]['type'] !== 'Point' && layerData[index]['type'] !== 'MultiPoint') {
|
|
9781
10067
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9782
10068
|
shapePoint.push(this.getPoint(layerData[index], []));
|
|
9783
10069
|
currentLength = shapePoint[shapePoint.length - 1].length;
|
|
@@ -9786,21 +10072,9 @@ var DataLabel = /** @__PURE__ @class */ (function () {
|
|
|
9786
10072
|
midIndex = shapePoint.length - 1;
|
|
9787
10073
|
}
|
|
9788
10074
|
}
|
|
9789
|
-
else {
|
|
10075
|
+
else if (layerData[index]['type'] !== 'Point' && layerData[index]['type'] !== 'MultiPoint') {
|
|
9790
10076
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9791
10077
|
var layer_1 = layerData[index];
|
|
9792
|
-
if (layer_1['type'] === 'Point') {
|
|
9793
|
-
isPoint = true;
|
|
9794
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9795
|
-
var layerPoints = [];
|
|
9796
|
-
layerPoints.push(this.getPoint(layerData, []));
|
|
9797
|
-
shapePoint = layerPoints;
|
|
9798
|
-
currentLength = shapePoint[shapePoint.length - 1].length;
|
|
9799
|
-
if (pointsLength < currentLength) {
|
|
9800
|
-
pointsLength = currentLength;
|
|
9801
|
-
midIndex = shapePoint.length - 1;
|
|
9802
|
-
}
|
|
9803
|
-
}
|
|
9804
10078
|
for (var j = 0; j < layer_1.length; j++) {
|
|
9805
10079
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9806
10080
|
shapePoint.push(this.getPoint(layer_1[j], []));
|
|
@@ -9870,7 +10144,7 @@ var DataLabel = /** @__PURE__ @class */ (function () {
|
|
|
9870
10144
|
var eventargs_1 = {
|
|
9871
10145
|
name: dataLabelRendering, maps: this.maps, cancel: false, border: { color: dataLabel.border.color,
|
|
9872
10146
|
width: dataLabel.border.width, opacity: dataLabel.border.opacity }, datalabel: dataLabel,
|
|
9873
|
-
fill: dataLabel.fill, template: dataLabel.template, text: text
|
|
10147
|
+
fill: dataLabel.fill, template: dataLabel.template, text: text, offsetX: 0, offsetY: 0
|
|
9874
10148
|
};
|
|
9875
10149
|
this.maps.trigger('dataLabelRendering', eventargs_1, function (labelArgs) {
|
|
9876
10150
|
if (eventargs_1.cancel) {
|
|
@@ -9915,13 +10189,13 @@ var DataLabel = /** @__PURE__ @class */ (function () {
|
|
|
9915
10189
|
_this.value[index] = { rightWidth: xpositionEnds, leftWidth: xpositionStart, heightTop: start, heightBottom: end };
|
|
9916
10190
|
var labelElement;
|
|
9917
10191
|
if (eventargs_1.template !== '') {
|
|
9918
|
-
templateFn = getTemplateFunction(eventargs_1.template);
|
|
10192
|
+
templateFn = getTemplateFunction(eventargs_1.template, _this.maps);
|
|
9919
10193
|
var templateElement = templateFn ? templateFn(!isNullOrUndefined(datasrcObj) ?
|
|
9920
10194
|
datasrcObj : shapeData['properties'], _this.maps, eventargs_1.template, _this.maps.element.id + '_LabelTemplate', false) : document.createElement('div');
|
|
9921
10195
|
templateElement.innerHTML = !templateFn ? eventargs_1.template : '';
|
|
9922
10196
|
labelElement = convertElementFromLabel(templateElement, labelId, !isNullOrUndefined(datasrcObj) ? datasrcObj : shapeData['properties'], index, _this.maps);
|
|
9923
|
-
labelElement.style.left = ((Math.abs(_this.maps.baseMapRectBounds['min']['x'] - location['x'])) * scale) + 'px';
|
|
9924
|
-
labelElement.style.top = ((Math.abs(_this.maps.baseMapRectBounds['min']['y'] - location['y'])) * scale) + 'px';
|
|
10197
|
+
labelElement.style.left = ((Math.abs(_this.maps.baseMapRectBounds['min']['x'] - location['x'])) * scale) + labelArgs.offsetX + 'px';
|
|
10198
|
+
labelElement.style.top = ((Math.abs(_this.maps.baseMapRectBounds['min']['y'] - location['y'])) * scale) + labelArgs.offsetY + 'px';
|
|
9925
10199
|
labelTemplateElement.appendChild(labelElement);
|
|
9926
10200
|
}
|
|
9927
10201
|
else {
|
|
@@ -10009,26 +10283,26 @@ var DataLabel = /** @__PURE__ @class */ (function () {
|
|
|
10009
10283
|
y = ((location['y'] + transPoint['y']) * scale) - textSize['height'] / 2;
|
|
10010
10284
|
}
|
|
10011
10285
|
border_1.opacity = isNullOrUndefined(border_1.opacity) ? opacity : border_1.opacity;
|
|
10012
|
-
var rectOptions = new RectOption(_this.maps.element.id + '_LayerIndex_' + layerIndex + '_shapeIndex_' + index + '_rectIndex_' + index, fill, border_1, opacity, new Rect(x, y, textSize['width'], textSize['height']), rx, ry);
|
|
10286
|
+
var rectOptions = new RectOption(_this.maps.element.id + '_LayerIndex_' + layerIndex + '_shapeIndex_' + index + '_rectIndex_' + index, fill, border_1, opacity, new Rect((x + labelArgs.offsetX), (y + labelArgs.offsetY), textSize['width'], textSize['height']), rx, ry);
|
|
10013
10287
|
var rect = _this.maps.renderer.drawRectangle(rectOptions);
|
|
10014
10288
|
group.appendChild(rect);
|
|
10015
10289
|
}
|
|
10016
10290
|
}
|
|
10017
10291
|
element = renderTextElement(options, style, style.color || _this.maps.themeStyle.dataLabelFontColor, group);
|
|
10018
10292
|
if (zoomLabelsPosition && scaleZoomValue > 1 && !_this.maps.zoomNotApplied) {
|
|
10019
|
-
element.setAttribute('transform', 'translate( ' + ((location['x'])) + ' '
|
|
10020
|
-
+ (((location['y']))) + ' )');
|
|
10293
|
+
element.setAttribute('transform', 'translate( ' + ((location['x'] + labelArgs.offsetX)) + ' '
|
|
10294
|
+
+ (((location['y'] + labelArgs.offsetY))) + ' )');
|
|
10021
10295
|
location['x'] = locationX;
|
|
10022
10296
|
location['y'] = locationY;
|
|
10023
10297
|
}
|
|
10024
10298
|
else {
|
|
10025
|
-
element.setAttribute('transform', 'translate( ' + ((location['x'] + transPoint.x) * scale) + ' '
|
|
10026
|
-
+ (((location['y'] + transPoint.y) * scale) + (elementSize.height / 4)) + ' )');
|
|
10299
|
+
element.setAttribute('transform', 'translate( ' + (((location['x'] + transPoint.x) * scale) + labelArgs.offsetX) + ' '
|
|
10300
|
+
+ ((((location['y'] + transPoint.y) * scale) + (elementSize.height / 4)) + labelArgs.offsetY) + ' )');
|
|
10027
10301
|
}
|
|
10028
10302
|
group.appendChild(element);
|
|
10029
10303
|
}
|
|
10030
10304
|
_this.dataLabelCollections.push({
|
|
10031
|
-
location: { x: location['x'], y: location['y'] },
|
|
10305
|
+
location: { x: location['x'] + labelArgs.offsetX, y: location['y'] + labelArgs.offsetY },
|
|
10032
10306
|
element: isNullOrUndefined(labelElement) ? element : labelElement,
|
|
10033
10307
|
layerIndex: layerIndex,
|
|
10034
10308
|
shapeIndex: sublayerIndexLabel ? oldIndex : index,
|
|
@@ -10045,10 +10319,21 @@ var DataLabel = /** @__PURE__ @class */ (function () {
|
|
|
10045
10319
|
};
|
|
10046
10320
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10047
10321
|
DataLabel.prototype.getPoint = function (shapes, points) {
|
|
10048
|
-
|
|
10049
|
-
|
|
10050
|
-
|
|
10051
|
-
|
|
10322
|
+
if (shapes['type'] === 'MultiLineString') {
|
|
10323
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10324
|
+
shapes.map(function (current) {
|
|
10325
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10326
|
+
current.map(function (shape) {
|
|
10327
|
+
points.push(new Point(shape['point']['x'], shape['point']['y']));
|
|
10328
|
+
});
|
|
10329
|
+
});
|
|
10330
|
+
}
|
|
10331
|
+
else {
|
|
10332
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10333
|
+
shapes.map(function (current, index) {
|
|
10334
|
+
points.push(new Point(current['point']['x'], current['point']['y']));
|
|
10335
|
+
});
|
|
10336
|
+
}
|
|
10052
10337
|
return points;
|
|
10053
10338
|
};
|
|
10054
10339
|
/**
|
|
@@ -10060,16 +10345,14 @@ var DataLabel = /** @__PURE__ @class */ (function () {
|
|
|
10060
10345
|
return 'DataLabel';
|
|
10061
10346
|
};
|
|
10062
10347
|
/**
|
|
10063
|
-
* To destroy the layers.
|
|
10064
10348
|
*
|
|
10065
|
-
* @param {Maps} maps - Specifies the instance of the maps.
|
|
10066
10349
|
* @returns {void}
|
|
10067
10350
|
* @private
|
|
10068
10351
|
*/
|
|
10069
|
-
DataLabel.prototype.destroy = function (
|
|
10070
|
-
|
|
10071
|
-
|
|
10072
|
-
|
|
10352
|
+
DataLabel.prototype.destroy = function () {
|
|
10353
|
+
this.dataLabelCollections = [];
|
|
10354
|
+
this.value = null;
|
|
10355
|
+
this.maps = null;
|
|
10073
10356
|
};
|
|
10074
10357
|
return DataLabel;
|
|
10075
10358
|
}());
|
|
@@ -10139,8 +10422,8 @@ var NavigationLine = /** @__PURE__ @class */ (function () {
|
|
|
10139
10422
|
for (var j = 0; j < point['length'] - 1; j++) {
|
|
10140
10423
|
angle = (-1 > angle) ? -1 : angle;
|
|
10141
10424
|
angle = (1 < angle) ? 1 : angle;
|
|
10142
|
-
var
|
|
10143
|
-
var
|
|
10425
|
+
var arcId = this.maps.element.id + '_LayerIndex_' + layerIndex + '_NavigationIndex_' + i + '_Line' + j + '';
|
|
10426
|
+
var radius = this.convertRadius(point[j], point[j + 1]);
|
|
10144
10427
|
if (angle <= 1 && angle > 0) {
|
|
10145
10428
|
direction = 0;
|
|
10146
10429
|
if (point[j]['x'] > point[j + 1]['x']) {
|
|
@@ -10185,10 +10468,10 @@ var NavigationLine = /** @__PURE__ @class */ (function () {
|
|
|
10185
10468
|
angle = Math.abs(angle);
|
|
10186
10469
|
d = (angle === 0) ? 'M ' + point[j]['x'] + ',' + point[j]['y'] + 'L ' + point[j + 1]['x']
|
|
10187
10470
|
+ ',' + point[j + 1]['y'] + ' ' :
|
|
10188
|
-
'M ' + point[j]['x'] + ',' + point[j]['y'] + ' A ' + (
|
|
10189
|
-
' ' + (
|
|
10471
|
+
'M ' + point[j]['x'] + ',' + point[j]['y'] + ' A ' + (radius / 2 + (1 - angle) * radius / (angle * 10)) +
|
|
10472
|
+
' ' + (radius / 2 + (1 - angle) * radius / (angle * 10)) + ' ' + 0 + ',' + 0 + ','
|
|
10190
10473
|
+ direction + ' , ' + point[j + 1]['x'] + ',' + point[j + 1]['y'] + ' ';
|
|
10191
|
-
pathOption = new PathOption(
|
|
10474
|
+
pathOption = new PathOption(arcId, 'none', width, color, 1, 1, dashArray, d);
|
|
10192
10475
|
navigationEle = this.maps.renderer.drawPath(pathOption);
|
|
10193
10476
|
if (!isNullOrUndefined(arrowPosition)) {
|
|
10194
10477
|
var position = (arrowPosition === 'Start') ? navigationEle.setAttribute('marker-start', startArrow)
|
|
@@ -10221,14 +10504,11 @@ var NavigationLine = /** @__PURE__ @class */ (function () {
|
|
|
10221
10504
|
/**
|
|
10222
10505
|
* To destroy the layers.
|
|
10223
10506
|
*
|
|
10224
|
-
* @param {Maps} maps - Specifies the instance of the map
|
|
10225
10507
|
* @returns {void}
|
|
10226
10508
|
* @private
|
|
10227
10509
|
*/
|
|
10228
|
-
NavigationLine.prototype.destroy = function (
|
|
10229
|
-
|
|
10230
|
-
* Destroy method performed here
|
|
10231
|
-
*/
|
|
10510
|
+
NavigationLine.prototype.destroy = function () {
|
|
10511
|
+
this.maps = null;
|
|
10232
10512
|
};
|
|
10233
10513
|
return NavigationLine;
|
|
10234
10514
|
}());
|
|
@@ -10242,6 +10522,10 @@ var Legend = /** @__PURE__ @class */ (function () {
|
|
|
10242
10522
|
* @private
|
|
10243
10523
|
*/
|
|
10244
10524
|
this.legendBorderRect = new Rect(0, 0, 0, 0);
|
|
10525
|
+
/**
|
|
10526
|
+
* @private
|
|
10527
|
+
*/
|
|
10528
|
+
this.initialMapAreaRect = new Rect(0, 0, 0, 0);
|
|
10245
10529
|
/**
|
|
10246
10530
|
* @private
|
|
10247
10531
|
*/
|
|
@@ -10300,6 +10584,7 @@ var Legend = /** @__PURE__ @class */ (function () {
|
|
|
10300
10584
|
this.heightIncrement = 0;
|
|
10301
10585
|
this.defsElement = this.maps.renderer.createDefs();
|
|
10302
10586
|
this.maps.svgObject.appendChild(this.defsElement);
|
|
10587
|
+
this.initialMapAreaRect = this.maps.mapAreaRect;
|
|
10303
10588
|
this.calculateLegendBounds();
|
|
10304
10589
|
this.drawLegend();
|
|
10305
10590
|
};
|
|
@@ -10339,9 +10624,9 @@ var Legend = /** @__PURE__ @class */ (function () {
|
|
|
10339
10624
|
}
|
|
10340
10625
|
}
|
|
10341
10626
|
}
|
|
10342
|
-
|
|
10343
|
-
|
|
10344
|
-
|
|
10627
|
+
}
|
|
10628
|
+
if (legend.type === 'Markers') {
|
|
10629
|
+
_this.getMarkersLegendCollections(layerIndex, layer.markerSettings);
|
|
10345
10630
|
}
|
|
10346
10631
|
});
|
|
10347
10632
|
if (this.legendCollection.length > 0) {
|
|
@@ -10532,8 +10817,9 @@ var Legend = /** @__PURE__ @class */ (function () {
|
|
|
10532
10817
|
}
|
|
10533
10818
|
}
|
|
10534
10819
|
else {
|
|
10820
|
+
var padding = 10;
|
|
10535
10821
|
shapeX = shapeLocation[j - 1].x;
|
|
10536
|
-
shapeY = prevPositionY +
|
|
10822
|
+
shapeY = prevPositionY + padding + (shapeHeight / 2);
|
|
10537
10823
|
}
|
|
10538
10824
|
}
|
|
10539
10825
|
}
|
|
@@ -10636,7 +10922,14 @@ var Legend = /** @__PURE__ @class */ (function () {
|
|
|
10636
10922
|
var legend = map.legendSettings;
|
|
10637
10923
|
var render = map.renderer;
|
|
10638
10924
|
var textOptions;
|
|
10639
|
-
var textFont =
|
|
10925
|
+
var textFont = {
|
|
10926
|
+
size: legend.textStyle.size,
|
|
10927
|
+
color: legend.textStyle.color,
|
|
10928
|
+
fontFamily: legend.textStyle.fontFamily,
|
|
10929
|
+
fontWeight: legend.textStyle.fontWeight,
|
|
10930
|
+
fontStyle: legend.textStyle.fontStyle,
|
|
10931
|
+
opacity: legend.textStyle.opacity
|
|
10932
|
+
};
|
|
10640
10933
|
this.legendGroup = render.createGroup({ id: map.element.id + '_Legend_Group' });
|
|
10641
10934
|
if (legend.mode === 'Interactive') {
|
|
10642
10935
|
for (var i = 0; i < this.legendRenderingCollections.length; i++) {
|
|
@@ -10652,7 +10945,7 @@ var Legend = /** @__PURE__ @class */ (function () {
|
|
|
10652
10945
|
textFont.color = (textFont.color !== null) ? textFont.color : this.maps.themeStyle.legendTextColor;
|
|
10653
10946
|
var rectOptions = new RectOption(itemId, item['fill'], item['shapeBorder'], legend.opacity, bounds);
|
|
10654
10947
|
textOptions = new TextOption(textId, textLocation.x, textLocation.y, 'middle', item['text'], '', '');
|
|
10655
|
-
textFont.fontFamily =
|
|
10948
|
+
textFont.fontFamily = !isNullOrUndefined(textFont.fontFamily) ? textFont.fontFamily : this.maps.themeStyle.fontFamily;
|
|
10656
10949
|
textFont.size = map.themeStyle.legendFontSize || textFont.size;
|
|
10657
10950
|
renderTextElement(textOptions, textFont, textFont.color, this.legendGroup);
|
|
10658
10951
|
this.legendGroup.appendChild(render.drawRectangle(rectOptions));
|
|
@@ -10707,7 +11000,7 @@ var Legend = /** @__PURE__ @class */ (function () {
|
|
|
10707
11000
|
};
|
|
10708
11001
|
legendTextStyle.color = (legendTextStyle.color !== null) ? legendTextStyle.color :
|
|
10709
11002
|
this.maps.themeStyle.legendTextColor;
|
|
10710
|
-
legendTextStyle.fontFamily =
|
|
11003
|
+
legendTextStyle.fontFamily = !isNullOrUndefined(legendTextStyle.fontFamily) ? legendTextStyle.fontFamily : this.maps.themeStyle.fontFamily;
|
|
10711
11004
|
legendTextStyle.size = map.themeStyle.legendFontSize || legendTextStyle.size;
|
|
10712
11005
|
if (i === 0) {
|
|
10713
11006
|
this.renderLegendBorder();
|
|
@@ -10783,7 +11076,9 @@ var Legend = /** @__PURE__ @class */ (function () {
|
|
|
10783
11076
|
'opacity': 1,
|
|
10784
11077
|
'dominant-baseline': ''
|
|
10785
11078
|
};
|
|
10786
|
-
|
|
11079
|
+
var pagingTextElement = render.createText(pageTextOptions, pagingText);
|
|
11080
|
+
pagingTextElement.setAttribute('style', 'user-select: none;');
|
|
11081
|
+
pagingGroup.appendChild(pagingTextElement);
|
|
10787
11082
|
this.legendGroup.appendChild(pagingGroup);
|
|
10788
11083
|
}
|
|
10789
11084
|
this.legendToggle();
|
|
@@ -10795,6 +11090,7 @@ var Legend = /** @__PURE__ @class */ (function () {
|
|
|
10795
11090
|
var shapeIndex;
|
|
10796
11091
|
var layerIndex;
|
|
10797
11092
|
var dataIndex;
|
|
11093
|
+
var pointIndex;
|
|
10798
11094
|
var legend = this.maps.legendSettings;
|
|
10799
11095
|
var textEle = legend.mode === 'Default' ? document.getElementById(targetElement.id.replace('Shape', 'Text')) :
|
|
10800
11096
|
document.getElementById(targetElement.id + '_Text');
|
|
@@ -10882,12 +11178,20 @@ var Legend = /** @__PURE__ @class */ (function () {
|
|
|
10882
11178
|
}
|
|
10883
11179
|
if (enable) {
|
|
10884
11180
|
for (var j = 0; j < data.length; j++) {
|
|
11181
|
+
var shapeElement = void 0;
|
|
10885
11182
|
shapeIndex = data[j]['shapeIndex'];
|
|
10886
11183
|
layerIndex = data[j]['layerIndex'];
|
|
10887
11184
|
dataIndex = data[j]['dataIndex'];
|
|
10888
|
-
|
|
10889
|
-
|
|
10890
|
-
|
|
11185
|
+
pointIndex = data[j]['pointIndex'];
|
|
11186
|
+
if (pointIndex === -1) {
|
|
11187
|
+
shapeElement = document.getElementById(this.maps.element.id + '_LayerIndex_' +
|
|
11188
|
+
layerIndex + '_shapeIndex_' + shapeIndex + '_dataIndex_' + dataIndex);
|
|
11189
|
+
}
|
|
11190
|
+
else {
|
|
11191
|
+
shapeElement = document.getElementById(this.maps.element.id + '_LayerIndex_' +
|
|
11192
|
+
layerIndex + '_shapeIndex_' + shapeIndex + '_dataIndex_' + dataIndex + '_multiLine_' + pointIndex);
|
|
11193
|
+
}
|
|
11194
|
+
if (shapeElement !== null) {
|
|
10891
11195
|
var shapeMatch = true;
|
|
10892
11196
|
if (this.maps.legendSelectionCollection !== null) {
|
|
10893
11197
|
for (var i_1 = 0; i_1 < this.maps.legendSelectionCollection.length; i_1++) {
|
|
@@ -10904,13 +11208,13 @@ var Legend = /** @__PURE__ @class */ (function () {
|
|
|
10904
11208
|
}
|
|
10905
11209
|
length = this.legendHighlightCollection.length;
|
|
10906
11210
|
var legendHighlightColor = this.legendHighlightCollection[length - 1]['legendOldFill'];
|
|
10907
|
-
this.legendHighlightCollection[length - 1]['MapShapeCollection']['Elements'].push(
|
|
11211
|
+
this.legendHighlightCollection[length - 1]['MapShapeCollection']['Elements'].push(shapeElement);
|
|
10908
11212
|
var shapeItemCount = this.legendHighlightCollection[length - 1]['MapShapeCollection']['Elements'].length - 1;
|
|
10909
|
-
var shapeOldFillColor =
|
|
11213
|
+
var shapeOldFillColor = shapeElement.getAttribute('fill');
|
|
10910
11214
|
this.legendHighlightCollection[length - 1]['shapeOldFillColor'].push(shapeOldFillColor);
|
|
10911
11215
|
var shapeOldColor = this.legendHighlightCollection[length - 1]['shapeOldFillColor'][shapeItemCount];
|
|
10912
11216
|
this.shapePreviousColor = this.legendHighlightCollection[length - 1]['shapeOldFillColor'];
|
|
10913
|
-
this.setColor(
|
|
11217
|
+
this.setColor(shapeElement, !isNullOrUndefined(module.fill) ? module.fill : shapeOldColor, module.opacity.toString(), module.border.color, module.border.width.toString(), 'highlight');
|
|
10914
11218
|
this.setColor(targetElement, !isNullOrUndefined(module.fill) ? module.fill : legendHighlightColor, module.opacity.toString(), module.border.color, module.border.width.toString(), 'highlight');
|
|
10915
11219
|
}
|
|
10916
11220
|
else if (value === 'selection') {
|
|
@@ -10933,12 +11237,12 @@ var Legend = /** @__PURE__ @class */ (function () {
|
|
|
10933
11237
|
}
|
|
10934
11238
|
selectLength = this.maps.legendSelectionCollection.length;
|
|
10935
11239
|
var legendSelectionColor = this.maps.legendSelectionCollection[selectLength - 1]['legendOldFill'];
|
|
10936
|
-
this.maps.legendSelectionCollection[selectLength - 1]['MapShapeCollection']['Elements'].push(
|
|
11240
|
+
this.maps.legendSelectionCollection[selectLength - 1]['MapShapeCollection']['Elements'].push(shapeElement);
|
|
10937
11241
|
this.maps.legendSelectionCollection[selectLength - 1]['shapeOldFillColor'] = this.shapePreviousColor;
|
|
10938
11242
|
this.setColor(targetElement, !isNullOrUndefined(module.fill) ? module.fill : legendSelectionColor, module.opacity.toString(), module.border.color, module.border.width.toString(), 'selection');
|
|
10939
|
-
this.setColor(
|
|
10940
|
-
if (this.maps.selectedElementId.indexOf(
|
|
10941
|
-
this.maps.selectedElementId.push(
|
|
11243
|
+
this.setColor(shapeElement, !isNullOrUndefined(module.fill) ? module.fill : legendSelectionColor, module.opacity.toString(), module.border.color, module.border.width.toString(), 'selection');
|
|
11244
|
+
if (this.maps.selectedElementId.indexOf(shapeElement.getAttribute('id')) === -1) {
|
|
11245
|
+
this.maps.selectedElementId.push(shapeElement.getAttribute('id'));
|
|
10942
11246
|
}
|
|
10943
11247
|
if (j === data.length - 1) {
|
|
10944
11248
|
this.maps.legendSelection = false;
|
|
@@ -10953,14 +11257,15 @@ var Legend = /** @__PURE__ @class */ (function () {
|
|
|
10953
11257
|
}
|
|
10954
11258
|
};
|
|
10955
11259
|
Legend.prototype.setColor = function (element, fill, opacity, borderColor, borderWidth, type) {
|
|
11260
|
+
var isLineStringShape = (element.parentElement.id.indexOf('LineString') > -1);
|
|
10956
11261
|
if (type === 'selection') {
|
|
10957
|
-
maintainStyleClass('ShapeselectionMap', 'ShapeselectionMapStyle', fill, opacity, borderColor, borderWidth, this.maps);
|
|
10958
|
-
element.setAttribute('class', 'ShapeselectionMapStyle');
|
|
11262
|
+
maintainStyleClass((isLineStringShape ? 'LineselectionMap' : 'ShapeselectionMap'), (isLineStringShape ? 'LineselectionMapStyle' : 'ShapeselectionMapStyle'), (isLineStringShape ? 'transparent' : fill), opacity, (isLineStringShape ? fill : borderColor), borderWidth, this.maps);
|
|
11263
|
+
element.setAttribute('class', isLineStringShape ? 'LineselectionMapStyle' : 'ShapeselectionMapStyle');
|
|
10959
11264
|
}
|
|
10960
11265
|
else {
|
|
10961
|
-
element.setAttribute('fill', fill);
|
|
11266
|
+
element.setAttribute('fill', isLineStringShape ? 'transparent' : fill);
|
|
10962
11267
|
element.setAttribute('fill-opacity', opacity);
|
|
10963
|
-
element.setAttribute('stroke', borderColor);
|
|
11268
|
+
element.setAttribute('stroke', isLineStringShape ? fill : borderColor);
|
|
10964
11269
|
element.setAttribute('stroke-width', (Number(borderWidth) / this.maps.scale).toString());
|
|
10965
11270
|
}
|
|
10966
11271
|
};
|
|
@@ -11003,7 +11308,8 @@ var Legend = /** @__PURE__ @class */ (function () {
|
|
|
11003
11308
|
var dataCount = shapeElements.length;
|
|
11004
11309
|
for (var j = 0; j < dataCount; j++) {
|
|
11005
11310
|
var shapeElement = getElement(shapeElements[j]);
|
|
11006
|
-
if (shapeElement.getAttribute('class') === 'ShapeselectionMapStyle'
|
|
11311
|
+
if (shapeElement.getAttribute('class') === 'ShapeselectionMapStyle' ||
|
|
11312
|
+
shapeElement.getAttribute('class') === 'LineselectionMapStyle') {
|
|
11007
11313
|
removeClass(shapeElement);
|
|
11008
11314
|
var selectedElementIdIndex = this.maps.selectedElementId.indexOf(shapeElement.id);
|
|
11009
11315
|
if (selectedElementIdIndex !== -1) {
|
|
@@ -11081,12 +11387,14 @@ var Legend = /** @__PURE__ @class */ (function () {
|
|
|
11081
11387
|
this.maps.legendSelectionClass = module;
|
|
11082
11388
|
}
|
|
11083
11389
|
else {
|
|
11084
|
-
if ((checkSelection <= 1) && targetElement.getAttribute('class') === 'ShapeselectionMapStyle'
|
|
11390
|
+
if ((checkSelection <= 1) && (targetElement.getAttribute('class') === 'ShapeselectionMapStyle'
|
|
11391
|
+
|| targetElement.getAttribute('class') === 'LineselectionMapStyle')) {
|
|
11085
11392
|
if (!this.maps.layers[layerIndex].selectionSettings.enableMultiSelect) {
|
|
11086
11393
|
this.maps.selectedLegendElementId.splice(selectionIndex, 1);
|
|
11087
11394
|
}
|
|
11088
11395
|
else {
|
|
11089
|
-
if (checkSelection <= 1 && targetElement.getAttribute('class') === 'ShapeselectionMapStyle'
|
|
11396
|
+
if (checkSelection <= 1 && (targetElement.getAttribute('class') === 'ShapeselectionMapStyle'
|
|
11397
|
+
|| targetElement.getAttribute('class') === 'LineselectionMapStyle')) {
|
|
11090
11398
|
this.maps.selectedLegendElementId.splice(selectionIndex, 1);
|
|
11091
11399
|
}
|
|
11092
11400
|
}
|
|
@@ -11173,7 +11481,8 @@ var Legend = /** @__PURE__ @class */ (function () {
|
|
|
11173
11481
|
}
|
|
11174
11482
|
}
|
|
11175
11483
|
}
|
|
11176
|
-
if (selectionEle && (selectionEle['IsSelected'] && targetElement.getAttribute('class') === 'ShapeselectionMapStyle'
|
|
11484
|
+
if (selectionEle && (selectionEle['IsSelected'] && (targetElement.getAttribute('class') === 'ShapeselectionMapStyle'
|
|
11485
|
+
|| targetElement.getAttribute('class') === 'LineselectionMapStyle'))) {
|
|
11177
11486
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11178
11487
|
var element = this.maps.legendSelectionCollection[selectionEle['SelectionIndex']];
|
|
11179
11488
|
var multiSelection = 0;
|
|
@@ -11264,7 +11573,7 @@ var Legend = /** @__PURE__ @class */ (function () {
|
|
|
11264
11573
|
}
|
|
11265
11574
|
for (var j = 0; j < this.maps.selectedLegendElementId.length; j++) {
|
|
11266
11575
|
var idIndex = this.maps.legendSettings.mode === 'Interactive' ?
|
|
11267
|
-
'
|
|
11576
|
+
this.maps.element.id + '_Legend_Index_' : this.maps.element.id + '_Legend_Shape_Index_';
|
|
11268
11577
|
var selectedElement = idIndex + this.maps.selectedLegendElementId[j];
|
|
11269
11578
|
var legendElement = document.getElementById(selectedElement);
|
|
11270
11579
|
if (!isNullOrUndefined(legendElement)) {
|
|
@@ -11316,6 +11625,7 @@ var Legend = /** @__PURE__ @class */ (function () {
|
|
|
11316
11625
|
var shapeIndex;
|
|
11317
11626
|
var layerIndex;
|
|
11318
11627
|
var dataIndex;
|
|
11628
|
+
var pointIndex;
|
|
11319
11629
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11320
11630
|
var collection = this.maps.legendModule.legendCollection;
|
|
11321
11631
|
var legend = this.maps.legendSettings;
|
|
@@ -11328,15 +11638,23 @@ var Legend = /** @__PURE__ @class */ (function () {
|
|
|
11328
11638
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11329
11639
|
var currentElement = { Elements: [] };
|
|
11330
11640
|
for (var j = 0; j < data.length; j++) {
|
|
11641
|
+
var shapeElement = void 0;
|
|
11331
11642
|
shapeIndex = data[j]['shapeIndex'];
|
|
11332
11643
|
layerIndex = data[j]['layerIndex'];
|
|
11333
11644
|
dataIndex = data[j]['dataIndex'];
|
|
11334
|
-
|
|
11335
|
-
|
|
11336
|
-
|
|
11645
|
+
pointIndex = data[j]['pointIndex'];
|
|
11646
|
+
if (pointIndex === -1) {
|
|
11647
|
+
shapeElement = document.getElementById(this.maps.element.id + '_LayerIndex_' +
|
|
11648
|
+
layerIndex + '_shapeIndex_' + shapeIndex + '_dataIndex_' + dataIndex);
|
|
11649
|
+
}
|
|
11650
|
+
else {
|
|
11651
|
+
shapeElement = document.getElementById(this.maps.element.id + '_LayerIndex_' +
|
|
11652
|
+
layerIndex + '_shapeIndex_' + shapeIndex + '_dataIndex_' + dataIndex + '_multiLine_' + pointIndex);
|
|
11653
|
+
}
|
|
11654
|
+
if (targetElement === shapeElement) {
|
|
11337
11655
|
process = true;
|
|
11338
11656
|
}
|
|
11339
|
-
elements.push(
|
|
11657
|
+
elements.push(shapeElement);
|
|
11340
11658
|
}
|
|
11341
11659
|
if (process) {
|
|
11342
11660
|
if (isNullOrUndefined(currentElement['LegendEle'])) {
|
|
@@ -11354,16 +11672,25 @@ var Legend = /** @__PURE__ @class */ (function () {
|
|
|
11354
11672
|
var shapeIndex;
|
|
11355
11673
|
var layerIndex;
|
|
11356
11674
|
var dataIndex;
|
|
11675
|
+
var pointIndex;
|
|
11357
11676
|
var idIndex = parseFloat(targetElement.id.charAt(targetElement.id.length - 1));
|
|
11358
11677
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11359
11678
|
var data = this.maps.legendModule.legendCollection[idIndex]['data'];
|
|
11360
11679
|
var legendShapeElements = [];
|
|
11361
11680
|
for (var i = 0; i < data.length; i++) {
|
|
11681
|
+
var shapeElement = void 0;
|
|
11362
11682
|
shapeIndex = data[i]['shapeIndex'];
|
|
11363
11683
|
layerIndex = data[i]['layerIndex'];
|
|
11364
11684
|
dataIndex = data[i]['dataIndex'];
|
|
11365
|
-
|
|
11366
|
-
|
|
11685
|
+
pointIndex = data[i]['pointIndex'];
|
|
11686
|
+
if (pointIndex === -1) {
|
|
11687
|
+
shapeElement = document.getElementById(this.maps.element.id + '_LayerIndex_' +
|
|
11688
|
+
layerIndex + '_shapeIndex_' + shapeIndex + '_dataIndex_' + dataIndex);
|
|
11689
|
+
}
|
|
11690
|
+
else {
|
|
11691
|
+
shapeElement = document.getElementById(this.maps.element.id + '_LayerIndex_' +
|
|
11692
|
+
layerIndex + '_shapeIndex_' + shapeIndex + '_dataIndex_' + dataIndex + '_multiLine_' + pointIndex);
|
|
11693
|
+
}
|
|
11367
11694
|
if (!isNullOrUndefined(shapeElement)) {
|
|
11368
11695
|
legendShapeElements.push(shapeElement.id);
|
|
11369
11696
|
}
|
|
@@ -11431,9 +11758,11 @@ var Legend = /** @__PURE__ @class */ (function () {
|
|
|
11431
11758
|
var renderOptions = new RectOption(map.element.id + '_Legend_Border', legend.background, legendBorder, 1, this.legendBorderRect, null, null, '', '');
|
|
11432
11759
|
this.legendGroup.appendChild(map.renderer.drawRectangle(renderOptions));
|
|
11433
11760
|
this.getLegendAlignment(map, this.legendBorderRect.width, this.legendBorderRect.height, legend);
|
|
11434
|
-
this.legendGroup.setAttribute('transform', 'translate( ' + (this.translate.x + (-
|
|
11761
|
+
this.legendGroup.setAttribute('transform', 'translate( ' + (this.translate.x + (-this.legendBorderRect.x)) + ' ' +
|
|
11435
11762
|
(this.translate.y + (-(this.legendBorderRect.y))) + ' )');
|
|
11436
|
-
|
|
11763
|
+
if (legend.position !== 'Float') {
|
|
11764
|
+
map.svgObject.appendChild(this.legendGroup);
|
|
11765
|
+
}
|
|
11437
11766
|
if (legendTitle) {
|
|
11438
11767
|
textStyle.color = (textStyle.color !== null) ? textStyle.color : this.maps.themeStyle.legendTitleFontColor;
|
|
11439
11768
|
textStyle.fontFamily = !isNullOrUndefined(textStyle.fontFamily) ? textStyle.fontFamily : this.maps.themeStyle.fontFamily;
|
|
@@ -11445,7 +11774,16 @@ var Legend = /** @__PURE__ @class */ (function () {
|
|
|
11445
11774
|
this.currentPage = (e.target.id.indexOf('_Left_Page_') > -1) ? (this.currentPage - 1) :
|
|
11446
11775
|
(this.currentPage + 1);
|
|
11447
11776
|
this.legendGroup = this.maps.renderer.createGroup({ id: this.maps.element.id + '_Legend_Group' });
|
|
11777
|
+
this.maps.mapAreaRect = this.initialMapAreaRect;
|
|
11448
11778
|
this.drawLegendItem(this.currentPage);
|
|
11779
|
+
if (!isNullOrUndefined(this.maps.legendModule) && this.maps.legendSettings.position === 'Float') {
|
|
11780
|
+
if (this.maps.isTileMap) {
|
|
11781
|
+
this.maps.mapLayerPanel.layerGroup.appendChild(this.maps.legendModule.legendGroup);
|
|
11782
|
+
}
|
|
11783
|
+
else {
|
|
11784
|
+
this.maps.svgObject.appendChild(this.maps.legendModule.legendGroup);
|
|
11785
|
+
}
|
|
11786
|
+
}
|
|
11449
11787
|
if (querySelector(this.maps.element.id + '_Legend_Border', this.maps.element.id)) {
|
|
11450
11788
|
querySelector(this.maps.element.id + '_Legend_Border', this.maps.element.id).style.pointerEvents = 'none';
|
|
11451
11789
|
}
|
|
@@ -11463,53 +11801,60 @@ var Legend = /** @__PURE__ @class */ (function () {
|
|
|
11463
11801
|
var areaWidth = totalRect.width;
|
|
11464
11802
|
var totalWidth = map.availableSize.width;
|
|
11465
11803
|
var totalHeight = map.availableSize.height;
|
|
11804
|
+
var locationX = !isNullOrUndefined(legend.location.x) ? legend.location.x : 0;
|
|
11805
|
+
var locationY = !isNullOrUndefined(legend.location.y) ? legend.location.y : 0;
|
|
11466
11806
|
if (legend.position === 'Float') {
|
|
11467
|
-
this.translate =
|
|
11807
|
+
this.translate = map.isTileMap ? new Point(locationX, locationY + (spacing / 4)) : new Point(locationX + map.mapAreaRect.x, locationY + map.mapAreaRect.y);
|
|
11808
|
+
this.legendTotalRect = map.mapAreaRect;
|
|
11468
11809
|
}
|
|
11469
11810
|
else {
|
|
11470
11811
|
switch (legend.position) {
|
|
11471
11812
|
case 'Top':
|
|
11472
11813
|
case 'Bottom':
|
|
11473
|
-
totalRect.height = (areaHeight - height);
|
|
11814
|
+
totalRect.height = (legend.position === 'Top') ? (areaHeight - height) : (areaHeight - height - (spacing * 2));
|
|
11474
11815
|
x = (totalWidth / 2) - (width / 2);
|
|
11475
11816
|
y = (legend.position === 'Top') ? areaY : (areaY + totalRect.height);
|
|
11476
|
-
totalRect.y = (legend.position === 'Top') ? areaY + height + spacing : areaY;
|
|
11817
|
+
totalRect.y = (legend.position === 'Top') ? areaY + height + (map.isTileMap ? (spacing / 2) : spacing) : areaY - (spacing / 2);
|
|
11477
11818
|
break;
|
|
11478
11819
|
case 'Left':
|
|
11479
11820
|
case 'Right':
|
|
11480
|
-
totalRect.width = (areaWidth - width);
|
|
11481
|
-
x = (legend.position === 'Left') ? areaX : (areaX + totalRect.width
|
|
11821
|
+
totalRect.width = (areaWidth - width - map.mapAreaRect.x);
|
|
11822
|
+
x = (legend.position === 'Left') ? areaX + (spacing / 2) : (areaX + totalRect.width + spacing);
|
|
11482
11823
|
y = (totalHeight / 2) - (height / 2);
|
|
11483
|
-
totalRect.x = (legend.position === 'Left') ? areaX + width : areaX;
|
|
11824
|
+
totalRect.x = (legend.position === 'Left') ? areaX + width + spacing : areaX;
|
|
11484
11825
|
break;
|
|
11485
11826
|
}
|
|
11486
11827
|
switch (legend.alignment) {
|
|
11487
11828
|
case 'Near':
|
|
11488
11829
|
if (legend.position === 'Top' || legend.position === 'Bottom') {
|
|
11489
|
-
x = totalRect.x;
|
|
11830
|
+
x = totalRect.x - (legend.mode === 'Interactive' ? spacing : 0);
|
|
11490
11831
|
}
|
|
11491
11832
|
else {
|
|
11492
|
-
y = totalRect.y;
|
|
11833
|
+
y = totalRect.y - (!(legend.height && legend.width) && legend.mode === 'Interactive' ? map.mapAreaRect.x : 0);
|
|
11493
11834
|
}
|
|
11494
11835
|
break;
|
|
11495
11836
|
case 'Far':
|
|
11496
11837
|
if (legend.position === 'Top' || legend.position === 'Bottom') {
|
|
11497
|
-
x = (totalWidth - width) - spacing;
|
|
11838
|
+
x = (totalWidth - width) - (legend.mode === 'Interactive' ? 0 : spacing);
|
|
11498
11839
|
}
|
|
11499
11840
|
else {
|
|
11500
|
-
y = totalHeight - height;
|
|
11841
|
+
y = totalHeight - height - (legend.mode === 'Default' ? spacing : 0);
|
|
11501
11842
|
}
|
|
11502
11843
|
break;
|
|
11503
11844
|
}
|
|
11504
11845
|
if ((legend.height || legend.width) && legend.mode !== 'Interactive') {
|
|
11505
|
-
this.legendTotalRect = map.totalRect = totalRect;
|
|
11846
|
+
this.legendTotalRect = map.mapAreaRect = map.totalRect = totalRect;
|
|
11506
11847
|
}
|
|
11507
11848
|
else {
|
|
11849
|
+
map.totalRect = null;
|
|
11508
11850
|
if ((legend.height || legend.width) && legend.mode === 'Interactive') {
|
|
11509
11851
|
map.totalRect = totalRect;
|
|
11510
11852
|
}
|
|
11511
11853
|
this.legendTotalRect = map.mapAreaRect = totalRect;
|
|
11512
11854
|
}
|
|
11855
|
+
if (legend.position === 'Left') {
|
|
11856
|
+
map.mapAreaRect.width = totalRect.width;
|
|
11857
|
+
}
|
|
11513
11858
|
this.translate = new Point(x, y);
|
|
11514
11859
|
}
|
|
11515
11860
|
};
|
|
@@ -11527,7 +11872,7 @@ var Legend = /** @__PURE__ @class */ (function () {
|
|
|
11527
11872
|
data[_this.maps.legendSettings.showLegendPath];
|
|
11528
11873
|
if (marker$$1.visible && showLegend && (!isNullOrUndefined(data['latitude'])) && (!isNullOrUndefined(data['longitude']))) {
|
|
11529
11874
|
if (marker$$1.template) {
|
|
11530
|
-
templateFn = getTemplateFunction(marker$$1.template);
|
|
11875
|
+
templateFn = getTemplateFunction(marker$$1.template, _this.maps);
|
|
11531
11876
|
var templateElement = templateFn(_this.maps);
|
|
11532
11877
|
var markerEle = isNullOrUndefined(templateElement.childElementCount) ? templateElement[0] :
|
|
11533
11878
|
templateElement;
|
|
@@ -11638,6 +11983,13 @@ var Legend = /** @__PURE__ @class */ (function () {
|
|
|
11638
11983
|
borderColor: legend.shapeBorder.color, borderWidth: legend.shapeBorder.width
|
|
11639
11984
|
});
|
|
11640
11985
|
}
|
|
11986
|
+
else {
|
|
11987
|
+
for (var i = 0; i < this.legendCollection.length; i++) {
|
|
11988
|
+
if (this.legendCollection[i]['text'] === legendText && this.legendCollection[i]['fill'] === legendFill) {
|
|
11989
|
+
this.legendCollection[i].data.push(newColllection[0]);
|
|
11990
|
+
}
|
|
11991
|
+
}
|
|
11992
|
+
}
|
|
11641
11993
|
}
|
|
11642
11994
|
};
|
|
11643
11995
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -11839,15 +12191,16 @@ var Legend = /** @__PURE__ @class */ (function () {
|
|
|
11839
12191
|
var width = 10;
|
|
11840
12192
|
var direction = (legend.orientation === 'None') ? (legend.position === 'Top' || legend.position === 'Bottom')
|
|
11841
12193
|
? 'Horizontal' : 'Vertical' : legend.orientation;
|
|
12194
|
+
rect.y = legend.position === 'Float' && this.maps.isTileMap ? rect.y - this.maps.mapAreaRect.y : rect.y;
|
|
11842
12195
|
if (direction === 'Horizontal') {
|
|
11843
12196
|
if (!legend.invertedPointer) {
|
|
11844
|
-
locX = rect.x + (rect.width / 2);
|
|
12197
|
+
locX = rect.x + (rect.width / 2) - (legend.position === 'Float' && this.maps.isTileMap ? this.maps.mapAreaRect.x : 0);
|
|
11845
12198
|
locY = rect.y;
|
|
11846
12199
|
path = ' M ' + locX + ' ' + locY + ' L ' + (locX - width) + ' ' + (locY - height) +
|
|
11847
12200
|
' L ' + (locX + width) + ' ' + (locY - height) + ' Z ';
|
|
11848
12201
|
}
|
|
11849
12202
|
else {
|
|
11850
|
-
locX = rect.x + (rect.width / 2);
|
|
12203
|
+
locX = rect.x + (rect.width / 2) - (legend.position === 'Float' && this.maps.isTileMap ? this.maps.mapAreaRect.x : 0);
|
|
11851
12204
|
locY = rect.y + (rect.height);
|
|
11852
12205
|
path = ' M ' + locX + ' ' + locY + ' L ' + (locX - width) + ' ' + (locY + height) +
|
|
11853
12206
|
' L ' + (locX + width) + ' ' + (locY + height) + ' Z ';
|
|
@@ -11855,20 +12208,25 @@ var Legend = /** @__PURE__ @class */ (function () {
|
|
|
11855
12208
|
}
|
|
11856
12209
|
else {
|
|
11857
12210
|
if (!legend.invertedPointer) {
|
|
11858
|
-
locX = rect.x +
|
|
12211
|
+
locX = rect.x + rect.width - (legend.position === 'Float' && this.maps.isTileMap ? this.maps.mapAreaRect.x : 0);
|
|
11859
12212
|
locY = rect.y + (rect.height / 2);
|
|
11860
12213
|
path = ' M ' + locX + ' ' + locY + ' L ' + (locX + width) + ' ' + (locY - height) +
|
|
11861
12214
|
' L ' + (locX + width) + ' ' + (locY + height) + ' z ';
|
|
11862
12215
|
}
|
|
11863
12216
|
else {
|
|
11864
|
-
locX = rect.x;
|
|
12217
|
+
locX = rect.x - (legend.position === 'Float' && this.maps.isTileMap ? this.maps.mapAreaRect.x : 0);
|
|
11865
12218
|
locY = rect.y + (rect.height / 2);
|
|
11866
12219
|
path = ' M ' + locX + ' ' + locY + ' L ' + (locX - width) + ' ' + (locY - height) +
|
|
11867
12220
|
' L ' + (locX - width) + ' ' + (locY + height) + ' z ';
|
|
11868
12221
|
}
|
|
11869
12222
|
}
|
|
11870
12223
|
var pathOptions = new PathOption(id, fill, strokeWidth, stroke, 1, 1, '', path);
|
|
11871
|
-
|
|
12224
|
+
if (legend.position === 'Float' && this.maps.isTileMap) {
|
|
12225
|
+
this.maps.mapLayerPanel.layerGroup.appendChild(this.maps.renderer.drawPath(pathOptions));
|
|
12226
|
+
}
|
|
12227
|
+
else {
|
|
12228
|
+
this.maps.svgObject.appendChild(this.maps.renderer.drawPath(pathOptions));
|
|
12229
|
+
}
|
|
11872
12230
|
};
|
|
11873
12231
|
Legend.prototype.wireEvents = function (element) {
|
|
11874
12232
|
EventHandler.add(element, Browser.touchStartEvent, this.changeNextPage, this);
|
|
@@ -11925,6 +12283,9 @@ var Legend = /** @__PURE__ @class */ (function () {
|
|
|
11925
12283
|
'_BubbleIndex_' + j + '_dataIndex_' + shape['dataIndex'], this.maps.element.id) : querySelector(this.maps.element.id + '_LayerIndex_' + shape['layerIndex'] +
|
|
11926
12284
|
'_MarkerIndex_' + shape['markerIndex'] + '_dataIndex_' + shape['dataIndex'], this.maps.element.id);
|
|
11927
12285
|
if (!isNullOrUndefined(shape['shape']) && shape['shape'] === 'Balloon') {
|
|
12286
|
+
mapElement = this.maps.legendSettings.type === 'Bubbles' ? querySelector(this.maps.element.id + '_LayerIndex_' + shape['layerIndex'] +
|
|
12287
|
+
'_BubbleIndex_' + j + '_dataIndex_' + shape['dataIndex'] + '_Group', this.maps.element.id) : querySelector(this.maps.element.id + '_LayerIndex_' + shape['layerIndex'] +
|
|
12288
|
+
'_MarkerIndex_' + shape['markerIndex'] + '_dataIndex_' + shape['dataIndex'] + '_Group', this.maps.element.id);
|
|
11928
12289
|
mapElement = mapElement.children[0];
|
|
11929
12290
|
}
|
|
11930
12291
|
if (isVisible && mapElement !== null) {
|
|
@@ -12066,6 +12427,9 @@ var Legend = /** @__PURE__ @class */ (function () {
|
|
|
12066
12427
|
'_BubbleIndex_' + j + '_dataIndex_' + mapdata['dataIndex'], this.maps.element.id) : querySelector(this.maps.element.id + '_LayerIndex_' + mapdata['layerIndex'] +
|
|
12067
12428
|
'_MarkerIndex_' + j + '_dataIndex_' + mapdata['dataIndex'], this.maps.element.id);
|
|
12068
12429
|
if (!isNullOrUndefined(mapdata['shape']) && mapdata['shape'] === 'Balloon') {
|
|
12430
|
+
LegendInteractive = this.maps.legendSettings.type === 'Bubbles' ? querySelector(this.maps.element.id + '_LayerIndex_' + mapdata['layerIndex'] +
|
|
12431
|
+
'_BubbleIndex_' + j + '_dataIndex_' + mapdata['dataIndex'] + '_Group', this.maps.element.id) : querySelector(this.maps.element.id + '_LayerIndex_' + mapdata['layerIndex'] +
|
|
12432
|
+
'_MarkerIndex_' + j + '_dataIndex_' + mapdata['dataIndex'] + '_Group', this.maps.element.id);
|
|
12069
12433
|
LegendInteractive = LegendInteractive.children[0];
|
|
12070
12434
|
}
|
|
12071
12435
|
if (isVisible && LegendInteractive !== null) {
|
|
@@ -12229,10 +12593,20 @@ var Legend = /** @__PURE__ @class */ (function () {
|
|
|
12229
12593
|
var shapeDataValueCase = !isNullOrUndefined(shapeData['properties'][shapePath])
|
|
12230
12594
|
&& isNaN(shapeData['properties'][shapePath]) ? shapeData['properties'][shapePath].toLowerCase() : shapeData['properties'][shapePath];
|
|
12231
12595
|
if (shapeDataValueCase === dataPathValueCase) {
|
|
12232
|
-
|
|
12233
|
-
|
|
12234
|
-
|
|
12235
|
-
|
|
12596
|
+
if (shapeData['geometry']['type'] != 'MultiPoint') {
|
|
12597
|
+
legendData.push({
|
|
12598
|
+
layerIndex: layerIndex, shapeIndex: i, dataIndex: dataIndex,
|
|
12599
|
+
name: data[dataPath], value: value, pointIndex: -1
|
|
12600
|
+
});
|
|
12601
|
+
}
|
|
12602
|
+
else {
|
|
12603
|
+
for (var j = 0; j < shapeData['geometry'].coordinates.length; j++) {
|
|
12604
|
+
legendData.push({
|
|
12605
|
+
layerIndex: layerIndex, shapeIndex: i, dataIndex: dataIndex,
|
|
12606
|
+
name: data[dataPath], value: value, pointIndex: j
|
|
12607
|
+
});
|
|
12608
|
+
}
|
|
12609
|
+
}
|
|
12236
12610
|
}
|
|
12237
12611
|
}
|
|
12238
12612
|
}
|
|
@@ -12278,15 +12652,30 @@ var Legend = /** @__PURE__ @class */ (function () {
|
|
|
12278
12652
|
/**
|
|
12279
12653
|
* To destroy the legend.
|
|
12280
12654
|
*
|
|
12281
|
-
* @param {Maps} maps - Specifies the instance of the maps
|
|
12282
12655
|
* @returns {void}
|
|
12283
12656
|
* @private
|
|
12284
12657
|
*/
|
|
12285
|
-
Legend.prototype.destroy = function (
|
|
12286
|
-
|
|
12287
|
-
|
|
12288
|
-
|
|
12658
|
+
Legend.prototype.destroy = function () {
|
|
12659
|
+
this.legendCollection = [];
|
|
12660
|
+
this.legendRenderingCollections = [];
|
|
12661
|
+
this.translate = null;
|
|
12662
|
+
this.legendBorderRect = null;
|
|
12663
|
+
this.initialMapAreaRect = null;
|
|
12664
|
+
this.legendTotalRect = null;
|
|
12665
|
+
this.totalPages = [];
|
|
12666
|
+
this.legendItemRect = null;
|
|
12667
|
+
this.legendGroup = null;
|
|
12668
|
+
this.shapeHighlightCollection = [];
|
|
12669
|
+
this.legendHighlightCollection = [];
|
|
12670
|
+
this.shapePreviousColor = [];
|
|
12671
|
+
this.selectedNonLegendShapes = [];
|
|
12672
|
+
this.legendLinearGradient = null;
|
|
12673
|
+
this.currentLayer = null;
|
|
12674
|
+
this.defsElement = null;
|
|
12675
|
+
this.legendElement = [];
|
|
12676
|
+
this.oldShapeElement = null;
|
|
12289
12677
|
this.removeEventListener();
|
|
12678
|
+
this.maps = null;
|
|
12290
12679
|
};
|
|
12291
12680
|
return Legend;
|
|
12292
12681
|
}());
|
|
@@ -12344,7 +12733,8 @@ var Highlight = /** @__PURE__ @class */ (function () {
|
|
|
12344
12733
|
targetEle.getAttribute('class') !== 'ShapeselectionMapStyle' && !isTouch &&
|
|
12345
12734
|
targetEle.getAttribute('class') !== 'MarkerselectionMapStyle' &&
|
|
12346
12735
|
targetEle.getAttribute('class') !== 'BubbleselectionMapStyle' &&
|
|
12347
|
-
targetEle.getAttribute('class') !== 'navigationlineselectionMapStyle'
|
|
12736
|
+
targetEle.getAttribute('class') !== 'navigationlineselectionMapStyle' &&
|
|
12737
|
+
targetEle.getAttribute('class') !== 'LineselectionMapStyle') {
|
|
12348
12738
|
layerIndex = parseInt(targetEle.id.split('_LayerIndex_')[1].split('_')[0], 10);
|
|
12349
12739
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12350
12740
|
var shapeData = void 0;
|
|
@@ -12354,8 +12744,9 @@ var Highlight = /** @__PURE__ @class */ (function () {
|
|
|
12354
12744
|
var dataIndex = void 0;
|
|
12355
12745
|
if (targetEle.id.indexOf('shapeIndex') > -1) {
|
|
12356
12746
|
shapeIn = parseInt(targetEle.id.split('_shapeIndex_')[1].split('_')[0], 10);
|
|
12357
|
-
shapeData = this.maps.layers[layerIndex].shapeData['features']
|
|
12358
|
-
this.maps.
|
|
12747
|
+
shapeData = this.maps.layers[layerIndex].shapeData['features'] &&
|
|
12748
|
+
!isNullOrUndefined(this.maps.layersCollection[layerIndex].layerData[shapeIn]) ?
|
|
12749
|
+
this.maps.layersCollection[layerIndex].layerData[shapeIn]['property'] : null;
|
|
12359
12750
|
dataIndex = parseInt(targetEle.id.split('_dataIndex_')[1].split('_')[0], 10);
|
|
12360
12751
|
data = isNullOrUndefined(dataIndex) ? null : this.maps.layers[layerIndex].dataSource[dataIndex];
|
|
12361
12752
|
this.highlightSettings = this.maps.layers[layerIndex].highlightSettings;
|
|
@@ -12427,7 +12818,8 @@ var Highlight = /** @__PURE__ @class */ (function () {
|
|
|
12427
12818
|
*/
|
|
12428
12819
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12429
12820
|
Highlight.prototype.handleHighlight = function (targetElement, layerIndex, data, shapeData) {
|
|
12430
|
-
if (this.maps.legendSettings.visible && targetElement.id.indexOf('_MarkerIndex_') === -1 && this.maps.legendModule
|
|
12821
|
+
if (this.maps.legendSettings.visible && targetElement.id.indexOf('_MarkerIndex_') === -1 && this.maps.legendModule
|
|
12822
|
+
&& this.maps.legendSettings.type === 'Layers') {
|
|
12431
12823
|
this.maps.legendModule.shapeHighLightAndSelection(targetElement, data, this.highlightSettings, 'highlight', layerIndex);
|
|
12432
12824
|
}
|
|
12433
12825
|
var selectHighLight = targetElement.id.indexOf('shapeIndex') > -1 && (this.maps.legendSettings.visible && this.maps.legendModule) ?
|
|
@@ -12446,7 +12838,7 @@ var Highlight = /** @__PURE__ @class */ (function () {
|
|
|
12446
12838
|
isMarkerSelect = this.maps.layers[layerIndex].markerSettings[marker$$1].highlightSettings.enable;
|
|
12447
12839
|
}
|
|
12448
12840
|
var border = {
|
|
12449
|
-
color: (targetEle.parentElement.id.indexOf('LineString') === -1) ? this.highlightSettings.border.color : (this.highlightSettings.
|
|
12841
|
+
color: (targetEle.parentElement.id.indexOf('LineString') === -1) ? this.highlightSettings.border.color : (this.highlightSettings.fill || this.highlightSettings.border.color),
|
|
12450
12842
|
width: (targetEle.parentElement.id.indexOf('LineString') === -1) ? (this.highlightSettings.border.width / (isMarkerSelect ? 1 : this.maps.scale)) : (this.highlightSettings.border.width / this.maps.scale),
|
|
12451
12843
|
opacity: this.highlightSettings.border.opacity
|
|
12452
12844
|
};
|
|
@@ -12502,15 +12894,13 @@ var Highlight = /** @__PURE__ @class */ (function () {
|
|
|
12502
12894
|
/**
|
|
12503
12895
|
* To destroy the highlight.
|
|
12504
12896
|
*
|
|
12505
|
-
* @param {Maps} maps - Specifies the maps instance
|
|
12506
12897
|
* @returns {void}
|
|
12507
12898
|
* @private
|
|
12508
12899
|
*/
|
|
12509
|
-
Highlight.prototype.destroy = function (
|
|
12510
|
-
|
|
12511
|
-
* Destroy method performed here
|
|
12512
|
-
*/
|
|
12900
|
+
Highlight.prototype.destroy = function () {
|
|
12901
|
+
this.highlightSettings = null;
|
|
12513
12902
|
this.removeEventListener();
|
|
12903
|
+
this.maps = null;
|
|
12514
12904
|
};
|
|
12515
12905
|
return Highlight;
|
|
12516
12906
|
}());
|
|
@@ -12531,7 +12921,6 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
12531
12921
|
Selection.prototype.addEventListener = function () {
|
|
12532
12922
|
if (!this.maps.isDestroyed) {
|
|
12533
12923
|
this.maps.on(click, this.mouseClick, this);
|
|
12534
|
-
this.maps.on(Browser.touchEndEvent, this.mouseClick, this);
|
|
12535
12924
|
}
|
|
12536
12925
|
};
|
|
12537
12926
|
/**
|
|
@@ -12544,7 +12933,6 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
12544
12933
|
return;
|
|
12545
12934
|
}
|
|
12546
12935
|
this.maps.off(click, this.mouseClick);
|
|
12547
|
-
this.maps.off(Browser.touchEndEvent, this.mouseClick);
|
|
12548
12936
|
};
|
|
12549
12937
|
Selection.prototype.mouseClick = function (targetElement) {
|
|
12550
12938
|
if (!isNullOrUndefined(targetElement['type']) && targetElement['type'].indexOf('touch') !== -1 &&
|
|
@@ -12562,8 +12950,12 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
12562
12950
|
var layerIndex = parseInt(targetElement.id.split('_LayerIndex_')[1].split('_')[0], 10);
|
|
12563
12951
|
if (targetElement.id.indexOf('shapeIndex') > -1) {
|
|
12564
12952
|
shapeIndex = parseInt(targetElement.id.split('_shapeIndex_')[1].split('_')[0], 10);
|
|
12565
|
-
shapeData = this.maps.layers[layerIndex].shapeData['features']
|
|
12566
|
-
this.maps.layers[layerIndex].shapeData['features'][
|
|
12953
|
+
shapeData = !isNullOrUndefined(this.maps.layers[layerIndex].shapeData['features'])
|
|
12954
|
+
&& this.maps.layers[layerIndex].shapeData['features']['length'] > shapeIndex ?
|
|
12955
|
+
this.maps.layers[layerIndex].shapeData['features'][shapeIndex]['properties'] :
|
|
12956
|
+
!isNullOrUndefined(this.maps.layers[layerIndex].shapeData['geometries'])
|
|
12957
|
+
&& this.maps.layers[layerIndex].shapeData['geometries']['length'] > shapeIndex ?
|
|
12958
|
+
this.maps.layers[layerIndex].shapeData['geometries'][shapeIndex]['properties'] : null;
|
|
12567
12959
|
dataIndex = parseInt(targetElement.id.split('_dataIndex_')[1].split('_')[0], 10);
|
|
12568
12960
|
data = isNullOrUndefined(dataIndex) ? null : this.maps.layers[layerIndex].dataSource[dataIndex];
|
|
12569
12961
|
this.selectionsettings = this.maps.layers[layerIndex].selectionSettings;
|
|
@@ -12644,15 +13036,17 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
12644
13036
|
Selection.prototype.selectMap = function (targetElement, shapeData, data) {
|
|
12645
13037
|
var _this = this;
|
|
12646
13038
|
var layerIndex = parseInt(targetElement.id.split('_LayerIndex_')[1].split('_')[0], 10);
|
|
13039
|
+
var isLineStringShape = targetElement.parentElement.id.indexOf('LineString') > -1;
|
|
12647
13040
|
var selectionsettings = this.selectionsettings;
|
|
12648
13041
|
var border = {
|
|
12649
|
-
color: (
|
|
12650
|
-
width:
|
|
13042
|
+
color: isLineStringShape ? (this.selectionsettings.fill || this.selectionsettings.border.color) : this.selectionsettings.border.color,
|
|
13043
|
+
width: isLineStringShape ? (this.selectionsettings.border.width / this.maps.scale) :
|
|
13044
|
+
(this.selectionsettings.border.width / (this.selectionType === 'Marker' ? 1 : this.maps.scale)),
|
|
12651
13045
|
opacity: this.selectionsettings.border.opacity
|
|
12652
13046
|
};
|
|
12653
13047
|
var eventArgs = {
|
|
12654
13048
|
opacity: this.selectionsettings.opacity,
|
|
12655
|
-
fill:
|
|
13049
|
+
fill: isLineStringShape ? 'transparent' : (this.selectionType !== 'navigationline' ? this.selectionsettings.fill : 'none'),
|
|
12656
13050
|
border: border,
|
|
12657
13051
|
name: itemSelection,
|
|
12658
13052
|
target: targetElement.id,
|
|
@@ -12664,7 +13058,8 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
12664
13058
|
this.maps.trigger('itemSelection', eventArgs, function (observedArgs) {
|
|
12665
13059
|
eventArgs.border.opacity = isNullOrUndefined(_this.selectionsettings.border.opacity) ? _this.selectionsettings.opacity : _this.selectionsettings.border.opacity;
|
|
12666
13060
|
if (!eventArgs.cancel) {
|
|
12667
|
-
if (targetElement.getAttribute('class') === _this.selectionType + 'selectionMapStyle'
|
|
13061
|
+
if (targetElement.getAttribute('class') === _this.selectionType + 'selectionMapStyle'
|
|
13062
|
+
|| targetElement.getAttribute('class') === 'LineselectionMapStyle') {
|
|
12668
13063
|
removeClass(targetElement);
|
|
12669
13064
|
_this.removedSelectionList(targetElement);
|
|
12670
13065
|
for (var m = 0; m < _this.maps.shapeSelectionItem.length; m++) {
|
|
@@ -12683,7 +13078,8 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
12683
13078
|
else {
|
|
12684
13079
|
var layetElement = getElementByID(_this.maps.element.id + '_Layer_Collections');
|
|
12685
13080
|
if (!_this.selectionsettings.enableMultiSelect &&
|
|
12686
|
-
layetElement.getElementsByClassName(_this.selectionType + 'selectionMapStyle').length > 0
|
|
13081
|
+
(layetElement.getElementsByClassName(_this.selectionType + 'selectionMapStyle').length > 0 ||
|
|
13082
|
+
layetElement.getElementsByClassName('LineselectionMapStyle').length > 0)) {
|
|
12687
13083
|
var eleCount = layetElement.getElementsByClassName(_this.selectionType + 'selectionMapStyle').length;
|
|
12688
13084
|
var ele = void 0;
|
|
12689
13085
|
for (var k = 0; k < eleCount; k++) {
|
|
@@ -12691,6 +13087,14 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
12691
13087
|
removeClass(ele);
|
|
12692
13088
|
_this.removedSelectionList(ele);
|
|
12693
13089
|
}
|
|
13090
|
+
if (layetElement.getElementsByClassName('LineselectionMapStyle').length > 0) {
|
|
13091
|
+
eleCount = layetElement.getElementsByClassName('LineselectionMapStyle').length;
|
|
13092
|
+
for (var k = 0; k < eleCount; k++) {
|
|
13093
|
+
ele = layetElement.getElementsByClassName('LineselectionMapStyle')[0];
|
|
13094
|
+
removeClass(ele);
|
|
13095
|
+
_this.removedSelectionList(ele);
|
|
13096
|
+
}
|
|
13097
|
+
}
|
|
12694
13098
|
if (_this.selectionType === 'Shape') {
|
|
12695
13099
|
_this.maps.shapeSelectionItem = [];
|
|
12696
13100
|
var selectionLength = _this.maps.selectedElementId.length;
|
|
@@ -12708,13 +13112,24 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
12708
13112
|
ele.setAttribute('stroke', _this.maps.layers[layerIndex_2].navigationLineSettings[index].color);
|
|
12709
13113
|
}
|
|
12710
13114
|
}
|
|
12711
|
-
if (!
|
|
12712
|
-
|
|
13115
|
+
if (!isLineStringShape) {
|
|
13116
|
+
if (!getElement(_this.selectionType + 'selectionMap')) {
|
|
13117
|
+
document.body.appendChild(createStyle(_this.selectionType + 'selectionMap', _this.selectionType + 'selectionMapStyle', eventArgs));
|
|
13118
|
+
}
|
|
13119
|
+
else {
|
|
13120
|
+
customizeStyle(_this.selectionType + 'selectionMap', _this.selectionType + 'selectionMapStyle', eventArgs);
|
|
13121
|
+
}
|
|
13122
|
+
targetElement.setAttribute('class', _this.selectionType + 'selectionMapStyle');
|
|
12713
13123
|
}
|
|
12714
13124
|
else {
|
|
12715
|
-
|
|
13125
|
+
if (!getElement('LineselectionMap')) {
|
|
13126
|
+
document.body.appendChild(createStyle('LineselectionMap', 'LineselectionMapStyle', eventArgs));
|
|
13127
|
+
}
|
|
13128
|
+
else {
|
|
13129
|
+
customizeStyle('LineselectionMap', 'LineselectionMapStyle', eventArgs);
|
|
13130
|
+
}
|
|
13131
|
+
targetElement.setAttribute('class', 'LineselectionMapStyle');
|
|
12716
13132
|
}
|
|
12717
|
-
targetElement.setAttribute('class', _this.selectionType + 'selectionMapStyle');
|
|
12718
13133
|
if (targetElement.getAttribute('class') === 'ShapeselectionMapStyle') {
|
|
12719
13134
|
_this.maps.shapeSelectionClass = getElement(_this.selectionType + 'selectionMap');
|
|
12720
13135
|
_this.maps.selectedElementId.push(targetElement.getAttribute('id'));
|
|
@@ -12783,15 +13198,13 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
12783
13198
|
/**
|
|
12784
13199
|
* To destroy the selection.
|
|
12785
13200
|
*
|
|
12786
|
-
* @param {Maps} maps - Specifies the maps instance.
|
|
12787
13201
|
* @returns {void}
|
|
12788
13202
|
* @private
|
|
12789
13203
|
*/
|
|
12790
|
-
Selection.prototype.destroy = function (
|
|
12791
|
-
|
|
12792
|
-
* Destroy method performed here
|
|
12793
|
-
*/
|
|
13204
|
+
Selection.prototype.destroy = function () {
|
|
13205
|
+
this.selectionsettings = null;
|
|
12794
13206
|
this.removeEventListener();
|
|
13207
|
+
this.maps = null;
|
|
12795
13208
|
};
|
|
12796
13209
|
return Selection;
|
|
12797
13210
|
}());
|
|
@@ -12976,7 +13389,7 @@ var MapsTooltip = /** @__PURE__ @class */ (function () {
|
|
|
12976
13389
|
options: tooltipOption,
|
|
12977
13390
|
fill: option.fill,
|
|
12978
13391
|
maps: this.maps,
|
|
12979
|
-
element: target, eventArgs: e
|
|
13392
|
+
element: target, eventArgs: e, content: !isNullOrUndefined(currentData) ? currentData.toString() : ''
|
|
12980
13393
|
};
|
|
12981
13394
|
this.maps.trigger(tooltipRender, tooltipArgs, function (args) {
|
|
12982
13395
|
if (!tooltipArgs.cancel && option.visible && !isNullOrUndefined(currentData) &&
|
|
@@ -12994,7 +13407,7 @@ var MapsTooltip = /** @__PURE__ @class */ (function () {
|
|
|
12994
13407
|
header: '',
|
|
12995
13408
|
data: option['data'],
|
|
12996
13409
|
template: option['template'],
|
|
12997
|
-
content: [currentData.toString()],
|
|
13410
|
+
content: tooltipArgs.content.toString() != currentData.toString() ? [tooltipArgs.content.toString()] : [currentData.toString()],
|
|
12998
13411
|
shapes: [],
|
|
12999
13412
|
location: option['location'],
|
|
13000
13413
|
palette: [markerFill],
|
|
@@ -13010,7 +13423,7 @@ var MapsTooltip = /** @__PURE__ @class */ (function () {
|
|
|
13010
13423
|
header: '',
|
|
13011
13424
|
data: tooltipArgs.options['data'],
|
|
13012
13425
|
template: tooltipArgs.options['template'],
|
|
13013
|
-
content: [currentData.toString()],
|
|
13426
|
+
content: tooltipArgs.content.toString() != currentData.toString() ? [tooltipArgs.content.toString()] : [currentData.toString()],
|
|
13014
13427
|
shapes: [],
|
|
13015
13428
|
location: tooltipArgs.options['location'],
|
|
13016
13429
|
palette: [markerFill],
|
|
@@ -13020,6 +13433,10 @@ var MapsTooltip = /** @__PURE__ @class */ (function () {
|
|
|
13020
13433
|
fill: tooltipArgs.fill || _this.maps.themeStyle.tooltipFillColor
|
|
13021
13434
|
});
|
|
13022
13435
|
}
|
|
13436
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13437
|
+
if (_this.maps.isVue || _this.maps.isVue3) {
|
|
13438
|
+
_this.svgTooltip.controlInstance = _this.maps;
|
|
13439
|
+
}
|
|
13023
13440
|
_this.svgTooltip.opacity = _this.maps.themeStyle.tooltipFillOpacity || _this.svgTooltip.opacity;
|
|
13024
13441
|
_this.svgTooltip.appendTo(tooltipEle);
|
|
13025
13442
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -13033,9 +13450,7 @@ var MapsTooltip = /** @__PURE__ @class */ (function () {
|
|
|
13033
13450
|
}
|
|
13034
13451
|
}
|
|
13035
13452
|
else {
|
|
13036
|
-
_this.
|
|
13037
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13038
|
-
_this.maps.clearTemplate();
|
|
13453
|
+
_this.clearTooltip();
|
|
13039
13454
|
}
|
|
13040
13455
|
});
|
|
13041
13456
|
if (this.svgTooltip) {
|
|
@@ -13050,9 +13465,7 @@ var MapsTooltip = /** @__PURE__ @class */ (function () {
|
|
|
13050
13465
|
});
|
|
13051
13466
|
}
|
|
13052
13467
|
else {
|
|
13053
|
-
this.
|
|
13054
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13055
|
-
this.maps.clearTemplate();
|
|
13468
|
+
this.clearTooltip();
|
|
13056
13469
|
}
|
|
13057
13470
|
}
|
|
13058
13471
|
else {
|
|
@@ -13062,9 +13475,7 @@ var MapsTooltip = /** @__PURE__ @class */ (function () {
|
|
|
13062
13475
|
this.maps.notify(click, this);
|
|
13063
13476
|
}
|
|
13064
13477
|
else {
|
|
13065
|
-
this.
|
|
13066
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13067
|
-
this.maps.clearTemplate();
|
|
13478
|
+
this.clearTooltip();
|
|
13068
13479
|
}
|
|
13069
13480
|
}
|
|
13070
13481
|
};
|
|
@@ -13110,8 +13521,18 @@ var MapsTooltip = /** @__PURE__ @class */ (function () {
|
|
|
13110
13521
|
}
|
|
13111
13522
|
};
|
|
13112
13523
|
MapsTooltip.prototype.removeTooltip = function () {
|
|
13524
|
+
var isTooltipRemoved = false;
|
|
13113
13525
|
if (document.getElementsByClassName('EJ2-maps-Tooltip').length > 0) {
|
|
13114
13526
|
remove(document.getElementsByClassName('EJ2-maps-Tooltip')[0]);
|
|
13527
|
+
isTooltipRemoved = true;
|
|
13528
|
+
}
|
|
13529
|
+
return isTooltipRemoved;
|
|
13530
|
+
};
|
|
13531
|
+
MapsTooltip.prototype.clearTooltip = function () {
|
|
13532
|
+
var isTooltipRemoved = this.removeTooltip();
|
|
13533
|
+
if (isTooltipRemoved) {
|
|
13534
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13535
|
+
this.maps.clearTemplate();
|
|
13115
13536
|
}
|
|
13116
13537
|
};
|
|
13117
13538
|
// eslint-disable-next-line valid-jsdoc
|
|
@@ -13160,12 +13581,17 @@ var MapsTooltip = /** @__PURE__ @class */ (function () {
|
|
|
13160
13581
|
/**
|
|
13161
13582
|
* To destroy the tooltip.
|
|
13162
13583
|
*
|
|
13163
|
-
* @param {Maps} maps Specifies the maps instance
|
|
13164
13584
|
* @returns {void}
|
|
13165
13585
|
* @private
|
|
13166
13586
|
*/
|
|
13167
|
-
MapsTooltip.prototype.destroy = function (
|
|
13587
|
+
MapsTooltip.prototype.destroy = function () {
|
|
13588
|
+
if (!isNullOrUndefined(this.svgTooltip)) {
|
|
13589
|
+
this.svgTooltip.destroy();
|
|
13590
|
+
}
|
|
13591
|
+
this.svgTooltip = null;
|
|
13168
13592
|
this.removeEventListener();
|
|
13593
|
+
//TODO: Calling the below code throws spec issue.
|
|
13594
|
+
//this.maps = null;
|
|
13169
13595
|
};
|
|
13170
13596
|
return MapsTooltip;
|
|
13171
13597
|
}());
|
|
@@ -13179,7 +13605,6 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
13179
13605
|
this.mouseEnter = false;
|
|
13180
13606
|
this.isTouch = false;
|
|
13181
13607
|
this.rectZoomingStart = false;
|
|
13182
|
-
this.pinchRect = new Rect(0, 0, 0, 0);
|
|
13183
13608
|
this.browserName = Browser.info.name;
|
|
13184
13609
|
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
13185
13610
|
this.isPointer = Browser.isPointer;
|
|
@@ -13188,8 +13613,6 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
13188
13613
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13189
13614
|
this.startTouches = [];
|
|
13190
13615
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13191
|
-
this.shapeZoomLocation = [];
|
|
13192
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13193
13616
|
this.intersect = [];
|
|
13194
13617
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13195
13618
|
this.mouseDownLatLong = { x: 0, y: 0 };
|
|
@@ -13205,7 +13628,6 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
13205
13628
|
this.selectionColor = this.maps.zoomSettings.selectionColor;
|
|
13206
13629
|
this.fillColor = this.maps.zoomSettings.color;
|
|
13207
13630
|
this.addEventListener();
|
|
13208
|
-
this.groupElements = [];
|
|
13209
13631
|
}
|
|
13210
13632
|
/**
|
|
13211
13633
|
* To perform zooming for maps
|
|
@@ -13229,7 +13651,8 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
13229
13651
|
var minZoom = map.zoomSettings.minZoom;
|
|
13230
13652
|
newZoomFactor = (minZoom > newZoomFactor && type === 'ZoomIn') ? minZoom + 1 : newZoomFactor;
|
|
13231
13653
|
var prevTilePoint = map.tileTranslatePoint;
|
|
13232
|
-
if ((!map.isTileMap) && (type === 'ZoomIn' ? newZoomFactor >= minZoom && newZoomFactor <= maxZoom : newZoomFactor >= minZoom)
|
|
13654
|
+
if ((!map.isTileMap) && ((type === 'ZoomIn' ? newZoomFactor >= minZoom && newZoomFactor <= maxZoom : newZoomFactor >= minZoom)
|
|
13655
|
+
|| map.isReset)) {
|
|
13233
13656
|
var availSize = map.mapAreaRect;
|
|
13234
13657
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13235
13658
|
var minBounds = map.baseMapRectBounds['min'];
|
|
@@ -13237,16 +13660,34 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
13237
13660
|
var maxBounds = map.baseMapRectBounds['max'];
|
|
13238
13661
|
var mapTotalWidth = Math.abs(minBounds['x'] - maxBounds['x']);
|
|
13239
13662
|
var mapTotalHeight = Math.abs(minBounds['y'] - maxBounds['y']);
|
|
13240
|
-
var
|
|
13241
|
-
var
|
|
13242
|
-
|
|
13243
|
-
|
|
13244
|
-
|
|
13245
|
-
|
|
13246
|
-
|
|
13663
|
+
var translatePointX = void 0;
|
|
13664
|
+
var translatePointY = void 0;
|
|
13665
|
+
if (newZoomFactor < 1.2 && map.projectionType !== 'Eckert5') {
|
|
13666
|
+
if (mapTotalWidth === 0 || mapTotalHeight === 0 || mapTotalWidth === mapTotalHeight) {
|
|
13667
|
+
mapTotalWidth = availSize.width / 2;
|
|
13668
|
+
mapTotalHeight = availSize.height;
|
|
13669
|
+
}
|
|
13670
|
+
newZoomFactor = parseFloat(Math.min(availSize.width / mapTotalWidth, availSize.height / mapTotalHeight).toFixed(2));
|
|
13671
|
+
newZoomFactor = newZoomFactor > 1.05 ? 1 : newZoomFactor;
|
|
13672
|
+
map.translatePoint = this.calculateInitalZoomTranslatePoint(newZoomFactor, mapTotalWidth, mapTotalHeight, availSize, minBounds, map);
|
|
13673
|
+
}
|
|
13674
|
+
else {
|
|
13675
|
+
var point = map.translatePoint;
|
|
13676
|
+
translatePointX = point.x - (((availSize.width / scale) - (availSize.width / newZoomFactor)) / (availSize.width / position.x));
|
|
13677
|
+
translatePointY = point.y - (((availSize.height / scale) - (availSize.height / newZoomFactor)) / (availSize.height / position.y));
|
|
13678
|
+
var currentHeight = Math.abs(map.baseMapRectBounds['max']['y'] - map.baseMapRectBounds['min']['y']) * newZoomFactor;
|
|
13679
|
+
translatePointX = (currentHeight < map.mapAreaRect.height) ? (availSize.x + ((-(minBounds['x'])) + ((availSize.width / 2) - (mapTotalWidth / 2)))) : translatePointX;
|
|
13680
|
+
translatePointY = (currentHeight < map.mapAreaRect.height) ? (availSize.y + ((-(minBounds['y'])) + ((availSize.height / 2) - (mapTotalHeight / 2)))) : translatePointY;
|
|
13681
|
+
map.translatePoint = new Point(translatePointX, translatePointY);
|
|
13682
|
+
}
|
|
13247
13683
|
map.scale = newZoomFactor;
|
|
13248
|
-
this.triggerZoomEvent(prevTilePoint, prevLevel, type)
|
|
13249
|
-
|
|
13684
|
+
if (this.triggerZoomEvent(prevTilePoint, prevLevel, type)) {
|
|
13685
|
+
map.translatePoint = map.previousPoint;
|
|
13686
|
+
map.scale = map.mapScaleValue = map.previousScale;
|
|
13687
|
+
}
|
|
13688
|
+
else {
|
|
13689
|
+
this.applyTransform(map);
|
|
13690
|
+
}
|
|
13250
13691
|
}
|
|
13251
13692
|
else if ((map.isTileMap) && (newZoomFactor >= minZoom && newZoomFactor <= maxZoom)) {
|
|
13252
13693
|
this.getTileTranslatePosition(prevLevel, newZoomFactor, position, type);
|
|
@@ -13263,34 +13704,49 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
13263
13704
|
}
|
|
13264
13705
|
map.translatePoint.y = (map.tileTranslatePoint.y - (0.01 * map.mapScaleValue)) / map.scale;
|
|
13265
13706
|
map.translatePoint.x = (map.tileTranslatePoint.x - (0.01 * map.mapScaleValue)) / map.scale;
|
|
13266
|
-
this.triggerZoomEvent(prevTilePoint, prevLevel, type)
|
|
13267
|
-
|
|
13268
|
-
|
|
13707
|
+
if (this.triggerZoomEvent(prevTilePoint, prevLevel, type)) {
|
|
13708
|
+
map.translatePoint = map.tileTranslatePoint = new Point(0, 0);
|
|
13709
|
+
map.scale = map.previousScale;
|
|
13710
|
+
map.tileZoomLevel = prevLevel;
|
|
13711
|
+
map.zoomSettings.zoomFactor = map.previousScale;
|
|
13269
13712
|
}
|
|
13270
|
-
|
|
13271
|
-
document.
|
|
13713
|
+
else {
|
|
13714
|
+
if (document.querySelector('.GroupElement')) {
|
|
13715
|
+
document.querySelector('.GroupElement').style.display = 'none';
|
|
13716
|
+
}
|
|
13717
|
+
if (document.getElementById(this.maps.element.id + '_LayerIndex_1')) {
|
|
13718
|
+
document.getElementById(this.maps.element.id + '_LayerIndex_1').style.display = 'none';
|
|
13719
|
+
}
|
|
13720
|
+
this.markerLineAnimation(map);
|
|
13721
|
+
map.mapLayerPanel.generateTiles(newZoomFactor, map.tileTranslatePoint, type + 'wheel', null, position);
|
|
13722
|
+
var element1 = document.getElementById(this.maps.element.id + '_tiles');
|
|
13723
|
+
var animationDuration = this.maps.layersCollection[0].animationDuration;
|
|
13724
|
+
setTimeout(function () {
|
|
13725
|
+
// if (type === 'ZoomOut') {
|
|
13726
|
+
// element1.removeChild(element1.children[element1.childElementCount - 1]);
|
|
13727
|
+
// if (element1.childElementCount) {
|
|
13728
|
+
// element1.removeChild(element1.children[element1.childElementCount - 1]);
|
|
13729
|
+
// } else {
|
|
13730
|
+
// element1 = element1;
|
|
13731
|
+
// }
|
|
13732
|
+
// }
|
|
13733
|
+
_this.applyTransform(_this.maps);
|
|
13734
|
+
if (document.getElementById(_this.maps.element.id + '_LayerIndex_1')) {
|
|
13735
|
+
document.getElementById(_this.maps.element.id + '_LayerIndex_1').style.display = 'block';
|
|
13736
|
+
}
|
|
13737
|
+
}, animationDuration);
|
|
13272
13738
|
}
|
|
13273
|
-
this.markerLineAnimation(map);
|
|
13274
|
-
map.mapLayerPanel.generateTiles(newZoomFactor, map.tileTranslatePoint, type + 'wheel', null, position);
|
|
13275
|
-
var element1 = document.getElementById(this.maps.element.id + '_tiles');
|
|
13276
|
-
var animationDuration = this.maps.layersCollection[0].animationDuration;
|
|
13277
|
-
setTimeout(function () {
|
|
13278
|
-
// if (type === 'ZoomOut') {
|
|
13279
|
-
// element1.removeChild(element1.children[element1.childElementCount - 1]);
|
|
13280
|
-
// if (element1.childElementCount) {
|
|
13281
|
-
// element1.removeChild(element1.children[element1.childElementCount - 1]);
|
|
13282
|
-
// } else {
|
|
13283
|
-
// element1 = element1;
|
|
13284
|
-
// }
|
|
13285
|
-
// }
|
|
13286
|
-
_this.applyTransform();
|
|
13287
|
-
if (document.getElementById(_this.maps.element.id + '_LayerIndex_1')) {
|
|
13288
|
-
document.getElementById(_this.maps.element.id + '_LayerIndex_1').style.display = 'block';
|
|
13289
|
-
}
|
|
13290
|
-
}, animationDuration);
|
|
13291
13739
|
}
|
|
13292
13740
|
this.maps.zoomNotApplied = false;
|
|
13293
13741
|
};
|
|
13742
|
+
Zoom.prototype.calculateInitalZoomTranslatePoint = function (newZoomFactor, mapTotalWidth, mapTotalHeight, availSize, minBounds, map) {
|
|
13743
|
+
mapTotalWidth *= newZoomFactor;
|
|
13744
|
+
mapTotalHeight *= newZoomFactor;
|
|
13745
|
+
var widthDiff = minBounds['x'] !== 0 && map.translateType === 'layers' ? map.availableSize.width - availSize.width : 0;
|
|
13746
|
+
var translatePointX = availSize.x + ((-(minBounds['x'])) + ((availSize.width / 2) - (mapTotalWidth / 2))) - widthDiff;
|
|
13747
|
+
var translatePointY = availSize.y + ((-(minBounds['y'])) + ((availSize.height / 2) - (mapTotalHeight / 2)));
|
|
13748
|
+
return new Point(translatePointX, translatePointY);
|
|
13749
|
+
};
|
|
13294
13750
|
Zoom.prototype.triggerZoomEvent = function (prevTilePoint, prevLevel, type) {
|
|
13295
13751
|
var map = this.maps;
|
|
13296
13752
|
var zoomArgs;
|
|
@@ -13309,6 +13765,7 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
13309
13765
|
};
|
|
13310
13766
|
}
|
|
13311
13767
|
map.trigger('zoom', zoomArgs);
|
|
13768
|
+
return zoomArgs.cancel;
|
|
13312
13769
|
};
|
|
13313
13770
|
Zoom.prototype.getTileTranslatePosition = function (prevLevel, currentLevel, position, type) {
|
|
13314
13771
|
var map = this.maps;
|
|
@@ -13334,6 +13791,7 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
13334
13791
|
var zoomRect = this.zoomingRect;
|
|
13335
13792
|
var maxZoom = map.zoomSettings.maxZoom;
|
|
13336
13793
|
var minZoom = map.zoomSettings.minZoom;
|
|
13794
|
+
var isZoomCancelled;
|
|
13337
13795
|
if (zoomRect.height > 0 && zoomRect.width > 0) {
|
|
13338
13796
|
var x = this.zoomingRect.x + (this.zoomingRect.width / 2);
|
|
13339
13797
|
var y = this.zoomingRect.y + (this.zoomingRect.height / 2);
|
|
@@ -13346,7 +13804,11 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
13346
13804
|
var translatePointY = translatePoint.y - (((size.height / scale) - (size.height / zoomCalculationFactor)) / (size.height / y));
|
|
13347
13805
|
map.translatePoint = new Point(translatePointX, translatePointY);
|
|
13348
13806
|
map.scale = zoomCalculationFactor;
|
|
13349
|
-
this.triggerZoomEvent(prevTilePoint, prevLevel, '');
|
|
13807
|
+
isZoomCancelled = this.triggerZoomEvent(prevTilePoint, prevLevel, '');
|
|
13808
|
+
if (isZoomCancelled) {
|
|
13809
|
+
map.translatePoint = map.previousPoint;
|
|
13810
|
+
map.scale = map.previousScale;
|
|
13811
|
+
}
|
|
13350
13812
|
}
|
|
13351
13813
|
else {
|
|
13352
13814
|
zoomCalculationFactor = prevLevel + (Math.round(prevLevel + (((size.width / zoomRect.width) + (size.height / zoomRect.height)) / 2)));
|
|
@@ -13359,13 +13821,21 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
13359
13821
|
map.translatePoint.y = (map.tileTranslatePoint.y - (0.5 * Math.pow(2, zoomCalculationFactor))) /
|
|
13360
13822
|
(Math.pow(2, zoomCalculationFactor));
|
|
13361
13823
|
map.scale = (Math.pow(2, zoomCalculationFactor));
|
|
13362
|
-
this.triggerZoomEvent(prevTilePoint, prevLevel, '');
|
|
13363
|
-
|
|
13824
|
+
isZoomCancelled = this.triggerZoomEvent(prevTilePoint, prevLevel, '');
|
|
13825
|
+
if (isZoomCancelled) {
|
|
13826
|
+
map.translatePoint = map.tileTranslatePoint = new Point(0, 0);
|
|
13827
|
+
map.scale = map.tileZoomLevel = map.zoomSettings.zoomFactor = prevLevel;
|
|
13828
|
+
}
|
|
13829
|
+
else {
|
|
13830
|
+
map.mapLayerPanel.generateTiles(zoomCalculationFactor, map.tileTranslatePoint);
|
|
13831
|
+
}
|
|
13832
|
+
}
|
|
13833
|
+
if (!isZoomCancelled) {
|
|
13834
|
+
map.mapScaleValue = zoomCalculationFactor;
|
|
13835
|
+
this.applyTransform(map, true);
|
|
13836
|
+
this.maps.zoomNotApplied = false;
|
|
13837
|
+
this.zoomingRect = null;
|
|
13364
13838
|
}
|
|
13365
|
-
map.mapScaleValue = zoomCalculationFactor;
|
|
13366
|
-
this.applyTransform(true);
|
|
13367
|
-
this.maps.zoomNotApplied = false;
|
|
13368
|
-
this.zoomingRect = null;
|
|
13369
13839
|
}
|
|
13370
13840
|
};
|
|
13371
13841
|
Zoom.prototype.setInteraction = function (newInteraction) {
|
|
@@ -13394,6 +13864,7 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
13394
13864
|
this.pinchFactor *= newScale;
|
|
13395
13865
|
this.pinchFactor = Math.min(this.maps.zoomSettings.maxZoom, Math.max(this.pinchFactor, this.maps.zoomSettings.minZoom));
|
|
13396
13866
|
var zoomCalculationFactor = this.pinchFactor;
|
|
13867
|
+
var isZoomCancelled;
|
|
13397
13868
|
if (!map.isTileMap) {
|
|
13398
13869
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13399
13870
|
var minBounds = map.baseMapRectBounds['min'];
|
|
@@ -13402,14 +13873,31 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
13402
13873
|
var mapTotalHeight = Math.abs(minBounds['y'] - maxBounds['y']);
|
|
13403
13874
|
var mapTotalWidth = Math.abs(minBounds['x'] - maxBounds['x']);
|
|
13404
13875
|
var translatePoint = map.translatePoint;
|
|
13405
|
-
var
|
|
13406
|
-
var
|
|
13407
|
-
|
|
13408
|
-
|
|
13409
|
-
|
|
13410
|
-
|
|
13876
|
+
var translatePointX = void 0;
|
|
13877
|
+
var translatePointY = void 0;
|
|
13878
|
+
if (zoomCalculationFactor < 1.2 && map.projectionType !== 'Eckert5') {
|
|
13879
|
+
if (mapTotalWidth === 0 || mapTotalHeight === 0 || mapTotalWidth === mapTotalHeight) {
|
|
13880
|
+
mapTotalWidth = availSize.width / 2;
|
|
13881
|
+
mapTotalHeight = availSize.height;
|
|
13882
|
+
}
|
|
13883
|
+
zoomCalculationFactor = parseFloat(Math.min(availSize.width / mapTotalWidth, availSize.height / mapTotalHeight).toFixed(2));
|
|
13884
|
+
zoomCalculationFactor = zoomCalculationFactor > 1.05 ? 1 : zoomCalculationFactor;
|
|
13885
|
+
map.translatePoint = this.calculateInitalZoomTranslatePoint(zoomCalculationFactor, mapTotalWidth, mapTotalHeight, availSize, minBounds, map);
|
|
13886
|
+
}
|
|
13887
|
+
else {
|
|
13888
|
+
var currentHeight = Math.abs(map.baseMapRectBounds['max']['y'] - map.baseMapRectBounds['min']['y']) * zoomCalculationFactor;
|
|
13889
|
+
translatePointX = translatePoint.x - (((availSize.width / map.scale) - (availSize.width / zoomCalculationFactor)) / (availSize.width / touchCenter.x));
|
|
13890
|
+
translatePointY = translatePoint.y - (((availSize.height / map.scale) - (availSize.height / zoomCalculationFactor)) / (availSize.height / touchCenter.y));
|
|
13891
|
+
translatePointX = (currentHeight < map.mapAreaRect.height) ? (availSize.x + ((-(minBounds['x'])) + ((availSize.width / 2) - (mapTotalWidth / 2)))) : translatePointX;
|
|
13892
|
+
translatePointY = (currentHeight < map.mapAreaRect.height) ? (availSize.y + ((-(minBounds['y'])) + ((availSize.height / 2) - (mapTotalHeight / 2)))) : translatePointY;
|
|
13893
|
+
map.translatePoint = new Point(translatePointX, translatePointY);
|
|
13894
|
+
}
|
|
13411
13895
|
map.scale = zoomCalculationFactor;
|
|
13412
|
-
this.triggerZoomEvent(prevTilePoint, prevLevel, '');
|
|
13896
|
+
isZoomCancelled = this.triggerZoomEvent(prevTilePoint, prevLevel, '');
|
|
13897
|
+
if (isZoomCancelled) {
|
|
13898
|
+
map.translatePoint = map.previousPoint;
|
|
13899
|
+
map.scale = map.previousScale;
|
|
13900
|
+
}
|
|
13413
13901
|
}
|
|
13414
13902
|
else {
|
|
13415
13903
|
var newTileFactor = zoomCalculationFactor;
|
|
@@ -13420,10 +13908,20 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
13420
13908
|
map.translatePoint.y = (map.tileTranslatePoint.y - (0.5 * Math.pow(2, newTileFactor))) /
|
|
13421
13909
|
(Math.pow(2, newTileFactor));
|
|
13422
13910
|
map.scale = (Math.pow(2, newTileFactor));
|
|
13423
|
-
this.triggerZoomEvent(prevTilePoint, prevLevel, '');
|
|
13424
|
-
|
|
13911
|
+
isZoomCancelled = this.triggerZoomEvent(prevTilePoint, prevLevel, '');
|
|
13912
|
+
if (isZoomCancelled) {
|
|
13913
|
+
map.translatePoint = map.tileTranslatePoint = new Point(0, 0);
|
|
13914
|
+
map.scale = map.previousScale;
|
|
13915
|
+
map.tileZoomLevel = prevLevel;
|
|
13916
|
+
map.zoomSettings.zoomFactor = map.previousScale;
|
|
13917
|
+
}
|
|
13918
|
+
else {
|
|
13919
|
+
map.mapLayerPanel.generateTiles(newTileFactor, map.tileTranslatePoint);
|
|
13920
|
+
}
|
|
13921
|
+
}
|
|
13922
|
+
if (!isZoomCancelled) {
|
|
13923
|
+
this.applyTransform(map);
|
|
13425
13924
|
}
|
|
13426
|
-
this.applyTransform();
|
|
13427
13925
|
};
|
|
13428
13926
|
Zoom.prototype.drawZoomRectangle = function () {
|
|
13429
13927
|
var map = this.maps;
|
|
@@ -13469,17 +13967,17 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
13469
13967
|
zoomAnimate(element, 0, duration, new MapLocation(x, y), scale, this.maps.mapAreaRect, this.maps);
|
|
13470
13968
|
}
|
|
13471
13969
|
};
|
|
13472
|
-
Zoom.prototype.applyTransform = function (animate$$1) {
|
|
13970
|
+
Zoom.prototype.applyTransform = function (maps, animate$$1) {
|
|
13473
13971
|
var layerIndex;
|
|
13474
13972
|
this.templateCount = 0;
|
|
13475
13973
|
var markerStyle;
|
|
13476
|
-
var scale =
|
|
13477
|
-
var x =
|
|
13478
|
-
var y =
|
|
13974
|
+
var scale = maps.scale;
|
|
13975
|
+
var x = maps.translatePoint.x;
|
|
13976
|
+
var y = maps.translatePoint.y;
|
|
13479
13977
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13480
|
-
|
|
13481
|
-
if (document.getElementById(
|
|
13482
|
-
removeElement(
|
|
13978
|
+
maps.zoomShapeCollection = [];
|
|
13979
|
+
if (document.getElementById(maps.element.id + '_mapsTooltip')) {
|
|
13980
|
+
removeElement(maps.element.id + '_mapsTooltip');
|
|
13483
13981
|
}
|
|
13484
13982
|
if (this.layerCollectionEle) {
|
|
13485
13983
|
for (var i_1 = 0; i_1 < this.layerCollectionEle.childElementCount; i_1++) {
|
|
@@ -13487,30 +13985,29 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
13487
13985
|
if (layerElement.tagName === 'g') {
|
|
13488
13986
|
this.templateCount++;
|
|
13489
13987
|
this.index = layerElement.id.indexOf('_LayerIndex_') > -1 && parseFloat(layerElement.id.split('_LayerIndex_')[1].split('_')[0]);
|
|
13490
|
-
this.currentLayer =
|
|
13491
|
-
var factor =
|
|
13988
|
+
this.currentLayer = maps.layersCollection[this.index];
|
|
13989
|
+
var factor = maps.mapLayerPanel.calculateFactor(this.currentLayer);
|
|
13492
13990
|
for (var j = 0; j < layerElement.childElementCount; j++) {
|
|
13493
13991
|
var currentEle = layerElement.childNodes[j];
|
|
13494
13992
|
if (!(currentEle.id.indexOf('_Markers_Group') > -1) && (!(currentEle.id.indexOf('_bubble_Group') > -1))
|
|
13495
13993
|
&& (!(currentEle.id.indexOf('_dataLableIndex_Group') > -1))) {
|
|
13496
|
-
if (
|
|
13994
|
+
if (maps.isTileMap && (currentEle.id.indexOf('_line_Group') > -1)) {
|
|
13497
13995
|
currentEle.remove();
|
|
13498
13996
|
if (layerElement.children.length > 0 && layerElement.children[0]) {
|
|
13499
|
-
layerElement.insertBefore(
|
|
13997
|
+
layerElement.insertBefore(maps.navigationLineModule.renderNavigation(this.currentLayer, maps.tileZoomLevel, this.index), layerElement.children[1]);
|
|
13500
13998
|
}
|
|
13501
13999
|
else {
|
|
13502
|
-
layerElement.appendChild(
|
|
14000
|
+
layerElement.appendChild(maps.navigationLineModule.renderNavigation(this.currentLayer, maps.tileZoomLevel, this.index));
|
|
13503
14001
|
}
|
|
13504
14002
|
}
|
|
13505
|
-
else {
|
|
13506
|
-
changeBorderWidth(currentEle, this.index, scale,
|
|
13507
|
-
|
|
14003
|
+
else if (currentEle.id.indexOf('Legend') == -1) {
|
|
14004
|
+
changeBorderWidth(currentEle, this.index, scale, maps);
|
|
14005
|
+
maps.zoomTranslatePoint = maps.translatePoint;
|
|
13508
14006
|
this.animateTransform(currentEle, animate$$1, x, y, scale);
|
|
13509
|
-
this.shapeZoomLocation = currentEle.childNodes;
|
|
13510
14007
|
}
|
|
13511
14008
|
}
|
|
13512
14009
|
else if (currentEle.id.indexOf('_Markers_Group') > -1) {
|
|
13513
|
-
if (!this.isPanning) {
|
|
14010
|
+
if (!this.isPanning && !isNullOrUndefined(currentEle.childNodes[0])) {
|
|
13514
14011
|
this.markerTranslates(currentEle.childNodes[0], factor, x, y, scale, 'Marker', layerElement, animate$$1);
|
|
13515
14012
|
}
|
|
13516
14013
|
currentEle = layerElement.childNodes[j];
|
|
@@ -13529,11 +14026,11 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
13529
14026
|
markerSelectionValues['latitude'] ||
|
|
13530
14027
|
this.currentLayer.markerSettings[markerIndex].initialMarkerSelection[x_1]['longitude'] ===
|
|
13531
14028
|
markerSelectionValues['longitude']) {
|
|
13532
|
-
|
|
14029
|
+
maps.markerSelection(this.currentLayer.markerSettings[markerIndex].selectionSettings, maps, currentEle.children[k], this.currentLayer.markerSettings[markerIndex].dataSource[dataIndex]);
|
|
13533
14030
|
}
|
|
13534
14031
|
}
|
|
13535
|
-
if ((this.currentLayer.animationDuration > 0 || (
|
|
13536
|
-
if (
|
|
14032
|
+
if ((this.currentLayer.animationDuration > 0 || (maps.layersCollection[0].animationDuration > 0 && this.currentLayer.type === 'SubLayer')) && !this.isPanning) {
|
|
14033
|
+
if (maps.isTileMap) {
|
|
13537
14034
|
var groupElement = document.querySelector('.GroupElement');
|
|
13538
14035
|
if (groupElement && !(document.querySelector('.ClusterGroupElement')) && markerAnimation) {
|
|
13539
14036
|
groupElement.style.display = 'none';
|
|
@@ -13545,29 +14042,29 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
13545
14042
|
}
|
|
13546
14043
|
}
|
|
13547
14044
|
}
|
|
13548
|
-
if (this.isPanning &&
|
|
13549
|
-
clusterSeparate(
|
|
14045
|
+
if (this.isPanning && maps.markerModule.sameMarkerData.length > 0) {
|
|
14046
|
+
clusterSeparate(maps.markerModule.sameMarkerData, maps, currentEle, true);
|
|
13550
14047
|
}
|
|
13551
|
-
else if (
|
|
13552
|
-
|
|
13553
|
-
if (document.getElementById(
|
|
13554
|
-
removeElement(
|
|
14048
|
+
else if (maps.markerModule.sameMarkerData.length > 0) {
|
|
14049
|
+
maps.markerModule.sameMarkerData = [];
|
|
14050
|
+
if (document.getElementById(maps.element.id + '_mapsTooltip')) {
|
|
14051
|
+
removeElement(maps.element.id + '_mapsTooltip');
|
|
13555
14052
|
}
|
|
13556
14053
|
}
|
|
13557
|
-
if (document.getElementById(
|
|
14054
|
+
if (document.getElementById(maps.element.id + '_mapsTooltip') && maps.mapsTooltipModule.tooltipTargetID.indexOf('_MarkerIndex_')
|
|
13558
14055
|
&& !this.isPanning) {
|
|
13559
|
-
var mapsTooltip =
|
|
14056
|
+
var mapsTooltip = maps.mapsTooltipModule;
|
|
13560
14057
|
var tooltipElement = currentEle.querySelector('#' + mapsTooltip.tooltipTargetID);
|
|
13561
14058
|
if (!isNullOrUndefined(tooltipElement)) {
|
|
13562
14059
|
if (tooltipElement['style']['visibility'] === 'hidden') {
|
|
13563
|
-
removeElement(
|
|
14060
|
+
removeElement(maps.element.id + '_mapsTooltip');
|
|
13564
14061
|
}
|
|
13565
14062
|
else {
|
|
13566
14063
|
var x_2 = parseFloat(tooltipElement.getAttribute('transform').split('(')[1].split(')')[0].split(' ')[1]);
|
|
13567
14064
|
var y_1 = parseFloat(tooltipElement.getAttribute('transform').split('(')[1].split(')')[0].split(' ')[2]);
|
|
13568
|
-
if (
|
|
13569
|
-
x_2 += +getElement(
|
|
13570
|
-
y_1 += +getElement(
|
|
14065
|
+
if (maps.isTileMap) {
|
|
14066
|
+
x_2 += +getElement(maps.element.id + '_tile_parent')['style']['left'].split('px')[0];
|
|
14067
|
+
y_1 += +getElement(maps.element.id + '_tile_parent')['style']['top'].split('px')[0];
|
|
13571
14068
|
}
|
|
13572
14069
|
mapsTooltip.svgTooltip.location.x = x_2;
|
|
13573
14070
|
mapsTooltip.svgTooltip.location.y = y_1;
|
|
@@ -13585,9 +14082,9 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
13585
14082
|
layerIndex = parseFloat(childElement.id.split('_LayerIndex_')[1].split('_')[0]);
|
|
13586
14083
|
var bubleIndex = parseFloat(childElement.id.split('_BubbleIndex_')[1].split('_')[0]);
|
|
13587
14084
|
var dataIndex = parseFloat(childElement.id.split('_BubbleIndex_')[1].split('_')[2]);
|
|
13588
|
-
for (var l = 0; l <
|
|
14085
|
+
for (var l = 0; l < maps.bubbleModule.bubbleCollection.length; l++) {
|
|
13589
14086
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13590
|
-
var bubbleCollection =
|
|
14087
|
+
var bubbleCollection = maps.bubbleModule.bubbleCollection[l];
|
|
13591
14088
|
if (bubbleCollection['LayerIndex'] === layerIndex && bubbleCollection['BubbleIndex'] === bubleIndex &&
|
|
13592
14089
|
bubbleCollection['DataIndex'] === dataIndex) {
|
|
13593
14090
|
var centerX = bubbleCollection['center']['x'];
|
|
@@ -13606,24 +14103,25 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
13606
14103
|
}
|
|
13607
14104
|
}
|
|
13608
14105
|
}
|
|
13609
|
-
else if (currentEle.id.indexOf('_dataLableIndex_Group') > -1) {
|
|
14106
|
+
else if (currentEle.id.indexOf('_dataLableIndex_Group') > -1 && !isNullOrUndefined(maps.layers[this.index])) {
|
|
13610
14107
|
this.intersect = [];
|
|
13611
|
-
|
|
13612
|
-
|
|
14108
|
+
maps.zoomLabelPositions = [];
|
|
14109
|
+
maps.zoomLabelPositions = maps.dataLabelModule.dataLabelCollections;
|
|
14110
|
+
var labelAnimate = !maps.isTileMap && animate$$1;
|
|
13613
14111
|
for (var k = 0; k < currentEle.childElementCount; k++) {
|
|
13614
14112
|
if (currentEle.childNodes[k]['id'].indexOf('_LabelIndex_') > -1) {
|
|
13615
14113
|
var labelIndex = parseFloat(currentEle.childNodes[k]['id'].split('_LabelIndex_')[1].split('_')[0]);
|
|
13616
|
-
this.zoomshapewidth =
|
|
13617
|
-
|
|
13618
|
-
this.dataLabelTranslate(currentEle.childNodes[k], factor, x, y, scale, 'DataLabel',
|
|
13619
|
-
var dataLabel =
|
|
14114
|
+
this.zoomshapewidth = currentEle.childNodes[k].getBoundingClientRect();
|
|
14115
|
+
maps.zoomShapeCollection.push(this.zoomshapewidth);
|
|
14116
|
+
this.dataLabelTranslate(currentEle.childNodes[k], factor, x, y, scale, 'DataLabel', labelAnimate);
|
|
14117
|
+
var dataLabel = maps.layers[this.index].dataLabelSettings;
|
|
13620
14118
|
var border = dataLabel.border;
|
|
13621
14119
|
if (k > 0 && border['width'] > 1) {
|
|
13622
|
-
if (currentEle.childNodes[k - 1]['id'].indexOf('_rectIndex_') > -1) {
|
|
13623
|
-
var labelX = ((
|
|
13624
|
-
var labelY = ((
|
|
14120
|
+
if (currentEle.childNodes[k - 1]['id'].indexOf('_rectIndex_') > -1 && !isNullOrUndefined(maps.zoomLabelPositions[labelIndex])) {
|
|
14121
|
+
var labelX = ((maps.zoomLabelPositions[labelIndex]['location']['x'] + x) * scale);
|
|
14122
|
+
var labelY = ((maps.zoomLabelPositions[labelIndex]['location']['y'] + y) * scale);
|
|
13625
14123
|
var zoomtext = currentEle.childNodes[k]['innerHTML'];
|
|
13626
|
-
var style =
|
|
14124
|
+
var style = maps.layers[this.index].dataLabelSettings.textStyle;
|
|
13627
14125
|
var zoomtextSize = measureText(zoomtext, style);
|
|
13628
14126
|
var padding = 5;
|
|
13629
14127
|
var rectElement = currentEle.childNodes[k - 1];
|
|
@@ -13638,11 +14136,11 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
13638
14136
|
}
|
|
13639
14137
|
}
|
|
13640
14138
|
}
|
|
13641
|
-
|
|
14139
|
+
maps.arrangeTemplate();
|
|
13642
14140
|
}
|
|
13643
14141
|
if (!isNullOrUndefined(this.currentLayer)) {
|
|
13644
|
-
if (!animate$$1 || this.currentLayer.animationDuration === 0 ||
|
|
13645
|
-
this.processTemplate(x, y, scale,
|
|
14142
|
+
if (!animate$$1 || this.currentLayer.animationDuration === 0 || maps.isTileMap) {
|
|
14143
|
+
this.processTemplate(x, y, scale, maps);
|
|
13646
14144
|
}
|
|
13647
14145
|
}
|
|
13648
14146
|
}
|
|
@@ -13702,10 +14200,10 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
13702
14200
|
}
|
|
13703
14201
|
var lati = (!isNullOrUndefined(markerSettings.latitudeValuePath)) ?
|
|
13704
14202
|
Number(getValueFromObject(data, markerSettings.latitudeValuePath)) : !isNullOrUndefined(data['latitude']) ?
|
|
13705
|
-
parseFloat(data['latitude']) : !isNullOrUndefined(data['Latitude']) ? data['Latitude'] :
|
|
14203
|
+
parseFloat(data['latitude']) : !isNullOrUndefined(data['Latitude']) ? data['Latitude'] : null;
|
|
13706
14204
|
var long = (!isNullOrUndefined(markerSettings.longitudeValuePath)) ?
|
|
13707
14205
|
Number(getValueFromObject(data, markerSettings.longitudeValuePath)) : !isNullOrUndefined(data['longitude']) ?
|
|
13708
|
-
parseFloat(data['longitude']) : !isNullOrUndefined(data['Longitude']) ? data['Longitude'] :
|
|
14206
|
+
parseFloat(data['longitude']) : !isNullOrUndefined(data['Longitude']) ? data['Longitude'] : null;
|
|
13709
14207
|
var offset = markerSettings.offset;
|
|
13710
14208
|
if (!eventArgs.cancel && markerSettings.visible && !isNullOrUndefined(long) && !isNullOrUndefined(lati)) {
|
|
13711
14209
|
var markerID = _this.maps.element.id + '_LayerIndex_' + layerIndex + '_MarkerIndex_'
|
|
@@ -13725,10 +14223,10 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
13725
14223
|
nullCount += (!isNaN(lati) && !isNaN(long)) ? 0 : 1;
|
|
13726
14224
|
markerTemplateCounts += (eventArgs.cancel) ? 1 : 0;
|
|
13727
14225
|
markerCounts += (eventArgs.cancel) ? 1 : 0;
|
|
13728
|
-
_this.maps.markerNullCount = (
|
|
13729
|
-
? _this.maps.markerNullCount : _this.maps.markerNullCount
|
|
14226
|
+
_this.maps.markerNullCount = (isNullOrUndefined(lati) || isNullOrUndefined(long))
|
|
14227
|
+
? _this.maps.markerNullCount + 1 : _this.maps.markerNullCount;
|
|
13730
14228
|
var markerDataLength = markerDatas.length - _this.maps.markerNullCount;
|
|
13731
|
-
if (markerSVGObject.childElementCount === (
|
|
14229
|
+
if (markerSVGObject.childElementCount === (markerDataLength - markerTemplateCounts - nullCount) && (type !== 'Template')) {
|
|
13732
14230
|
layerElement.appendChild(markerSVGObject);
|
|
13733
14231
|
if (currentLayers.markerClusterSettings.allowClustering) {
|
|
13734
14232
|
_this.maps.svgObject.appendChild(markerSVGObject);
|
|
@@ -13736,7 +14234,7 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
13736
14234
|
clusterTemplate(currentLayers, markerSVGObject, _this.maps, layerIndex, markerSVGObject, layerElement, true, true);
|
|
13737
14235
|
}
|
|
13738
14236
|
}
|
|
13739
|
-
if (markerTemplateElements.childElementCount === (
|
|
14237
|
+
if (markerTemplateElements.childElementCount === (markerDataLength - markerCounts - nullCount) && getElementByID(_this.maps.element.id + '_Secondary_Element')) {
|
|
13740
14238
|
getElementByID(_this.maps.element.id + '_Secondary_Element').appendChild(markerTemplateElements);
|
|
13741
14239
|
if (scale >= 1) {
|
|
13742
14240
|
if (currentLayers.markerClusterSettings.allowClustering) {
|
|
@@ -13832,7 +14330,7 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
13832
14330
|
}
|
|
13833
14331
|
if (this.maps.layers[this.index].dataLabelSettings.smartLabelMode === 'Hide') {
|
|
13834
14332
|
if (scale > 1) {
|
|
13835
|
-
text = (this.
|
|
14333
|
+
text = ((this.maps.dataLabelShape[l] * scale) >= zoomtextSize['width']) ? zoomtext : '';
|
|
13836
14334
|
element.innerHTML = text;
|
|
13837
14335
|
}
|
|
13838
14336
|
else {
|
|
@@ -13842,7 +14340,7 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
13842
14340
|
}
|
|
13843
14341
|
if (this.maps.layers[this.index].dataLabelSettings.smartLabelMode === 'Trim') {
|
|
13844
14342
|
if (scale > 1) {
|
|
13845
|
-
zoomtrimLabel = textTrim(this.
|
|
14343
|
+
zoomtrimLabel = textTrim((this.maps.dataLabelShape[l] * scale), zoomtext, style);
|
|
13846
14344
|
text = zoomtrimLabel;
|
|
13847
14345
|
element.innerHTML = text;
|
|
13848
14346
|
}
|
|
@@ -13880,7 +14378,7 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
13880
14378
|
|| textLocations['heightTop'] > this.intersect[j]['heightBottom']) {
|
|
13881
14379
|
trimmedLable = !isNullOrUndefined(text) ? text : zoomtext;
|
|
13882
14380
|
if (scale > 1) {
|
|
13883
|
-
trimmedLable = textTrim(this.
|
|
14381
|
+
trimmedLable = textTrim((this.maps.dataLabelShape[l] * scale), trimmedLable, style);
|
|
13884
14382
|
}
|
|
13885
14383
|
element.innerHTML = trimmedLable;
|
|
13886
14384
|
}
|
|
@@ -13906,11 +14404,11 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
13906
14404
|
}
|
|
13907
14405
|
this.intersect.push(textLocations);
|
|
13908
14406
|
if (isNullOrUndefined(trimmedLable)) {
|
|
13909
|
-
trimmedLable = textTrim(this.
|
|
14407
|
+
trimmedLable = textTrim((this.maps.dataLabelShape[l] * scale), zoomtext, style);
|
|
13910
14408
|
element.innerHTML = trimmedLable;
|
|
13911
14409
|
}
|
|
13912
14410
|
}
|
|
13913
|
-
|
|
14411
|
+
if (animate$$1 || duration > 0) {
|
|
13914
14412
|
smoothTranslate(element, 0, duration, new MapLocation(labelX, labelY));
|
|
13915
14413
|
}
|
|
13916
14414
|
}
|
|
@@ -14032,7 +14530,7 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
14032
14530
|
var layerRect = getElementByID(map.element.id + '_Layer_Collections').getBoundingClientRect();
|
|
14033
14531
|
var elementRect = getElementByID(map.element.id + '_svg').getBoundingClientRect();
|
|
14034
14532
|
var panningXDirection = ((xDifference < 0 ? layerRect.left <= (elementRect.left + map.mapAreaRect.x) :
|
|
14035
|
-
((layerRect.left + layerRect.width
|
|
14533
|
+
((layerRect.left + layerRect.width + map.mapAreaRect.x) >= (elementRect.width))));
|
|
14036
14534
|
var panningYDirection = ((yDifference < 0 ? layerRect.top <= (elementRect.top + map.mapAreaRect.y) :
|
|
14037
14535
|
((layerRect.top + layerRect.height + legendHeight + map.margin.top) >= (elementRect.top + elementRect.height))));
|
|
14038
14536
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -14046,15 +14544,15 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
14046
14544
|
if (!panArgs.cancel) {
|
|
14047
14545
|
if (panningXDirection && panningYDirection) {
|
|
14048
14546
|
map.translatePoint = new Point(x, y);
|
|
14049
|
-
this.applyTransform();
|
|
14547
|
+
this.applyTransform(map);
|
|
14050
14548
|
}
|
|
14051
14549
|
else if (panningXDirection) {
|
|
14052
14550
|
map.translatePoint = new Point(x, map.translatePoint.y);
|
|
14053
|
-
this.applyTransform();
|
|
14551
|
+
this.applyTransform(map);
|
|
14054
14552
|
}
|
|
14055
14553
|
else if (panningYDirection) {
|
|
14056
14554
|
map.translatePoint = new Point(map.translatePoint.x, y);
|
|
14057
|
-
this.applyTransform();
|
|
14555
|
+
this.applyTransform(map);
|
|
14058
14556
|
}
|
|
14059
14557
|
}
|
|
14060
14558
|
this.maps.zoomNotApplied = false;
|
|
@@ -14082,7 +14580,7 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
14082
14580
|
};
|
|
14083
14581
|
map.trigger(pan, panArgs);
|
|
14084
14582
|
map.mapLayerPanel.generateTiles(map.tileZoomLevel, map.tileTranslatePoint, 'Pan');
|
|
14085
|
-
this.applyTransform();
|
|
14583
|
+
this.applyTransform(map);
|
|
14086
14584
|
}
|
|
14087
14585
|
map.zoomTranslatePoint = map.translatePoint;
|
|
14088
14586
|
this.mouseDownPoints = this.mouseMovePoints;
|
|
@@ -14094,7 +14592,7 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
14094
14592
|
(this.distanceX / this.maps.scale)) : this.maps.translatePoint.x;
|
|
14095
14593
|
this.maps.translatePoint.y = !isNullOrUndefined(this.distanceY) ? this.maps.translatePoint.y -
|
|
14096
14594
|
(this.distanceY / this.maps.scale) : this.maps.translatePoint.y;
|
|
14097
|
-
this.applyTransform(false);
|
|
14595
|
+
this.applyTransform(this.maps, false);
|
|
14098
14596
|
};
|
|
14099
14597
|
Zoom.prototype.toolBarZooming = function (zoomFactor, type) {
|
|
14100
14598
|
var _this = this;
|
|
@@ -14124,18 +14622,36 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
14124
14622
|
var max = map.baseMapRectBounds['max'];
|
|
14125
14623
|
var mapWidth = Math.abs(max['x'] - min['x']);
|
|
14126
14624
|
var mapHeight = Math.abs(min['y'] - max['y']);
|
|
14127
|
-
var translatePointX =
|
|
14128
|
-
var translatePointY =
|
|
14129
|
-
|
|
14130
|
-
|
|
14131
|
-
|
|
14132
|
-
|
|
14133
|
-
|
|
14134
|
-
|
|
14625
|
+
var translatePointX = void 0;
|
|
14626
|
+
var translatePointY = void 0;
|
|
14627
|
+
if (zoomFactor < 1.2 && map.projectionType !== 'Eckert5') {
|
|
14628
|
+
if (mapHeight === 0 || mapWidth === 0 || mapHeight === mapWidth) {
|
|
14629
|
+
mapWidth = size.width / 2;
|
|
14630
|
+
mapHeight = size.height;
|
|
14631
|
+
}
|
|
14632
|
+
zoomFactor = parseFloat(Math.min(size.width / mapWidth, size.height / mapHeight).toFixed(2));
|
|
14633
|
+
zoomFactor = zoomFactor > 1.05 ? 1 : zoomFactor;
|
|
14634
|
+
map.translatePoint = this.calculateInitalZoomTranslatePoint(zoomFactor, mapWidth, mapHeight, size, min, map);
|
|
14635
|
+
}
|
|
14636
|
+
else {
|
|
14637
|
+
translatePointX = translatePoint.x - (((size.width / scale) - (size.width / zoomFactor)) / 2);
|
|
14638
|
+
translatePointY = translatePoint.y - (((size.height / scale) - (size.height / zoomFactor)) / 2);
|
|
14639
|
+
var currentHeight = Math.abs(map.baseMapRectBounds['max']['y'] - map.baseMapRectBounds['min']['y']) * zoomFactor;
|
|
14640
|
+
translatePointX = (currentHeight < map.mapAreaRect.height) ? (size.x + ((-(min['x'])) + ((size.width / 2) - (mapWidth / 2))))
|
|
14641
|
+
: translatePointX;
|
|
14642
|
+
translatePointY = (currentHeight < map.mapAreaRect.height) ? (size.y + ((-(min['y'])) + ((size.height / 2) - (mapHeight / 2))))
|
|
14643
|
+
: translatePointY;
|
|
14644
|
+
map.translatePoint = new Point(translatePointX, translatePointY);
|
|
14645
|
+
}
|
|
14135
14646
|
map.zoomTranslatePoint = map.translatePoint;
|
|
14136
14647
|
map.scale = zoomFactor;
|
|
14137
|
-
this.triggerZoomEvent(prevTilePoint, prevLevel, type)
|
|
14138
|
-
|
|
14648
|
+
if (this.triggerZoomEvent(prevTilePoint, prevLevel, type)) {
|
|
14649
|
+
map.translatePoint = map.zoomTranslatePoint = map.previousPoint;
|
|
14650
|
+
map.scale = map.previousScale;
|
|
14651
|
+
}
|
|
14652
|
+
else {
|
|
14653
|
+
this.applyTransform(map, true);
|
|
14654
|
+
}
|
|
14139
14655
|
}
|
|
14140
14656
|
else if ((map.isTileMap) && ((zoomFactor >= minZoom && zoomFactor <= maxZoom) || map.isReset)) {
|
|
14141
14657
|
var tileZoomFactor = prevLevel < minZoom && !map.isReset ? minZoom : zoomFactor;
|
|
@@ -14152,34 +14668,44 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
14152
14668
|
map.tileTranslatePoint.y = map.initialTileTranslate.y;
|
|
14153
14669
|
tileZoomFactor = map.tileZoomLevel = map.mapScaleValue = map.initialZoomLevel;
|
|
14154
14670
|
}
|
|
14155
|
-
this.triggerZoomEvent(prevTilePoint, prevLevel, type)
|
|
14156
|
-
|
|
14157
|
-
|
|
14158
|
-
|
|
14159
|
-
|
|
14160
|
-
}
|
|
14161
|
-
if (document.querySelector('.GroupElement')) {
|
|
14162
|
-
document.querySelector('.GroupElement').style.display = 'none';
|
|
14671
|
+
if (this.triggerZoomEvent(prevTilePoint, prevLevel, type)) {
|
|
14672
|
+
map.translatePoint = map.tileTranslatePoint = new Point(0, 0);
|
|
14673
|
+
map.scale = map.previousScale;
|
|
14674
|
+
map.tileZoomLevel = prevLevel;
|
|
14675
|
+
map.zoomSettings.zoomFactor = map.previousScale;
|
|
14163
14676
|
}
|
|
14164
|
-
|
|
14165
|
-
|
|
14166
|
-
|
|
14167
|
-
|
|
14168
|
-
|
|
14169
|
-
_this.applyTransform(true);
|
|
14170
|
-
if (document.getElementById(_this.maps.element.id + '_LayerIndex_1')) {
|
|
14171
|
-
document.getElementById(_this.maps.element.id + '_LayerIndex_1').style.display = 'block';
|
|
14677
|
+
else {
|
|
14678
|
+
map.translatePoint.y = (map.tileTranslatePoint.y - (0.01 * map.mapScaleValue)) / map.scale;
|
|
14679
|
+
map.translatePoint.x = (map.tileTranslatePoint.x - (0.01 * map.mapScaleValue)) / map.scale;
|
|
14680
|
+
if (document.getElementById(this.maps.element.id + '_LayerIndex_1')) {
|
|
14681
|
+
document.getElementById(this.maps.element.id + '_LayerIndex_1').style.display = 'none';
|
|
14172
14682
|
}
|
|
14173
|
-
|
|
14683
|
+
if (document.querySelector('.GroupElement')) {
|
|
14684
|
+
document.querySelector('.GroupElement').style.display = 'none';
|
|
14685
|
+
}
|
|
14686
|
+
this.markerLineAnimation(map);
|
|
14687
|
+
map.mapLayerPanel.generateTiles(tileZoomFactor, map.tileTranslatePoint, type);
|
|
14688
|
+
var element1 = document.getElementById(this.maps.element.id + '_tiles');
|
|
14689
|
+
var animationDuration = this.maps.layersCollection[0].animationDuration;
|
|
14690
|
+
setTimeout(function () {
|
|
14691
|
+
_this.applyTransform(_this.maps, true);
|
|
14692
|
+
if (document.getElementById(_this.maps.element.id + '_LayerIndex_1')) {
|
|
14693
|
+
document.getElementById(_this.maps.element.id + '_LayerIndex_1').style.display = 'block';
|
|
14694
|
+
}
|
|
14695
|
+
_this.maps.isAddLayer = false;
|
|
14696
|
+
}, animationDuration);
|
|
14697
|
+
}
|
|
14174
14698
|
}
|
|
14175
14699
|
this.maps.zoomNotApplied = false;
|
|
14176
14700
|
}
|
|
14177
14701
|
};
|
|
14178
14702
|
Zoom.prototype.createZoomingToolbars = function () {
|
|
14179
14703
|
var map = this.maps;
|
|
14704
|
+
var zoomInElements;
|
|
14705
|
+
var zoomOutElements;
|
|
14180
14706
|
this.toolBarGroup = map.renderer.createGroup({
|
|
14181
14707
|
id: map.element.id + '_Zooming_KitCollection',
|
|
14182
|
-
opacity: map.theme.toLowerCase() === '
|
|
14708
|
+
opacity: map.theme.toLowerCase() === 'fluentdark' ? 0.6 : 0.3
|
|
14183
14709
|
});
|
|
14184
14710
|
var kitHeight = 16;
|
|
14185
14711
|
var kitWidth = 16;
|
|
@@ -14194,7 +14720,6 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
14194
14720
|
var toolBarLength = map.zoomSettings.toolbars.length;
|
|
14195
14721
|
var toolWidth = (map.zoomSettings.toolBarOrientation === 'Horizontal') ? (toolBarLength * kitWidth) + (toolBarLength * padding) : (kitWidth * 2);
|
|
14196
14722
|
var toolHeight = (map.zoomSettings.toolBarOrientation === 'Horizontal') ? (kitHeight * 2) : (toolBarLength * kitHeight) + (toolBarLength * padding);
|
|
14197
|
-
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)));
|
|
14198
14723
|
var defElement = map.renderer.createDefs();
|
|
14199
14724
|
defElement.innerHTML = shadowElement;
|
|
14200
14725
|
this.toolBarGroup.appendChild(defElement);
|
|
@@ -14243,13 +14768,13 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
14243
14768
|
case 'zoomin':
|
|
14244
14769
|
direction = 'M 8, 0 L 8, 16 M 0, 8 L 16, 8';
|
|
14245
14770
|
this.currentToolbarEle.appendChild(map.renderer.drawPath(new PathOption(map.element.id + '_Zooming_ToolBar_' + toolbar_1 + '_Path', fill, 3, this.maps.themeStyle.zoomFillColor, 1, 1, null, direction)));
|
|
14246
|
-
|
|
14771
|
+
zoomInElements = this.currentToolbarEle;
|
|
14247
14772
|
this.wireEvents(this.currentToolbarEle, this.performToolBarAction);
|
|
14248
14773
|
break;
|
|
14249
14774
|
case 'zoomout':
|
|
14250
14775
|
direction = 'M 0, 8 L 16, 8';
|
|
14251
14776
|
this.currentToolbarEle.appendChild(map.renderer.drawPath(new PathOption(map.element.id + '_Zooming_ToolBar_' + toolbar_1, fill, 3, this.maps.themeStyle.zoomFillColor, 1, 1, null, direction)));
|
|
14252
|
-
|
|
14777
|
+
zoomOutElements = this.currentToolbarEle;
|
|
14253
14778
|
this.wireEvents(this.currentToolbarEle, this.performToolBarAction);
|
|
14254
14779
|
break;
|
|
14255
14780
|
case 'pan': {
|
|
@@ -14434,7 +14959,12 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
14434
14959
|
x = (size.width / 2) - (toolBarSize.width / 2);
|
|
14435
14960
|
break;
|
|
14436
14961
|
case 'Far':
|
|
14437
|
-
|
|
14962
|
+
if (!isNullOrUndefined(map.legendModule) && map.legendSettings.position === 'Left') {
|
|
14963
|
+
x = size.width + size.x - toolBarSize.width - padding;
|
|
14964
|
+
}
|
|
14965
|
+
else {
|
|
14966
|
+
x = (size.width - toolBarSize.width) - padding;
|
|
14967
|
+
}
|
|
14438
14968
|
break;
|
|
14439
14969
|
}
|
|
14440
14970
|
var extraPosition = map.getExtraPosition();
|
|
@@ -14490,6 +15020,7 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
14490
15020
|
}
|
|
14491
15021
|
else {
|
|
14492
15022
|
map.mapScaleValue = value - delta;
|
|
15023
|
+
map.isReset = (map.mapScaleValue < 1) ? true : false;
|
|
14493
15024
|
map.staticMapZoom = map.tileZoomLevel;
|
|
14494
15025
|
if (map.mapScaleValue === 1) {
|
|
14495
15026
|
map.markerCenterLatitude = null;
|
|
@@ -14583,14 +15114,14 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
14583
15114
|
if (document.getElementById(map.element.id + '_Zooming_ToolBar_Pan_Group')) {
|
|
14584
15115
|
if (!this.maps.zoomSettings.enablePanning) {
|
|
14585
15116
|
if (target.id.indexOf('_Zooming_ToolBar') > -1 || target.id.indexOf('_Zooming_Rect') > -1) {
|
|
14586
|
-
getElementByID(map.element.id + '_Zooming_ToolBar_Pan_Rect').setAttribute('opacity', map.theme.toLowerCase() === '
|
|
14587
|
-
getElementByID(map.element.id + '_Zooming_ToolBar_Pan').setAttribute('opacity', map.theme.toLowerCase() === '
|
|
15117
|
+
getElementByID(map.element.id + '_Zooming_ToolBar_Pan_Rect').setAttribute('opacity', map.theme.toLowerCase() === 'fluentdark' ? '0.6' : '0.3');
|
|
15118
|
+
getElementByID(map.element.id + '_Zooming_ToolBar_Pan').setAttribute('opacity', map.theme.toLowerCase() === 'fluentdark' ? '0.6' : '0.3');
|
|
14588
15119
|
}
|
|
14589
15120
|
}
|
|
14590
15121
|
}
|
|
14591
15122
|
}
|
|
14592
15123
|
else {
|
|
14593
|
-
getElementByID(map.element.id + '_Zooming_KitCollection').setAttribute('opacity', map.theme.toLowerCase() === '
|
|
15124
|
+
getElementByID(map.element.id + '_Zooming_KitCollection').setAttribute('opacity', map.theme.toLowerCase() === 'fluentdark' ? '0.6' : '0.3');
|
|
14594
15125
|
if (!this.maps.zoomSettings.enablePanning && document.getElementById(map.element.id + '_Zooming_ToolBar_Pan_Group')) {
|
|
14595
15126
|
getElementByID(map.element.id + '_Zooming_ToolBar_Pan_Rect').setAttribute('opacity', '1');
|
|
14596
15127
|
getElementByID(map.element.id + '_Zooming_ToolBar_Pan').setAttribute('opacity', '1');
|
|
@@ -14740,15 +15271,30 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
14740
15271
|
/**
|
|
14741
15272
|
* To destroy the zoom.
|
|
14742
15273
|
*
|
|
14743
|
-
* @param {Maps} maps - Specifies the instance of the maps.
|
|
14744
15274
|
* @returns {void}
|
|
14745
15275
|
* @private
|
|
14746
15276
|
*/
|
|
14747
|
-
Zoom.prototype.destroy = function (
|
|
15277
|
+
Zoom.prototype.destroy = function () {
|
|
15278
|
+
this.toolBarGroup = null;
|
|
15279
|
+
this.currentToolbarEle = null;
|
|
15280
|
+
this.zoomingRect = null;
|
|
15281
|
+
this.zoomElements = null;
|
|
15282
|
+
this.panElements = null;
|
|
15283
|
+
this.baseTranslatePoint = null;
|
|
15284
|
+
this.touchStartList = null;
|
|
15285
|
+
this.touchMoveList = null;
|
|
15286
|
+
this.previousTouchMoveList = null;
|
|
15287
|
+
this.mouseDownPoints = null;
|
|
15288
|
+
this.mouseMovePoints = null;
|
|
15289
|
+
this.startTouches = [];
|
|
15290
|
+
this.zoomshapewidth = null;
|
|
15291
|
+
this.intersect = [];
|
|
15292
|
+
this.mouseDownLatLong = null;
|
|
15293
|
+
this.mouseMoveLatLong = null;
|
|
14748
15294
|
this.removeEventListener();
|
|
14749
|
-
|
|
14750
|
-
|
|
14751
|
-
|
|
15295
|
+
//TODO: Calling the below code throws spec issue.
|
|
15296
|
+
//this.maps = null;
|
|
15297
|
+
this.currentLayer = null;
|
|
14752
15298
|
};
|
|
14753
15299
|
return Zoom;
|
|
14754
15300
|
}());
|
|
@@ -14766,7 +15312,6 @@ var Print = /** @__PURE__ @class */ (function () {
|
|
|
14766
15312
|
* @param {Maps} control - Specifies the instance of the map
|
|
14767
15313
|
*/
|
|
14768
15314
|
function Print(control) {
|
|
14769
|
-
this.control = control;
|
|
14770
15315
|
}
|
|
14771
15316
|
/**
|
|
14772
15317
|
* To print the Maps
|
|
@@ -14775,17 +15320,16 @@ var Print = /** @__PURE__ @class */ (function () {
|
|
|
14775
15320
|
* @returns {void}
|
|
14776
15321
|
* @private
|
|
14777
15322
|
*/
|
|
14778
|
-
Print.prototype.print = function (elements) {
|
|
14779
|
-
var
|
|
14780
|
-
|
|
14781
|
-
|
|
14782
|
-
this.printWindow.resizeTo(screen.availWidth, screen.availHeight);
|
|
15323
|
+
Print.prototype.print = function (maps, elements) {
|
|
15324
|
+
var printWindow = window.open('', 'print', 'height=' + window.outerHeight + ',width=' + window.outerWidth + ',tabbar=no');
|
|
15325
|
+
printWindow.moveTo(0, 0);
|
|
15326
|
+
printWindow.resizeTo(screen.availWidth, screen.availHeight);
|
|
14783
15327
|
var argsData = {
|
|
14784
|
-
cancel: false, htmlContent: this.getHTMLContent(elements), name: beforePrint
|
|
15328
|
+
cancel: false, htmlContent: this.getHTMLContent(maps, elements), name: beforePrint
|
|
14785
15329
|
};
|
|
14786
|
-
|
|
15330
|
+
maps.trigger('beforePrint', argsData, function (beforePrintArgs) {
|
|
14787
15331
|
if (!argsData.cancel) {
|
|
14788
|
-
print(argsData.htmlContent,
|
|
15332
|
+
print(argsData.htmlContent, printWindow);
|
|
14789
15333
|
}
|
|
14790
15334
|
});
|
|
14791
15335
|
};
|
|
@@ -14796,8 +15340,29 @@ var Print = /** @__PURE__ @class */ (function () {
|
|
|
14796
15340
|
* @returns {Element} - Returns the div element
|
|
14797
15341
|
* @private
|
|
14798
15342
|
*/
|
|
14799
|
-
Print.prototype.getHTMLContent = function (elements) {
|
|
15343
|
+
Print.prototype.getHTMLContent = function (maps, elements) {
|
|
14800
15344
|
var div = createElement('div');
|
|
15345
|
+
var divElement = maps.element.cloneNode(true);
|
|
15346
|
+
if (maps.isTileMap) {
|
|
15347
|
+
for (var i = 0; i < divElement.childElementCount; i++) {
|
|
15348
|
+
if (divElement.children[i].id === maps.element.id + '_tile_parent') {
|
|
15349
|
+
divElement.children[i].style.removeProperty('height');
|
|
15350
|
+
divElement.children[i].style.removeProperty('width');
|
|
15351
|
+
divElement.children[i].style.removeProperty('top');
|
|
15352
|
+
divElement.children[i].style.removeProperty('left');
|
|
15353
|
+
divElement.children[i].style.removeProperty('right');
|
|
15354
|
+
divElement.children[i].style.removeProperty('overflow');
|
|
15355
|
+
var svgElement = document.getElementById(maps.element.id + '_Tile_SVG_Parent');
|
|
15356
|
+
divElement.children[i].children[0].style.overflow = 'hidden';
|
|
15357
|
+
divElement.children[i].children[0].style.position = 'absolute';
|
|
15358
|
+
divElement.children[i].children[0].style.height = svgElement.style.height;
|
|
15359
|
+
divElement.children[i].children[0].style.width = svgElement.style.width;
|
|
15360
|
+
divElement.children[i].children[0].style.left = svgElement.style.left;
|
|
15361
|
+
divElement.children[i].children[0].style.top = svgElement.style.top;
|
|
15362
|
+
break;
|
|
15363
|
+
}
|
|
15364
|
+
}
|
|
15365
|
+
}
|
|
14801
15366
|
if (elements) {
|
|
14802
15367
|
if (elements instanceof Array) {
|
|
14803
15368
|
Array.prototype.forEach.call(elements, function (value) {
|
|
@@ -14812,7 +15377,7 @@ var Print = /** @__PURE__ @class */ (function () {
|
|
|
14812
15377
|
}
|
|
14813
15378
|
}
|
|
14814
15379
|
else {
|
|
14815
|
-
div.appendChild(
|
|
15380
|
+
div.appendChild(divElement);
|
|
14816
15381
|
}
|
|
14817
15382
|
return div;
|
|
14818
15383
|
};
|
|
@@ -14827,15 +15392,10 @@ var Print = /** @__PURE__ @class */ (function () {
|
|
|
14827
15392
|
/**
|
|
14828
15393
|
* To destroy the print.
|
|
14829
15394
|
*
|
|
14830
|
-
* @param {Maps} maps - Specifies the instance of the maps
|
|
14831
15395
|
* @returns {void}
|
|
14832
15396
|
* @private
|
|
14833
15397
|
*/
|
|
14834
|
-
Print.prototype.destroy = function (
|
|
14835
|
-
/**
|
|
14836
|
-
* Destroy method performed here
|
|
14837
|
-
*/
|
|
14838
|
-
};
|
|
15398
|
+
Print.prototype.destroy = function () { };
|
|
14839
15399
|
return Print;
|
|
14840
15400
|
}());
|
|
14841
15401
|
|
|
@@ -14852,7 +15412,6 @@ var ImageExport = /** @__PURE__ @class */ (function () {
|
|
|
14852
15412
|
* @param {Maps} control - Specifies the instance of the map
|
|
14853
15413
|
*/
|
|
14854
15414
|
function ImageExport(control) {
|
|
14855
|
-
this.control = control;
|
|
14856
15415
|
}
|
|
14857
15416
|
/**
|
|
14858
15417
|
* To export the file as image/svg format
|
|
@@ -14863,32 +15422,33 @@ var ImageExport = /** @__PURE__ @class */ (function () {
|
|
|
14863
15422
|
* @returns {Promise<string>} - Returns the promise string.
|
|
14864
15423
|
* @private
|
|
14865
15424
|
*/
|
|
14866
|
-
ImageExport.prototype.export = function (type, fileName, allowDownload) {
|
|
14867
|
-
var _this = this;
|
|
15425
|
+
ImageExport.prototype.export = function (maps, type, fileName, allowDownload) {
|
|
14868
15426
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
14869
15427
|
var promise = new Promise(function (resolve, reject) {
|
|
14870
15428
|
var imageCanvasElement = createElement('canvas', {
|
|
14871
15429
|
id: 'ej2-canvas',
|
|
14872
15430
|
attrs: {
|
|
14873
|
-
'width':
|
|
14874
|
-
'height':
|
|
15431
|
+
'width': maps.availableSize.width.toString(),
|
|
15432
|
+
'height': maps.availableSize.height.toString()
|
|
14875
15433
|
}
|
|
14876
15434
|
});
|
|
14877
15435
|
var isDownload = !(Browser.userAgent.toString().indexOf('HeadlessChrome') > -1);
|
|
14878
|
-
var toolbarEle = document.getElementById(
|
|
14879
|
-
var svgParent = document.getElementById(
|
|
15436
|
+
var toolbarEle = document.getElementById(maps.element.id + '_ToolBar');
|
|
15437
|
+
var svgParent = document.getElementById(maps.element.id + '_Tile_SVG_Parent');
|
|
14880
15438
|
var svgDataElement;
|
|
14881
|
-
|
|
15439
|
+
var tileSvg;
|
|
15440
|
+
var svgObject = getElementByID(maps.element.id + '_svg').cloneNode(true);
|
|
15441
|
+
if (!maps.isTileMap) {
|
|
14882
15442
|
svgDataElement = '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">' +
|
|
14883
|
-
|
|
15443
|
+
maps.svgObject.outerHTML + '</svg>';
|
|
14884
15444
|
}
|
|
14885
15445
|
else {
|
|
14886
|
-
|
|
15446
|
+
tileSvg = getElementByID(maps.element.id + '_Tile_SVG').cloneNode(true);
|
|
14887
15447
|
svgDataElement = '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">' +
|
|
14888
|
-
|
|
15448
|
+
svgObject.outerHTML + tileSvg.outerHTML + '</svg>';
|
|
14889
15449
|
}
|
|
14890
15450
|
var url = window.URL.createObjectURL(new Blob(type === 'SVG' ? [svgDataElement] :
|
|
14891
|
-
[(new XMLSerializer()).serializeToString(
|
|
15451
|
+
[(new XMLSerializer()).serializeToString(svgObject)], { type: 'image/svg+xml' }));
|
|
14892
15452
|
if (type === 'SVG') {
|
|
14893
15453
|
if (allowDownload) {
|
|
14894
15454
|
triggerDownload(fileName, type, url, isDownload);
|
|
@@ -14900,7 +15460,7 @@ var ImageExport = /** @__PURE__ @class */ (function () {
|
|
|
14900
15460
|
else {
|
|
14901
15461
|
var image_1 = new Image();
|
|
14902
15462
|
var ctxt_1 = imageCanvasElement.getContext('2d');
|
|
14903
|
-
if (!
|
|
15463
|
+
if (!maps.isTileMap) {
|
|
14904
15464
|
image_1.onload = (function () {
|
|
14905
15465
|
ctxt_1.drawImage(image_1, 0, 0);
|
|
14906
15466
|
window.URL.revokeObjectURL(url);
|
|
@@ -14919,31 +15479,37 @@ var ImageExport = /** @__PURE__ @class */ (function () {
|
|
|
14919
15479
|
image_1.src = url;
|
|
14920
15480
|
}
|
|
14921
15481
|
else {
|
|
15482
|
+
var svgParentElement = document.getElementById(maps.element.id + '_MapAreaBorder');
|
|
15483
|
+
var top_1 = parseFloat(svgParentElement.getAttribute('y'));
|
|
15484
|
+
var left_1 = parseFloat(svgParentElement.getAttribute('x'));
|
|
14922
15485
|
var imgxHttp = new XMLHttpRequest();
|
|
14923
|
-
var imgTileLength_1 =
|
|
15486
|
+
var imgTileLength_1 = maps.mapLayerPanel.tiles.length;
|
|
14924
15487
|
var _loop_1 = function (i) {
|
|
14925
|
-
var tile = document.getElementById(
|
|
15488
|
+
var tile = document.getElementById(maps.element.id + '_tile_' + (i - 1));
|
|
14926
15489
|
var exportTileImg = new Image();
|
|
14927
15490
|
exportTileImg.crossOrigin = 'Anonymous';
|
|
14928
|
-
ctxt_1.fillStyle =
|
|
14929
|
-
ctxt_1.fillRect(0, 0,
|
|
14930
|
-
ctxt_1.font =
|
|
14931
|
-
|
|
14932
|
-
|
|
15491
|
+
ctxt_1.fillStyle = maps.background ? maps.background : '#FFFFFF';
|
|
15492
|
+
ctxt_1.fillRect(0, 0, maps.availableSize.width, maps.availableSize.height);
|
|
15493
|
+
ctxt_1.font = maps.titleSettings.textStyle.size + ' Arial';
|
|
15494
|
+
var titleElement = document.getElementById(maps.element.id + '_Map_title');
|
|
15495
|
+
if (!isNullOrUndefined(titleElement)) {
|
|
15496
|
+
ctxt_1.fillStyle = titleElement.getAttribute('fill');
|
|
15497
|
+
ctxt_1.fillText(maps.titleSettings.text, parseFloat(titleElement.getAttribute('x')), parseFloat(titleElement.getAttribute('y')));
|
|
15498
|
+
}
|
|
14933
15499
|
exportTileImg.onload = (function () {
|
|
14934
15500
|
if (i === 0 || i === imgTileLength_1 + 1) {
|
|
14935
15501
|
if (i === 0) {
|
|
14936
15502
|
ctxt_1.setTransform(1, 0, 0, 1, 0, 0);
|
|
14937
|
-
ctxt_1.rect(0,
|
|
15503
|
+
ctxt_1.rect(0, top_1, parseFloat(svgParent.style.width), parseFloat(svgParent.style.height));
|
|
14938
15504
|
ctxt_1.clip();
|
|
14939
15505
|
}
|
|
14940
15506
|
else {
|
|
14941
|
-
ctxt_1.setTransform(1, 0, 0, 1,
|
|
15507
|
+
ctxt_1.setTransform(1, 0, 0, 1, left_1, top_1);
|
|
14942
15508
|
}
|
|
14943
15509
|
}
|
|
14944
15510
|
else {
|
|
14945
|
-
ctxt_1.setTransform(1, 0, 0, 1, parseFloat(tile.style.left) +
|
|
14946
|
-
|
|
15511
|
+
ctxt_1.setTransform(1, 0, 0, 1, parseFloat(tile.style.left) + left_1, parseFloat(tile.style.top) +
|
|
15512
|
+
top_1);
|
|
14947
15513
|
}
|
|
14948
15514
|
ctxt_1.drawImage(exportTileImg, 0, 0);
|
|
14949
15515
|
if (i === imgTileLength_1 + 1) {
|
|
@@ -14969,7 +15535,7 @@ var ImageExport = /** @__PURE__ @class */ (function () {
|
|
|
14969
15535
|
}
|
|
14970
15536
|
else {
|
|
14971
15537
|
setTimeout(function () {
|
|
14972
|
-
exportTileImg.src = window.URL.createObjectURL(new Blob([(new XMLSerializer()).serializeToString(
|
|
15538
|
+
exportTileImg.src = window.URL.createObjectURL(new Blob([(new XMLSerializer()).serializeToString(tileSvg)], { type: 'image/svg+xml' }));
|
|
14973
15539
|
}, 300);
|
|
14974
15540
|
}
|
|
14975
15541
|
}
|
|
@@ -14998,15 +15564,10 @@ var ImageExport = /** @__PURE__ @class */ (function () {
|
|
|
14998
15564
|
/**
|
|
14999
15565
|
* To destroy the ImageExport.
|
|
15000
15566
|
*
|
|
15001
|
-
* @param {Maps} maps - Specifies the instance of the maps.
|
|
15002
15567
|
* @returns {void}
|
|
15003
15568
|
* @private
|
|
15004
15569
|
*/
|
|
15005
|
-
ImageExport.prototype.destroy = function (
|
|
15006
|
-
/**
|
|
15007
|
-
* Destroy method performed here
|
|
15008
|
-
*/
|
|
15009
|
-
};
|
|
15570
|
+
ImageExport.prototype.destroy = function () { };
|
|
15010
15571
|
return ImageExport;
|
|
15011
15572
|
}());
|
|
15012
15573
|
|
|
@@ -15022,8 +15583,7 @@ var PdfExport = /** @__PURE__ @class */ (function () {
|
|
|
15022
15583
|
*
|
|
15023
15584
|
* @param {Maps} control Specifies the instance of the map
|
|
15024
15585
|
*/
|
|
15025
|
-
function PdfExport(
|
|
15026
|
-
this.control = control;
|
|
15586
|
+
function PdfExport() {
|
|
15027
15587
|
}
|
|
15028
15588
|
/**
|
|
15029
15589
|
* To export the file as image/svg format
|
|
@@ -15035,25 +15595,24 @@ var PdfExport = /** @__PURE__ @class */ (function () {
|
|
|
15035
15595
|
* @returns {Promise<string>} - Returns the promise string
|
|
15036
15596
|
* @private
|
|
15037
15597
|
*/
|
|
15038
|
-
PdfExport.prototype.export = function (type, fileName, allowDownload, orientation) {
|
|
15039
|
-
var _this = this;
|
|
15598
|
+
PdfExport.prototype.export = function (maps, type, fileName, allowDownload, orientation) {
|
|
15040
15599
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
15041
15600
|
var promise = new Promise(function (resolve, reject) {
|
|
15042
15601
|
var canvasElement = createElement('canvas', {
|
|
15043
15602
|
id: 'ej2-canvas',
|
|
15044
15603
|
attrs: {
|
|
15045
|
-
'width':
|
|
15046
|
-
'height':
|
|
15604
|
+
'width': maps.availableSize.width.toString(),
|
|
15605
|
+
'height': maps.availableSize.height.toString()
|
|
15047
15606
|
}
|
|
15048
15607
|
});
|
|
15049
15608
|
orientation = isNullOrUndefined(orientation) ? PdfPageOrientation.Landscape : orientation;
|
|
15050
|
-
var svgParent = document.getElementById(
|
|
15609
|
+
var svgParent = document.getElementById(maps.element.id + '_Tile_SVG_Parent');
|
|
15051
15610
|
var svgData;
|
|
15052
|
-
var exportElement =
|
|
15611
|
+
var exportElement = maps.svgObject.cloneNode(true);
|
|
15053
15612
|
var backgroundElement = exportElement.childNodes[0];
|
|
15054
15613
|
var backgroundColor = backgroundElement.getAttribute('fill');
|
|
15055
|
-
if ((
|
|
15056
|
-
&& (backgroundColor === 'rgba(255,255,255, 0.0)' || backgroundColor === 'transparent')) {
|
|
15614
|
+
if ((maps.theme === 'Tailwind' || maps.theme === 'TailwindDark' || maps.theme === 'Bootstrap5' || maps.theme === 'Bootstrap5Dark'
|
|
15615
|
+
|| maps.theme === 'Fluent' || maps.theme === 'FluentDark') && (backgroundColor === 'rgba(255,255,255, 0.0)' || backgroundColor === 'transparent')) {
|
|
15057
15616
|
exportElement.childNodes[0].setAttribute('fill', 'rgba(255,255,255, 1)');
|
|
15058
15617
|
}
|
|
15059
15618
|
var url = window.URL.createObjectURL(new Blob(type === 'SVG' ? [svgData] :
|
|
@@ -15061,7 +15620,7 @@ var PdfExport = /** @__PURE__ @class */ (function () {
|
|
|
15061
15620
|
var pdfDocument = new PdfDocument();
|
|
15062
15621
|
var image = new Image();
|
|
15063
15622
|
var ctx = canvasElement.getContext('2d');
|
|
15064
|
-
if (!
|
|
15623
|
+
if (!maps.isTileMap) {
|
|
15065
15624
|
image.onload = (function () {
|
|
15066
15625
|
ctx.drawImage(image, 0, 0);
|
|
15067
15626
|
window.URL.revokeObjectURL(url);
|
|
@@ -15069,7 +15628,7 @@ var PdfExport = /** @__PURE__ @class */ (function () {
|
|
|
15069
15628
|
var imageString = canvasElement.toDataURL('image/jpeg').replace('image/jpeg', 'image/octet-stream');
|
|
15070
15629
|
pdfDocument.pageSettings.orientation = orientation;
|
|
15071
15630
|
imageString = imageString.slice(imageString.indexOf(',') + 1);
|
|
15072
|
-
pdfDocument.pages.add().graphics.drawImage(new PdfBitmap(imageString), 0, 0, (
|
|
15631
|
+
pdfDocument.pages.add().graphics.drawImage(new PdfBitmap(imageString), 0, 0, (maps.availableSize.width - 60), maps.availableSize.height);
|
|
15073
15632
|
if (allowDownload) {
|
|
15074
15633
|
pdfDocument.save(fileName + '.pdf');
|
|
15075
15634
|
pdfDocument.destroy();
|
|
@@ -15082,31 +15641,36 @@ var PdfExport = /** @__PURE__ @class */ (function () {
|
|
|
15082
15641
|
image.src = url;
|
|
15083
15642
|
}
|
|
15084
15643
|
else {
|
|
15644
|
+
var svgParentElement = document.getElementById(maps.element.id + '_MapAreaBorder');
|
|
15645
|
+
var top_1 = parseFloat(svgParentElement.getAttribute('y'));
|
|
15646
|
+
var left_1 = parseFloat(svgParentElement.getAttribute('x'));
|
|
15085
15647
|
var xHttp = new XMLHttpRequest();
|
|
15086
|
-
var tileLength_1 =
|
|
15648
|
+
var tileLength_1 = maps.mapLayerPanel.tiles.length;
|
|
15087
15649
|
var _loop_1 = function (i) {
|
|
15088
|
-
var tile = document.getElementById(
|
|
15650
|
+
var tile = document.getElementById(maps.element.id + '_tile_' + (i - 1));
|
|
15089
15651
|
var tileImg = new Image();
|
|
15090
15652
|
tileImg.crossOrigin = 'Anonymous';
|
|
15091
|
-
ctx.fillStyle =
|
|
15092
|
-
ctx.fillRect(0, 0,
|
|
15093
|
-
ctx.font =
|
|
15094
|
-
|
|
15095
|
-
|
|
15653
|
+
ctx.fillStyle = maps.background ? maps.background : '#FFFFFF';
|
|
15654
|
+
ctx.fillRect(0, 0, maps.availableSize.width, maps.availableSize.height);
|
|
15655
|
+
ctx.font = maps.titleSettings.textStyle.size + ' Arial';
|
|
15656
|
+
var titleElement = document.getElementById(maps.element.id + '_Map_title');
|
|
15657
|
+
if (!isNullOrUndefined(titleElement)) {
|
|
15658
|
+
ctx.fillStyle = titleElement.getAttribute('fill');
|
|
15659
|
+
ctx.fillText(maps.titleSettings.text, parseFloat(titleElement.getAttribute('x')), parseFloat(titleElement.getAttribute('y')));
|
|
15660
|
+
}
|
|
15096
15661
|
tileImg.onload = (function () {
|
|
15097
15662
|
if (i === 0 || i === tileLength_1 + 1) {
|
|
15098
15663
|
if (i === 0) {
|
|
15099
15664
|
ctx.setTransform(1, 0, 0, 1, 0, 0);
|
|
15100
|
-
ctx.rect(0,
|
|
15665
|
+
ctx.rect(0, top_1, parseFloat(svgParent.style.width), parseFloat(svgParent.style.height));
|
|
15101
15666
|
ctx.clip();
|
|
15102
15667
|
}
|
|
15103
15668
|
else {
|
|
15104
|
-
ctx.setTransform(1, 0, 0, 1,
|
|
15669
|
+
ctx.setTransform(1, 0, 0, 1, left_1, top_1);
|
|
15105
15670
|
}
|
|
15106
15671
|
}
|
|
15107
15672
|
else {
|
|
15108
|
-
ctx.setTransform(1, 0, 0, 1, parseFloat(tile.style.left) +
|
|
15109
|
-
(parseFloat(document.getElementById(_this.control.element.id + '_tile_parent').style.top)));
|
|
15673
|
+
ctx.setTransform(1, 0, 0, 1, parseFloat(tile.style.left) + left_1, parseFloat(tile.style.top) + top_1);
|
|
15110
15674
|
}
|
|
15111
15675
|
ctx.drawImage(tileImg, 0, 0);
|
|
15112
15676
|
if (i === tileLength_1 + 1) {
|
|
@@ -15115,7 +15679,7 @@ var PdfExport = /** @__PURE__ @class */ (function () {
|
|
|
15115
15679
|
var x = localStorage.getItem('saved-image-example');
|
|
15116
15680
|
pdfDocument.pageSettings.orientation = orientation;
|
|
15117
15681
|
x = x.slice(x.indexOf(',') + 1);
|
|
15118
|
-
pdfDocument.pages.add().graphics.drawImage(new PdfBitmap(x), 0, 0, (
|
|
15682
|
+
pdfDocument.pages.add().graphics.drawImage(new PdfBitmap(x), 0, 0, (maps.availableSize.width - 60), maps.availableSize.height);
|
|
15119
15683
|
if (allowDownload) {
|
|
15120
15684
|
pdfDocument.save(fileName + '.pdf');
|
|
15121
15685
|
pdfDocument.destroy();
|
|
@@ -15132,7 +15696,8 @@ var PdfExport = /** @__PURE__ @class */ (function () {
|
|
|
15132
15696
|
}
|
|
15133
15697
|
else {
|
|
15134
15698
|
setTimeout(function () {
|
|
15135
|
-
|
|
15699
|
+
var tileSvg = document.getElementById(maps.element.id + '_Tile_SVG');
|
|
15700
|
+
tileImg.src = window.URL.createObjectURL(new Blob([(new XMLSerializer()).serializeToString(tileSvg)], { type: 'image/svg+xml' }));
|
|
15136
15701
|
}, 300);
|
|
15137
15702
|
}
|
|
15138
15703
|
}
|
|
@@ -15158,17 +15723,12 @@ var PdfExport = /** @__PURE__ @class */ (function () {
|
|
|
15158
15723
|
return 'PdfExport';
|
|
15159
15724
|
};
|
|
15160
15725
|
/**
|
|
15161
|
-
* To destroy the
|
|
15726
|
+
* To destroy the PdfExport.
|
|
15162
15727
|
*
|
|
15163
|
-
* @param {Maps} maps - Specifies the instance of the maps.
|
|
15164
15728
|
* @returns {void}
|
|
15165
15729
|
* @private
|
|
15166
15730
|
*/
|
|
15167
|
-
PdfExport.prototype.destroy = function (
|
|
15168
|
-
/**
|
|
15169
|
-
* Destroy method performed here
|
|
15170
|
-
*/
|
|
15171
|
-
};
|
|
15731
|
+
PdfExport.prototype.destroy = function () { };
|
|
15172
15732
|
return PdfExport;
|
|
15173
15733
|
}());
|
|
15174
15734
|
|
|
@@ -15180,5 +15740,5 @@ var PdfExport = /** @__PURE__ @class */ (function () {
|
|
|
15180
15740
|
* exporting all modules from maps index
|
|
15181
15741
|
*/
|
|
15182
15742
|
|
|
15183
|
-
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, 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 };
|
|
15743
|
+
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 };
|
|
15184
15744
|
//# sourceMappingURL=ej2-maps.es5.js.map
|