@syncfusion/ej2-maps 23.2.7 → 24.1.41
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 +14 -1
- 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 +1041 -747
- package/dist/es6/ej2-maps.es2015.js.map +1 -1
- package/dist/es6/ej2-maps.es5.js +1066 -757
- 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/global.js +1 -1
- package/src/maps/index.d.ts +1 -0
- package/src/maps/index.js +1 -0
- package/src/maps/layers/layer-panel.js +14 -3
- package/src/maps/layers/legend.js +1 -1
- package/src/maps/layers/marker.js +21 -19
- package/src/maps/layers/polygon.d.ts +31 -0
- package/src/maps/layers/polygon.js +58 -0
- package/src/maps/maps-model.d.ts +1 -1
- package/src/maps/maps.d.ts +25 -1
- package/src/maps/maps.js +79 -15
- package/src/maps/model/base-model.d.ts +103 -25
- package/src/maps/model/base.d.ts +72 -7
- package/src/maps/model/base.js +53 -0
- package/src/maps/model/interface.d.ts +24 -3
- package/src/maps/user-interaction/highlight.js +6 -0
- package/src/maps/user-interaction/selection.js +13 -0
- package/src/maps/user-interaction/tooltip.js +13 -21
- package/src/maps/user-interaction/zoom.js +78 -16
- package/src/maps/utils/helper.d.ts +18 -0
- package/src/maps/utils/helper.js +54 -4
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Point, getElementByID, PathOption, Rect, convertGeoToPoint, CircleOption, convertTileLatLongToPoint } from '../utils/helper';
|
|
2
2
|
import { RectOption, createTooltip, calculateScale, getTouchCenter, getTouches, targetTouches } from '../utils/helper';
|
|
3
3
|
import { MapLocation, zoomAnimate, smoothTranslate, measureText, textTrim, clusterTemplate, marker } from '../utils/helper';
|
|
4
|
-
import { markerTemplate, removeElement, getElement, clusterSeparate, markerColorChoose } from '../utils/helper';
|
|
4
|
+
import { markerTemplate, removeElement, getElement, clusterSeparate, markerColorChoose, calculatePolygonPath } from '../utils/helper';
|
|
5
5
|
import { markerShapeChoose } from '../utils/helper';
|
|
6
6
|
import { isNullOrUndefined, EventHandler, Browser, remove, createElement, animationMode } from '@syncfusion/ej2-base';
|
|
7
7
|
import { changeBorderWidth, markerRendering } from '../index';
|
|
@@ -64,10 +64,10 @@ var Zoom = /** @class */ (function () {
|
|
|
64
64
|
Zoom.prototype.performZooming = function (position, newZoomFactor, type) {
|
|
65
65
|
var _this = this;
|
|
66
66
|
var map = this.maps;
|
|
67
|
-
map.previousProjection = map.projectionType;
|
|
67
|
+
map.previousProjection = newZoomFactor <= 1.5 ? undefined : map.projectionType;
|
|
68
68
|
map.defaultState = false;
|
|
69
69
|
map.initialCheck = false;
|
|
70
|
-
map.markerZoomedState = false;
|
|
70
|
+
map.markerZoomedState = map.isMarkerZoomCompleted = false;
|
|
71
71
|
map.zoomPersistence = map.enablePersistence;
|
|
72
72
|
var prevLevel = map.tileZoomLevel;
|
|
73
73
|
var scale = map.previousScale = map.scale;
|
|
@@ -115,6 +115,7 @@ var Zoom = /** @class */ (function () {
|
|
|
115
115
|
map.translatePoint = new Point(translatePointX, translatePointY);
|
|
116
116
|
}
|
|
117
117
|
map.scale = newZoomFactor;
|
|
118
|
+
map.zoomTranslatePoint = map.translatePoint;
|
|
118
119
|
if (this.triggerZoomEvent(prevTilePoint, prevLevel, type)) {
|
|
119
120
|
map.translatePoint = map.previousPoint;
|
|
120
121
|
map.scale = map.mapScaleValue = map.previousScale;
|
|
@@ -136,6 +137,7 @@ var Zoom = /** @class */ (function () {
|
|
|
136
137
|
newZoomFactor = map.tileZoomLevel = map.mapScaleValue = map.initialZoomLevel;
|
|
137
138
|
map.scale = Math.pow(2, newZoomFactor - 1);
|
|
138
139
|
}
|
|
140
|
+
map.mapScaleValue = isNaN(map.mapScaleValue) ? 1 : map.mapScaleValue;
|
|
139
141
|
map.translatePoint.y = (map.tileTranslatePoint.y - (0.01 * map.mapScaleValue)) / map.scale;
|
|
140
142
|
map.translatePoint.x = (map.tileTranslatePoint.x - (0.01 * map.mapScaleValue)) / map.scale;
|
|
141
143
|
if (this.triggerZoomEvent(prevTilePoint, prevLevel, type)) {
|
|
@@ -189,18 +191,28 @@ var Zoom = /** @class */ (function () {
|
|
|
189
191
|
Zoom.prototype.triggerZoomEvent = function (prevTilePoint, prevLevel, type) {
|
|
190
192
|
var map = this.maps;
|
|
191
193
|
var zoomArgs;
|
|
194
|
+
if (map.isTileMap) {
|
|
195
|
+
map.mapScaleValue = isNullOrUndefined(map.mapScaleValue) ? 1 : map.mapScaleValue;
|
|
196
|
+
map.translatePoint.y = (map.tileTranslatePoint.y - (0.01 * map.mapScaleValue)) / map.scale;
|
|
197
|
+
map.translatePoint.x = (map.tileTranslatePoint.x - (0.01 * map.mapScaleValue)) / map.scale;
|
|
198
|
+
}
|
|
199
|
+
var minMaxLatitudeLongitude = this.maps.getMinMaxLatitudeLongitude();
|
|
192
200
|
if (!map.isTileMap) {
|
|
193
201
|
zoomArgs = {
|
|
194
202
|
cancel: false, name: 'zoom', type: type, maps: map,
|
|
195
203
|
tileTranslatePoint: {}, translatePoint: { previous: map.previousPoint, current: map.translatePoint },
|
|
196
|
-
tileZoomLevel: {}, scale: { previous: map.previousScale, current: map.scale }
|
|
204
|
+
tileZoomLevel: {}, scale: { previous: map.previousScale, current: map.scale },
|
|
205
|
+
minLatitude: minMaxLatitudeLongitude.minLatitude, maxLatitude: minMaxLatitudeLongitude.maxLatitude,
|
|
206
|
+
minLongitude: minMaxLatitudeLongitude.minLongitude, maxLongitude: minMaxLatitudeLongitude.maxLongitude
|
|
197
207
|
};
|
|
198
208
|
}
|
|
199
209
|
else {
|
|
200
210
|
zoomArgs = {
|
|
201
211
|
cancel: false, name: 'zoom', type: type, maps: map,
|
|
202
212
|
tileTranslatePoint: { previous: prevTilePoint, current: map.tileTranslatePoint }, translatePoint: { previous: map.previousPoint, current: map.translatePoint },
|
|
203
|
-
tileZoomLevel: { previous: prevLevel, current: map.tileZoomLevel }, scale: { previous: map.previousScale, current: map.scale }
|
|
213
|
+
tileZoomLevel: { previous: prevLevel, current: map.tileZoomLevel }, scale: { previous: map.previousScale, current: map.scale },
|
|
214
|
+
minLatitude: minMaxLatitudeLongitude.minLatitude, maxLatitude: minMaxLatitudeLongitude.maxLatitude,
|
|
215
|
+
minLongitude: minMaxLatitudeLongitude.minLongitude, maxLongitude: minMaxLatitudeLongitude.maxLongitude
|
|
204
216
|
};
|
|
205
217
|
}
|
|
206
218
|
map.trigger('zoom', zoomArgs);
|
|
@@ -249,6 +261,7 @@ var Zoom = /** @class */ (function () {
|
|
|
249
261
|
map.translatePoint = new Point(translatePointX, translatePointY);
|
|
250
262
|
}
|
|
251
263
|
map.scale = zoomCalculationFactor < this.maps.zoomSettings.maxZoom ? zoomCalculationFactor : this.maps.zoomSettings.maxZoom;
|
|
264
|
+
map.zoomTranslatePoint = map.translatePoint;
|
|
252
265
|
isZoomCancelled = this.triggerZoomEvent(prevTilePoint, prevLevel, '');
|
|
253
266
|
if (isZoomCancelled) {
|
|
254
267
|
map.translatePoint = map.previousPoint;
|
|
@@ -304,6 +317,7 @@ var Zoom = /** @class */ (function () {
|
|
|
304
317
|
var map = this.maps;
|
|
305
318
|
var prevLevel = map.tileZoomLevel;
|
|
306
319
|
var availSize = map.mapAreaRect;
|
|
320
|
+
map.isMarkerZoomCompleted = false;
|
|
307
321
|
map.previousScale = map.scale;
|
|
308
322
|
map.previousPoint = map.translatePoint;
|
|
309
323
|
map.previousProjection = map.projectionType;
|
|
@@ -420,7 +434,9 @@ var Zoom = /** @class */ (function () {
|
|
|
420
434
|
Zoom.prototype.animateTransform = function (element, animate, x, y, scale) {
|
|
421
435
|
var duration = this.currentLayer.animationDuration === 0 && animationMode === 'Enable' ? 1000 : this.currentLayer.animationDuration;
|
|
422
436
|
if (!animate || duration === 0 || this.maps.isTileMap) {
|
|
423
|
-
|
|
437
|
+
if (!(this.maps.isTileMap && element.id.indexOf('_Polygons_Group') > -1)) {
|
|
438
|
+
element.setAttribute('transform', 'scale(' + (scale) + ') translate( ' + x + ' ' + y + ' )');
|
|
439
|
+
}
|
|
424
440
|
return;
|
|
425
441
|
}
|
|
426
442
|
if (!this.maps.isTileMap) {
|
|
@@ -431,6 +447,7 @@ var Zoom = /** @class */ (function () {
|
|
|
431
447
|
* @private
|
|
432
448
|
*/
|
|
433
449
|
Zoom.prototype.applyTransform = function (maps, animate) {
|
|
450
|
+
var _this = this;
|
|
434
451
|
var layerIndex;
|
|
435
452
|
this.templateCount = 0;
|
|
436
453
|
var layer;
|
|
@@ -469,6 +486,17 @@ var Zoom = /** @class */ (function () {
|
|
|
469
486
|
layerElement.appendChild(maps.navigationLineModule.renderNavigation(this.currentLayer, maps.tileZoomLevel, this.index));
|
|
470
487
|
}
|
|
471
488
|
}
|
|
489
|
+
else if (maps.isTileMap && (currentEle.id.indexOf('_Polygons_Group') > -1)) {
|
|
490
|
+
if (this.currentLayer.polygonSettings.polygons.length > 0) {
|
|
491
|
+
this.currentLayer.polygonSettings.polygons.map(function (polygonSettings, polygonIndex) {
|
|
492
|
+
var markerData = polygonSettings.points;
|
|
493
|
+
var path = calculatePolygonPath(maps, maps.tileZoomLevel, _this.currentLayer, markerData);
|
|
494
|
+
var element = document.getElementById(maps.element.id + '_LayerIndex_' + _this.index + '_PolygonIndex_' + polygonIndex);
|
|
495
|
+
element.setAttribute('d', path);
|
|
496
|
+
});
|
|
497
|
+
document.getElementById(maps.element.id + '_LayerIndex_' + this.index + '_Polygons_Group').style.visibility = '';
|
|
498
|
+
}
|
|
499
|
+
}
|
|
472
500
|
else if (currentEle.id.indexOf('Legend') === -1) {
|
|
473
501
|
changeBorderWidth(currentEle, this.index, scale, maps);
|
|
474
502
|
maps.zoomTranslatePoint = maps.translatePoint;
|
|
@@ -476,7 +504,7 @@ var Zoom = /** @class */ (function () {
|
|
|
476
504
|
}
|
|
477
505
|
}
|
|
478
506
|
else if (currentEle.id.indexOf('_Markers_Group') > -1) {
|
|
479
|
-
if (!this.isPanning && !isNullOrUndefined(currentEle.childNodes[0])) {
|
|
507
|
+
if ((!this.isPanning) && !isNullOrUndefined(currentEle.childNodes[0])) {
|
|
480
508
|
this.markerTranslates(currentEle.childNodes[0], factor, x, y, scale, 'Marker', layerElement, animate);
|
|
481
509
|
}
|
|
482
510
|
currentEle = layerElement.childNodes[j];
|
|
@@ -695,7 +723,19 @@ var Zoom = /** @class */ (function () {
|
|
|
695
723
|
var markerDataLength = markerDatas.length - _this.maps.markerNullCount;
|
|
696
724
|
if (markerSVGObject.childElementCount === (markerDataLength - markerTemplateCounts - nullCount) && (type !== 'Template')) {
|
|
697
725
|
if (_this.maps.isTileMap) {
|
|
698
|
-
|
|
726
|
+
var polygonsElement = document.getElementById(_this.maps.element.id + '_LayerIndex_' + layerIndex + '_Polygons_Group');
|
|
727
|
+
var polygonElement = document.getElementById(_this.maps.element.id + '_LayerIndex_' + layerIndex + '_Polygon_Group');
|
|
728
|
+
if (!isNullOrUndefined(polygonsElement)) {
|
|
729
|
+
polygonsElement.insertAdjacentElement('afterend', markerSVGObject);
|
|
730
|
+
}
|
|
731
|
+
else {
|
|
732
|
+
if (!isNullOrUndefined(polygonElement)) {
|
|
733
|
+
polygonElement.insertAdjacentElement('afterend', markerSVGObject);
|
|
734
|
+
}
|
|
735
|
+
else {
|
|
736
|
+
layerElement.insertBefore(markerSVGObject, layerElement.firstElementChild);
|
|
737
|
+
}
|
|
738
|
+
}
|
|
699
739
|
}
|
|
700
740
|
else {
|
|
701
741
|
layerElement.appendChild(markerSVGObject);
|
|
@@ -735,6 +775,8 @@ var Zoom = /** @class */ (function () {
|
|
|
735
775
|
i + '_Markers_Template_Group');
|
|
736
776
|
var datalabelTemplateElemement = getElementByID(maps.element.id + '_LayerIndex_'
|
|
737
777
|
+ i + '_Label_Template_Group');
|
|
778
|
+
var polygonElement = getElementByID(maps.element.id + '_LayerIndex_'
|
|
779
|
+
+ i + '_Polygons_Group');
|
|
738
780
|
if ((!isNullOrUndefined(markerTemplateElement)) && markerTemplateElement.childElementCount > 0) {
|
|
739
781
|
markerTemplateElement.style.visibility = 'visible';
|
|
740
782
|
for (var k = 0; k < markerTemplateElement.childElementCount; k++) {
|
|
@@ -746,6 +788,12 @@ var Zoom = /** @class */ (function () {
|
|
|
746
788
|
this.dataLabelTranslate(datalabelTemplateElemement.childNodes[k], factor, x, y, scale, 'Template');
|
|
747
789
|
}
|
|
748
790
|
}
|
|
791
|
+
if (!isNullOrUndefined(polygonElement)) {
|
|
792
|
+
for (var k = 0; k < polygonElement.childElementCount; k++) {
|
|
793
|
+
var width = maps.layersCollection[i].polygonSettings.polygons[k].borderWidth;
|
|
794
|
+
polygonElement.childNodes[k].childNodes[0].setAttribute('stroke-width', (width / scale).toString());
|
|
795
|
+
}
|
|
796
|
+
}
|
|
749
797
|
}
|
|
750
798
|
};
|
|
751
799
|
Zoom.prototype.dataLabelTranslate = function (element, factor, x, y, scale, type, animate) {
|
|
@@ -800,7 +848,6 @@ var Zoom = /** @class */ (function () {
|
|
|
800
848
|
zoomtextSize = measureText(zoomtext, style);
|
|
801
849
|
var start = labelY - zoomtextSize['height'] / 4;
|
|
802
850
|
var end = labelY + zoomtextSize['height'] / 4;
|
|
803
|
-
labelY = end;
|
|
804
851
|
var xpositionEnds = labelX + zoomtextSize['width'] / 2;
|
|
805
852
|
var xpositionStart = labelX - zoomtextSize['width'] / 2;
|
|
806
853
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -973,12 +1020,16 @@ var Zoom = /** @class */ (function () {
|
|
|
973
1020
|
for (var i = 0; i < map.layersCollection.length; i++) {
|
|
974
1021
|
var markerTemplateElement = getElementByID(this.maps.element.id + '_LayerIndex_' + i + '_Markers_Template_Group');
|
|
975
1022
|
var lineElement = getElementByID(this.maps.element.id + '_LayerIndex_' + i + '_line_Group');
|
|
1023
|
+
var polygonElement = getElementByID(this.maps.element.id + '_LayerIndex_' + i + '_Polygons_Group');
|
|
976
1024
|
if (!isNullOrUndefined(markerTemplateElement)) {
|
|
977
1025
|
markerTemplateElement.style.visibility = 'hidden';
|
|
978
1026
|
}
|
|
979
1027
|
if (!isNullOrUndefined(lineElement)) {
|
|
980
1028
|
lineElement.style.visibility = 'hidden';
|
|
981
1029
|
}
|
|
1030
|
+
if (!isNullOrUndefined(polygonElement)) {
|
|
1031
|
+
polygonElement.style.visibility = 'hidden';
|
|
1032
|
+
}
|
|
982
1033
|
}
|
|
983
1034
|
}
|
|
984
1035
|
};
|
|
@@ -1020,10 +1071,13 @@ var Zoom = /** @class */ (function () {
|
|
|
1020
1071
|
((layerRect.top + layerRect.height + legendHeight + map.margin.top) >= (elementRect.top + elementRect.height))));
|
|
1021
1072
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1022
1073
|
var location_3 = this.maps.getGeoLocation(this.maps.layersCollection.length - 1, mouseLocation['layerX'], mouseLocation['layerY']);
|
|
1074
|
+
var minMaxLatitudeLongitude = this.maps.getMinMaxLatitudeLongitude();
|
|
1023
1075
|
panArgs = {
|
|
1024
1076
|
cancel: false, name: pan, maps: map,
|
|
1025
1077
|
tileTranslatePoint: {}, translatePoint: { previous: translatePoint, current: new Point(x, y) },
|
|
1026
|
-
scale: map.scale, tileZoomLevel: map.tileZoomLevel, latitude: location_3['latitude'], longitude: location_3['longitude']
|
|
1078
|
+
scale: map.scale, tileZoomLevel: map.tileZoomLevel, latitude: location_3['latitude'], longitude: location_3['longitude'],
|
|
1079
|
+
minLatitude: minMaxLatitudeLongitude.minLatitude, maxLatitude: minMaxLatitudeLongitude.maxLatitude,
|
|
1080
|
+
minLongitude: minMaxLatitudeLongitude.minLongitude, maxLongitude: minMaxLatitudeLongitude.maxLongitude
|
|
1027
1081
|
};
|
|
1028
1082
|
map.trigger(pan, panArgs);
|
|
1029
1083
|
if (!panArgs.cancel) {
|
|
@@ -1057,11 +1111,14 @@ var Zoom = /** @class */ (function () {
|
|
|
1057
1111
|
map.translatePoint.y = (map.tileTranslatePoint.y - yDifference) / map.scale;
|
|
1058
1112
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1059
1113
|
var location_4 = this.maps.getTileGeoLocation(mouseLocation['layerX'], mouseLocation['layerY']);
|
|
1114
|
+
var minMaxLatitudeLongitude = this.maps.getMinMaxLatitudeLongitude();
|
|
1060
1115
|
panArgs = {
|
|
1061
1116
|
cancel: false, name: pan, maps: map,
|
|
1062
1117
|
tileTranslatePoint: { previous: prevTilePoint, current: map.tileTranslatePoint },
|
|
1063
1118
|
translatePoint: { previous: translatePoint, current: map.translatePoint }, scale: map.scale,
|
|
1064
|
-
tileZoomLevel: map.tileZoomLevel, latitude: location_4['latitude'], longitude: location_4['longitude']
|
|
1119
|
+
tileZoomLevel: map.tileZoomLevel, latitude: location_4['latitude'], longitude: location_4['longitude'],
|
|
1120
|
+
minLatitude: minMaxLatitudeLongitude.minLatitude, maxLatitude: minMaxLatitudeLongitude.maxLatitude,
|
|
1121
|
+
minLongitude: minMaxLatitudeLongitude.minLongitude, maxLongitude: minMaxLatitudeLongitude.maxLongitude
|
|
1065
1122
|
};
|
|
1066
1123
|
map.trigger(pan, panArgs);
|
|
1067
1124
|
map.mapLayerPanel.generateTiles(map.tileZoomLevel, map.tileTranslatePoint, 'Pan');
|
|
@@ -1084,7 +1141,7 @@ var Zoom = /** @class */ (function () {
|
|
|
1084
1141
|
Zoom.prototype.toolBarZooming = function (zoomFactor, type) {
|
|
1085
1142
|
var _this = this;
|
|
1086
1143
|
var map = this.maps;
|
|
1087
|
-
map.initialCheck = false;
|
|
1144
|
+
map.initialCheck = map.isMarkerZoomCompleted = false;
|
|
1088
1145
|
map.defaultState = ((type === 'Reset' && zoomFactor === 1 && !(map.zoomSettings.resetToInitial && map.applyZoomReset))
|
|
1089
1146
|
|| (type === 'ZoomOut' && zoomFactor === 1));
|
|
1090
1147
|
var prevLevel = map.tileZoomLevel;
|
|
@@ -1097,7 +1154,7 @@ var Zoom = /** @class */ (function () {
|
|
|
1097
1154
|
var size = map.mapAreaRect;
|
|
1098
1155
|
var translatePoint = map.previousPoint = map.translatePoint;
|
|
1099
1156
|
var prevTilePoint = map.tileTranslatePoint;
|
|
1100
|
-
map.previousProjection =
|
|
1157
|
+
map.previousProjection = type === 'Reset' ? undefined : map.projectionType;
|
|
1101
1158
|
zoomFactor = (type === 'ZoomOut') ? (Math.round(zoomFactor) === 1 ? 1 : zoomFactor) : zoomFactor;
|
|
1102
1159
|
zoomFactor = (type === 'Reset') ? minZoom : (Math.round(zoomFactor) === 0) ? 1 : zoomFactor;
|
|
1103
1160
|
zoomFactor = (minZoom > zoomFactor && type === 'ZoomIn') ? minZoom + 1 : zoomFactor;
|
|
@@ -1362,7 +1419,10 @@ var Zoom = /** @class */ (function () {
|
|
|
1362
1419
|
isToolbarPerform = (this.maps.isTileMap ? this.maps.tileZoomLevel : this.maps.scale) + 1 <= this.maps.zoomSettings.maxZoom;
|
|
1363
1420
|
break;
|
|
1364
1421
|
case 'zoomout':
|
|
1365
|
-
|
|
1422
|
+
var scaleValue = this.maps.isTileMap ? this.maps.tileZoomLevel : this.maps.scale;
|
|
1423
|
+
isToolbarPerform = (this.maps.projectionType === 'Miller' || this.maps.projectionType === 'Winkel3' ||
|
|
1424
|
+
this.maps.projectionType === 'AitOff') ? Math.round(scaleValue) - 1 >= this.maps.zoomSettings.minZoom :
|
|
1425
|
+
(scaleValue) - 1 >= this.maps.zoomSettings.minZoom;
|
|
1366
1426
|
break;
|
|
1367
1427
|
case 'reset':
|
|
1368
1428
|
isToolbarPerform = Math.round(this.maps.isTileMap ? this.maps.tileZoomLevel : this.maps.scale) != this.maps.zoomSettings.minZoom;
|
|
@@ -1796,8 +1856,9 @@ var Zoom = /** @class */ (function () {
|
|
|
1796
1856
|
var pageX = e.pageX;
|
|
1797
1857
|
var pageY = e.pageY;
|
|
1798
1858
|
var target = e.target;
|
|
1859
|
+
var tooltipElement = e.target.closest('#' + this.maps.element.id + '_mapsTooltipparent_template');
|
|
1799
1860
|
if (this.maps.zoomSettings.enable && this.maps.zoomSettings.doubleClickZoom
|
|
1800
|
-
&& !(e.target['id'].indexOf('_Zooming_') > -1)) {
|
|
1861
|
+
&& !(e.target['id'].indexOf('_Zooming_') > -1) && isNullOrUndefined(tooltipElement)) {
|
|
1801
1862
|
var position = this.getMousePosition(pageX, pageY);
|
|
1802
1863
|
var map = this.maps;
|
|
1803
1864
|
var size = map.availableSize;
|
|
@@ -1973,8 +2034,9 @@ var Zoom = /** @class */ (function () {
|
|
|
1973
2034
|
*/
|
|
1974
2035
|
Zoom.prototype.click = function (e) {
|
|
1975
2036
|
var map = this.maps;
|
|
2037
|
+
var tooltipElement = e.target.closest('#' + this.maps.element.id + '_mapsTooltipparent_template');
|
|
1976
2038
|
if ((map.markerModule && map.markerModule.sameMarkerData.length > 0) ||
|
|
1977
|
-
(e.target['id'].indexOf('MarkerIndex') > -1 && e.target['id'].indexOf('cluster') === -1)) {
|
|
2039
|
+
(e.target['id'].indexOf('MarkerIndex') > -1 && e.target['id'].indexOf('cluster') === -1) || !isNullOrUndefined(tooltipElement)) {
|
|
1978
2040
|
return null;
|
|
1979
2041
|
}
|
|
1980
2042
|
if (this.isSingleClick && map.zoomSettings.zoomOnClick && !(e.target['id'].indexOf('_Zooming_') > -1) && !map.zoomSettings.doubleClickZoom
|
|
@@ -79,6 +79,10 @@ export declare function radiansToDegrees(radian: number): number;
|
|
|
79
79
|
* @private
|
|
80
80
|
*/
|
|
81
81
|
export declare function convertGeoToPoint(latitude: number, longitude: number, factor: number, layer: LayerSettings, mapModel: Maps): Point;
|
|
82
|
+
/**
|
|
83
|
+
* @private
|
|
84
|
+
*/
|
|
85
|
+
export declare function calculatePolygonPath(maps: Maps, factor: number, currentLayer: LayerSettings, markerData: Coordinate[]): string;
|
|
82
86
|
/**
|
|
83
87
|
* Converting tile latitude and longitude to point
|
|
84
88
|
*
|
|
@@ -175,6 +179,20 @@ export declare class Point {
|
|
|
175
179
|
y: number;
|
|
176
180
|
constructor(x: number, y: number);
|
|
177
181
|
}
|
|
182
|
+
/**
|
|
183
|
+
* Defines the latitude and longitude values that define a map location.
|
|
184
|
+
*/
|
|
185
|
+
export declare class Coordinate {
|
|
186
|
+
/**
|
|
187
|
+
* Gets or sets the latitude of a coordinate on a map.
|
|
188
|
+
*/
|
|
189
|
+
latitude: number;
|
|
190
|
+
/**
|
|
191
|
+
* Gets or sets the longitude of a coordinate on a map.
|
|
192
|
+
*/
|
|
193
|
+
longitude: number;
|
|
194
|
+
constructor(latitude: number, longitude: number);
|
|
195
|
+
}
|
|
178
196
|
/**
|
|
179
197
|
* Map internal class for min and max
|
|
180
198
|
*
|
package/src/maps/utils/helper.js
CHANGED
|
@@ -215,6 +215,25 @@ export function convertGeoToPoint(latitude, longitude, factor, layer, mapModel)
|
|
|
215
215
|
}
|
|
216
216
|
return new Point(x, y);
|
|
217
217
|
}
|
|
218
|
+
/**
|
|
219
|
+
* @private
|
|
220
|
+
*/
|
|
221
|
+
export function calculatePolygonPath(maps, factor, currentLayer, markerData) {
|
|
222
|
+
var path = '';
|
|
223
|
+
Array.prototype.forEach.call(markerData, function (data, dataIndex) {
|
|
224
|
+
var lat = data.latitude;
|
|
225
|
+
var lng = data.longitude;
|
|
226
|
+
var location = (maps.isTileMap) ? convertTileLatLongToPoint(new MapLocation(lng, lat), factor, maps.tileTranslatePoint, true) : convertGeoToPoint(lat, lng, factor, currentLayer, maps);
|
|
227
|
+
if (dataIndex === 0) {
|
|
228
|
+
path += 'M ' + location.x + ' ' + location.y;
|
|
229
|
+
}
|
|
230
|
+
else {
|
|
231
|
+
path += ' L ' + location.x + ' ' + location.y;
|
|
232
|
+
}
|
|
233
|
+
});
|
|
234
|
+
path += ' z ';
|
|
235
|
+
return path;
|
|
236
|
+
}
|
|
218
237
|
/**
|
|
219
238
|
* Converting tile latitude and longitude to point
|
|
220
239
|
*
|
|
@@ -358,6 +377,17 @@ var Point = /** @class */ (function () {
|
|
|
358
377
|
return Point;
|
|
359
378
|
}());
|
|
360
379
|
export { Point };
|
|
380
|
+
/**
|
|
381
|
+
* Defines the latitude and longitude values that define a map location.
|
|
382
|
+
*/
|
|
383
|
+
var Coordinate = /** @class */ (function () {
|
|
384
|
+
function Coordinate(latitude, longitude) {
|
|
385
|
+
this.latitude = latitude;
|
|
386
|
+
this.longitude = longitude;
|
|
387
|
+
}
|
|
388
|
+
return Coordinate;
|
|
389
|
+
}());
|
|
390
|
+
export { Coordinate };
|
|
361
391
|
/**
|
|
362
392
|
* Map internal class for min and max
|
|
363
393
|
*
|
|
@@ -1130,12 +1160,24 @@ export function clusterTemplate(currentLayer, markerTemplate, maps, layerIndex,
|
|
|
1130
1160
|
getElementByID(maps.element.id + '_Secondary_Element').appendChild(markerCollection);
|
|
1131
1161
|
}
|
|
1132
1162
|
var element = document.getElementById(maps.element.id + '_LayerIndex_' + layerIndex + '_Polygon_Group');
|
|
1133
|
-
|
|
1163
|
+
var polygonElement = document.getElementById(maps.element.id + '_LayerIndex_' + layerIndex + '_Polygons_Group');
|
|
1164
|
+
if (isNullOrUndefined(element) && !maps.isTileMap) {
|
|
1134
1165
|
layerElement.insertBefore(markerCollection, layerElement.firstChild);
|
|
1135
1166
|
}
|
|
1136
|
-
else {
|
|
1167
|
+
else if (!maps.isTileMap) {
|
|
1137
1168
|
layerElement.appendChild(markerCollection);
|
|
1138
1169
|
}
|
|
1170
|
+
else {
|
|
1171
|
+
if (!isNullOrUndefined(polygonElement)) {
|
|
1172
|
+
polygonElement.insertAdjacentElement('afterend', markerCollection);
|
|
1173
|
+
}
|
|
1174
|
+
else if (!isNullOrUndefined(element)) {
|
|
1175
|
+
element.insertAdjacentElement('afterend', markerCollection);
|
|
1176
|
+
}
|
|
1177
|
+
else {
|
|
1178
|
+
layerElement.insertBefore(markerCollection, layerElement.firstChild);
|
|
1179
|
+
}
|
|
1180
|
+
}
|
|
1139
1181
|
var markerCluster = document.getElementById(maps.element.id + '_LayerIndex_' + layerIndex + '_markerCluster');
|
|
1140
1182
|
if (!isNullOrUndefined(markerCluster)) {
|
|
1141
1183
|
markerCluster.remove();
|
|
@@ -1667,7 +1709,7 @@ export function drawBalloon(maps, options, size, location, type, element) {
|
|
|
1667
1709
|
var height = size.height;
|
|
1668
1710
|
var pathElement;
|
|
1669
1711
|
location.x -= width / 2;
|
|
1670
|
-
location.y -= height / 2;
|
|
1712
|
+
location.y -= ((options.id.indexOf('cluster') > -1) ? (height / 2) : options.id.indexOf('Legend') > -1 ? height / 1.25 : height);
|
|
1671
1713
|
options.d = 'M15,0C8.8,0,3.8,5,3.8,11.2C3.8,17.5,9.4,24.4,15,30c5.6-5.6,11.2-12.5,11.2-18.8C26.2,5,21.2,0,15,0z M15,16' +
|
|
1672
1714
|
'c-2.8,0-5-2.2-5-5s2.2-5,5-5s5,2.2,5,5S17.8,16,15,16z';
|
|
1673
1715
|
var balloon = maps.renderer.drawPath(options);
|
|
@@ -2076,7 +2118,8 @@ export function getTranslate(mapObject, layer, animate) {
|
|
|
2076
2118
|
var topPosition = (((mapHeight + Math.abs(mapObject.mapAreaRect.height - mapHeight)) / 2) + mapObject.mapAreaRect.y) / factor;
|
|
2077
2119
|
var point = checkMethodeZoom ? calculateCenterFromPixel(mapObject, layer) :
|
|
2078
2120
|
convertGeoToPoint(centerLatitude, centerLongitude, mapObject.mapLayerPanel.calculateFactor(layer), layer, mapObject);
|
|
2079
|
-
if (isNullOrUndefined(mapObject.previousProjection) || mapObject.previousProjection !== mapObject.projectionType
|
|
2121
|
+
if (isNullOrUndefined(mapObject.previousProjection) || mapObject.previousProjection !== mapObject.projectionType
|
|
2122
|
+
|| mapObject.isMarkerZoomCompleted) {
|
|
2080
2123
|
x = -point.x + leftPosition;
|
|
2081
2124
|
y = -point.y + topPosition;
|
|
2082
2125
|
scaleFactor = zoomFactor;
|
|
@@ -3045,6 +3088,13 @@ export function changeBorderWidth(element, index, scale, maps) {
|
|
|
3045
3088
|
if (childNode.id.indexOf('_NavigationGroup') > -1) {
|
|
3046
3089
|
changeNavaigationLineWidth(childNode, index, scale, maps);
|
|
3047
3090
|
}
|
|
3091
|
+
else if (childNode.id.indexOf('_Polygons_Group') > -1) {
|
|
3092
|
+
for (var i = 0; i < childNode.childElementCount; i++) {
|
|
3093
|
+
// eslint-disable-next-line
|
|
3094
|
+
var width = maps.layersCollection[index].polygonSettings.polygons[parseInt(childNode.children[i].id.split('_PolygonIndex_')[1])].borderWidth;
|
|
3095
|
+
childNode.children[i].setAttribute('stroke-width', (width / scale).toString());
|
|
3096
|
+
}
|
|
3097
|
+
}
|
|
3048
3098
|
else {
|
|
3049
3099
|
var currentStroke = void 0;
|
|
3050
3100
|
var value = 0;
|