@syncfusion/ej2-maps 19.4.56 → 19.4.57-105067
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.json +18 -3
- package/.github/PULL_REQUEST_TEMPLATE/Bug.md +72 -72
- package/.github/PULL_REQUEST_TEMPLATE/Feature.md +49 -49
- package/CHANGELOG.md +441 -439
- package/README.md +73 -73
- package/dist/ej2-maps.umd.min.js +1 -10
- package/dist/ej2-maps.umd.min.js.map +1 -1
- package/dist/es6/ej2-maps.es2015.js +1161 -638
- package/dist/es6/ej2-maps.es2015.js.map +1 -1
- package/dist/es6/ej2-maps.es5.js +1200 -678
- package/dist/es6/ej2-maps.es5.js.map +1 -1
- package/dist/global/ej2-maps.min.js +1 -10
- package/dist/global/ej2-maps.min.js.map +1 -1
- package/dist/global/index.d.ts +0 -9
- package/dist/ts/maps/layers/bing-map.ts +50 -0
- package/dist/ts/maps/layers/bubble.ts +290 -0
- package/dist/ts/maps/layers/color-mapping.ts +226 -0
- package/dist/ts/maps/layers/data-label.ts +418 -0
- package/dist/ts/maps/layers/layer-panel.ts +1480 -0
- package/dist/ts/maps/layers/legend.ts +2236 -0
- package/dist/ts/maps/layers/marker.ts +453 -0
- package/dist/ts/maps/layers/navigation-selected-line.ts +167 -0
- package/dist/ts/maps/maps.ts +2886 -0
- package/dist/ts/maps/model/base.ts +1843 -0
- package/dist/ts/maps/model/constants.ts +200 -0
- package/dist/ts/maps/model/export-image.ts +178 -0
- package/dist/ts/maps/model/export-pdf.ts +170 -0
- package/dist/ts/maps/model/interface.ts +823 -0
- package/dist/ts/maps/model/print.ts +104 -0
- package/dist/ts/maps/model/theme.ts +554 -0
- package/dist/ts/maps/user-interaction/annotation.ts +127 -0
- package/dist/ts/maps/user-interaction/highlight.ts +233 -0
- package/dist/ts/maps/user-interaction/selection.ts +321 -0
- package/dist/ts/maps/user-interaction/tooltip.ts +387 -0
- package/dist/ts/maps/user-interaction/zoom.ts +1767 -0
- package/dist/ts/maps/utils/enum.ts +368 -0
- package/dist/ts/maps/utils/helper.ts +3421 -0
- package/helper/e2e/index.js +3 -3
- package/helper/e2e/maps-helper.js +13 -13
- package/license +9 -9
- package/package.json +85 -85
- package/src/maps/layers/bing-map.d.ts +4 -0
- package/src/maps/layers/bing-map.js +16 -3
- package/src/maps/layers/bubble.d.ts +1 -2
- package/src/maps/layers/bubble.js +7 -12
- package/src/maps/layers/data-label.d.ts +1 -4
- package/src/maps/layers/data-label.js +32 -35
- package/src/maps/layers/layer-panel.d.ts +18 -1
- package/src/maps/layers/layer-panel.js +226 -72
- package/src/maps/layers/legend.d.ts +5 -2
- package/src/maps/layers/legend.js +170 -61
- package/src/maps/layers/marker.d.ts +2 -4
- package/src/maps/layers/marker.js +49 -48
- package/src/maps/layers/navigation-selected-line.d.ts +1 -2
- package/src/maps/layers/navigation-selected-line.js +7 -13
- package/src/maps/maps-model.d.ts +259 -251
- package/src/maps/maps.d.ts +24 -3
- package/src/maps/maps.js +152 -90
- package/src/maps/model/base-model.d.ts +1025 -1021
- package/src/maps/model/base.d.ts +5 -1
- package/src/maps/model/base.js +24 -24
- package/src/maps/model/constants.d.ts +6 -0
- package/src/maps/model/constants.js +6 -0
- package/src/maps/model/export-image.d.ts +2 -4
- package/src/maps/model/export-image.js +26 -32
- package/src/maps/model/export-pdf.d.ts +4 -6
- package/src/maps/model/export-pdf.js +27 -35
- package/src/maps/model/interface.d.ts +34 -26
- package/src/maps/model/print.d.ts +2 -5
- package/src/maps/model/print.js +33 -21
- package/src/maps/model/theme.js +7 -4
- package/src/maps/user-interaction/annotation.d.ts +1 -2
- package/src/maps/user-interaction/annotation.js +3 -4
- package/src/maps/user-interaction/highlight.d.ts +1 -2
- package/src/maps/user-interaction/highlight.js +11 -10
- package/src/maps/user-interaction/selection.d.ts +1 -2
- package/src/maps/user-interaction/selection.js +42 -19
- package/src/maps/user-interaction/tooltip.d.ts +3 -5
- package/src/maps/user-interaction/tooltip.js +27 -14
- package/src/maps/user-interaction/zoom.d.ts +3 -8
- package/src/maps/user-interaction/zoom.js +282 -162
- package/src/maps/utils/enum.d.ts +5 -1
- package/src/maps/utils/helper.d.ts +1 -1
- package/src/maps/utils/helper.js +62 -31
|
@@ -16,7 +16,6 @@ var Zoom = /** @class */ (function () {
|
|
|
16
16
|
this.mouseEnter = false;
|
|
17
17
|
this.isTouch = false;
|
|
18
18
|
this.rectZoomingStart = false;
|
|
19
|
-
this.pinchRect = new Rect(0, 0, 0, 0);
|
|
20
19
|
this.browserName = Browser.info.name;
|
|
21
20
|
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
22
21
|
this.isPointer = Browser.isPointer;
|
|
@@ -25,8 +24,6 @@ var Zoom = /** @class */ (function () {
|
|
|
25
24
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
26
25
|
this.startTouches = [];
|
|
27
26
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
28
|
-
this.shapeZoomLocation = [];
|
|
29
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
30
27
|
this.intersect = [];
|
|
31
28
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
32
29
|
this.mouseDownLatLong = { x: 0, y: 0 };
|
|
@@ -42,7 +39,6 @@ var Zoom = /** @class */ (function () {
|
|
|
42
39
|
this.selectionColor = this.maps.zoomSettings.selectionColor;
|
|
43
40
|
this.fillColor = this.maps.zoomSettings.color;
|
|
44
41
|
this.addEventListener();
|
|
45
|
-
this.groupElements = [];
|
|
46
42
|
}
|
|
47
43
|
/**
|
|
48
44
|
* To perform zooming for maps
|
|
@@ -66,7 +62,8 @@ var Zoom = /** @class */ (function () {
|
|
|
66
62
|
var minZoom = map.zoomSettings.minZoom;
|
|
67
63
|
newZoomFactor = (minZoom > newZoomFactor && type === 'ZoomIn') ? minZoom + 1 : newZoomFactor;
|
|
68
64
|
var prevTilePoint = map.tileTranslatePoint;
|
|
69
|
-
if ((!map.isTileMap) && (type === 'ZoomIn' ? newZoomFactor >= minZoom && newZoomFactor <= maxZoom : newZoomFactor >= minZoom)
|
|
65
|
+
if ((!map.isTileMap) && ((type === 'ZoomIn' ? newZoomFactor >= minZoom && newZoomFactor <= maxZoom : newZoomFactor >= minZoom)
|
|
66
|
+
|| map.isReset)) {
|
|
70
67
|
var availSize = map.mapAreaRect;
|
|
71
68
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
72
69
|
var minBounds = map.baseMapRectBounds['min'];
|
|
@@ -74,16 +71,34 @@ var Zoom = /** @class */ (function () {
|
|
|
74
71
|
var maxBounds = map.baseMapRectBounds['max'];
|
|
75
72
|
var mapTotalWidth = Math.abs(minBounds['x'] - maxBounds['x']);
|
|
76
73
|
var mapTotalHeight = Math.abs(minBounds['y'] - maxBounds['y']);
|
|
77
|
-
var
|
|
78
|
-
var
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
74
|
+
var translatePointX = void 0;
|
|
75
|
+
var translatePointY = void 0;
|
|
76
|
+
if (newZoomFactor < 1.2 && map.projectionType !== 'Eckert5') {
|
|
77
|
+
if (mapTotalWidth === 0 || mapTotalHeight === 0 || mapTotalWidth === mapTotalHeight) {
|
|
78
|
+
mapTotalWidth = availSize.width / 2;
|
|
79
|
+
mapTotalHeight = availSize.height;
|
|
80
|
+
}
|
|
81
|
+
newZoomFactor = parseFloat(Math.min(availSize.width / mapTotalWidth, availSize.height / mapTotalHeight).toFixed(2));
|
|
82
|
+
newZoomFactor = newZoomFactor > 1.05 ? 1 : newZoomFactor;
|
|
83
|
+
map.translatePoint = this.calculateInitalZoomTranslatePoint(newZoomFactor, mapTotalWidth, mapTotalHeight, availSize, minBounds, map);
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
var point = map.translatePoint;
|
|
87
|
+
translatePointX = point.x - (((availSize.width / scale) - (availSize.width / newZoomFactor)) / (availSize.width / position.x));
|
|
88
|
+
translatePointY = point.y - (((availSize.height / scale) - (availSize.height / newZoomFactor)) / (availSize.height / position.y));
|
|
89
|
+
var currentHeight = Math.abs(map.baseMapRectBounds['max']['y'] - map.baseMapRectBounds['min']['y']) * newZoomFactor;
|
|
90
|
+
translatePointX = (currentHeight < map.mapAreaRect.height) ? (availSize.x + ((-(minBounds['x'])) + ((availSize.width / 2) - (mapTotalWidth / 2)))) : translatePointX;
|
|
91
|
+
translatePointY = (currentHeight < map.mapAreaRect.height) ? (availSize.y + ((-(minBounds['y'])) + ((availSize.height / 2) - (mapTotalHeight / 2)))) : translatePointY;
|
|
92
|
+
map.translatePoint = new Point(translatePointX, translatePointY);
|
|
93
|
+
}
|
|
84
94
|
map.scale = newZoomFactor;
|
|
85
|
-
this.triggerZoomEvent(prevTilePoint, prevLevel, type)
|
|
86
|
-
|
|
95
|
+
if (this.triggerZoomEvent(prevTilePoint, prevLevel, type)) {
|
|
96
|
+
map.translatePoint = map.previousPoint;
|
|
97
|
+
map.scale = map.mapScaleValue = map.previousScale;
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
this.applyTransform(map);
|
|
101
|
+
}
|
|
87
102
|
}
|
|
88
103
|
else if ((map.isTileMap) && (newZoomFactor >= minZoom && newZoomFactor <= maxZoom)) {
|
|
89
104
|
this.getTileTranslatePosition(prevLevel, newZoomFactor, position, type);
|
|
@@ -100,34 +115,49 @@ var Zoom = /** @class */ (function () {
|
|
|
100
115
|
}
|
|
101
116
|
map.translatePoint.y = (map.tileTranslatePoint.y - (0.01 * map.mapScaleValue)) / map.scale;
|
|
102
117
|
map.translatePoint.x = (map.tileTranslatePoint.x - (0.01 * map.mapScaleValue)) / map.scale;
|
|
103
|
-
this.triggerZoomEvent(prevTilePoint, prevLevel, type)
|
|
104
|
-
|
|
105
|
-
|
|
118
|
+
if (this.triggerZoomEvent(prevTilePoint, prevLevel, type)) {
|
|
119
|
+
map.translatePoint = map.tileTranslatePoint = new Point(0, 0);
|
|
120
|
+
map.scale = map.previousScale;
|
|
121
|
+
map.tileZoomLevel = prevLevel;
|
|
122
|
+
map.zoomSettings.zoomFactor = map.previousScale;
|
|
106
123
|
}
|
|
107
|
-
|
|
108
|
-
document.
|
|
109
|
-
|
|
110
|
-
this.markerLineAnimation(map);
|
|
111
|
-
map.mapLayerPanel.generateTiles(newZoomFactor, map.tileTranslatePoint, type + 'wheel', null, position);
|
|
112
|
-
var element1 = document.getElementById(this.maps.element.id + '_tiles');
|
|
113
|
-
var animationDuration = this.maps.layersCollection[0].animationDuration;
|
|
114
|
-
setTimeout(function () {
|
|
115
|
-
// if (type === 'ZoomOut') {
|
|
116
|
-
// element1.removeChild(element1.children[element1.childElementCount - 1]);
|
|
117
|
-
// if (element1.childElementCount) {
|
|
118
|
-
// element1.removeChild(element1.children[element1.childElementCount - 1]);
|
|
119
|
-
// } else {
|
|
120
|
-
// element1 = element1;
|
|
121
|
-
// }
|
|
122
|
-
// }
|
|
123
|
-
_this.applyTransform();
|
|
124
|
-
if (document.getElementById(_this.maps.element.id + '_LayerIndex_1')) {
|
|
125
|
-
document.getElementById(_this.maps.element.id + '_LayerIndex_1').style.display = 'block';
|
|
124
|
+
else {
|
|
125
|
+
if (document.querySelector('.GroupElement')) {
|
|
126
|
+
document.querySelector('.GroupElement').style.display = 'none';
|
|
126
127
|
}
|
|
127
|
-
|
|
128
|
+
if (document.getElementById(this.maps.element.id + '_LayerIndex_1')) {
|
|
129
|
+
document.getElementById(this.maps.element.id + '_LayerIndex_1').style.display = 'none';
|
|
130
|
+
}
|
|
131
|
+
this.markerLineAnimation(map);
|
|
132
|
+
map.mapLayerPanel.generateTiles(newZoomFactor, map.tileTranslatePoint, type + 'wheel', null, position);
|
|
133
|
+
var element1 = document.getElementById(this.maps.element.id + '_tiles');
|
|
134
|
+
var animationDuration = this.maps.layersCollection[0].animationDuration;
|
|
135
|
+
setTimeout(function () {
|
|
136
|
+
// if (type === 'ZoomOut') {
|
|
137
|
+
// element1.removeChild(element1.children[element1.childElementCount - 1]);
|
|
138
|
+
// if (element1.childElementCount) {
|
|
139
|
+
// element1.removeChild(element1.children[element1.childElementCount - 1]);
|
|
140
|
+
// } else {
|
|
141
|
+
// element1 = element1;
|
|
142
|
+
// }
|
|
143
|
+
// }
|
|
144
|
+
_this.applyTransform(_this.maps);
|
|
145
|
+
if (document.getElementById(_this.maps.element.id + '_LayerIndex_1')) {
|
|
146
|
+
document.getElementById(_this.maps.element.id + '_LayerIndex_1').style.display = 'block';
|
|
147
|
+
}
|
|
148
|
+
}, animationDuration);
|
|
149
|
+
}
|
|
128
150
|
}
|
|
129
151
|
this.maps.zoomNotApplied = false;
|
|
130
152
|
};
|
|
153
|
+
Zoom.prototype.calculateInitalZoomTranslatePoint = function (newZoomFactor, mapTotalWidth, mapTotalHeight, availSize, minBounds, map) {
|
|
154
|
+
mapTotalWidth *= newZoomFactor;
|
|
155
|
+
mapTotalHeight *= newZoomFactor;
|
|
156
|
+
var widthDiff = minBounds['x'] !== 0 && map.translateType === 'layers' ? map.availableSize.width - availSize.width : 0;
|
|
157
|
+
var translatePointX = availSize.x + ((-(minBounds['x'])) + ((availSize.width / 2) - (mapTotalWidth / 2))) - widthDiff;
|
|
158
|
+
var translatePointY = availSize.y + ((-(minBounds['y'])) + ((availSize.height / 2) - (mapTotalHeight / 2)));
|
|
159
|
+
return new Point(translatePointX, translatePointY);
|
|
160
|
+
};
|
|
131
161
|
Zoom.prototype.triggerZoomEvent = function (prevTilePoint, prevLevel, type) {
|
|
132
162
|
var map = this.maps;
|
|
133
163
|
var zoomArgs;
|
|
@@ -146,6 +176,7 @@ var Zoom = /** @class */ (function () {
|
|
|
146
176
|
};
|
|
147
177
|
}
|
|
148
178
|
map.trigger('zoom', zoomArgs);
|
|
179
|
+
return zoomArgs.cancel;
|
|
149
180
|
};
|
|
150
181
|
Zoom.prototype.getTileTranslatePosition = function (prevLevel, currentLevel, position, type) {
|
|
151
182
|
var map = this.maps;
|
|
@@ -171,6 +202,7 @@ var Zoom = /** @class */ (function () {
|
|
|
171
202
|
var zoomRect = this.zoomingRect;
|
|
172
203
|
var maxZoom = map.zoomSettings.maxZoom;
|
|
173
204
|
var minZoom = map.zoomSettings.minZoom;
|
|
205
|
+
var isZoomCancelled;
|
|
174
206
|
if (zoomRect.height > 0 && zoomRect.width > 0) {
|
|
175
207
|
var x = this.zoomingRect.x + (this.zoomingRect.width / 2);
|
|
176
208
|
var y = this.zoomingRect.y + (this.zoomingRect.height / 2);
|
|
@@ -183,7 +215,11 @@ var Zoom = /** @class */ (function () {
|
|
|
183
215
|
var translatePointY = translatePoint.y - (((size.height / scale) - (size.height / zoomCalculationFactor)) / (size.height / y));
|
|
184
216
|
map.translatePoint = new Point(translatePointX, translatePointY);
|
|
185
217
|
map.scale = zoomCalculationFactor;
|
|
186
|
-
this.triggerZoomEvent(prevTilePoint, prevLevel, '');
|
|
218
|
+
isZoomCancelled = this.triggerZoomEvent(prevTilePoint, prevLevel, '');
|
|
219
|
+
if (isZoomCancelled) {
|
|
220
|
+
map.translatePoint = map.previousPoint;
|
|
221
|
+
map.scale = map.previousScale;
|
|
222
|
+
}
|
|
187
223
|
}
|
|
188
224
|
else {
|
|
189
225
|
zoomCalculationFactor = prevLevel + (Math.round(prevLevel + (((size.width / zoomRect.width) + (size.height / zoomRect.height)) / 2)));
|
|
@@ -196,13 +232,21 @@ var Zoom = /** @class */ (function () {
|
|
|
196
232
|
map.translatePoint.y = (map.tileTranslatePoint.y - (0.5 * Math.pow(2, zoomCalculationFactor))) /
|
|
197
233
|
(Math.pow(2, zoomCalculationFactor));
|
|
198
234
|
map.scale = (Math.pow(2, zoomCalculationFactor));
|
|
199
|
-
this.triggerZoomEvent(prevTilePoint, prevLevel, '');
|
|
200
|
-
|
|
235
|
+
isZoomCancelled = this.triggerZoomEvent(prevTilePoint, prevLevel, '');
|
|
236
|
+
if (isZoomCancelled) {
|
|
237
|
+
map.translatePoint = map.tileTranslatePoint = new Point(0, 0);
|
|
238
|
+
map.scale = map.tileZoomLevel = map.zoomSettings.zoomFactor = prevLevel;
|
|
239
|
+
}
|
|
240
|
+
else {
|
|
241
|
+
map.mapLayerPanel.generateTiles(zoomCalculationFactor, map.tileTranslatePoint);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
if (!isZoomCancelled) {
|
|
245
|
+
map.mapScaleValue = zoomCalculationFactor;
|
|
246
|
+
this.applyTransform(map, true);
|
|
247
|
+
this.maps.zoomNotApplied = false;
|
|
248
|
+
this.zoomingRect = null;
|
|
201
249
|
}
|
|
202
|
-
map.mapScaleValue = zoomCalculationFactor;
|
|
203
|
-
this.applyTransform(true);
|
|
204
|
-
this.maps.zoomNotApplied = false;
|
|
205
|
-
this.zoomingRect = null;
|
|
206
250
|
}
|
|
207
251
|
};
|
|
208
252
|
Zoom.prototype.setInteraction = function (newInteraction) {
|
|
@@ -232,6 +276,7 @@ var Zoom = /** @class */ (function () {
|
|
|
232
276
|
this.pinchFactor = Math.min(this.maps.zoomSettings.maxZoom, Math.max(this.pinchFactor, this.maps.zoomSettings.minZoom));
|
|
233
277
|
var zoomCalculationFactor = this.pinchFactor;
|
|
234
278
|
var zoomArgs;
|
|
279
|
+
var isZoomCancelled;
|
|
235
280
|
if (!map.isTileMap) {
|
|
236
281
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
237
282
|
var minBounds = map.baseMapRectBounds['min'];
|
|
@@ -240,14 +285,31 @@ var Zoom = /** @class */ (function () {
|
|
|
240
285
|
var mapTotalHeight = Math.abs(minBounds['y'] - maxBounds['y']);
|
|
241
286
|
var mapTotalWidth = Math.abs(minBounds['x'] - maxBounds['x']);
|
|
242
287
|
var translatePoint = map.translatePoint;
|
|
243
|
-
var
|
|
244
|
-
var
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
288
|
+
var translatePointX = void 0;
|
|
289
|
+
var translatePointY = void 0;
|
|
290
|
+
if (zoomCalculationFactor < 1.2 && map.projectionType !== 'Eckert5') {
|
|
291
|
+
if (mapTotalWidth === 0 || mapTotalHeight === 0 || mapTotalWidth === mapTotalHeight) {
|
|
292
|
+
mapTotalWidth = availSize.width / 2;
|
|
293
|
+
mapTotalHeight = availSize.height;
|
|
294
|
+
}
|
|
295
|
+
zoomCalculationFactor = parseFloat(Math.min(availSize.width / mapTotalWidth, availSize.height / mapTotalHeight).toFixed(2));
|
|
296
|
+
zoomCalculationFactor = zoomCalculationFactor > 1.05 ? 1 : zoomCalculationFactor;
|
|
297
|
+
map.translatePoint = this.calculateInitalZoomTranslatePoint(zoomCalculationFactor, mapTotalWidth, mapTotalHeight, availSize, minBounds, map);
|
|
298
|
+
}
|
|
299
|
+
else {
|
|
300
|
+
var currentHeight = Math.abs(map.baseMapRectBounds['max']['y'] - map.baseMapRectBounds['min']['y']) * zoomCalculationFactor;
|
|
301
|
+
translatePointX = translatePoint.x - (((availSize.width / map.scale) - (availSize.width / zoomCalculationFactor)) / (availSize.width / touchCenter.x));
|
|
302
|
+
translatePointY = translatePoint.y - (((availSize.height / map.scale) - (availSize.height / zoomCalculationFactor)) / (availSize.height / touchCenter.y));
|
|
303
|
+
translatePointX = (currentHeight < map.mapAreaRect.height) ? (availSize.x + ((-(minBounds['x'])) + ((availSize.width / 2) - (mapTotalWidth / 2)))) : translatePointX;
|
|
304
|
+
translatePointY = (currentHeight < map.mapAreaRect.height) ? (availSize.y + ((-(minBounds['y'])) + ((availSize.height / 2) - (mapTotalHeight / 2)))) : translatePointY;
|
|
305
|
+
map.translatePoint = new Point(translatePointX, translatePointY);
|
|
306
|
+
}
|
|
249
307
|
map.scale = zoomCalculationFactor;
|
|
250
|
-
this.triggerZoomEvent(prevTilePoint, prevLevel, '');
|
|
308
|
+
isZoomCancelled = this.triggerZoomEvent(prevTilePoint, prevLevel, '');
|
|
309
|
+
if (isZoomCancelled) {
|
|
310
|
+
map.translatePoint = map.previousPoint;
|
|
311
|
+
map.scale = map.previousScale;
|
|
312
|
+
}
|
|
251
313
|
}
|
|
252
314
|
else {
|
|
253
315
|
var newTileFactor = zoomCalculationFactor;
|
|
@@ -258,10 +320,20 @@ var Zoom = /** @class */ (function () {
|
|
|
258
320
|
map.translatePoint.y = (map.tileTranslatePoint.y - (0.5 * Math.pow(2, newTileFactor))) /
|
|
259
321
|
(Math.pow(2, newTileFactor));
|
|
260
322
|
map.scale = (Math.pow(2, newTileFactor));
|
|
261
|
-
this.triggerZoomEvent(prevTilePoint, prevLevel, '');
|
|
262
|
-
|
|
323
|
+
isZoomCancelled = this.triggerZoomEvent(prevTilePoint, prevLevel, '');
|
|
324
|
+
if (isZoomCancelled) {
|
|
325
|
+
map.translatePoint = map.tileTranslatePoint = new Point(0, 0);
|
|
326
|
+
map.scale = map.previousScale;
|
|
327
|
+
map.tileZoomLevel = prevLevel;
|
|
328
|
+
map.zoomSettings.zoomFactor = map.previousScale;
|
|
329
|
+
}
|
|
330
|
+
else {
|
|
331
|
+
map.mapLayerPanel.generateTiles(newTileFactor, map.tileTranslatePoint);
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
if (!isZoomCancelled) {
|
|
335
|
+
this.applyTransform(map);
|
|
263
336
|
}
|
|
264
|
-
this.applyTransform();
|
|
265
337
|
};
|
|
266
338
|
Zoom.prototype.drawZoomRectangle = function () {
|
|
267
339
|
var map = this.maps;
|
|
@@ -307,7 +379,7 @@ var Zoom = /** @class */ (function () {
|
|
|
307
379
|
zoomAnimate(element, 0, duration, new MapLocation(x, y), scale, this.maps.mapAreaRect, this.maps);
|
|
308
380
|
}
|
|
309
381
|
};
|
|
310
|
-
Zoom.prototype.applyTransform = function (animate) {
|
|
382
|
+
Zoom.prototype.applyTransform = function (maps, animate) {
|
|
311
383
|
var layerIndex;
|
|
312
384
|
this.templateCount = 0;
|
|
313
385
|
var layer;
|
|
@@ -315,14 +387,14 @@ var Zoom = /** @class */ (function () {
|
|
|
315
387
|
var zoomshapelocation;
|
|
316
388
|
var i;
|
|
317
389
|
var markerStyle;
|
|
318
|
-
var scale =
|
|
319
|
-
var x =
|
|
320
|
-
var y =
|
|
390
|
+
var scale = maps.scale;
|
|
391
|
+
var x = maps.translatePoint.x;
|
|
392
|
+
var y = maps.translatePoint.y;
|
|
321
393
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
322
394
|
var collection = [];
|
|
323
|
-
|
|
324
|
-
if (document.getElementById(
|
|
325
|
-
removeElement(
|
|
395
|
+
maps.zoomShapeCollection = [];
|
|
396
|
+
if (document.getElementById(maps.element.id + '_mapsTooltip')) {
|
|
397
|
+
removeElement(maps.element.id + '_mapsTooltip');
|
|
326
398
|
}
|
|
327
399
|
if (this.layerCollectionEle) {
|
|
328
400
|
for (var i_1 = 0; i_1 < this.layerCollectionEle.childElementCount; i_1++) {
|
|
@@ -330,30 +402,29 @@ var Zoom = /** @class */ (function () {
|
|
|
330
402
|
if (layerElement.tagName === 'g') {
|
|
331
403
|
this.templateCount++;
|
|
332
404
|
this.index = layerElement.id.indexOf('_LayerIndex_') > -1 && parseFloat(layerElement.id.split('_LayerIndex_')[1].split('_')[0]);
|
|
333
|
-
this.currentLayer =
|
|
334
|
-
var factor =
|
|
405
|
+
this.currentLayer = maps.layersCollection[this.index];
|
|
406
|
+
var factor = maps.mapLayerPanel.calculateFactor(this.currentLayer);
|
|
335
407
|
for (var j = 0; j < layerElement.childElementCount; j++) {
|
|
336
408
|
var currentEle = layerElement.childNodes[j];
|
|
337
409
|
if (!(currentEle.id.indexOf('_Markers_Group') > -1) && (!(currentEle.id.indexOf('_bubble_Group') > -1))
|
|
338
410
|
&& (!(currentEle.id.indexOf('_dataLableIndex_Group') > -1))) {
|
|
339
|
-
if (
|
|
411
|
+
if (maps.isTileMap && (currentEle.id.indexOf('_line_Group') > -1)) {
|
|
340
412
|
currentEle.remove();
|
|
341
413
|
if (layerElement.children.length > 0 && layerElement.children[0]) {
|
|
342
|
-
layerElement.insertBefore(
|
|
414
|
+
layerElement.insertBefore(maps.navigationLineModule.renderNavigation(this.currentLayer, maps.tileZoomLevel, this.index), layerElement.children[1]);
|
|
343
415
|
}
|
|
344
416
|
else {
|
|
345
|
-
layerElement.appendChild(
|
|
417
|
+
layerElement.appendChild(maps.navigationLineModule.renderNavigation(this.currentLayer, maps.tileZoomLevel, this.index));
|
|
346
418
|
}
|
|
347
419
|
}
|
|
348
|
-
else {
|
|
349
|
-
changeBorderWidth(currentEle, this.index, scale,
|
|
350
|
-
|
|
420
|
+
else if (currentEle.id.indexOf('Legend') == -1) {
|
|
421
|
+
changeBorderWidth(currentEle, this.index, scale, maps);
|
|
422
|
+
maps.zoomTranslatePoint = maps.translatePoint;
|
|
351
423
|
this.animateTransform(currentEle, animate, x, y, scale);
|
|
352
|
-
this.shapeZoomLocation = currentEle.childNodes;
|
|
353
424
|
}
|
|
354
425
|
}
|
|
355
426
|
else if (currentEle.id.indexOf('_Markers_Group') > -1) {
|
|
356
|
-
if (!this.isPanning) {
|
|
427
|
+
if (!this.isPanning && !isNullOrUndefined(currentEle.childNodes[0])) {
|
|
357
428
|
this.markerTranslates(currentEle.childNodes[0], factor, x, y, scale, 'Marker', layerElement, animate);
|
|
358
429
|
}
|
|
359
430
|
currentEle = layerElement.childNodes[j];
|
|
@@ -372,11 +443,11 @@ var Zoom = /** @class */ (function () {
|
|
|
372
443
|
markerSelectionValues['latitude'] ||
|
|
373
444
|
this.currentLayer.markerSettings[markerIndex].initialMarkerSelection[x_1]['longitude'] ===
|
|
374
445
|
markerSelectionValues['longitude']) {
|
|
375
|
-
|
|
446
|
+
maps.markerSelection(this.currentLayer.markerSettings[markerIndex].selectionSettings, maps, currentEle.children[k], this.currentLayer.markerSettings[markerIndex].dataSource[dataIndex]);
|
|
376
447
|
}
|
|
377
448
|
}
|
|
378
|
-
if ((this.currentLayer.animationDuration > 0 || (
|
|
379
|
-
if (
|
|
449
|
+
if ((this.currentLayer.animationDuration > 0 || (maps.layersCollection[0].animationDuration > 0 && this.currentLayer.type === 'SubLayer')) && !this.isPanning) {
|
|
450
|
+
if (maps.isTileMap) {
|
|
380
451
|
var groupElement = document.querySelector('.GroupElement');
|
|
381
452
|
if (groupElement && !(document.querySelector('.ClusterGroupElement')) && markerAnimation) {
|
|
382
453
|
groupElement.style.display = 'none';
|
|
@@ -388,29 +459,29 @@ var Zoom = /** @class */ (function () {
|
|
|
388
459
|
}
|
|
389
460
|
}
|
|
390
461
|
}
|
|
391
|
-
if (this.isPanning &&
|
|
392
|
-
clusterSeparate(
|
|
462
|
+
if (this.isPanning && maps.markerModule.sameMarkerData.length > 0) {
|
|
463
|
+
clusterSeparate(maps.markerModule.sameMarkerData, maps, currentEle, true);
|
|
393
464
|
}
|
|
394
|
-
else if (
|
|
395
|
-
|
|
396
|
-
if (document.getElementById(
|
|
397
|
-
removeElement(
|
|
465
|
+
else if (maps.markerModule.sameMarkerData.length > 0) {
|
|
466
|
+
maps.markerModule.sameMarkerData = [];
|
|
467
|
+
if (document.getElementById(maps.element.id + '_mapsTooltip')) {
|
|
468
|
+
removeElement(maps.element.id + '_mapsTooltip');
|
|
398
469
|
}
|
|
399
470
|
}
|
|
400
|
-
if (document.getElementById(
|
|
471
|
+
if (document.getElementById(maps.element.id + '_mapsTooltip') && maps.mapsTooltipModule.tooltipTargetID.indexOf('_MarkerIndex_')
|
|
401
472
|
&& !this.isPanning) {
|
|
402
|
-
var mapsTooltip =
|
|
473
|
+
var mapsTooltip = maps.mapsTooltipModule;
|
|
403
474
|
var tooltipElement = currentEle.querySelector('#' + mapsTooltip.tooltipTargetID);
|
|
404
475
|
if (!isNullOrUndefined(tooltipElement)) {
|
|
405
476
|
if (tooltipElement['style']['visibility'] === 'hidden') {
|
|
406
|
-
removeElement(
|
|
477
|
+
removeElement(maps.element.id + '_mapsTooltip');
|
|
407
478
|
}
|
|
408
479
|
else {
|
|
409
480
|
var x_2 = parseFloat(tooltipElement.getAttribute('transform').split('(')[1].split(')')[0].split(' ')[1]);
|
|
410
481
|
var y_1 = parseFloat(tooltipElement.getAttribute('transform').split('(')[1].split(')')[0].split(' ')[2]);
|
|
411
|
-
if (
|
|
412
|
-
x_2 += +getElement(
|
|
413
|
-
y_1 += +getElement(
|
|
482
|
+
if (maps.isTileMap) {
|
|
483
|
+
x_2 += +getElement(maps.element.id + '_tile_parent')['style']['left'].split('px')[0];
|
|
484
|
+
y_1 += +getElement(maps.element.id + '_tile_parent')['style']['top'].split('px')[0];
|
|
414
485
|
}
|
|
415
486
|
mapsTooltip.svgTooltip.location.x = x_2;
|
|
416
487
|
mapsTooltip.svgTooltip.location.y = y_1;
|
|
@@ -428,9 +499,9 @@ var Zoom = /** @class */ (function () {
|
|
|
428
499
|
layerIndex = parseFloat(childElement.id.split('_LayerIndex_')[1].split('_')[0]);
|
|
429
500
|
var bubleIndex = parseFloat(childElement.id.split('_BubbleIndex_')[1].split('_')[0]);
|
|
430
501
|
var dataIndex = parseFloat(childElement.id.split('_BubbleIndex_')[1].split('_')[2]);
|
|
431
|
-
for (var l = 0; l <
|
|
502
|
+
for (var l = 0; l < maps.bubbleModule.bubbleCollection.length; l++) {
|
|
432
503
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
433
|
-
var bubbleCollection =
|
|
504
|
+
var bubbleCollection = maps.bubbleModule.bubbleCollection[l];
|
|
434
505
|
if (bubbleCollection['LayerIndex'] === layerIndex && bubbleCollection['BubbleIndex'] === bubleIndex &&
|
|
435
506
|
bubbleCollection['DataIndex'] === dataIndex) {
|
|
436
507
|
var centerX = bubbleCollection['center']['x'];
|
|
@@ -449,24 +520,25 @@ var Zoom = /** @class */ (function () {
|
|
|
449
520
|
}
|
|
450
521
|
}
|
|
451
522
|
}
|
|
452
|
-
else if (currentEle.id.indexOf('_dataLableIndex_Group') > -1) {
|
|
523
|
+
else if (currentEle.id.indexOf('_dataLableIndex_Group') > -1 && !isNullOrUndefined(maps.layers[this.index])) {
|
|
453
524
|
this.intersect = [];
|
|
454
|
-
|
|
455
|
-
|
|
525
|
+
maps.zoomLabelPositions = [];
|
|
526
|
+
maps.zoomLabelPositions = maps.dataLabelModule.dataLabelCollections;
|
|
527
|
+
var labelAnimate = !maps.isTileMap && animate;
|
|
456
528
|
for (var k = 0; k < currentEle.childElementCount; k++) {
|
|
457
529
|
if (currentEle.childNodes[k]['id'].indexOf('_LabelIndex_') > -1) {
|
|
458
530
|
var labelIndex = parseFloat(currentEle.childNodes[k]['id'].split('_LabelIndex_')[1].split('_')[0]);
|
|
459
|
-
this.zoomshapewidth =
|
|
460
|
-
|
|
461
|
-
this.dataLabelTranslate(currentEle.childNodes[k], factor, x, y, scale, 'DataLabel',
|
|
462
|
-
var dataLabel =
|
|
531
|
+
this.zoomshapewidth = currentEle.childNodes[k].getBoundingClientRect();
|
|
532
|
+
maps.zoomShapeCollection.push(this.zoomshapewidth);
|
|
533
|
+
this.dataLabelTranslate(currentEle.childNodes[k], factor, x, y, scale, 'DataLabel', labelAnimate);
|
|
534
|
+
var dataLabel = maps.layers[this.index].dataLabelSettings;
|
|
463
535
|
var border = dataLabel.border;
|
|
464
536
|
if (k > 0 && border['width'] > 1) {
|
|
465
|
-
if (currentEle.childNodes[k - 1]['id'].indexOf('_rectIndex_') > -1) {
|
|
466
|
-
var labelX = ((
|
|
467
|
-
var labelY = ((
|
|
537
|
+
if (currentEle.childNodes[k - 1]['id'].indexOf('_rectIndex_') > -1 && !isNullOrUndefined(maps.zoomLabelPositions[labelIndex])) {
|
|
538
|
+
var labelX = ((maps.zoomLabelPositions[labelIndex]['location']['x'] + x) * scale);
|
|
539
|
+
var labelY = ((maps.zoomLabelPositions[labelIndex]['location']['y'] + y) * scale);
|
|
468
540
|
var zoomtext = currentEle.childNodes[k]['innerHTML'];
|
|
469
|
-
var style =
|
|
541
|
+
var style = maps.layers[this.index].dataLabelSettings.textStyle;
|
|
470
542
|
var zoomtextSize = measureText(zoomtext, style);
|
|
471
543
|
var padding = 5;
|
|
472
544
|
var rectElement = currentEle.childNodes[k - 1];
|
|
@@ -481,11 +553,11 @@ var Zoom = /** @class */ (function () {
|
|
|
481
553
|
}
|
|
482
554
|
}
|
|
483
555
|
}
|
|
484
|
-
|
|
556
|
+
maps.arrangeTemplate();
|
|
485
557
|
}
|
|
486
558
|
if (!isNullOrUndefined(this.currentLayer)) {
|
|
487
|
-
if (!animate || this.currentLayer.animationDuration === 0 ||
|
|
488
|
-
this.processTemplate(x, y, scale,
|
|
559
|
+
if (!animate || this.currentLayer.animationDuration === 0 || maps.isTileMap) {
|
|
560
|
+
this.processTemplate(x, y, scale, maps);
|
|
489
561
|
}
|
|
490
562
|
}
|
|
491
563
|
}
|
|
@@ -545,10 +617,10 @@ var Zoom = /** @class */ (function () {
|
|
|
545
617
|
}
|
|
546
618
|
var lati = (!isNullOrUndefined(markerSettings.latitudeValuePath)) ?
|
|
547
619
|
Number(getValueFromObject(data, markerSettings.latitudeValuePath)) : !isNullOrUndefined(data['latitude']) ?
|
|
548
|
-
parseFloat(data['latitude']) : !isNullOrUndefined(data['Latitude']) ? data['Latitude'] :
|
|
620
|
+
parseFloat(data['latitude']) : !isNullOrUndefined(data['Latitude']) ? data['Latitude'] : null;
|
|
549
621
|
var long = (!isNullOrUndefined(markerSettings.longitudeValuePath)) ?
|
|
550
622
|
Number(getValueFromObject(data, markerSettings.longitudeValuePath)) : !isNullOrUndefined(data['longitude']) ?
|
|
551
|
-
parseFloat(data['longitude']) : !isNullOrUndefined(data['Longitude']) ? data['Longitude'] :
|
|
623
|
+
parseFloat(data['longitude']) : !isNullOrUndefined(data['Longitude']) ? data['Longitude'] : null;
|
|
552
624
|
var offset = markerSettings.offset;
|
|
553
625
|
if (!eventArgs.cancel && markerSettings.visible && !isNullOrUndefined(long) && !isNullOrUndefined(lati)) {
|
|
554
626
|
var markerID = _this.maps.element.id + '_LayerIndex_' + layerIndex + '_MarkerIndex_'
|
|
@@ -568,10 +640,10 @@ var Zoom = /** @class */ (function () {
|
|
|
568
640
|
nullCount += (!isNaN(lati) && !isNaN(long)) ? 0 : 1;
|
|
569
641
|
markerTemplateCounts += (eventArgs.cancel) ? 1 : 0;
|
|
570
642
|
markerCounts += (eventArgs.cancel) ? 1 : 0;
|
|
571
|
-
_this.maps.markerNullCount = (
|
|
572
|
-
? _this.maps.markerNullCount : _this.maps.markerNullCount
|
|
643
|
+
_this.maps.markerNullCount = (isNullOrUndefined(lati) || isNullOrUndefined(long))
|
|
644
|
+
? _this.maps.markerNullCount + 1 : _this.maps.markerNullCount;
|
|
573
645
|
var markerDataLength = markerDatas.length - _this.maps.markerNullCount;
|
|
574
|
-
if (markerSVGObject.childElementCount === (
|
|
646
|
+
if (markerSVGObject.childElementCount === (markerDataLength - markerTemplateCounts - nullCount) && (type !== 'Template')) {
|
|
575
647
|
layerElement.appendChild(markerSVGObject);
|
|
576
648
|
if (currentLayers.markerClusterSettings.allowClustering) {
|
|
577
649
|
_this.maps.svgObject.appendChild(markerSVGObject);
|
|
@@ -579,7 +651,7 @@ var Zoom = /** @class */ (function () {
|
|
|
579
651
|
clusterTemplate(currentLayers, markerSVGObject, _this.maps, layerIndex, markerSVGObject, layerElement, true, true);
|
|
580
652
|
}
|
|
581
653
|
}
|
|
582
|
-
if (markerTemplateElements.childElementCount === (
|
|
654
|
+
if (markerTemplateElements.childElementCount === (markerDataLength - markerCounts - nullCount) && getElementByID(_this.maps.element.id + '_Secondary_Element')) {
|
|
583
655
|
getElementByID(_this.maps.element.id + '_Secondary_Element').appendChild(markerTemplateElements);
|
|
584
656
|
if (scale >= 1) {
|
|
585
657
|
if (currentLayers.markerClusterSettings.allowClustering) {
|
|
@@ -675,7 +747,7 @@ var Zoom = /** @class */ (function () {
|
|
|
675
747
|
}
|
|
676
748
|
if (this.maps.layers[this.index].dataLabelSettings.smartLabelMode === 'Hide') {
|
|
677
749
|
if (scale > 1) {
|
|
678
|
-
text = (this.
|
|
750
|
+
text = ((this.maps.dataLabelShape[l] * scale) >= zoomtextSize['width']) ? zoomtext : '';
|
|
679
751
|
element.innerHTML = text;
|
|
680
752
|
}
|
|
681
753
|
else {
|
|
@@ -685,7 +757,7 @@ var Zoom = /** @class */ (function () {
|
|
|
685
757
|
}
|
|
686
758
|
if (this.maps.layers[this.index].dataLabelSettings.smartLabelMode === 'Trim') {
|
|
687
759
|
if (scale > 1) {
|
|
688
|
-
zoomtrimLabel = textTrim(this.
|
|
760
|
+
zoomtrimLabel = textTrim((this.maps.dataLabelShape[l] * scale), zoomtext, style);
|
|
689
761
|
text = zoomtrimLabel;
|
|
690
762
|
element.innerHTML = text;
|
|
691
763
|
}
|
|
@@ -723,7 +795,7 @@ var Zoom = /** @class */ (function () {
|
|
|
723
795
|
|| textLocations['heightTop'] > this.intersect[j]['heightBottom']) {
|
|
724
796
|
trimmedLable = !isNullOrUndefined(text) ? text : zoomtext;
|
|
725
797
|
if (scale > 1) {
|
|
726
|
-
trimmedLable = textTrim(this.
|
|
798
|
+
trimmedLable = textTrim((this.maps.dataLabelShape[l] * scale), trimmedLable, style);
|
|
727
799
|
}
|
|
728
800
|
element.innerHTML = trimmedLable;
|
|
729
801
|
}
|
|
@@ -749,11 +821,11 @@ var Zoom = /** @class */ (function () {
|
|
|
749
821
|
}
|
|
750
822
|
this.intersect.push(textLocations);
|
|
751
823
|
if (isNullOrUndefined(trimmedLable)) {
|
|
752
|
-
trimmedLable = textTrim(this.
|
|
824
|
+
trimmedLable = textTrim((this.maps.dataLabelShape[l] * scale), zoomtext, style);
|
|
753
825
|
element.innerHTML = trimmedLable;
|
|
754
826
|
}
|
|
755
827
|
}
|
|
756
|
-
|
|
828
|
+
if (animate || duration > 0) {
|
|
757
829
|
smoothTranslate(element, 0, duration, new MapLocation(labelX, labelY));
|
|
758
830
|
}
|
|
759
831
|
}
|
|
@@ -875,7 +947,7 @@ var Zoom = /** @class */ (function () {
|
|
|
875
947
|
var layerRect = getElementByID(map.element.id + '_Layer_Collections').getBoundingClientRect();
|
|
876
948
|
var elementRect = getElementByID(map.element.id + '_svg').getBoundingClientRect();
|
|
877
949
|
var panningXDirection = ((xDifference < 0 ? layerRect.left <= (elementRect.left + map.mapAreaRect.x) :
|
|
878
|
-
((layerRect.left + layerRect.width
|
|
950
|
+
((layerRect.left + layerRect.width + map.mapAreaRect.x) >= (elementRect.width))));
|
|
879
951
|
var panningYDirection = ((yDifference < 0 ? layerRect.top <= (elementRect.top + map.mapAreaRect.y) :
|
|
880
952
|
((layerRect.top + layerRect.height + legendHeight + map.margin.top) >= (elementRect.top + elementRect.height))));
|
|
881
953
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -889,15 +961,15 @@ var Zoom = /** @class */ (function () {
|
|
|
889
961
|
if (!panArgs.cancel) {
|
|
890
962
|
if (panningXDirection && panningYDirection) {
|
|
891
963
|
map.translatePoint = new Point(x, y);
|
|
892
|
-
this.applyTransform();
|
|
964
|
+
this.applyTransform(map);
|
|
893
965
|
}
|
|
894
966
|
else if (panningXDirection) {
|
|
895
967
|
map.translatePoint = new Point(x, map.translatePoint.y);
|
|
896
|
-
this.applyTransform();
|
|
968
|
+
this.applyTransform(map);
|
|
897
969
|
}
|
|
898
970
|
else if (panningYDirection) {
|
|
899
971
|
map.translatePoint = new Point(map.translatePoint.x, y);
|
|
900
|
-
this.applyTransform();
|
|
972
|
+
this.applyTransform(map);
|
|
901
973
|
}
|
|
902
974
|
}
|
|
903
975
|
this.maps.zoomNotApplied = false;
|
|
@@ -925,7 +997,7 @@ var Zoom = /** @class */ (function () {
|
|
|
925
997
|
};
|
|
926
998
|
map.trigger(pan, panArgs);
|
|
927
999
|
map.mapLayerPanel.generateTiles(map.tileZoomLevel, map.tileTranslatePoint, 'Pan');
|
|
928
|
-
this.applyTransform();
|
|
1000
|
+
this.applyTransform(map);
|
|
929
1001
|
}
|
|
930
1002
|
map.zoomTranslatePoint = map.translatePoint;
|
|
931
1003
|
this.mouseDownPoints = this.mouseMovePoints;
|
|
@@ -937,7 +1009,7 @@ var Zoom = /** @class */ (function () {
|
|
|
937
1009
|
(this.distanceX / this.maps.scale)) : this.maps.translatePoint.x;
|
|
938
1010
|
this.maps.translatePoint.y = !isNullOrUndefined(this.distanceY) ? this.maps.translatePoint.y -
|
|
939
1011
|
(this.distanceY / this.maps.scale) : this.maps.translatePoint.y;
|
|
940
|
-
this.applyTransform(false);
|
|
1012
|
+
this.applyTransform(this.maps, false);
|
|
941
1013
|
};
|
|
942
1014
|
Zoom.prototype.toolBarZooming = function (zoomFactor, type) {
|
|
943
1015
|
var _this = this;
|
|
@@ -968,18 +1040,36 @@ var Zoom = /** @class */ (function () {
|
|
|
968
1040
|
var max = map.baseMapRectBounds['max'];
|
|
969
1041
|
var mapWidth = Math.abs(max['x'] - min['x']);
|
|
970
1042
|
var mapHeight = Math.abs(min['y'] - max['y']);
|
|
971
|
-
var translatePointX =
|
|
972
|
-
var translatePointY =
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
1043
|
+
var translatePointX = void 0;
|
|
1044
|
+
var translatePointY = void 0;
|
|
1045
|
+
if (zoomFactor < 1.2 && map.projectionType !== 'Eckert5') {
|
|
1046
|
+
if (mapHeight === 0 || mapWidth === 0 || mapHeight === mapWidth) {
|
|
1047
|
+
mapWidth = size.width / 2;
|
|
1048
|
+
mapHeight = size.height;
|
|
1049
|
+
}
|
|
1050
|
+
zoomFactor = parseFloat(Math.min(size.width / mapWidth, size.height / mapHeight).toFixed(2));
|
|
1051
|
+
zoomFactor = zoomFactor > 1.05 ? 1 : zoomFactor;
|
|
1052
|
+
map.translatePoint = this.calculateInitalZoomTranslatePoint(zoomFactor, mapWidth, mapHeight, size, min, map);
|
|
1053
|
+
}
|
|
1054
|
+
else {
|
|
1055
|
+
translatePointX = translatePoint.x - (((size.width / scale) - (size.width / zoomFactor)) / 2);
|
|
1056
|
+
translatePointY = translatePoint.y - (((size.height / scale) - (size.height / zoomFactor)) / 2);
|
|
1057
|
+
var currentHeight = Math.abs(map.baseMapRectBounds['max']['y'] - map.baseMapRectBounds['min']['y']) * zoomFactor;
|
|
1058
|
+
translatePointX = (currentHeight < map.mapAreaRect.height) ? (size.x + ((-(min['x'])) + ((size.width / 2) - (mapWidth / 2))))
|
|
1059
|
+
: translatePointX;
|
|
1060
|
+
translatePointY = (currentHeight < map.mapAreaRect.height) ? (size.y + ((-(min['y'])) + ((size.height / 2) - (mapHeight / 2))))
|
|
1061
|
+
: translatePointY;
|
|
1062
|
+
map.translatePoint = new Point(translatePointX, translatePointY);
|
|
1063
|
+
}
|
|
979
1064
|
map.zoomTranslatePoint = map.translatePoint;
|
|
980
1065
|
map.scale = zoomFactor;
|
|
981
|
-
this.triggerZoomEvent(prevTilePoint, prevLevel, type)
|
|
982
|
-
|
|
1066
|
+
if (this.triggerZoomEvent(prevTilePoint, prevLevel, type)) {
|
|
1067
|
+
map.translatePoint = map.zoomTranslatePoint = map.previousPoint;
|
|
1068
|
+
map.scale = map.previousScale;
|
|
1069
|
+
}
|
|
1070
|
+
else {
|
|
1071
|
+
this.applyTransform(map, true);
|
|
1072
|
+
}
|
|
983
1073
|
}
|
|
984
1074
|
else if ((map.isTileMap) && ((zoomFactor >= minZoom && zoomFactor <= maxZoom) || map.isReset)) {
|
|
985
1075
|
var tileZoomFactor = prevLevel < minZoom && !map.isReset ? minZoom : zoomFactor;
|
|
@@ -996,38 +1086,48 @@ var Zoom = /** @class */ (function () {
|
|
|
996
1086
|
map.tileTranslatePoint.y = map.initialTileTranslate.y;
|
|
997
1087
|
tileZoomFactor = map.tileZoomLevel = map.mapScaleValue = map.initialZoomLevel;
|
|
998
1088
|
}
|
|
999
|
-
this.triggerZoomEvent(prevTilePoint, prevLevel, type)
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
}
|
|
1005
|
-
if (document.querySelector('.GroupElement')) {
|
|
1006
|
-
document.querySelector('.GroupElement').style.display = 'none';
|
|
1089
|
+
if (this.triggerZoomEvent(prevTilePoint, prevLevel, type)) {
|
|
1090
|
+
map.translatePoint = map.tileTranslatePoint = new Point(0, 0);
|
|
1091
|
+
map.scale = map.previousScale;
|
|
1092
|
+
map.tileZoomLevel = prevLevel;
|
|
1093
|
+
map.zoomSettings.zoomFactor = map.previousScale;
|
|
1007
1094
|
}
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
if (type === 'ZoomOut' || type === 'Reset') {
|
|
1014
|
-
// element1.removeChild(element1.children[element1.childElementCount - 1]);
|
|
1015
|
-
// element1.childElementCount ? element1.removeChild(element1.children[element1.childElementCount - 1]) : element1;
|
|
1095
|
+
else {
|
|
1096
|
+
map.translatePoint.y = (map.tileTranslatePoint.y - (0.01 * map.mapScaleValue)) / map.scale;
|
|
1097
|
+
map.translatePoint.x = (map.tileTranslatePoint.x - (0.01 * map.mapScaleValue)) / map.scale;
|
|
1098
|
+
if (document.getElementById(this.maps.element.id + '_LayerIndex_1')) {
|
|
1099
|
+
document.getElementById(this.maps.element.id + '_LayerIndex_1').style.display = 'none';
|
|
1016
1100
|
}
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
document.getElementById(_this.maps.element.id + '_LayerIndex_1').style.display = 'block';
|
|
1101
|
+
if (document.querySelector('.GroupElement')) {
|
|
1102
|
+
document.querySelector('.GroupElement').style.display = 'none';
|
|
1020
1103
|
}
|
|
1021
|
-
|
|
1104
|
+
this.markerLineAnimation(map);
|
|
1105
|
+
map.mapLayerPanel.generateTiles(tileZoomFactor, map.tileTranslatePoint, type);
|
|
1106
|
+
var element1 = document.getElementById(this.maps.element.id + '_tiles');
|
|
1107
|
+
var animationDuration = this.maps.layersCollection[0].animationDuration;
|
|
1108
|
+
setTimeout(function () {
|
|
1109
|
+
if (type === 'ZoomOut' || type === 'Reset') {
|
|
1110
|
+
// element1.removeChild(element1.children[element1.childElementCount - 1]);
|
|
1111
|
+
// element1.childElementCount ? element1.removeChild(element1.children[element1.childElementCount - 1]) : element1;
|
|
1112
|
+
}
|
|
1113
|
+
_this.applyTransform(_this.maps, true);
|
|
1114
|
+
if (document.getElementById(_this.maps.element.id + '_LayerIndex_1')) {
|
|
1115
|
+
document.getElementById(_this.maps.element.id + '_LayerIndex_1').style.display = 'block';
|
|
1116
|
+
}
|
|
1117
|
+
_this.maps.isAddLayer = false;
|
|
1118
|
+
}, animationDuration);
|
|
1119
|
+
}
|
|
1022
1120
|
}
|
|
1023
1121
|
this.maps.zoomNotApplied = false;
|
|
1024
1122
|
}
|
|
1025
1123
|
};
|
|
1026
1124
|
Zoom.prototype.createZoomingToolbars = function () {
|
|
1027
1125
|
var map = this.maps;
|
|
1126
|
+
var zoomInElements;
|
|
1127
|
+
var zoomOutElements;
|
|
1028
1128
|
this.toolBarGroup = map.renderer.createGroup({
|
|
1029
1129
|
id: map.element.id + '_Zooming_KitCollection',
|
|
1030
|
-
opacity: map.theme.toLowerCase() === '
|
|
1130
|
+
opacity: map.theme.toLowerCase() === 'fluentdark' ? 0.6 : 0.3
|
|
1031
1131
|
});
|
|
1032
1132
|
var kitHeight = 16;
|
|
1033
1133
|
var kitWidth = 16;
|
|
@@ -1042,7 +1142,6 @@ var Zoom = /** @class */ (function () {
|
|
|
1042
1142
|
var toolBarLength = map.zoomSettings.toolbars.length;
|
|
1043
1143
|
var toolWidth = (map.zoomSettings.toolBarOrientation === 'Horizontal') ? (toolBarLength * kitWidth) + (toolBarLength * padding) : (kitWidth * 2);
|
|
1044
1144
|
var toolHeight = (map.zoomSettings.toolBarOrientation === 'Horizontal') ? (kitHeight * 2) : (toolBarLength * kitHeight) + (toolBarLength * padding);
|
|
1045
|
-
this.toolBarGroup.appendChild(map.renderer.drawRectangle(new RectOption(map.element.id + '_Zooming_Rect', 'transparent', { color: 'transparent', width: 1 }, 1, new Rect(0, 0, toolWidth, toolHeight), 0, 0)));
|
|
1046
1145
|
var defElement = map.renderer.createDefs();
|
|
1047
1146
|
defElement.innerHTML = shadowElement;
|
|
1048
1147
|
this.toolBarGroup.appendChild(defElement);
|
|
@@ -1096,13 +1195,13 @@ var Zoom = /** @class */ (function () {
|
|
|
1096
1195
|
case 'zoomin':
|
|
1097
1196
|
direction = 'M 8, 0 L 8, 16 M 0, 8 L 16, 8';
|
|
1098
1197
|
this.currentToolbarEle.appendChild(map.renderer.drawPath(new PathOption(map.element.id + '_Zooming_ToolBar_' + toolbar_1 + '_Path', fill, 3, this.maps.themeStyle.zoomFillColor, 1, 1, null, direction)));
|
|
1099
|
-
|
|
1198
|
+
zoomInElements = this.currentToolbarEle;
|
|
1100
1199
|
this.wireEvents(this.currentToolbarEle, this.performToolBarAction);
|
|
1101
1200
|
break;
|
|
1102
1201
|
case 'zoomout':
|
|
1103
1202
|
direction = 'M 0, 8 L 16, 8';
|
|
1104
1203
|
this.currentToolbarEle.appendChild(map.renderer.drawPath(new PathOption(map.element.id + '_Zooming_ToolBar_' + toolbar_1, fill, 3, this.maps.themeStyle.zoomFillColor, 1, 1, null, direction)));
|
|
1105
|
-
|
|
1204
|
+
zoomOutElements = this.currentToolbarEle;
|
|
1106
1205
|
this.wireEvents(this.currentToolbarEle, this.performToolBarAction);
|
|
1107
1206
|
break;
|
|
1108
1207
|
case 'pan': {
|
|
@@ -1287,7 +1386,12 @@ var Zoom = /** @class */ (function () {
|
|
|
1287
1386
|
x = (size.width / 2) - (toolBarSize.width / 2);
|
|
1288
1387
|
break;
|
|
1289
1388
|
case 'Far':
|
|
1290
|
-
|
|
1389
|
+
if (!isNullOrUndefined(map.legendModule) && map.legendSettings.position === 'Left') {
|
|
1390
|
+
x = size.width + size.x - toolBarSize.width - padding;
|
|
1391
|
+
}
|
|
1392
|
+
else {
|
|
1393
|
+
x = (size.width - toolBarSize.width) - padding;
|
|
1394
|
+
}
|
|
1291
1395
|
break;
|
|
1292
1396
|
}
|
|
1293
1397
|
var extraPosition = map.getExtraPosition();
|
|
@@ -1343,6 +1447,7 @@ var Zoom = /** @class */ (function () {
|
|
|
1343
1447
|
}
|
|
1344
1448
|
else {
|
|
1345
1449
|
map.mapScaleValue = value - delta;
|
|
1450
|
+
map.isReset = (map.mapScaleValue < 1) ? true : false;
|
|
1346
1451
|
map.staticMapZoom = map.tileZoomLevel;
|
|
1347
1452
|
if (map.mapScaleValue === 1) {
|
|
1348
1453
|
map.markerCenterLatitude = null;
|
|
@@ -1437,14 +1542,14 @@ var Zoom = /** @class */ (function () {
|
|
|
1437
1542
|
if (document.getElementById(map.element.id + '_Zooming_ToolBar_Pan_Group')) {
|
|
1438
1543
|
if (!this.maps.zoomSettings.enablePanning) {
|
|
1439
1544
|
if (target.id.indexOf('_Zooming_ToolBar') > -1 || target.id.indexOf('_Zooming_Rect') > -1) {
|
|
1440
|
-
getElementByID(map.element.id + '_Zooming_ToolBar_Pan_Rect').setAttribute('opacity', map.theme.toLowerCase() === '
|
|
1441
|
-
getElementByID(map.element.id + '_Zooming_ToolBar_Pan').setAttribute('opacity', map.theme.toLowerCase() === '
|
|
1545
|
+
getElementByID(map.element.id + '_Zooming_ToolBar_Pan_Rect').setAttribute('opacity', map.theme.toLowerCase() === 'fluentdark' ? '0.6' : '0.3');
|
|
1546
|
+
getElementByID(map.element.id + '_Zooming_ToolBar_Pan').setAttribute('opacity', map.theme.toLowerCase() === 'fluentdark' ? '0.6' : '0.3');
|
|
1442
1547
|
}
|
|
1443
1548
|
}
|
|
1444
1549
|
}
|
|
1445
1550
|
}
|
|
1446
1551
|
else {
|
|
1447
|
-
getElementByID(map.element.id + '_Zooming_KitCollection').setAttribute('opacity', map.theme.toLowerCase() === '
|
|
1552
|
+
getElementByID(map.element.id + '_Zooming_KitCollection').setAttribute('opacity', map.theme.toLowerCase() === 'fluentdark' ? '0.6' : '0.3');
|
|
1448
1553
|
if (!this.maps.zoomSettings.enablePanning && document.getElementById(map.element.id + '_Zooming_ToolBar_Pan_Group')) {
|
|
1449
1554
|
getElementByID(map.element.id + '_Zooming_ToolBar_Pan_Rect').setAttribute('opacity', '1');
|
|
1450
1555
|
getElementByID(map.element.id + '_Zooming_ToolBar_Pan').setAttribute('opacity', '1');
|
|
@@ -1596,15 +1701,30 @@ var Zoom = /** @class */ (function () {
|
|
|
1596
1701
|
/**
|
|
1597
1702
|
* To destroy the zoom.
|
|
1598
1703
|
*
|
|
1599
|
-
* @param {Maps} maps - Specifies the instance of the maps.
|
|
1600
1704
|
* @returns {void}
|
|
1601
1705
|
* @private
|
|
1602
1706
|
*/
|
|
1603
|
-
Zoom.prototype.destroy = function (
|
|
1707
|
+
Zoom.prototype.destroy = function () {
|
|
1708
|
+
this.toolBarGroup = null;
|
|
1709
|
+
this.currentToolbarEle = null;
|
|
1710
|
+
this.zoomingRect = null;
|
|
1711
|
+
this.zoomElements = null;
|
|
1712
|
+
this.panElements = null;
|
|
1713
|
+
this.baseTranslatePoint = null;
|
|
1714
|
+
this.touchStartList = null;
|
|
1715
|
+
this.touchMoveList = null;
|
|
1716
|
+
this.previousTouchMoveList = null;
|
|
1717
|
+
this.mouseDownPoints = null;
|
|
1718
|
+
this.mouseMovePoints = null;
|
|
1719
|
+
this.startTouches = [];
|
|
1720
|
+
this.zoomshapewidth = null;
|
|
1721
|
+
this.intersect = [];
|
|
1722
|
+
this.mouseDownLatLong = null;
|
|
1723
|
+
this.mouseMoveLatLong = null;
|
|
1604
1724
|
this.removeEventListener();
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1725
|
+
//TODO: Calling the below code throws spec issue.
|
|
1726
|
+
//this.maps = null;
|
|
1727
|
+
this.currentLayer = null;
|
|
1608
1728
|
};
|
|
1609
1729
|
return Zoom;
|
|
1610
1730
|
}());
|