@syncfusion/ej2-maps 24.2.9 → 25.1.35
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/CHANGELOG.md +12 -2
- package/dist/ej2-maps.min.js +2 -2
- package/dist/ej2-maps.umd.min.js +2 -2
- package/dist/ej2-maps.umd.min.js.map +1 -1
- package/dist/es6/ej2-maps.es2015.js +646 -331
- package/dist/es6/ej2-maps.es2015.js.map +1 -1
- package/dist/es6/ej2-maps.es5.js +660 -346
- package/dist/es6/ej2-maps.es5.js.map +1 -1
- package/dist/global/ej2-maps.min.js +2 -2
- package/dist/global/ej2-maps.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +13 -13
- package/src/maps/layers/bubble.js +2 -3
- package/src/maps/layers/color-mapping.d.ts +0 -1
- package/src/maps/layers/color-mapping.js +0 -1
- package/src/maps/layers/data-label.js +19 -17
- package/src/maps/layers/layer-panel.js +13 -7
- package/src/maps/layers/legend.js +11 -3
- package/src/maps/layers/marker.d.ts +4 -0
- package/src/maps/layers/marker.js +16 -13
- package/src/maps/layers/polygon.d.ts +0 -1
- package/src/maps/layers/polygon.js +1 -4
- package/src/maps/maps-model.d.ts +14 -0
- package/src/maps/maps.d.ts +14 -2
- package/src/maps/maps.js +118 -46
- package/src/maps/model/base-model.d.ts +51 -0
- package/src/maps/model/base.d.ts +43 -1
- package/src/maps/model/base.js +32 -0
- package/src/maps/model/constants.d.ts +12 -0
- package/src/maps/model/constants.js +12 -0
- package/src/maps/model/interface.d.ts +8 -0
- package/src/maps/user-interaction/tooltip.js +151 -110
- package/src/maps/user-interaction/zoom.d.ts +3 -5
- package/src/maps/user-interaction/zoom.js +198 -106
- package/src/maps/utils/helper.d.ts +7 -1
- package/src/maps/utils/helper.js +89 -37
- package/.github/PULL_REQUEST_TEMPLATE/Bug.md +0 -72
- package/.github/PULL_REQUEST_TEMPLATE/Feature.md +0 -49
package/dist/es6/ej2-maps.es5.js
CHANGED
|
@@ -416,28 +416,26 @@ var GeoLocation = /** @__PURE__ @class */ (function () {
|
|
|
416
416
|
function measureText(text, font) {
|
|
417
417
|
var measureObject = document.getElementById('mapsmeasuretext');
|
|
418
418
|
if (measureObject === null) {
|
|
419
|
-
measureObject = createElement('text'
|
|
419
|
+
measureObject = document.createElement('text');
|
|
420
|
+
measureObject.id = 'mapsmeasuretext';
|
|
420
421
|
document.body.appendChild(measureObject);
|
|
421
422
|
}
|
|
422
423
|
measureObject.innerText = text;
|
|
423
|
-
measureObject.style.
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
}
|
|
427
|
-
else {
|
|
428
|
-
measureObject.style.fontSize = font.size;
|
|
429
|
-
}
|
|
430
|
-
measureObject.style.fontWeight = font.fontWeight;
|
|
431
|
-
measureObject.style.fontStyle = font.fontStyle;
|
|
432
|
-
measureObject.style.fontFamily = font.fontFamily;
|
|
433
|
-
measureObject.style.visibility = 'hidden';
|
|
434
|
-
measureObject.style.top = '-100';
|
|
435
|
-
measureObject.style.left = '0';
|
|
436
|
-
measureObject.style.whiteSpace = 'nowrap';
|
|
437
|
-
// For bootstrap line height issue
|
|
438
|
-
measureObject.style.lineHeight = 'normal';
|
|
424
|
+
measureObject.style.cssText = 'position: absolute; font-size: ' + (typeof (font.size) === 'number' ? (font.size + 'px') : font.size) +
|
|
425
|
+
'; font-weight: ' + font.fontWeight + '; font-style: ' + font.fontStyle + '; font-family: ' + font.fontFamily +
|
|
426
|
+
'; visibility: hidden; top: -100; left: 0; whiteSpace: nowrap; lineHeight: normal';
|
|
439
427
|
return new Size(measureObject.clientWidth, measureObject.clientHeight);
|
|
440
428
|
}
|
|
429
|
+
/** @private */
|
|
430
|
+
function measureTextElement(text, font) {
|
|
431
|
+
var canvas = document.createElement('canvas');
|
|
432
|
+
var context = canvas.getContext('2d');
|
|
433
|
+
context.font = font.fontStyle + " " + font.fontWeight + " " + (typeof font.size === 'number' ? font.size + 'px' : font.size) + " " + font.fontFamily;
|
|
434
|
+
var metrics = context.measureText(text);
|
|
435
|
+
var width = metrics.width;
|
|
436
|
+
var height = parseFloat(font.size) || 16;
|
|
437
|
+
return new Size(width, height);
|
|
438
|
+
}
|
|
441
439
|
/**
|
|
442
440
|
* Internal use of text options
|
|
443
441
|
*
|
|
@@ -984,6 +982,7 @@ function clusterTemplate(currentLayer, markerTemplate, maps, layerIndex, markerC
|
|
|
984
982
|
factor = maps.mapLayerPanel.calculateFactor(currentLayer);
|
|
985
983
|
}
|
|
986
984
|
var isClusteringCompleted = false;
|
|
985
|
+
var currentZoomFactor = !maps.isTileMap ? maps.mapScaleValue : maps.tileZoomLevel;
|
|
987
986
|
maps.trigger('markerClusterRendering', eventArg, function (clusterargs) {
|
|
988
987
|
Array.prototype.forEach.call(markerTemplate.childNodes, function (markerElement, o) {
|
|
989
988
|
indexCollection = [];
|
|
@@ -992,20 +991,28 @@ function clusterTemplate(currentLayer, markerTemplate, maps, layerIndex, markerC
|
|
|
992
991
|
bounds1 = tempElement.getBoundingClientRect();
|
|
993
992
|
indexCollection.push(o);
|
|
994
993
|
if (!isNullOrUndefined(bounds1)) {
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
indexCollection
|
|
994
|
+
var list = (maps.markerModule.zoomedMarkerCluster.length > 0 && maps.markerModule.zoomedMarkerCluster[layerIndex] && maps.markerModule.zoomedMarkerCluster[layerIndex][o] && maps.markerModule.zoomedMarkerCluster[layerIndex][o].length > 0)
|
|
995
|
+
|| (maps.markerModule.initialMarkerCluster.length > 0 && maps.markerModule.initialMarkerCluster[layerIndex] && maps.markerModule.initialMarkerCluster[layerIndex][o] && maps.markerModule.initialMarkerCluster[layerIndex][o].length > 0) ?
|
|
996
|
+
(maps.previousScale < currentZoomFactor ? maps.markerModule.zoomedMarkerCluster[layerIndex][o] : maps.markerModule.initialMarkerCluster[layerIndex][o]) : null;
|
|
997
|
+
if (!isNullOrUndefined(list) && list.length !== 0) {
|
|
998
|
+
Array.prototype.forEach.call(list, function (currentIndex, p) {
|
|
999
|
+
if (o !== currentIndex) {
|
|
1000
|
+
var otherMarkerElement = document.getElementById(maps.element.id + '_LayerIndex_' + layerIndex + '_MarkerIndex_'
|
|
1001
|
+
+ 0 + '_dataIndex_' + currentIndex);
|
|
1002
|
+
if (otherMarkerElement['style']['visibility'] !== 'hidden') {
|
|
1003
|
+
markerBoundsComparer(otherMarkerElement, bounds1, colloideBounds, indexCollection, currentIndex);
|
|
1005
1004
|
}
|
|
1006
1005
|
}
|
|
1007
|
-
}
|
|
1008
|
-
}
|
|
1006
|
+
});
|
|
1007
|
+
}
|
|
1008
|
+
else {
|
|
1009
|
+
Array.prototype.forEach.call(markerTemplate.childNodes, function (otherMarkerElement, p) {
|
|
1010
|
+
if (p >= o + 1 && otherMarkerElement['style']['visibility'] !== 'hidden') {
|
|
1011
|
+
markerBoundsComparer(otherMarkerElement, bounds1, colloideBounds, indexCollection, p);
|
|
1012
|
+
}
|
|
1013
|
+
});
|
|
1014
|
+
}
|
|
1015
|
+
markerClusterListHandler(maps, currentZoomFactor, layerIndex, o, indexCollection);
|
|
1009
1016
|
tempX = bounds1.left + bounds1.width / 2;
|
|
1010
1017
|
tempY = bounds1.top + bounds1.height;
|
|
1011
1018
|
if (colloideBounds.length > 0) {
|
|
@@ -1080,6 +1087,9 @@ function clusterTemplate(currentLayer, markerTemplate, maps, layerIndex, markerC
|
|
|
1080
1087
|
}
|
|
1081
1088
|
colloideBounds = [];
|
|
1082
1089
|
}
|
|
1090
|
+
else {
|
|
1091
|
+
markerClusterListHandler(maps, currentZoomFactor, layerIndex, o, indexCollection);
|
|
1092
|
+
}
|
|
1083
1093
|
isClusteringCompleted = true;
|
|
1084
1094
|
});
|
|
1085
1095
|
layerElement.appendChild(clusterGroup);
|
|
@@ -1168,6 +1178,30 @@ function clusterTemplate(currentLayer, markerTemplate, maps, layerIndex, markerC
|
|
|
1168
1178
|
});
|
|
1169
1179
|
return isClusteringCompleted;
|
|
1170
1180
|
}
|
|
1181
|
+
/** @private */
|
|
1182
|
+
function markerClusterListHandler(maps, currentZoomFactor, layerIndex, index, indexCollection) {
|
|
1183
|
+
if (currentZoomFactor == 1) {
|
|
1184
|
+
var initialMarkerClusterList = isNullOrUndefined(maps.markerModule.initialMarkerCluster[layerIndex][index]) ? [] : indexCollection.length > 1 ? indexCollection : [];
|
|
1185
|
+
maps.markerModule.initialMarkerCluster[layerIndex][index] = initialMarkerClusterList;
|
|
1186
|
+
var zoomedMarkerClusterList = isNullOrUndefined(maps.markerModule.zoomedMarkerCluster[layerIndex][index]) ? [] : indexCollection.length > 1 ? indexCollection : [];
|
|
1187
|
+
maps.markerModule.zoomedMarkerCluster[layerIndex][index] = zoomedMarkerClusterList;
|
|
1188
|
+
}
|
|
1189
|
+
else if (currentZoomFactor > 1) {
|
|
1190
|
+
maps.markerModule.zoomedMarkerCluster[layerIndex][index] = indexCollection.length > 1 ? indexCollection : [];
|
|
1191
|
+
}
|
|
1192
|
+
}
|
|
1193
|
+
/** @private */
|
|
1194
|
+
function markerBoundsComparer(tempElement, markerBounds, colloideBounds, indexCollection, p) {
|
|
1195
|
+
var currentMarkerBound = tempElement.getBoundingClientRect();
|
|
1196
|
+
if (!isNullOrUndefined(currentMarkerBound)) {
|
|
1197
|
+
if (!(markerBounds.left > currentMarkerBound.right || markerBounds.right < currentMarkerBound.left
|
|
1198
|
+
|| markerBounds.top > currentMarkerBound.bottom || markerBounds.bottom < currentMarkerBound.top)) {
|
|
1199
|
+
colloideBounds.push(currentMarkerBound);
|
|
1200
|
+
tempElement['style']['visibility'] = 'hidden';
|
|
1201
|
+
indexCollection.push(p);
|
|
1202
|
+
}
|
|
1203
|
+
}
|
|
1204
|
+
}
|
|
1171
1205
|
/**
|
|
1172
1206
|
*
|
|
1173
1207
|
* @param {MarkerClusterData[]} sameMarkerData - Specifies the marker data
|
|
@@ -1962,22 +1996,40 @@ function isCustomPath(layerData) {
|
|
|
1962
1996
|
* @returns {string} - Returns the string
|
|
1963
1997
|
* @private
|
|
1964
1998
|
*/
|
|
1965
|
-
function textTrim(maxWidth, text, font) {
|
|
1999
|
+
function textTrim(maxWidth, text, font, width, isCanvasMeasure, widthList) {
|
|
1966
2000
|
var label = text;
|
|
1967
|
-
|
|
1968
|
-
|
|
2001
|
+
if (isNullOrUndefined(width)) {
|
|
2002
|
+
if (!isCanvasMeasure) {
|
|
2003
|
+
width = measureText(text, font).width;
|
|
2004
|
+
}
|
|
2005
|
+
else {
|
|
2006
|
+
width = measureTextElement(text, font).width;
|
|
2007
|
+
}
|
|
2008
|
+
}
|
|
2009
|
+
if (width > maxWidth) {
|
|
1969
2010
|
var textLength = text.length;
|
|
1970
2011
|
for (var i = textLength - 1; i >= 0; --i) {
|
|
1971
2012
|
label = text.substring(0, i) + '...';
|
|
1972
|
-
|
|
1973
|
-
|
|
2013
|
+
if (!isCanvasMeasure) {
|
|
2014
|
+
width = measureText(label, font).width;
|
|
2015
|
+
}
|
|
2016
|
+
else {
|
|
2017
|
+
width = measureTextElement(label, font).width;
|
|
2018
|
+
}
|
|
2019
|
+
if (width <= maxWidth || label.length < 4) {
|
|
1974
2020
|
if (label.length < 4) {
|
|
1975
2021
|
label = ' ';
|
|
1976
2022
|
}
|
|
2023
|
+
if (!isNullOrUndefined(widthList)) {
|
|
2024
|
+
widthList.push(width);
|
|
2025
|
+
}
|
|
1977
2026
|
return label;
|
|
1978
2027
|
}
|
|
1979
2028
|
}
|
|
1980
2029
|
}
|
|
2030
|
+
if (!isNullOrUndefined(widthList)) {
|
|
2031
|
+
widthList.push(width);
|
|
2032
|
+
}
|
|
1981
2033
|
return label;
|
|
1982
2034
|
}
|
|
1983
2035
|
/**
|
|
@@ -2055,11 +2107,11 @@ function getTranslate(mapObject, layer, animate) {
|
|
|
2055
2107
|
}
|
|
2056
2108
|
if (mapObject.zoomSettings.shouldZoomInitially && mapObject.zoomSettings.enable) {
|
|
2057
2109
|
mapObject.mapScaleValue = scaleFactor = zoomFactorValue = ((mapObject.zoomSettings.shouldZoomInitially || mapObject.enablePersistence) && mapObject.scale === 1)
|
|
2058
|
-
? mapObject.scale : (isNullOrUndefined(mapObject.markerZoomFactor)) ? 1 : mapObject.markerZoomFactor;
|
|
2059
|
-
if (mapObject.mapScaleValue !== mapObject.markerZoomFactor && !mapObject.enablePersistence) {
|
|
2110
|
+
? mapObject.scale : (isNullOrUndefined(mapObject.markerZoomFactor)) ? 1 : (mapObject.markerZoomedState ? mapObject.markerZoomFactor : parseInt(mapObject.scale.toString()));
|
|
2111
|
+
if (mapObject.markerZoomedState && mapObject.mapScaleValue !== mapObject.markerZoomFactor && !mapObject.enablePersistence) {
|
|
2060
2112
|
mapObject.mapScaleValue = zoomFactorValue = mapObject.markerZoomFactor;
|
|
2061
2113
|
}
|
|
2062
|
-
if (!isNullOrUndefined(mapObject.markerCenterLatitude) && !isNullOrUndefined(mapObject.markerCenterLongitude)) {
|
|
2114
|
+
if (mapObject.markerZoomedState && !isNullOrUndefined(mapObject.markerCenterLatitude) && !isNullOrUndefined(mapObject.markerCenterLongitude)) {
|
|
2063
2115
|
centerLatitude = mapObject.markerCenterLatitude;
|
|
2064
2116
|
centerLongitude = mapObject.markerCenterLongitude;
|
|
2065
2117
|
}
|
|
@@ -4401,6 +4453,28 @@ var TooltipSettings = /** @__PURE__ @class */ (function (_super) {
|
|
|
4401
4453
|
], TooltipSettings.prototype, "valuePath", void 0);
|
|
4402
4454
|
return TooltipSettings;
|
|
4403
4455
|
}(ChildProperty));
|
|
4456
|
+
/**
|
|
4457
|
+
* Specifies the properties such as visibility, fill, border and text style to customize the tooltip.
|
|
4458
|
+
*/
|
|
4459
|
+
var PolygonTooltipSettings = /** @__PURE__ @class */ (function (_super) {
|
|
4460
|
+
__extends$2(PolygonTooltipSettings, _super);
|
|
4461
|
+
function PolygonTooltipSettings() {
|
|
4462
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
4463
|
+
}
|
|
4464
|
+
__decorate$1([
|
|
4465
|
+
Property(false)
|
|
4466
|
+
], PolygonTooltipSettings.prototype, "visible", void 0);
|
|
4467
|
+
__decorate$1([
|
|
4468
|
+
Property('')
|
|
4469
|
+
], PolygonTooltipSettings.prototype, "fill", void 0);
|
|
4470
|
+
__decorate$1([
|
|
4471
|
+
Complex({ color: 'transparent', width: 1 }, Border)
|
|
4472
|
+
], PolygonTooltipSettings.prototype, "border", void 0);
|
|
4473
|
+
__decorate$1([
|
|
4474
|
+
Complex({ fontFamily: null, size: null, fontWeight: null }, Font)
|
|
4475
|
+
], PolygonTooltipSettings.prototype, "textStyle", void 0);
|
|
4476
|
+
return PolygonTooltipSettings;
|
|
4477
|
+
}(ChildProperty));
|
|
4404
4478
|
/**
|
|
4405
4479
|
* Gets or sets the options to customize the margin of the maps.
|
|
4406
4480
|
*/
|
|
@@ -4645,6 +4719,12 @@ var PolygonSetting = /** @__PURE__ @class */ (function (_super) {
|
|
|
4645
4719
|
__decorate$1([
|
|
4646
4720
|
Property([])
|
|
4647
4721
|
], PolygonSetting.prototype, "points", void 0);
|
|
4722
|
+
__decorate$1([
|
|
4723
|
+
Property('')
|
|
4724
|
+
], PolygonSetting.prototype, "tooltipText", void 0);
|
|
4725
|
+
__decorate$1([
|
|
4726
|
+
Property('')
|
|
4727
|
+
], PolygonSetting.prototype, "tooltipTemplate", void 0);
|
|
4648
4728
|
return PolygonSetting;
|
|
4649
4729
|
}(ChildProperty));
|
|
4650
4730
|
/**
|
|
@@ -4665,6 +4745,9 @@ var PolygonSettings = /** @__PURE__ @class */ (function (_super) {
|
|
|
4665
4745
|
__decorate$1([
|
|
4666
4746
|
Complex({}, HighlightSettings)
|
|
4667
4747
|
], PolygonSettings.prototype, "highlightSettings", void 0);
|
|
4748
|
+
__decorate$1([
|
|
4749
|
+
Complex({}, PolygonTooltipSettings)
|
|
4750
|
+
], PolygonSettings.prototype, "tooltipSettings", void 0);
|
|
4668
4751
|
return PolygonSettings;
|
|
4669
4752
|
}(ChildProperty));
|
|
4670
4753
|
/**
|
|
@@ -5521,6 +5604,18 @@ var annotationRendering = 'annotationRendering';
|
|
|
5521
5604
|
* @private
|
|
5522
5605
|
*/
|
|
5523
5606
|
var itemSelection = 'itemSelection';
|
|
5607
|
+
/**
|
|
5608
|
+
* Specifies the maps pan complete event name.
|
|
5609
|
+
*
|
|
5610
|
+
* @private
|
|
5611
|
+
*/
|
|
5612
|
+
var panComplete = 'panComplete';
|
|
5613
|
+
/**
|
|
5614
|
+
* Specifies the maps zoom complete event name.
|
|
5615
|
+
*
|
|
5616
|
+
* @private
|
|
5617
|
+
*/
|
|
5618
|
+
var zoomComplete = 'zoomComplete';
|
|
5524
5619
|
/**
|
|
5525
5620
|
* Specifies the maps item highlight event name.
|
|
5526
5621
|
*
|
|
@@ -5593,7 +5688,6 @@ var BingMap = /** @__PURE__ @class */ (function () {
|
|
|
5593
5688
|
*/
|
|
5594
5689
|
var ColorMapping = /** @__PURE__ @class */ (function () {
|
|
5595
5690
|
function ColorMapping(maps) {
|
|
5596
|
-
this.maps = maps;
|
|
5597
5691
|
}
|
|
5598
5692
|
/**
|
|
5599
5693
|
* To get color based on shape settings.
|
|
@@ -5973,8 +6067,10 @@ var LayerPanel = /** @__PURE__ @class */ (function () {
|
|
|
5973
6067
|
else if (panel.mapObject.defaultState) {
|
|
5974
6068
|
panel.mapObject.previousZoomFactor = panel.mapObject.tileZoomLevel;
|
|
5975
6069
|
panel.mapObject.tileZoomLevel = zoomFactorValue;
|
|
5976
|
-
panel.mapObject.tileTranslatePoint
|
|
5977
|
-
|
|
6070
|
+
if (!isNullOrUndefined(panel.mapObject.tileTranslatePoint)) {
|
|
6071
|
+
panel.mapObject.tileTranslatePoint.x = 0;
|
|
6072
|
+
panel.mapObject.tileTranslatePoint.y = 0;
|
|
6073
|
+
}
|
|
5978
6074
|
}
|
|
5979
6075
|
if (zoomFactorValue <= 1 && !isNullOrUndefined(panel.mapObject.height) && !panel.mapObject.zoomSettings.shouldZoomInitially
|
|
5980
6076
|
&& (panel.mapObject.tileZoomLevel === panel.mapObject.tileZoomScale) && this.mapObject.initialCheck) {
|
|
@@ -5982,8 +6078,10 @@ var LayerPanel = /** @__PURE__ @class */ (function () {
|
|
|
5982
6078
|
}
|
|
5983
6079
|
if (!isNullOrUndefined(panel.mapObject.centerLatOfGivenLocation) && !isNullOrUndefined(panel.mapObject.centerLongOfGivenLocation) &&
|
|
5984
6080
|
panel.mapObject.zoomNotApplied) {
|
|
5985
|
-
centerTileMap
|
|
5986
|
-
|
|
6081
|
+
if (!isNullOrUndefined(centerTileMap)) {
|
|
6082
|
+
centerTileMap.y = panel.mapObject.centerLatOfGivenLocation;
|
|
6083
|
+
centerTileMap.x = panel.mapObject.centerLongOfGivenLocation;
|
|
6084
|
+
}
|
|
5987
6085
|
panel.mapObject.tileZoomLevel = panel.mapObject.mapScaleValue = panel.mapObject.scaleOfGivenLocation;
|
|
5988
6086
|
}
|
|
5989
6087
|
panel.mapObject.tileTranslatePoint = panel.panTileMap(panel.mapObject.availableSize.width, panel.mapObject.availableSize.height, centerTileMap);
|
|
@@ -5994,8 +6092,10 @@ var LayerPanel = /** @__PURE__ @class */ (function () {
|
|
|
5994
6092
|
var padding = this.mapObject.layers[this.mapObject.baseLayerIndex].layerType !== 'GoogleStaticMap' ?
|
|
5995
6093
|
20 : 0;
|
|
5996
6094
|
var totalSize = Math.pow(2, this.mapObject.initialZoomLevel) * 256;
|
|
5997
|
-
|
|
5998
|
-
|
|
6095
|
+
if (!isNullOrUndefined(this.mapObject.initialTileTranslate)) {
|
|
6096
|
+
this.mapObject.initialTileTranslate.x = (this.mapObject.availableSize.width / 2) - (totalSize / 2);
|
|
6097
|
+
this.mapObject.initialTileTranslate.y = (this.mapObject.availableSize.height / 2) - (totalSize / 2) + padding;
|
|
6098
|
+
}
|
|
5999
6099
|
}
|
|
6000
6100
|
panel.generateTiles(panel.mapObject.tileZoomLevel, panel.mapObject.tileTranslatePoint, null, bing);
|
|
6001
6101
|
if (!isNullOrUndefined(panel.mapObject.previousZoomFactor)
|
|
@@ -6511,7 +6611,7 @@ var LayerPanel = /** @__PURE__ @class */ (function () {
|
|
|
6511
6611
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6512
6612
|
var intersect_1 = [];
|
|
6513
6613
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6514
|
-
|
|
6614
|
+
Array.prototype.forEach.call(renderData, function (currentShapeData, i) {
|
|
6515
6615
|
_this.renderLabel(_this.currentLayer, layerIndex, currentShapeData, group, i, labelTemplateEle, intersect_1);
|
|
6516
6616
|
});
|
|
6517
6617
|
this.groupElements.push(group);
|
|
@@ -7668,6 +7768,9 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
|
|
|
7668
7768
|
this.trigger(load, { maps: this });
|
|
7669
7769
|
this.createSVG();
|
|
7670
7770
|
this.findBaseAndSubLayers();
|
|
7771
|
+
if (!isNullOrUndefined(this.markerModule)) {
|
|
7772
|
+
this.markerModule.initializeMarkerClusterList();
|
|
7773
|
+
}
|
|
7671
7774
|
this.createSecondaryElement();
|
|
7672
7775
|
this.addTabIndex();
|
|
7673
7776
|
this.themeStyle = getThemeStyle(this.theme);
|
|
@@ -8128,55 +8231,63 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
|
|
|
8128
8231
|
* @returns {void}
|
|
8129
8232
|
*/
|
|
8130
8233
|
Maps.prototype.getMinMaxLatitudeLongitude = function () {
|
|
8131
|
-
var
|
|
8132
|
-
|
|
8133
|
-
|
|
8134
|
-
this.
|
|
8135
|
-
|
|
8136
|
-
|
|
8137
|
-
|
|
8138
|
-
|
|
8139
|
-
|
|
8234
|
+
var mapsElement = document.getElementById(this.element.id);
|
|
8235
|
+
if (!isNullOrUndefined(mapsElement)) {
|
|
8236
|
+
var element = mapsElement.getBoundingClientRect();
|
|
8237
|
+
var minPosition = this.isTileMap ? this.pointToLatLong((this.mapAreaRect.x - this.margin.left), -this.mapAreaRect.y) : this.getGeoLocation(0, (this.mapAreaRect.x + element.left), this.mapAreaRect.y);
|
|
8238
|
+
var maxPosition = this.isTileMap ? this.pointToLatLong(this.mapAreaRect.width, (this.mapAreaRect.height - this.mapAreaRect.y)) :
|
|
8239
|
+
this.getGeoLocation(0, (this.mapAreaRect.x + element.left + this.mapAreaRect.width), (this.mapAreaRect.y + this.mapAreaRect.height));
|
|
8240
|
+
var MinMaxLatitudeLongitude = {
|
|
8241
|
+
minLatitude: minPosition.latitude, maxLatitude: maxPosition.latitude, minLongitude: minPosition.longitude,
|
|
8242
|
+
maxLongitude: maxPosition.longitude
|
|
8243
|
+
};
|
|
8244
|
+
return MinMaxLatitudeLongitude;
|
|
8245
|
+
}
|
|
8246
|
+
else {
|
|
8247
|
+
return { minLatitude: 0, maxLatitude: 0, minLongitude: 0,
|
|
8248
|
+
maxLongitude: 0 };
|
|
8249
|
+
}
|
|
8140
8250
|
};
|
|
8141
8251
|
/**
|
|
8142
8252
|
* @returns {void}
|
|
8143
8253
|
* @private
|
|
8144
8254
|
*/
|
|
8145
8255
|
Maps.prototype.arrangeTemplate = function () {
|
|
8256
|
+
var _this = this;
|
|
8146
8257
|
if (document.getElementById(this.element.id + '_Legend_Border')) {
|
|
8147
8258
|
document.getElementById(this.element.id + '_Legend_Border').style.pointerEvents = 'none';
|
|
8148
8259
|
}
|
|
8149
8260
|
var templateElements = document.getElementsByClassName(this.element.id + '_template');
|
|
8150
8261
|
if (!isNullOrUndefined(templateElements) && templateElements.length > 0 &&
|
|
8151
8262
|
getElementByID(this.element.id + '_Layer_Collections') && !this.isTileMap) {
|
|
8152
|
-
|
|
8263
|
+
Array.prototype.forEach.call(templateElements, function (templateGroupEle, i) {
|
|
8153
8264
|
var offSetLetValue = 0;
|
|
8154
8265
|
var offSetTopValue = 0;
|
|
8155
|
-
var templateGroupEle = templateElements[i];
|
|
8156
8266
|
if (!isNullOrUndefined(templateGroupEle) && templateGroupEle.childElementCount > 0) {
|
|
8157
|
-
var layerOffset = getElementByID(
|
|
8267
|
+
var layerOffset = getElementByID(_this.element.id + '_Layer_Collections').getBoundingClientRect();
|
|
8158
8268
|
var elementOffset = getElementByID(templateGroupEle.id).getBoundingClientRect();
|
|
8159
8269
|
if (templateGroupEle.id.indexOf('Marker') === -1) {
|
|
8160
|
-
offSetLetValue =
|
|
8270
|
+
offSetLetValue = _this.isTileMap ? 0 : (layerOffset.left < elementOffset.left) ?
|
|
8161
8271
|
-(Math.abs(elementOffset.left - layerOffset.left)) : (Math.abs(elementOffset.left - layerOffset.left));
|
|
8162
|
-
offSetTopValue =
|
|
8272
|
+
offSetTopValue = _this.isTileMap ? 0 : (layerOffset.top < elementOffset.top) ?
|
|
8163
8273
|
-(Math.abs(elementOffset.top - layerOffset.top)) : Math.abs(elementOffset.top - layerOffset.top);
|
|
8164
8274
|
}
|
|
8165
|
-
|
|
8166
|
-
var currentTemplate = templateGroupEle.childNodes[j];
|
|
8275
|
+
Array.prototype.forEach.call(templateGroupEle.childNodes, function (currentTemplate, j) {
|
|
8167
8276
|
if (currentTemplate.id.indexOf('Marker') !== -1) {
|
|
8168
|
-
|
|
8169
|
-
|
|
8170
|
-
|
|
8277
|
+
if (currentTemplate.style.visibility != "hidden") {
|
|
8278
|
+
var elementOffset_1 = getElementByID(currentTemplate.id).getBoundingClientRect();
|
|
8279
|
+
currentTemplate.style.left = parseFloat(currentTemplate.style.left) - (_this.isTileMap ? 0 : elementOffset_1.width / 2) + 'px';
|
|
8280
|
+
currentTemplate.style.top = parseFloat(currentTemplate.style.top) - (_this.isTileMap ? 0 : elementOffset_1.height / 2) + 'px';
|
|
8281
|
+
}
|
|
8171
8282
|
}
|
|
8172
8283
|
else {
|
|
8173
8284
|
currentTemplate.style.left = parseFloat(currentTemplate.style.left) + offSetLetValue + 'px';
|
|
8174
8285
|
currentTemplate.style.top = parseFloat(currentTemplate.style.top) + offSetTopValue + 'px';
|
|
8175
8286
|
currentTemplate.style.transform = 'translate(-50%, -50%)';
|
|
8176
8287
|
}
|
|
8177
|
-
}
|
|
8288
|
+
});
|
|
8178
8289
|
}
|
|
8179
|
-
}
|
|
8290
|
+
});
|
|
8180
8291
|
}
|
|
8181
8292
|
};
|
|
8182
8293
|
Maps.prototype.createTile = function () {
|
|
@@ -8304,7 +8415,8 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
|
|
|
8304
8415
|
var options = new TextOption(this.element.id + '_Map_' + type, location_1.x, location_1.y, 'start', trimmedTitle);
|
|
8305
8416
|
var titleBounds = new Rect(location_1.x, location_1.y, elementSize.width, elementSize.height);
|
|
8306
8417
|
var element = renderTextElement(options, style, style.color || (type === 'title' ? this.themeStyle.titleFontColor : this.themeStyle.subTitleFontColor), groupEle);
|
|
8307
|
-
element.setAttribute('aria-label',
|
|
8418
|
+
element.setAttribute('aria-label', title.text);
|
|
8419
|
+
element.setAttribute('role', 'region');
|
|
8308
8420
|
if ((type === 'title' && !title.subtitleSettings.text) || (type === 'subtitle')) {
|
|
8309
8421
|
height = Math.abs((titleBounds.y + this.margin.bottom) - this.availableSize.height);
|
|
8310
8422
|
this.mapAreaRect = new Rect(this.margin.left, titleBounds.y + 10, width, height - 10);
|
|
@@ -8455,7 +8567,7 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
|
|
|
8455
8567
|
}
|
|
8456
8568
|
else if (this.zoomSettings.enable && zoom && event['keyCode'] === 82) {
|
|
8457
8569
|
zoom.performZoomingByToolBar('reset');
|
|
8458
|
-
zoom.
|
|
8570
|
+
zoom.isPanModeEnabled = false;
|
|
8459
8571
|
}
|
|
8460
8572
|
else if (this.zoomSettings.enable && this.zoomSettings.enablePanning && zoom
|
|
8461
8573
|
&& (event.code === 'ArrowUp' || event.code === 'ArrowDown')) {
|
|
@@ -8619,12 +8731,12 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
|
|
|
8619
8731
|
return latLongValue;
|
|
8620
8732
|
};
|
|
8621
8733
|
/** @private */
|
|
8622
|
-
Maps.prototype.getClickLocation = function (targetId, pageX, pageY, targetElement, x, y) {
|
|
8734
|
+
Maps.prototype.getClickLocation = function (targetId, pageX, pageY, targetElement, x, y, type) {
|
|
8623
8735
|
var layerIndex = 0;
|
|
8624
8736
|
var latLongValue;
|
|
8625
|
-
if (targetId.indexOf('_LayerIndex_') !== -1 && !this.isTileMap &&
|
|
8626
|
-
(parseInt(this.mouseDownEvent['x'], 10) === parseInt(this.mouseClickEvent['x'], 10)) &&
|
|
8627
|
-
|
|
8737
|
+
if (targetId.indexOf('_LayerIndex_') !== -1 && !this.isTileMap && (!isNullOrUndefined(type) ||
|
|
8738
|
+
((parseInt(this.mouseDownEvent['x'], 10) === parseInt(this.mouseClickEvent['x'], 10)) &&
|
|
8739
|
+
(parseInt(this.mouseDownEvent['y'], 10) === parseInt(this.mouseClickEvent['y'], 10))))) {
|
|
8628
8740
|
layerIndex = parseFloat(targetId.split('_LayerIndex_')[1].split('_')[0]);
|
|
8629
8741
|
if (this.layers[layerIndex].geometryType === 'Normal') {
|
|
8630
8742
|
if (targetId.indexOf('_shapeIndex_') > -1) {
|
|
@@ -8683,8 +8795,9 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
|
|
|
8683
8795
|
latLongValue = this.getGeoLocation(layerIndex, x, y);
|
|
8684
8796
|
}
|
|
8685
8797
|
}
|
|
8686
|
-
else if (this.isTileMap && (
|
|
8687
|
-
(parseInt(this.mouseDownEvent['
|
|
8798
|
+
else if (this.isTileMap && (!isNullOrUndefined(type) ||
|
|
8799
|
+
((parseInt(this.mouseDownEvent['x'], 10) === parseInt(this.mouseClickEvent['x'], 10)) &&
|
|
8800
|
+
(parseInt(this.mouseDownEvent['y'], 10) === parseInt(this.mouseClickEvent['y'], 10))))) {
|
|
8688
8801
|
latLongValue = this.getTileGeoLocation(x, y);
|
|
8689
8802
|
}
|
|
8690
8803
|
return latLongValue;
|
|
@@ -9417,13 +9530,51 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
|
|
|
9417
9530
|
this.mouseDownEvent = { x: null, y: null };
|
|
9418
9531
|
this.mouseClickEvent = { x: null, y: null };
|
|
9419
9532
|
this.formatFunction = null;
|
|
9420
|
-
|
|
9421
|
-
|
|
9422
|
-
this.
|
|
9533
|
+
this.localeObject = null;
|
|
9534
|
+
this.defaultLocalConstants = null;
|
|
9535
|
+
this.intl = null;
|
|
9536
|
+
this.mapAreaRect = null;
|
|
9537
|
+
this.layersCollection = null;
|
|
9538
|
+
this.themeStyle = null;
|
|
9539
|
+
this.totalRect = null;
|
|
9540
|
+
this.baseSize = null;
|
|
9541
|
+
this.baseMapBounds = null;
|
|
9542
|
+
this.baseMapRectBounds = null;
|
|
9543
|
+
this.baseTranslatePoint = null;
|
|
9544
|
+
this.baseTileTranslatePoint = null;
|
|
9545
|
+
this.markerZoomCenterPoint = null;
|
|
9546
|
+
this.currentTiles = null;
|
|
9547
|
+
this.serverProcess = null;
|
|
9548
|
+
this.toolbarProperties = null;
|
|
9549
|
+
this.zoomLabelPositions = null;
|
|
9550
|
+
this.resizeEvent = null;
|
|
9551
|
+
this.availableSize = null;
|
|
9423
9552
|
if (document.getElementById('mapsmeasuretext')) {
|
|
9424
9553
|
document.getElementById('mapsmeasuretext').remove();
|
|
9425
9554
|
}
|
|
9426
9555
|
this.removeSvg();
|
|
9556
|
+
this.svgObject = null;
|
|
9557
|
+
this.mapLayerPanel = null;
|
|
9558
|
+
this.renderer = null;
|
|
9559
|
+
this.translatePoint = null;
|
|
9560
|
+
this.tileTranslatePoint = null;
|
|
9561
|
+
this.previousPoint = null;
|
|
9562
|
+
this.dataLabelShape = [];
|
|
9563
|
+
this.zoomShapeCollection = [];
|
|
9564
|
+
this.selectedElementId = [];
|
|
9565
|
+
this.selectedMarkerElementId = [];
|
|
9566
|
+
this.selectedBubbleElementId = [];
|
|
9567
|
+
this.shapeSelectionClass = null;
|
|
9568
|
+
this.markerSelectionClass = null;
|
|
9569
|
+
this.bubbleSelectionClass = null;
|
|
9570
|
+
this.navigationSelectionClass = null;
|
|
9571
|
+
this.selectedNavigationElementId = [];
|
|
9572
|
+
this.polygonSelectionClass = null;
|
|
9573
|
+
this.selectedPolygonElementId = [];
|
|
9574
|
+
this.legendSelectionClass = null;
|
|
9575
|
+
this.previousTranslate = null;
|
|
9576
|
+
this.initialTileTranslate = null;
|
|
9577
|
+
this.markerDragArgument = null;
|
|
9427
9578
|
};
|
|
9428
9579
|
/**
|
|
9429
9580
|
* Gets component name
|
|
@@ -9566,85 +9717,99 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
|
|
|
9566
9717
|
if (this.isBubbleVisible()) {
|
|
9567
9718
|
modules.push({
|
|
9568
9719
|
member: 'Bubble',
|
|
9569
|
-
args: [this]
|
|
9720
|
+
args: [this],
|
|
9721
|
+
name: 'Bubble'
|
|
9570
9722
|
});
|
|
9571
9723
|
}
|
|
9572
9724
|
if (isVisible.highlight) {
|
|
9573
9725
|
modules.push({
|
|
9574
9726
|
member: 'Highlight',
|
|
9575
|
-
args: [this]
|
|
9727
|
+
args: [this],
|
|
9728
|
+
name: 'Highlight'
|
|
9576
9729
|
});
|
|
9577
9730
|
}
|
|
9578
9731
|
if (isVisible.selection) {
|
|
9579
9732
|
modules.push({
|
|
9580
9733
|
member: 'Selection',
|
|
9581
|
-
args: [this]
|
|
9734
|
+
args: [this],
|
|
9735
|
+
name: 'Selection'
|
|
9582
9736
|
});
|
|
9583
9737
|
}
|
|
9584
9738
|
if (this.legendSettings.visible) {
|
|
9585
9739
|
modules.push({
|
|
9586
9740
|
member: 'Legend',
|
|
9587
|
-
args: [this]
|
|
9741
|
+
args: [this],
|
|
9742
|
+
name: 'Legend'
|
|
9588
9743
|
});
|
|
9589
9744
|
}
|
|
9590
9745
|
if (this.zoomSettings.enable || this.zoomSettings.zoomFactor > this.zoomSettings.minZoom) {
|
|
9591
9746
|
modules.push({
|
|
9592
9747
|
member: 'Zoom',
|
|
9593
|
-
args: [this]
|
|
9748
|
+
args: [this],
|
|
9749
|
+
name: 'Zoom'
|
|
9594
9750
|
});
|
|
9595
9751
|
}
|
|
9596
9752
|
if (this.isMarkersVisible()) {
|
|
9597
9753
|
modules.push({
|
|
9598
9754
|
member: 'Marker',
|
|
9599
|
-
args: [this]
|
|
9755
|
+
args: [this],
|
|
9756
|
+
name: 'Marker'
|
|
9600
9757
|
});
|
|
9601
9758
|
}
|
|
9602
9759
|
if (this.isDataLabelVisible()) {
|
|
9603
9760
|
modules.push({
|
|
9604
9761
|
member: 'DataLabel',
|
|
9605
|
-
args: [this]
|
|
9762
|
+
args: [this],
|
|
9763
|
+
name: 'DataLabel'
|
|
9606
9764
|
});
|
|
9607
9765
|
}
|
|
9608
9766
|
if (this.isNavigationVisible()) {
|
|
9609
9767
|
modules.push({
|
|
9610
9768
|
member: 'NavigationLine',
|
|
9611
|
-
args: [this]
|
|
9769
|
+
args: [this],
|
|
9770
|
+
name: 'NavigationLine'
|
|
9612
9771
|
});
|
|
9613
9772
|
}
|
|
9614
9773
|
if (this.isPolygonVisible()) {
|
|
9615
9774
|
modules.push({
|
|
9616
9775
|
member: 'Polygon',
|
|
9617
|
-
args: [this]
|
|
9776
|
+
args: [this],
|
|
9777
|
+
name: 'Polygon'
|
|
9618
9778
|
});
|
|
9619
9779
|
}
|
|
9620
9780
|
if (isVisible.tooltip) {
|
|
9621
9781
|
modules.push({
|
|
9622
9782
|
member: 'MapsTooltip',
|
|
9623
|
-
args: [this]
|
|
9783
|
+
args: [this],
|
|
9784
|
+
name: 'MapsTooltip'
|
|
9624
9785
|
});
|
|
9625
9786
|
}
|
|
9626
9787
|
if (annotationEnable) {
|
|
9627
9788
|
modules.push({
|
|
9628
9789
|
member: 'Annotations',
|
|
9629
|
-
args: [this, Annotations]
|
|
9790
|
+
args: [this, Annotations],
|
|
9791
|
+
name: 'Annotations'
|
|
9630
9792
|
});
|
|
9631
9793
|
}
|
|
9632
9794
|
if (this.allowPrint) {
|
|
9633
9795
|
modules.push({
|
|
9634
9796
|
member: 'Print',
|
|
9635
|
-
args: [this]
|
|
9797
|
+
args: [this],
|
|
9798
|
+
name: 'Print'
|
|
9636
9799
|
});
|
|
9637
9800
|
}
|
|
9638
9801
|
if (this.allowImageExport) {
|
|
9639
9802
|
modules.push({
|
|
9640
9803
|
member: 'ImageExport',
|
|
9641
|
-
args: [this]
|
|
9804
|
+
args: [this],
|
|
9805
|
+
name: 'ImageExport'
|
|
9642
9806
|
});
|
|
9643
9807
|
}
|
|
9644
9808
|
if (this.allowPdfExport) {
|
|
9645
9809
|
modules.push({
|
|
9646
9810
|
member: 'PdfExport',
|
|
9647
|
-
args: [this]
|
|
9811
|
+
args: [this],
|
|
9812
|
+
name: 'PdfExport'
|
|
9648
9813
|
});
|
|
9649
9814
|
}
|
|
9650
9815
|
return modules;
|
|
@@ -9849,6 +10014,7 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
|
|
|
9849
10014
|
if (polygon.points.length > 0) {
|
|
9850
10015
|
isSelection = layer.polygonSettings.highlightSettings.enable || isSelection;
|
|
9851
10016
|
isHighlight = layer.polygonSettings.selectionSettings.enable || isHighlight;
|
|
10017
|
+
istooltipVisible = layer.polygonSettings.tooltipSettings.visible || istooltipVisible;
|
|
9852
10018
|
}
|
|
9853
10019
|
}
|
|
9854
10020
|
for (var _d = 0, markers_1 = markers; _d < markers_1.length; _d++) {
|
|
@@ -10126,6 +10292,12 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
|
|
|
10126
10292
|
__decorate([
|
|
10127
10293
|
Event()
|
|
10128
10294
|
], Maps.prototype, "pan", void 0);
|
|
10295
|
+
__decorate([
|
|
10296
|
+
Event()
|
|
10297
|
+
], Maps.prototype, "panComplete", void 0);
|
|
10298
|
+
__decorate([
|
|
10299
|
+
Event()
|
|
10300
|
+
], Maps.prototype, "zoomComplete", void 0);
|
|
10129
10301
|
Maps = __decorate([
|
|
10130
10302
|
NotifyPropertyChanges
|
|
10131
10303
|
], Maps);
|
|
@@ -10353,10 +10525,10 @@ var Bubble = /** @__PURE__ @class */ (function () {
|
|
|
10353
10525
|
Bubble.prototype.getbubble = function (target) {
|
|
10354
10526
|
var id = target.split('_LayerIndex_');
|
|
10355
10527
|
var index = parseInt(id[1].split('_')[0], 10);
|
|
10356
|
-
var layer = this.maps.layers[index];
|
|
10357
10528
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10358
10529
|
var data;
|
|
10359
10530
|
if (target.indexOf('_BubbleIndex_') > -1) {
|
|
10531
|
+
var layer = this.maps.layers[index];
|
|
10360
10532
|
var bubbleIndex = parseInt(id[1].split('_BubbleIndex_')[1], 10);
|
|
10361
10533
|
var dataIndex = parseInt(id[1].split('_BubbleIndex_')[1].split('_dataIndex_')[1], 10);
|
|
10362
10534
|
if (!isNaN(bubbleIndex)) {
|
|
@@ -10406,8 +10578,7 @@ var Bubble = /** @__PURE__ @class */ (function () {
|
|
|
10406
10578
|
*/
|
|
10407
10579
|
Bubble.prototype.destroy = function () {
|
|
10408
10580
|
this.bubbleCollection = [];
|
|
10409
|
-
|
|
10410
|
-
//this.maps = null;
|
|
10581
|
+
this.maps = null;
|
|
10411
10582
|
};
|
|
10412
10583
|
return Bubble;
|
|
10413
10584
|
}());
|
|
@@ -10420,6 +10591,8 @@ var Marker = /** @__PURE__ @class */ (function () {
|
|
|
10420
10591
|
this.maps = maps;
|
|
10421
10592
|
this.trackElements = [];
|
|
10422
10593
|
this.sameMarkerData = [];
|
|
10594
|
+
this.initialMarkerCluster = [];
|
|
10595
|
+
this.zoomedMarkerCluster = [];
|
|
10423
10596
|
}
|
|
10424
10597
|
Marker.prototype.markerRender = function (maps, layerElement, layerIndex, factor, type) {
|
|
10425
10598
|
var _this = this;
|
|
@@ -10452,12 +10625,11 @@ var Marker = /** @__PURE__ @class */ (function () {
|
|
|
10452
10625
|
getZoomTranslate(maps, currentLayer, allowAnimation) :
|
|
10453
10626
|
getTranslate(maps, currentLayer, allowAnimation);
|
|
10454
10627
|
}
|
|
10455
|
-
|
|
10456
|
-
var markerSettings = currentLayer.markerSettings[markerIndex];
|
|
10628
|
+
Array.prototype.forEach.call(currentLayer.markerSettings, function (markerSettings, markerIndex) {
|
|
10457
10629
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10458
10630
|
var markerData = markerSettings.dataSource;
|
|
10459
|
-
|
|
10460
|
-
|
|
10631
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10632
|
+
Array.prototype.forEach.call(markerData, function (data, dataIndex) {
|
|
10461
10633
|
maps.markerNullCount = markerIndex > 0 && dataIndex === 0 ? 0 : maps.markerNullCount;
|
|
10462
10634
|
var eventArgs = {
|
|
10463
10635
|
cancel: false, name: markerRendering, fill: markerSettings.fill, height: markerSettings.height,
|
|
@@ -10531,15 +10703,8 @@ var Marker = /** @__PURE__ @class */ (function () {
|
|
|
10531
10703
|
}
|
|
10532
10704
|
}
|
|
10533
10705
|
});
|
|
10534
|
-
};
|
|
10535
|
-
|
|
10536
|
-
for (var dataIndex = 0; dataIndex < markerData.length; dataIndex++) {
|
|
10537
|
-
_loop_2(dataIndex);
|
|
10538
|
-
}
|
|
10539
|
-
};
|
|
10540
|
-
for (var markerIndex = 0; markerIndex < currentLayer.markerSettings.length; markerIndex++) {
|
|
10541
|
-
_loop_1(markerIndex);
|
|
10542
|
-
}
|
|
10706
|
+
});
|
|
10707
|
+
});
|
|
10543
10708
|
};
|
|
10544
10709
|
/**
|
|
10545
10710
|
* To find zoom level for individual layers like India, USA.
|
|
@@ -10899,6 +11064,13 @@ var Marker = /** @__PURE__ @class */ (function () {
|
|
|
10899
11064
|
};
|
|
10900
11065
|
this.maps.trigger(markerClusterMouseMove, eventArgs);
|
|
10901
11066
|
};
|
|
11067
|
+
/** @private */
|
|
11068
|
+
Marker.prototype.initializeMarkerClusterList = function () {
|
|
11069
|
+
for (var i = 0; i < this.maps.layers.length; i++) {
|
|
11070
|
+
this.initialMarkerCluster[i] = [];
|
|
11071
|
+
this.zoomedMarkerCluster[i] = [];
|
|
11072
|
+
}
|
|
11073
|
+
};
|
|
10902
11074
|
/**
|
|
10903
11075
|
* Get module name.
|
|
10904
11076
|
*
|
|
@@ -10918,6 +11090,8 @@ var Marker = /** @__PURE__ @class */ (function () {
|
|
|
10918
11090
|
this.trackElements = [];
|
|
10919
11091
|
this.markerSVGObject = null;
|
|
10920
11092
|
this.sameMarkerData = [];
|
|
11093
|
+
this.initialMarkerCluster = [];
|
|
11094
|
+
this.zoomedMarkerCluster = [];
|
|
10921
11095
|
};
|
|
10922
11096
|
return Marker;
|
|
10923
11097
|
}());
|
|
@@ -10927,7 +11101,6 @@ var Marker = /** @__PURE__ @class */ (function () {
|
|
|
10927
11101
|
*/
|
|
10928
11102
|
var Polygon = /** @__PURE__ @class */ (function () {
|
|
10929
11103
|
function Polygon(maps) {
|
|
10930
|
-
this.maps = maps;
|
|
10931
11104
|
}
|
|
10932
11105
|
/**
|
|
10933
11106
|
* To render polygon for maps
|
|
@@ -10939,7 +11112,6 @@ var Polygon = /** @__PURE__ @class */ (function () {
|
|
|
10939
11112
|
* @private
|
|
10940
11113
|
*/
|
|
10941
11114
|
Polygon.prototype.polygonRender = function (maps, layerIndex, factor) {
|
|
10942
|
-
var _this = this;
|
|
10943
11115
|
var currentLayer = maps.layersCollection[layerIndex];
|
|
10944
11116
|
var polygonsSVGObject = maps.renderer.createGroup({
|
|
10945
11117
|
id: maps.element.id + '_LayerIndex_' + layerIndex + '_Polygons_Group'
|
|
@@ -10953,7 +11125,7 @@ var Polygon = /** @__PURE__ @class */ (function () {
|
|
|
10953
11125
|
var path = calculatePolygonPath(maps, factor, currentLayer, polygonData);
|
|
10954
11126
|
var pathOptions = new PathOption(maps.element.id + '_LayerIndex_' + layerIndex + '_PolygonIndex_' + polygonIndex, polygonSetting.fill, (polygonSetting.borderWidth / factor), polygonSetting.borderColor, polygonSetting.opacity, polygonSetting.borderOpacity, '', path);
|
|
10955
11127
|
var polygonEle = maps.renderer.drawPath(pathOptions);
|
|
10956
|
-
maintainSelection(
|
|
11128
|
+
maintainSelection(maps.selectedPolygonElementId, maps.polygonSelectionClass, polygonEle, 'PolygonselectionMapStyle');
|
|
10957
11129
|
polygonSVGObject.appendChild(polygonEle);
|
|
10958
11130
|
polygonsSVGObject.appendChild(polygonSVGObject);
|
|
10959
11131
|
});
|
|
@@ -10974,7 +11146,6 @@ var Polygon = /** @__PURE__ @class */ (function () {
|
|
|
10974
11146
|
* @private
|
|
10975
11147
|
*/
|
|
10976
11148
|
Polygon.prototype.destroy = function () {
|
|
10977
|
-
this.maps = null;
|
|
10978
11149
|
};
|
|
10979
11150
|
return Polygon;
|
|
10980
11151
|
}());
|
|
@@ -11060,7 +11231,7 @@ var DataLabel = /** @__PURE__ @class */ (function () {
|
|
|
11060
11231
|
var locationY;
|
|
11061
11232
|
style.fontFamily = this.maps.theme.toLowerCase() !== 'material' ? this.maps.themeStyle.labelFontFamily : style.fontFamily;
|
|
11062
11233
|
style.fontWeight = style.fontWeight || this.maps.themeStyle.fontWeight || Theme.dataLabelFont.fontWeight;
|
|
11063
|
-
shape = shapes['property'];
|
|
11234
|
+
shape = !isNullOrUndefined(shapes) ? shapes['property'] : null;
|
|
11064
11235
|
var properties = (Object.prototype.toString.call(layer.shapePropertyPath) === '[object Array]' ?
|
|
11065
11236
|
layer.shapePropertyPath : [layer.shapePropertyPath]);
|
|
11066
11237
|
var propertyPath;
|
|
@@ -11092,7 +11263,7 @@ var DataLabel = /** @__PURE__ @class */ (function () {
|
|
|
11092
11263
|
datasrcObj = this.getDataLabel(
|
|
11093
11264
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11094
11265
|
layer.dataSource, layer.shapeDataPath, shapeData['properties'][propertyPath], layer.shapeDataPath);
|
|
11095
|
-
if (!isNullOrUndefined(shapes['property'])) {
|
|
11266
|
+
if (!isNullOrUndefined(shapes) && !isNullOrUndefined(shapes['property'])) {
|
|
11096
11267
|
shapePoint = [[]];
|
|
11097
11268
|
if (!layerData[index]['_isMultiPolygon'] && layerData[index]['type'] !== 'Point' && layerData[index]['type'] !== 'MultiPoint') {
|
|
11098
11269
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -11195,13 +11366,13 @@ var DataLabel = /** @__PURE__ @class */ (function () {
|
|
|
11195
11366
|
if (eventargs_1.text !== text && !eventargs_1.cancel) {
|
|
11196
11367
|
text = eventargs_1.text;
|
|
11197
11368
|
}
|
|
11198
|
-
var textSize =
|
|
11369
|
+
var textSize = measureTextElement(text, style);
|
|
11199
11370
|
var trimmedLable = text;
|
|
11200
11371
|
var elementSize = textSize;
|
|
11201
|
-
var startY = location['y'] - textSize['height'] /
|
|
11202
|
-
var endY = location['y'] + textSize['height'] /
|
|
11203
|
-
var start = ((location['y'] + transPoint['y']) * scale) - textSize['height'] /
|
|
11204
|
-
var end = ((location['y'] + transPoint['y']) * scale) + textSize['height'] /
|
|
11372
|
+
var startY = location['y'] - textSize['height'] / 2;
|
|
11373
|
+
var endY = location['y'] + textSize['height'] / 2;
|
|
11374
|
+
var start = ((location['y'] + transPoint['y']) * scale) - textSize['height'] / 2;
|
|
11375
|
+
var end = ((location['y'] + transPoint['y']) * scale) + textSize['height'] / 2;
|
|
11205
11376
|
position = filter(shapePoint[midIndex], startY, endY);
|
|
11206
11377
|
if (!isPoint && position.length > 5 && (shapeData['geometry']['type'] !== 'MultiPolygon') &&
|
|
11207
11378
|
(shapeData['type'] !== 'MultiPolygon')) {
|
|
@@ -11242,8 +11413,8 @@ var DataLabel = /** @__PURE__ @class */ (function () {
|
|
|
11242
11413
|
if (dataLabelSettings.smartLabelMode === 'Trim') {
|
|
11243
11414
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11244
11415
|
var textType = typeof text === 'number' ? text.toString() : text;
|
|
11245
|
-
trimmedLable = textTrim(width, textType, style);
|
|
11246
|
-
elementSize =
|
|
11416
|
+
trimmedLable = textTrim(width, textType, style, null, true);
|
|
11417
|
+
elementSize = measureTextElement(trimmedLable, style);
|
|
11247
11418
|
options = new TextOption(labelId, textLocation.x, textLocation.y, 'middle', trimmedLable, '', '');
|
|
11248
11419
|
}
|
|
11249
11420
|
if (dataLabelSettings.smartLabelMode === 'None') {
|
|
@@ -11284,19 +11455,19 @@ var DataLabel = /** @__PURE__ @class */ (function () {
|
|
|
11284
11455
|
if (_this.value[index]['leftWidth'] > intersect[j]['leftWidth']) {
|
|
11285
11456
|
width = intersect[j]['rightWidth'] - _this.value[index]['leftWidth'];
|
|
11286
11457
|
difference = width - (_this.value[index]['rightWidth'] - _this.value[index]['leftWidth']);
|
|
11287
|
-
trimmedLable = textTrim(difference, text, style);
|
|
11458
|
+
trimmedLable = textTrim(difference, text, style, null, true);
|
|
11288
11459
|
break;
|
|
11289
11460
|
}
|
|
11290
11461
|
if (_this.value[index]['leftWidth'] < intersect[j]['leftWidth']) {
|
|
11291
11462
|
width = _this.value[index]['rightWidth'] - intersect[j]['leftWidth'];
|
|
11292
11463
|
difference = Math.abs(width - (_this.value[index]['rightWidth'] - _this.value[index]['leftWidth']));
|
|
11293
|
-
trimmedLable = textTrim(difference, text, style);
|
|
11464
|
+
trimmedLable = textTrim(difference, text, style, null, true);
|
|
11294
11465
|
break;
|
|
11295
11466
|
}
|
|
11296
11467
|
}
|
|
11297
11468
|
}
|
|
11298
11469
|
}
|
|
11299
|
-
elementSize =
|
|
11470
|
+
elementSize = measureTextElement(trimmedLable, style);
|
|
11300
11471
|
intersect.push(_this.value[index]);
|
|
11301
11472
|
options = new TextOption(labelId, textLocation.x, (textLocation.y), 'middle', trimmedLable, '', '');
|
|
11302
11473
|
}
|
|
@@ -11330,6 +11501,8 @@ var DataLabel = /** @__PURE__ @class */ (function () {
|
|
|
11330
11501
|
}
|
|
11331
11502
|
}
|
|
11332
11503
|
element = renderTextElement(options, style, style.color || _this.maps.themeStyle.dataLabelFontColor, group);
|
|
11504
|
+
element.setAttribute('aria-label', text);
|
|
11505
|
+
element.setAttribute('role', 'region');
|
|
11333
11506
|
element.setAttribute('visibility', layer.dataLabelSettings.animationDuration > 0 || animationMode === 'Enable' ? 'hidden' : 'visibile');
|
|
11334
11507
|
if (zoomLabelsPosition && scaleZoomValue > 1 && !_this.maps.zoomNotApplied) {
|
|
11335
11508
|
element.setAttribute('transform', 'translate( ' + ((location['x'] + labelArgs.offsetX)) + ' '
|
|
@@ -11339,7 +11512,7 @@ var DataLabel = /** @__PURE__ @class */ (function () {
|
|
|
11339
11512
|
}
|
|
11340
11513
|
else {
|
|
11341
11514
|
element.setAttribute('transform', 'translate( ' + (((location['x'] + transPoint.x) * scale) + labelArgs.offsetX) + ' '
|
|
11342
|
-
+ ((((location['y'] + transPoint.y) * scale) + (elementSize.height /
|
|
11515
|
+
+ ((((location['y'] + transPoint.y) * scale) + (elementSize.height / 2)) + labelArgs.offsetY) + ' )');
|
|
11343
11516
|
}
|
|
11344
11517
|
group.appendChild(element);
|
|
11345
11518
|
}
|
|
@@ -11389,16 +11562,16 @@ var DataLabel = /** @__PURE__ @class */ (function () {
|
|
|
11389
11562
|
DataLabel.prototype.getPoint = function (shapes, points) {
|
|
11390
11563
|
if (shapes['type'] === 'MultiLineString') {
|
|
11391
11564
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11392
|
-
|
|
11565
|
+
Array.prototype.forEach.call(shapes, function (current) {
|
|
11393
11566
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11394
|
-
|
|
11567
|
+
Array.prototype.forEach.call(current, function (shape) {
|
|
11395
11568
|
points.push(new Point(shape['point']['x'], shape['point']['y']));
|
|
11396
11569
|
});
|
|
11397
11570
|
});
|
|
11398
11571
|
}
|
|
11399
11572
|
else {
|
|
11400
11573
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11401
|
-
|
|
11574
|
+
Array.prototype.forEach.call(shapes, function (current) {
|
|
11402
11575
|
points.push(new Point(current['point']['x'], current['point']['y']));
|
|
11403
11576
|
});
|
|
11404
11577
|
}
|
|
@@ -12022,7 +12195,9 @@ var Legend = /** @__PURE__ @class */ (function () {
|
|
|
12022
12195
|
textOptions = new TextOption(textId, textLocation.x, textLocation.y, 'middle', item['text'], '', '');
|
|
12023
12196
|
textFont.fontFamily = !isNullOrUndefined(textFont.fontFamily) ? textFont.fontFamily : this.maps.themeStyle.fontFamily;
|
|
12024
12197
|
textFont.size = map.themeStyle.legendFontSize || textFont.size;
|
|
12025
|
-
renderTextElement(textOptions, textFont, textFont.color, this.legendGroup);
|
|
12198
|
+
var element = renderTextElement(textOptions, textFont, textFont.color, this.legendGroup);
|
|
12199
|
+
element.setAttribute('aria-label', item['text']);
|
|
12200
|
+
element.setAttribute('role', 'region');
|
|
12026
12201
|
this.legendGroup.appendChild(render.drawRectangle(rectOptions));
|
|
12027
12202
|
this.legendToggle();
|
|
12028
12203
|
}
|
|
@@ -12099,7 +12274,9 @@ var Legend = /** @__PURE__ @class */ (function () {
|
|
|
12099
12274
|
legendText = trimmedText;
|
|
12100
12275
|
}
|
|
12101
12276
|
textOptions = new TextOption(textId, textLocation.x, textLocation.y, 'start', legendText, '', '');
|
|
12102
|
-
renderTextElement(textOptions, legendTextStyle, legendTextStyle.color, legendElement);
|
|
12277
|
+
var element = renderTextElement(textOptions, legendTextStyle, legendTextStyle.color, legendElement);
|
|
12278
|
+
element.setAttribute('aria-label', legendText);
|
|
12279
|
+
element.setAttribute('role', 'region');
|
|
12103
12280
|
this.legendGroup.appendChild(legendElement);
|
|
12104
12281
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12105
12282
|
if (i === (this.totalPages[page]['Collection'].length - 1)) {
|
|
@@ -12175,6 +12352,8 @@ var Legend = /** @__PURE__ @class */ (function () {
|
|
|
12175
12352
|
};
|
|
12176
12353
|
var pagingTextElement = render.createText(pageTextOptions, pagingText);
|
|
12177
12354
|
pagingTextElement.style.cssText = 'user-select: none;';
|
|
12355
|
+
pagingTextElement.setAttribute('aria-label', pagingText);
|
|
12356
|
+
pagingTextElement.setAttribute('role', 'region');
|
|
12178
12357
|
pagingGroup.appendChild(pagingTextElement);
|
|
12179
12358
|
this.legendGroup.appendChild(pagingGroup);
|
|
12180
12359
|
}
|
|
@@ -12870,7 +13049,9 @@ var Legend = /** @__PURE__ @class */ (function () {
|
|
|
12870
13049
|
textStyle.size = !isNullOrUndefined(textStyle.size) ? textStyle.size : this.maps.themeStyle.subTitleFontSize || Theme.legendTitleFont.size;
|
|
12871
13050
|
textStyle.fontWeight = !isNullOrUndefined(textStyle.fontWeight) ? textStyle.fontWeight : this.maps.themeStyle.titleFontWeight || Theme.legendTitleFont.fontWeight;
|
|
12872
13051
|
textOptions = new TextOption(map.element.id + '_LegendTitle', (this.legendItemRect.x) + (this.legendItemRect.width / 2), this.legendItemRect.y - (textSize.height / 2) - spacing / 2, 'middle', trimTitle, '');
|
|
12873
|
-
renderTextElement(textOptions, textStyle, textStyle.color, this.legendGroup);
|
|
13052
|
+
var element = renderTextElement(textOptions, textStyle, textStyle.color, this.legendGroup);
|
|
13053
|
+
element.setAttribute('aria-label', legendTitle);
|
|
13054
|
+
element.setAttribute('role', 'region');
|
|
12874
13055
|
}
|
|
12875
13056
|
};
|
|
12876
13057
|
Legend.prototype.changeNextPage = function (e) {
|
|
@@ -14434,6 +14615,7 @@ var MapsTooltip = /** @__PURE__ @class */ (function () {
|
|
|
14434
14615
|
}
|
|
14435
14616
|
}
|
|
14436
14617
|
var option;
|
|
14618
|
+
var polygonTooltipOption;
|
|
14437
14619
|
var currentData = '';
|
|
14438
14620
|
var targetId = target.id;
|
|
14439
14621
|
var tooltipEle;
|
|
@@ -14446,10 +14628,30 @@ var MapsTooltip = /** @__PURE__ @class */ (function () {
|
|
|
14446
14628
|
var markerFill;
|
|
14447
14629
|
var location = getMousePosition(pageX, pageY, this.maps.svgObject);
|
|
14448
14630
|
this.tooltipTargetID = targetId;
|
|
14631
|
+
var polygonTextStyle;
|
|
14632
|
+
var polygonFill;
|
|
14633
|
+
var polygon;
|
|
14634
|
+
var latitude = null;
|
|
14635
|
+
var longitude = null;
|
|
14636
|
+
var latLongValue = this.maps.getClickLocation(targetId, e.pageX, e.pageY, target, e['layerX'], e['layerY'], 'tooltip');
|
|
14637
|
+
if (!isNullOrUndefined(latLongValue)) {
|
|
14638
|
+
latitude = latLongValue.latitude;
|
|
14639
|
+
longitude = latLongValue.longitude;
|
|
14640
|
+
}
|
|
14641
|
+
var isPolygon = targetId.indexOf('_PolygonIndex_') > -1;
|
|
14449
14642
|
var istooltipRender = (targetId.indexOf('_shapeIndex_') > -1)
|
|
14450
|
-
|| (targetId.indexOf('_MarkerIndex_') > -1) || (targetId.indexOf('_BubbleIndex_') > -1)
|
|
14643
|
+
|| (targetId.indexOf('_MarkerIndex_') > -1) || (targetId.indexOf('_BubbleIndex_') > -1)
|
|
14644
|
+
|| (targetId.indexOf('_PolygonIndex_') > -1);
|
|
14451
14645
|
if (istooltipRender && this.maps.markerDragArgument === null) {
|
|
14452
|
-
if (targetId.indexOf('
|
|
14646
|
+
if (targetId.indexOf('_PolygonIndex_') > -1) {
|
|
14647
|
+
var polygonIndex = parseInt(targetId.split('_PolygonIndex_')[1].split('_')[0], 10);
|
|
14648
|
+
polygonTooltipOption = layer.polygonSettings.tooltipSettings;
|
|
14649
|
+
polygon = layer.polygonSettings.polygons[polygonIndex];
|
|
14650
|
+
polygonTextStyle = polygonTooltipOption.textStyle;
|
|
14651
|
+
polygonFill = polygonTooltipOption.fill;
|
|
14652
|
+
tooltipContent.push(polygon.tooltipText);
|
|
14653
|
+
}
|
|
14654
|
+
else if (targetId.indexOf('_shapeIndex_') > -1) {
|
|
14453
14655
|
option = layer.tooltipSettings;
|
|
14454
14656
|
var shape = parseInt(targetId.split('_shapeIndex_')[1].split('_')[0], 10);
|
|
14455
14657
|
if (isNullOrUndefined(layer.layerData) || isNullOrUndefined(layer.layerData[shape])) {
|
|
@@ -14552,116 +14754,135 @@ var MapsTooltip = /** @__PURE__ @class */ (function () {
|
|
|
14552
14754
|
}
|
|
14553
14755
|
//location.y = this.template(option, location);
|
|
14554
14756
|
}
|
|
14555
|
-
if (
|
|
14556
|
-
|
|
14557
|
-
|
|
14558
|
-
else {
|
|
14559
|
-
tooltipEle = createElement('div', {
|
|
14560
|
-
id: this.maps.element.id + '_mapsTooltip',
|
|
14561
|
-
className: 'EJ2-maps-Tooltip'
|
|
14562
|
-
});
|
|
14563
|
-
if (isNullOrUndefined(option.template) || option.template === '' || this.maps.tooltipDisplayMode === 'MouseMove') {
|
|
14564
|
-
tooltipEle.style.cssText = 'position: absolute;pointer-events:none;';
|
|
14757
|
+
if (isPolygon ? polygonTooltipOption.visible : option.visible) {
|
|
14758
|
+
if (document.getElementById(this.tooltipId)) {
|
|
14759
|
+
tooltipEle = document.getElementById(this.tooltipId);
|
|
14565
14760
|
}
|
|
14566
14761
|
else {
|
|
14567
|
-
tooltipEle
|
|
14568
|
-
|
|
14569
|
-
|
|
14570
|
-
|
|
14571
|
-
|
|
14572
|
-
|
|
14573
|
-
}
|
|
14574
|
-
templateData = this.setTooltipContent(option, templateData);
|
|
14575
|
-
var tooltipTextStyle = {
|
|
14576
|
-
color: option.textStyle.color, fontFamily: option.textStyle.fontFamily, fontStyle: option.textStyle.fontStyle,
|
|
14577
|
-
fontWeight: option.textStyle.fontWeight, opacity: option.textStyle.opacity, size: option.textStyle.size
|
|
14578
|
-
};
|
|
14579
|
-
var tooltipOption = {
|
|
14580
|
-
location: location, text: tooltipContent, data: templateData,
|
|
14581
|
-
textStyle: tooltipTextStyle,
|
|
14582
|
-
template: option.template
|
|
14583
|
-
};
|
|
14584
|
-
tooltipArgs = {
|
|
14585
|
-
cancel: false, name: tooltipRender,
|
|
14586
|
-
options: tooltipOption,
|
|
14587
|
-
fill: option.fill,
|
|
14588
|
-
maps: this.maps,
|
|
14589
|
-
element: target, eventArgs: e, content: !isNullOrUndefined(currentData) ? currentData.toString() : ''
|
|
14590
|
-
};
|
|
14591
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
14592
|
-
this.maps.trigger(tooltipRender, tooltipArgs, function (args) {
|
|
14593
|
-
if (!tooltipArgs.cancel && option.visible && !isNullOrUndefined(currentData) &&
|
|
14594
|
-
(targetId.indexOf('_cluster_') === -1 && targetId.indexOf('_dataLabel_') === -1)) {
|
|
14595
|
-
_this.maps['isProtectedOnChange'] = true;
|
|
14596
|
-
tooltipArgs.options['textStyle']['size'] = tooltipArgs.options['textStyle']['size']
|
|
14597
|
-
|| _this.maps.themeStyle.fontSize;
|
|
14598
|
-
tooltipArgs.options['textStyle']['color'] = tooltipArgs.options['textStyle']['color']
|
|
14599
|
-
|| _this.maps.themeStyle.tooltipFontColor;
|
|
14600
|
-
tooltipArgs.options['textStyle']['fontFamily'] = tooltipArgs.options['textStyle']['fontFamily']
|
|
14601
|
-
|| _this.maps.themeStyle.fontFamily;
|
|
14602
|
-
tooltipArgs.options['textStyle']['fontWeight'] = tooltipArgs.options['textStyle']['fontWeight']
|
|
14603
|
-
|| _this.maps.themeStyle.fontWeight;
|
|
14604
|
-
tooltipArgs.options['textStyle']['opacity'] = tooltipArgs.options['textStyle']['opacity']
|
|
14605
|
-
|| _this.maps.themeStyle.tooltipTextOpacity;
|
|
14606
|
-
if (tooltipArgs.cancel) {
|
|
14607
|
-
_this.svgTooltip = new Tooltip({
|
|
14608
|
-
enable: true,
|
|
14609
|
-
header: '',
|
|
14610
|
-
data: option['data'],
|
|
14611
|
-
template: option['template'],
|
|
14612
|
-
content: tooltipArgs.content.toString() !== currentData.toString() ? [tooltipArgs.content.toString()] :
|
|
14613
|
-
[currentData.toString()],
|
|
14614
|
-
shapes: [],
|
|
14615
|
-
location: option['location'],
|
|
14616
|
-
palette: [markerFill],
|
|
14617
|
-
areaBounds: _this.maps.mapAreaRect,
|
|
14618
|
-
textStyle: option['textStyle'],
|
|
14619
|
-
availableSize: _this.maps.availableSize,
|
|
14620
|
-
fill: option.fill || _this.maps.themeStyle.tooltipFillColor,
|
|
14621
|
-
enableShadow: true
|
|
14622
|
-
});
|
|
14762
|
+
tooltipEle = createElement('div', {
|
|
14763
|
+
id: this.maps.element.id + '_mapsTooltip',
|
|
14764
|
+
className: 'EJ2-maps-Tooltip'
|
|
14765
|
+
});
|
|
14766
|
+
if (isNullOrUndefined(isPolygon ? polygon.tooltipTemplate : option.template) || (isPolygon ? polygon.tooltipTemplate === '' : option.template === '') || this.maps.tooltipDisplayMode === 'MouseMove') {
|
|
14767
|
+
tooltipEle.style.cssText = 'position: absolute;pointer-events:none;';
|
|
14623
14768
|
}
|
|
14624
14769
|
else {
|
|
14625
|
-
|
|
14626
|
-
enable: true,
|
|
14627
|
-
header: '',
|
|
14628
|
-
data: tooltipArgs.options['data'],
|
|
14629
|
-
template: tooltipArgs.options['template'],
|
|
14630
|
-
content: tooltipArgs.content.toString() !== currentData.toString() ? [tooltipArgs.content.toString()] :
|
|
14631
|
-
[currentData.toString()],
|
|
14632
|
-
shapes: [],
|
|
14633
|
-
location: tooltipArgs.options['location'],
|
|
14634
|
-
palette: [markerFill],
|
|
14635
|
-
areaBounds: _this.maps.mapAreaRect,
|
|
14636
|
-
textStyle: tooltipArgs.options['textStyle'],
|
|
14637
|
-
availableSize: _this.maps.availableSize,
|
|
14638
|
-
fill: tooltipArgs.fill || _this.maps.themeStyle.tooltipFillColor,
|
|
14639
|
-
enableShadow: true
|
|
14640
|
-
});
|
|
14770
|
+
tooltipEle.style.position = 'absolute';
|
|
14641
14771
|
}
|
|
14642
|
-
|
|
14643
|
-
|
|
14644
|
-
|
|
14772
|
+
document.getElementById(this.maps.element.id + '_Secondary_Element').appendChild(tooltipEle);
|
|
14773
|
+
}
|
|
14774
|
+
if (typeof (isPolygon ? polygon.tooltipTemplate !== 'function' : option.template !== 'function') && (isPolygon ? polygon.tooltipTemplate !== null : option.template !== null) && Object.keys(typeof (isPolygon ? polygon.tooltipTemplate === 'object' : option.template === 'object') ? (isPolygon ? polygon.tooltipTemplate : option.template) : {}).length === 1) {
|
|
14775
|
+
if (isPolygon) {
|
|
14776
|
+
polygon.tooltipTemplate = polygon.tooltipTemplate[Object.keys(polygon.tooltipTemplate)[0]];
|
|
14645
14777
|
}
|
|
14646
|
-
|
|
14647
|
-
|
|
14648
|
-
|
|
14649
|
-
|
|
14778
|
+
else {
|
|
14779
|
+
option.template = option.template[Object.keys(option.template)[0]];
|
|
14780
|
+
}
|
|
14781
|
+
}
|
|
14782
|
+
templateData = this.setTooltipContent(option, templateData);
|
|
14783
|
+
var tooltipTextStyle = {
|
|
14784
|
+
// eslint-disable-next-line max-len
|
|
14785
|
+
color: isPolygon ? polygonTextStyle.color : option.textStyle.color, fontFamily: isPolygon ? polygonTextStyle.fontFamily : option.textStyle.fontFamily, fontStyle: isPolygon ? polygonTextStyle.fontStyle : option.textStyle.fontStyle,
|
|
14786
|
+
// eslint-disable-next-line max-len
|
|
14787
|
+
fontWeight: isPolygon ? polygonTextStyle.fontWeight : option.textStyle.fontWeight, opacity: isPolygon ? polygonTextStyle.opacity : option.textStyle.opacity, size: isPolygon ? polygonTextStyle.size : option.textStyle.size
|
|
14788
|
+
};
|
|
14789
|
+
var tooltipOption = {
|
|
14790
|
+
location: location, text: tooltipContent, data: templateData,
|
|
14791
|
+
textStyle: tooltipTextStyle,
|
|
14792
|
+
template: isPolygon ? polygon.tooltipTemplate : option.template
|
|
14793
|
+
};
|
|
14794
|
+
tooltipArgs = {
|
|
14795
|
+
cancel: false, name: tooltipRender,
|
|
14796
|
+
options: tooltipOption,
|
|
14797
|
+
fill: isPolygon ? polygonFill : option.fill,
|
|
14798
|
+
maps: this.maps, latitude: latitude, longitude: longitude,
|
|
14799
|
+
element: target, eventArgs: e, content: isPolygon ? polygon.tooltipText : !isNullOrUndefined(currentData) ? currentData.toString() : ''
|
|
14800
|
+
};
|
|
14801
|
+
if (tooltipArgs.content !== '' || tooltipArgs.options['template'] !== '') {
|
|
14802
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
14803
|
+
this.maps.trigger(tooltipRender, tooltipArgs, function (args) {
|
|
14804
|
+
if (!tooltipArgs.cancel && !isNullOrUndefined(currentData) &&
|
|
14805
|
+
(targetId.indexOf('_cluster_') === -1 && targetId.indexOf('_dataLabel_') === -1)) {
|
|
14806
|
+
_this.maps['isProtectedOnChange'] = true;
|
|
14807
|
+
tooltipArgs.options['textStyle']['size'] = tooltipArgs.options['textStyle']['size']
|
|
14808
|
+
|| _this.maps.themeStyle.fontSize;
|
|
14809
|
+
tooltipArgs.options['textStyle']['color'] = tooltipArgs.options['textStyle']['color']
|
|
14810
|
+
|| _this.maps.themeStyle.tooltipFontColor;
|
|
14811
|
+
tooltipArgs.options['textStyle']['fontFamily'] = tooltipArgs.options['textStyle']['fontFamily']
|
|
14812
|
+
|| _this.maps.themeStyle.fontFamily;
|
|
14813
|
+
tooltipArgs.options['textStyle']['fontWeight'] = tooltipArgs.options['textStyle']['fontWeight']
|
|
14814
|
+
|| _this.maps.themeStyle.fontWeight;
|
|
14815
|
+
tooltipArgs.options['textStyle']['opacity'] = tooltipArgs.options['textStyle']['opacity']
|
|
14816
|
+
|| _this.maps.themeStyle.tooltipTextOpacity;
|
|
14817
|
+
if (tooltipArgs.cancel) {
|
|
14818
|
+
_this.svgTooltip = new Tooltip({
|
|
14819
|
+
enable: true,
|
|
14820
|
+
header: '',
|
|
14821
|
+
data: option['data'],
|
|
14822
|
+
template: option['template'],
|
|
14823
|
+
content: tooltipArgs.content.toString() !== currentData.toString() ? [tooltipArgs.content.toString()] :
|
|
14824
|
+
[currentData.toString()],
|
|
14825
|
+
shapes: [],
|
|
14826
|
+
location: option['location'],
|
|
14827
|
+
palette: [markerFill],
|
|
14828
|
+
areaBounds: _this.maps.mapAreaRect,
|
|
14829
|
+
textStyle: option['textStyle'],
|
|
14830
|
+
availableSize: _this.maps.availableSize,
|
|
14831
|
+
fill: option.fill || _this.maps.themeStyle.tooltipFillColor,
|
|
14832
|
+
enableShadow: true,
|
|
14833
|
+
border: isPolygon ? polygonTooltipOption.border : option.border
|
|
14834
|
+
});
|
|
14835
|
+
}
|
|
14836
|
+
else {
|
|
14837
|
+
_this.svgTooltip = new Tooltip({
|
|
14838
|
+
enable: true,
|
|
14839
|
+
header: '',
|
|
14840
|
+
data: tooltipArgs.options['data'],
|
|
14841
|
+
template: tooltipArgs.options['template'],
|
|
14842
|
+
content: tooltipArgs.content.toString() !== currentData.toString() ? [tooltipArgs.content.toString()] :
|
|
14843
|
+
[currentData.toString()],
|
|
14844
|
+
shapes: [],
|
|
14845
|
+
location: tooltipArgs.options['location'],
|
|
14846
|
+
palette: [markerFill],
|
|
14847
|
+
areaBounds: _this.maps.mapAreaRect,
|
|
14848
|
+
textStyle: tooltipArgs.options['textStyle'],
|
|
14849
|
+
availableSize: _this.maps.availableSize,
|
|
14850
|
+
fill: tooltipArgs.fill || _this.maps.themeStyle.tooltipFillColor,
|
|
14851
|
+
enableShadow: true,
|
|
14852
|
+
border: isPolygon ? polygonTooltipOption.border : option.border
|
|
14853
|
+
});
|
|
14854
|
+
}
|
|
14855
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
14856
|
+
if (_this.maps.isVue || _this.maps.isVue3) {
|
|
14857
|
+
_this.svgTooltip.controlInstance = _this.maps;
|
|
14858
|
+
}
|
|
14859
|
+
_this.svgTooltip.opacity = _this.maps.themeStyle.tooltipFillOpacity || _this.svgTooltip.opacity;
|
|
14860
|
+
_this.svgTooltip.appendTo(tooltipEle);
|
|
14861
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
14862
|
+
_this.maps.renderReactTemplates();
|
|
14863
|
+
}
|
|
14864
|
+
else {
|
|
14865
|
+
_this.clearTooltip(e.target);
|
|
14866
|
+
}
|
|
14867
|
+
});
|
|
14650
14868
|
}
|
|
14651
14869
|
else {
|
|
14652
|
-
|
|
14870
|
+
this.clearTooltip(e.target);
|
|
14871
|
+
}
|
|
14872
|
+
if (this.svgTooltip) {
|
|
14873
|
+
this.maps.trigger('tooltipRenderComplete', {
|
|
14874
|
+
cancel: false, name: 'tooltipRenderComplete', maps: this.maps, options: tooltipOption,
|
|
14875
|
+
element: this.svgTooltip.element
|
|
14876
|
+
});
|
|
14877
|
+
}
|
|
14878
|
+
if (this.svgTooltip) {
|
|
14879
|
+
this.maps.trigger('tooltipRenderComplete', {
|
|
14880
|
+
cancel: false, name: 'tooltipRenderComplete', maps: this.maps, options: tooltipOption, element: this.svgTooltip.element
|
|
14881
|
+
});
|
|
14882
|
+
}
|
|
14883
|
+
else {
|
|
14884
|
+
this.clearTooltip(e.target);
|
|
14653
14885
|
}
|
|
14654
|
-
});
|
|
14655
|
-
if (this.svgTooltip) {
|
|
14656
|
-
this.maps.trigger('tooltipRenderComplete', {
|
|
14657
|
-
cancel: false, name: 'tooltipRenderComplete', maps: this.maps, options: tooltipOption,
|
|
14658
|
-
element: this.svgTooltip.element
|
|
14659
|
-
});
|
|
14660
|
-
}
|
|
14661
|
-
if (this.svgTooltip) {
|
|
14662
|
-
this.maps.trigger('tooltipRenderComplete', {
|
|
14663
|
-
cancel: false, name: 'tooltipRenderComplete', maps: this.maps, options: tooltipOption, element: this.svgTooltip.element
|
|
14664
|
-
});
|
|
14665
14886
|
}
|
|
14666
14887
|
else {
|
|
14667
14888
|
this.clearTooltip(e.target);
|
|
@@ -14712,10 +14933,12 @@ var MapsTooltip = /** @__PURE__ @class */ (function () {
|
|
|
14712
14933
|
* @private
|
|
14713
14934
|
*/
|
|
14714
14935
|
MapsTooltip.prototype.mouseUpHandler = function (e) {
|
|
14715
|
-
this.
|
|
14716
|
-
|
|
14717
|
-
|
|
14718
|
-
|
|
14936
|
+
if (!isNullOrUndefined(this.maps)) {
|
|
14937
|
+
this.renderTooltip(e);
|
|
14938
|
+
if (this.maps.tooltipDisplayMode === 'MouseMove') {
|
|
14939
|
+
clearTimeout(this.clearTimeout);
|
|
14940
|
+
this.clearTimeout = setTimeout(this.removeTooltip.bind(this), 2000);
|
|
14941
|
+
}
|
|
14719
14942
|
}
|
|
14720
14943
|
};
|
|
14721
14944
|
/**
|
|
@@ -14769,7 +14992,7 @@ var MapsTooltip = /** @__PURE__ @class */ (function () {
|
|
|
14769
14992
|
return;
|
|
14770
14993
|
}
|
|
14771
14994
|
if (this.maps.tooltipDisplayMode === 'DoubleClick') {
|
|
14772
|
-
this.maps.off('dblclick', this.
|
|
14995
|
+
this.maps.off('dblclick', this.renderTooltip);
|
|
14773
14996
|
}
|
|
14774
14997
|
else if (this.maps.tooltipDisplayMode === 'Click') {
|
|
14775
14998
|
this.maps.off(Browser.touchEndEvent, this.mouseUpHandler);
|
|
@@ -14800,8 +15023,7 @@ var MapsTooltip = /** @__PURE__ @class */ (function () {
|
|
|
14800
15023
|
this.svgTooltip.destroy();
|
|
14801
15024
|
}
|
|
14802
15025
|
this.svgTooltip = null;
|
|
14803
|
-
|
|
14804
|
-
//this.maps = null;
|
|
15026
|
+
this.maps = null;
|
|
14805
15027
|
};
|
|
14806
15028
|
return MapsTooltip;
|
|
14807
15029
|
}());
|
|
@@ -14812,7 +15034,7 @@ var MapsTooltip = /** @__PURE__ @class */ (function () {
|
|
|
14812
15034
|
var Zoom = /** @__PURE__ @class */ (function () {
|
|
14813
15035
|
function Zoom(maps) {
|
|
14814
15036
|
/** @private */
|
|
14815
|
-
this.
|
|
15037
|
+
this.isPanModeEnabled = false;
|
|
14816
15038
|
/** @private */
|
|
14817
15039
|
this.mouseEnter = false;
|
|
14818
15040
|
/** @private */
|
|
@@ -14833,9 +15055,6 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
14833
15055
|
this.startTouches = [];
|
|
14834
15056
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
14835
15057
|
/** @private */
|
|
14836
|
-
this.intersect = [];
|
|
14837
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
14838
|
-
/** @private */
|
|
14839
15058
|
this.mouseDownLatLong = { x: 0, y: 0 };
|
|
14840
15059
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
14841
15060
|
/** @private */
|
|
@@ -14972,6 +15191,7 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
14972
15191
|
}, animationDuration);
|
|
14973
15192
|
}
|
|
14974
15193
|
}
|
|
15194
|
+
this.triggerZoomComplete(map, prevLevel, type);
|
|
14975
15195
|
}
|
|
14976
15196
|
this.maps.zoomNotApplied = false;
|
|
14977
15197
|
if (this.maps.isDevice) {
|
|
@@ -15060,12 +15280,12 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
15060
15280
|
map.translatePoint = new Point(translatePointX, translatePointY);
|
|
15061
15281
|
}
|
|
15062
15282
|
map.scale = zoomCalculationFactor < this.maps.zoomSettings.maxZoom ? zoomCalculationFactor : this.maps.zoomSettings.maxZoom;
|
|
15063
|
-
map.zoomTranslatePoint = map.translatePoint;
|
|
15064
15283
|
isZoomCancelled = this.triggerZoomEvent(prevTilePoint, prevLevel, '');
|
|
15065
15284
|
if (isZoomCancelled) {
|
|
15066
15285
|
map.translatePoint = map.previousPoint;
|
|
15067
15286
|
map.scale = map.previousScale;
|
|
15068
15287
|
}
|
|
15288
|
+
map.zoomTranslatePoint = map.translatePoint;
|
|
15069
15289
|
}
|
|
15070
15290
|
else {
|
|
15071
15291
|
zoomCalculationFactor = prevLevel + (Math.round(prevLevel + (((size.width / zoomRect.width) + (size.height / zoomRect.height)) / 2)));
|
|
@@ -15095,6 +15315,7 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
15095
15315
|
}
|
|
15096
15316
|
}
|
|
15097
15317
|
this.isZoomFinal = this.isZoomSelection && Math.round(map.scale) === this.maps.zoomSettings.maxZoom;
|
|
15318
|
+
this.triggerZoomComplete(map, prevLevel, '');
|
|
15098
15319
|
this.removeToolbarOpacity(map.scale, this.maps.element.id + '_Zooming_');
|
|
15099
15320
|
};
|
|
15100
15321
|
Zoom.prototype.setInteraction = function (newInteraction) {
|
|
@@ -15187,10 +15408,41 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
15187
15408
|
if (!isZoomCancelled) {
|
|
15188
15409
|
this.applyTransform(map);
|
|
15189
15410
|
}
|
|
15411
|
+
this.triggerZoomComplete(map, prevLevel, '');
|
|
15190
15412
|
if (Browser.isDevice) {
|
|
15191
15413
|
this.removeToolbarOpacity(map.isTileMap ? Math.round(map.tileZoomLevel) : map.scale, map.element.id + '_Zooming_');
|
|
15192
15414
|
}
|
|
15193
15415
|
};
|
|
15416
|
+
Zoom.prototype.triggerZoomComplete = function (map, prevLevel, type) {
|
|
15417
|
+
if (map.zoomSettings.enable) {
|
|
15418
|
+
var zoomArgs = void 0;
|
|
15419
|
+
if (map.isTileMap) {
|
|
15420
|
+
map.mapScaleValue = isNullOrUndefined(map.mapScaleValue) ? 1 : map.mapScaleValue;
|
|
15421
|
+
map.translatePoint.y = (map.tileTranslatePoint.y - (0.01 * map.mapScaleValue)) / map.scale;
|
|
15422
|
+
map.translatePoint.x = (map.tileTranslatePoint.x - (0.01 * map.mapScaleValue)) / map.scale;
|
|
15423
|
+
}
|
|
15424
|
+
var minMaxLatitudeLongitude = this.maps.getMinMaxLatitudeLongitude();
|
|
15425
|
+
if (!map.isTileMap) {
|
|
15426
|
+
zoomArgs = {
|
|
15427
|
+
cancel: false, name: 'zoomComplete', type: type, maps: map,
|
|
15428
|
+
tileTranslatePoint: {}, translatePoint: { previous: map.previousPoint, current: map.translatePoint },
|
|
15429
|
+
tileZoomLevel: {}, scale: { previous: map.previousScale, current: map.scale },
|
|
15430
|
+
minLatitude: minMaxLatitudeLongitude.minLatitude, maxLatitude: minMaxLatitudeLongitude.maxLatitude,
|
|
15431
|
+
minLongitude: minMaxLatitudeLongitude.minLongitude, maxLongitude: minMaxLatitudeLongitude.maxLongitude
|
|
15432
|
+
};
|
|
15433
|
+
}
|
|
15434
|
+
else {
|
|
15435
|
+
zoomArgs = {
|
|
15436
|
+
cancel: false, name: 'zoomComplete', type: type, maps: map,
|
|
15437
|
+
tileTranslatePoint: { previous: map.tileTranslatePoint, current: map.tileTranslatePoint }, translatePoint: { previous: map.previousPoint, current: map.translatePoint },
|
|
15438
|
+
tileZoomLevel: { previous: prevLevel, current: map.tileZoomLevel }, scale: { previous: map.previousScale, current: map.scale },
|
|
15439
|
+
minLatitude: minMaxLatitudeLongitude.minLatitude, maxLatitude: minMaxLatitudeLongitude.maxLatitude,
|
|
15440
|
+
minLongitude: minMaxLatitudeLongitude.minLongitude, maxLongitude: minMaxLatitudeLongitude.maxLongitude
|
|
15441
|
+
};
|
|
15442
|
+
}
|
|
15443
|
+
this.maps.trigger('zoomComplete', zoomArgs);
|
|
15444
|
+
}
|
|
15445
|
+
};
|
|
15194
15446
|
/**
|
|
15195
15447
|
* @private
|
|
15196
15448
|
*/
|
|
@@ -15244,7 +15496,7 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
15244
15496
|
/**
|
|
15245
15497
|
* @private
|
|
15246
15498
|
*/
|
|
15247
|
-
Zoom.prototype.applyTransform = function (maps, animate$$1) {
|
|
15499
|
+
Zoom.prototype.applyTransform = function (maps, animate$$1, isPanning) {
|
|
15248
15500
|
var _this = this;
|
|
15249
15501
|
var layerIndex;
|
|
15250
15502
|
this.templateCount = 0;
|
|
@@ -15252,6 +15504,7 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
15252
15504
|
var scale = maps.scale;
|
|
15253
15505
|
var x = maps.translatePoint.x;
|
|
15254
15506
|
var y = maps.translatePoint.y;
|
|
15507
|
+
var currentLabelIndex = 0;
|
|
15255
15508
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
15256
15509
|
maps.zoomShapeCollection = [];
|
|
15257
15510
|
if (document.getElementById(maps.element.id + '_mapsTooltip')) {
|
|
@@ -15297,7 +15550,7 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
15297
15550
|
}
|
|
15298
15551
|
}
|
|
15299
15552
|
else if (currentEle.id.indexOf('_Markers_Group') > -1) {
|
|
15300
|
-
if ((!this_1.
|
|
15553
|
+
if ((!this_1.isPanModeEnabled) && !isNullOrUndefined(currentEle.childNodes[0])) {
|
|
15301
15554
|
this_1.markerTranslates(currentEle.childNodes[0], factor_1, x, y, scale, 'Marker', layerElement, animate$$1);
|
|
15302
15555
|
}
|
|
15303
15556
|
currentEle = layerElement.childNodes[j];
|
|
@@ -15321,7 +15574,7 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
15321
15574
|
}
|
|
15322
15575
|
}
|
|
15323
15576
|
}
|
|
15324
|
-
if (((_this.currentLayer.animationDuration > 0 || animationMode === 'Enable') || ((maps.layersCollection[0].animationDuration > 0 || animationMode === 'Enable') && _this.currentLayer.type === 'SubLayer')) && !_this.
|
|
15577
|
+
if (((_this.currentLayer.animationDuration > 0 || animationMode === 'Enable') || ((maps.layersCollection[0].animationDuration > 0 || animationMode === 'Enable') && _this.currentLayer.type === 'SubLayer')) && !_this.isPanModeEnabled) {
|
|
15325
15578
|
if (maps.isTileMap) {
|
|
15326
15579
|
var groupElement = document.querySelector('.GroupElement');
|
|
15327
15580
|
if (groupElement && !(document.querySelector('.ClusterGroupElement')) && markerAnimation_1) {
|
|
@@ -15334,7 +15587,7 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
15334
15587
|
}
|
|
15335
15588
|
}
|
|
15336
15589
|
});
|
|
15337
|
-
if (this_1.
|
|
15590
|
+
if (this_1.isPanModeEnabled && maps.markerModule.sameMarkerData.length > 0) {
|
|
15338
15591
|
clusterSeparate(maps.markerModule.sameMarkerData, maps, currentEle, true);
|
|
15339
15592
|
}
|
|
15340
15593
|
else if (maps.markerModule.sameMarkerData.length > 0) {
|
|
@@ -15344,7 +15597,7 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
15344
15597
|
}
|
|
15345
15598
|
}
|
|
15346
15599
|
if (document.getElementById(maps.element.id + '_mapsTooltip') && maps.mapsTooltipModule.tooltipTargetID.indexOf('_MarkerIndex_')
|
|
15347
|
-
&& !this_1.
|
|
15600
|
+
&& !this_1.isPanModeEnabled) {
|
|
15348
15601
|
var mapsTooltip = maps.mapsTooltipModule;
|
|
15349
15602
|
var tooltipElement = currentEle.querySelector('#' + mapsTooltip.tooltipTargetID);
|
|
15350
15603
|
if (!isNullOrUndefined(tooltipElement)) {
|
|
@@ -15395,24 +15648,25 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
15395
15648
|
}
|
|
15396
15649
|
}
|
|
15397
15650
|
else if (currentEle.id.indexOf('_dataLableIndex_Group') > -1 && !isNullOrUndefined(maps.layers[this_1.index])) {
|
|
15398
|
-
this_1.intersect = [];
|
|
15399
15651
|
maps.zoomLabelPositions = [];
|
|
15400
15652
|
maps.zoomLabelPositions = maps.dataLabelModule.dataLabelCollections;
|
|
15401
|
-
var
|
|
15402
|
-
|
|
15653
|
+
var labelAnimate_1 = !maps.isTileMap && animate$$1;
|
|
15654
|
+
var intersect_1 = [];
|
|
15655
|
+
Array.prototype.forEach.call(currentEle.childNodes, function (childNode, k) {
|
|
15403
15656
|
if (currentEle.childNodes[k]['id'].indexOf('_LabelIndex_') > -1) {
|
|
15404
15657
|
var labelIndex = parseFloat(currentEle.childNodes[k]['id'].split('_LabelIndex_')[1].split('_')[0]);
|
|
15405
|
-
|
|
15406
|
-
maps.zoomShapeCollection.push(
|
|
15407
|
-
|
|
15408
|
-
|
|
15658
|
+
var zoomShapeWidth = currentEle.childNodes[k].id;
|
|
15659
|
+
maps.zoomShapeCollection.push(zoomShapeWidth);
|
|
15660
|
+
_this.dataLabelTranslate(currentEle.childNodes[k], factor_1, x, y, scale, 'DataLabel', labelAnimate_1, currentLabelIndex, isPanning, intersect_1);
|
|
15661
|
+
currentLabelIndex++;
|
|
15662
|
+
var dataLabel = maps.layers[_this.index].dataLabelSettings;
|
|
15409
15663
|
var border = dataLabel.border;
|
|
15410
15664
|
if (k > 0 && border['width'] > 1) {
|
|
15411
15665
|
if (currentEle.childNodes[k - 1]['id'].indexOf('_rectIndex_') > -1 && !isNullOrUndefined(maps.zoomLabelPositions[labelIndex])) {
|
|
15412
15666
|
var labelX = ((maps.zoomLabelPositions[labelIndex]['location']['x'] + x) * scale);
|
|
15413
15667
|
var labelY = ((maps.zoomLabelPositions[labelIndex]['location']['y'] + y) * scale);
|
|
15414
15668
|
var zoomtext = currentEle.childNodes[k]['textContent'];
|
|
15415
|
-
var style = maps.layers[
|
|
15669
|
+
var style = maps.layers[_this.index].dataLabelSettings.textStyle;
|
|
15416
15670
|
var zoomtextSize = measureText(zoomtext, style);
|
|
15417
15671
|
var padding = 5;
|
|
15418
15672
|
var rectElement = currentEle.childNodes[k - 1];
|
|
@@ -15423,7 +15677,7 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
15423
15677
|
}
|
|
15424
15678
|
}
|
|
15425
15679
|
}
|
|
15426
|
-
}
|
|
15680
|
+
});
|
|
15427
15681
|
}
|
|
15428
15682
|
};
|
|
15429
15683
|
for (var j = 0; j < elementCount; j++) {
|
|
@@ -15572,6 +15826,7 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
15572
15826
|
* @private
|
|
15573
15827
|
*/
|
|
15574
15828
|
Zoom.prototype.processTemplate = function (x, y, scale, maps) {
|
|
15829
|
+
var currentLabelIndex = 0;
|
|
15575
15830
|
for (var i = 0; i < this.templateCount; i++) {
|
|
15576
15831
|
var factor = maps.mapLayerPanel.calculateFactor(this.currentLayer);
|
|
15577
15832
|
var markerTemplateElement = getElementByID(maps.element.id + '_LayerIndex_' +
|
|
@@ -15588,7 +15843,8 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
15588
15843
|
}
|
|
15589
15844
|
if ((!isNullOrUndefined(datalabelTemplateElemement)) && datalabelTemplateElemement.childElementCount > 0) {
|
|
15590
15845
|
for (var k = 0; k < datalabelTemplateElemement.childElementCount; k++) {
|
|
15591
|
-
this.dataLabelTranslate(datalabelTemplateElemement.childNodes[k], factor, x, y, scale, 'Template');
|
|
15846
|
+
this.dataLabelTranslate(datalabelTemplateElemement.childNodes[k], factor, x, y, scale, 'Template', false, currentLabelIndex);
|
|
15847
|
+
currentLabelIndex++;
|
|
15592
15848
|
}
|
|
15593
15849
|
}
|
|
15594
15850
|
if (!isNullOrUndefined(polygonElement)) {
|
|
@@ -15599,7 +15855,7 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
15599
15855
|
}
|
|
15600
15856
|
}
|
|
15601
15857
|
};
|
|
15602
|
-
Zoom.prototype.dataLabelTranslate = function (element, factor, x, y, scale, type, animate$$1) {
|
|
15858
|
+
Zoom.prototype.dataLabelTranslate = function (element, factor, x, y, scale, type, animate$$1, currentLabelIndex, isPanning, intersect) {
|
|
15603
15859
|
if (animate$$1 === void 0) { animate$$1 = false; }
|
|
15604
15860
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
15605
15861
|
var labelCollection = this.maps.dataLabelModule.dataLabelCollections;
|
|
@@ -15616,77 +15872,80 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
15616
15872
|
labelIndex = parseFloat(element.id.split('_LabelIndex_')[1].split('_')[0]);
|
|
15617
15873
|
}
|
|
15618
15874
|
var duration = this.currentLayer.animationDuration === 0 && animationMode === 'Enable' ? 1000 : this.currentLayer.animationDuration;
|
|
15619
|
-
|
|
15620
|
-
|
|
15621
|
-
|
|
15622
|
-
|
|
15623
|
-
|
|
15624
|
-
|
|
15625
|
-
|
|
15626
|
-
|
|
15627
|
-
|
|
15628
|
-
|
|
15629
|
-
|
|
15630
|
-
zoomtext = label['dataLabelText'];
|
|
15631
|
-
zoomtextSize = measureText(zoomtext, style);
|
|
15632
|
-
locationX = ((labelX + x) * scale) - (zoomtextSize['width'] / 2);
|
|
15633
|
-
locationY = ((labelY + y) * scale) - (zoomtextSize['height']);
|
|
15634
|
-
}
|
|
15635
|
-
else {
|
|
15636
|
-
var layerEle = getElementByID(this.maps.element.id + '_Layer_Collections');
|
|
15637
|
-
labelX = ((Math.abs(this.maps.baseMapRectBounds['min']['x'] - labelX)) * scale);
|
|
15638
|
-
labelY = ((Math.abs(this.maps.baseMapRectBounds['min']['y'] - labelY)) * scale);
|
|
15639
|
-
var layerOffset = layerEle.getBoundingClientRect();
|
|
15640
|
-
var elementOffset = element.parentElement.getBoundingClientRect();
|
|
15641
|
-
locationX = ((labelX) + (layerOffset.left - elementOffset.left));
|
|
15642
|
-
locationY = ((labelY) + (layerOffset.top - elementOffset.top));
|
|
15643
|
-
}
|
|
15644
|
-
element.style.left = locationX + 'px';
|
|
15645
|
-
element.style.top = locationY + 'px';
|
|
15646
|
-
}
|
|
15647
|
-
else {
|
|
15648
|
-
labelX = ((labelX + x) * scale);
|
|
15649
|
-
labelY = ((labelY + y) * scale);
|
|
15875
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
15876
|
+
var label = labelCollection[currentLabelIndex];
|
|
15877
|
+
var index = currentLabelIndex;
|
|
15878
|
+
if (label['layerIndex'] === layerIndex && label['shapeIndex'] === shapeIndex
|
|
15879
|
+
&& label['labelIndex'] === labelIndex) {
|
|
15880
|
+
var labelX = label['location']['x'];
|
|
15881
|
+
var labelY = label['location']['y'];
|
|
15882
|
+
if (type === 'Template') {
|
|
15883
|
+
var locationX = 0;
|
|
15884
|
+
var locationY = 0;
|
|
15885
|
+
if (this.maps.isTileMap) {
|
|
15650
15886
|
zoomtext = label['dataLabelText'];
|
|
15651
15887
|
zoomtextSize = measureText(zoomtext, style);
|
|
15652
|
-
|
|
15653
|
-
|
|
15888
|
+
locationX = ((labelX + x) * scale) - (zoomtextSize['width'] / 2);
|
|
15889
|
+
locationY = ((labelY + y) * scale) - (zoomtextSize['height']);
|
|
15890
|
+
}
|
|
15891
|
+
else {
|
|
15892
|
+
var layerEle = getElementByID(this.maps.element.id + '_Layer_Collections');
|
|
15893
|
+
labelX = ((Math.abs(this.maps.baseMapRectBounds['min']['x'] - labelX)) * scale);
|
|
15894
|
+
labelY = ((Math.abs(this.maps.baseMapRectBounds['min']['y'] - labelY)) * scale);
|
|
15895
|
+
var layerOffset = layerEle.getBoundingClientRect();
|
|
15896
|
+
var elementOffset = element.parentElement.getBoundingClientRect();
|
|
15897
|
+
locationX = ((labelX) + (layerOffset.left - elementOffset.left));
|
|
15898
|
+
locationY = ((labelY) + (layerOffset.top - elementOffset.top));
|
|
15899
|
+
}
|
|
15900
|
+
element.style.left = locationX + 'px';
|
|
15901
|
+
element.style.top = locationY + 'px';
|
|
15902
|
+
}
|
|
15903
|
+
else {
|
|
15904
|
+
labelX = ((labelX + x) * scale);
|
|
15905
|
+
labelY = ((labelY + y) * scale);
|
|
15906
|
+
zoomtext = label['dataLabelText'];
|
|
15907
|
+
if (!animate$$1 || duration === 0) {
|
|
15908
|
+
element.setAttribute('transform', 'translate( ' + labelX + ' ' + labelY + ' )');
|
|
15909
|
+
}
|
|
15910
|
+
if ((isNullOrUndefined(isPanning) || !isPanning) && (this.maps.layers[this.index].dataLabelSettings.smartLabelMode !== 'None' ||
|
|
15911
|
+
this.maps.layers[this.index].dataLabelSettings.intersectionAction !== 'None')) {
|
|
15912
|
+
zoomtextSize = measureTextElement(zoomtext, style);
|
|
15913
|
+
var start = labelY - zoomtextSize['height'] / 2;
|
|
15914
|
+
var end = labelY + zoomtextSize['height'] / 2;
|
|
15654
15915
|
var xpositionEnds = labelX + zoomtextSize['width'] / 2;
|
|
15655
15916
|
var xpositionStart = labelX - zoomtextSize['width'] / 2;
|
|
15656
15917
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
15657
15918
|
var textLocations = { rightWidth: xpositionEnds, leftWidth: xpositionStart, heightTop: start, heightBottom: end };
|
|
15658
|
-
if (!animate$$1 || duration === 0) {
|
|
15659
|
-
element.setAttribute('transform', 'translate( ' + labelX + ' ' + labelY + ' )');
|
|
15660
|
-
}
|
|
15661
15919
|
if (this.maps.layers[this.index].dataLabelSettings.smartLabelMode === 'Hide') {
|
|
15662
15920
|
if (scale > 1) {
|
|
15663
|
-
text = ((this.maps.dataLabelShape[
|
|
15921
|
+
text = ((this.maps.dataLabelShape[index] * scale) >= zoomtextSize['width']) ? zoomtext : '';
|
|
15664
15922
|
element.textContent = text;
|
|
15665
15923
|
}
|
|
15666
15924
|
else {
|
|
15667
|
-
text = (this.maps.dataLabelShape[
|
|
15925
|
+
text = (this.maps.dataLabelShape[index] >= zoomtextSize['width']) ? zoomtext : '';
|
|
15668
15926
|
element.textContent = text;
|
|
15669
15927
|
}
|
|
15670
15928
|
}
|
|
15929
|
+
var widthList = [];
|
|
15671
15930
|
if (this.maps.layers[this.index].dataLabelSettings.smartLabelMode === 'Trim') {
|
|
15672
15931
|
if (scale > 1) {
|
|
15673
|
-
zoomtrimLabel = textTrim((this.maps.dataLabelShape[
|
|
15932
|
+
zoomtrimLabel = textTrim((this.maps.dataLabelShape[index] * scale), zoomtext, style, zoomtextSize.width, true, widthList);
|
|
15674
15933
|
text = zoomtrimLabel;
|
|
15675
15934
|
element.textContent = text;
|
|
15676
15935
|
}
|
|
15677
15936
|
else {
|
|
15678
|
-
zoomtrimLabel = textTrim(this.maps.dataLabelShape[
|
|
15937
|
+
zoomtrimLabel = textTrim(this.maps.dataLabelShape[index], zoomtext, style, zoomtextSize.width, true, widthList);
|
|
15679
15938
|
text = zoomtrimLabel;
|
|
15680
15939
|
element.textContent = text;
|
|
15681
15940
|
}
|
|
15682
15941
|
}
|
|
15683
15942
|
if (this.maps.layers[this.index].dataLabelSettings.intersectionAction === 'Hide') {
|
|
15684
|
-
for (var m = 0; m <
|
|
15685
|
-
if (!isNullOrUndefined(
|
|
15686
|
-
if (textLocations['leftWidth'] >
|
|
15687
|
-
|| textLocations['rightWidth'] <
|
|
15688
|
-
|| textLocations['heightTop'] >
|
|
15689
|
-
|| textLocations['heightBottom'] <
|
|
15943
|
+
for (var m = 0; m < intersect.length; m++) {
|
|
15944
|
+
if (!isNullOrUndefined(intersect[m])) {
|
|
15945
|
+
if (textLocations['leftWidth'] > intersect[m]['rightWidth']
|
|
15946
|
+
|| textLocations['rightWidth'] < intersect[m]['leftWidth']
|
|
15947
|
+
|| textLocations['heightTop'] > intersect[m]['heightBottom']
|
|
15948
|
+
|| textLocations['heightBottom'] < intersect[m]['heightTop']) {
|
|
15690
15949
|
text = !isNullOrUndefined(text) ? text : zoomtext;
|
|
15691
15950
|
element.textContent = text;
|
|
15692
15951
|
}
|
|
@@ -15697,50 +15956,53 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
15697
15956
|
}
|
|
15698
15957
|
}
|
|
15699
15958
|
}
|
|
15700
|
-
|
|
15959
|
+
intersect.push(textLocations);
|
|
15701
15960
|
}
|
|
15702
15961
|
if (this.maps.layers[this.index].dataLabelSettings.intersectionAction === 'Trim') {
|
|
15703
|
-
for (var j = 0; j <
|
|
15704
|
-
if (!isNullOrUndefined(
|
|
15705
|
-
if (textLocations['rightWidth'] <
|
|
15706
|
-
|| textLocations['leftWidth'] >
|
|
15707
|
-
|| textLocations['heightBottom'] <
|
|
15708
|
-
|| textLocations['heightTop'] >
|
|
15962
|
+
for (var j = 0; j < intersect.length; j++) {
|
|
15963
|
+
if (!isNullOrUndefined(intersect[j])) {
|
|
15964
|
+
if (textLocations['rightWidth'] < intersect[j]['leftWidth']
|
|
15965
|
+
|| textLocations['leftWidth'] > intersect[j]['rightWidth']
|
|
15966
|
+
|| textLocations['heightBottom'] < intersect[j]['heightTop']
|
|
15967
|
+
|| textLocations['heightTop'] > intersect[j]['heightBottom']) {
|
|
15709
15968
|
trimmedLable = !isNullOrUndefined(text) ? text : zoomtext;
|
|
15710
15969
|
if (scale > 1) {
|
|
15711
|
-
|
|
15970
|
+
var trimmedWidth = widthList.length > 0 ? widthList[0] : zoomtextSize.width;
|
|
15971
|
+
trimmedLable = textTrim((this.maps.dataLabelShape[index] * scale), trimmedLable, style, trimmedWidth, true);
|
|
15712
15972
|
}
|
|
15713
15973
|
element.textContent = trimmedLable;
|
|
15714
15974
|
}
|
|
15715
15975
|
else {
|
|
15716
|
-
if (textLocations['leftWidth'] >
|
|
15717
|
-
var width =
|
|
15976
|
+
if (textLocations['leftWidth'] > intersect[j]['leftWidth']) {
|
|
15977
|
+
var width = intersect[j]['rightWidth'] - textLocations['leftWidth'];
|
|
15718
15978
|
var difference = width - (textLocations['rightWidth'] - textLocations['leftWidth']);
|
|
15719
15979
|
text = !isNullOrUndefined(text) ? text : zoomtext;
|
|
15720
|
-
|
|
15980
|
+
var trimmedWidth = widthList.length > 0 ? widthList[0] : zoomtextSize.width;
|
|
15981
|
+
trimmedLable = textTrim(difference, text, style, trimmedWidth, true);
|
|
15721
15982
|
element.textContent = trimmedLable;
|
|
15722
15983
|
break;
|
|
15723
15984
|
}
|
|
15724
|
-
if (textLocations['leftWidth'] <
|
|
15725
|
-
var width = textLocations['rightWidth'] -
|
|
15985
|
+
if (textLocations['leftWidth'] < intersect[j]['leftWidth']) {
|
|
15986
|
+
var width = textLocations['rightWidth'] - intersect[j]['leftWidth'];
|
|
15726
15987
|
var difference = Math.abs(width - (textLocations['rightWidth'] - textLocations['leftWidth']));
|
|
15727
15988
|
text = !isNullOrUndefined(text) ? text : zoomtext;
|
|
15728
|
-
|
|
15989
|
+
var trimmedWidth = widthList.length > 0 ? widthList[0] : zoomtextSize.width;
|
|
15990
|
+
trimmedLable = textTrim(difference, text, style, trimmedWidth, true);
|
|
15729
15991
|
element.textContent = trimmedLable;
|
|
15730
15992
|
break;
|
|
15731
15993
|
}
|
|
15732
15994
|
}
|
|
15733
15995
|
}
|
|
15734
15996
|
}
|
|
15735
|
-
|
|
15997
|
+
intersect.push(textLocations);
|
|
15736
15998
|
if (isNullOrUndefined(trimmedLable)) {
|
|
15737
|
-
trimmedLable = textTrim((this.maps.dataLabelShape[
|
|
15999
|
+
trimmedLable = textTrim((this.maps.dataLabelShape[index] * scale), zoomtext, style, zoomtextSize.width, true);
|
|
15738
16000
|
element.textContent = trimmedLable;
|
|
15739
16001
|
}
|
|
15740
16002
|
}
|
|
15741
|
-
|
|
15742
|
-
|
|
15743
|
-
|
|
16003
|
+
}
|
|
16004
|
+
if (animate$$1 || duration > 0) {
|
|
16005
|
+
smoothTranslate(element, 0, duration, new MapLocation(labelX, labelY));
|
|
15744
16006
|
}
|
|
15745
16007
|
}
|
|
15746
16008
|
}
|
|
@@ -15886,15 +16148,15 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
15886
16148
|
if (!panArgs.cancel) {
|
|
15887
16149
|
if (panningXDirection && panningYDirection) {
|
|
15888
16150
|
map.translatePoint = new Point(x, y);
|
|
15889
|
-
this.applyTransform(map);
|
|
16151
|
+
this.applyTransform(map, false, true);
|
|
15890
16152
|
}
|
|
15891
16153
|
else if (panningXDirection) {
|
|
15892
16154
|
map.translatePoint = new Point(x, map.translatePoint.y);
|
|
15893
|
-
this.applyTransform(map);
|
|
16155
|
+
this.applyTransform(map, false, true);
|
|
15894
16156
|
}
|
|
15895
16157
|
else if (panningYDirection) {
|
|
15896
16158
|
map.translatePoint = new Point(map.translatePoint.x, y);
|
|
15897
|
-
this.applyTransform(map);
|
|
16159
|
+
this.applyTransform(map, false, true);
|
|
15898
16160
|
}
|
|
15899
16161
|
}
|
|
15900
16162
|
this.maps.zoomNotApplied = false;
|
|
@@ -15925,7 +16187,7 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
15925
16187
|
};
|
|
15926
16188
|
map.trigger(pan, panArgs);
|
|
15927
16189
|
map.mapLayerPanel.generateTiles(map.tileZoomLevel, map.tileTranslatePoint, 'Pan');
|
|
15928
|
-
this.applyTransform(map);
|
|
16190
|
+
this.applyTransform(map, false, true);
|
|
15929
16191
|
}
|
|
15930
16192
|
map.zoomTranslatePoint = map.translatePoint;
|
|
15931
16193
|
this.mouseDownPoints = this.mouseMovePoints;
|
|
@@ -16045,6 +16307,7 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
16045
16307
|
}
|
|
16046
16308
|
this.maps.zoomNotApplied = false;
|
|
16047
16309
|
}
|
|
16310
|
+
this.triggerZoomComplete(map, prevLevel, type);
|
|
16048
16311
|
};
|
|
16049
16312
|
/**
|
|
16050
16313
|
* @private
|
|
@@ -16334,7 +16597,7 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
16334
16597
|
};
|
|
16335
16598
|
Zoom.prototype.panningStyle = function (toolbar) {
|
|
16336
16599
|
var svg = getElementByID(this.maps.element.id + '_svg');
|
|
16337
|
-
if (toolbar === 'pan' || (this.
|
|
16600
|
+
if (toolbar === 'pan' || (this.isPanModeEnabled && toolbar !== 'reset')) {
|
|
16338
16601
|
svg.setAttribute('class', 'e-maps-panning');
|
|
16339
16602
|
}
|
|
16340
16603
|
else {
|
|
@@ -16681,8 +16944,8 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
16681
16944
|
this.isTouch = true;
|
|
16682
16945
|
touches = e.touches;
|
|
16683
16946
|
target = e.target;
|
|
16684
|
-
pageX = touches[0].
|
|
16685
|
-
pageY = touches[0].
|
|
16947
|
+
pageX = touches[0].pageX;
|
|
16948
|
+
pageY = touches[0].pageY;
|
|
16686
16949
|
}
|
|
16687
16950
|
else {
|
|
16688
16951
|
pageX = e.pageX;
|
|
@@ -16690,11 +16953,11 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
16690
16953
|
target = e.target;
|
|
16691
16954
|
}
|
|
16692
16955
|
if (!this.maps.zoomSettings.enablePanning) {
|
|
16693
|
-
this.isPan = this.
|
|
16956
|
+
this.isPan = this.isPanModeEnabled = this.panColor !== this.selectionColor ? this.maps.zoomSettings.enablePanning
|
|
16694
16957
|
: this.zoomColor === this.selectionColor;
|
|
16695
16958
|
}
|
|
16696
16959
|
else {
|
|
16697
|
-
this.isPan = this.
|
|
16960
|
+
this.isPan = this.isPanModeEnabled = !this.isZoomSelection;
|
|
16698
16961
|
}
|
|
16699
16962
|
this.mouseDownLatLong = { x: pageX, y: pageY };
|
|
16700
16963
|
var scale = this.maps.isTileMap ? Math.round(this.maps.tileZoomLevel) : Math.round(this.maps.mapScaleValue);
|
|
@@ -16721,8 +16984,8 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
16721
16984
|
this.isTouch = true;
|
|
16722
16985
|
target = e.target;
|
|
16723
16986
|
touches = e.touches;
|
|
16724
|
-
pageX = touches[0].
|
|
16725
|
-
pageY = touches[0].
|
|
16987
|
+
pageX = touches[0].pageX;
|
|
16988
|
+
pageY = touches[0].pageY;
|
|
16726
16989
|
}
|
|
16727
16990
|
else {
|
|
16728
16991
|
pageX = e.pageX;
|
|
@@ -16756,7 +17019,7 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
16756
17019
|
this.mouseMovePoints = this.getMousePosition(pageX, pageY);
|
|
16757
17020
|
var targetId = e.target['id'];
|
|
16758
17021
|
var targetEle = e.target;
|
|
16759
|
-
if (zoom.enable && this.
|
|
17022
|
+
if (zoom.enable && this.isPanModeEnabled && this.maps.markerDragId.indexOf('_MarkerIndex_') == -1 && ((Browser.isDevice && touches.length >= 1) || !Browser.isDevice)) {
|
|
16760
17023
|
e.preventDefault();
|
|
16761
17024
|
this.maps.element.style.cursor = 'pointer';
|
|
16762
17025
|
this.mouseMoveLatLong = { x: pageX, y: pageY };
|
|
@@ -16786,13 +17049,66 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
16786
17049
|
Zoom.prototype.mouseUpHandler = function (e) {
|
|
16787
17050
|
var map = this.maps;
|
|
16788
17051
|
this.rectZoomingStart = false;
|
|
16789
|
-
this.isPanning = false;
|
|
16790
17052
|
this.isSingleClick = this.isSingleClick ? true : false;
|
|
16791
17053
|
this.isTouch = false;
|
|
16792
17054
|
this.touchStartList = [];
|
|
16793
17055
|
this.touchMoveList = [];
|
|
16794
17056
|
this.lastScale = 1;
|
|
16795
17057
|
this.maps.element.style.cursor = 'auto';
|
|
17058
|
+
// eslint-disable-next-line max-len
|
|
17059
|
+
if (this.isPanModeEnabled && this.maps.zoomSettings.enablePanning && !isNullOrUndefined(this.maps.previousPoint) &&
|
|
17060
|
+
(this.maps.translatePoint.x !== this.maps.previousPoint.x && this.maps.translatePoint.y !== this.maps.previousPoint.y)) {
|
|
17061
|
+
var pageX = void 0;
|
|
17062
|
+
var pageY = void 0;
|
|
17063
|
+
var layerX = 0;
|
|
17064
|
+
var layerY = 0;
|
|
17065
|
+
var target = void 0;
|
|
17066
|
+
var rect = this.maps.element.getBoundingClientRect();
|
|
17067
|
+
var element = e.target;
|
|
17068
|
+
if (e.type.indexOf('touch') !== -1) {
|
|
17069
|
+
var touchArg = e;
|
|
17070
|
+
layerX = pageX = touchArg.changedTouches[0].pageX;
|
|
17071
|
+
pageY = touchArg.changedTouches[0].pageY;
|
|
17072
|
+
layerY = pageY - (this.maps.isTileMap ? 10 : 0);
|
|
17073
|
+
target = touchArg.target;
|
|
17074
|
+
this.maps.mouseClickEvent = { x: pageX, y: pageY };
|
|
17075
|
+
}
|
|
17076
|
+
else {
|
|
17077
|
+
pageX = e.pageX;
|
|
17078
|
+
pageY = e.pageY;
|
|
17079
|
+
layerX = e['layerX'];
|
|
17080
|
+
layerY = e['layerY'] - (this.maps.isTileMap ? 10 : 0);
|
|
17081
|
+
target = e.target;
|
|
17082
|
+
}
|
|
17083
|
+
var panCompleteEventArgs = void 0;
|
|
17084
|
+
var minMaxLatitudeLongitude = this.maps.getMinMaxLatitudeLongitude();
|
|
17085
|
+
if (!this.maps.isTileMap) {
|
|
17086
|
+
this.maps.mouseClickEvent['x'] = this.maps.mouseDownEvent['x'];
|
|
17087
|
+
this.maps.mouseClickEvent['y'] = this.maps.mouseDownEvent['y'];
|
|
17088
|
+
var location_5 = this.maps.getClickLocation(element.id, pageX, pageY, element, pageX, pageY);
|
|
17089
|
+
panCompleteEventArgs = {
|
|
17090
|
+
cancel: false, name: 'panComplete', maps: this.maps,
|
|
17091
|
+
tileTranslatePoint: {}, translatePoint: { previous: this.maps.previousPoint, current: this.maps.translatePoint },
|
|
17092
|
+
scale: this.maps.scale, tileZoomLevel: this.maps.tileZoomLevel, latitude: !isNullOrUndefined(location_5) ?
|
|
17093
|
+
location_5.latitude : 0, longitude: !isNullOrUndefined(location_5) ? location_5.longitude : 0,
|
|
17094
|
+
minLatitude: minMaxLatitudeLongitude.minLatitude, maxLatitude: minMaxLatitudeLongitude.maxLatitude,
|
|
17095
|
+
minLongitude: minMaxLatitudeLongitude.minLongitude, maxLongitude: minMaxLatitudeLongitude.maxLongitude
|
|
17096
|
+
};
|
|
17097
|
+
}
|
|
17098
|
+
else {
|
|
17099
|
+
var location_6 = this.maps.getTileGeoLocation(layerX, layerY);
|
|
17100
|
+
panCompleteEventArgs = {
|
|
17101
|
+
cancel: false, name: 'panComplete', maps: this.maps,
|
|
17102
|
+
tileTranslatePoint: { previous: this.maps.tileTranslatePoint, current: this.maps.tileTranslatePoint },
|
|
17103
|
+
translatePoint: { previous: this.maps.previousPoint, current: this.maps.translatePoint }, scale: this.maps.scale,
|
|
17104
|
+
tileZoomLevel: this.maps.tileZoomLevel, latitude: location_6.latitude, longitude: location_6.longitude,
|
|
17105
|
+
minLatitude: minMaxLatitudeLongitude.minLatitude, maxLatitude: minMaxLatitudeLongitude.maxLatitude,
|
|
17106
|
+
minLongitude: minMaxLatitudeLongitude.minLongitude, maxLongitude: minMaxLatitudeLongitude.maxLongitude
|
|
17107
|
+
};
|
|
17108
|
+
}
|
|
17109
|
+
this.maps.trigger('panComplete', panCompleteEventArgs);
|
|
17110
|
+
}
|
|
17111
|
+
this.isPanModeEnabled = false;
|
|
16796
17112
|
if ((!isNullOrUndefined(this.distanceX) || !isNullOrUndefined(this.distanceY)) && (!isNullOrUndefined(this.currentLayer) && this.currentLayer.type === 'SubLayer')) {
|
|
16797
17113
|
this.toAlignSublayer();
|
|
16798
17114
|
this.distanceX = this.distanceY = null;
|
|
@@ -16809,7 +17125,7 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
16809
17125
|
* @private
|
|
16810
17126
|
*/
|
|
16811
17127
|
Zoom.prototype.mouseCancelHandler = function (e) {
|
|
16812
|
-
this.
|
|
17128
|
+
this.isPanModeEnabled = false;
|
|
16813
17129
|
this.isTouch = false;
|
|
16814
17130
|
this.rectZoomingStart = false;
|
|
16815
17131
|
var zoomRectElement = getElementByID(this.maps.element.id + '_Selection_Rect_Zooming');
|
|
@@ -16889,7 +17205,7 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
16889
17205
|
this.maps.off(Browser.touchMoveEvent, this.mouseMoveHandler);
|
|
16890
17206
|
this.maps.off(Browser.touchStartEvent, this.mouseDownHandler);
|
|
16891
17207
|
this.maps.off(Browser.touchEndEvent, this.mouseUpHandler);
|
|
16892
|
-
this.maps.
|
|
17208
|
+
EventHandler.remove(this.maps.element, this.cancelEvent, this.mouseCancelHandler);
|
|
16893
17209
|
};
|
|
16894
17210
|
/**
|
|
16895
17211
|
* Get module name.
|
|
@@ -16918,14 +17234,12 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
16918
17234
|
this.mouseDownPoints = null;
|
|
16919
17235
|
this.mouseMovePoints = null;
|
|
16920
17236
|
this.startTouches = [];
|
|
16921
|
-
this.zoomshapewidth = null;
|
|
16922
|
-
this.intersect = [];
|
|
16923
17237
|
this.mouseDownLatLong = null;
|
|
16924
17238
|
this.mouseMoveLatLong = null;
|
|
16925
17239
|
this.removeEventListener();
|
|
16926
|
-
|
|
16927
|
-
//this.maps = null;
|
|
17240
|
+
this.layerCollectionEle = null;
|
|
16928
17241
|
this.currentLayer = null;
|
|
17242
|
+
this.maps = null;
|
|
16929
17243
|
};
|
|
16930
17244
|
return Zoom;
|
|
16931
17245
|
}());
|
|
@@ -17410,5 +17724,5 @@ var PdfExport = /** @__PURE__ @class */ (function () {
|
|
|
17410
17724
|
* exporting all modules from maps index
|
|
17411
17725
|
*/
|
|
17412
17726
|
|
|
17413
|
-
export { Maps, load, loaded, click, onclick, rightClick, doubleClick, resize, tooltipRender, shapeSelected, shapeHighlight, mousemove, mouseup, mousedown, layerRendering, shapeRendering, markerRendering, markerClusterRendering, markerClick, markerDragStart, markerDragEnd, markerClusterClick, markerMouseMove, markerClusterMouseMove, dataLabelRendering, bubbleRendering, bubbleClick, bubbleMouseMove, animationComplete, legendRendering, annotationRendering, itemSelection, itemHighlight, beforePrint, zoomIn, zoomOut, pan, Annotation, Arrow, Font, ZoomToolbarButtonSettings, ZoomToolbarTooltipSettings, ZoomToolbarSettings, Border, CenterPosition, TooltipSettings, Margin, ConnectorLineSettings, MarkerClusterSettings, MarkerClusterData, ColorMappingSettings, InitialMarkerSelectionSettings, InitialShapeSelectionSettings, SelectionSettings, HighlightSettings, PolygonSetting, PolygonSettings, NavigationLineSettings, BubbleSettings, CommonTitleSettings, SubTitleSettings, TitleSettings, ZoomSettings, ToggleLegendSettings, LegendSettings, DataLabelSettings, ShapeSettings, MarkerBase, MarkerSettings, LayerSettings, Tile, MapsAreaSettings, Size, stringToNumber, calculateSize, createSvg, getMousePosition, degreesToRadians, radiansToDegrees, convertGeoToPoint, calculatePolygonPath, convertTileLatLongToPoint, xToCoordinate, yToCoordinate, aitoff, roundTo, sinci, acos, calculateBound, triggerDownload, Point, Coordinate, MinMax, GeoLocation, measureText, TextOption, PathOption, ColorValue, RectOption, CircleOption, PolygonOption, PolylineOption, LineOption, Line, MapLocation, Rect, PatternOptions, renderTextElement, convertElement, formatValue, convertStringToValue, convertElementFromLabel, drawSymbols, getValueFromObject, markerColorChoose, markerShapeChoose, clusterTemplate, mergeSeparateCluster, clusterSeparate, marker, markerTemplate, maintainSelection, maintainStyleClass, appendShape, drawCircle, drawRectangle, drawPath, drawPolygon, drawPolyline, drawLine, calculateShapes, drawDiamond, drawTriangle, drawCross, drawHorizontalLine, drawVerticalLine, drawStar, drawBalloon, drawPattern, getFieldData, checkShapeDataFields, checkPropertyPath, filter, getRatioOfBubble, findMidPointOfPolygon, isCustomPath, textTrim, findPosition, removeElement, calculateCenterFromPixel, getTranslate, getZoomTranslate, fixInitialScaleForTile, getElementByID, getClientElement, Internalize, getTemplateFunction, getElement, getShapeData, triggerShapeEvent, getElementsByClassName, querySelector, getTargetElement, createStyle, customizeStyle, triggerItemSelectionEvent, removeClass, elementAnimate, timeout, showTooltip, wordWrap, createTooltip, getHexColor, drawSymbol, renderLegendShape, getElementOffset, changeBorderWidth, changeNavaigationLineWidth, targetTouches, calculateScale, getDistance, getTouches, getTouchCenter, sum, zoomAnimate, animate, MapAjax, smoothTranslate, compareZoomFactor, calculateZoomLevel, processResult, LayerPanel, Bubble, BingMap, Marker, Polygon, ColorMapping, DataLabel, NavigationLine, Legend, Highlight, Selection, MapsTooltip, Zoom, Annotations, Print, ImageExport, PdfExport };
|
|
17727
|
+
export { Maps, load, loaded, click, onclick, rightClick, doubleClick, resize, tooltipRender, shapeSelected, shapeHighlight, mousemove, mouseup, mousedown, layerRendering, shapeRendering, markerRendering, markerClusterRendering, markerClick, markerDragStart, markerDragEnd, markerClusterClick, markerMouseMove, markerClusterMouseMove, dataLabelRendering, bubbleRendering, bubbleClick, bubbleMouseMove, animationComplete, legendRendering, annotationRendering, itemSelection, panComplete, zoomComplete, itemHighlight, beforePrint, zoomIn, zoomOut, pan, Annotation, Arrow, Font, ZoomToolbarButtonSettings, ZoomToolbarTooltipSettings, ZoomToolbarSettings, Border, CenterPosition, TooltipSettings, PolygonTooltipSettings, Margin, ConnectorLineSettings, MarkerClusterSettings, MarkerClusterData, ColorMappingSettings, InitialMarkerSelectionSettings, InitialShapeSelectionSettings, SelectionSettings, HighlightSettings, PolygonSetting, PolygonSettings, NavigationLineSettings, BubbleSettings, CommonTitleSettings, SubTitleSettings, TitleSettings, ZoomSettings, ToggleLegendSettings, LegendSettings, DataLabelSettings, ShapeSettings, MarkerBase, MarkerSettings, LayerSettings, Tile, MapsAreaSettings, Size, stringToNumber, calculateSize, createSvg, getMousePosition, degreesToRadians, radiansToDegrees, convertGeoToPoint, calculatePolygonPath, convertTileLatLongToPoint, xToCoordinate, yToCoordinate, aitoff, roundTo, sinci, acos, calculateBound, triggerDownload, Point, Coordinate, MinMax, GeoLocation, measureText, measureTextElement, TextOption, PathOption, ColorValue, RectOption, CircleOption, PolygonOption, PolylineOption, LineOption, Line, MapLocation, Rect, PatternOptions, renderTextElement, convertElement, formatValue, convertStringToValue, convertElementFromLabel, drawSymbols, getValueFromObject, markerColorChoose, markerShapeChoose, clusterTemplate, markerClusterListHandler, markerBoundsComparer, mergeSeparateCluster, clusterSeparate, marker, markerTemplate, maintainSelection, maintainStyleClass, appendShape, drawCircle, drawRectangle, drawPath, drawPolygon, drawPolyline, drawLine, calculateShapes, drawDiamond, drawTriangle, drawCross, drawHorizontalLine, drawVerticalLine, drawStar, drawBalloon, drawPattern, getFieldData, checkShapeDataFields, checkPropertyPath, filter, getRatioOfBubble, findMidPointOfPolygon, isCustomPath, textTrim, findPosition, removeElement, calculateCenterFromPixel, getTranslate, getZoomTranslate, fixInitialScaleForTile, getElementByID, getClientElement, Internalize, getTemplateFunction, getElement, getShapeData, triggerShapeEvent, getElementsByClassName, querySelector, getTargetElement, createStyle, customizeStyle, triggerItemSelectionEvent, removeClass, elementAnimate, timeout, showTooltip, wordWrap, createTooltip, getHexColor, drawSymbol, renderLegendShape, getElementOffset, changeBorderWidth, changeNavaigationLineWidth, targetTouches, calculateScale, getDistance, getTouches, getTouchCenter, sum, zoomAnimate, animate, MapAjax, smoothTranslate, compareZoomFactor, calculateZoomLevel, processResult, LayerPanel, Bubble, BingMap, Marker, Polygon, ColorMapping, DataLabel, NavigationLine, Legend, Highlight, Selection, MapsTooltip, Zoom, Annotations, Print, ImageExport, PdfExport };
|
|
17414
17728
|
//# sourceMappingURL=ej2-maps.es5.js.map
|