@syncfusion/ej2-maps 28.2.9 → 29.1.34
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/README.md +1 -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 +312 -151
- package/dist/es6/ej2-maps.es2015.js.map +1 -1
- package/dist/es6/ej2-maps.es5.js +313 -151
- 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 +21 -23
- package/src/maps/layers/layer-panel.d.ts +3 -2
- package/src/maps/layers/layer-panel.js +105 -91
- package/src/maps/layers/legend.js +4 -2
- package/src/maps/maps.js +14 -0
- package/src/maps/model/base-model.d.ts +4 -0
- package/src/maps/model/base.d.ts +4 -0
- package/src/maps/user-interaction/highlight.d.ts +2 -1
- package/src/maps/user-interaction/highlight.js +5 -2
- package/src/maps/user-interaction/selection.d.ts +2 -1
- package/src/maps/user-interaction/selection.js +5 -2
- package/src/maps/user-interaction/tooltip.js +16 -16
- package/src/maps/user-interaction/zoom.d.ts +15 -0
- package/src/maps/user-interaction/zoom.js +164 -37
- package/src/maps/utils/helper.js +0 -1
|
@@ -34,6 +34,12 @@ var Zoom = /** @class */ (function () {
|
|
|
34
34
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
35
35
|
this.startTouches = [];
|
|
36
36
|
/** @private */
|
|
37
|
+
this.isCancellation = false;
|
|
38
|
+
this.pinchTileZoomScale = 1;
|
|
39
|
+
this.tileZoomLevel = 1;
|
|
40
|
+
this.pinchZoomScale = 1;
|
|
41
|
+
this.isPinchZooming = false;
|
|
42
|
+
/** @private */
|
|
37
43
|
this.mouseDownLatLong = { x: 0, y: 0 };
|
|
38
44
|
/** @private */
|
|
39
45
|
this.mouseMoveLatLong = { x: 0, y: 0 };
|
|
@@ -228,6 +234,22 @@ var Zoom = /** @class */ (function () {
|
|
|
228
234
|
map.tileTranslatePoint.y = (currentLevel === 1) ? ((bounds.height / 2) - ((tileDefaultSize * 2) / 2) + (padding * 2)) :
|
|
229
235
|
position.y - ((y * totalSize) / 100);
|
|
230
236
|
};
|
|
237
|
+
Zoom.prototype.getTileTranslate = function (currentLevel, type) {
|
|
238
|
+
var map = this.maps;
|
|
239
|
+
var padding = type === 'ZoomOut' ? 10 : (type === 'Reset' && currentLevel > 1) ? 0 : 10;
|
|
240
|
+
var bounds = map.availableSize;
|
|
241
|
+
var totalSize = Math.pow(2, currentLevel) * 256;
|
|
242
|
+
var x = (bounds.width / 2) - (totalSize / 2);
|
|
243
|
+
var y = (bounds.height / 2) - (totalSize / 2);
|
|
244
|
+
var position = convertTileLatLongToPoint(new MapLocation(this.pinchStartLatLong['longitude'], this.pinchStartLatLong['latitude']), currentLevel, { x: x, y: y }, true);
|
|
245
|
+
x -= position.x - (bounds.width / 2);
|
|
246
|
+
y = y - (position.y - (bounds.height / 2)) + padding;
|
|
247
|
+
var scale = Math.pow(2, currentLevel - 1);
|
|
248
|
+
map.tileTranslatePoint.x = x;
|
|
249
|
+
map.tileTranslatePoint.y = y;
|
|
250
|
+
map.translatePoint.x = (x - (0.01 * this.tileZoomLevel)) / scale;
|
|
251
|
+
map.translatePoint.y = (y - (0.01 * this.tileZoomLevel)) / scale;
|
|
252
|
+
};
|
|
231
253
|
/**
|
|
232
254
|
* @returns {void}
|
|
233
255
|
* @private
|
|
@@ -308,6 +330,11 @@ var Zoom = /** @class */ (function () {
|
|
|
308
330
|
this.setInteraction(null);
|
|
309
331
|
}
|
|
310
332
|
};
|
|
333
|
+
Zoom.prototype.tilePinchingProcess = function (scale) {
|
|
334
|
+
this.tileZoomLevel = Math.round(scale);
|
|
335
|
+
this.getTileTranslate(this.tileZoomLevel);
|
|
336
|
+
this.maps.mapLayerPanel.generateTiles(this.tileZoomLevel, this.maps.tileTranslatePoint, null, null, null, true);
|
|
337
|
+
};
|
|
311
338
|
/**
|
|
312
339
|
* @param {PointerEvent} e - Specifies the vent in the map
|
|
313
340
|
* @returns {void}
|
|
@@ -367,48 +394,112 @@ var Zoom = /** @class */ (function () {
|
|
|
367
394
|
}
|
|
368
395
|
}
|
|
369
396
|
else {
|
|
370
|
-
|
|
371
|
-
var
|
|
372
|
-
var
|
|
397
|
+
this.isPinchZooming = true;
|
|
398
|
+
var touchCenter = this.touchCenter;
|
|
399
|
+
var touchOnePoint = this.getMousePosition(this.touchMoveList[0].pageX, this.touchMoveList[0].pageY);
|
|
400
|
+
var touchTwoPoint = this.getMousePosition(this.touchMoveList[1].pageX, this.touchMoveList[1].pageY);
|
|
401
|
+
var distance = Math.sqrt(Math.pow((touchOnePoint.x - touchTwoPoint.x), 2) + Math.pow((touchOnePoint.y - touchTwoPoint.y), 2));
|
|
402
|
+
var pinchScale = distance / this.startDistance;
|
|
373
403
|
if (!isNullOrUndefined(this.pinchDistance)) {
|
|
404
|
+
var pinchZoomFactor = Math.log2(pinchScale * (256 * Math.pow(2, prevLevel)) / 256);
|
|
405
|
+
pinchZoomFactor = Math.min(map.zoomSettings.maxZoom, Math.max(map.zoomSettings.minZoom, pinchZoomFactor));
|
|
406
|
+
var scaleFactor = this.pinchDistance > distance ? (prevLevel * pinchScale) : pinchZoomFactor;
|
|
407
|
+
var factor = pinchZoomFactor;
|
|
408
|
+
var isZoomOut = false;
|
|
374
409
|
if (this.pinchDistance > distance) {
|
|
375
|
-
factor =
|
|
410
|
+
factor = (scaleFactor % 1);
|
|
411
|
+
isZoomOut = true;
|
|
376
412
|
}
|
|
377
413
|
else if (this.pinchDistance < distance) {
|
|
378
|
-
factor =
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
if (
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
map.scale = Math.pow(2, map.tileZoomLevel - 1);
|
|
386
|
-
this.getTileTranslatePosition(prevLevel, this.pinchFactor, { x: touchCenter.x, y: touchCenter.y }, null);
|
|
387
|
-
map.translatePoint.x = (map.tileTranslatePoint.x - (0.01 * map.scale)) / map.scale;
|
|
388
|
-
map.translatePoint.y = (map.tileTranslatePoint.y - (0.01 * map.scale)) / map.scale;
|
|
389
|
-
isZoomCancelled = this.triggerZoomEvent(prevTilePoint, prevLevel, '');
|
|
390
|
-
if (isZoomCancelled) {
|
|
391
|
-
map.translatePoint = map.tileTranslatePoint = new Point(0, 0);
|
|
392
|
-
map.scale = map.previousScale;
|
|
393
|
-
map.tileZoomLevel = prevLevel;
|
|
394
|
-
map.zoomSettings.zoomFactor = map.previousScale;
|
|
414
|
+
factor = (scaleFactor % 1) + 1;
|
|
415
|
+
}
|
|
416
|
+
var zoomFactor = Math.ceil(scaleFactor);
|
|
417
|
+
if (zoomFactor > map.zoomSettings.minZoom && zoomFactor <= map.zoomSettings.maxZoom) {
|
|
418
|
+
var element = document.getElementById(map.element.id);
|
|
419
|
+
if (element) {
|
|
420
|
+
element.style.overflow = 'hidden';
|
|
395
421
|
}
|
|
396
|
-
|
|
397
|
-
|
|
422
|
+
this.tileZoomLevel = zoomFactor;
|
|
423
|
+
var transformOriginX = (touchCenter.x / (map.mapAreaRect.width - map.mapAreaRect.x)) * 100;
|
|
424
|
+
var transformOriginY = (touchCenter.y / (map.mapAreaRect.height - map.mapAreaRect.y)) * 100;
|
|
425
|
+
var tilesParent = document.getElementById(map.element.id + '_tile_parent');
|
|
426
|
+
var copyTilesParent = document.getElementById(map.element.id + '_tiles');
|
|
427
|
+
if (!copyTilesParent) {
|
|
428
|
+
copyTilesParent = document.createElement('div');
|
|
429
|
+
copyTilesParent.id = map.element.id + '_tiles';
|
|
430
|
+
map.element.appendChild(copyTilesParent);
|
|
431
|
+
this.copyStyles(tilesParent, copyTilesParent);
|
|
432
|
+
copyTilesParent.style.zIndex = '0';
|
|
433
|
+
}
|
|
434
|
+
copyTilesParent.style.visibility = 'hidden';
|
|
435
|
+
tilesParent.style.transformOrigin = transformOriginX + "% " + transformOriginY + "%";
|
|
436
|
+
tilesParent.style.transform = "scale(" + factor + ")";
|
|
437
|
+
var svgElement = document.getElementById(map.element.id + '_Tile_SVG_Parent');
|
|
438
|
+
svgElement.style.transformOrigin = transformOriginX + "% " + transformOriginY + "%";
|
|
439
|
+
svgElement.style.transform = "scale(" + factor + ")";
|
|
440
|
+
if (!this.isCancellation && (0.2 >= scaleFactor % 1 && scaleFactor % 1 >= 0.1 && !isZoomOut) || (scaleFactor % 1 <= 0.9 && isZoomOut)) {
|
|
441
|
+
var animateTile = document.getElementById(map.element.id + '_animates_tiles');
|
|
442
|
+
if (!animateTile) {
|
|
443
|
+
animateTile = document.createElement('div');
|
|
444
|
+
animateTile.id = map.element.id + '_animates_tiles';
|
|
445
|
+
animateTile.classList.add(this.tileZoomLevel.toString());
|
|
446
|
+
copyTilesParent.appendChild(animateTile);
|
|
447
|
+
}
|
|
448
|
+
if (animateTile.childElementCount === 0) {
|
|
449
|
+
this.pinchZoomScale = isZoomOut ? Math.floor(scaleFactor) : Math.ceil(scaleFactor);
|
|
450
|
+
this.tilePinchingProcess(this.pinchZoomScale);
|
|
451
|
+
this.isCancellation = true;
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
if (this.isCancellation && (scaleFactor % 1 >= 0.99 && !isZoomOut) || (scaleFactor % 1 <= 0.1 && isZoomOut)) {
|
|
455
|
+
if (tilesParent.style.transformOrigin !== '' && this.isCancellation) {
|
|
456
|
+
tilesParent.style.transformOrigin = '';
|
|
457
|
+
tilesParent.style.transform = '';
|
|
458
|
+
svgElement.style.transformOrigin = '';
|
|
459
|
+
svgElement.style.transform = '';
|
|
460
|
+
this.pinchTileZoomScale = isZoomOut ? Math.floor(scaleFactor) : Math.ceil(scaleFactor);
|
|
461
|
+
this.getTileTranslate(this.pinchTileZoomScale);
|
|
462
|
+
var targetElement_1 = document.getElementById(map.element.id + '_animated_tiles');
|
|
463
|
+
var sourceElement = document.getElementById(map.element.id + '_animates_tiles');
|
|
464
|
+
while (targetElement_1.firstChild) {
|
|
465
|
+
targetElement_1.removeChild(targetElement_1.firstChild);
|
|
466
|
+
}
|
|
467
|
+
Array.from(sourceElement.children).forEach(function (child) {
|
|
468
|
+
targetElement_1.appendChild(child.cloneNode(true));
|
|
469
|
+
});
|
|
470
|
+
document.getElementById(map.element.id + '_animated_tiles')['className'] = this.pinchTileZoomScale.toFixed(0);
|
|
471
|
+
if (sourceElement) {
|
|
472
|
+
while (sourceElement.firstChild) {
|
|
473
|
+
sourceElement.removeChild(sourceElement.firstChild);
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
this.isCancellation = false;
|
|
477
|
+
map.mapScaleValue = this.pinchTileZoomScale;
|
|
478
|
+
map.scale = Math.pow(2, this.pinchTileZoomScale - 1);
|
|
479
|
+
this.applyTransform(map);
|
|
480
|
+
}
|
|
398
481
|
}
|
|
399
482
|
}
|
|
400
483
|
}
|
|
401
484
|
this.pinchDistance = distance;
|
|
402
485
|
}
|
|
403
|
-
map.
|
|
404
|
-
|
|
405
|
-
|
|
486
|
+
if (!map.isTileMap) {
|
|
487
|
+
map.mapScaleValue = zoomCalculationFactor;
|
|
488
|
+
if (!isZoomCancelled) {
|
|
489
|
+
this.applyTransform(map);
|
|
490
|
+
}
|
|
491
|
+
this.triggerZoomComplete(map, prevLevel, '');
|
|
406
492
|
}
|
|
407
|
-
this.triggerZoomComplete(map, prevLevel, '');
|
|
408
493
|
if (Browser.isDevice) {
|
|
409
494
|
this.removeToolbarOpacity(map.isTileMap ? Math.round(map.tileZoomLevel) : map.scale, map.element.id + '_Zooming_');
|
|
410
495
|
}
|
|
411
496
|
};
|
|
497
|
+
Zoom.prototype.copyStyles = function (sourceElement, targetElement) {
|
|
498
|
+
var sourceStyles = window.getComputedStyle(sourceElement);
|
|
499
|
+
Array.from(sourceStyles).forEach(function (style) {
|
|
500
|
+
targetElement.style[style] = sourceStyles.getPropertyValue(style);
|
|
501
|
+
});
|
|
502
|
+
};
|
|
412
503
|
Zoom.prototype.getTouchCenterPoint = function () {
|
|
413
504
|
var touchList = [];
|
|
414
505
|
for (var i = 0; i < this.touchMoveList.length; i++) {
|
|
@@ -472,6 +563,7 @@ var Zoom = /** @class */ (function () {
|
|
|
472
563
|
height: map.availableSize.height,
|
|
473
564
|
style: 'position: absolute;'
|
|
474
565
|
});
|
|
566
|
+
rectSVGObject.style.position = 'absolute';
|
|
475
567
|
var rectOption = new RectOption(map.element.id + '_ZoomRect', this.maps.themeStyle.rectangleZoomFillColor, border, this.maps.themeStyle.rectangleZoomFillOpacity, this.zoomingRect, 0, 0, '', '3');
|
|
476
568
|
rectSVGObject.appendChild(map.renderer.drawRectangle(rectOption));
|
|
477
569
|
getElementByID(map.element.id + '_Secondary_Element').appendChild(rectSVGObject);
|
|
@@ -549,17 +641,17 @@ var Zoom = /** @class */ (function () {
|
|
|
549
641
|
if (maps.isTileMap && (currentEle.id.indexOf('_line_Group') > -1)) {
|
|
550
642
|
currentEle.remove();
|
|
551
643
|
if (layerElement.children.length > 0 && layerElement.children[0]) {
|
|
552
|
-
layerElement.insertBefore(maps.navigationLineModule.renderNavigation(this_1.currentLayer, maps.tileZoomLevel, this_1.index), layerElement.children[1]);
|
|
644
|
+
layerElement.insertBefore(maps.navigationLineModule.renderNavigation(this_1.currentLayer, this_1.isPinchZooming ? this_1.pinchZoomScale : maps.tileZoomLevel, this_1.index), layerElement.children[1]);
|
|
553
645
|
}
|
|
554
646
|
else {
|
|
555
|
-
layerElement.appendChild(maps.navigationLineModule.renderNavigation(this_1.currentLayer, maps.tileZoomLevel, this_1.index));
|
|
647
|
+
layerElement.appendChild(maps.navigationLineModule.renderNavigation(this_1.currentLayer, this_1.isPinchZooming ? this_1.pinchZoomScale : maps.tileZoomLevel, this_1.index));
|
|
556
648
|
}
|
|
557
649
|
}
|
|
558
650
|
else if (maps.isTileMap && (currentEle.id.indexOf('_Polygons_Group') > -1)) {
|
|
559
651
|
if (this_1.currentLayer.polygonSettings.polygons.length > 0) {
|
|
560
652
|
this_1.currentLayer.polygonSettings.polygons.map(function (polygonSettings, polygonIndex) {
|
|
561
653
|
var markerData = polygonSettings.points;
|
|
562
|
-
var path = calculatePolygonPath(maps, maps.tileZoomLevel, _this.currentLayer, markerData);
|
|
654
|
+
var path = calculatePolygonPath(maps, _this.isPinchZooming ? _this.pinchZoomScale : maps.tileZoomLevel, _this.currentLayer, markerData);
|
|
563
655
|
var element = document.getElementById(maps.element.id + '_LayerIndex_' + _this.index + '_PolygonIndex_' + polygonIndex);
|
|
564
656
|
if (!isNullOrUndefined(element)) {
|
|
565
657
|
element.setAttribute('d', path);
|
|
@@ -789,7 +881,7 @@ var Zoom = /** @class */ (function () {
|
|
|
789
881
|
if (!eventArgs.cancel && markerSettings.visible && !isNullOrUndefined(long) && !isNullOrUndefined(lati)) {
|
|
790
882
|
var markerID = _this.maps.element.id + '_LayerIndex_' + layerIndex + '_MarkerIndex_'
|
|
791
883
|
+ markerIndex + '_dataIndex_' + dataIndex;
|
|
792
|
-
var location_1 = (_this.maps.isTileMap) ? convertTileLatLongToPoint(new MapLocation(long, lati), _this.maps.tileZoomLevel, _this.maps.tileTranslatePoint, true) : convertGeoToPoint(lati, long, factor, currentLayers, _this.maps);
|
|
884
|
+
var location_1 = (_this.maps.isTileMap) ? convertTileLatLongToPoint(new MapLocation(long, lati), _this.isPinchZooming ? _this.pinchZoomScale : _this.maps.tileZoomLevel, _this.maps.tileTranslatePoint, true) : convertGeoToPoint(lati, long, factor, currentLayers, _this.maps);
|
|
793
885
|
var transPoint = { x: x, y: y };
|
|
794
886
|
if (eventArgs.template && (!isNaN(location_1.x) && !isNaN(location_1.y))) {
|
|
795
887
|
markerTemplateCounts++;
|
|
@@ -1077,7 +1169,7 @@ var Zoom = /** @class */ (function () {
|
|
|
1077
1169
|
!isNullOrUndefined(marker.dataSource[dataIndex]['latitude']) ? parseFloat(marker.dataSource[dataIndex]['latitude']) :
|
|
1078
1170
|
!isNullOrUndefined(marker.dataSource[dataIndex]['Latitude']) ? parseFloat(marker.dataSource[dataIndex]['Latitude']) : 0;
|
|
1079
1171
|
var duration = this.currentLayer.animationDuration === 0 && animationMode === 'Enable' ? 1000 : this.currentLayer.animationDuration;
|
|
1080
|
-
var location_2 = (this.maps.isTileMap) ? convertTileLatLongToPoint(new Point(lng, lat), this.maps.tileZoomLevel, this.maps.tileTranslatePoint, true) : convertGeoToPoint(lat, lng, factor, layer, this.maps);
|
|
1172
|
+
var location_2 = (this.maps.isTileMap) ? convertTileLatLongToPoint(new Point(lng, lat), this.isPinchZooming ? this.pinchZoomScale : this.maps.tileZoomLevel, this.maps.tileTranslatePoint, true) : convertGeoToPoint(lat, lng, factor, layer, this.maps);
|
|
1081
1173
|
if (this.maps.isTileMap) {
|
|
1082
1174
|
if (type === 'Template') {
|
|
1083
1175
|
element.style.left = (location_2.x + marker.offset.x) + 'px';
|
|
@@ -2009,6 +2101,7 @@ var Zoom = /** @class */ (function () {
|
|
|
2009
2101
|
var pageY;
|
|
2010
2102
|
var target;
|
|
2011
2103
|
var touches = null;
|
|
2104
|
+
this.isPinchZooming = false;
|
|
2012
2105
|
//eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2013
2106
|
var element = e.target;
|
|
2014
2107
|
if (e.type === 'touchstart') {
|
|
@@ -2043,6 +2136,16 @@ var Zoom = /** @class */ (function () {
|
|
|
2043
2136
|
this.pinchFactor = this.maps.scale;
|
|
2044
2137
|
this.fingers = touches.length;
|
|
2045
2138
|
}
|
|
2139
|
+
if (this.maps.isTileMap && this.isTouch && e['touches'].length > 1) {
|
|
2140
|
+
var startTouch = this.getMousePosition(e['touches'][0].pageX, e['touches'][0].pageY);
|
|
2141
|
+
var endTouch = this.getMousePosition(e['touches'][1].pageX, e['touches'][1].pageY);
|
|
2142
|
+
this.startDistance = Math.sqrt(Math.pow((startTouch.x - endTouch.x), 2) + Math.pow((startTouch.y - endTouch.y), 2));
|
|
2143
|
+
this.touchCenter = { x: (startTouch.x + endTouch.x) / 2, y: (startTouch.y + endTouch.y) / 2 };
|
|
2144
|
+
this.pinchStartLatLong = this.maps.pointToLatLong((startTouch.x + endTouch.x) / 2, (startTouch.y + endTouch.y) / 2);
|
|
2145
|
+
this.isCancellation = false;
|
|
2146
|
+
this.pinchTileZoomScale = this.maps.tileZoomLevel;
|
|
2147
|
+
this.pinchDistance = null;
|
|
2148
|
+
}
|
|
2046
2149
|
this.isSingleClick = true;
|
|
2047
2150
|
};
|
|
2048
2151
|
/**
|
|
@@ -2080,7 +2183,7 @@ var Zoom = /** @class */ (function () {
|
|
|
2080
2183
|
}
|
|
2081
2184
|
}
|
|
2082
2185
|
if (this.isTouch) {
|
|
2083
|
-
if (this.maps.zoomSettings.pinchZooming && touches !== null) {
|
|
2186
|
+
if (this.maps.zoomSettings.enable && this.maps.zoomSettings.pinchZooming && touches !== null) {
|
|
2084
2187
|
if (this.firstMove && touches.length === 2) {
|
|
2085
2188
|
this.rectZoomingStart = false;
|
|
2086
2189
|
this.updateInteraction();
|
|
@@ -2088,7 +2191,9 @@ var Zoom = /** @class */ (function () {
|
|
|
2088
2191
|
}
|
|
2089
2192
|
else if (touches.length === 2 && this.touchStartList.length === 2) {
|
|
2090
2193
|
this.touchMoveList = targetTouches(e);
|
|
2091
|
-
e.
|
|
2194
|
+
if (e.cancelable) {
|
|
2195
|
+
e.preventDefault();
|
|
2196
|
+
}
|
|
2092
2197
|
this.rectZoomingStart = false;
|
|
2093
2198
|
this.performPinchZooming(e);
|
|
2094
2199
|
}
|
|
@@ -2096,7 +2201,7 @@ var Zoom = /** @class */ (function () {
|
|
|
2096
2201
|
}
|
|
2097
2202
|
}
|
|
2098
2203
|
this.mouseMovePoints = this.getMousePosition(pageX, pageY);
|
|
2099
|
-
if (zoom.enable && this.isPanModeEnabled && this.maps.markerDragId.indexOf('_MarkerIndex_') === -1 && ((Browser.isDevice && touches.length >= 1) || !Browser.isDevice)) {
|
|
2204
|
+
if (!this.isPinchZooming && (zoom.enable && this.isPanModeEnabled && this.maps.markerDragId.indexOf('_MarkerIndex_') === -1 && ((Browser.isDevice && touches.length >= 1) || !Browser.isDevice))) {
|
|
2100
2205
|
e.preventDefault();
|
|
2101
2206
|
this.maps.element.style.cursor = 'pointer';
|
|
2102
2207
|
this.mouseMoveLatLong = { x: pageX, y: pageY };
|
|
@@ -2108,7 +2213,7 @@ var Zoom = /** @class */ (function () {
|
|
|
2108
2213
|
this.mouseDownLatLong['y'] = pageY;
|
|
2109
2214
|
}
|
|
2110
2215
|
}
|
|
2111
|
-
if (this.isTouch ? (touches !== null && touches.length === 1 && this.rectZoomingStart) : this.rectZoomingStart) {
|
|
2216
|
+
if (!this.isPinchZooming && (this.isTouch ? (touches !== null && touches.length === 1 && this.rectZoomingStart) : this.rectZoomingStart)) {
|
|
2112
2217
|
e.preventDefault();
|
|
2113
2218
|
var scale = this.maps.isTileMap ? Math.round(this.maps.tileZoomLevel) : Math.round(this.maps.mapScaleValue);
|
|
2114
2219
|
if (this.maps.zoomSettings.enableSelectionZooming && scale < this.maps.zoomSettings.maxZoom) {
|
|
@@ -2132,7 +2237,26 @@ var Zoom = /** @class */ (function () {
|
|
|
2132
2237
|
this.touchStartList = [];
|
|
2133
2238
|
this.touchMoveList = [];
|
|
2134
2239
|
this.lastScale = 1;
|
|
2240
|
+
this.isCancellation = false;
|
|
2135
2241
|
this.maps.element.style.cursor = 'auto';
|
|
2242
|
+
if (this.isPinchZooming && this.maps.isTileMap) {
|
|
2243
|
+
this.isPinchZooming = false;
|
|
2244
|
+
var tilesParent = document.getElementById(this.maps.element.id + '_tile_parent');
|
|
2245
|
+
var svgElement = document.getElementById(this.maps.element.id + '_Tile_SVG_Parent');
|
|
2246
|
+
tilesParent.style.transformOrigin = '';
|
|
2247
|
+
tilesParent.style.transform = '';
|
|
2248
|
+
svgElement.style.transformOrigin = '';
|
|
2249
|
+
svgElement.style.transform = '';
|
|
2250
|
+
this.maps.tileZoomLevel = this.maps.mapScaleValue = this.maps.zoomSettings.zoomFactor = this.pinchZoomScale;
|
|
2251
|
+
this.maps.scale = Math.pow(2, this.pinchZoomScale - 1);
|
|
2252
|
+
this.tileZoomLevel = Math.round(this.pinchZoomScale);
|
|
2253
|
+
this.getTileTranslate(this.tileZoomLevel);
|
|
2254
|
+
this.maps.mapLayerPanel.generateTiles(this.tileZoomLevel, this.maps.tileTranslatePoint);
|
|
2255
|
+
this.applyTransform(this.maps);
|
|
2256
|
+
if (document.getElementById(this.maps.element.id + '_animates_tiles')) {
|
|
2257
|
+
document.getElementById(this.maps.element.id + '_animates_tiles').remove();
|
|
2258
|
+
}
|
|
2259
|
+
}
|
|
2136
2260
|
if (this.isPanModeEnabled && this.maps.zoomSettings.enablePanning && !isNullOrUndefined(this.maps.previousPoint) &&
|
|
2137
2261
|
(!this.maps.isTileMap ? (this.maps.translatePoint.x !== this.maps.previousPoint.x && this.maps.translatePoint.y !== this.maps.previousPoint.y)
|
|
2138
2262
|
: this.isPanningInProgress)) {
|
|
@@ -2332,10 +2456,13 @@ var Zoom = /** @class */ (function () {
|
|
|
2332
2456
|
this.startTouches = [];
|
|
2333
2457
|
this.mouseDownLatLong = null;
|
|
2334
2458
|
this.mouseMoveLatLong = null;
|
|
2335
|
-
this.removeEventListener();
|
|
2336
2459
|
this.layerCollectionEle = null;
|
|
2337
2460
|
this.currentLayer = null;
|
|
2338
2461
|
this.pinchDistance = null;
|
|
2462
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2463
|
+
if (!this.maps.refreshing) {
|
|
2464
|
+
this.maps = null;
|
|
2465
|
+
}
|
|
2339
2466
|
};
|
|
2340
2467
|
return Zoom;
|
|
2341
2468
|
}());
|
package/src/maps/utils/helper.js
CHANGED
|
@@ -1356,7 +1356,6 @@ export function mergeSeparateCluster(sameMarkerData, maps) {
|
|
|
1356
1356
|
var markerIndex = sameMarkerData[0].markerIndex;
|
|
1357
1357
|
var dataIndex = sameMarkerData[0].dataIndex;
|
|
1358
1358
|
var markerId = maps.element.id + '_LayerIndex_' + layerIndex + '_MarkerIndex_' + markerIndex;
|
|
1359
|
-
var marker = maps.layers[layerIndex].markerSettings[markerIndex];
|
|
1360
1359
|
var clusterId = markerId + '_dataIndex_' + dataIndex + '_cluster_' + clusterIndex;
|
|
1361
1360
|
var clusterEle = maps.layers[layerIndex].markerClusterSettings.shape === 'Balloon' ? getElement(clusterId + '_Group') : getElement(clusterId);
|
|
1362
1361
|
var clusterEleLabel = getElement(clusterId + '_datalabel_' + clusterIndex);
|