@syncfusion/ej2-maps 23.2.4 → 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 +20 -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 +1059 -765
- package/dist/es6/ej2-maps.es2015.js.map +1 -1
- package/dist/es6/ej2-maps.es5.js +1084 -775
- 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/navigation-selected-line.js +16 -16
- 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 +81 -17
- 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
package/src/maps/model/base.js
CHANGED
|
@@ -527,6 +527,56 @@ var HighlightSettings = /** @class */ (function (_super) {
|
|
|
527
527
|
return HighlightSettings;
|
|
528
528
|
}(ChildProperty));
|
|
529
529
|
export { HighlightSettings };
|
|
530
|
+
/**
|
|
531
|
+
* Defines the properties for a single polygon shape to render over the Maps, such as coordinates, fill, border, and opacity.
|
|
532
|
+
*/
|
|
533
|
+
var PolygonSetting = /** @class */ (function (_super) {
|
|
534
|
+
__extends(PolygonSetting, _super);
|
|
535
|
+
function PolygonSetting() {
|
|
536
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
537
|
+
}
|
|
538
|
+
__decorate([
|
|
539
|
+
Property(1)
|
|
540
|
+
], PolygonSetting.prototype, "borderWidth", void 0);
|
|
541
|
+
__decorate([
|
|
542
|
+
Property(1)
|
|
543
|
+
], PolygonSetting.prototype, "borderOpacity", void 0);
|
|
544
|
+
__decorate([
|
|
545
|
+
Property(1)
|
|
546
|
+
], PolygonSetting.prototype, "opacity", void 0);
|
|
547
|
+
__decorate([
|
|
548
|
+
Property('#FF471A')
|
|
549
|
+
], PolygonSetting.prototype, "borderColor", void 0);
|
|
550
|
+
__decorate([
|
|
551
|
+
Property('#FF471A')
|
|
552
|
+
], PolygonSetting.prototype, "fill", void 0);
|
|
553
|
+
__decorate([
|
|
554
|
+
Property([])
|
|
555
|
+
], PolygonSetting.prototype, "points", void 0);
|
|
556
|
+
return PolygonSetting;
|
|
557
|
+
}(ChildProperty));
|
|
558
|
+
export { PolygonSetting };
|
|
559
|
+
/**
|
|
560
|
+
* Defines the properties of the polygon shapes that will be rendered on a map layer.
|
|
561
|
+
* The selection and highlight settings for polygon shapes can also be defined.
|
|
562
|
+
*/
|
|
563
|
+
var PolygonSettings = /** @class */ (function (_super) {
|
|
564
|
+
__extends(PolygonSettings, _super);
|
|
565
|
+
function PolygonSettings() {
|
|
566
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
567
|
+
}
|
|
568
|
+
__decorate([
|
|
569
|
+
Collection([], PolygonSetting)
|
|
570
|
+
], PolygonSettings.prototype, "polygons", void 0);
|
|
571
|
+
__decorate([
|
|
572
|
+
Complex({}, SelectionSettings)
|
|
573
|
+
], PolygonSettings.prototype, "selectionSettings", void 0);
|
|
574
|
+
__decorate([
|
|
575
|
+
Complex({}, HighlightSettings)
|
|
576
|
+
], PolygonSettings.prototype, "highlightSettings", void 0);
|
|
577
|
+
return PolygonSettings;
|
|
578
|
+
}(ChildProperty));
|
|
579
|
+
export { PolygonSettings };
|
|
530
580
|
/**
|
|
531
581
|
* Gets or sets the options to customize the navigation lines in maps which is used to connect different locations.
|
|
532
582
|
*/
|
|
@@ -1150,6 +1200,9 @@ var LayerSettings = /** @class */ (function (_super) {
|
|
|
1150
1200
|
__decorate([
|
|
1151
1201
|
Collection([], NavigationLineSettings)
|
|
1152
1202
|
], LayerSettings.prototype, "navigationLineSettings", void 0);
|
|
1203
|
+
__decorate([
|
|
1204
|
+
Complex({}, PolygonSettings)
|
|
1205
|
+
], LayerSettings.prototype, "polygonSettings", void 0);
|
|
1153
1206
|
__decorate([
|
|
1154
1207
|
Complex({}, TooltipSettings)
|
|
1155
1208
|
], LayerSettings.prototype, "tooltipSettings", void 0);
|
|
@@ -25,10 +25,31 @@ export interface IPrintEventArgs extends IMapsEventArgs {
|
|
|
25
25
|
*/
|
|
26
26
|
htmlContent: Element;
|
|
27
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* This class contains the minimum and maximum latitude and longitude coordinates of the map's visible area
|
|
30
|
+
*/
|
|
31
|
+
export interface IMinMaxLatitudeLongitude {
|
|
32
|
+
/**
|
|
33
|
+
* Gets the minimum latitude value from the visible map area.
|
|
34
|
+
*/
|
|
35
|
+
minLatitude: number;
|
|
36
|
+
/**
|
|
37
|
+
* Gets the maximum latitude value from the visible map area.
|
|
38
|
+
*/
|
|
39
|
+
maxLatitude: number;
|
|
40
|
+
/**
|
|
41
|
+
* Gets the minimum longitude value from the visible map area.
|
|
42
|
+
*/
|
|
43
|
+
minLongitude: number;
|
|
44
|
+
/**
|
|
45
|
+
* Gets the maximum longitude value from the visible map area.
|
|
46
|
+
*/
|
|
47
|
+
maxLongitude: number;
|
|
48
|
+
}
|
|
28
49
|
/**
|
|
29
50
|
* Specifies the event arguments for the loaded event in maps.
|
|
30
51
|
*/
|
|
31
|
-
export interface ILoadedEventArgs extends IMapsEventArgs {
|
|
52
|
+
export interface ILoadedEventArgs extends IMinMaxLatitudeLongitude, IMapsEventArgs {
|
|
32
53
|
/**
|
|
33
54
|
* Defines the current maps instance.
|
|
34
55
|
*
|
|
@@ -692,7 +713,7 @@ export interface IAnnotationRenderingEventArgs extends IMapsEventArgs {
|
|
|
692
713
|
/**
|
|
693
714
|
* Specifies the event arguments for the pan event in maps.
|
|
694
715
|
*/
|
|
695
|
-
export interface IMapPanEventArgs extends IMapsEventArgs {
|
|
716
|
+
export interface IMapPanEventArgs extends IMinMaxLatitudeLongitude, IMapsEventArgs {
|
|
696
717
|
/**
|
|
697
718
|
* Defines the current maps instance.
|
|
698
719
|
*
|
|
@@ -727,7 +748,7 @@ export interface IMapPanEventArgs extends IMapsEventArgs {
|
|
|
727
748
|
/**
|
|
728
749
|
* Specifies the event arguments for zoom event in maps.
|
|
729
750
|
*/
|
|
730
|
-
export interface IMapZoomEventArgs extends IMapsEventArgs {
|
|
751
|
+
export interface IMapZoomEventArgs extends IMinMaxLatitudeLongitude, IMapsEventArgs {
|
|
731
752
|
/**
|
|
732
753
|
* Defines the current maps instance.
|
|
733
754
|
*
|
|
@@ -56,6 +56,7 @@ var Highlight = /** @class */ (function () {
|
|
|
56
56
|
targetEle.getAttribute('class') !== 'MarkerselectionMapStyle' &&
|
|
57
57
|
targetEle.getAttribute('class') !== 'BubbleselectionMapStyle' &&
|
|
58
58
|
targetEle.getAttribute('class') !== 'navigationlineselectionMapStyle' &&
|
|
59
|
+
targetEle.getAttribute('class') !== 'PolygonselectionMapStyle' &&
|
|
59
60
|
targetEle.getAttribute('class') !== 'LineselectionMapStyle') {
|
|
60
61
|
layerIndex = parseInt(targetEle.id.split('_LayerIndex_')[1].split('_')[0], 10);
|
|
61
62
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -85,6 +86,11 @@ var Highlight = /** @class */ (function () {
|
|
|
85
86
|
data = this.maps.layers[layerIndex].markerSettings[marker].dataSource[dataIndex];
|
|
86
87
|
this.highlightSettings = this.maps.layers[layerIndex].markerSettings[marker].highlightSettings;
|
|
87
88
|
}
|
|
89
|
+
else if (targetEle.id.indexOf('_PolygonIndex_') > -1) {
|
|
90
|
+
dataIndex = parseInt(targetEle.id.split('_PolygonIndex_')[1].split('_')[0], 10);
|
|
91
|
+
data = this.maps.layers[layerIndex].polygonSettings.polygons[dataIndex].points;
|
|
92
|
+
this.highlightSettings = this.maps.layers[layerIndex].polygonSettings.highlightSettings;
|
|
93
|
+
}
|
|
88
94
|
else {
|
|
89
95
|
var index = parseInt(targetEle.id.split('_NavigationIndex_')[1].split('_')[0], 10);
|
|
90
96
|
layerIndex = parseInt(targetEle.id.split('_LayerIndex_')[1].split('_')[0], 10);
|
|
@@ -71,6 +71,12 @@ var Selection = /** @class */ (function () {
|
|
|
71
71
|
this.selectionsettings = this.maps.layers[layerIndex].markerSettings[markerIndex].selectionSettings;
|
|
72
72
|
this.selectionType = 'Marker';
|
|
73
73
|
}
|
|
74
|
+
else if (targetElement.id.indexOf('_PolygonIndex_') > -1) {
|
|
75
|
+
dataIndex = parseInt(targetElement.id.split('_PolygonIndex_')[1].split('_')[0], 10);
|
|
76
|
+
data = this.maps.layers[layerIndex].polygonSettings.polygons[dataIndex].points;
|
|
77
|
+
this.selectionsettings = this.maps.layers[layerIndex].polygonSettings.selectionSettings;
|
|
78
|
+
this.selectionType = 'Polygon';
|
|
79
|
+
}
|
|
74
80
|
else if (targetElement.id.indexOf('NavigationIndex') > -1) {
|
|
75
81
|
var index = parseInt(targetElement.id.split('_NavigationIndex_')[1].split('_')[0], 10);
|
|
76
82
|
shapeData = null;
|
|
@@ -249,6 +255,10 @@ var Selection = /** @class */ (function () {
|
|
|
249
255
|
_this.maps.navigationSelectionClass = getElement(_this.selectionType + 'selectionMap');
|
|
250
256
|
_this.maps.selectedNavigationElementId.push(targetElement.getAttribute('id'));
|
|
251
257
|
}
|
|
258
|
+
if (targetElement.getAttribute('class') === 'PolygonselectionMapStyle') {
|
|
259
|
+
_this.maps.polygonSelectionClass = getElement(_this.selectionType + 'selectionMap');
|
|
260
|
+
_this.maps.selectedPolygonElementId.push(targetElement.getAttribute('id'));
|
|
261
|
+
}
|
|
252
262
|
}
|
|
253
263
|
}
|
|
254
264
|
});
|
|
@@ -288,6 +298,9 @@ var Selection = /** @class */ (function () {
|
|
|
288
298
|
if (this.selectionType === 'navigationline') {
|
|
289
299
|
this.maps.selectedBubbleElementId.splice(this.maps.selectedBubbleElementId.indexOf(targetElement.getAttribute('id')), 1);
|
|
290
300
|
}
|
|
301
|
+
if (this.selectionType === 'Polygon') {
|
|
302
|
+
this.maps.selectedPolygonElementId.splice(this.maps.selectedPolygonElementId.indexOf(targetElement.getAttribute('id')), 1);
|
|
303
|
+
}
|
|
291
304
|
};
|
|
292
305
|
/**
|
|
293
306
|
* Get module name.
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { tooltipRender } from '../index';
|
|
2
2
|
import { Tooltip } from '@syncfusion/ej2-svg-base';
|
|
3
|
-
import { createElement, Browser, isNullOrUndefined, extend, remove
|
|
3
|
+
import { createElement, Browser, isNullOrUndefined, extend, remove } from '@syncfusion/ej2-base';
|
|
4
4
|
import { getMousePosition, Internalize, checkPropertyPath, getValueFromObject, formatValue, convertStringToValue } from '../utils/helper';
|
|
5
|
-
import { click } from '../model/constants';
|
|
6
5
|
/**
|
|
7
6
|
* Map Tooltip
|
|
8
7
|
*/
|
|
@@ -22,7 +21,6 @@ var MapsTooltip = /** @class */ (function () {
|
|
|
22
21
|
var target;
|
|
23
22
|
var touchArg;
|
|
24
23
|
var tooltipArgs;
|
|
25
|
-
var tooltipTemplateElement;
|
|
26
24
|
if (e.type.indexOf('touch') !== -1) {
|
|
27
25
|
this.isTouch = true;
|
|
28
26
|
touchArg = e;
|
|
@@ -173,7 +171,12 @@ var MapsTooltip = /** @class */ (function () {
|
|
|
173
171
|
id: this.maps.element.id + '_mapsTooltip',
|
|
174
172
|
className: 'EJ2-maps-Tooltip'
|
|
175
173
|
});
|
|
176
|
-
|
|
174
|
+
if (isNullOrUndefined(option.template) || option.template === '' || this.maps.tooltipDisplayMode === 'MouseMove') {
|
|
175
|
+
tooltipEle.style.cssText = 'position: absolute;pointer-events:none;';
|
|
176
|
+
}
|
|
177
|
+
else {
|
|
178
|
+
tooltipEle.style.position = 'absolute';
|
|
179
|
+
}
|
|
177
180
|
document.getElementById(this.maps.element.id + '_Secondary_Element').appendChild(tooltipEle);
|
|
178
181
|
}
|
|
179
182
|
if (typeof option.template !== 'function' && option.template !== null && Object.keys(typeof option.template === 'object' ? option.template : {}).length === 1) {
|
|
@@ -217,8 +220,8 @@ var MapsTooltip = /** @class */ (function () {
|
|
|
217
220
|
header: '',
|
|
218
221
|
data: option['data'],
|
|
219
222
|
template: option['template'],
|
|
220
|
-
content: tooltipArgs.content.toString() !== currentData.toString() ? [
|
|
221
|
-
[
|
|
223
|
+
content: tooltipArgs.content.toString() !== currentData.toString() ? [tooltipArgs.content.toString()] :
|
|
224
|
+
[currentData.toString()],
|
|
222
225
|
shapes: [],
|
|
223
226
|
location: option['location'],
|
|
224
227
|
palette: [markerFill],
|
|
@@ -235,8 +238,8 @@ var MapsTooltip = /** @class */ (function () {
|
|
|
235
238
|
header: '',
|
|
236
239
|
data: tooltipArgs.options['data'],
|
|
237
240
|
template: tooltipArgs.options['template'],
|
|
238
|
-
content: tooltipArgs.content.toString() !== currentData.toString() ? [
|
|
239
|
-
[
|
|
241
|
+
content: tooltipArgs.content.toString() !== currentData.toString() ? [tooltipArgs.content.toString()] :
|
|
242
|
+
[currentData.toString()],
|
|
240
243
|
shapes: [],
|
|
241
244
|
location: tooltipArgs.options['location'],
|
|
242
245
|
palette: [markerFill],
|
|
@@ -255,13 +258,6 @@ var MapsTooltip = /** @class */ (function () {
|
|
|
255
258
|
_this.svgTooltip.appendTo(tooltipEle);
|
|
256
259
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
257
260
|
_this.maps.renderReactTemplates();
|
|
258
|
-
tooltipTemplateElement = document.getElementById(_this.maps.element.id + '_mapsTooltip');
|
|
259
|
-
if (tooltipTemplateElement !== null && tooltipTemplateElement.innerHTML.indexOf('href') !== -1
|
|
260
|
-
&& tooltipTemplateElement.innerHTML.indexOf('</a>') !== -1) {
|
|
261
|
-
var templateStyle = tooltipTemplateElement.getAttribute('style');
|
|
262
|
-
templateStyle = templateStyle.replace('pointer-events: none;', 'position-events:all;');
|
|
263
|
-
tooltipTemplateElement.style.cssText = templateStyle;
|
|
264
|
-
}
|
|
265
261
|
}
|
|
266
262
|
else {
|
|
267
263
|
_this.clearTooltip(e.target);
|
|
@@ -283,12 +279,8 @@ var MapsTooltip = /** @class */ (function () {
|
|
|
283
279
|
}
|
|
284
280
|
}
|
|
285
281
|
else {
|
|
286
|
-
|
|
287
|
-
if (
|
|
288
|
-
&& tooltipTemplateElement.innerHTML.indexOf('</a>') !== -1) {
|
|
289
|
-
this.maps.notify(click, this);
|
|
290
|
-
}
|
|
291
|
-
else {
|
|
282
|
+
var tooltipElement = e.target.closest('#' + this.maps.element.id + '_mapsTooltipparent_template');
|
|
283
|
+
if (isNullOrUndefined(tooltipElement)) {
|
|
292
284
|
this.clearTooltip(e.target);
|
|
293
285
|
}
|
|
294
286
|
}
|
|
@@ -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
|
*
|