@syncfusion/ej2-maps 19.3.46 → 19.4.47
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/.github/PULL_REQUEST_TEMPLATE/Bug.md +72 -0
- package/.github/PULL_REQUEST_TEMPLATE/Feature.md +49 -0
- package/CHANGELOG.md +34 -1
- package/README.md +1 -1
- 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 +478 -257
- package/dist/es6/ej2-maps.es2015.js.map +1 -1
- package/dist/es6/ej2-maps.es5.js +474 -253
- 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 +12 -12
- package/src/maps/layers/bubble.d.ts +6 -0
- package/src/maps/layers/bubble.js +7 -1
- package/src/maps/layers/data-label.js +1 -0
- package/src/maps/layers/layer-panel.d.ts +2 -1
- package/src/maps/layers/layer-panel.js +86 -50
- package/src/maps/layers/legend.js +47 -18
- package/src/maps/layers/marker.js +2 -8
- package/src/maps/maps-model.d.ts +1 -1
- package/src/maps/maps.d.ts +5 -0
- package/src/maps/maps.js +42 -16
- package/src/maps/model/base-model.d.ts +7 -0
- package/src/maps/model/base.d.ts +6 -0
- package/src/maps/model/base.js +5 -2
- package/src/maps/model/interface.d.ts +1 -3
- package/src/maps/model/theme.js +62 -5
- package/src/maps/user-interaction/highlight.js +4 -4
- package/src/maps/user-interaction/selection.js +10 -9
- package/src/maps/user-interaction/tooltip.js +9 -3
- package/src/maps/user-interaction/zoom.d.ts +1 -0
- package/src/maps/user-interaction/zoom.js +76 -44
- package/src/maps/utils/enum.d.ts +3 -1
- package/src/maps/utils/helper.d.ts +4 -2
- package/src/maps/utils/helper.js +130 -98
|
@@ -107,8 +107,10 @@ var Zoom = /** @class */ (function () {
|
|
|
107
107
|
if (document.getElementById(this.maps.element.id + '_LayerIndex_1')) {
|
|
108
108
|
document.getElementById(this.maps.element.id + '_LayerIndex_1').style.display = 'none';
|
|
109
109
|
}
|
|
110
|
+
this.markerLineAnimation(map);
|
|
110
111
|
map.mapLayerPanel.generateTiles(newZoomFactor, map.tileTranslatePoint, type + 'wheel', null, position);
|
|
111
112
|
var element1 = document.getElementById(this.maps.element.id + '_tiles');
|
|
113
|
+
var animationDuration = this.maps.layersCollection[0].animationDuration;
|
|
112
114
|
setTimeout(function () {
|
|
113
115
|
// if (type === 'ZoomOut') {
|
|
114
116
|
// element1.removeChild(element1.children[element1.childElementCount - 1]);
|
|
@@ -122,7 +124,7 @@ var Zoom = /** @class */ (function () {
|
|
|
122
124
|
if (document.getElementById(_this.maps.element.id + '_LayerIndex_1')) {
|
|
123
125
|
document.getElementById(_this.maps.element.id + '_LayerIndex_1').style.display = 'block';
|
|
124
126
|
}
|
|
125
|
-
},
|
|
127
|
+
}, animationDuration);
|
|
126
128
|
}
|
|
127
129
|
this.maps.zoomNotApplied = false;
|
|
128
130
|
};
|
|
@@ -297,11 +299,13 @@ var Zoom = /** @class */ (function () {
|
|
|
297
299
|
*/
|
|
298
300
|
Zoom.prototype.animateTransform = function (element, animate, x, y, scale) {
|
|
299
301
|
var duration = this.currentLayer.animationDuration;
|
|
300
|
-
if (!animate || duration === 0) {
|
|
302
|
+
if (!animate || duration === 0 || this.maps.isTileMap) {
|
|
301
303
|
element.setAttribute('transform', 'scale(' + (scale) + ') translate( ' + x + ' ' + y + ' )');
|
|
302
304
|
return;
|
|
303
305
|
}
|
|
304
|
-
|
|
306
|
+
if (!this.maps.isTileMap) {
|
|
307
|
+
zoomAnimate(element, 0, duration, new MapLocation(x, y), scale, this.maps.mapAreaRect, this.maps);
|
|
308
|
+
}
|
|
305
309
|
};
|
|
306
310
|
Zoom.prototype.applyTransform = function (animate) {
|
|
307
311
|
var layerIndex;
|
|
@@ -353,12 +357,14 @@ var Zoom = /** @class */ (function () {
|
|
|
353
357
|
this.markerTranslates(currentEle.childNodes[0], factor, x, y, scale, 'Marker', layerElement, animate);
|
|
354
358
|
}
|
|
355
359
|
currentEle = layerElement.childNodes[j];
|
|
360
|
+
var markerAnimation = void 0;
|
|
356
361
|
if (!isNullOrUndefined(currentEle) && currentEle.id.indexOf('Markers') !== -1) {
|
|
357
362
|
for (var k = 0; k < currentEle.childElementCount; k++) {
|
|
358
363
|
this.markerTranslate(currentEle.childNodes[k], factor, x, y, scale, 'Marker', animate);
|
|
359
364
|
var layerIndex_1 = parseInt(currentEle.childNodes[k]['id'].split('_LayerIndex_')[1].split('_')[0], 10);
|
|
360
365
|
var dataIndex = parseInt(currentEle.childNodes[k]['id'].split('_dataIndex_')[1].split('_')[0], 10);
|
|
361
366
|
var markerIndex = parseInt(currentEle.childNodes[k]['id'].split('_MarkerIndex_')[1].split('_')[0], 10);
|
|
367
|
+
markerAnimation = this.currentLayer.markerSettings[markerIndex].animationDuration > 0;
|
|
362
368
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
363
369
|
var markerSelectionValues = this.currentLayer.markerSettings[markerIndex].dataSource[dataIndex];
|
|
364
370
|
for (var x_1 = 0; x_1 < this.currentLayer.markerSettings[markerIndex].initialMarkerSelection.length; x_1++) {
|
|
@@ -369,9 +375,17 @@ var Zoom = /** @class */ (function () {
|
|
|
369
375
|
this.maps.markerSelection(this.currentLayer.markerSettings[markerIndex].selectionSettings, this.maps, currentEle.children[k], this.currentLayer.markerSettings[markerIndex].dataSource[dataIndex]);
|
|
370
376
|
}
|
|
371
377
|
}
|
|
372
|
-
if (
|
|
373
|
-
|
|
374
|
-
|
|
378
|
+
if ((this.currentLayer.animationDuration > 0 || (this.maps.layersCollection[0].animationDuration > 0 && this.currentLayer.type === 'SubLayer')) && !this.isPanning) {
|
|
379
|
+
if (this.maps.isTileMap) {
|
|
380
|
+
var groupElement = document.querySelector('.GroupElement');
|
|
381
|
+
if (groupElement && !(document.querySelector('.ClusterGroupElement')) && markerAnimation) {
|
|
382
|
+
groupElement.style.display = 'none';
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
else {
|
|
386
|
+
markerStyle = 'visibility:hidden';
|
|
387
|
+
currentEle.setAttribute('style', markerStyle);
|
|
388
|
+
}
|
|
375
389
|
}
|
|
376
390
|
}
|
|
377
391
|
if (this.isPanning && this.maps.markerModule.sameMarkerData.length > 0) {
|
|
@@ -470,7 +484,7 @@ var Zoom = /** @class */ (function () {
|
|
|
470
484
|
this.maps.arrangeTemplate();
|
|
471
485
|
}
|
|
472
486
|
if (!isNullOrUndefined(this.currentLayer)) {
|
|
473
|
-
if (!animate || this.currentLayer.animationDuration === 0) {
|
|
487
|
+
if (!animate || this.currentLayer.animationDuration === 0 || this.maps.isTileMap) {
|
|
474
488
|
this.processTemplate(x, y, scale, this.maps);
|
|
475
489
|
}
|
|
476
490
|
}
|
|
@@ -589,7 +603,6 @@ var Zoom = /** @class */ (function () {
|
|
|
589
603
|
*/
|
|
590
604
|
Zoom.prototype.processTemplate = function (x, y, scale, maps) {
|
|
591
605
|
for (var i = 0; i < this.templateCount; i++) {
|
|
592
|
-
this.currentLayer = maps.layersCollection[i];
|
|
593
606
|
var factor = maps.mapLayerPanel.calculateFactor(this.currentLayer);
|
|
594
607
|
var markerTemplateElement = getElementByID(maps.element.id + '_LayerIndex_' +
|
|
595
608
|
i + '_Markers_Template_Group');
|
|
@@ -820,6 +833,20 @@ var Zoom = /** @class */ (function () {
|
|
|
820
833
|
}
|
|
821
834
|
}
|
|
822
835
|
};
|
|
836
|
+
Zoom.prototype.markerLineAnimation = function (map) {
|
|
837
|
+
if (map.isTileMap) {
|
|
838
|
+
for (var i = 0; i < map.layersCollection.length; i++) {
|
|
839
|
+
var markerTemplateElement = getElementByID(this.maps.element.id + '_LayerIndex_' + i + '_Markers_Template_Group');
|
|
840
|
+
var lineElement = getElementByID(this.maps.element.id + '_LayerIndex_' + i + '_line_Group');
|
|
841
|
+
if (!isNullOrUndefined(markerTemplateElement)) {
|
|
842
|
+
markerTemplateElement.style.visibility = 'hidden';
|
|
843
|
+
}
|
|
844
|
+
if (!isNullOrUndefined(lineElement)) {
|
|
845
|
+
lineElement.style.visibility = 'hidden';
|
|
846
|
+
}
|
|
847
|
+
}
|
|
848
|
+
}
|
|
849
|
+
};
|
|
823
850
|
Zoom.prototype.panning = function (direction, xDifference, yDifference, mouseLocation) {
|
|
824
851
|
var map = this.maps;
|
|
825
852
|
var panArgs;
|
|
@@ -953,45 +980,49 @@ var Zoom = /** @class */ (function () {
|
|
|
953
980
|
var tileZoomFactor = prevLevel < minZoom && !map.isReset ? minZoom : zoomFactor;
|
|
954
981
|
map.scale = Math.pow(2, tileZoomFactor - 1);
|
|
955
982
|
map.tileZoomLevel = tileZoomFactor;
|
|
956
|
-
map.
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
map.
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
this.triggerZoomEvent(prevTilePoint, prevLevel, type);
|
|
967
|
-
map.translatePoint.y = (map.tileTranslatePoint.y - (0.01 * map.mapScaleValue)) / map.scale;
|
|
968
|
-
map.translatePoint.x = (map.tileTranslatePoint.x - (0.01 * map.mapScaleValue)) / map.scale;
|
|
969
|
-
if (document.getElementById(this.maps.element.id + '_LayerIndex_1')) {
|
|
970
|
-
document.getElementById(this.maps.element.id + '_LayerIndex_1').style.display = 'none';
|
|
971
|
-
}
|
|
972
|
-
if (document.querySelector('.GroupElement')) {
|
|
973
|
-
document.querySelector('.GroupElement').style.display = 'none';
|
|
974
|
-
}
|
|
975
|
-
map.mapLayerPanel.generateTiles(tileZoomFactor, map.tileTranslatePoint, type);
|
|
976
|
-
var element1 = document.getElementById(this.maps.element.id + '_tiles');
|
|
977
|
-
setTimeout(function () {
|
|
978
|
-
if (type === 'ZoomOut' || type === 'Reset') {
|
|
979
|
-
// element1.removeChild(element1.children[element1.childElementCount - 1]);
|
|
980
|
-
// element1.childElementCount ? element1.removeChild(element1.children[element1.childElementCount - 1]) : element1;
|
|
983
|
+
if (map.previousScale !== map.scale || map.isReset) {
|
|
984
|
+
map.zoomSettings.zoomFactor = zoomFactor;
|
|
985
|
+
var position = { x: map.availableSize.width / 2, y: map.availableSize.height / 2 };
|
|
986
|
+
this.getTileTranslatePosition(prevLevel, tileZoomFactor, position, type);
|
|
987
|
+
if (map.zoomSettings.resetToInitial && map.applyZoomReset && type === 'Reset' || (type === 'ZoomOut' && map.zoomSettings.resetToInitial && map.applyZoomReset && tileZoomFactor <= map.initialZoomLevel)) {
|
|
988
|
+
map.initialCheck = true;
|
|
989
|
+
map.zoomPersistence = false;
|
|
990
|
+
map.tileTranslatePoint.x = map.initialTileTranslate.x;
|
|
991
|
+
map.tileTranslatePoint.y = map.initialTileTranslate.y;
|
|
992
|
+
tileZoomFactor = map.tileZoomLevel = map.mapScaleValue = map.initialZoomLevel;
|
|
981
993
|
}
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
994
|
+
this.triggerZoomEvent(prevTilePoint, prevLevel, type);
|
|
995
|
+
map.translatePoint.y = (map.tileTranslatePoint.y - (0.01 * map.mapScaleValue)) / map.scale;
|
|
996
|
+
map.translatePoint.x = (map.tileTranslatePoint.x - (0.01 * map.mapScaleValue)) / map.scale;
|
|
997
|
+
if (document.getElementById(this.maps.element.id + '_LayerIndex_1')) {
|
|
998
|
+
document.getElementById(this.maps.element.id + '_LayerIndex_1').style.display = 'none';
|
|
985
999
|
}
|
|
986
|
-
|
|
1000
|
+
if (document.querySelector('.GroupElement')) {
|
|
1001
|
+
document.querySelector('.GroupElement').style.display = 'none';
|
|
1002
|
+
}
|
|
1003
|
+
this.markerLineAnimation(map);
|
|
1004
|
+
map.mapLayerPanel.generateTiles(tileZoomFactor, map.tileTranslatePoint, type);
|
|
1005
|
+
var element1 = document.getElementById(this.maps.element.id + '_tiles');
|
|
1006
|
+
var animationDuration = this.maps.layersCollection[0].animationDuration;
|
|
1007
|
+
setTimeout(function () {
|
|
1008
|
+
if (type === 'ZoomOut' || type === 'Reset') {
|
|
1009
|
+
// element1.removeChild(element1.children[element1.childElementCount - 1]);
|
|
1010
|
+
// element1.childElementCount ? element1.removeChild(element1.children[element1.childElementCount - 1]) : element1;
|
|
1011
|
+
}
|
|
1012
|
+
_this.applyTransform(true);
|
|
1013
|
+
if (document.getElementById(_this.maps.element.id + '_LayerIndex_1')) {
|
|
1014
|
+
document.getElementById(_this.maps.element.id + '_LayerIndex_1').style.display = 'block';
|
|
1015
|
+
}
|
|
1016
|
+
}, animationDuration);
|
|
1017
|
+
}
|
|
1018
|
+
this.maps.zoomNotApplied = false;
|
|
987
1019
|
}
|
|
988
|
-
this.maps.zoomNotApplied = false;
|
|
989
1020
|
};
|
|
990
1021
|
Zoom.prototype.createZoomingToolbars = function () {
|
|
991
1022
|
var map = this.maps;
|
|
992
1023
|
this.toolBarGroup = map.renderer.createGroup({
|
|
993
1024
|
id: map.element.id + '_Zooming_KitCollection',
|
|
994
|
-
opacity: 0.3
|
|
1025
|
+
opacity: map.theme.toLowerCase() === 'fluentuidark' ? 0.6 : 0.3
|
|
995
1026
|
});
|
|
996
1027
|
var kitHeight = 16;
|
|
997
1028
|
var kitWidth = 16;
|
|
@@ -1254,8 +1285,9 @@ var Zoom = /** @class */ (function () {
|
|
|
1254
1285
|
x = (size.width - toolBarSize.width) - padding;
|
|
1255
1286
|
break;
|
|
1256
1287
|
}
|
|
1257
|
-
|
|
1258
|
-
element.style.
|
|
1288
|
+
var extraPosition = map.getExtraPosition();
|
|
1289
|
+
element.style.left = x + extraPosition.x + 'px';
|
|
1290
|
+
element.style.top = y + extraPosition.y + 'px';
|
|
1259
1291
|
var color = this.maps.zoomSettings.highlightColor || this.maps.themeStyle.zoomSelectionColor;
|
|
1260
1292
|
var css = ' .e-maps-toolbar:hover > circle { stroke:' + color + '; } .e-maps-toolbar:hover > path { fill: ' + color + ' ; stroke: ' + color + '; }' +
|
|
1261
1293
|
'.e-maps-toolbar:hover { cursor: pointer; } .e-maps-cursor-disable:hover { cursor: not-allowed; } .e-maps-panning:hover { cursor: pointer; } ' +
|
|
@@ -1400,14 +1432,14 @@ var Zoom = /** @class */ (function () {
|
|
|
1400
1432
|
if (document.getElementById(map.element.id + '_Zooming_ToolBar_Pan_Group')) {
|
|
1401
1433
|
if (!this.maps.zoomSettings.enablePanning) {
|
|
1402
1434
|
if (target.id.indexOf('_Zooming_ToolBar') > -1 || target.id.indexOf('_Zooming_Rect') > -1) {
|
|
1403
|
-
getElementByID(map.element.id + '_Zooming_ToolBar_Pan_Rect').setAttribute('opacity', '0.3');
|
|
1404
|
-
getElementByID(map.element.id + '_Zooming_ToolBar_Pan').setAttribute('opacity', '0.3');
|
|
1435
|
+
getElementByID(map.element.id + '_Zooming_ToolBar_Pan_Rect').setAttribute('opacity', map.theme.toLowerCase() === 'fluentuidark' ? '0.6' : '0.3');
|
|
1436
|
+
getElementByID(map.element.id + '_Zooming_ToolBar_Pan').setAttribute('opacity', map.theme.toLowerCase() === 'fluentuidark' ? '0.6' : '0.3');
|
|
1405
1437
|
}
|
|
1406
1438
|
}
|
|
1407
1439
|
}
|
|
1408
1440
|
}
|
|
1409
1441
|
else {
|
|
1410
|
-
getElementByID(map.element.id + '_Zooming_KitCollection').setAttribute('opacity', '0.3');
|
|
1442
|
+
getElementByID(map.element.id + '_Zooming_KitCollection').setAttribute('opacity', map.theme.toLowerCase() === 'fluentuidark' ? '0.6' : '0.3');
|
|
1411
1443
|
if (!this.maps.zoomSettings.enablePanning && document.getElementById(map.element.id + '_Zooming_ToolBar_Pan_Group')) {
|
|
1412
1444
|
getElementByID(map.element.id + '_Zooming_ToolBar_Pan_Rect').setAttribute('opacity', '1');
|
|
1413
1445
|
getElementByID(map.element.id + '_Zooming_ToolBar_Pan').setAttribute('opacity', '1');
|
package/src/maps/utils/enum.d.ts
CHANGED
|
@@ -245,7 +245,9 @@ export declare type LegendShape =
|
|
|
245
245
|
/** Specifies the legend shape as a pentagon. */
|
|
246
246
|
'Pentagon' |
|
|
247
247
|
/** Specifies the legend shape as a inverted triangle. */
|
|
248
|
-
'InvertedTriangle'
|
|
248
|
+
'InvertedTriangle' |
|
|
249
|
+
/** Specifies to render the marker shape as balloon on maps. */
|
|
250
|
+
'Balloon';
|
|
249
251
|
/**
|
|
250
252
|
* Defines the legend arrangement in the maps component.
|
|
251
253
|
*/
|
|
@@ -31,7 +31,7 @@ export declare function stringToNumber(value: string, containerSize: number): nu
|
|
|
31
31
|
* @param {Maps} maps Specifies the maps instance
|
|
32
32
|
* @returns {void}
|
|
33
33
|
*/
|
|
34
|
-
export declare function calculateSize(maps: Maps):
|
|
34
|
+
export declare function calculateSize(maps: Maps): Size;
|
|
35
35
|
/**
|
|
36
36
|
* Method to create svg for maps.
|
|
37
37
|
*
|
|
@@ -481,6 +481,7 @@ export declare function marker(eventArgs: IMarkerRenderingEventArgs, markerSetti
|
|
|
481
481
|
* @param {number} markerIndex - Specifies the marker index
|
|
482
482
|
* @param {HTMLElement} markerTemplate - Specifies the marker template element
|
|
483
483
|
* @param {Point} location - Specifies the location
|
|
484
|
+
* @param {Point} transPoint - Specifies the translate point.
|
|
484
485
|
* @param {number} scale - Specifies the scale value
|
|
485
486
|
* @param {Point} offset - Specifies the offset value
|
|
486
487
|
* @param {Maps} maps - Specifies the instance of the maps
|
|
@@ -677,7 +678,7 @@ export declare function drawStar(maps: Maps, options: PathOption, size: Size, lo
|
|
|
677
678
|
* @returns {Element} - Returns the element
|
|
678
679
|
* @private
|
|
679
680
|
*/
|
|
680
|
-
export declare function drawBalloon(maps: Maps, options: PathOption, size: Size, location: MapLocation, element?: Element): Element;
|
|
681
|
+
export declare function drawBalloon(maps: Maps, options: PathOption, size: Size, location: MapLocation, type: string, element?: Element): Element;
|
|
681
682
|
/**
|
|
682
683
|
* Internal rendering of Pattern
|
|
683
684
|
*
|
|
@@ -740,6 +741,7 @@ export declare function getRatioOfBubble(min: number, max: number, value: number
|
|
|
740
741
|
*
|
|
741
742
|
* @param {MapLocation[]} points - Specifies the points
|
|
742
743
|
* @param {string} type - Specifies the type
|
|
744
|
+
* @param {string} geometryType - Specified the type of the geometry
|
|
743
745
|
* @returns {any} - Specifies the object
|
|
744
746
|
*/
|
|
745
747
|
export declare function findMidPointOfPolygon(points: MapLocation[], type: string, geometryType?: string): any;
|