@syncfusion/ej2-maps 27.1.56 → 28.1.33
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 +37 -0
- 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 +528 -224
- package/dist/es6/ej2-maps.es2015.js.map +1 -1
- package/dist/es6/ej2-maps.es5.js +537 -233
- 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/legend.d.ts +1 -1
- package/src/maps/layers/legend.js +40 -38
- 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 +53 -15
- 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 +13 -1
- package/src/maps/user-interaction/zoom.js +139 -91
- 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
package/src/maps/utils/helper.js
CHANGED
|
@@ -458,6 +458,7 @@ export function measureTextElement(text, font) {
|
|
|
458
458
|
var metrics = context.measureText(text);
|
|
459
459
|
var width = metrics.width;
|
|
460
460
|
var height = parseFloat(font.size) || 16;
|
|
461
|
+
canvas = null;
|
|
461
462
|
return new Size(width, height);
|
|
462
463
|
}
|
|
463
464
|
/**
|
|
@@ -1000,14 +1001,19 @@ function updateImageUrl(eventArgs, data) {
|
|
|
1000
1001
|
* @param {HTMLElement | Element} markerTemplate - Specifies the marker template
|
|
1001
1002
|
* @param {Maps} maps - Specifies the instance of the maps
|
|
1002
1003
|
* @param {number} layerIndex - Specifies the layer index
|
|
1004
|
+
* @param {number} markerIndex - Specifies the marker index
|
|
1003
1005
|
* @param {Element} markerCollection - Specifies the marker collection
|
|
1004
1006
|
* @param {Element} layerElement - Specifies the layer element
|
|
1005
1007
|
* @param {boolean} check - Specifies the boolean value
|
|
1006
1008
|
* @param {boolean} zoomCheck - Specifies the boolean value
|
|
1009
|
+
* @param {any} translatePoint - Specifies the data
|
|
1010
|
+
* @param {boolean} allowInnerClusterSetting - Specifies the boolean value
|
|
1007
1011
|
* @returns {boolean} -Returns boolean for cluster completion
|
|
1008
1012
|
* @private
|
|
1009
1013
|
*/
|
|
1010
|
-
export function clusterTemplate(currentLayer, markerTemplate, maps, layerIndex,
|
|
1014
|
+
export function clusterTemplate(currentLayer, markerTemplate, maps, layerIndex, markerIndex, markerCollection,
|
|
1015
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1016
|
+
layerElement, check, zoomCheck, translatePoint, allowInnerClusterSetting) {
|
|
1011
1017
|
var bounds1;
|
|
1012
1018
|
var bounds2;
|
|
1013
1019
|
var colloideBounds = [];
|
|
@@ -1016,7 +1022,7 @@ export function clusterTemplate(currentLayer, markerTemplate, maps, layerIndex,
|
|
|
1016
1022
|
var tempY = 0;
|
|
1017
1023
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1018
1024
|
var data;
|
|
1019
|
-
var
|
|
1025
|
+
var markerSetting = currentLayer.markerSettings[markerIndex];
|
|
1020
1026
|
var options;
|
|
1021
1027
|
var textElement;
|
|
1022
1028
|
var tempElement1;
|
|
@@ -1026,7 +1032,9 @@ export function clusterTemplate(currentLayer, markerTemplate, maps, layerIndex,
|
|
|
1026
1032
|
var postionY = (15 / 4);
|
|
1027
1033
|
var m = 0;
|
|
1028
1034
|
var indexCollection = [];
|
|
1029
|
-
var clusters = currentLayer.markerClusterSettings
|
|
1035
|
+
var clusters = !allowInnerClusterSetting && currentLayer.markerClusterSettings.allowClustering ?
|
|
1036
|
+
currentLayer.markerClusterSettings : markerSetting.clusterSettings;
|
|
1037
|
+
var style = clusters.labelStyle;
|
|
1030
1038
|
var clusterGroup = maps.renderer.createGroup({ id: maps.element.id + '_LayerIndex_' + layerIndex + '_markerCluster' });
|
|
1031
1039
|
var eventArg = {
|
|
1032
1040
|
cancel: false, name: markerClusterRendering, fill: clusters.fill, height: clusters.height,
|
|
@@ -1042,9 +1050,13 @@ export function clusterTemplate(currentLayer, markerTemplate, maps, layerIndex,
|
|
|
1042
1050
|
}
|
|
1043
1051
|
var isClusteringCompleted = false;
|
|
1044
1052
|
var currentZoomFactor = !maps.isTileMap ? maps.mapScaleValue : maps.tileZoomLevel;
|
|
1053
|
+
var markerGroup = (markerSetting.clusterSettings.allowClustering
|
|
1054
|
+
|| (currentLayer.markerClusterSettings.allowClustering && currentLayer.markerSettings.length > 1))
|
|
1055
|
+
? markerTemplate.querySelectorAll("[id*='LayerIndex_" + layerIndex + "_MarkerIndex_" + markerIndex + "']:not([id*='_Group'])")
|
|
1056
|
+
: markerTemplate.childNodes;
|
|
1045
1057
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1046
1058
|
maps.trigger('markerClusterRendering', eventArg, function (clusterargs) {
|
|
1047
|
-
Array.prototype.forEach.call(
|
|
1059
|
+
Array.prototype.forEach.call(markerGroup, function (markerElement, o) {
|
|
1048
1060
|
indexCollection = [];
|
|
1049
1061
|
if (markerElement['style']['visibility'] !== 'hidden') {
|
|
1050
1062
|
tempElement = markerElement;
|
|
@@ -1054,19 +1066,19 @@ export function clusterTemplate(currentLayer, markerTemplate, maps, layerIndex,
|
|
|
1054
1066
|
var list = (maps.markerModule.zoomedMarkerCluster.length > 0 && maps.markerModule.zoomedMarkerCluster[layerIndex] && maps.markerModule.zoomedMarkerCluster[layerIndex][o] && maps.markerModule.zoomedMarkerCluster[layerIndex][o].length > 0)
|
|
1055
1067
|
|| (maps.markerModule.initialMarkerCluster.length > 0 && maps.markerModule.initialMarkerCluster[layerIndex] && maps.markerModule.initialMarkerCluster[layerIndex][o] && maps.markerModule.initialMarkerCluster[layerIndex][o].length > 0) ?
|
|
1056
1068
|
(maps.previousScale < currentZoomFactor ? maps.markerModule.zoomedMarkerCluster[layerIndex][o] : maps.markerModule.initialMarkerCluster[layerIndex][o]) : null;
|
|
1057
|
-
if (!isNullOrUndefined(list) && list.length !== 0) {
|
|
1069
|
+
if (!isNullOrUndefined(list) && list.length !== 0 && !markerSetting.clusterSettings.allowClustering) {
|
|
1058
1070
|
Array.prototype.forEach.call(list, function (currentIndex) {
|
|
1059
1071
|
if (o !== currentIndex) {
|
|
1060
1072
|
var otherMarkerElement = document.getElementById(maps.element.id + '_LayerIndex_' + layerIndex + '_MarkerIndex_'
|
|
1061
|
-
+
|
|
1062
|
-
if (otherMarkerElement['style']['visibility'] !== 'hidden') {
|
|
1073
|
+
+ markerIndex + '_dataIndex_' + currentIndex);
|
|
1074
|
+
if (otherMarkerElement && otherMarkerElement['style']['visibility'] !== 'hidden') {
|
|
1063
1075
|
markerBoundsComparer(otherMarkerElement, bounds1, colloideBounds, indexCollection, currentIndex);
|
|
1064
1076
|
}
|
|
1065
1077
|
}
|
|
1066
1078
|
});
|
|
1067
1079
|
}
|
|
1068
1080
|
else {
|
|
1069
|
-
Array.prototype.forEach.call(
|
|
1081
|
+
Array.prototype.forEach.call(markerGroup, function (otherMarkerElement, p) {
|
|
1070
1082
|
if (p >= o + 1 && otherMarkerElement['style']['visibility'] !== 'hidden') {
|
|
1071
1083
|
markerBoundsComparer(otherMarkerElement, bounds1, colloideBounds, indexCollection, p);
|
|
1072
1084
|
}
|
|
@@ -1082,23 +1094,23 @@ export function clusterTemplate(currentLayer, markerTemplate, maps, layerIndex,
|
|
|
1082
1094
|
tempY = (tempY - ((maps.availableSize.height <= containerRect['height']) ?
|
|
1083
1095
|
containerRect['top'] : (containerRect['bottom'] - containerRect['top'])));
|
|
1084
1096
|
var dataIndex = parseInt(markerElement['id'].split('_dataIndex_')[1].split('_')[0], 10);
|
|
1085
|
-
var
|
|
1086
|
-
var
|
|
1097
|
+
var markerIndex_1 = parseInt(markerElement['id'].split('_MarkerIndex_')[1].split('_')[0], 10);
|
|
1098
|
+
var markerSetting_1 = currentLayer.markerSettings[markerIndex_1];
|
|
1087
1099
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1088
|
-
var markerData =
|
|
1100
|
+
var markerData = markerSetting_1.dataSource[dataIndex];
|
|
1089
1101
|
var location_1;
|
|
1090
|
-
var longitude = (!isNullOrUndefined(
|
|
1091
|
-
Number(getValueFromObject(markerData,
|
|
1102
|
+
var longitude = (!isNullOrUndefined(markerSetting_1.longitudeValuePath)) ?
|
|
1103
|
+
Number(getValueFromObject(markerData, markerSetting_1.longitudeValuePath)) :
|
|
1092
1104
|
!isNullOrUndefined(markerData['longitude']) ? parseFloat(markerData['longitude']) :
|
|
1093
1105
|
!isNullOrUndefined(markerData['Longitude']) ? parseFloat(markerData['Longitude']) : 0;
|
|
1094
|
-
var latitude = (!isNullOrUndefined(
|
|
1095
|
-
Number(getValueFromObject(markerData,
|
|
1106
|
+
var latitude = (!isNullOrUndefined(markerSetting_1.latitudeValuePath)) ?
|
|
1107
|
+
Number(getValueFromObject(markerData, markerSetting_1.latitudeValuePath)) :
|
|
1096
1108
|
!isNullOrUndefined(markerData['latitude']) ? parseFloat(markerData['latitude']) :
|
|
1097
1109
|
!isNullOrUndefined(markerData['Latitude']) ? parseFloat(markerData['Latitude']) : 0;
|
|
1098
1110
|
if (!maps.isTileMap) {
|
|
1099
1111
|
location_1 = convertGeoToPoint(latitude, longitude, factor, currentLayer, maps);
|
|
1100
1112
|
}
|
|
1101
|
-
else if (maps.isTileMap
|
|
1113
|
+
else if (maps.isTileMap) {
|
|
1102
1114
|
location_1 = convertTileLatLongToPoint(new Point(longitude, latitude), maps.tileZoomLevel, maps.tileTranslatePoint, true);
|
|
1103
1115
|
}
|
|
1104
1116
|
markerElement['style']['visibility'] = 'hidden';
|
|
@@ -1123,12 +1135,16 @@ export function clusterTemplate(currentLayer, markerTemplate, maps, layerIndex,
|
|
|
1123
1135
|
}
|
|
1124
1136
|
tempX = (maps.isTileMap) ? tempX : (markerTemplate.id.indexOf('_Markers_Group') > -1) ? tempX : tempX + postionY - (eventArg.width / 2);
|
|
1125
1137
|
tempY = (maps.isTileMap) ? tempY : (markerTemplate.id.indexOf('_Markers_Group') > -1) ? tempY : tempY - (eventArg.height / 2);
|
|
1126
|
-
if (maps.isTileMap
|
|
1138
|
+
if (maps.isTileMap) {
|
|
1127
1139
|
tempX = location_1.x;
|
|
1128
1140
|
tempY = location_1.y;
|
|
1129
1141
|
}
|
|
1130
|
-
|
|
1131
|
-
|
|
1142
|
+
else {
|
|
1143
|
+
tempX = (((location_1.x + ((!isNullOrUndefined(maps.translatePoint) && maps.translatePoint.x !== 0 && !maps.isResize) ? maps.translatePoint.x : translatePoint.location.x)) * (isNullOrUndefined(maps.scale) ? translatePoint.scale : maps.scale)) + markerSetting_1.offset.x);
|
|
1144
|
+
tempY = (((location_1.y + ((!isNullOrUndefined(maps.translatePoint) && maps.translatePoint.y !== 0 && !maps.isResize) ? maps.translatePoint.y : translatePoint.location.y)) * (isNullOrUndefined(maps.scale) ? translatePoint.scale : maps.scale)) + markerSetting_1.offset.y);
|
|
1145
|
+
}
|
|
1146
|
+
var clusterID = maps.element.id + '_LayerIndex_' + layerIndex + '_MarkerIndex_' + markerIndex_1 + '_dataIndex_' + dataIndex + '_cluster_' + (m);
|
|
1147
|
+
var labelID = maps.element.id + '_LayerIndex_' + layerIndex + '_MarkerIndex_' + markerIndex_1 + '_dataIndex_' + dataIndex + '_cluster_' + (m) + '_datalabel_' + m;
|
|
1132
1148
|
m++;
|
|
1133
1149
|
var ele = drawSymbols(shapeCustom['shape'], shapeCustom['imageUrl'], { x: 0, y: 0 }, clusterID, shapeCustom, markerCollection, maps);
|
|
1134
1150
|
ele.setAttribute('transform', 'translate( ' + tempX + ' ' + tempY + ' )');
|
|
@@ -1141,8 +1157,16 @@ export function clusterTemplate(currentLayer, markerTemplate, maps, layerIndex,
|
|
|
1141
1157
|
options = new TextOption(labelID, (0), postionY, 'middle', (colloideBounds.length + 1).toString(), '', '');
|
|
1142
1158
|
textElement = renderTextElement(options, style, style.color, markerCollection);
|
|
1143
1159
|
textElement.setAttribute('transform', 'translate( ' + tempX + ' ' + tempY + ' )');
|
|
1144
|
-
|
|
1145
|
-
|
|
1160
|
+
var eleMarkerIndex = parseFloat(ele.id.split('_MarkerIndex_')[1]);
|
|
1161
|
+
if ((markerSetting_1.clusterSettings.allowClustering && eleMarkerIndex === markerIndex_1) ||
|
|
1162
|
+
(currentLayer.markerClusterSettings.allowClustering && currentLayer.markerSettings.length > 1 && eleMarkerIndex === markerIndex_1)) {
|
|
1163
|
+
clusterGroup.appendChild(ele);
|
|
1164
|
+
clusterGroup.appendChild(textElement);
|
|
1165
|
+
}
|
|
1166
|
+
else {
|
|
1167
|
+
clusterGroup.appendChild(textElement);
|
|
1168
|
+
clusterGroup.appendChild(ele);
|
|
1169
|
+
}
|
|
1146
1170
|
}
|
|
1147
1171
|
}
|
|
1148
1172
|
colloideBounds = [];
|
|
@@ -1155,7 +1179,7 @@ export function clusterTemplate(currentLayer, markerTemplate, maps, layerIndex,
|
|
|
1155
1179
|
layerElement.appendChild(clusterGroup);
|
|
1156
1180
|
maps.svgObject.appendChild(layerElement);
|
|
1157
1181
|
maps.element.appendChild(maps.svgObject);
|
|
1158
|
-
if (clusters.allowDeepClustering) {
|
|
1182
|
+
if (clusters.allowDeepClustering && !allowInnerClusterSetting) {
|
|
1159
1183
|
Array.prototype.forEach.call(clusterGroup.childNodes, function (clusterElement, o) {
|
|
1160
1184
|
if (clusterElement['style']['visibility'] !== 'hidden') {
|
|
1161
1185
|
tempElement = clusterElement;
|
|
@@ -1171,7 +1195,16 @@ export function clusterTemplate(currentLayer, markerTemplate, maps, layerIndex,
|
|
|
1171
1195
|
clusterColloideBounds.push(tempElement1);
|
|
1172
1196
|
clusterColloideBounds.push(clusterGroup.childNodes[p - 1]);
|
|
1173
1197
|
clusterGroup.childNodes[p]['style']['visibility'] = 'hidden';
|
|
1174
|
-
clusterGroup.childNodes[p
|
|
1198
|
+
var eleMarkerIndex = !isNullOrUndefined(clusterGroup.childNodes[p + 1]) ?
|
|
1199
|
+
parseFloat(clusterGroup.childNodes[p + 1].id.split('_MarkerIndex_')[1]) : null;
|
|
1200
|
+
if ((markerSetting.clusterSettings.allowClustering && eleMarkerIndex === markerIndex) ||
|
|
1201
|
+
(currentLayer.markerClusterSettings.allowClustering && currentLayer.markerSettings.length > 1 && eleMarkerIndex === markerIndex)) {
|
|
1202
|
+
clusterGroup.childNodes[p + 1]['style']['visibility'] = 'hidden';
|
|
1203
|
+
}
|
|
1204
|
+
else {
|
|
1205
|
+
eleMarkerIndex = parseFloat(clusterGroup.childNodes[p - 1].id.split('_MarkerIndex_')[1]);
|
|
1206
|
+
clusterGroup.childNodes[p - 1]['style']['visibility'] = (eleMarkerIndex === markerIndex) ? 'hidden' : clusterGroup.childNodes[p - 1]['style']['visibility'];
|
|
1207
|
+
}
|
|
1175
1208
|
indexCollection.push(p);
|
|
1176
1209
|
}
|
|
1177
1210
|
}
|
|
@@ -1187,7 +1220,16 @@ export function clusterTemplate(currentLayer, markerTemplate, maps, layerIndex,
|
|
|
1187
1220
|
else {
|
|
1188
1221
|
tempElement.textContent = tempElement.textContent + ',' + clusterColloideBounds[i].textContent;
|
|
1189
1222
|
}
|
|
1190
|
-
|
|
1223
|
+
var eleMarkerIndex = parseFloat(clusterGroup.childNodes[o + 1].id.split('_MarkerIndex_')[1]);
|
|
1224
|
+
if ((markerSetting.clusterSettings.allowClustering && eleMarkerIndex === markerIndex) ||
|
|
1225
|
+
(currentLayer.markerClusterSettings.allowClustering && currentLayer.markerSettings.length > 1 && eleMarkerIndex === markerIndex)) {
|
|
1226
|
+
clusterGroup.childNodes[o + 1].textContent = ((+(clusterGroup.childNodes[o + 1].textContent)) + (+(clusterColloideBounds[i + 1].textContent))).toString();
|
|
1227
|
+
}
|
|
1228
|
+
else {
|
|
1229
|
+
eleMarkerIndex = parseFloat(clusterGroup.childNodes[o - 1].id.split('_MarkerIndex_')[1]);
|
|
1230
|
+
clusterGroup.childNodes[o - 1].textContent = (eleMarkerIndex === markerIndex) ?
|
|
1231
|
+
((+(clusterGroup.childNodes[o - 1].textContent)) + (+(clusterColloideBounds[i + 1].textContent))).toString() : clusterGroup.childNodes[o - 1].textContent;
|
|
1232
|
+
}
|
|
1191
1233
|
i++;
|
|
1192
1234
|
}
|
|
1193
1235
|
}
|
|
@@ -1197,7 +1239,16 @@ export function clusterTemplate(currentLayer, markerTemplate, maps, layerIndex,
|
|
|
1197
1239
|
});
|
|
1198
1240
|
}
|
|
1199
1241
|
while (0 < clusterGroup.childNodes.length) {
|
|
1200
|
-
|
|
1242
|
+
var eleMarkerIndex = parseFloat(clusterGroup.childNodes[0].id.split('_MarkerIndex_')[1]);
|
|
1243
|
+
if ((markerSetting.clusterSettings.allowClustering && eleMarkerIndex === markerIndex) ||
|
|
1244
|
+
(currentLayer.markerClusterSettings.allowClustering && currentLayer.markerSettings.length > 1 && eleMarkerIndex === markerIndex)) {
|
|
1245
|
+
markerCollection.insertBefore(clusterGroup.childNodes[0], null);
|
|
1246
|
+
}
|
|
1247
|
+
else {
|
|
1248
|
+
if (eleMarkerIndex === markerIndex) {
|
|
1249
|
+
markerCollection.insertBefore(clusterGroup.childNodes[0], markerCollection.firstChild);
|
|
1250
|
+
}
|
|
1251
|
+
}
|
|
1201
1252
|
}
|
|
1202
1253
|
if (!check) {
|
|
1203
1254
|
getElementByID(maps.element.id + '_Secondary_Element').appendChild(markerCollection);
|
|
@@ -1303,6 +1354,10 @@ export function mergeSeparateCluster(sameMarkerData, maps) {
|
|
|
1303
1354
|
for (var i = 0; i < markerDataLength; i++) {
|
|
1304
1355
|
markerEle = marker.shape === 'Balloon' && isNullOrUndefined(marker.template) ? getElement(markerId + '_dataIndex_' + sameMarkerData[0].data[i]['index'] + '_Group') : getElement(markerId + '_dataIndex_' + sameMarkerData[0].data[i]['index']);
|
|
1305
1356
|
markerEle['style']['visibility'] = 'hidden';
|
|
1357
|
+
if (markerEle.id.indexOf('Group') > -1) {
|
|
1358
|
+
var marker_1 = getElement(markerId + '_dataIndex_' + sameMarkerData[0].data[i]['index']);
|
|
1359
|
+
marker_1['style']['visibility'] = 'hidden';
|
|
1360
|
+
}
|
|
1306
1361
|
}
|
|
1307
1362
|
removeElement(maps.element.id + '_LayerIndex_' + layerIndex + '_MarkerIndex_' + markerIndex + '_markerClusterConnectorLine');
|
|
1308
1363
|
}
|
|
@@ -1324,9 +1379,13 @@ export function clusterSeparate(sameMarkerData, maps, markerElement, isDom) {
|
|
|
1324
1379
|
var getElementFunction = isDom ? getElement : markerElement.querySelector.bind(markerElement);
|
|
1325
1380
|
var getQueryConnect = isDom ? '' : '#';
|
|
1326
1381
|
var markerId = maps.element.id + '_LayerIndex_' + layerIndex + '_MarkerIndex_' + markerIndex;
|
|
1327
|
-
var
|
|
1382
|
+
var layer = maps.layers[layerIndex];
|
|
1383
|
+
var allowInnerClusterSetting = maps.markerModule.allowInnerClusterSetting(layer);
|
|
1384
|
+
var cluster = !allowInnerClusterSetting && layer.markerClusterSettings.allowClustering ?
|
|
1385
|
+
layer.markerClusterSettings : layer.markerSettings[markerIndex].clusterSettings;
|
|
1386
|
+
var marker = layer.markerSettings[markerIndex];
|
|
1328
1387
|
var clusterId = markerId + '_dataIndex_' + dataIndex + '_cluster_' + clusterIndex;
|
|
1329
|
-
var clusterEle =
|
|
1388
|
+
var clusterEle = cluster.shape === 'Balloon' ? getElementFunction(getQueryConnect + '' + clusterId + '_Group') : getElementFunction(getQueryConnect + '' + clusterId);
|
|
1330
1389
|
var clusterEleLabel = getElementFunction(getQueryConnect + '' + clusterId + '_datalabel_' + clusterIndex);
|
|
1331
1390
|
clusterEle.setAttribute('visibility', 'hidden');
|
|
1332
1391
|
clusterEleLabel.setAttribute('visibility', 'hidden');
|
|
@@ -1335,6 +1394,7 @@ export function clusterSeparate(sameMarkerData, maps, markerElement, isDom) {
|
|
|
1335
1394
|
var width = markerEle.parentElement.id.indexOf('Template_Group') > -1 ? markerEle.getBoundingClientRect().width : marker.width;
|
|
1336
1395
|
var centerX = +clusterEle.getAttribute('transform').split('translate(')[1].trim().split(' ')[0];
|
|
1337
1396
|
var centerY = +clusterEle.getAttribute('transform').split('translate(')[1].trim().split(' ')[1].split(')')[0].trim();
|
|
1397
|
+
width = (typeof width === 'string' ? parseFloat(width) : width);
|
|
1338
1398
|
var radius = width + 5;
|
|
1339
1399
|
var area = 2 * 3.14 * radius;
|
|
1340
1400
|
var totalMarker = 0;
|
|
@@ -1377,14 +1437,20 @@ export function clusterSeparate(sameMarkerData, maps, markerElement, isDom) {
|
|
|
1377
1437
|
markerEle.setAttribute('transform', 'translate( ' + x1 + ' ' + y1 + ')');
|
|
1378
1438
|
}
|
|
1379
1439
|
markerEle['style']['visibility'] = 'visible';
|
|
1440
|
+
if (markerEle.id.indexOf('Group') > -1) {
|
|
1441
|
+
var marker_2 = getElementFunction(getQueryConnect + '' + markerId + '_dataIndex_' + sameMarkerData[0].data[i]['index']);
|
|
1442
|
+
marker_2['style']['visibility'] = 'visible';
|
|
1443
|
+
}
|
|
1380
1444
|
newAngle += angle;
|
|
1381
1445
|
}
|
|
1382
|
-
var connectorLine =
|
|
1446
|
+
var connectorLine = cluster.connectorLineSettings;
|
|
1383
1447
|
var options = {
|
|
1384
1448
|
d: path, id: maps.element.id + '_LayerIndex_' + layerIndex + '_MarkerIndex_' + markerIndex + '_dataIndex_' + dataIndex + '_markerClusterConnectorLine', stroke: connectorLine.color,
|
|
1385
1449
|
'fill-opacity': connectorLine.opacity, 'stroke-opacity': connectorLine.opacity, 'stroke-width': connectorLine.width
|
|
1386
1450
|
};
|
|
1387
1451
|
markerElement = isDom ? getElementFunction(maps.element.id + '_Markers_Group') : markerElement;
|
|
1452
|
+
var layerElement = getElementFunction(maps.element.id + '_LayerIndex_' + layerIndex);
|
|
1453
|
+
markerElement = layerElement.querySelector('#' + markerElement.id);
|
|
1388
1454
|
var groupEle = maps.renderer.createGroup({ id: maps.element.id + '_LayerIndex_' + layerIndex + '_MarkerIndex_' + markerIndex + '_markerClusterConnectorLine' });
|
|
1389
1455
|
groupEle.appendChild(maps.renderer.drawPath(options));
|
|
1390
1456
|
if (marker.shape === 'Balloon') {
|
|
@@ -1464,8 +1530,9 @@ export function markerTemplate(eventArgs, templateFn, markerID, data, markerInde
|
|
|
1464
1530
|
for (var i = 0; i < markerElement.children.length; i++) {
|
|
1465
1531
|
markerElement.children[i].style.pointerEvents = 'auto';
|
|
1466
1532
|
}
|
|
1467
|
-
markerElement.style.left = (maps.isTileMap ? location.x : (location.x + transPoint.x) * scale) + offset.x - maps.mapAreaRect.x + 'px';
|
|
1468
|
-
markerElement.style.top = (maps.isTileMap ? location.y : (location.y + transPoint.y) * scale) + offset.y - maps.mapAreaRect.y + 'px';
|
|
1533
|
+
markerElement.style.left = (maps.isTileMap ? location.x : (location.x + transPoint.x) * scale) + offset.x - (maps.isTileMap ? 0 : maps.mapAreaRect.x) + 'px';
|
|
1534
|
+
markerElement.style.top = (maps.isTileMap ? location.y : (location.y + transPoint.y) * scale) + offset.y - (maps.isTileMap ? 0 : maps.mapAreaRect.y) + 'px';
|
|
1535
|
+
markerElement.style.transform = 'translate(-50%, -50%)';
|
|
1469
1536
|
markerTemplate.appendChild(markerElement);
|
|
1470
1537
|
}
|
|
1471
1538
|
return markerTemplate;
|
|
@@ -2533,22 +2600,6 @@ export function fixInitialScaleForTile(map) {
|
|
|
2533
2600
|
export function getElementByID(id) {
|
|
2534
2601
|
return document.getElementById(id);
|
|
2535
2602
|
}
|
|
2536
|
-
/**
|
|
2537
|
-
* Function to get clientElement from id.
|
|
2538
|
-
*
|
|
2539
|
-
* @param {string} id - Specifies the id
|
|
2540
|
-
* @returns {Element} - Returns the element
|
|
2541
|
-
* @private
|
|
2542
|
-
*/
|
|
2543
|
-
export function getClientElement(id) {
|
|
2544
|
-
var element = document.getElementById(id);
|
|
2545
|
-
if (!isNullOrUndefined(element)) {
|
|
2546
|
-
return element.getClientRects()[0];
|
|
2547
|
-
}
|
|
2548
|
-
else {
|
|
2549
|
-
return null;
|
|
2550
|
-
}
|
|
2551
|
-
}
|
|
2552
2603
|
/**
|
|
2553
2604
|
* Function to return the number value for the string value.
|
|
2554
2605
|
*
|
|
@@ -2858,6 +2909,11 @@ export function elementAnimate(element, delay, duration, point, maps, ele, radiu
|
|
|
2858
2909
|
element.setAttribute('transform', 'translate( ' + (centerX - (radius * height)) + ' ' + (centerY - (radius * height)) +
|
|
2859
2910
|
' ) scale(' + height + ')');
|
|
2860
2911
|
}
|
|
2912
|
+
else {
|
|
2913
|
+
if (maps.zoomModule.isPanningInProgress) {
|
|
2914
|
+
transform = element.getAttribute('transform');
|
|
2915
|
+
}
|
|
2916
|
+
}
|
|
2861
2917
|
},
|
|
2862
2918
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2863
2919
|
end: function (model) {
|