@syncfusion/ej2-maps 19.3.44 → 19.4.42
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 +1 -1
- package/.github/PULL_REQUEST_TEMPLATE/Bug.md +72 -0
- package/.github/PULL_REQUEST_TEMPLATE/Feature.md +49 -0
- package/CHANGELOG.md +36 -5
- package/README.md +4 -4
- 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 +655 -647
- package/dist/es6/ej2-maps.es2015.js.map +1 -1
- package/dist/es6/ej2-maps.es5.js +652 -645
- 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 +10 -25
- package/src/maps/layers/data-label.js +6 -17
- package/src/maps/layers/layer-panel.d.ts +2 -1
- package/src/maps/layers/layer-panel.js +86 -72
- package/src/maps/layers/legend.js +48 -19
- package/src/maps/layers/marker.js +2 -24
- package/src/maps/maps-model.d.ts +1 -28
- package/src/maps/maps.d.ts +5 -38
- package/src/maps/maps.js +80 -102
- package/src/maps/model/base-model.d.ts +7 -5
- package/src/maps/model/base.d.ts +6 -5
- package/src/maps/model/base.js +5 -2
- package/src/maps/model/export-pdf.js +1 -1
- package/src/maps/model/interface.d.ts +1 -3
- package/src/maps/model/theme.js +116 -6
- package/src/maps/user-interaction/annotation.js +3 -7
- package/src/maps/user-interaction/highlight.js +4 -17
- package/src/maps/user-interaction/selection.js +10 -22
- package/src/maps/user-interaction/tooltip.js +61 -125
- package/src/maps/user-interaction/zoom.d.ts +1 -0
- package/src/maps/user-interaction/zoom.js +92 -110
- package/src/maps/utils/enum.d.ts +8 -2
- package/src/maps/utils/helper.d.ts +5 -3
- package/src/maps/utils/helper.js +136 -104
package/dist/global/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: index.d.ts
|
|
3
|
-
* version : 19.
|
|
3
|
+
* version : 19.4.42
|
|
4
4
|
* Copyright Syncfusion Inc. 2001 - 2020. All rights reserved.
|
|
5
5
|
* Use of this code is subject to the terms of our license.
|
|
6
6
|
* A copy of the current license can be obtained at any time by e-mailing
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_from": "@syncfusion/ej2-maps@*",
|
|
3
|
-
"_id": "@syncfusion/ej2-maps@19.
|
|
3
|
+
"_id": "@syncfusion/ej2-maps@19.4.38",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512-
|
|
5
|
+
"_integrity": "sha512-xf9oJZL2/pVspVWQuwHj5TV/3bOONNCrZSWd3Ch8Ytc0STAtZyk14/h7cSjLe6dpL4Zp2JSmHIIxPhS1/q67Wg==",
|
|
6
6
|
"_location": "/@syncfusion/ej2-maps",
|
|
7
7
|
"_phantomChildren": {},
|
|
8
8
|
"_requested": {
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
"/@syncfusion/ej2-react-maps",
|
|
24
24
|
"/@syncfusion/ej2-vue-maps"
|
|
25
25
|
],
|
|
26
|
-
"_resolved": "http://nexus.syncfusion.com/repository/ej2-hotfix/@syncfusion/ej2-maps/-/ej2-maps-19.
|
|
27
|
-
"_shasum": "
|
|
26
|
+
"_resolved": "http://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-maps/-/ej2-maps-19.4.38.tgz",
|
|
27
|
+
"_shasum": "fc11eb553b86eba1ab721c27f20887f715121469",
|
|
28
28
|
"_spec": "@syncfusion/ej2-maps@*",
|
|
29
29
|
"_where": "/jenkins/workspace/automation_release_19.1.0.1-ZPMUBNQ6AUYH6YGEFBPVYMEQLRRW2SLD4XCZ6GATNZJFYJ3RIAOA/packages/included",
|
|
30
30
|
"author": {
|
|
@@ -35,13 +35,13 @@
|
|
|
35
35
|
},
|
|
36
36
|
"bundleDependencies": false,
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@syncfusion/ej2-base": "~19.
|
|
39
|
-
"@syncfusion/ej2-buttons": "~19.
|
|
40
|
-
"@syncfusion/ej2-compression": "~19.
|
|
41
|
-
"@syncfusion/ej2-data": "~19.
|
|
42
|
-
"@syncfusion/ej2-file-utils": "~19.
|
|
43
|
-
"@syncfusion/ej2-pdf-export": "~19.
|
|
44
|
-
"@syncfusion/ej2-svg-base": "~19.
|
|
38
|
+
"@syncfusion/ej2-base": "~19.4.42",
|
|
39
|
+
"@syncfusion/ej2-buttons": "~19.4.42",
|
|
40
|
+
"@syncfusion/ej2-compression": "~19.4.38",
|
|
41
|
+
"@syncfusion/ej2-data": "~19.4.42",
|
|
42
|
+
"@syncfusion/ej2-file-utils": "~19.4.38",
|
|
43
|
+
"@syncfusion/ej2-pdf-export": "~19.4.42",
|
|
44
|
+
"@syncfusion/ej2-svg-base": "~19.4.42"
|
|
45
45
|
},
|
|
46
46
|
"deprecated": false,
|
|
47
47
|
"description": "The Maps component is used to visualize the geographical data and represent the statistical data of a particular geographical area on earth with user interactivity, and provides various customizing options",
|
|
@@ -80,6 +80,6 @@
|
|
|
80
80
|
"url": "git+https://github.com/syncfusion/ej2-javascript-ui-controls.git"
|
|
81
81
|
},
|
|
82
82
|
"typings": "index.d.ts",
|
|
83
|
-
"version": "19.
|
|
83
|
+
"version": "19.4.42",
|
|
84
84
|
"sideEffects": false
|
|
85
85
|
}
|
|
@@ -14,6 +14,8 @@ export declare class Bubble {
|
|
|
14
14
|
constructor(maps: Maps);
|
|
15
15
|
/**
|
|
16
16
|
* To render bubble
|
|
17
|
+
*
|
|
18
|
+
* @private
|
|
17
19
|
*/
|
|
18
20
|
renderBubble(bubbleSettings: BubbleSettingsModel, shapeData: any, color: string, range: {
|
|
19
21
|
min: number;
|
|
@@ -22,6 +24,8 @@ export declare class Bubble {
|
|
|
22
24
|
private getPoints;
|
|
23
25
|
/**
|
|
24
26
|
* To check and trigger bubble click event
|
|
27
|
+
*
|
|
28
|
+
* @private
|
|
25
29
|
*/
|
|
26
30
|
bubbleClick(e: PointerEvent): void;
|
|
27
31
|
/**
|
|
@@ -33,6 +37,8 @@ export declare class Bubble {
|
|
|
33
37
|
private getbubble;
|
|
34
38
|
/**
|
|
35
39
|
* To check and trigger bubble move event
|
|
40
|
+
*
|
|
41
|
+
* @private
|
|
36
42
|
*/
|
|
37
43
|
bubbleMove(e: PointerEvent): void;
|
|
38
44
|
/**
|
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
|
|
7
|
-
t[p[i]] = s[p[i]];
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
1
|
import { ColorMapping, bubbleRendering } from '../index';
|
|
11
2
|
import { bubbleClick, bubbleMouseMove } from '../index';
|
|
12
3
|
import { isNullOrUndefined } from '@syncfusion/ej2-base';
|
|
@@ -27,6 +18,8 @@ var Bubble = /** @class */ (function () {
|
|
|
27
18
|
// eslint-disable-next-line valid-jsdoc
|
|
28
19
|
/**
|
|
29
20
|
* To render bubble
|
|
21
|
+
*
|
|
22
|
+
* @private
|
|
30
23
|
*/
|
|
31
24
|
Bubble.prototype.renderBubble = function (
|
|
32
25
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -72,7 +65,7 @@ var Bubble = /** @class */ (function () {
|
|
|
72
65
|
isNaN(shapeData[layer.shapeDataPath]) ? shapeData[layer.shapeDataPath].toLowerCase() : shapeData[layer.shapeDataPath];
|
|
73
66
|
var shapePathValue = !isNullOrUndefined(shape[shapePath]) && isNaN(shape[shapePath])
|
|
74
67
|
? shape[shapePath].toLowerCase() : shape[shapePath];
|
|
75
|
-
if (shapeDataLayerPathValue === shapePathValue) {
|
|
68
|
+
if (shapeDataLayerPathValue === shapePathValue && layerData[i].type !== 'LineString') {
|
|
76
69
|
if (layerData[i]['type'] === 'Point') {
|
|
77
70
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
78
71
|
shapePoints.push(this.getPoints(layerData[i], []));
|
|
@@ -109,14 +102,14 @@ var Bubble = /** @class */ (function () {
|
|
|
109
102
|
width: bubbleSettings.border.width
|
|
110
103
|
};
|
|
111
104
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
112
|
-
var center = findMidPointOfPolygon(shapePoints[midIndex], projectionType);
|
|
105
|
+
var center = findMidPointOfPolygon(shapePoints[midIndex], projectionType, layer.geometryType);
|
|
113
106
|
if (bubbleSettings.visible) {
|
|
114
107
|
if (!isNullOrUndefined(center)) {
|
|
115
108
|
centerY = this.maps.projectionType === 'Mercator' ? center['y'] : (-center['y']);
|
|
116
109
|
eventArgs = {
|
|
117
110
|
cancel: false, name: bubbleRendering, border: bubbleBorder,
|
|
118
111
|
cx: center['x'], cy: centerY, data: shapeData, fill: bubbleColor,
|
|
119
|
-
maps: this.maps
|
|
112
|
+
maps: this.maps, radius: radius
|
|
120
113
|
};
|
|
121
114
|
}
|
|
122
115
|
else {
|
|
@@ -125,17 +118,13 @@ var Bubble = /** @class */ (function () {
|
|
|
125
118
|
eventArgs = {
|
|
126
119
|
cancel: false, name: bubbleRendering, border: bubbleBorder,
|
|
127
120
|
cx: shapePoints[shapePointsLength]['x'], cy: shapePoints[shapePointsLength]['y'],
|
|
128
|
-
data: shapeData, fill: bubbleColor, maps: this.maps
|
|
121
|
+
data: shapeData, fill: bubbleColor, maps: this.maps,
|
|
129
122
|
radius: radius
|
|
130
123
|
};
|
|
131
124
|
}
|
|
132
125
|
else {
|
|
133
126
|
return;
|
|
134
127
|
}
|
|
135
|
-
if (this.maps.isBlazor) {
|
|
136
|
-
var maps = eventArgs.maps, blazorEventArgs = __rest(eventArgs, ["maps"]);
|
|
137
|
-
eventArgs = blazorEventArgs;
|
|
138
|
-
}
|
|
139
128
|
}
|
|
140
129
|
this.maps.trigger('bubbleRendering', eventArgs, function (bubbleArgs) {
|
|
141
130
|
if (eventArgs.cancel) {
|
|
@@ -207,6 +196,8 @@ var Bubble = /** @class */ (function () {
|
|
|
207
196
|
// eslint-disable-next-line valid-jsdoc
|
|
208
197
|
/**
|
|
209
198
|
* To check and trigger bubble click event
|
|
199
|
+
*
|
|
200
|
+
* @private
|
|
210
201
|
*/
|
|
211
202
|
Bubble.prototype.bubbleClick = function (e) {
|
|
212
203
|
var target = e.target.id;
|
|
@@ -222,10 +213,6 @@ var Bubble = /** @class */ (function () {
|
|
|
222
213
|
cancel: false, name: bubbleClick, data: data, maps: this.maps,
|
|
223
214
|
target: target, x: e.clientX, y: e.clientY
|
|
224
215
|
};
|
|
225
|
-
if (this.maps.isBlazor) {
|
|
226
|
-
var maps = eventArgs.maps, blazorEventArgs = __rest(eventArgs, ["maps"]);
|
|
227
|
-
eventArgs = blazorEventArgs;
|
|
228
|
-
}
|
|
229
216
|
this.maps.trigger(bubbleClick, eventArgs);
|
|
230
217
|
};
|
|
231
218
|
/**
|
|
@@ -254,6 +241,8 @@ var Bubble = /** @class */ (function () {
|
|
|
254
241
|
// eslint-disable-next-line valid-jsdoc
|
|
255
242
|
/**
|
|
256
243
|
* To check and trigger bubble move event
|
|
244
|
+
*
|
|
245
|
+
* @private
|
|
257
246
|
*/
|
|
258
247
|
Bubble.prototype.bubbleMove = function (e) {
|
|
259
248
|
var target = e.target.id;
|
|
@@ -269,10 +258,6 @@ var Bubble = /** @class */ (function () {
|
|
|
269
258
|
cancel: false, name: bubbleMouseMove, data: data, maps: this.maps,
|
|
270
259
|
target: target, x: e.clientX, y: e.clientY
|
|
271
260
|
};
|
|
272
|
-
if (this.maps.isBlazor) {
|
|
273
|
-
var maps = eventArgs.maps, blazorEventArgs = __rest(eventArgs, ["maps"]);
|
|
274
|
-
eventArgs = blazorEventArgs;
|
|
275
|
-
}
|
|
276
261
|
this.maps.trigger(bubbleMouseMove, eventArgs);
|
|
277
262
|
};
|
|
278
263
|
/**
|
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
|
|
7
|
-
t[p[i]] = s[p[i]];
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
1
|
import { findMidPointOfPolygon, Rect, filter, getTemplateFunction, getZoomTranslate, getTranslate, RectOption, convertElementFromLabel, Point, TextOption, renderTextElement, textTrim, measureText, Internalize } from '../utils/helper';
|
|
11
2
|
import { isNullOrUndefined } from '@syncfusion/ej2-base';
|
|
12
3
|
import { dataLabelRendering } from '../model/constants';
|
|
@@ -185,7 +176,7 @@ var DataLabel = /** @class */ (function () {
|
|
|
185
176
|
};
|
|
186
177
|
}
|
|
187
178
|
else {
|
|
188
|
-
location = findMidPointOfPolygon(shapePoint[midIndex], projectionType);
|
|
179
|
+
location = findMidPointOfPolygon(shapePoint[midIndex], projectionType, layer.geometryType);
|
|
189
180
|
}
|
|
190
181
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
191
182
|
var firstLevelMapLocation = location;
|
|
@@ -206,7 +197,7 @@ var DataLabel = /** @class */ (function () {
|
|
|
206
197
|
location['x'] = ((location['x'] + zoomTransPoint['x']) * scale);
|
|
207
198
|
location['y'] = ((location['y'] + zoomTransPoint['y']) * scale);
|
|
208
199
|
}
|
|
209
|
-
location['y'] = (this.maps.projectionType === 'Mercator') ? location['y'] : (-location['y']);
|
|
200
|
+
location['y'] = (this.maps.projectionType === 'Mercator') || layer.geometryType === 'Normal' ? location['y'] : (-location['y']);
|
|
210
201
|
data = location;
|
|
211
202
|
if (!isNullOrUndefined(this.maps.format) && !isNaN(parseFloat(text))) {
|
|
212
203
|
if (this.maps.useGroupingSeparator) {
|
|
@@ -221,10 +212,6 @@ var DataLabel = /** @class */ (function () {
|
|
|
221
212
|
width: dataLabel.border.width, opacity: dataLabel.border.opacity }, datalabel: dataLabel,
|
|
222
213
|
fill: dataLabel.fill, template: dataLabel.template, text: text
|
|
223
214
|
};
|
|
224
|
-
if (this.maps.isBlazor) {
|
|
225
|
-
var maps = eventargs_1.maps, datalabel = eventargs_1.datalabel, blazorEventArgs = __rest(eventargs_1, ["maps", "datalabel"]);
|
|
226
|
-
eventargs_1 = blazorEventArgs;
|
|
227
|
-
}
|
|
228
215
|
this.maps.trigger('dataLabelRendering', eventargs_1, function (labelArgs) {
|
|
229
216
|
if (eventargs_1.cancel) {
|
|
230
217
|
return;
|
|
@@ -253,7 +240,7 @@ var DataLabel = /** @class */ (function () {
|
|
|
253
240
|
if (!isPoint && position.length > 5 && (shapeData['geometry']['type'] !== 'MultiPolygon') &&
|
|
254
241
|
(shapeData['type'] !== 'MultiPolygon')) {
|
|
255
242
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
256
|
-
var location1 = findMidPointOfPolygon(position, projectionType);
|
|
243
|
+
var location1 = findMidPointOfPolygon(position, projectionType, layer.geometryType);
|
|
257
244
|
if (zoomLabelsPosition && scaleZoomValue > 1 && !_this.maps.zoomNotApplied && eventargs_1.template === '') {
|
|
258
245
|
location1['x'] = ((_this.maps.zoomLabelPositions[index]['location']['x'] + zoomTransPoint['x']) * scale);
|
|
259
246
|
location1['y'] = ((_this.maps.zoomLabelPositions[index]['location']['y'] + zoomTransPoint['y']) * scale);
|
|
@@ -280,7 +267,9 @@ var DataLabel = /** @class */ (function () {
|
|
|
280
267
|
}
|
|
281
268
|
else {
|
|
282
269
|
if (dataLabelSettings.smartLabelMode === 'Trim') {
|
|
283
|
-
|
|
270
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
271
|
+
var textType = typeof text === 'number' ? text.toString() : text;
|
|
272
|
+
trimmedLable = textTrim(width, textType, style);
|
|
284
273
|
elementSize = measureText(trimmedLable, style);
|
|
285
274
|
options = new TextOption(labelId, textLocation.x, textLocation.y, 'middle', trimmedLable, '', '');
|
|
286
275
|
}
|
|
@@ -96,11 +96,12 @@ export declare class LayerPanel {
|
|
|
96
96
|
*/
|
|
97
97
|
private getShapeColorMapping;
|
|
98
98
|
generatePoints(type: string, coordinates: any[], data: any, properties: any): void;
|
|
99
|
+
calculateBox(point: Point, extraSpace: number): void;
|
|
99
100
|
calculateFactor(layer: LayerSettings): number;
|
|
100
101
|
translateLayerElements(layerElement: Element, index: number): void;
|
|
101
102
|
calculateRectBounds(layerData: any[]): void;
|
|
102
103
|
calculatePolygonBox(coordinates: any[], data: any, properties: any): any;
|
|
103
|
-
calculateRectBox(coordinates: any[]): void;
|
|
104
|
+
calculateRectBox(coordinates: any[], type?: string, isFirstItem?: boolean): void;
|
|
104
105
|
generateTiles(zoomLevel: number, tileTranslatePoint: Point, zoomType?: string, bing?: BingMap, position?: Point): void;
|
|
105
106
|
arrangeTiles(type: string, x: number, y: number): void;
|
|
106
107
|
/**
|
|
@@ -1,19 +1,10 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
|
|
7
|
-
t[p[i]] = s[p[i]];
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
1
|
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
|
11
2
|
/* eslint-disable jsdoc/require-param */
|
|
12
3
|
/* eslint-disable no-case-declarations */
|
|
13
4
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
14
5
|
import { isNullOrUndefined, extend, createElement, Ajax } from '@syncfusion/ej2-base';
|
|
15
6
|
import { getShapeColor } from '../model/theme';
|
|
16
|
-
import { GeoLocation, isCustomPath, convertGeoToPoint, Point, PathOption, Size,
|
|
7
|
+
import { GeoLocation, isCustomPath, convertGeoToPoint, Point, PathOption, Size, removeElement } from '../utils/helper';
|
|
17
8
|
import { getElementByID, maintainSelection, getValueFromObject } from '../utils/helper';
|
|
18
9
|
import { RectOption, getTranslate, convertTileLatLongToPoint, checkShapeDataFields, CircleOption } from '../utils/helper';
|
|
19
10
|
import { getZoomTranslate, fixInitialScaleForTile } from '../utils/helper';
|
|
@@ -187,7 +178,7 @@ var LayerPanel = /** @class */ (function () {
|
|
|
187
178
|
if (this.mapObject.zoomSettings.resetToInitial && this.mapObject.initialCheck && !isNullOrUndefined(panel.mapObject.height)
|
|
188
179
|
&& this.mapObject.availableSize.height > 512) {
|
|
189
180
|
this.mapObject.applyZoomReset = true;
|
|
190
|
-
this.mapObject.initialZoomLevel = Math.floor(this.mapObject.availableSize.height / 512)
|
|
181
|
+
this.mapObject.initialZoomLevel = Math.floor(this.mapObject.availableSize.height / 512);
|
|
191
182
|
var padding = this.mapObject.layers[this.mapObject.baseLayerIndex].layerType !== 'GoogleStaticMap' ?
|
|
192
183
|
20 : 0;
|
|
193
184
|
var totalSize = Math.pow(2, this.mapObject.initialZoomLevel) * 256;
|
|
@@ -233,10 +224,6 @@ var LayerPanel = /** @class */ (function () {
|
|
|
233
224
|
cancel: false, name: layerRendering, index: layerIndex,
|
|
234
225
|
layer: layer, maps: this.mapObject, visible: layer.visible
|
|
235
226
|
};
|
|
236
|
-
if (this.mapObject.isBlazor) {
|
|
237
|
-
var maps = eventArgs.maps, layer_1 = eventArgs.layer, blazorEventArgs = __rest(eventArgs, ["maps", "layer"]);
|
|
238
|
-
eventArgs = blazorEventArgs;
|
|
239
|
-
}
|
|
240
227
|
this.mapObject.trigger('layerRendering', eventArgs, function (observedArgs) {
|
|
241
228
|
if (!eventArgs.cancel && eventArgs.visible) {
|
|
242
229
|
if (layer.layerType !== 'Geometry') {
|
|
@@ -271,13 +258,11 @@ var LayerPanel = /** @class */ (function () {
|
|
|
271
258
|
bing_1.maxZoom = maxZoom;
|
|
272
259
|
}
|
|
273
260
|
proxy_1.mapObject['bingMap'] = bing_1;
|
|
274
|
-
if (_this.mapObject.isBlazor) {
|
|
275
|
-
if (!isNullOrUndefined(markerGroupElement)) {
|
|
276
|
-
removeElement(_this.mapObject.element.id + '_Markers_Group');
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
261
|
proxy_1.renderTileLayer(proxy_1, layer, layerIndex, bing_1);
|
|
280
262
|
_this.mapObject.arrangeTemplate();
|
|
263
|
+
if (_this.mapObject.zoomModule && (_this.mapObject.previousScale !== _this.mapObject.scale)) {
|
|
264
|
+
_this.mapObject.zoomModule.applyTransform(true);
|
|
265
|
+
}
|
|
281
266
|
};
|
|
282
267
|
ajax.send();
|
|
283
268
|
}
|
|
@@ -356,9 +341,7 @@ var LayerPanel = /** @class */ (function () {
|
|
|
356
341
|
var data = geometryData['geometry'];
|
|
357
342
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
358
343
|
var properties = geometryData['properties'];
|
|
359
|
-
|
|
360
|
-
_this.generatePoints(type, coords, data, properties);
|
|
361
|
-
}
|
|
344
|
+
_this.generatePoints(type, coords, data, properties);
|
|
362
345
|
}
|
|
363
346
|
});
|
|
364
347
|
this.currentLayer.rectBounds = this.rectBounds;
|
|
@@ -386,7 +369,7 @@ var LayerPanel = /** @class */ (function () {
|
|
|
386
369
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
387
370
|
var currentShapeData = this_1.currentLayer.layerData[i];
|
|
388
371
|
var pathOptions;
|
|
389
|
-
var polyLineOptions;
|
|
372
|
+
var polyLineOptions = void 0;
|
|
390
373
|
var circleOptions;
|
|
391
374
|
var groupElement;
|
|
392
375
|
var drawObject = void 0;
|
|
@@ -441,10 +424,6 @@ var LayerPanel = /** @class */ (function () {
|
|
|
441
424
|
shape: shapeSettings, fill: fill,
|
|
442
425
|
border: { width: borderValue.width, color: borderValue.color, opacity: borderValue.opacity }
|
|
443
426
|
};
|
|
444
|
-
if (this_1.mapObject.isBlazor) {
|
|
445
|
-
var maps = eventArgs.maps, blazorEventArgs = __rest(eventArgs, ["maps"]);
|
|
446
|
-
eventArgs = blazorEventArgs;
|
|
447
|
-
}
|
|
448
427
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
449
428
|
var shapeRenderingSuccess = function (eventArgs) {
|
|
450
429
|
var drawingType = !isNullOrUndefined(currentShapeData['_isMultiPolygon'])
|
|
@@ -459,7 +438,7 @@ var LayerPanel = /** @class */ (function () {
|
|
|
459
438
|
if (isNullOrUndefined(shapeSettings.borderColorValuePath)) {
|
|
460
439
|
_this.mapObject.layers[layerIndex].shapeSettings.border.color = eventArgs.border.color;
|
|
461
440
|
}
|
|
462
|
-
|
|
441
|
+
if (isNullOrUndefined(shapeSettings.borderWidthValuePath)) {
|
|
463
442
|
_this.mapObject.layers[layerIndex].shapeSettings.border.width = eventArgs.border.width;
|
|
464
443
|
}
|
|
465
444
|
}
|
|
@@ -513,17 +492,21 @@ var LayerPanel = /** @class */ (function () {
|
|
|
513
492
|
}
|
|
514
493
|
break;
|
|
515
494
|
case 'LineString':
|
|
495
|
+
path += 'M ' + (currentShapeData[0]['point']['x']) + ' ' + (currentShapeData[0]['point']['y']);
|
|
516
496
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
517
497
|
currentShapeData.map(function (lineData) {
|
|
518
|
-
|
|
498
|
+
path += 'L' + (lineData['point']['x']) + ' , ' + (lineData['point']['y']) + ' ';
|
|
519
499
|
});
|
|
520
|
-
|
|
521
|
-
|
|
500
|
+
if (path.length > 3) {
|
|
501
|
+
pathOptions = new PathOption(shapeID, 'transparent', !isNullOrUndefined(eventArgs.border.width) ? eventArgs.border.width : 1, eventArgs.border.color, opacity, eventArgs.border.opacity, shapeSettings.dashArray, path);
|
|
502
|
+
pathEle = _this.mapObject.renderer.drawPath(pathOptions);
|
|
503
|
+
}
|
|
522
504
|
break;
|
|
523
505
|
case 'Point':
|
|
524
506
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
525
507
|
var pointData = currentShapeData['point'];
|
|
526
|
-
|
|
508
|
+
var circleRadius = (_this.mapObject.layers[layerIndex].type !== 'SubLayer') ? shapeSettings.circleRadius : shapeSettings.circleRadius / _this.currentFactor;
|
|
509
|
+
circleOptions = new CircleOption(shapeID, eventArgs.fill, eventArgs.border, opacity, pointData['x'], pointData['y'], circleRadius, null);
|
|
527
510
|
pathEle = _this.mapObject.renderer.drawCircle(circleOptions);
|
|
528
511
|
break;
|
|
529
512
|
case 'Path':
|
|
@@ -545,6 +528,9 @@ var LayerPanel = /** @class */ (function () {
|
|
|
545
528
|
pathEle.setAttribute('aria-label', ((!isNullOrUndefined(currentShapeData['property'])) ?
|
|
546
529
|
(currentShapeData['property'][properties]) : ''));
|
|
547
530
|
pathEle.setAttribute('tabindex', (_this.mapObject.tabIndex + i + 2).toString());
|
|
531
|
+
if (drawingType === 'LineString') {
|
|
532
|
+
pathEle.setAttribute('style', 'outline:none');
|
|
533
|
+
}
|
|
548
534
|
maintainSelection(_this.mapObject.selectedElementId, _this.mapObject.shapeSelectionClass, pathEle, 'ShapeselectionMapStyle');
|
|
549
535
|
if (_this.mapObject.toggledShapeElementId) {
|
|
550
536
|
for (var j = 0; j < _this.mapObject.toggledShapeElementId.length; j++) {
|
|
@@ -763,11 +749,14 @@ var LayerPanel = /** @class */ (function () {
|
|
|
763
749
|
this.currentLayer.layerData.push(multiPolygonDatas);
|
|
764
750
|
break;
|
|
765
751
|
case 'linestring':
|
|
752
|
+
var extraSpace_1 = !isNullOrUndefined(this.currentLayer.shapeSettings.border.width) ?
|
|
753
|
+
this.currentLayer.shapeSettings.border.width : 1;
|
|
766
754
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
767
755
|
coordinates.map(function (points, index) {
|
|
768
756
|
latitude = points[1];
|
|
769
757
|
longitude = points[0];
|
|
770
758
|
var point = convertGeoToPoint(latitude, longitude, _this.currentFactor, _this.currentLayer, _this.mapObject);
|
|
759
|
+
_this.calculateBox(point, extraSpace_1);
|
|
771
760
|
newData.push({
|
|
772
761
|
point: point, lat: latitude, lng: longitude
|
|
773
762
|
});
|
|
@@ -778,6 +767,8 @@ var LayerPanel = /** @class */ (function () {
|
|
|
778
767
|
break;
|
|
779
768
|
case 'point': {
|
|
780
769
|
var arrayCollections_1 = false;
|
|
770
|
+
var extraSpace_2 = (!isNullOrUndefined(this.currentLayer.shapeSettings.border.width) ?
|
|
771
|
+
this.currentLayer.shapeSettings.border.width : 1) + (this.currentLayer.shapeSettings.circleRadius * 2);
|
|
781
772
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
782
773
|
coordinates.map(function (points, index) {
|
|
783
774
|
if (Object.prototype.toString.call(points) === '[object Array]') {
|
|
@@ -794,6 +785,7 @@ var LayerPanel = /** @class */ (function () {
|
|
|
794
785
|
latitude = coordinates[1];
|
|
795
786
|
longitude = coordinates[0];
|
|
796
787
|
var point = convertGeoToPoint(latitude, longitude, this.currentFactor, this.currentLayer, this.mapObject);
|
|
788
|
+
this.calculateBox(point, extraSpace_2);
|
|
797
789
|
this.currentLayer.layerData.push({
|
|
798
790
|
point: point, type: type, lat: latitude, lng: longitude, property: properties
|
|
799
791
|
});
|
|
@@ -807,6 +799,17 @@ var LayerPanel = /** @class */ (function () {
|
|
|
807
799
|
break;
|
|
808
800
|
}
|
|
809
801
|
};
|
|
802
|
+
LayerPanel.prototype.calculateBox = function (point, extraSpace) {
|
|
803
|
+
if (isNullOrUndefined(this.rectBounds)) {
|
|
804
|
+
this.rectBounds = { min: { x: point.x, y: point.y - extraSpace }, max: { x: point.x, y: point.y + extraSpace } };
|
|
805
|
+
}
|
|
806
|
+
else {
|
|
807
|
+
this.rectBounds['min']['x'] = Math.min(this.rectBounds['min']['x'], point.x);
|
|
808
|
+
this.rectBounds['min']['y'] = Math.min(this.rectBounds['min']['y'], point.y - extraSpace);
|
|
809
|
+
this.rectBounds['max']['x'] = Math.max(this.rectBounds['max']['x'], point.x);
|
|
810
|
+
this.rectBounds['max']['y'] = Math.max(this.rectBounds['max']['y'], point.y + extraSpace);
|
|
811
|
+
}
|
|
812
|
+
};
|
|
810
813
|
LayerPanel.prototype.calculateFactor = function (layer) {
|
|
811
814
|
var horFactor;
|
|
812
815
|
var verFactor = 1;
|
|
@@ -915,6 +918,15 @@ var LayerPanel = /** @class */ (function () {
|
|
|
915
918
|
_this.calculateRectBox(point[0]);
|
|
916
919
|
});
|
|
917
920
|
break;
|
|
921
|
+
case 'linestring':
|
|
922
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
923
|
+
coordinates.map(function (point, index) {
|
|
924
|
+
_this.calculateRectBox(point, 'LineString', index === 0 ? true : false);
|
|
925
|
+
});
|
|
926
|
+
break;
|
|
927
|
+
case 'point':
|
|
928
|
+
_this.calculateRectBox(coordinates, 'point');
|
|
929
|
+
break;
|
|
918
930
|
}
|
|
919
931
|
}
|
|
920
932
|
});
|
|
@@ -951,20 +963,33 @@ var LayerPanel = /** @class */ (function () {
|
|
|
951
963
|
return newData;
|
|
952
964
|
};
|
|
953
965
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
954
|
-
LayerPanel.prototype.calculateRectBox = function (coordinates) {
|
|
966
|
+
LayerPanel.prototype.calculateRectBox = function (coordinates, type, isFirstItem) {
|
|
955
967
|
var _this = this;
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
_this.mapObject.baseMapBounds
|
|
968
|
+
if (type !== 'LineString' && type !== 'point') {
|
|
969
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
970
|
+
Array.prototype.forEach.call(coordinates, function (currentCoords) {
|
|
971
|
+
if (isNullOrUndefined(_this.mapObject.baseMapBounds)) {
|
|
972
|
+
_this.mapObject.baseMapBounds = new GeoLocation({ min: currentCoords[1], max: currentCoords[1] }, { min: currentCoords[0], max: currentCoords[0] });
|
|
973
|
+
}
|
|
974
|
+
else {
|
|
975
|
+
_this.mapObject.baseMapBounds.latitude.min = Math.min(_this.mapObject.baseMapBounds.latitude.min, currentCoords[1]);
|
|
976
|
+
_this.mapObject.baseMapBounds.latitude.max = Math.max(_this.mapObject.baseMapBounds.latitude.max, currentCoords[1]);
|
|
977
|
+
_this.mapObject.baseMapBounds.longitude.min = Math.min(_this.mapObject.baseMapBounds.longitude.min, currentCoords[0]);
|
|
978
|
+
_this.mapObject.baseMapBounds.longitude.max = Math.max(_this.mapObject.baseMapBounds.longitude.max, currentCoords[0]);
|
|
979
|
+
}
|
|
980
|
+
});
|
|
981
|
+
}
|
|
982
|
+
else {
|
|
983
|
+
if ((isFirstItem || type === 'point') && isNullOrUndefined(this.mapObject.baseMapBounds)) {
|
|
984
|
+
this.mapObject.baseMapBounds = new GeoLocation({ min: coordinates[1], max: coordinates[1] }, { min: coordinates[0], max: coordinates[0] });
|
|
960
985
|
}
|
|
961
986
|
else {
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
987
|
+
this.mapObject.baseMapBounds.latitude.min = Math.min(this.mapObject.baseMapBounds.latitude.min, coordinates[1]);
|
|
988
|
+
this.mapObject.baseMapBounds.latitude.max = Math.max(this.mapObject.baseMapBounds.latitude.max, coordinates[1]);
|
|
989
|
+
this.mapObject.baseMapBounds.longitude.min = Math.min(this.mapObject.baseMapBounds.longitude.min, coordinates[0]);
|
|
990
|
+
this.mapObject.baseMapBounds.longitude.max = Math.max(this.mapObject.baseMapBounds.longitude.max, coordinates[0]);
|
|
966
991
|
}
|
|
967
|
-
}
|
|
992
|
+
}
|
|
968
993
|
};
|
|
969
994
|
LayerPanel.prototype.generateTiles = function (zoomLevel, tileTranslatePoint, zoomType, bing, position) {
|
|
970
995
|
var userLang = this.mapObject.locale;
|
|
@@ -1053,16 +1078,18 @@ var LayerPanel = /** @class */ (function () {
|
|
|
1053
1078
|
}
|
|
1054
1079
|
}
|
|
1055
1080
|
}
|
|
1056
|
-
this.
|
|
1081
|
+
if (this.mapObject.previousScale !== this.mapObject.scale || this.mapObject.isReset) {
|
|
1082
|
+
this.arrangeTiles(zoomType, this.animateToZoomX, this.animateToZoomY);
|
|
1083
|
+
}
|
|
1057
1084
|
};
|
|
1058
1085
|
LayerPanel.prototype.arrangeTiles = function (type, x, y) {
|
|
1059
1086
|
var _this = this;
|
|
1060
1087
|
var element = document.getElementById(this.mapObject.element.id + '_tile_parent');
|
|
1061
1088
|
var element1 = document.getElementById(this.mapObject.element.id + '_tiles');
|
|
1062
1089
|
var timeOut;
|
|
1063
|
-
if (!isNullOrUndefined(type) && type !== 'Pan'
|
|
1090
|
+
if (!isNullOrUndefined(type) && type !== 'Pan') {
|
|
1064
1091
|
this.tileAnimation(type, x, y);
|
|
1065
|
-
timeOut =
|
|
1092
|
+
timeOut = this.mapObject.layersCollection[0].animationDuration;
|
|
1066
1093
|
}
|
|
1067
1094
|
else {
|
|
1068
1095
|
timeOut = 0;
|
|
@@ -1077,7 +1104,6 @@ var LayerPanel = /** @class */ (function () {
|
|
|
1077
1104
|
}
|
|
1078
1105
|
if (element1) {
|
|
1079
1106
|
element1.style.zIndex = '0';
|
|
1080
|
-
element1.style.visibility = 'hidden';
|
|
1081
1107
|
}
|
|
1082
1108
|
var animateElement;
|
|
1083
1109
|
if (!document.getElementById(_this.mapObject.element.id + '_animated_tiles') && element) {
|
|
@@ -1139,35 +1165,23 @@ var LayerPanel = /** @class */ (function () {
|
|
|
1139
1165
|
* @returns {void}
|
|
1140
1166
|
*/
|
|
1141
1167
|
LayerPanel.prototype.tileAnimation = function (zoomType, translateX, translateY) {
|
|
1142
|
-
var
|
|
1143
|
-
var
|
|
1144
|
-
var
|
|
1168
|
+
var tileParent = document.getElementById(this.mapObject.element.id + '_tile_parent');
|
|
1169
|
+
var animatedTiles = document.getElementById(this.mapObject.element.id + '_animated_tiles');
|
|
1170
|
+
var tileElement = document.getElementById(this.mapObject.element.id + '_tiles');
|
|
1145
1171
|
var scaleValue = '2';
|
|
1146
|
-
if (zoomType.indexOf('ZoomOut') === 0) {
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
ele.removeChild(ele.children[0]);
|
|
1152
|
-
}
|
|
1153
|
-
translateX = 0;
|
|
1154
|
-
translateY = 128 - 23;
|
|
1155
|
-
scaleValue = '0.5';
|
|
1156
|
-
}
|
|
1157
|
-
else if (zoomType === 'Reset') {
|
|
1158
|
-
ele.style.zIndex = '1';
|
|
1159
|
-
element.style.zIndex = '0';
|
|
1160
|
-
while (!(ele.childElementCount === 1) && !(ele.childElementCount === 0)) {
|
|
1161
|
-
ele.removeChild(ele.children[1]);
|
|
1172
|
+
if (zoomType.indexOf('ZoomOut') === 0 || zoomType === 'Reset') {
|
|
1173
|
+
tileElement.style.zIndex = '1';
|
|
1174
|
+
tileParent.style.zIndex = '0';
|
|
1175
|
+
while (tileElement.childElementCount >= 1) {
|
|
1176
|
+
tileElement.removeChild(tileElement.children[0]);
|
|
1162
1177
|
}
|
|
1163
|
-
element1 = ele.children[0];
|
|
1164
1178
|
translateX = 0;
|
|
1165
|
-
translateY = 0;
|
|
1166
|
-
scaleValue = '
|
|
1179
|
+
translateY = document.getElementById(this.mapObject.element.id + '_tile_parent').getClientRects()[0].height / 4;
|
|
1180
|
+
scaleValue = zoomType.indexOf('ZoomOut') === 0 ? '0.5' : '0.2';
|
|
1167
1181
|
}
|
|
1168
|
-
if (!isNullOrUndefined(
|
|
1169
|
-
|
|
1170
|
-
|
|
1182
|
+
if (!isNullOrUndefined(animatedTiles)) {
|
|
1183
|
+
animatedTiles.style.transition = this.mapObject.layersCollection[0].animationDuration + 'ms';
|
|
1184
|
+
animatedTiles.style.transform = 'translate(' + translateX + 'px, ' + translateY + 'px) scale(' + scaleValue + ')';
|
|
1171
1185
|
}
|
|
1172
1186
|
};
|
|
1173
1187
|
/**
|