@syncfusion/ej2-maps 27.2.2 → 28.1.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.gitleaksignore +3 -3
- package/README.md +2 -2
- package/dist/ej2-maps.min.js +3 -3
- package/dist/ej2-maps.umd.min.js +3 -3
- package/dist/ej2-maps.umd.min.js.map +1 -1
- package/dist/es6/ej2-maps.es2015.js +529 -223
- package/dist/es6/ej2-maps.es2015.js.map +1 -1
- package/dist/es6/ej2-maps.es5.js +539 -232
- package/dist/es6/ej2-maps.es5.js.map +1 -1
- package/dist/global/ej2-maps.min.js +3 -3
- package/dist/global/ej2-maps.min.js.map +1 -1
- package/dist/global/index.d.ts +2 -2
- package/package.json +13 -13
- package/src/maps/layers/layer-panel.js +1 -1
- package/src/maps/layers/legend.js +23 -21
- package/src/maps/layers/marker.d.ts +8 -1
- package/src/maps/layers/marker.js +104 -33
- package/src/maps/maps-model.d.ts +8 -1
- package/src/maps/maps.d.ts +19 -3
- package/src/maps/maps.js +54 -16
- package/src/maps/model/base-model.d.ts +20 -0
- package/src/maps/model/base.d.ts +17 -0
- package/src/maps/model/base.js +9 -0
- package/src/maps/model/constants.d.ts +6 -0
- package/src/maps/model/constants.js +6 -0
- package/src/maps/model/export-image.js +4 -4
- package/src/maps/model/export-pdf.js +4 -4
- package/src/maps/model/interface.d.ts +15 -0
- package/src/maps/model/print.js +2 -2
- package/src/maps/model/theme.js +72 -0
- package/src/maps/user-interaction/tooltip.js +3 -1
- package/src/maps/user-interaction/zoom.d.ts +17 -3
- package/src/maps/user-interaction/zoom.js +156 -105
- package/src/maps/utils/enum.d.ts +4 -0
- package/src/maps/utils/helper.d.ts +4 -9
- package/src/maps/utils/helper.js +102 -46
|
@@ -424,13 +424,14 @@ function measureText(text, font) {
|
|
|
424
424
|
* @private
|
|
425
425
|
*/
|
|
426
426
|
function measureTextElement(text, font) {
|
|
427
|
-
|
|
427
|
+
let canvas = document.createElement('canvas');
|
|
428
428
|
// eslint-disable-next-line @typescript-eslint/tslint/config
|
|
429
429
|
const context = canvas.getContext('2d');
|
|
430
430
|
context.font = `${font.fontStyle} ${font.fontWeight} ${typeof font.size === 'number' ? font.size + 'px' : font.size} ${font.fontFamily}`;
|
|
431
431
|
const metrics = context.measureText(text);
|
|
432
432
|
const width = metrics.width;
|
|
433
433
|
const height = parseFloat(font.size) || 16;
|
|
434
|
+
canvas = null;
|
|
434
435
|
return new Size(width, height);
|
|
435
436
|
}
|
|
436
437
|
/**
|
|
@@ -925,14 +926,19 @@ function updateImageUrl(eventArgs, data) {
|
|
|
925
926
|
* @param {HTMLElement | Element} markerTemplate - Specifies the marker template
|
|
926
927
|
* @param {Maps} maps - Specifies the instance of the maps
|
|
927
928
|
* @param {number} layerIndex - Specifies the layer index
|
|
929
|
+
* @param {number} markerIndex - Specifies the marker index
|
|
928
930
|
* @param {Element} markerCollection - Specifies the marker collection
|
|
929
931
|
* @param {Element} layerElement - Specifies the layer element
|
|
930
932
|
* @param {boolean} check - Specifies the boolean value
|
|
931
933
|
* @param {boolean} zoomCheck - Specifies the boolean value
|
|
934
|
+
* @param {any} translatePoint - Specifies the data
|
|
935
|
+
* @param {boolean} allowInnerClusterSetting - Specifies the boolean value
|
|
932
936
|
* @returns {boolean} -Returns boolean for cluster completion
|
|
933
937
|
* @private
|
|
934
938
|
*/
|
|
935
|
-
function clusterTemplate(currentLayer, markerTemplate, maps, layerIndex,
|
|
939
|
+
function clusterTemplate(currentLayer, markerTemplate, maps, layerIndex, markerIndex, markerCollection,
|
|
940
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
941
|
+
layerElement, check, zoomCheck, translatePoint, allowInnerClusterSetting) {
|
|
936
942
|
let bounds1;
|
|
937
943
|
let bounds2;
|
|
938
944
|
let colloideBounds = [];
|
|
@@ -941,7 +947,7 @@ function clusterTemplate(currentLayer, markerTemplate, maps, layerIndex, markerC
|
|
|
941
947
|
let tempY = 0;
|
|
942
948
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
943
949
|
let data;
|
|
944
|
-
const
|
|
950
|
+
const markerSetting = currentLayer.markerSettings[markerIndex];
|
|
945
951
|
let options;
|
|
946
952
|
let textElement;
|
|
947
953
|
let tempElement1;
|
|
@@ -951,7 +957,9 @@ function clusterTemplate(currentLayer, markerTemplate, maps, layerIndex, markerC
|
|
|
951
957
|
const postionY = (15 / 4);
|
|
952
958
|
let m = 0;
|
|
953
959
|
let indexCollection = [];
|
|
954
|
-
const clusters = currentLayer.markerClusterSettings
|
|
960
|
+
const clusters = !allowInnerClusterSetting && currentLayer.markerClusterSettings.allowClustering ?
|
|
961
|
+
currentLayer.markerClusterSettings : markerSetting.clusterSettings;
|
|
962
|
+
const style = clusters.labelStyle;
|
|
955
963
|
const clusterGroup = maps.renderer.createGroup({ id: maps.element.id + '_LayerIndex_' + layerIndex + '_markerCluster' });
|
|
956
964
|
const eventArg = {
|
|
957
965
|
cancel: false, name: markerClusterRendering, fill: clusters.fill, height: clusters.height,
|
|
@@ -967,9 +975,13 @@ function clusterTemplate(currentLayer, markerTemplate, maps, layerIndex, markerC
|
|
|
967
975
|
}
|
|
968
976
|
let isClusteringCompleted = false;
|
|
969
977
|
const currentZoomFactor = !maps.isTileMap ? maps.mapScaleValue : maps.tileZoomLevel;
|
|
978
|
+
const markerGroup = (markerSetting.clusterSettings.allowClustering
|
|
979
|
+
|| (currentLayer.markerClusterSettings.allowClustering && currentLayer.markerSettings.length > 1))
|
|
980
|
+
? markerTemplate.querySelectorAll(`[id*='LayerIndex_${layerIndex}_MarkerIndex_${markerIndex}']:not([id*='_Group'])`)
|
|
981
|
+
: markerTemplate.childNodes;
|
|
970
982
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
971
983
|
maps.trigger('markerClusterRendering', eventArg, (clusterargs) => {
|
|
972
|
-
Array.prototype.forEach.call(
|
|
984
|
+
Array.prototype.forEach.call(markerGroup, (markerElement, o) => {
|
|
973
985
|
indexCollection = [];
|
|
974
986
|
if (markerElement['style']['visibility'] !== 'hidden') {
|
|
975
987
|
tempElement = markerElement;
|
|
@@ -979,19 +991,19 @@ function clusterTemplate(currentLayer, markerTemplate, maps, layerIndex, markerC
|
|
|
979
991
|
const list = (maps.markerModule.zoomedMarkerCluster.length > 0 && maps.markerModule.zoomedMarkerCluster[layerIndex] && maps.markerModule.zoomedMarkerCluster[layerIndex][o] && maps.markerModule.zoomedMarkerCluster[layerIndex][o].length > 0)
|
|
980
992
|
|| (maps.markerModule.initialMarkerCluster.length > 0 && maps.markerModule.initialMarkerCluster[layerIndex] && maps.markerModule.initialMarkerCluster[layerIndex][o] && maps.markerModule.initialMarkerCluster[layerIndex][o].length > 0) ?
|
|
981
993
|
(maps.previousScale < currentZoomFactor ? maps.markerModule.zoomedMarkerCluster[layerIndex][o] : maps.markerModule.initialMarkerCluster[layerIndex][o]) : null;
|
|
982
|
-
if (!isNullOrUndefined(list) && list.length !== 0) {
|
|
994
|
+
if (!isNullOrUndefined(list) && list.length !== 0 && !markerSetting.clusterSettings.allowClustering) {
|
|
983
995
|
Array.prototype.forEach.call(list, (currentIndex) => {
|
|
984
996
|
if (o !== currentIndex) {
|
|
985
997
|
const otherMarkerElement = document.getElementById(maps.element.id + '_LayerIndex_' + layerIndex + '_MarkerIndex_'
|
|
986
|
-
+
|
|
987
|
-
if (otherMarkerElement['style']['visibility'] !== 'hidden') {
|
|
998
|
+
+ markerIndex + '_dataIndex_' + currentIndex);
|
|
999
|
+
if (otherMarkerElement && otherMarkerElement['style']['visibility'] !== 'hidden') {
|
|
988
1000
|
markerBoundsComparer(otherMarkerElement, bounds1, colloideBounds, indexCollection, currentIndex);
|
|
989
1001
|
}
|
|
990
1002
|
}
|
|
991
1003
|
});
|
|
992
1004
|
}
|
|
993
1005
|
else {
|
|
994
|
-
Array.prototype.forEach.call(
|
|
1006
|
+
Array.prototype.forEach.call(markerGroup, (otherMarkerElement, p) => {
|
|
995
1007
|
if (p >= o + 1 && otherMarkerElement['style']['visibility'] !== 'hidden') {
|
|
996
1008
|
markerBoundsComparer(otherMarkerElement, bounds1, colloideBounds, indexCollection, p);
|
|
997
1009
|
}
|
|
@@ -1023,7 +1035,7 @@ function clusterTemplate(currentLayer, markerTemplate, maps, layerIndex, markerC
|
|
|
1023
1035
|
if (!maps.isTileMap) {
|
|
1024
1036
|
location = convertGeoToPoint(latitude, longitude, factor, currentLayer, maps);
|
|
1025
1037
|
}
|
|
1026
|
-
else if (maps.isTileMap
|
|
1038
|
+
else if (maps.isTileMap) {
|
|
1027
1039
|
location = convertTileLatLongToPoint(new Point(longitude, latitude), maps.tileZoomLevel, maps.tileTranslatePoint, true);
|
|
1028
1040
|
}
|
|
1029
1041
|
markerElement['style']['visibility'] = 'hidden';
|
|
@@ -1048,10 +1060,14 @@ function clusterTemplate(currentLayer, markerTemplate, maps, layerIndex, markerC
|
|
|
1048
1060
|
}
|
|
1049
1061
|
tempX = (maps.isTileMap) ? tempX : (markerTemplate.id.indexOf('_Markers_Group') > -1) ? tempX : tempX + postionY - (eventArg.width / 2);
|
|
1050
1062
|
tempY = (maps.isTileMap) ? tempY : (markerTemplate.id.indexOf('_Markers_Group') > -1) ? tempY : tempY - (eventArg.height / 2);
|
|
1051
|
-
if (maps.isTileMap
|
|
1063
|
+
if (maps.isTileMap) {
|
|
1052
1064
|
tempX = location.x;
|
|
1053
1065
|
tempY = location.y;
|
|
1054
1066
|
}
|
|
1067
|
+
else {
|
|
1068
|
+
tempX = (((location.x + ((!isNullOrUndefined(maps.translatePoint) && maps.translatePoint.x !== 0 && !maps.isResize) ? maps.translatePoint.x : translatePoint.location.x)) * (isNullOrUndefined(maps.scale) ? translatePoint.scale : maps.scale)) + markerSetting.offset.x);
|
|
1069
|
+
tempY = (((location.y + ((!isNullOrUndefined(maps.translatePoint) && maps.translatePoint.y !== 0 && !maps.isResize) ? maps.translatePoint.y : translatePoint.location.y)) * (isNullOrUndefined(maps.scale) ? translatePoint.scale : maps.scale)) + markerSetting.offset.y);
|
|
1070
|
+
}
|
|
1055
1071
|
const clusterID = maps.element.id + '_LayerIndex_' + layerIndex + '_MarkerIndex_' + markerIndex + '_dataIndex_' + dataIndex + '_cluster_' + (m);
|
|
1056
1072
|
const labelID = maps.element.id + '_LayerIndex_' + layerIndex + '_MarkerIndex_' + markerIndex + '_dataIndex_' + dataIndex + '_cluster_' + (m) + '_datalabel_' + m;
|
|
1057
1073
|
m++;
|
|
@@ -1066,8 +1082,16 @@ function clusterTemplate(currentLayer, markerTemplate, maps, layerIndex, markerC
|
|
|
1066
1082
|
options = new TextOption(labelID, (0), postionY, 'middle', (colloideBounds.length + 1).toString(), '', '');
|
|
1067
1083
|
textElement = renderTextElement(options, style, style.color, markerCollection);
|
|
1068
1084
|
textElement.setAttribute('transform', 'translate( ' + tempX + ' ' + tempY + ' )');
|
|
1069
|
-
|
|
1070
|
-
|
|
1085
|
+
const eleMarkerIndex = parseFloat(ele.id.split('_MarkerIndex_')[1]);
|
|
1086
|
+
if ((markerSetting.clusterSettings.allowClustering && eleMarkerIndex === markerIndex) ||
|
|
1087
|
+
(currentLayer.markerClusterSettings.allowClustering && currentLayer.markerSettings.length > 1 && eleMarkerIndex === markerIndex)) {
|
|
1088
|
+
clusterGroup.appendChild(ele);
|
|
1089
|
+
clusterGroup.appendChild(textElement);
|
|
1090
|
+
}
|
|
1091
|
+
else {
|
|
1092
|
+
clusterGroup.appendChild(textElement);
|
|
1093
|
+
clusterGroup.appendChild(ele);
|
|
1094
|
+
}
|
|
1071
1095
|
}
|
|
1072
1096
|
}
|
|
1073
1097
|
colloideBounds = [];
|
|
@@ -1080,7 +1104,7 @@ function clusterTemplate(currentLayer, markerTemplate, maps, layerIndex, markerC
|
|
|
1080
1104
|
layerElement.appendChild(clusterGroup);
|
|
1081
1105
|
maps.svgObject.appendChild(layerElement);
|
|
1082
1106
|
maps.element.appendChild(maps.svgObject);
|
|
1083
|
-
if (clusters.allowDeepClustering) {
|
|
1107
|
+
if (clusters.allowDeepClustering && !allowInnerClusterSetting) {
|
|
1084
1108
|
Array.prototype.forEach.call(clusterGroup.childNodes, (clusterElement, o) => {
|
|
1085
1109
|
if (clusterElement['style']['visibility'] !== 'hidden') {
|
|
1086
1110
|
tempElement = clusterElement;
|
|
@@ -1096,7 +1120,16 @@ function clusterTemplate(currentLayer, markerTemplate, maps, layerIndex, markerC
|
|
|
1096
1120
|
clusterColloideBounds.push(tempElement1);
|
|
1097
1121
|
clusterColloideBounds.push(clusterGroup.childNodes[p - 1]);
|
|
1098
1122
|
clusterGroup.childNodes[p]['style']['visibility'] = 'hidden';
|
|
1099
|
-
clusterGroup.childNodes[p
|
|
1123
|
+
let eleMarkerIndex = !isNullOrUndefined(clusterGroup.childNodes[p + 1]) ?
|
|
1124
|
+
parseFloat(clusterGroup.childNodes[p + 1].id.split('_MarkerIndex_')[1]) : null;
|
|
1125
|
+
if ((markerSetting.clusterSettings.allowClustering && eleMarkerIndex === markerIndex) ||
|
|
1126
|
+
(currentLayer.markerClusterSettings.allowClustering && currentLayer.markerSettings.length > 1 && eleMarkerIndex === markerIndex)) {
|
|
1127
|
+
clusterGroup.childNodes[p + 1]['style']['visibility'] = 'hidden';
|
|
1128
|
+
}
|
|
1129
|
+
else {
|
|
1130
|
+
eleMarkerIndex = parseFloat(clusterGroup.childNodes[p - 1].id.split('_MarkerIndex_')[1]);
|
|
1131
|
+
clusterGroup.childNodes[p - 1]['style']['visibility'] = (eleMarkerIndex === markerIndex) ? 'hidden' : clusterGroup.childNodes[p - 1]['style']['visibility'];
|
|
1132
|
+
}
|
|
1100
1133
|
indexCollection.push(p);
|
|
1101
1134
|
}
|
|
1102
1135
|
}
|
|
@@ -1112,7 +1145,16 @@ function clusterTemplate(currentLayer, markerTemplate, maps, layerIndex, markerC
|
|
|
1112
1145
|
else {
|
|
1113
1146
|
tempElement.textContent = tempElement.textContent + ',' + clusterColloideBounds[i].textContent;
|
|
1114
1147
|
}
|
|
1115
|
-
|
|
1148
|
+
let eleMarkerIndex = parseFloat(clusterGroup.childNodes[o + 1].id.split('_MarkerIndex_')[1]);
|
|
1149
|
+
if ((markerSetting.clusterSettings.allowClustering && eleMarkerIndex === markerIndex) ||
|
|
1150
|
+
(currentLayer.markerClusterSettings.allowClustering && currentLayer.markerSettings.length > 1 && eleMarkerIndex === markerIndex)) {
|
|
1151
|
+
clusterGroup.childNodes[o + 1].textContent = ((+(clusterGroup.childNodes[o + 1].textContent)) + (+(clusterColloideBounds[i + 1].textContent))).toString();
|
|
1152
|
+
}
|
|
1153
|
+
else {
|
|
1154
|
+
eleMarkerIndex = parseFloat(clusterGroup.childNodes[o - 1].id.split('_MarkerIndex_')[1]);
|
|
1155
|
+
clusterGroup.childNodes[o - 1].textContent = (eleMarkerIndex === markerIndex) ?
|
|
1156
|
+
((+(clusterGroup.childNodes[o - 1].textContent)) + (+(clusterColloideBounds[i + 1].textContent))).toString() : clusterGroup.childNodes[o - 1].textContent;
|
|
1157
|
+
}
|
|
1116
1158
|
i++;
|
|
1117
1159
|
}
|
|
1118
1160
|
}
|
|
@@ -1122,7 +1164,16 @@ function clusterTemplate(currentLayer, markerTemplate, maps, layerIndex, markerC
|
|
|
1122
1164
|
});
|
|
1123
1165
|
}
|
|
1124
1166
|
while (0 < clusterGroup.childNodes.length) {
|
|
1125
|
-
|
|
1167
|
+
const eleMarkerIndex = parseFloat(clusterGroup.childNodes[0].id.split('_MarkerIndex_')[1]);
|
|
1168
|
+
if ((markerSetting.clusterSettings.allowClustering && eleMarkerIndex === markerIndex) ||
|
|
1169
|
+
(currentLayer.markerClusterSettings.allowClustering && currentLayer.markerSettings.length > 1 && eleMarkerIndex === markerIndex)) {
|
|
1170
|
+
markerCollection.insertBefore(clusterGroup.childNodes[0], null);
|
|
1171
|
+
}
|
|
1172
|
+
else {
|
|
1173
|
+
if (eleMarkerIndex === markerIndex) {
|
|
1174
|
+
markerCollection.insertBefore(clusterGroup.childNodes[0], markerCollection.firstChild);
|
|
1175
|
+
}
|
|
1176
|
+
}
|
|
1126
1177
|
}
|
|
1127
1178
|
if (!check) {
|
|
1128
1179
|
getElementByID(maps.element.id + '_Secondary_Element').appendChild(markerCollection);
|
|
@@ -1228,6 +1279,10 @@ function mergeSeparateCluster(sameMarkerData, maps) {
|
|
|
1228
1279
|
for (let i = 0; i < markerDataLength; i++) {
|
|
1229
1280
|
markerEle = marker.shape === 'Balloon' && isNullOrUndefined(marker.template) ? getElement(markerId + '_dataIndex_' + sameMarkerData[0].data[i]['index'] + '_Group') : getElement(markerId + '_dataIndex_' + sameMarkerData[0].data[i]['index']);
|
|
1230
1281
|
markerEle['style']['visibility'] = 'hidden';
|
|
1282
|
+
if (markerEle.id.indexOf('Group') > -1) {
|
|
1283
|
+
const marker = getElement(markerId + '_dataIndex_' + sameMarkerData[0].data[i]['index']);
|
|
1284
|
+
marker['style']['visibility'] = 'hidden';
|
|
1285
|
+
}
|
|
1231
1286
|
}
|
|
1232
1287
|
removeElement(maps.element.id + '_LayerIndex_' + layerIndex + '_MarkerIndex_' + markerIndex + '_markerClusterConnectorLine');
|
|
1233
1288
|
}
|
|
@@ -1249,17 +1304,22 @@ function clusterSeparate(sameMarkerData, maps, markerElement, isDom) {
|
|
|
1249
1304
|
const getElementFunction = isDom ? getElement : markerElement.querySelector.bind(markerElement);
|
|
1250
1305
|
const getQueryConnect = isDom ? '' : '#';
|
|
1251
1306
|
const markerId = maps.element.id + '_LayerIndex_' + layerIndex + '_MarkerIndex_' + markerIndex;
|
|
1252
|
-
const
|
|
1307
|
+
const layer = maps.layers[layerIndex];
|
|
1308
|
+
const allowInnerClusterSetting = maps.markerModule.allowInnerClusterSetting(layer);
|
|
1309
|
+
const cluster = !allowInnerClusterSetting && layer.markerClusterSettings.allowClustering ?
|
|
1310
|
+
layer.markerClusterSettings : layer.markerSettings[markerIndex].clusterSettings;
|
|
1311
|
+
const marker = layer.markerSettings[markerIndex];
|
|
1253
1312
|
const clusterId = markerId + '_dataIndex_' + dataIndex + '_cluster_' + clusterIndex;
|
|
1254
|
-
const clusterEle =
|
|
1313
|
+
const clusterEle = cluster.shape === 'Balloon' ? getElementFunction(getQueryConnect + '' + clusterId + '_Group') : getElementFunction(getQueryConnect + '' + clusterId);
|
|
1255
1314
|
const clusterEleLabel = getElementFunction(getQueryConnect + '' + clusterId + '_datalabel_' + clusterIndex);
|
|
1256
1315
|
clusterEle.setAttribute('visibility', 'hidden');
|
|
1257
1316
|
clusterEleLabel.setAttribute('visibility', 'hidden');
|
|
1258
1317
|
let markerEle = marker.shape === 'Balloon' && isNullOrUndefined(marker.template) ? getElementFunction(getQueryConnect + '' + markerId + '_dataIndex_' + dataIndex + '_Group') : getElementFunction(getQueryConnect + '' + markerId + '_dataIndex_' + dataIndex);
|
|
1259
1318
|
const height = markerEle.parentElement.id.indexOf('Template_Group') > -1 ? markerEle.getBoundingClientRect().height : marker.height;
|
|
1260
|
-
|
|
1319
|
+
let width = markerEle.parentElement.id.indexOf('Template_Group') > -1 ? markerEle.getBoundingClientRect().width : marker.width;
|
|
1261
1320
|
const centerX = +clusterEle.getAttribute('transform').split('translate(')[1].trim().split(' ')[0];
|
|
1262
1321
|
const centerY = +clusterEle.getAttribute('transform').split('translate(')[1].trim().split(' ')[1].split(')')[0].trim();
|
|
1322
|
+
width = (typeof width === 'string' ? parseFloat(width) : width);
|
|
1263
1323
|
let radius = width + 5;
|
|
1264
1324
|
let area = 2 * 3.14 * radius;
|
|
1265
1325
|
let totalMarker = 0;
|
|
@@ -1302,14 +1362,20 @@ function clusterSeparate(sameMarkerData, maps, markerElement, isDom) {
|
|
|
1302
1362
|
markerEle.setAttribute('transform', 'translate( ' + x1 + ' ' + y1 + ')');
|
|
1303
1363
|
}
|
|
1304
1364
|
markerEle['style']['visibility'] = 'visible';
|
|
1365
|
+
if (markerEle.id.indexOf('Group') > -1) {
|
|
1366
|
+
const marker = getElementFunction(getQueryConnect + '' + markerId + '_dataIndex_' + sameMarkerData[0].data[i]['index']);
|
|
1367
|
+
marker['style']['visibility'] = 'visible';
|
|
1368
|
+
}
|
|
1305
1369
|
newAngle += angle;
|
|
1306
1370
|
}
|
|
1307
|
-
const connectorLine =
|
|
1371
|
+
const connectorLine = cluster.connectorLineSettings;
|
|
1308
1372
|
const options = {
|
|
1309
1373
|
d: path, id: maps.element.id + '_LayerIndex_' + layerIndex + '_MarkerIndex_' + markerIndex + '_dataIndex_' + dataIndex + '_markerClusterConnectorLine', stroke: connectorLine.color,
|
|
1310
1374
|
'fill-opacity': connectorLine.opacity, 'stroke-opacity': connectorLine.opacity, 'stroke-width': connectorLine.width
|
|
1311
1375
|
};
|
|
1312
1376
|
markerElement = isDom ? getElementFunction(maps.element.id + '_Markers_Group') : markerElement;
|
|
1377
|
+
const layerElement = getElementFunction(maps.element.id + '_LayerIndex_' + layerIndex);
|
|
1378
|
+
markerElement = layerElement.querySelector('#' + markerElement.id);
|
|
1313
1379
|
const groupEle = maps.renderer.createGroup({ id: maps.element.id + '_LayerIndex_' + layerIndex + '_MarkerIndex_' + markerIndex + '_markerClusterConnectorLine' });
|
|
1314
1380
|
groupEle.appendChild(maps.renderer.drawPath(options));
|
|
1315
1381
|
if (marker.shape === 'Balloon') {
|
|
@@ -1389,8 +1455,9 @@ function markerTemplate(eventArgs, templateFn, markerID, data, markerIndex, mark
|
|
|
1389
1455
|
for (let i = 0; i < markerElement.children.length; i++) {
|
|
1390
1456
|
markerElement.children[i].style.pointerEvents = 'auto';
|
|
1391
1457
|
}
|
|
1392
|
-
markerElement.style.left = (maps.isTileMap ? location.x : (location.x + transPoint.x) * scale) + offset.x - maps.mapAreaRect.x + 'px';
|
|
1393
|
-
markerElement.style.top = (maps.isTileMap ? location.y : (location.y + transPoint.y) * scale) + offset.y - maps.mapAreaRect.y + 'px';
|
|
1458
|
+
markerElement.style.left = (maps.isTileMap ? location.x : (location.x + transPoint.x) * scale) + offset.x - (maps.isTileMap ? 0 : maps.mapAreaRect.x) + 'px';
|
|
1459
|
+
markerElement.style.top = (maps.isTileMap ? location.y : (location.y + transPoint.y) * scale) + offset.y - (maps.isTileMap ? 0 : maps.mapAreaRect.y) + 'px';
|
|
1460
|
+
markerElement.style.transform = 'translate(-50%, -50%)';
|
|
1394
1461
|
markerTemplate.appendChild(markerElement);
|
|
1395
1462
|
}
|
|
1396
1463
|
return markerTemplate;
|
|
@@ -2455,22 +2522,6 @@ function fixInitialScaleForTile(map) {
|
|
|
2455
2522
|
function getElementByID(id) {
|
|
2456
2523
|
return document.getElementById(id);
|
|
2457
2524
|
}
|
|
2458
|
-
/**
|
|
2459
|
-
* Function to get clientElement from id.
|
|
2460
|
-
*
|
|
2461
|
-
* @param {string} id - Specifies the id
|
|
2462
|
-
* @returns {Element} - Returns the element
|
|
2463
|
-
* @private
|
|
2464
|
-
*/
|
|
2465
|
-
function getClientElement(id) {
|
|
2466
|
-
const element = document.getElementById(id);
|
|
2467
|
-
if (!isNullOrUndefined(element)) {
|
|
2468
|
-
return element.getClientRects()[0];
|
|
2469
|
-
}
|
|
2470
|
-
else {
|
|
2471
|
-
return null;
|
|
2472
|
-
}
|
|
2473
|
-
}
|
|
2474
2525
|
/**
|
|
2475
2526
|
* Function to return the number value for the string value.
|
|
2476
2527
|
*
|
|
@@ -2763,7 +2814,7 @@ function elementAnimate(element, delay, duration, point, maps, ele, radius = 0)
|
|
|
2763
2814
|
const centerX = point.x;
|
|
2764
2815
|
const centerY = point.y;
|
|
2765
2816
|
let height = 0;
|
|
2766
|
-
|
|
2817
|
+
let transform = element.getAttribute('transform') || '';
|
|
2767
2818
|
new Animation({}).animate(element, {
|
|
2768
2819
|
duration: (duration === 0 && animationMode === 'Enable') ? 1000 : duration,
|
|
2769
2820
|
delay: delay,
|
|
@@ -2779,6 +2830,11 @@ function elementAnimate(element, delay, duration, point, maps, ele, radius = 0)
|
|
|
2779
2830
|
element.setAttribute('transform', 'translate( ' + (centerX - (radius * height)) + ' ' + (centerY - (radius * height)) +
|
|
2780
2831
|
' ) scale(' + height + ')');
|
|
2781
2832
|
}
|
|
2833
|
+
else {
|
|
2834
|
+
if (maps.zoomModule.isPanningInProgress) {
|
|
2835
|
+
transform = element.getAttribute('transform');
|
|
2836
|
+
}
|
|
2837
|
+
}
|
|
2782
2838
|
},
|
|
2783
2839
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2784
2840
|
end: (model) => {
|
|
@@ -3710,6 +3766,12 @@ function getShapeColor(theme) {
|
|
|
3710
3766
|
themePalette = ['#10B981', '#22D3EE', '#2DD4BF', '#4ADE80', '#8B5CF6',
|
|
3711
3767
|
'#E879F9', '#F472B6', '#F87171', '#F97316', '#FCD34D'];
|
|
3712
3768
|
break;
|
|
3769
|
+
case 'tailwind3':
|
|
3770
|
+
themePalette = ['#2F4074', '#03B4B4', '#0D72DE', '#FF5733', '#D63384', '#F39C12', '#EF291F', '#91C822'];
|
|
3771
|
+
break;
|
|
3772
|
+
case 'tailwind3dark':
|
|
3773
|
+
themePalette = ['#8029F1', '#1ABC9C', '#0D72DE', '#FF5733', '#D63384', '#F39C12', '#EF291F', '#91C822'];
|
|
3774
|
+
break;
|
|
3713
3775
|
case 'fluent':
|
|
3714
3776
|
themePalette = ['#614570', '#4C6FB1', '#CC6952', '#3F579A', '#4EA09B',
|
|
3715
3777
|
'#6E7A89', '#D4515C', '#E6AF5D', '#639751', '#9D4D69'];
|
|
@@ -4034,6 +4096,72 @@ function getThemeStyle(theme) {
|
|
|
4034
4096
|
zoomButtonRadius: 30
|
|
4035
4097
|
};
|
|
4036
4098
|
break;
|
|
4099
|
+
case 'tailwind3':
|
|
4100
|
+
style = {
|
|
4101
|
+
backgroundColor: 'rgba(255,255,255, 0.0)',
|
|
4102
|
+
areaBackgroundColor: 'rgba(255,255,255, 0.0)',
|
|
4103
|
+
titleFontColor: '#111827',
|
|
4104
|
+
subTitleFontColor: '#111827',
|
|
4105
|
+
legendTitleFontColor: '#111827',
|
|
4106
|
+
legendTextColor: '#6B7280',
|
|
4107
|
+
dataLabelFontColor: '#111827',
|
|
4108
|
+
tooltipFontColor: '#F9FAFB',
|
|
4109
|
+
tooltipFillColor: '#111827',
|
|
4110
|
+
zoomFillColor: '#374151',
|
|
4111
|
+
fontFamily: 'Inter',
|
|
4112
|
+
fontSize: '12px',
|
|
4113
|
+
fontWeight: '400',
|
|
4114
|
+
titleFontSize: '14px',
|
|
4115
|
+
legendFontSize: '12px',
|
|
4116
|
+
tooltipFillOpacity: 1,
|
|
4117
|
+
tooltipTextOpacity: 1,
|
|
4118
|
+
labelFontFamily: 'Inter',
|
|
4119
|
+
titleFontWeight: '500',
|
|
4120
|
+
zoomSelectionColor: '#6B7280',
|
|
4121
|
+
shapeFill: '#F3F4F6',
|
|
4122
|
+
shapeBorderColor: '#E5E7EB',
|
|
4123
|
+
rectangleZoomFillColor: '#818CF8',
|
|
4124
|
+
rectangleZoomFillOpacity: 0.3,
|
|
4125
|
+
rectangleZoomBorderColor: '#4F46E5',
|
|
4126
|
+
legendBorderColor: '#E5E7EB',
|
|
4127
|
+
legendBorderWidth: 0,
|
|
4128
|
+
tooltipBorderColor: '#111827',
|
|
4129
|
+
zoomButtonRadius: 32
|
|
4130
|
+
};
|
|
4131
|
+
break;
|
|
4132
|
+
case 'tailwind3dark':
|
|
4133
|
+
style = {
|
|
4134
|
+
backgroundColor: 'rgba(255,255,255, 0.0)',
|
|
4135
|
+
areaBackgroundColor: 'rgba(255,255,255, 0.0)',
|
|
4136
|
+
titleFontColor: '#FFFFFF',
|
|
4137
|
+
subTitleFontColor: '#FFFFFF',
|
|
4138
|
+
legendTitleFontColor: '#FFFFFF',
|
|
4139
|
+
legendTextColor: '#9CA3AF',
|
|
4140
|
+
dataLabelFontColor: '#FFFFFF',
|
|
4141
|
+
tooltipFontColor: '#1F2937',
|
|
4142
|
+
tooltipFillColor: '#F9FAFB',
|
|
4143
|
+
zoomFillColor: '#D1D5DB',
|
|
4144
|
+
fontFamily: 'Inter',
|
|
4145
|
+
fontSize: '12px',
|
|
4146
|
+
fontWeight: '400',
|
|
4147
|
+
titleFontSize: '14px',
|
|
4148
|
+
legendFontSize: '12px',
|
|
4149
|
+
tooltipFillOpacity: 1,
|
|
4150
|
+
tooltipTextOpacity: 1,
|
|
4151
|
+
labelFontFamily: 'Inter',
|
|
4152
|
+
titleFontWeight: '600',
|
|
4153
|
+
zoomSelectionColor: '#9CA3AF',
|
|
4154
|
+
shapeFill: '#282F3C',
|
|
4155
|
+
shapeBorderColor: '#282F3C',
|
|
4156
|
+
rectangleZoomFillColor: '#3730A3',
|
|
4157
|
+
rectangleZoomFillOpacity: 0.3,
|
|
4158
|
+
rectangleZoomBorderColor: '#6366F1',
|
|
4159
|
+
legendBorderColor: '#282F3C',
|
|
4160
|
+
legendBorderWidth: 0,
|
|
4161
|
+
tooltipBorderColor: '#F9FAFB',
|
|
4162
|
+
zoomButtonRadius: 30
|
|
4163
|
+
};
|
|
4164
|
+
break;
|
|
4037
4165
|
case 'bootstrap5':
|
|
4038
4166
|
style = {
|
|
4039
4167
|
backgroundColor: 'transparent',
|
|
@@ -5238,6 +5366,12 @@ __decorate([
|
|
|
5238
5366
|
__decorate([
|
|
5239
5367
|
Property('#FF471A')
|
|
5240
5368
|
], MarkerBase.prototype, "fill", void 0);
|
|
5369
|
+
__decorate([
|
|
5370
|
+
Property(null)
|
|
5371
|
+
], MarkerBase.prototype, "heightValuePath", void 0);
|
|
5372
|
+
__decorate([
|
|
5373
|
+
Property(null)
|
|
5374
|
+
], MarkerBase.prototype, "widthValuePath", void 0);
|
|
5241
5375
|
__decorate([
|
|
5242
5376
|
Property(10)
|
|
5243
5377
|
], MarkerBase.prototype, "height", void 0);
|
|
@@ -5301,6 +5435,9 @@ __decorate([
|
|
|
5301
5435
|
__decorate([
|
|
5302
5436
|
Collection([], InitialMarkerSelectionSettings)
|
|
5303
5437
|
], MarkerBase.prototype, "initialMarkerSelection", void 0);
|
|
5438
|
+
__decorate([
|
|
5439
|
+
Complex({}, MarkerClusterSettings)
|
|
5440
|
+
], MarkerBase.prototype, "clusterSettings", void 0);
|
|
5304
5441
|
/**
|
|
5305
5442
|
* Gets or sets the options to customize the markers in the maps.
|
|
5306
5443
|
*/
|
|
@@ -5546,6 +5683,12 @@ const markerClusterClick = 'markerClusterClick';
|
|
|
5546
5683
|
* @private
|
|
5547
5684
|
*/
|
|
5548
5685
|
const markerMouseMove = 'markerMouseMove';
|
|
5686
|
+
/**
|
|
5687
|
+
* Specifies the maps mouse move event name.
|
|
5688
|
+
*
|
|
5689
|
+
* @private
|
|
5690
|
+
*/
|
|
5691
|
+
const mouseMove = 'mouseMove';
|
|
5549
5692
|
/**
|
|
5550
5693
|
* Specifies the maps cluster mouse move event name.
|
|
5551
5694
|
*
|
|
@@ -6176,7 +6319,7 @@ class LayerPanel {
|
|
|
6176
6319
|
proxy.renderTileLayer(proxy, layer, layerIndex, bing);
|
|
6177
6320
|
this.mapObject.arrangeTemplate();
|
|
6178
6321
|
if (this.mapObject.zoomModule && (this.mapObject.previousScale !== this.mapObject.scale)) {
|
|
6179
|
-
this.mapObject.zoomModule.applyTransform(this.mapObject, true);
|
|
6322
|
+
this.mapObject.zoomModule.applyTransform(this.mapObject, false, true);
|
|
6180
6323
|
}
|
|
6181
6324
|
}
|
|
6182
6325
|
bubbleCalculation(bubbleSettings, range) {
|
|
@@ -7442,6 +7585,8 @@ let Maps = class Maps extends Component {
|
|
|
7442
7585
|
this.isTileMap = false;
|
|
7443
7586
|
/**
|
|
7444
7587
|
* Resize the map
|
|
7588
|
+
*
|
|
7589
|
+
* @private
|
|
7445
7590
|
*/
|
|
7446
7591
|
this.isResize = false;
|
|
7447
7592
|
/**
|
|
@@ -8024,7 +8169,7 @@ let Maps = class Maps extends Component {
|
|
|
8024
8169
|
}
|
|
8025
8170
|
}
|
|
8026
8171
|
if (this.zoomModule && ((this.previousScale !== this.scale) || this.zoomNotApplied || this.isZoomByPosition)) {
|
|
8027
|
-
this.zoomModule.applyTransform(this, true);
|
|
8172
|
+
this.zoomModule.applyTransform(this, false, true);
|
|
8028
8173
|
}
|
|
8029
8174
|
}
|
|
8030
8175
|
}
|
|
@@ -8085,14 +8230,7 @@ let Maps = class Maps extends Component {
|
|
|
8085
8230
|
-(Math.abs(elementOffset.top - layerOffset.top)) : Math.abs(elementOffset.top - layerOffset.top);
|
|
8086
8231
|
}
|
|
8087
8232
|
Array.prototype.forEach.call(templateGroupEle.childNodes, (currentTemplate) => {
|
|
8088
|
-
if (currentTemplate.id.indexOf('Marker')
|
|
8089
|
-
if (currentTemplate.style.visibility !== 'hidden') {
|
|
8090
|
-
const elementOffset = getElementByID(currentTemplate.id).getBoundingClientRect();
|
|
8091
|
-
currentTemplate.style.left = parseFloat(currentTemplate.style.left) - (this.isTileMap ? 0 : elementOffset.width / 2) + 'px';
|
|
8092
|
-
currentTemplate.style.top = parseFloat(currentTemplate.style.top) - (this.isTileMap ? 0 : elementOffset.height / 2) + 'px';
|
|
8093
|
-
}
|
|
8094
|
-
}
|
|
8095
|
-
else {
|
|
8233
|
+
if (currentTemplate.id.indexOf('Marker') === -1) {
|
|
8096
8234
|
currentTemplate.style.left = parseFloat(currentTemplate.style.left) + offSetLetValue + 'px';
|
|
8097
8235
|
currentTemplate.style.top = parseFloat(currentTemplate.style.top) + offSetTopValue + 'px';
|
|
8098
8236
|
currentTemplate.style.transform = 'translate(-50%, -50%)';
|
|
@@ -8875,6 +9013,7 @@ let Maps = class Maps extends Component {
|
|
|
8875
9013
|
// if (target.id.indexOf('shapeIndex') !== -1 && !this.highlightSettings.enable) {
|
|
8876
9014
|
// triggerShapeEvent(target.id, this.highlightSettings, this, shapeHighlight);
|
|
8877
9015
|
// }
|
|
9016
|
+
this.mouseMoveEvent(e);
|
|
8878
9017
|
if (this.markerModule) {
|
|
8879
9018
|
this.markerModule.markerMove(e);
|
|
8880
9019
|
this.markerModule.markerClusterMouseMove(e);
|
|
@@ -8888,6 +9027,34 @@ let Maps = class Maps extends Component {
|
|
|
8888
9027
|
this.onMouseMove(e);
|
|
8889
9028
|
this.notify(Browser.touchMoveEvent, e);
|
|
8890
9029
|
}
|
|
9030
|
+
/**
|
|
9031
|
+
* To check and trigger mouse move event on maps.
|
|
9032
|
+
*
|
|
9033
|
+
* @param {PointerEvent} e - Specifies the pointer event on maps.
|
|
9034
|
+
* @returns {void}
|
|
9035
|
+
* @private
|
|
9036
|
+
*/
|
|
9037
|
+
mouseMoveEvent(e) {
|
|
9038
|
+
const targetId = e.target.id;
|
|
9039
|
+
let layerIndex;
|
|
9040
|
+
let eventArgs;
|
|
9041
|
+
if (this.isTileMap) {
|
|
9042
|
+
const latLongValue = this.getTileGeoLocation(e['layerX'], e['layerY']);
|
|
9043
|
+
eventArgs = {
|
|
9044
|
+
x: e.clientX, y: e.clientY, latitude: latLongValue.latitude,
|
|
9045
|
+
longitude: latLongValue.longitude, target: e.target
|
|
9046
|
+
};
|
|
9047
|
+
}
|
|
9048
|
+
else {
|
|
9049
|
+
layerIndex = targetId.indexOf('_LayerIndex_') > -1 ? parseInt(targetId.split('_LayerIndex_')[1].split('_')[0], 10) : this.baseLayerIndex;
|
|
9050
|
+
const latLongValue = this.getGeoLocation(layerIndex, e.clientX, e.clientY);
|
|
9051
|
+
eventArgs = {
|
|
9052
|
+
x: e.clientX, y: e.clientY, latitude: latLongValue.latitude,
|
|
9053
|
+
longitude: latLongValue.longitude, target: e.target
|
|
9054
|
+
};
|
|
9055
|
+
}
|
|
9056
|
+
this.trigger(mouseMove, eventArgs);
|
|
9057
|
+
}
|
|
8891
9058
|
/**
|
|
8892
9059
|
* This method is used to perform operations when mouse move event is performed on maps.
|
|
8893
9060
|
*
|
|
@@ -9117,12 +9284,23 @@ let Maps = class Maps extends Component {
|
|
|
9117
9284
|
*/
|
|
9118
9285
|
addMarker(layerIndex, markerCollection) {
|
|
9119
9286
|
if (!this.isDestroyed && !isNullOrUndefined(this.markerModule)) {
|
|
9120
|
-
|
|
9121
|
-
|
|
9122
|
-
|
|
9123
|
-
|
|
9287
|
+
if (!isNullOrUndefined(layerIndex) && !isNullOrUndefined(markerCollection)) {
|
|
9288
|
+
const layerEle = document.getElementById(this.element.id + '_LayerIndex_' + layerIndex);
|
|
9289
|
+
if (markerCollection.length > 0 && layerEle) {
|
|
9290
|
+
for (const newMarker of markerCollection) {
|
|
9291
|
+
this.layersCollection[layerIndex].markerSettings.push(new MarkerSettings(this, 'markerSettings', newMarker));
|
|
9292
|
+
}
|
|
9293
|
+
this.markerModule.markerRender(this, layerEle, layerIndex, this.isTileMap ? this.tileZoomLevel : this.mapLayerPanel['currentFactor'], 'AddMarker');
|
|
9294
|
+
this.arrangeTemplate();
|
|
9295
|
+
}
|
|
9296
|
+
}
|
|
9297
|
+
else {
|
|
9298
|
+
for (let i = 0; i < this.layers.length; i++) {
|
|
9299
|
+
const layerEle = document.getElementById(this.element.id + '_LayerIndex_' + i);
|
|
9300
|
+
this.markerModule.zoomedMarkerCluster[i] = [];
|
|
9301
|
+
this.markerModule.initialMarkerCluster[i] = [];
|
|
9302
|
+
this.markerModule.markerRender(this, layerEle, i, this.isTileMap ? this.tileZoomLevel : this.mapLayerPanel['currentFactor'], null);
|
|
9124
9303
|
}
|
|
9125
|
-
this.markerModule.markerRender(this, layerEle, layerIndex, this.mapLayerPanel['currentFactor'], 'AddMarker');
|
|
9126
9304
|
this.arrangeTemplate();
|
|
9127
9305
|
}
|
|
9128
9306
|
}
|
|
@@ -10102,6 +10280,9 @@ __decorate$1([
|
|
|
10102
10280
|
__decorate$1([
|
|
10103
10281
|
Event()
|
|
10104
10282
|
], Maps.prototype, "markerMouseMove", void 0);
|
|
10283
|
+
__decorate$1([
|
|
10284
|
+
Event()
|
|
10285
|
+
], Maps.prototype, "mouseMove", void 0);
|
|
10105
10286
|
__decorate$1([
|
|
10106
10287
|
Event()
|
|
10107
10288
|
], Maps.prototype, "dataLabelRendering", void 0);
|
|
@@ -10433,7 +10614,6 @@ class Bubble {
|
|
|
10433
10614
|
class Marker {
|
|
10434
10615
|
constructor(maps) {
|
|
10435
10616
|
this.maps = maps;
|
|
10436
|
-
this.trackElements = [];
|
|
10437
10617
|
this.sameMarkerData = [];
|
|
10438
10618
|
this.initialMarkerCluster = [];
|
|
10439
10619
|
this.zoomedMarkerCluster = [];
|
|
@@ -10450,23 +10630,43 @@ class Marker {
|
|
|
10450
10630
|
let templateFn;
|
|
10451
10631
|
let markerCount = 0;
|
|
10452
10632
|
let nullCount = 0;
|
|
10633
|
+
let isMarkerTemplateNewCreation = false;
|
|
10453
10634
|
let markerTemplateCount = 0;
|
|
10454
10635
|
maps.translateType = 'marker';
|
|
10455
10636
|
const currentLayer = maps.layersCollection[layerIndex];
|
|
10456
|
-
|
|
10457
|
-
|
|
10458
|
-
|
|
10459
|
-
|
|
10637
|
+
const markerElement = layerElement.querySelectorAll('#' + maps.element.id + '_Markers_Group');
|
|
10638
|
+
if (markerElement.length > 0) {
|
|
10639
|
+
this.markerSVGObject = markerElement[0];
|
|
10640
|
+
this.markerSVGObject.innerHTML = '';
|
|
10641
|
+
isMarkerTemplateNewCreation = true;
|
|
10642
|
+
}
|
|
10643
|
+
else {
|
|
10644
|
+
this.markerSVGObject = maps.renderer.createGroup({
|
|
10645
|
+
id: maps.element.id + '_Markers_Group',
|
|
10646
|
+
class: 'GroupElement'
|
|
10647
|
+
});
|
|
10648
|
+
}
|
|
10460
10649
|
this.markerSVGObject.style.pointerEvents = 'auto';
|
|
10461
|
-
const
|
|
10462
|
-
|
|
10463
|
-
|
|
10464
|
-
|
|
10465
|
-
|
|
10466
|
-
|
|
10467
|
-
|
|
10468
|
-
|
|
10469
|
-
|
|
10650
|
+
const secondaryElement = getElementByID(maps.element.id + '_Secondary_Element');
|
|
10651
|
+
const markerTemplateElement = secondaryElement.querySelectorAll('#' + maps.element.id + '_LayerIndex_' + layerIndex + '_Markers_Template_Group');
|
|
10652
|
+
let markerTemplateEle;
|
|
10653
|
+
if (markerTemplateElement && markerTemplateElement.length > 0 && markerTemplateElement[0].childElementCount > 0) {
|
|
10654
|
+
markerTemplateEle = getElementByID(maps.element.id + '_LayerIndex_' + layerIndex + '_Markers_Template_Group');
|
|
10655
|
+
markerTemplateEle.innerHTML = '';
|
|
10656
|
+
isMarkerTemplateNewCreation = true;
|
|
10657
|
+
}
|
|
10658
|
+
else {
|
|
10659
|
+
markerTemplateEle = createElement('div', {
|
|
10660
|
+
id: maps.element.id + '_LayerIndex_' + layerIndex + '_Markers_Template_Group',
|
|
10661
|
+
className: maps.element.id + '_template'
|
|
10662
|
+
});
|
|
10663
|
+
markerTemplateEle.style.cssText = 'overflow: hidden; position: absolute;pointer-events: none;' +
|
|
10664
|
+
'top:' + maps.mapAreaRect.y + 'px;' +
|
|
10665
|
+
'left:' + maps.mapAreaRect.x + 'px;' +
|
|
10666
|
+
'height:' + maps.mapAreaRect.height + 'px;' +
|
|
10667
|
+
'width:' + maps.mapAreaRect.width + 'px;';
|
|
10668
|
+
}
|
|
10669
|
+
const allowInnerClusterSetting = this.allowInnerClusterSetting(currentLayer);
|
|
10470
10670
|
const allowAnimation = (currentLayer.animationDuration !== 0 || animationMode === 'Enable') || isNullOrUndefined(maps.zoomModule);
|
|
10471
10671
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10472
10672
|
let translatePoint;
|
|
@@ -10478,13 +10678,20 @@ class Marker {
|
|
|
10478
10678
|
Array.prototype.forEach.call(currentLayer.markerSettings, (markerSettings, markerIndex) => {
|
|
10479
10679
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10480
10680
|
const markerData = markerSettings.dataSource;
|
|
10681
|
+
markerCount = 0;
|
|
10481
10682
|
if (!isNullOrUndefined(markerSettings.dataSource)) {
|
|
10482
10683
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10483
10684
|
Array.prototype.forEach.call(markerData, (data, dataIndex) => {
|
|
10484
10685
|
maps.markerNullCount = markerIndex > 0 && dataIndex === 0 ? 0 : maps.markerNullCount;
|
|
10485
10686
|
let eventArgs = {
|
|
10486
|
-
cancel: false, name: markerRendering, fill: markerSettings.fill,
|
|
10487
|
-
|
|
10687
|
+
cancel: false, name: markerRendering, fill: markerSettings.fill,
|
|
10688
|
+
height: (!isNullOrUndefined(markerSettings.heightValuePath) &&
|
|
10689
|
+
!isNullOrUndefined(data[markerSettings.heightValuePath]) ?
|
|
10690
|
+
data[markerSettings.heightValuePath] : markerSettings.height),
|
|
10691
|
+
width: (!isNullOrUndefined(markerSettings.widthValuePath) &&
|
|
10692
|
+
!isNullOrUndefined(data[markerSettings.widthValuePath]) ?
|
|
10693
|
+
data[markerSettings.widthValuePath] : markerSettings.width),
|
|
10694
|
+
imageUrl: markerSettings.imageUrl, shape: markerSettings.shape,
|
|
10488
10695
|
template: markerSettings.template, data: data, maps: maps, marker: markerSettings,
|
|
10489
10696
|
border: markerSettings.border, colorValuePath: markerSettings.colorValuePath,
|
|
10490
10697
|
shapeValuePath: markerSettings.shapeValuePath, imageUrlValuePath: markerSettings.imageUrlValuePath
|
|
@@ -10510,12 +10717,14 @@ class Marker {
|
|
|
10510
10717
|
const scale = type === 'AddMarker' ? maps.scale : translatePoint['scale'];
|
|
10511
10718
|
const transPoint = type === 'AddMarker' ? maps.translatePoint : translatePoint['location'];
|
|
10512
10719
|
if (eventArgs.template && (!isNaN(location.x) && !isNaN(location.y))) {
|
|
10720
|
+
isMarkerTemplateNewCreation = false;
|
|
10513
10721
|
markerTemplateCount++;
|
|
10514
10722
|
markerTemplate(eventArgs, templateFn, markerID, data, markerIndex, markerTemplateEle, location, transPoint, scale, offset, maps);
|
|
10515
10723
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10516
10724
|
maps.renderReactTemplates();
|
|
10517
10725
|
}
|
|
10518
10726
|
else if (!eventArgs.template && (!isNaN(location.x) && !isNaN(location.y))) {
|
|
10727
|
+
isMarkerTemplateNewCreation = true;
|
|
10519
10728
|
markerCount++;
|
|
10520
10729
|
marker(eventArgs, markerSettings, markerData, dataIndex, location, transPoint, markerID, offset, scale, maps, this.markerSVGObject);
|
|
10521
10730
|
}
|
|
@@ -10527,32 +10736,55 @@ class Marker {
|
|
|
10527
10736
|
maps.markerNullCount + 1 : maps.markerNullCount;
|
|
10528
10737
|
const markerDataLength = markerData.length - maps.markerNullCount;
|
|
10529
10738
|
let isMarkersClustered = false;
|
|
10530
|
-
|
|
10531
|
-
|
|
10532
|
-
|
|
10533
|
-
|
|
10534
|
-
|
|
10739
|
+
const markerGroup = (markerSettings.clusterSettings.allowClustering ||
|
|
10740
|
+
(currentLayer.markerClusterSettings.allowClustering && currentLayer.markerSettings.length > 1))
|
|
10741
|
+
? this.markerSVGObject.querySelectorAll(`[id*='LayerIndex_${layerIndex}_MarkerIndex_${markerIndex}']:not([id*='_Group'])`)
|
|
10742
|
+
: this.markerSVGObject.childNodes;
|
|
10743
|
+
const templateCount = this.markerSVGObject.childNodes === markerGroup ? markerTemplateCount : 0;
|
|
10744
|
+
if (markerGroup.length === (markerDataLength - templateCount - nullCount) && (type !== 'Template')) {
|
|
10745
|
+
if (markerElement.length === 0) {
|
|
10746
|
+
layerElement.appendChild(this.markerSVGObject);
|
|
10747
|
+
}
|
|
10748
|
+
if (markerSettings.clusterSettings.allowClustering || !allowInnerClusterSetting &&
|
|
10749
|
+
currentLayer.markerClusterSettings.allowClustering) {
|
|
10750
|
+
if (markerElement.length === 0) {
|
|
10751
|
+
maps.svgObject.appendChild(this.markerSVGObject);
|
|
10752
|
+
maps.element.appendChild(maps.svgObject);
|
|
10753
|
+
}
|
|
10535
10754
|
if ((currentLayer.urlTemplate.indexOf('openstreetmap') !== -1 && isNullOrUndefined(currentLayer.shapeData))
|
|
10536
10755
|
&& maps.zoomSettings.enable) {
|
|
10537
|
-
isMarkersClustered = clusterTemplate(currentLayer, this.markerSVGObject, maps, layerIndex, this.markerSVGObject, layerElement, true, false);
|
|
10538
|
-
|
|
10756
|
+
isMarkersClustered = clusterTemplate(currentLayer, this.markerSVGObject, maps, layerIndex, markerIndex, this.markerSVGObject, layerElement, true, false, null, allowInnerClusterSetting);
|
|
10757
|
+
if (markerElement.length === 0) {
|
|
10758
|
+
layerElement.appendChild(this.markerSVGObject);
|
|
10759
|
+
}
|
|
10539
10760
|
}
|
|
10540
10761
|
else {
|
|
10541
|
-
isMarkersClustered = clusterTemplate(currentLayer, this.markerSVGObject, maps, layerIndex, this.markerSVGObject, layerElement, true, false);
|
|
10762
|
+
isMarkersClustered = clusterTemplate(currentLayer, this.markerSVGObject, maps, layerIndex, markerIndex, this.markerSVGObject, layerElement, true, false, translatePoint, allowInnerClusterSetting);
|
|
10542
10763
|
}
|
|
10543
10764
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10544
10765
|
maps.renderReactTemplates();
|
|
10545
10766
|
}
|
|
10546
10767
|
}
|
|
10547
|
-
|
|
10548
|
-
|
|
10768
|
+
const markerTemplateGroup = (markerSettings.clusterSettings.allowClustering ||
|
|
10769
|
+
(currentLayer.markerClusterSettings.allowClustering && currentLayer.markerSettings.length > 1))
|
|
10770
|
+
? markerTemplateEle.querySelectorAll(`[id*='LayerIndex_${layerIndex}_MarkerIndex_${markerIndex}']:not([id*='_Group'])`)
|
|
10771
|
+
: markerTemplateEle.childNodes;
|
|
10772
|
+
if (markerTemplateGroup.length === (markerDataLength - markerCount - nullCount) && getElementByID(maps.element.id + '_Secondary_Element')) {
|
|
10773
|
+
if (!isMarkerTemplateNewCreation) {
|
|
10774
|
+
getElementByID(maps.element.id + '_Secondary_Element').appendChild(markerTemplateEle);
|
|
10775
|
+
}
|
|
10549
10776
|
if (maps.checkInitialRender) {
|
|
10550
|
-
if (
|
|
10551
|
-
|
|
10777
|
+
if ((markerSettings.clusterSettings.allowClustering || !allowInnerClusterSetting &&
|
|
10778
|
+
currentLayer.markerClusterSettings.allowClustering) && !isMarkersClustered) {
|
|
10779
|
+
clusterTemplate(currentLayer, markerTemplateEle, maps, layerIndex, markerIndex, this.markerSVGObject, layerElement, false, false, translatePoint, allowInnerClusterSetting);
|
|
10552
10780
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10553
10781
|
maps.renderReactTemplates();
|
|
10554
10782
|
}
|
|
10555
10783
|
}
|
|
10784
|
+
if (currentLayer.markerClusterSettings.allowClustering && markerElement.length > 0) {
|
|
10785
|
+
const layerCollectionEle = getElementByID(maps.element.id + '_Layer_Collections');
|
|
10786
|
+
layerCollectionEle.appendChild(layerElement);
|
|
10787
|
+
}
|
|
10556
10788
|
}
|
|
10557
10789
|
});
|
|
10558
10790
|
});
|
|
@@ -10833,16 +11065,18 @@ class Marker {
|
|
|
10833
11065
|
const markCollection = [];
|
|
10834
11066
|
const clusterCollection = [];
|
|
10835
11067
|
let marker;
|
|
10836
|
-
this.maps.markerClusterExpand = layer.markerClusterSettings.allowClusterExpand;
|
|
10837
11068
|
if (target.indexOf('_MarkerIndex_') > -1) {
|
|
10838
11069
|
const markerIndex = parseInt(id[1].split('_MarkerIndex_')[1].split('_')[0], 10);
|
|
10839
11070
|
const dataIndex = parseInt(id[1].split('_dataIndex_')[1].split('_')[0], 10);
|
|
10840
11071
|
marker = layer.markerSettings[markerIndex];
|
|
11072
|
+
const allowInnerClusterSetting = this.allowInnerClusterSetting(layer);
|
|
11073
|
+
this.maps.markerClusterExpand = !allowInnerClusterSetting && layer.markerClusterSettings.allowClustering ?
|
|
11074
|
+
layer.markerClusterSettings.allowClusterExpand : marker.clusterSettings.allowClusterExpand;
|
|
10841
11075
|
if (!isNaN(markerIndex)) {
|
|
10842
11076
|
data = marker.dataSource[dataIndex];
|
|
10843
11077
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10844
11078
|
let collection = [];
|
|
10845
|
-
if (!marker.template && (target.indexOf('_cluster_') > -1) &&
|
|
11079
|
+
if (!marker.template && (target.indexOf('_cluster_') > -1) && this.maps.markerClusterExpand) {
|
|
10846
11080
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10847
11081
|
Array.prototype.forEach.call(marker.dataSource, (location, index) => {
|
|
10848
11082
|
if (location['latitude'] === data['latitude'] && location['longitude'] === data['longitude']) {
|
|
@@ -10852,8 +11086,10 @@ class Marker {
|
|
|
10852
11086
|
}
|
|
10853
11087
|
if ((target.indexOf('_cluster_') > -1)) {
|
|
10854
11088
|
let isClusterSame = false;
|
|
10855
|
-
const
|
|
10856
|
-
|
|
11089
|
+
const cluster = !allowInnerClusterSetting && layer.markerClusterSettings.allowClustering ?
|
|
11090
|
+
layer.markerClusterSettings : layer.markerSettings[markerIndex].clusterSettings;
|
|
11091
|
+
const clusterElement = document.getElementById(target.indexOf('_datalabel_') > -1 ? cluster.shape === 'Balloon' ? target.split('_datalabel_')[0] + '_Group' : target.split('_datalabel_')[0] : cluster.shape === 'Balloon' ? target + '_Group' : target);
|
|
11092
|
+
const indexes = cluster.shape === 'Balloon' ? clusterElement.children[0].textContent.split(',').map(Number) : clusterElement.textContent.split(',').map(Number);
|
|
10857
11093
|
collection = [];
|
|
10858
11094
|
for (const i of indexes) {
|
|
10859
11095
|
collection.push({ data: marker.dataSource[i], index: i });
|
|
@@ -10922,6 +11158,23 @@ class Marker {
|
|
|
10922
11158
|
};
|
|
10923
11159
|
this.maps.trigger(markerClusterMouseMove, eventArgs);
|
|
10924
11160
|
}
|
|
11161
|
+
/**
|
|
11162
|
+
* This method is used to return whether the clustering is enabled in any marker settings.
|
|
11163
|
+
*
|
|
11164
|
+
* @param {LayerSettings} layer - Specifies the layer settings
|
|
11165
|
+
* @returns {boolean} - Specifies whether the clustering is enabled in any marker settings.
|
|
11166
|
+
* @private
|
|
11167
|
+
*/
|
|
11168
|
+
allowInnerClusterSetting(layer) {
|
|
11169
|
+
let allowInnerClusterSetting = false;
|
|
11170
|
+
for (let markerIndex = 0; markerIndex < layer.markerSettings.length; markerIndex++) {
|
|
11171
|
+
if (layer.markerSettings[markerIndex].clusterSettings.allowClustering) {
|
|
11172
|
+
allowInnerClusterSetting = true;
|
|
11173
|
+
break;
|
|
11174
|
+
}
|
|
11175
|
+
}
|
|
11176
|
+
return allowInnerClusterSetting;
|
|
11177
|
+
}
|
|
10925
11178
|
/**
|
|
10926
11179
|
* @private
|
|
10927
11180
|
* @returns {void}
|
|
@@ -10948,7 +11201,6 @@ class Marker {
|
|
|
10948
11201
|
*/
|
|
10949
11202
|
destroy() {
|
|
10950
11203
|
this.maps = null;
|
|
10951
|
-
this.trackElements = [];
|
|
10952
11204
|
this.markerSVGObject = null;
|
|
10953
11205
|
this.sameMarkerData = [];
|
|
10954
11206
|
this.initialMarkerCluster = [];
|
|
@@ -11811,6 +12063,13 @@ class Legend {
|
|
|
11811
12063
|
else {
|
|
11812
12064
|
legendText = '';
|
|
11813
12065
|
}
|
|
12066
|
+
if (legend.position === 'Left' || legend.position === 'Right') {
|
|
12067
|
+
for (let i = 0; i < this.legendCollection.length; i++) {
|
|
12068
|
+
const legendItem = this.legendCollection[i];
|
|
12069
|
+
const legendTextSize = measureText(legendItem['text'], legend.textStyle);
|
|
12070
|
+
this.textMaxWidth = Math.max(this.textMaxWidth, legendTextSize.width);
|
|
12071
|
+
}
|
|
12072
|
+
}
|
|
11814
12073
|
maxTextHeight = Math.max(maxTextHeight, itemTextSize.height);
|
|
11815
12074
|
maxTextWidth = Math.max(maxTextWidth, itemTextSize.width);
|
|
11816
12075
|
if (itemTextSize.width > 0 && itemTextSize.height > 0) {
|
|
@@ -11820,26 +12079,26 @@ class Legend {
|
|
|
11820
12079
|
(startY - textPadding);
|
|
11821
12080
|
}
|
|
11822
12081
|
else {
|
|
11823
|
-
textX = (position === 'After') ? startX - (
|
|
11824
|
-
: (startX + rectWidth +
|
|
12082
|
+
textX = (position === 'After') ? startX - (this.textMaxWidth / 2) - textPadding
|
|
12083
|
+
: (startX + rectWidth + this.textMaxWidth / 2) + textPadding;
|
|
11825
12084
|
textY = startY + (rectHeight / 2) + (itemTextSize.height / 4);
|
|
11826
12085
|
}
|
|
11827
12086
|
}
|
|
11828
12087
|
if (i === 0) {
|
|
11829
12088
|
itemStartX = (arrangement === 'Horizontal') ? startX : (position === 'After') ?
|
|
11830
|
-
textX - (
|
|
12089
|
+
textX - (this.textMaxWidth / 2) : startX;
|
|
11831
12090
|
itemStartY = (arrangement === 'Horizontal') ? (position === 'After') ? startY :
|
|
11832
12091
|
textY - (itemTextSize.height / 2) : startY;
|
|
11833
12092
|
if (this.legendCollection.length === 1) {
|
|
11834
12093
|
legendWidth = (arrangement === 'Horizontal') ? Math.abs((startX + rectWidth) - itemStartX) :
|
|
11835
|
-
(rectWidth +
|
|
12094
|
+
(rectWidth + this.textMaxWidth + textPadding);
|
|
11836
12095
|
legendHeight = (arrangement === 'Horizontal') ? (rectHeight + (maxTextHeight / 2) + textPadding) :
|
|
11837
12096
|
Math.abs((startY + rectHeight) - itemStartY);
|
|
11838
12097
|
}
|
|
11839
12098
|
}
|
|
11840
12099
|
else if (i === this.legendCollection.length - 1) {
|
|
11841
12100
|
legendWidth = (arrangement === 'Horizontal') ? Math.abs((startX + rectWidth) - itemStartX) :
|
|
11842
|
-
(rectWidth +
|
|
12101
|
+
(rectWidth + this.textMaxWidth + textPadding);
|
|
11843
12102
|
legendHeight = (arrangement === 'Horizontal') ? (rectHeight + (maxTextHeight / 2) + textPadding) :
|
|
11844
12103
|
Math.abs((startY + rectHeight) - itemStartY);
|
|
11845
12104
|
}
|
|
@@ -11851,8 +12110,8 @@ class Legend {
|
|
|
11851
12110
|
shapeBorder: this.legendCollection[i]['shapeBorder']
|
|
11852
12111
|
});
|
|
11853
12112
|
}
|
|
11854
|
-
if (this.legendCollection.length === 1
|
|
11855
|
-
legendHeight =
|
|
12113
|
+
if (this.legendCollection.length === 1) {
|
|
12114
|
+
legendHeight = maxTextHeight + textPadding;
|
|
11856
12115
|
legendWidth = rectWidth;
|
|
11857
12116
|
}
|
|
11858
12117
|
this.legendItemRect = { x: itemStartX, y: itemStartY, width: legendWidth, height: legendHeight };
|
|
@@ -12919,18 +13178,7 @@ class Legend {
|
|
|
12919
13178
|
const spacing = 10;
|
|
12920
13179
|
const trimTitle = textTrim((this.legendItemRect.width + (spacing * 2)), legendTitle, textStyle);
|
|
12921
13180
|
const textSize = measureText(trimTitle, textStyle);
|
|
12922
|
-
|
|
12923
|
-
for (let i = 0; i < this.legendRenderingCollections.length; i++) {
|
|
12924
|
-
if (this.legendRenderingCollections[i].textWidth !== this.legendRenderingCollections[0].textWidth) {
|
|
12925
|
-
sameTextWidth = false;
|
|
12926
|
-
break;
|
|
12927
|
-
}
|
|
12928
|
-
else {
|
|
12929
|
-
sameTextWidth = true;
|
|
12930
|
-
}
|
|
12931
|
-
}
|
|
12932
|
-
this.legendBorderRect = new Rect((map.theme === 'Fluent2HighContrast' && !sameTextWidth && (legend.position === 'Left' || legend.position === 'Right') && legend.mode === 'Interactive')
|
|
12933
|
-
? (this.legendItemRect.x - (spacing * 3)) : (this.legendItemRect.x - spacing), (this.legendItemRect.y - spacing - textSize.height), (this.legendItemRect.width) + (spacing * 2), (this.legendItemRect.height) + (spacing * 2) + textSize.height +
|
|
13181
|
+
this.legendBorderRect = new Rect((this.legendItemRect.x - spacing), (this.legendItemRect.y - spacing - textSize.height), (this.legendItemRect.width) + (spacing * 2), (this.legendItemRect.height) + (spacing * 2) + textSize.height +
|
|
12934
13182
|
(legend.mode === 'Interactive' ? 0 : (this.page !== 0) ? spacing : 0));
|
|
12935
13183
|
const legendBorder = {
|
|
12936
13184
|
color: legend.border.color || this.maps.themeStyle.legendBorderColor, opacity: legend.border.opacity,
|
|
@@ -13842,6 +14090,12 @@ class Legend {
|
|
|
13842
14090
|
this.maps.off(Browser.touchMoveEvent, this.interactiveHandler);
|
|
13843
14091
|
this.maps.off(Browser.touchEndEvent, this.interactiveHandler);
|
|
13844
14092
|
this.maps.off(click, this.legendClick);
|
|
14093
|
+
const pagingElement = document.getElementById(this.maps.element.id + '_Legend_Paging_Group');
|
|
14094
|
+
if (pagingElement) {
|
|
14095
|
+
for (let i = 0; i < pagingElement.childElementCount; i++) {
|
|
14096
|
+
EventHandler.remove(pagingElement.childNodes[i], Browser.touchStartEvent, this.changeNextPage);
|
|
14097
|
+
}
|
|
14098
|
+
}
|
|
13845
14099
|
}
|
|
13846
14100
|
getLegendData(
|
|
13847
14101
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -15043,6 +15297,8 @@ class MapsTooltip {
|
|
|
15043
15297
|
destroy() {
|
|
15044
15298
|
if (!isNullOrUndefined(this.svgTooltip)) {
|
|
15045
15299
|
this.svgTooltip.destroy();
|
|
15300
|
+
this.svgTooltip.controlInstance = null;
|
|
15301
|
+
removeElement(this.maps.element.id + '_mapsTooltip');
|
|
15046
15302
|
}
|
|
15047
15303
|
this.svgTooltip = null;
|
|
15048
15304
|
this.maps = null;
|
|
@@ -15094,10 +15350,11 @@ class Zoom {
|
|
|
15094
15350
|
* @param {Point} position - Specifies the position.
|
|
15095
15351
|
* @param {number} newZoomFactor - Specifies the zoom factor.
|
|
15096
15352
|
* @param {string} type - Specifies the type.
|
|
15353
|
+
* @param {boolean} isMouseWheel - Indicates whether the zoom operation was triggered by the mouse wheel.
|
|
15097
15354
|
* @returns {void}
|
|
15098
15355
|
* @private
|
|
15099
15356
|
*/
|
|
15100
|
-
performZooming(position, newZoomFactor, type) {
|
|
15357
|
+
performZooming(position, newZoomFactor, type, isMouseWheel = false) {
|
|
15101
15358
|
const map = this.maps;
|
|
15102
15359
|
map.previousProjection = newZoomFactor <= 1.5 ? undefined : map.projectionType;
|
|
15103
15360
|
map.defaultState = false;
|
|
@@ -15156,7 +15413,7 @@ class Zoom {
|
|
|
15156
15413
|
map.scale = map.mapScaleValue = map.previousScale;
|
|
15157
15414
|
}
|
|
15158
15415
|
else {
|
|
15159
|
-
this.applyTransform(map);
|
|
15416
|
+
this.applyTransform(map, isMouseWheel);
|
|
15160
15417
|
}
|
|
15161
15418
|
}
|
|
15162
15419
|
else if ((map.isTileMap) && (newZoomFactor >= minZoom && newZoomFactor <= maxZoom)) {
|
|
@@ -15200,7 +15457,7 @@ class Zoom {
|
|
|
15200
15457
|
// element1 = element1;
|
|
15201
15458
|
// }
|
|
15202
15459
|
// }
|
|
15203
|
-
this.applyTransform(this.maps);
|
|
15460
|
+
this.applyTransform(this.maps, isMouseWheel);
|
|
15204
15461
|
if (document.getElementById(this.maps.element.id + '_LayerIndex_1')) {
|
|
15205
15462
|
document.getElementById(this.maps.element.id + '_LayerIndex_1').style.display = 'block';
|
|
15206
15463
|
}
|
|
@@ -15326,7 +15583,7 @@ class Zoom {
|
|
|
15326
15583
|
}
|
|
15327
15584
|
if (!isZoomCancelled) {
|
|
15328
15585
|
map.mapScaleValue = zoomCalculationFactor;
|
|
15329
|
-
this.applyTransform(map, true);
|
|
15586
|
+
this.applyTransform(map, false, true);
|
|
15330
15587
|
this.maps.zoomNotApplied = false;
|
|
15331
15588
|
this.zoomingRect = null;
|
|
15332
15589
|
}
|
|
@@ -15359,6 +15616,7 @@ class Zoom {
|
|
|
15359
15616
|
let zoomCalculationFactor = this.pinchFactor;
|
|
15360
15617
|
let isZoomCancelled;
|
|
15361
15618
|
const prevTilePoint = map.tileTranslatePoint;
|
|
15619
|
+
this.maps.mergeCluster();
|
|
15362
15620
|
if (!map.isTileMap) {
|
|
15363
15621
|
const availSize = map.mapAreaRect;
|
|
15364
15622
|
map.isMarkerZoomCompleted = false;
|
|
@@ -15539,12 +15797,13 @@ class Zoom {
|
|
|
15539
15797
|
}
|
|
15540
15798
|
/**
|
|
15541
15799
|
* @param {Maps} maps - Specifies the Map control
|
|
15800
|
+
* @param {boolean} isMouseWheel - Indicates whether the zoom operation was triggered by the mouse wheel.
|
|
15542
15801
|
* @param {boolean} animate - Specifies the animation is available or not
|
|
15543
15802
|
* @param {boolean} isPanning - Specifies that it is panning or not
|
|
15544
15803
|
* @returns {void}
|
|
15545
15804
|
* @private
|
|
15546
15805
|
*/
|
|
15547
|
-
applyTransform(maps, animate, isPanning) {
|
|
15806
|
+
applyTransform(maps, isMouseWheel, animate, isPanning) {
|
|
15548
15807
|
let layerIndex;
|
|
15549
15808
|
this.templateCount = 0;
|
|
15550
15809
|
let markerStyle;
|
|
@@ -15557,6 +15816,17 @@ class Zoom {
|
|
|
15557
15816
|
if (document.getElementById(maps.element.id + '_mapsTooltip')) {
|
|
15558
15817
|
removeElement(maps.element.id + '_mapsTooltip');
|
|
15559
15818
|
}
|
|
15819
|
+
if (maps.isTileMap) {
|
|
15820
|
+
const element = document.getElementById(maps.element.id + '_svg');
|
|
15821
|
+
if (element) {
|
|
15822
|
+
for (let k = 0; k < maps.layers.length; k++) {
|
|
15823
|
+
const layerElement = element.querySelector('#' + maps.element.id + '_LayerIndex_' + k);
|
|
15824
|
+
if (layerElement) {
|
|
15825
|
+
element.removeChild(layerElement);
|
|
15826
|
+
}
|
|
15827
|
+
}
|
|
15828
|
+
}
|
|
15829
|
+
}
|
|
15560
15830
|
if (this.layerCollectionEle) {
|
|
15561
15831
|
for (let i = 0; i < this.layerCollectionEle.childElementCount; i++) {
|
|
15562
15832
|
const layerElement = this.layerCollectionEle.childNodes[i];
|
|
@@ -15566,6 +15836,7 @@ class Zoom {
|
|
|
15566
15836
|
this.currentLayer = maps.layersCollection[this.index];
|
|
15567
15837
|
const factor = maps.mapLayerPanel.calculateFactor(this.currentLayer);
|
|
15568
15838
|
const elementCount = layerElement.childElementCount;
|
|
15839
|
+
const templateElement = document.getElementById(maps.element.id + '_LayerIndex_' + this.index + '_Markers_Template_Group');
|
|
15569
15840
|
for (let j = 0; j < elementCount; j++) {
|
|
15570
15841
|
let currentEle = layerElement.childNodes[j];
|
|
15571
15842
|
if (!(currentEle.id.indexOf('_Markers_Group') > -1) && (!(currentEle.id.indexOf('_bubble_Group') > -1))
|
|
@@ -15599,17 +15870,16 @@ class Zoom {
|
|
|
15599
15870
|
}
|
|
15600
15871
|
}
|
|
15601
15872
|
else if (currentEle.id.indexOf('_Markers_Group') > -1) {
|
|
15602
|
-
if ((!this.isPanModeEnabled || !isPanning) && !isNullOrUndefined(currentEle.childNodes[0])) {
|
|
15603
|
-
|
|
15873
|
+
if ((!this.isPanModeEnabled || !isPanning) && (!isNullOrUndefined(currentEle.childNodes[0]) || !isNullOrUndefined(templateElement.childNodes[0]))) {
|
|
15874
|
+
const processElement = (!isNullOrUndefined(currentEle.childNodes[0]) ? currentEle.childNodes[0] : templateElement.childNodes[0]);
|
|
15875
|
+
this.markerTranslates(processElement, factor, x, y, scale, 'Marker', layerElement);
|
|
15604
15876
|
}
|
|
15605
15877
|
currentEle = layerElement.childNodes[j];
|
|
15606
|
-
let markerAnimation;
|
|
15607
15878
|
if (!isNullOrUndefined(currentEle) && currentEle.id.indexOf('Markers') !== -1) {
|
|
15608
15879
|
Array.prototype.forEach.call(currentEle.childNodes, (childNode, k) => {
|
|
15609
15880
|
this.markerTranslate(childNode, factor, x, y, scale, 'Marker', animate);
|
|
15610
15881
|
const dataIndex = parseInt(childNode['id'].split('_dataIndex_')[1].split('_')[0], 10);
|
|
15611
15882
|
const markerIndex = parseInt(childNode['id'].split('_MarkerIndex_')[1].split('_')[0], 10);
|
|
15612
|
-
markerAnimation = this.currentLayer.markerSettings[markerIndex].animationDuration > 0 || animationMode === 'Enable';
|
|
15613
15883
|
if (this.currentLayer.markerSettings[markerIndex].initialMarkerSelection.length > 0) {
|
|
15614
15884
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
15615
15885
|
const markerSelectionValues = this.currentLayer.markerSettings[markerIndex].dataSource[dataIndex];
|
|
@@ -15623,16 +15893,12 @@ class Zoom {
|
|
|
15623
15893
|
}
|
|
15624
15894
|
}
|
|
15625
15895
|
if (((this.currentLayer.animationDuration > 0 || animationMode === 'Enable') || ((maps.layersCollection[0].animationDuration > 0 || animationMode === 'Enable') && this.currentLayer.type === 'SubLayer')) && !this.isPanModeEnabled) {
|
|
15626
|
-
if (maps.isTileMap) {
|
|
15627
|
-
|
|
15628
|
-
if (
|
|
15629
|
-
|
|
15896
|
+
if (!maps.isTileMap) {
|
|
15897
|
+
markerStyle = isMouseWheel ? markerStyle : 'visibility:hidden';
|
|
15898
|
+
if (!isNullOrUndefined(markerStyle)) {
|
|
15899
|
+
currentEle.style.cssText = markerStyle;
|
|
15630
15900
|
}
|
|
15631
15901
|
}
|
|
15632
|
-
else {
|
|
15633
|
-
markerStyle = 'visibility:hidden';
|
|
15634
|
-
currentEle.style.cssText = markerStyle;
|
|
15635
|
-
}
|
|
15636
15902
|
}
|
|
15637
15903
|
});
|
|
15638
15904
|
if (this.isPanModeEnabled && maps.markerModule.sameMarkerData.length > 0) {
|
|
@@ -15769,92 +16035,111 @@ class Zoom {
|
|
|
15769
16035
|
removeElement(markerTemplateElements.id);
|
|
15770
16036
|
}
|
|
15771
16037
|
const currentLayers = this.maps.layersCollection[layerIndex];
|
|
16038
|
+
const allowInnerClusterSetting = this.maps.markerModule.allowInnerClusterSetting(currentLayers);
|
|
15772
16039
|
Array.prototype.forEach.call(currentLayers.markerSettings, (markerSettings, markerIndex) => {
|
|
16040
|
+
markerTemplateCounts = 0;
|
|
16041
|
+
markerCounts = 0;
|
|
15773
16042
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
15774
16043
|
const markerDatas = markerSettings.dataSource;
|
|
15775
|
-
|
|
15776
|
-
|
|
15777
|
-
|
|
15778
|
-
|
|
15779
|
-
|
|
15780
|
-
|
|
15781
|
-
|
|
15782
|
-
|
|
15783
|
-
|
|
15784
|
-
|
|
15785
|
-
|
|
15786
|
-
|
|
15787
|
-
|
|
15788
|
-
|
|
15789
|
-
|
|
15790
|
-
|
|
15791
|
-
|
|
15792
|
-
|
|
15793
|
-
|
|
15794
|
-
|
|
15795
|
-
|
|
15796
|
-
Number(getValueFromObject(data, markerSettings.latitudeValuePath)) : !isNullOrUndefined(data['latitude']) ?
|
|
15797
|
-
parseFloat(data['latitude']) : !isNullOrUndefined(data['Latitude']) ? data['Latitude'] : null;
|
|
15798
|
-
const long = (!isNullOrUndefined(markerSettings.longitudeValuePath)) ?
|
|
15799
|
-
Number(getValueFromObject(data, markerSettings.longitudeValuePath)) : !isNullOrUndefined(data['longitude']) ?
|
|
15800
|
-
parseFloat(data['longitude']) : !isNullOrUndefined(data['Longitude']) ? data['Longitude'] : null;
|
|
15801
|
-
const offset = markerSettings.offset;
|
|
15802
|
-
if (!eventArgs.cancel && markerSettings.visible && !isNullOrUndefined(long) && !isNullOrUndefined(lati)) {
|
|
15803
|
-
const markerID = this.maps.element.id + '_LayerIndex_' + layerIndex + '_MarkerIndex_'
|
|
15804
|
-
+ markerIndex + '_dataIndex_' + dataIndex;
|
|
15805
|
-
const location = (this.maps.isTileMap) ? convertTileLatLongToPoint(new MapLocation(long, lati), this.maps.tileZoomLevel, this.maps.tileTranslatePoint, true) : convertGeoToPoint(lati, long, factor, currentLayers, this.maps);
|
|
15806
|
-
const transPoint = { x: x, y: y };
|
|
15807
|
-
if (eventArgs.template && (!isNaN(location.x) && !isNaN(location.y))) {
|
|
15808
|
-
markerTemplateCounts++;
|
|
15809
|
-
markerTemplate(eventArgs, templateFn, markerID, data, markerIndex, markerTemplateElements, location, transPoint, scale, offset, this.maps);
|
|
16044
|
+
if (!isNullOrUndefined(markerDatas)) {
|
|
16045
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16046
|
+
Array.prototype.forEach.call(markerDatas, (data, dataIndex) => {
|
|
16047
|
+
this.maps.markerNullCount = markerIndex >= 0 && dataIndex === 0 ? 0 : this.maps.markerNullCount;
|
|
16048
|
+
let eventArgs = {
|
|
16049
|
+
template: markerSettings.template, data: data, maps: this.maps, marker: markerSettings,
|
|
16050
|
+
cancel: false, name: markerRendering, fill: markerSettings.fill, colorValuePath: markerSettings.colorValuePath,
|
|
16051
|
+
shapeValuePath: markerSettings.shapeValuePath,
|
|
16052
|
+
height: !isNullOrUndefined(markerSettings.heightValuePath) && !isNullOrUndefined(data[markerSettings.heightValuePath])
|
|
16053
|
+
? data[markerSettings.heightValuePath] : markerSettings.height,
|
|
16054
|
+
width: !isNullOrUndefined(markerSettings.widthValuePath) && !isNullOrUndefined(data[markerSettings.widthValuePath])
|
|
16055
|
+
? data[markerSettings.widthValuePath] : markerSettings.width,
|
|
16056
|
+
imageUrl: markerSettings.imageUrl, imageUrlValuePath: markerSettings.imageUrlValuePath, shape: markerSettings.shape,
|
|
16057
|
+
border: markerSettings.border
|
|
16058
|
+
};
|
|
16059
|
+
eventArgs = markerShapeChoose(eventArgs, data);
|
|
16060
|
+
eventArgs = markerColorChoose(eventArgs, data);
|
|
16061
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
16062
|
+
this.maps.trigger('markerRendering', eventArgs, (MarkerArgs) => {
|
|
16063
|
+
if (markerSettings.shapeValuePath !== eventArgs.shapeValuePath) {
|
|
16064
|
+
eventArgs = markerShapeChoose(eventArgs, data);
|
|
15810
16065
|
}
|
|
15811
|
-
|
|
15812
|
-
|
|
15813
|
-
marker(eventArgs, markerSettings, markerDatas, dataIndex, location, transPoint, markerID, offset, scale, this.maps, markerSVGObject);
|
|
16066
|
+
if (markerSettings.colorValuePath !== eventArgs.colorValuePath) {
|
|
16067
|
+
eventArgs = markerColorChoose(eventArgs, data);
|
|
15814
16068
|
}
|
|
15815
|
-
|
|
15816
|
-
|
|
15817
|
-
|
|
15818
|
-
|
|
15819
|
-
|
|
15820
|
-
|
|
15821
|
-
|
|
15822
|
-
|
|
15823
|
-
|
|
15824
|
-
|
|
15825
|
-
const
|
|
15826
|
-
const
|
|
15827
|
-
if (!
|
|
15828
|
-
|
|
16069
|
+
const lati = (!isNullOrUndefined(markerSettings.latitudeValuePath)) ?
|
|
16070
|
+
Number(getValueFromObject(data, markerSettings.latitudeValuePath)) : !isNullOrUndefined(data['latitude']) ?
|
|
16071
|
+
parseFloat(data['latitude']) : !isNullOrUndefined(data['Latitude']) ? data['Latitude'] : null;
|
|
16072
|
+
const long = (!isNullOrUndefined(markerSettings.longitudeValuePath)) ?
|
|
16073
|
+
Number(getValueFromObject(data, markerSettings.longitudeValuePath)) : !isNullOrUndefined(data['longitude']) ?
|
|
16074
|
+
parseFloat(data['longitude']) : !isNullOrUndefined(data['Longitude']) ? data['Longitude'] : null;
|
|
16075
|
+
const offset = markerSettings.offset;
|
|
16076
|
+
if (!eventArgs.cancel && markerSettings.visible && !isNullOrUndefined(long) && !isNullOrUndefined(lati)) {
|
|
16077
|
+
const markerID = this.maps.element.id + '_LayerIndex_' + layerIndex + '_MarkerIndex_'
|
|
16078
|
+
+ markerIndex + '_dataIndex_' + dataIndex;
|
|
16079
|
+
const location = (this.maps.isTileMap) ? convertTileLatLongToPoint(new MapLocation(long, lati), this.maps.tileZoomLevel, this.maps.tileTranslatePoint, true) : convertGeoToPoint(lati, long, factor, currentLayers, this.maps);
|
|
16080
|
+
const transPoint = { x: x, y: y };
|
|
16081
|
+
if (eventArgs.template && (!isNaN(location.x) && !isNaN(location.y))) {
|
|
16082
|
+
markerTemplateCounts++;
|
|
16083
|
+
markerTemplate(eventArgs, templateFn, markerID, data, markerIndex, markerTemplateElements, location, transPoint, scale, offset, this.maps);
|
|
15829
16084
|
}
|
|
15830
|
-
else {
|
|
15831
|
-
|
|
15832
|
-
|
|
16085
|
+
else if (!eventArgs.template && (!isNaN(location.x) && !isNaN(location.y))) {
|
|
16086
|
+
markerCounts++;
|
|
16087
|
+
marker(eventArgs, markerSettings, markerDatas, dataIndex, location, transPoint, markerID, offset, scale, this.maps, markerSVGObject);
|
|
16088
|
+
}
|
|
16089
|
+
}
|
|
16090
|
+
nullCount += (!isNaN(lati) && !isNaN(long)) ? 0 : 1;
|
|
16091
|
+
markerTemplateCounts += (eventArgs.cancel) ? 1 : 0;
|
|
16092
|
+
markerCounts += (eventArgs.cancel) ? 1 : 0;
|
|
16093
|
+
this.maps.markerNullCount = (isNullOrUndefined(lati) || isNullOrUndefined(long))
|
|
16094
|
+
? this.maps.markerNullCount + 1 : this.maps.markerNullCount;
|
|
16095
|
+
const markerDataLength = markerDatas.length - this.maps.markerNullCount;
|
|
16096
|
+
let isMarkersClustered = false;
|
|
16097
|
+
const markerGroup = (markerSettings.clusterSettings.allowClustering
|
|
16098
|
+
|| (currentLayers.markerClusterSettings.allowClustering && currentLayers.markerSettings.length > 1))
|
|
16099
|
+
? markerSVGObject.querySelectorAll(`[id*='LayerIndex_${layerIndex}_MarkerIndex_${markerIndex}']:not([id*='_Group'])`)
|
|
16100
|
+
: markerSVGObject.childNodes;
|
|
16101
|
+
if (markerGroup.length === (markerDataLength - markerTemplateCounts - nullCount) && (type !== 'Template')) {
|
|
16102
|
+
if (this.maps.isTileMap) {
|
|
16103
|
+
const polygonsElement = document.getElementById(this.maps.element.id + '_LayerIndex_' + layerIndex + '_Polygons_Group');
|
|
16104
|
+
const polygonElement = document.getElementById(this.maps.element.id + '_LayerIndex_' + layerIndex + '_Polygon_Group');
|
|
16105
|
+
if (!isNullOrUndefined(polygonsElement)) {
|
|
16106
|
+
polygonsElement.insertAdjacentElement('afterend', markerSVGObject);
|
|
15833
16107
|
}
|
|
15834
16108
|
else {
|
|
15835
|
-
|
|
16109
|
+
if (!isNullOrUndefined(polygonElement)) {
|
|
16110
|
+
polygonElement.insertAdjacentElement('afterend', markerSVGObject);
|
|
16111
|
+
}
|
|
16112
|
+
else {
|
|
16113
|
+
layerElement.insertBefore(markerSVGObject, layerElement.firstElementChild);
|
|
16114
|
+
}
|
|
15836
16115
|
}
|
|
15837
16116
|
}
|
|
16117
|
+
else {
|
|
16118
|
+
layerElement.appendChild(markerSVGObject);
|
|
16119
|
+
}
|
|
16120
|
+
if (currentLayers.markerSettings[markerIndex].clusterSettings.allowClustering ||
|
|
16121
|
+
!allowInnerClusterSetting && currentLayers.markerClusterSettings.allowClustering) {
|
|
16122
|
+
this.maps.svgObject.appendChild(markerSVGObject);
|
|
16123
|
+
this.maps.element.appendChild(this.maps.svgObject);
|
|
16124
|
+
isMarkersClustered = clusterTemplate(currentLayers, markerSVGObject, this.maps, layerIndex, markerIndex, markerSVGObject, layerElement, true, true, null, allowInnerClusterSetting);
|
|
16125
|
+
}
|
|
15838
16126
|
}
|
|
15839
|
-
|
|
15840
|
-
|
|
15841
|
-
|
|
15842
|
-
|
|
15843
|
-
|
|
15844
|
-
this.maps.element.appendChild(
|
|
15845
|
-
|
|
15846
|
-
|
|
15847
|
-
|
|
15848
|
-
|
|
15849
|
-
|
|
15850
|
-
if (scale >= 1) {
|
|
15851
|
-
if (currentLayers.markerClusterSettings.allowClustering && !isMarkersClustered) {
|
|
15852
|
-
clusterTemplate(currentLayers, markerTemplateElements, this.maps, layerIndex, markerSVGObject, layerElement, false, true);
|
|
16127
|
+
const markerTemplateGroup = (markerSettings.clusterSettings.allowClustering
|
|
16128
|
+
|| (currentLayers.markerClusterSettings.allowClustering && currentLayers.markerSettings.length > 1))
|
|
16129
|
+
? markerTemplateElements.querySelectorAll(`[id*='LayerIndex_${layerIndex}_MarkerIndex_${markerIndex}']:not([id*='_Group'])`)
|
|
16130
|
+
: markerTemplateElements.childNodes;
|
|
16131
|
+
if (markerTemplateGroup.length === (markerDataLength - markerCounts - nullCount) && getElementByID(this.maps.element.id + '_Secondary_Element')) {
|
|
16132
|
+
getElementByID(this.maps.element.id + '_Secondary_Element').appendChild(markerTemplateElements);
|
|
16133
|
+
if (scale >= 1) {
|
|
16134
|
+
if ((markerSettings.clusterSettings.allowClustering || !allowInnerClusterSetting &&
|
|
16135
|
+
currentLayers.markerClusterSettings.allowClustering) && !isMarkersClustered) {
|
|
16136
|
+
clusterTemplate(currentLayers, markerTemplateElements, this.maps, layerIndex, markerIndex, markerSVGObject, layerElement, false, true, null, allowInnerClusterSetting);
|
|
16137
|
+
}
|
|
15853
16138
|
}
|
|
15854
16139
|
}
|
|
15855
|
-
}
|
|
16140
|
+
});
|
|
15856
16141
|
});
|
|
15857
|
-
}
|
|
16142
|
+
}
|
|
15858
16143
|
});
|
|
15859
16144
|
}
|
|
15860
16145
|
/**
|
|
@@ -16049,6 +16334,18 @@ class Zoom {
|
|
|
16049
16334
|
}
|
|
16050
16335
|
}
|
|
16051
16336
|
}
|
|
16337
|
+
/**
|
|
16338
|
+
*
|
|
16339
|
+
* @param {Element | HTMLElement} element - Specifies the marker element.
|
|
16340
|
+
* @param {number} factor - Specifies scale factor.
|
|
16341
|
+
* @param {number} x - Specifies the x location of the marker element.
|
|
16342
|
+
* @param {number} y - Specifies the y location of the marker element.
|
|
16343
|
+
* @param {number} scale - Specifies scale factor.
|
|
16344
|
+
* @param {number} type - Specifies the type of the marker processing.
|
|
16345
|
+
* @param {number} animate - Specifies whether the animation is enabled or not.
|
|
16346
|
+
* @returns {void}
|
|
16347
|
+
* @private
|
|
16348
|
+
*/
|
|
16052
16349
|
markerTranslate(element, factor, x, y, scale, type, animate = false) {
|
|
16053
16350
|
const layerIndex = parseInt(element.id.split('_LayerIndex_')[1].split('_')[0], 10);
|
|
16054
16351
|
const markerIndex = parseInt(element.id.split('_MarkerIndex_')[1].split('_')[0], 10);
|
|
@@ -16068,9 +16365,8 @@ class Zoom {
|
|
|
16068
16365
|
const location = (this.maps.isTileMap) ? convertTileLatLongToPoint(new Point(lng, lat), this.maps.tileZoomLevel, this.maps.tileTranslatePoint, true) : convertGeoToPoint(lat, lng, factor, layer, this.maps);
|
|
16069
16366
|
if (this.maps.isTileMap) {
|
|
16070
16367
|
if (type === 'Template') {
|
|
16071
|
-
|
|
16072
|
-
element.style.
|
|
16073
|
-
element.style.top = ((location.y - (templateOffset.height / 2)) + marker.offset.y) + 'px';
|
|
16368
|
+
element.style.left = (location.x + marker.offset.x) + 'px';
|
|
16369
|
+
element.style.top = (location.y + marker.offset.y) + 'px';
|
|
16074
16370
|
}
|
|
16075
16371
|
else {
|
|
16076
16372
|
location.x += marker.offset.x;
|
|
@@ -16090,9 +16386,8 @@ class Zoom {
|
|
|
16090
16386
|
element.style.transform = 'translate(-50%, -50%)';
|
|
16091
16387
|
}
|
|
16092
16388
|
else {
|
|
16093
|
-
|
|
16094
|
-
element.style.
|
|
16095
|
-
element.style.top = ((location.y + y) * scale) + marker.offset.y - this.maps.mapAreaRect.y - (elementOffset.height / 2) + 'px';
|
|
16389
|
+
element.style.left = ((location.x + x) * scale) + marker.offset.x - this.maps.mapAreaRect.x + 'px';
|
|
16390
|
+
element.style.top = ((location.y + y) * scale) + marker.offset.y - this.maps.mapAreaRect.y + 'px';
|
|
16096
16391
|
}
|
|
16097
16392
|
}
|
|
16098
16393
|
else {
|
|
@@ -16179,15 +16474,15 @@ class Zoom {
|
|
|
16179
16474
|
if (!panArgs.cancel) {
|
|
16180
16475
|
if (panningXDirection && panningYDirection) {
|
|
16181
16476
|
map.translatePoint = new Point(x, y);
|
|
16182
|
-
this.applyTransform(map, false, true);
|
|
16477
|
+
this.applyTransform(map, false, false, true);
|
|
16183
16478
|
}
|
|
16184
16479
|
else if (panningXDirection) {
|
|
16185
16480
|
map.translatePoint = new Point(x, map.translatePoint.y);
|
|
16186
|
-
this.applyTransform(map, false, true);
|
|
16481
|
+
this.applyTransform(map, false, false, true);
|
|
16187
16482
|
}
|
|
16188
16483
|
else if (panningYDirection) {
|
|
16189
16484
|
map.translatePoint = new Point(map.translatePoint.x, y);
|
|
16190
|
-
this.applyTransform(map, false, true);
|
|
16485
|
+
this.applyTransform(map, false, false, true);
|
|
16191
16486
|
}
|
|
16192
16487
|
}
|
|
16193
16488
|
this.maps.zoomNotApplied = false;
|
|
@@ -16216,7 +16511,7 @@ class Zoom {
|
|
|
16216
16511
|
};
|
|
16217
16512
|
map.trigger(pan, panArgs);
|
|
16218
16513
|
map.mapLayerPanel.generateTiles(map.tileZoomLevel, map.tileTranslatePoint, 'Pan');
|
|
16219
|
-
this.applyTransform(map, false, true);
|
|
16514
|
+
this.applyTransform(map, false, false, true);
|
|
16220
16515
|
map.translatePoint.x = (map.tileTranslatePoint.x - xDifference) / map.scale;
|
|
16221
16516
|
map.translatePoint.y = (map.tileTranslatePoint.y - yDifference) / map.scale;
|
|
16222
16517
|
}
|
|
@@ -16245,6 +16540,7 @@ class Zoom {
|
|
|
16245
16540
|
const size = map.mapAreaRect;
|
|
16246
16541
|
const translatePoint = map.previousPoint = map.translatePoint;
|
|
16247
16542
|
const prevTilePoint = map.tileTranslatePoint;
|
|
16543
|
+
this.maps.mergeCluster();
|
|
16248
16544
|
map.previousProjection = type === 'Reset' ? undefined : map.projectionType;
|
|
16249
16545
|
zoomFactor = (type === 'ZoomOut') ? (Math.round(zoomFactor) === 1 ? 1 : zoomFactor) : zoomFactor;
|
|
16250
16546
|
zoomFactor = (type === 'Reset') ? minZoom : (Math.round(zoomFactor) === 0) ? 1 : zoomFactor;
|
|
@@ -16285,7 +16581,7 @@ class Zoom {
|
|
|
16285
16581
|
map.scale = map.previousScale;
|
|
16286
16582
|
}
|
|
16287
16583
|
else {
|
|
16288
|
-
this.applyTransform(map, true);
|
|
16584
|
+
this.applyTransform(map, false, true);
|
|
16289
16585
|
}
|
|
16290
16586
|
}
|
|
16291
16587
|
else if ((map.isTileMap) && ((zoomFactor >= minZoom && zoomFactor <= maxZoom) || map.isReset)) {
|
|
@@ -16322,7 +16618,7 @@ class Zoom {
|
|
|
16322
16618
|
map.mapLayerPanel.generateTiles(tileZoomFactor, map.tileTranslatePoint, type);
|
|
16323
16619
|
const animationDuration = this.maps.layersCollection[0].animationDuration === 0 && animationMode === 'Enable' ? 1000 : this.maps.layersCollection[0].animationDuration;
|
|
16324
16620
|
setTimeout(() => {
|
|
16325
|
-
this.applyTransform(this.maps, true);
|
|
16621
|
+
this.applyTransform(this.maps, false, true);
|
|
16326
16622
|
if (document.getElementById(this.maps.element.id + '_LayerIndex_1')) {
|
|
16327
16623
|
document.getElementById(this.maps.element.id + '_LayerIndex_1').style.display = 'block';
|
|
16328
16624
|
}
|
|
@@ -16922,6 +17218,7 @@ class Zoom {
|
|
|
16922
17218
|
const delta = 1;
|
|
16923
17219
|
const staticMaxZoomLevel = map.zoomSettings.maxZoom;
|
|
16924
17220
|
const value = (map.isTileMap) ? prevLevel : prevScale;
|
|
17221
|
+
this.maps.mergeCluster();
|
|
16925
17222
|
if (((position.x > map.mapAreaRect.x) && (position.x < (map.mapAreaRect.x + map.mapAreaRect.width))) &&
|
|
16926
17223
|
(position.y > map.mapAreaRect.y) && position.y < (map.mapAreaRect.y + map.mapAreaRect.height)) {
|
|
16927
17224
|
e.preventDefault();
|
|
@@ -16934,11 +17231,11 @@ class Zoom {
|
|
|
16934
17231
|
map.staticMapZoom = map.tileZoomLevel;
|
|
16935
17232
|
if (map.staticMapZoom > 0 && map.staticMapZoom < staticMaxZoomLevel) {
|
|
16936
17233
|
map.staticMapZoom += 1;
|
|
16937
|
-
this.performZooming(position, (value + delta), direction);
|
|
17234
|
+
this.performZooming(position, (value + delta), direction, true);
|
|
16938
17235
|
}
|
|
16939
17236
|
}
|
|
16940
17237
|
else {
|
|
16941
|
-
this.performZooming(position, (value + delta), direction);
|
|
17238
|
+
this.performZooming(position, (value + delta), direction, true);
|
|
16942
17239
|
}
|
|
16943
17240
|
}
|
|
16944
17241
|
else {
|
|
@@ -16952,7 +17249,7 @@ class Zoom {
|
|
|
16952
17249
|
if (map.staticMapZoom > 1 && map.staticMapZoom < staticMaxZoomLevel) {
|
|
16953
17250
|
map.staticMapZoom -= 1;
|
|
16954
17251
|
}
|
|
16955
|
-
this.performZooming(position, (value - delta), direction);
|
|
17252
|
+
this.performZooming(position, (value - delta), direction, true);
|
|
16956
17253
|
}
|
|
16957
17254
|
}
|
|
16958
17255
|
this.removeToolbarOpacity(map.mapScaleValue, (!this.maps.isDevice ? (!isNullOrUndefined(e.target) ? e.target['id'] :
|
|
@@ -17273,6 +17570,16 @@ class Zoom {
|
|
|
17273
17570
|
this.maps.off(Browser.touchStartEvent, this.mouseDownHandler);
|
|
17274
17571
|
this.maps.off(Browser.touchEndEvent, this.mouseUpHandler);
|
|
17275
17572
|
EventHandler.remove(this.maps.element, this.cancelEvent, this.mouseCancelHandler);
|
|
17573
|
+
const toolbarElement = document.getElementById(this.maps.element.id + '_Zooming_KitCollection');
|
|
17574
|
+
if (toolbarElement) {
|
|
17575
|
+
for (let i = 0; i < toolbarElement.childNodes.length; i++) {
|
|
17576
|
+
if (toolbarElement.childNodes[i].tagName === 'g') {
|
|
17577
|
+
EventHandler.add(toolbarElement.childNodes[i], Browser.touchStartEvent, this.performToolBarAction);
|
|
17578
|
+
EventHandler.add(toolbarElement.childNodes[i], 'mouseover', this.showTooltip);
|
|
17579
|
+
EventHandler.add(toolbarElement.childNodes[i], 'mouseout', this.removeTooltip);
|
|
17580
|
+
}
|
|
17581
|
+
}
|
|
17582
|
+
}
|
|
17276
17583
|
}
|
|
17277
17584
|
/**
|
|
17278
17585
|
* Get module name.
|
|
@@ -17307,7 +17614,6 @@ class Zoom {
|
|
|
17307
17614
|
this.layerCollectionEle = null;
|
|
17308
17615
|
this.currentLayer = null;
|
|
17309
17616
|
this.pinchDistance = null;
|
|
17310
|
-
this.maps = null;
|
|
17311
17617
|
}
|
|
17312
17618
|
}
|
|
17313
17619
|
|
|
@@ -17363,12 +17669,12 @@ class Print {
|
|
|
17363
17669
|
backgroundElement = backgroundElement.childNodes[0];
|
|
17364
17670
|
if (!isNullOrUndefined(backgroundElement)) {
|
|
17365
17671
|
const backgroundColor = backgroundElement.getAttribute('fill');
|
|
17366
|
-
if ((maps.theme === 'Tailwind' || maps.theme === 'Bootstrap5' || maps.theme === 'Fluent' || maps.theme === 'Material3' ||
|
|
17672
|
+
if ((maps.theme === 'Tailwind' || maps.theme === 'Tailwind3' || maps.theme === 'Bootstrap5' || maps.theme === 'Fluent' || maps.theme === 'Material3' ||
|
|
17367
17673
|
maps.theme === 'Fluent2')
|
|
17368
17674
|
&& (backgroundColor === 'rgba(255,255,255, 0.0)' || backgroundColor === 'transparent')) {
|
|
17369
17675
|
backgroundElement.setAttribute('fill', 'rgba(255,255,255, 1)');
|
|
17370
17676
|
}
|
|
17371
|
-
else if ((maps.theme === 'TailwindDark' || maps.theme === 'Bootstrap5Dark' || maps.theme === 'FluentDark' || maps.theme === 'Material3Dark' ||
|
|
17677
|
+
else if ((maps.theme === 'TailwindDark' || maps.theme === 'Tailwind3Dark' || maps.theme === 'Bootstrap5Dark' || maps.theme === 'FluentDark' || maps.theme === 'Material3Dark' ||
|
|
17372
17678
|
maps.theme === 'Fluent2Dark' || maps.theme === 'Fluent2HighContrast')
|
|
17373
17679
|
&& (backgroundColor === 'rgba(255,255,255, 0.0)' || backgroundColor === 'transparent')) {
|
|
17374
17680
|
backgroundElement.setAttribute('fill', 'rgba(0, 0, 0, 1)');
|
|
@@ -17472,11 +17778,11 @@ class ImageExport {
|
|
|
17472
17778
|
const svgObject = getElementByID(maps.element.id + '_svg').cloneNode(true);
|
|
17473
17779
|
const backgroundElement = svgObject.childNodes[0];
|
|
17474
17780
|
const backgroundColor = backgroundElement.getAttribute('fill');
|
|
17475
|
-
if ((maps.theme === 'Tailwind' || maps.theme === 'Bootstrap5' || maps.theme === 'Fluent' || maps.theme === 'Material3' || maps.theme === 'Fluent2')
|
|
17781
|
+
if ((maps.theme === 'Tailwind' || maps.theme === 'Tailwind3' || maps.theme === 'Bootstrap5' || maps.theme === 'Fluent' || maps.theme === 'Material3' || maps.theme === 'Fluent2')
|
|
17476
17782
|
&& (backgroundColor === 'rgba(255,255,255, 0.0)' || backgroundColor === 'transparent')) {
|
|
17477
17783
|
svgObject.childNodes[0].setAttribute('fill', 'rgba(255,255,255, 1)');
|
|
17478
17784
|
}
|
|
17479
|
-
else if ((maps.theme === 'TailwindDark' || maps.theme === 'Bootstrap5Dark' || maps.theme === 'FluentDark' || maps.theme === 'Material3Dark' ||
|
|
17785
|
+
else if ((maps.theme === 'TailwindDark' || maps.theme === 'Tailwind3Dark' || maps.theme === 'Bootstrap5Dark' || maps.theme === 'FluentDark' || maps.theme === 'Material3Dark' ||
|
|
17480
17786
|
maps.theme === 'Fluent2Dark' || maps.theme === 'Fluent2HighContrast')
|
|
17481
17787
|
&& (backgroundColor === 'rgba(255,255,255, 0.0)' || backgroundColor === 'transparent')) {
|
|
17482
17788
|
svgObject.childNodes[0].setAttribute('fill', 'rgba(0, 0, 0, 1)');
|
|
@@ -17532,8 +17838,8 @@ class ImageExport {
|
|
|
17532
17838
|
const tile = document.getElementById(maps.element.id + '_tile_' + (i - 1));
|
|
17533
17839
|
const exportTileImg = new Image();
|
|
17534
17840
|
exportTileImg.crossOrigin = 'Anonymous';
|
|
17535
|
-
const background = maps.background ? maps.background : ((maps.theme === 'Tailwind' || maps.theme === 'Bootstrap5' || maps.theme === 'Fluent' || maps.theme === 'Material3') && (backgroundColor === 'rgba(255,255,255, 0.0)' || backgroundColor === 'transparent')) ? '#ffffff' :
|
|
17536
|
-
(maps.theme === 'TailwindDark' || maps.theme === 'Bootstrap5Dark' || maps.theme === 'FluentDark' || maps.theme === 'Material3Dark') && (backgroundColor === 'rgba(255,255,255, 0.0)' || backgroundColor === 'transparent') ? '#000000' : '#ffffff';
|
|
17841
|
+
const background = maps.background ? maps.background : ((maps.theme === 'Tailwind' || maps.theme === 'Tailwind3' || maps.theme === 'Bootstrap5' || maps.theme === 'Fluent' || maps.theme === 'Material3') && (backgroundColor === 'rgba(255,255,255, 0.0)' || backgroundColor === 'transparent')) ? '#ffffff' :
|
|
17842
|
+
(maps.theme === 'TailwindDark' || maps.theme === 'Tailwind3Dark' || maps.theme === 'Bootstrap5Dark' || maps.theme === 'FluentDark' || maps.theme === 'Material3Dark') && (backgroundColor === 'rgba(255,255,255, 0.0)' || backgroundColor === 'transparent') ? '#000000' : '#ffffff';
|
|
17537
17843
|
ctxt.fillStyle = background;
|
|
17538
17844
|
ctxt.fillRect(0, 0, maps.availableSize.width, maps.availableSize.height);
|
|
17539
17845
|
ctxt.font = maps.titleSettings.textStyle.size + ' Arial';
|
|
@@ -17658,12 +17964,12 @@ class PdfExport {
|
|
|
17658
17964
|
const exportElement = maps.svgObject.cloneNode(true);
|
|
17659
17965
|
const backgroundElement = exportElement.childNodes[0];
|
|
17660
17966
|
const backgroundColor = backgroundElement.getAttribute('fill');
|
|
17661
|
-
if ((maps.theme === 'Tailwind' || maps.theme === 'Bootstrap5' || maps.theme === 'Fluent' || maps.theme === 'Material3' ||
|
|
17967
|
+
if ((maps.theme === 'Tailwind' || maps.theme === 'Tailwind3' || maps.theme === 'Bootstrap5' || maps.theme === 'Fluent' || maps.theme === 'Material3' ||
|
|
17662
17968
|
maps.theme === 'Fluent2')
|
|
17663
17969
|
&& (backgroundColor === 'rgba(255,255,255, 0.0)' || backgroundColor === 'transparent')) {
|
|
17664
17970
|
exportElement.childNodes[0].setAttribute('fill', 'rgba(255,255,255, 1)');
|
|
17665
17971
|
}
|
|
17666
|
-
else if ((maps.theme === 'TailwindDark' || maps.theme === 'Bootstrap5Dark' || maps.theme === 'FluentDark' || maps.theme === 'Material3Dark' ||
|
|
17972
|
+
else if ((maps.theme === 'TailwindDark' || maps.theme === 'Tailwind3Dark' || maps.theme === 'Bootstrap5Dark' || maps.theme === 'FluentDark' || maps.theme === 'Material3Dark' ||
|
|
17667
17973
|
maps.theme === 'Fluent2Dark' || maps.theme === 'Fluent2HighContrast')
|
|
17668
17974
|
&& (backgroundColor === 'rgba(255,255,255, 0.0)' || backgroundColor === 'transparent')) {
|
|
17669
17975
|
exportElement.childNodes[0].setAttribute('fill', 'rgba(0, 0, 0, 1)');
|
|
@@ -17703,8 +18009,8 @@ class PdfExport {
|
|
|
17703
18009
|
const tile = document.getElementById(maps.element.id + '_tile_' + (i - 1));
|
|
17704
18010
|
const tileImg = new Image();
|
|
17705
18011
|
tileImg.crossOrigin = 'Anonymous';
|
|
17706
|
-
const background = maps.background ? maps.background : ((maps.theme === 'Tailwind' || maps.theme === 'Bootstrap5' || maps.theme === 'Fluent' || maps.theme === 'Material3') && (backgroundColor === 'rgba(255,255,255, 0.0)' || backgroundColor === 'transparent')) ? '#ffffff' :
|
|
17707
|
-
(maps.theme === 'TailwindDark' || maps.theme === 'Bootstrap5Dark' || maps.theme === 'FluentDark' || maps.theme === 'Material3Dark') && (backgroundColor === 'rgba(255,255,255, 0.0)' || backgroundColor === 'transparent') ? '#000000' : '#ffffff';
|
|
18012
|
+
const background = maps.background ? maps.background : ((maps.theme === 'Tailwind' || maps.theme === 'Tailwind3' || maps.theme === 'Bootstrap5' || maps.theme === 'Fluent' || maps.theme === 'Material3') && (backgroundColor === 'rgba(255,255,255, 0.0)' || backgroundColor === 'transparent')) ? '#ffffff' :
|
|
18013
|
+
(maps.theme === 'TailwindDark' || maps.theme === 'Tailwind3Dark' || maps.theme === 'Bootstrap5Dark' || maps.theme === 'FluentDark' || maps.theme === 'Material3Dark') && (backgroundColor === 'rgba(255,255,255, 0.0)' || backgroundColor === 'transparent') ? '#000000' : '#ffffff';
|
|
17708
18014
|
ctx.fillStyle = background;
|
|
17709
18015
|
ctx.fillRect(0, 0, maps.availableSize.width, maps.availableSize.height);
|
|
17710
18016
|
ctx.font = maps.titleSettings.textStyle.size + ' Arial';
|
|
@@ -17785,5 +18091,5 @@ class PdfExport {
|
|
|
17785
18091
|
destroy() { }
|
|
17786
18092
|
}
|
|
17787
18093
|
|
|
17788
|
-
export { Annotation, Annotations, Arrow, BingMap, Border, Bubble, BubbleSettings, CenterPosition, CircleOption, ColorMapping, ColorMappingSettings, ColorValue, CommonTitleSettings, ConnectorLineSettings, Coordinate, DataLabel, DataLabelSettings, Font, GeoLocation, Highlight, HighlightSettings, ImageExport, InitialMarkerSelectionSettings, InitialShapeSelectionSettings, Internalize, LayerPanel, LayerSettings, Legend, LegendSettings, Line, LineOption, MapAjax, MapLocation, Maps, MapsAreaSettings, MapsTooltip, Margin, Marker, MarkerBase, MarkerClusterData, MarkerClusterSettings, MarkerSettings, MinMax, NavigationLine, NavigationLineSettings, PathOption, PatternOptions, PdfExport, Point, Polygon, PolygonOption, PolygonSetting, PolygonSettings, PolygonTooltipSettings, PolylineOption, Print, Rect, RectOption, Selection, SelectionSettings, ShapeSettings, Size, SubTitleSettings, TextOption, Tile, TitleSettings, ToggleLegendSettings, TooltipSettings, Zoom, ZoomSettings, ZoomToolbarButtonSettings, ZoomToolbarSettings, ZoomToolbarTooltipSettings, acos, aitoff, animate, animationComplete, annotationRendering, appendShape, beforePrint, bubbleClick, bubbleMouseMove, bubbleRendering, calculateBound, calculateCenterFromPixel, calculatePolygonPath, calculateScale, calculateShapes, calculateSize, calculateZoomLevel, changeBorderWidth, changeNavaigationLineWidth, checkPropertyPath, checkShapeDataFields, click, clusterSeparate, clusterTemplate, compareZoomFactor, convertElement, convertElementFromLabel, convertGeoToPoint, convertStringToValue, convertTileLatLongToPoint, createStyle, createSvg, createTooltip, customizeStyle, dataLabelRendering, degreesToRadians, doubleClick, drawBalloon, drawCircle, drawCross, drawDiamond, drawHorizontalLine, drawLine, drawPath, drawPattern, drawPolygon, drawPolyline, drawRectangle, drawStar, drawSymbol, drawSymbols, drawTriangle, drawVerticalLine, elementAnimate, filter, findMidPointOfPolygon, findPosition, fixInitialScaleForTile, formatValue,
|
|
18094
|
+
export { Annotation, Annotations, Arrow, BingMap, Border, Bubble, BubbleSettings, CenterPosition, CircleOption, ColorMapping, ColorMappingSettings, ColorValue, CommonTitleSettings, ConnectorLineSettings, Coordinate, DataLabel, DataLabelSettings, Font, GeoLocation, Highlight, HighlightSettings, ImageExport, InitialMarkerSelectionSettings, InitialShapeSelectionSettings, Internalize, LayerPanel, LayerSettings, Legend, LegendSettings, Line, LineOption, MapAjax, MapLocation, Maps, MapsAreaSettings, MapsTooltip, Margin, Marker, MarkerBase, MarkerClusterData, MarkerClusterSettings, MarkerSettings, MinMax, NavigationLine, NavigationLineSettings, PathOption, PatternOptions, PdfExport, Point, Polygon, PolygonOption, PolygonSetting, PolygonSettings, PolygonTooltipSettings, PolylineOption, Print, Rect, RectOption, Selection, SelectionSettings, ShapeSettings, Size, SubTitleSettings, TextOption, Tile, TitleSettings, ToggleLegendSettings, TooltipSettings, Zoom, ZoomSettings, ZoomToolbarButtonSettings, ZoomToolbarSettings, ZoomToolbarTooltipSettings, acos, aitoff, animate, animationComplete, annotationRendering, appendShape, beforePrint, bubbleClick, bubbleMouseMove, bubbleRendering, calculateBound, calculateCenterFromPixel, calculatePolygonPath, calculateScale, calculateShapes, calculateSize, calculateZoomLevel, changeBorderWidth, changeNavaigationLineWidth, checkPropertyPath, checkShapeDataFields, click, clusterSeparate, clusterTemplate, compareZoomFactor, convertElement, convertElementFromLabel, convertGeoToPoint, convertStringToValue, convertTileLatLongToPoint, createStyle, createSvg, createTooltip, customizeStyle, dataLabelRendering, degreesToRadians, doubleClick, drawBalloon, drawCircle, drawCross, drawDiamond, drawHorizontalLine, drawLine, drawPath, drawPattern, drawPolygon, drawPolyline, drawRectangle, drawStar, drawSymbol, drawSymbols, drawTriangle, drawVerticalLine, elementAnimate, filter, findMidPointOfPolygon, findPosition, fixInitialScaleForTile, formatValue, getDistance, getElement, getElementByID, getElementOffset, getElementsByClassName, getFieldData, getHexColor, getMousePosition, getProcessedMarginValue, getRatioOfBubble, getShapeData, getTargetElement, getTemplateFunction, getTouchCenter, getTouches, getTranslate, getValueFromObject, getZoomTranslate, isCustomPath, itemHighlight, itemSelection, layerRendering, legendRendering, load, loaded, maintainSelection, maintainStyleClass, maintainToggleSelection, marker, markerBoundsComparer, markerClick, markerClusterClick, markerClusterListHandler, markerClusterMouseMove, markerClusterRendering, markerColorChoose, markerDragEnd, markerDragStart, markerMouseMove, markerRendering, markerShapeChoose, markerTemplate, measureText, measureTextElement, mergeSeparateCluster, mouseMove, mousedown, mousemove, mouseup, onclick, pan, panComplete, processResult, querySelector, radiansToDegrees, removeClass, removeElement, renderLegendShape, renderTextElement, resize, rightClick, roundTo, shapeHighlight, shapeRendering, shapeSelected, showTooltip, sinci, smoothTranslate, stringToNumber, sum, targetTouches, textTrim, timeout, tooltipRender, triggerDownload, triggerItemSelectionEvent, triggerShapeEvent, wordWrap, xToCoordinate, yToCoordinate, zoomAnimate, zoomComplete, zoomIn, zoomOut };
|
|
17789
18095
|
//# sourceMappingURL=ej2-maps.es2015.js.map
|