@syncfusion/ej2-maps 20.1.55 → 20.2.38
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 +13 -42
- 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 +587 -246
- package/dist/es6/ej2-maps.es2015.js.map +1 -1
- package/dist/es6/ej2-maps.es5.js +581 -240
- 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/bing-map.js +9 -3
- package/src/maps/layers/bubble.js +2 -6
- package/src/maps/layers/data-label.js +17 -18
- package/src/maps/layers/layer-panel.d.ts +13 -1
- package/src/maps/layers/layer-panel.js +198 -67
- package/src/maps/layers/legend.d.ts +4 -0
- package/src/maps/layers/legend.js +143 -55
- package/src/maps/layers/marker.js +4 -3
- package/src/maps/maps-model.d.ts +1 -1
- package/src/maps/maps.d.ts +7 -0
- package/src/maps/maps.js +63 -30
- package/src/maps/model/base-model.d.ts +5 -1
- package/src/maps/model/base.d.ts +5 -1
- package/src/maps/model/base.js +5 -5
- package/src/maps/model/theme.js +3 -0
- package/src/maps/user-interaction/highlight.js +8 -5
- package/src/maps/user-interaction/selection.js +38 -11
- package/src/maps/user-interaction/zoom.d.ts +1 -1
- package/src/maps/user-interaction/zoom.js +83 -35
- package/src/maps/utils/helper.js +10 -3
package/dist/global/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: index.d.ts
|
|
3
|
-
* version : 20.
|
|
3
|
+
* version : 20.2.38
|
|
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@20.
|
|
3
|
+
"_id": "@syncfusion/ej2-maps@20.2.36",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512-
|
|
5
|
+
"_integrity": "sha512-F4oto9pbVy/GFRpkaVBJI84ztssNnG/CIPGCqp2qylutLhMLFpnCqpK/JMXE6EqB1ztaknptya9q6K2UdHh4yQ==",
|
|
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-new/@syncfusion/ej2-maps/-/ej2-maps-20.
|
|
27
|
-
"_shasum": "
|
|
26
|
+
"_resolved": "http://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-maps/-/ej2-maps-20.2.36.tgz",
|
|
27
|
+
"_shasum": "25af786664388cca9544bff736c4aa464a150dee",
|
|
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": "~20.
|
|
39
|
-
"@syncfusion/ej2-buttons": "~20.
|
|
40
|
-
"@syncfusion/ej2-compression": "~20.
|
|
41
|
-
"@syncfusion/ej2-data": "~20.
|
|
42
|
-
"@syncfusion/ej2-file-utils": "~20.
|
|
43
|
-
"@syncfusion/ej2-pdf-export": "~20.
|
|
44
|
-
"@syncfusion/ej2-svg-base": "~20.
|
|
38
|
+
"@syncfusion/ej2-base": "~20.2.38",
|
|
39
|
+
"@syncfusion/ej2-buttons": "~20.2.38",
|
|
40
|
+
"@syncfusion/ej2-compression": "~20.2.38",
|
|
41
|
+
"@syncfusion/ej2-data": "~20.2.38",
|
|
42
|
+
"@syncfusion/ej2-file-utils": "~20.2.38",
|
|
43
|
+
"@syncfusion/ej2-pdf-export": "~20.2.38",
|
|
44
|
+
"@syncfusion/ej2-svg-base": "~20.2.38"
|
|
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": "20.
|
|
83
|
+
"version": "20.2.38",
|
|
84
84
|
"sideEffects": false
|
|
85
85
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isNullOrUndefined } from '@syncfusion/ej2-base';
|
|
1
2
|
/**
|
|
2
3
|
* Bing map src doc
|
|
3
4
|
*/
|
|
@@ -19,9 +20,14 @@ var BingMap = /** @class */ (function () {
|
|
|
19
20
|
}
|
|
20
21
|
quadKey = quadKey + '' + digit;
|
|
21
22
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
if (!isNullOrUndefined(subDomains)) {
|
|
24
|
+
var subDomain = subDomains[Math.min(parseInt(quadKey.substr(quadKey.length - 1, 1), 10), subDomains.length)];
|
|
25
|
+
imageUrl = imageUrl.replace('{quadkey}', quadKey).replace('{subdomain}', subDomain);
|
|
26
|
+
return imageUrl += '&mkt=' + language + '&ur=IN&Key=' + key;
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
return '';
|
|
30
|
+
}
|
|
25
31
|
};
|
|
26
32
|
return BingMap;
|
|
27
33
|
}());
|
|
@@ -65,12 +65,8 @@ var Bubble = /** @class */ (function () {
|
|
|
65
65
|
isNaN(shapeData[layer.shapeDataPath]) ? shapeData[layer.shapeDataPath].toLowerCase() : shapeData[layer.shapeDataPath];
|
|
66
66
|
var shapePathValue = !isNullOrUndefined(shape[shapePath]) && isNaN(shape[shapePath])
|
|
67
67
|
? shape[shapePath].toLowerCase() : shape[shapePath];
|
|
68
|
-
if (shapeDataLayerPathValue === shapePathValue && layerData[i].type !== 'LineString') {
|
|
69
|
-
if (layerData[i]['
|
|
70
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
71
|
-
shapePoints.push(this.getPoints(layerData[i], []));
|
|
72
|
-
}
|
|
73
|
-
else if (!layerData[i]['_isMultiPolygon']) {
|
|
68
|
+
if (shapeDataLayerPathValue === shapePathValue && (layerData[i].type !== 'LineString' && layerData[i].type !== 'MultiLineString' && layerData[i]['type'] !== 'Point' && layerData[i]['type'] !== 'MultiPoint')) {
|
|
69
|
+
if (!layerData[i]['_isMultiPolygon']) {
|
|
74
70
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
75
71
|
shapePoints.push(this.getPoints(layerData[i], []));
|
|
76
72
|
currentLength = shapePoints[shapePoints.length - 1].length;
|
|
@@ -116,7 +116,7 @@ var DataLabel = /** @class */ (function () {
|
|
|
116
116
|
layer.dataSource, layer.shapeDataPath, shapeData['properties'][propertyPath], layer.shapeDataPath);
|
|
117
117
|
if (!isNullOrUndefined(shapes['property'])) {
|
|
118
118
|
shapePoint = [[]];
|
|
119
|
-
if (!layerData[index]['_isMultiPolygon'] && layerData[index]['type'] !== 'Point') {
|
|
119
|
+
if (!layerData[index]['_isMultiPolygon'] && layerData[index]['type'] !== 'Point' && layerData[index]['type'] !== 'MultiPoint') {
|
|
120
120
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
121
121
|
shapePoint.push(this.getPoint(layerData[index], []));
|
|
122
122
|
currentLength = shapePoint[shapePoint.length - 1].length;
|
|
@@ -125,21 +125,9 @@ var DataLabel = /** @class */ (function () {
|
|
|
125
125
|
midIndex = shapePoint.length - 1;
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
|
-
else {
|
|
128
|
+
else if (layerData[index]['type'] !== 'Point' && layerData[index]['type'] !== 'MultiPoint') {
|
|
129
129
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
130
130
|
var layer_1 = layerData[index];
|
|
131
|
-
if (layer_1['type'] === 'Point') {
|
|
132
|
-
isPoint = true;
|
|
133
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
134
|
-
var layerPoints = [];
|
|
135
|
-
layerPoints.push(this.getPoint(layerData, []));
|
|
136
|
-
shapePoint = layerPoints;
|
|
137
|
-
currentLength = shapePoint[shapePoint.length - 1].length;
|
|
138
|
-
if (pointsLength < currentLength) {
|
|
139
|
-
pointsLength = currentLength;
|
|
140
|
-
midIndex = shapePoint.length - 1;
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
131
|
for (var j = 0; j < layer_1.length; j++) {
|
|
144
132
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
145
133
|
shapePoint.push(this.getPoint(layer_1[j], []));
|
|
@@ -386,10 +374,21 @@ var DataLabel = /** @class */ (function () {
|
|
|
386
374
|
};
|
|
387
375
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
388
376
|
DataLabel.prototype.getPoint = function (shapes, points) {
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
377
|
+
if (shapes['type'] === 'MultiLineString') {
|
|
378
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
379
|
+
shapes.map(function (current) {
|
|
380
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
381
|
+
current.map(function (shape) {
|
|
382
|
+
points.push(new Point(shape['point']['x'], shape['point']['y']));
|
|
383
|
+
});
|
|
384
|
+
});
|
|
385
|
+
}
|
|
386
|
+
else {
|
|
387
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
388
|
+
shapes.map(function (current, index) {
|
|
389
|
+
points.push(new Point(current['point']['x'], current['point']['y']));
|
|
390
|
+
});
|
|
391
|
+
}
|
|
393
392
|
return points;
|
|
394
393
|
};
|
|
395
394
|
/**
|
|
@@ -14,7 +14,6 @@ export declare class LayerPanel {
|
|
|
14
14
|
private rectBounds;
|
|
15
15
|
tiles: Tile[];
|
|
16
16
|
private clipRectElement;
|
|
17
|
-
private layerGroup;
|
|
18
17
|
private urlTemplate;
|
|
19
18
|
private isMapCoordinates;
|
|
20
19
|
private tileSvgObject;
|
|
@@ -25,6 +24,7 @@ export declare class LayerPanel {
|
|
|
25
24
|
private animateToZoomY;
|
|
26
25
|
horizontalPan: boolean;
|
|
27
26
|
horizontalPanXCount: number;
|
|
27
|
+
layerGroup: Element;
|
|
28
28
|
constructor(map: Maps);
|
|
29
29
|
measureLayerPanel(): void;
|
|
30
30
|
/**
|
|
@@ -39,8 +39,20 @@ export declare class LayerPanel {
|
|
|
39
39
|
*/
|
|
40
40
|
renderTileLayer(panel: LayerPanel, layer: LayerSettings, layerIndex: number, bing?: BingMap): void;
|
|
41
41
|
protected processLayers(layer: LayerSettings, layerIndex: number): void;
|
|
42
|
+
private bingMapCalculation;
|
|
42
43
|
private bubbleCalculation;
|
|
43
44
|
calculatePathCollection(layerIndex: number, renderData: any[]): void;
|
|
45
|
+
/**
|
|
46
|
+
* layer features as bubble, marker, datalabel, navigation line.
|
|
47
|
+
*
|
|
48
|
+
* @param {groupElement} Element - Specifies the element to append the group
|
|
49
|
+
* @param {pathEle} Element - Specifies the svg element
|
|
50
|
+
* @param {drawingType} string - Specifies the data type
|
|
51
|
+
* @param {currentShapeData} any - Specifies the layer of shapedata.
|
|
52
|
+
* @param {index} number - Specifies the tab index.
|
|
53
|
+
* @returns {void}
|
|
54
|
+
*/
|
|
55
|
+
private pathAttributeCalculate;
|
|
44
56
|
/**
|
|
45
57
|
* layer features as bubble, marker, datalabel, navigation line.
|
|
46
58
|
*
|
|
@@ -56,8 +56,7 @@ var LayerPanel = /** @class */ (function () {
|
|
|
56
56
|
else {
|
|
57
57
|
this.clipRectElement = this.mapObject.renderer.drawClipPath(new RectOption(this.mapObject.element.id + '_MapArea_ClipRect', 'transparent', { width: 1, color: 'Gray' }, 1, {
|
|
58
58
|
x: this.mapObject.isTileMap ? 0 : areaRect.x, y: this.mapObject.isTileMap ? 0 : areaRect.y,
|
|
59
|
-
width: areaRect.width, height:
|
|
60
|
-
this.mapObject.legendModule.totalPages.length > 0 ? this.mapObject.legendModule.legendTotalRect.height : areaRect.height
|
|
59
|
+
width: areaRect.width, height: areaRect.height
|
|
61
60
|
}));
|
|
62
61
|
}
|
|
63
62
|
this.layerGroup.appendChild(this.clipRectElement);
|
|
@@ -68,6 +67,14 @@ var LayerPanel = /** @class */ (function () {
|
|
|
68
67
|
_this.currentLayer = layer;
|
|
69
68
|
_this.processLayers(layer, index);
|
|
70
69
|
});
|
|
70
|
+
if (!isNullOrUndefined(this.mapObject.legendModule) && this.mapObject.legendSettings.position === 'Float') {
|
|
71
|
+
if (this.mapObject.isTileMap) {
|
|
72
|
+
this.layerGroup.appendChild(this.mapObject.legendModule.legendGroup);
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
this.mapObject.svgObject.appendChild(this.mapObject.legendModule.legendGroup);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
71
78
|
};
|
|
72
79
|
/**
|
|
73
80
|
* Tile rendering
|
|
@@ -227,9 +234,21 @@ var LayerPanel = /** @class */ (function () {
|
|
|
227
234
|
};
|
|
228
235
|
this.mapObject.trigger('layerRendering', eventArgs, function (observedArgs) {
|
|
229
236
|
if (!eventArgs.cancel && eventArgs.visible) {
|
|
230
|
-
if (layer.layerType
|
|
237
|
+
if (layer.layerType === 'OSM') {
|
|
238
|
+
layer.urlTemplate = 'https://a.tile.openstreetmap.org/level/tileX/tileY.png';
|
|
239
|
+
}
|
|
240
|
+
if (layer.layerType === 'Google') {
|
|
241
|
+
layer.urlTemplate = 'https://mt1.google.com/vt/lyrs=m@129&hl=en&x=tileX&y=tileY&z=level';
|
|
242
|
+
}
|
|
243
|
+
if (layer.layerType !== 'Geometry' || (isNullOrUndefined(layer.shapeData) && !isNullOrUndefined(layer.urlTemplate) && layer.urlTemplate !== '')) {
|
|
231
244
|
if (layer.layerType !== 'Bing' || _this.bing) {
|
|
232
|
-
|
|
245
|
+
if (!isNullOrUndefined(layer.urlTemplate) && layer.urlTemplate.indexOf('quadkey') > -1) {
|
|
246
|
+
var bing = new BingMap(_this.mapObject);
|
|
247
|
+
_this.bingMapCalculation(layer, layerIndex, _this, bing);
|
|
248
|
+
}
|
|
249
|
+
else {
|
|
250
|
+
_this.renderTileLayer(_this, layer, layerIndex);
|
|
251
|
+
}
|
|
233
252
|
}
|
|
234
253
|
else if (layer.key && layer.key.length > 1) {
|
|
235
254
|
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
@@ -298,6 +317,17 @@ var LayerPanel = /** @class */ (function () {
|
|
|
298
317
|
this.mapObject.baseMapBounds = null;
|
|
299
318
|
}
|
|
300
319
|
};
|
|
320
|
+
LayerPanel.prototype.bingMapCalculation = function (layer, layerIndex, proxy, bing) {
|
|
321
|
+
bing.imageUrl = layer.urlTemplate;
|
|
322
|
+
bing.subDomains = ['t0', 't1', 't2', 't3'];
|
|
323
|
+
bing.maxZoom = '21';
|
|
324
|
+
proxy.mapObject['bingMap'] = bing;
|
|
325
|
+
proxy.renderTileLayer(proxy, layer, layerIndex, bing);
|
|
326
|
+
this.mapObject.arrangeTemplate();
|
|
327
|
+
if (this.mapObject.zoomModule && (this.mapObject.previousScale !== this.mapObject.scale)) {
|
|
328
|
+
this.mapObject.zoomModule.applyTransform(true);
|
|
329
|
+
}
|
|
330
|
+
};
|
|
301
331
|
LayerPanel.prototype.bubbleCalculation = function (bubbleSettings, range) {
|
|
302
332
|
if (bubbleSettings.dataSource != null && bubbleSettings != null) {
|
|
303
333
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -493,60 +523,66 @@ var LayerPanel = /** @class */ (function () {
|
|
|
493
523
|
}
|
|
494
524
|
break;
|
|
495
525
|
case 'LineString':
|
|
496
|
-
path += 'M ' + (currentShapeData[0]['point']['x']) + ' ' + (currentShapeData[0]['point']['y']);
|
|
497
526
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
498
|
-
currentShapeData.map(function (lineData) {
|
|
499
|
-
|
|
527
|
+
currentShapeData.map(function (lineData, index) {
|
|
528
|
+
if (index === 0) {
|
|
529
|
+
path += 'M ' + (lineData['point']['x']) + ' ' + (lineData['point']['y']);
|
|
530
|
+
}
|
|
531
|
+
else {
|
|
532
|
+
path += 'L' + (lineData['point']['x']) + ' , ' + (lineData['point']['y']) + ' ';
|
|
533
|
+
}
|
|
500
534
|
});
|
|
501
535
|
if (path.length > 3) {
|
|
502
|
-
pathOptions = new PathOption(shapeID, 'transparent', !isNullOrUndefined(eventArgs.border.width) ? eventArgs.border.width : 1, eventArgs.
|
|
536
|
+
pathOptions = new PathOption(shapeID, 'transparent', !isNullOrUndefined(eventArgs.border.width) ? eventArgs.border.width : 1, !isNullOrUndefined(eventArgs.fill) ? eventArgs.fill :
|
|
537
|
+
eventArgs.border.color, opacity, eventArgs.border.opacity, shapeSettings.dashArray, path);
|
|
538
|
+
pathEle = _this.mapObject.renderer.drawPath(pathOptions);
|
|
539
|
+
}
|
|
540
|
+
break;
|
|
541
|
+
case 'MultiLineString':
|
|
542
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
543
|
+
currentShapeData.map(function (multilineData) {
|
|
544
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
545
|
+
multilineData.map(function (lineData, index) {
|
|
546
|
+
if (index === 0) {
|
|
547
|
+
path += 'M ' + (lineData['point']['x']) + ' ' + (lineData['point']['y']);
|
|
548
|
+
}
|
|
549
|
+
else {
|
|
550
|
+
path += 'L' + (lineData['point']['x']) + ' , ' + (lineData['point']['y']) + ' ';
|
|
551
|
+
}
|
|
552
|
+
});
|
|
553
|
+
});
|
|
554
|
+
if (path.length > 3) {
|
|
555
|
+
pathOptions = new PathOption(shapeID, 'transparent', !isNullOrUndefined(eventArgs.border.width) ? eventArgs.border.width : 1, !isNullOrUndefined(eventArgs.fill) ? eventArgs.fill :
|
|
556
|
+
eventArgs.border.color, opacity, eventArgs.border.opacity, shapeSettings.dashArray, path);
|
|
503
557
|
pathEle = _this.mapObject.renderer.drawPath(pathOptions);
|
|
504
558
|
}
|
|
505
559
|
break;
|
|
506
560
|
case 'Point':
|
|
507
561
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
508
562
|
var pointData = currentShapeData['point'];
|
|
509
|
-
var circleRadius = (_this.mapObject.layers[layerIndex].type !== 'SubLayer') ? shapeSettings.circleRadius : shapeSettings.circleRadius / _this.currentFactor;
|
|
510
|
-
circleOptions = new CircleOption(shapeID, eventArgs.fill, eventArgs.border, opacity, pointData['x'], pointData['y'], circleRadius,
|
|
563
|
+
var circleRadius = (_this.mapObject.layers[layerIndex].type !== 'SubLayer') ? shapeSettings.circleRadius : shapeSettings.circleRadius / (_this.mapObject.isTileMap ? _this.mapObject.scale : _this.currentFactor);
|
|
564
|
+
circleOptions = new CircleOption(shapeID, eventArgs.fill, eventArgs.border, opacity, pointData['x'], pointData['y'], circleRadius, shapeSettings.dashArray);
|
|
511
565
|
pathEle = _this.mapObject.renderer.drawCircle(circleOptions);
|
|
512
566
|
break;
|
|
567
|
+
case 'MultiPoint':
|
|
568
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
569
|
+
currentShapeData.map(function (multiPointData, index) {
|
|
570
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
571
|
+
var pointData = multiPointData['point'];
|
|
572
|
+
var circleRadius = (_this.mapObject.layers[layerIndex].type !== 'SubLayer') ? shapeSettings.circleRadius : shapeSettings.circleRadius / (_this.mapObject.isTileMap ? _this.mapObject.scale : _this.currentFactor);
|
|
573
|
+
circleOptions = new CircleOption((shapeID + "_multiLine_" + index), eventArgs.fill, eventArgs.border, opacity, pointData['x'], pointData['y'], circleRadius, shapeSettings.dashArray);
|
|
574
|
+
pathEle = _this.mapObject.renderer.drawCircle(circleOptions);
|
|
575
|
+
_this.pathAttributeCalculate(groupElement, pathEle, drawingType, currentShapeData, i);
|
|
576
|
+
});
|
|
577
|
+
break;
|
|
513
578
|
case 'Path':
|
|
514
579
|
path = currentShapeData['point'];
|
|
515
580
|
pathOptions = new PathOption(shapeID, eventArgs.fill, eventArgs.border.width, eventArgs.border.color, opacity, eventArgs.border.opacity, shapeSettings.dashArray, path);
|
|
516
581
|
pathEle = _this.mapObject.renderer.drawPath(pathOptions);
|
|
517
582
|
break;
|
|
518
583
|
}
|
|
519
|
-
if (!isNullOrUndefined(pathEle)) {
|
|
520
|
-
|
|
521
|
-
_this.currentLayer.shapePropertyPath : [_this.currentLayer.shapePropertyPath]);
|
|
522
|
-
var properties = void 0;
|
|
523
|
-
for (var j = 0; j < property.length; j++) {
|
|
524
|
-
if (!isNullOrUndefined(currentShapeData['property'])) {
|
|
525
|
-
properties = property[j];
|
|
526
|
-
break;
|
|
527
|
-
}
|
|
528
|
-
}
|
|
529
|
-
pathEle.setAttribute('aria-label', ((!isNullOrUndefined(currentShapeData['property'])) ?
|
|
530
|
-
(currentShapeData['property'][properties]) : ''));
|
|
531
|
-
pathEle.setAttribute('tabindex', (_this.mapObject.tabIndex + i + 3).toString());
|
|
532
|
-
if (drawingType === 'LineString') {
|
|
533
|
-
pathEle.setAttribute('style', 'outline:none');
|
|
534
|
-
}
|
|
535
|
-
maintainSelection(_this.mapObject.selectedElementId, _this.mapObject.shapeSelectionClass, pathEle, 'ShapeselectionMapStyle');
|
|
536
|
-
if (_this.mapObject.toggledShapeElementId) {
|
|
537
|
-
for (var j = 0; j < _this.mapObject.toggledShapeElementId.length; j++) {
|
|
538
|
-
var styleProperty = _this.mapObject.legendSettings.toggleLegendSettings.applyShapeSettings ?
|
|
539
|
-
_this.currentLayer.shapeSettings : _this.mapObject.legendSettings.toggleLegendSettings;
|
|
540
|
-
if (_this.mapObject.toggledShapeElementId[j] === pathEle.id) {
|
|
541
|
-
pathEle.setAttribute('fill', styleProperty.fill);
|
|
542
|
-
pathEle.setAttribute('stroke', styleProperty.border.color);
|
|
543
|
-
pathEle.setAttribute('fill-opacity', (styleProperty.opacity).toString());
|
|
544
|
-
pathEle.setAttribute('stroke-opacity', (isNullOrUndefined(styleProperty.border.opacity) ? styleProperty.opacity : styleProperty.border.opacity).toString());
|
|
545
|
-
pathEle.setAttribute('stroke-width', (styleProperty.border.width).toString());
|
|
546
|
-
}
|
|
547
|
-
}
|
|
548
|
-
}
|
|
549
|
-
groupElement.appendChild(pathEle);
|
|
584
|
+
if (!isNullOrUndefined(pathEle) && drawingType !== 'MultiPoint') {
|
|
585
|
+
_this.pathAttributeCalculate(groupElement, pathEle, drawingType, currentShapeData, i);
|
|
550
586
|
}
|
|
551
587
|
if (i === _this.currentLayer.layerData.length - 1) {
|
|
552
588
|
_this.layerFeatures(layerIndex, colors, renderData, labelTemplateEle);
|
|
@@ -564,6 +600,49 @@ var LayerPanel = /** @class */ (function () {
|
|
|
564
600
|
this.layerFeatures(layerIndex, colors, renderData, labelTemplateEle);
|
|
565
601
|
}
|
|
566
602
|
};
|
|
603
|
+
/**
|
|
604
|
+
* layer features as bubble, marker, datalabel, navigation line.
|
|
605
|
+
*
|
|
606
|
+
* @param {groupElement} Element - Specifies the element to append the group
|
|
607
|
+
* @param {pathEle} Element - Specifies the svg element
|
|
608
|
+
* @param {drawingType} string - Specifies the data type
|
|
609
|
+
* @param {currentShapeData} any - Specifies the layer of shapedata.
|
|
610
|
+
* @param {index} number - Specifies the tab index.
|
|
611
|
+
* @returns {void}
|
|
612
|
+
*/
|
|
613
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
614
|
+
LayerPanel.prototype.pathAttributeCalculate = function (groupElement, pathEle, drawingType, currentShapeData, index) {
|
|
615
|
+
var property = (Object.prototype.toString.call(this.currentLayer.shapePropertyPath) === '[object Array]' ?
|
|
616
|
+
this.currentLayer.shapePropertyPath : [this.currentLayer.shapePropertyPath]);
|
|
617
|
+
var properties;
|
|
618
|
+
for (var j = 0; j < property.length; j++) {
|
|
619
|
+
if (!isNullOrUndefined(currentShapeData['property'])) {
|
|
620
|
+
properties = property[j];
|
|
621
|
+
break;
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
pathEle.setAttribute('aria-label', ((!isNullOrUndefined(currentShapeData['property'])) ?
|
|
625
|
+
(currentShapeData['property'][properties]) : ''));
|
|
626
|
+
pathEle.setAttribute('tabindex', (this.mapObject.tabIndex + index + 3).toString());
|
|
627
|
+
if (drawingType === 'LineString' || drawingType === 'MultiLineString') {
|
|
628
|
+
pathEle.setAttribute('style', 'outline:none');
|
|
629
|
+
}
|
|
630
|
+
maintainSelection(this.mapObject.selectedElementId, this.mapObject.shapeSelectionClass, pathEle, 'ShapeselectionMapStyle');
|
|
631
|
+
if (this.mapObject.toggledShapeElementId) {
|
|
632
|
+
for (var j = 0; j < this.mapObject.toggledShapeElementId.length; j++) {
|
|
633
|
+
var styleProperty = this.mapObject.legendSettings.toggleLegendSettings.applyShapeSettings ?
|
|
634
|
+
this.currentLayer.shapeSettings : this.mapObject.legendSettings.toggleLegendSettings;
|
|
635
|
+
if (this.mapObject.toggledShapeElementId[j] === pathEle.id) {
|
|
636
|
+
pathEle.setAttribute('fill', styleProperty.fill);
|
|
637
|
+
pathEle.setAttribute('stroke', styleProperty.border.color);
|
|
638
|
+
pathEle.setAttribute('fill-opacity', (styleProperty.opacity).toString());
|
|
639
|
+
pathEle.setAttribute('stroke-opacity', (isNullOrUndefined(styleProperty.border.opacity) ? styleProperty.opacity : styleProperty.border.opacity).toString());
|
|
640
|
+
pathEle.setAttribute('stroke-width', (styleProperty.border.width).toString());
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
groupElement.appendChild(pathEle);
|
|
645
|
+
};
|
|
567
646
|
/**
|
|
568
647
|
* layer features as bubble, marker, datalabel, navigation line.
|
|
569
648
|
*
|
|
@@ -751,7 +830,8 @@ var LayerPanel = /** @class */ (function () {
|
|
|
751
830
|
break;
|
|
752
831
|
case 'linestring':
|
|
753
832
|
var extraSpace_1 = !isNullOrUndefined(this.currentLayer.shapeSettings.border.width) ?
|
|
754
|
-
this.currentLayer.shapeSettings.border.width
|
|
833
|
+
(typeof (this.currentLayer.shapeSettings.border.width) === 'string' ?
|
|
834
|
+
parseInt(this.currentLayer.shapeSettings.border.width, 10) : this.currentLayer.shapeSettings.border.width) : 1;
|
|
755
835
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
756
836
|
coordinates.map(function (points, index) {
|
|
757
837
|
latitude = points[1];
|
|
@@ -766,31 +846,61 @@ var LayerPanel = /** @class */ (function () {
|
|
|
766
846
|
newData['type'] = type;
|
|
767
847
|
this.currentLayer.layerData.push(newData);
|
|
768
848
|
break;
|
|
769
|
-
case '
|
|
770
|
-
var
|
|
771
|
-
|
|
772
|
-
|
|
849
|
+
case 'multilinestring':
|
|
850
|
+
var extraSpaces_1 = !isNullOrUndefined(this.currentLayer.shapeSettings.border.width) ?
|
|
851
|
+
(typeof (this.currentLayer.shapeSettings.border.width) === 'string' ?
|
|
852
|
+
parseInt(this.currentLayer.shapeSettings.border.width, 10) : this.currentLayer.shapeSettings.border.width) : 1;
|
|
853
|
+
var multiLineData_1 = [];
|
|
773
854
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
774
|
-
coordinates.map(function (
|
|
775
|
-
|
|
855
|
+
coordinates.map(function (multiPoints) {
|
|
856
|
+
newData = [];
|
|
857
|
+
multiPoints.map(function (points) {
|
|
776
858
|
latitude = points[1];
|
|
777
859
|
longitude = points[0];
|
|
778
|
-
arrayCollections_1 = true;
|
|
779
860
|
var point = convertGeoToPoint(latitude, longitude, _this.currentFactor, _this.currentLayer, _this.mapObject);
|
|
780
|
-
_this.
|
|
781
|
-
|
|
861
|
+
_this.calculateBox(point, extraSpaces_1);
|
|
862
|
+
newData.push({
|
|
863
|
+
point: point, lat: latitude, lng: longitude
|
|
782
864
|
});
|
|
783
|
-
}
|
|
865
|
+
});
|
|
866
|
+
multiLineData_1.push(newData);
|
|
784
867
|
});
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
868
|
+
multiLineData_1['property'] = properties;
|
|
869
|
+
multiLineData_1['type'] = type;
|
|
870
|
+
this.currentLayer.layerData.push(multiLineData_1);
|
|
871
|
+
break;
|
|
872
|
+
case 'point':
|
|
873
|
+
var pointExtraSpace = (!isNullOrUndefined(this.currentLayer.shapeSettings.border.width) ?
|
|
874
|
+
(typeof (this.currentLayer.shapeSettings.border.width) === 'string' ?
|
|
875
|
+
parseInt(this.currentLayer.shapeSettings.border.width, 10) : this.currentLayer.shapeSettings.border.width) : 1) +
|
|
876
|
+
(this.currentLayer.shapeSettings.circleRadius * 2);
|
|
877
|
+
latitude = coordinates[1];
|
|
878
|
+
longitude = coordinates[0];
|
|
879
|
+
var point = convertGeoToPoint(latitude, longitude, this.currentFactor, this.currentLayer, this.mapObject);
|
|
880
|
+
this.calculateBox(point, pointExtraSpace);
|
|
881
|
+
this.currentLayer.layerData.push({
|
|
882
|
+
point: point, type: type, lat: latitude, lng: longitude, property: properties
|
|
883
|
+
});
|
|
884
|
+
break;
|
|
885
|
+
case 'multipoint': {
|
|
886
|
+
var extraSpace_2 = (!isNullOrUndefined(this.currentLayer.shapeSettings.border.width) ?
|
|
887
|
+
(typeof (this.currentLayer.shapeSettings.border.width) === 'string' ?
|
|
888
|
+
parseInt(this.currentLayer.shapeSettings.border.width, 10) : this.currentLayer.shapeSettings.border.width) : 1) +
|
|
889
|
+
(this.currentLayer.shapeSettings.circleRadius * 2);
|
|
890
|
+
newData = [];
|
|
891
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
892
|
+
coordinates.map(function (points) {
|
|
893
|
+
latitude = points[1];
|
|
894
|
+
longitude = points[0];
|
|
895
|
+
var point = convertGeoToPoint(latitude, longitude, _this.currentFactor, _this.currentLayer, _this.mapObject);
|
|
896
|
+
_this.calculateBox(point, extraSpace_2);
|
|
897
|
+
newData.push({
|
|
898
|
+
point: point, lat: latitude, lng: longitude
|
|
792
899
|
});
|
|
793
|
-
}
|
|
900
|
+
});
|
|
901
|
+
newData['property'] = properties;
|
|
902
|
+
newData['type'] = type;
|
|
903
|
+
this.currentLayer.layerData.push(newData);
|
|
794
904
|
break;
|
|
795
905
|
}
|
|
796
906
|
case 'path':
|
|
@@ -802,12 +912,12 @@ var LayerPanel = /** @class */ (function () {
|
|
|
802
912
|
};
|
|
803
913
|
LayerPanel.prototype.calculateBox = function (point, extraSpace) {
|
|
804
914
|
if (isNullOrUndefined(this.rectBounds)) {
|
|
805
|
-
this.rectBounds = { min: { x: point.x, y: point.y - extraSpace }, max: { x: point.x, y: point.y + extraSpace } };
|
|
915
|
+
this.rectBounds = { min: { x: point.x - extraSpace, y: point.y - extraSpace }, max: { x: point.x + extraSpace, y: point.y + extraSpace } };
|
|
806
916
|
}
|
|
807
917
|
else {
|
|
808
|
-
this.rectBounds['min']['x'] = Math.min(this.rectBounds['min']['x'], point.x);
|
|
918
|
+
this.rectBounds['min']['x'] = Math.min(this.rectBounds['min']['x'], point.x - extraSpace);
|
|
809
919
|
this.rectBounds['min']['y'] = Math.min(this.rectBounds['min']['y'], point.y - extraSpace);
|
|
810
|
-
this.rectBounds['max']['x'] = Math.max(this.rectBounds['max']['x'], point.x);
|
|
920
|
+
this.rectBounds['max']['x'] = Math.max(this.rectBounds['max']['x'], point.x + extraSpace);
|
|
811
921
|
this.rectBounds['max']['y'] = Math.max(this.rectBounds['max']['y'], point.y + extraSpace);
|
|
812
922
|
}
|
|
813
923
|
};
|
|
@@ -825,6 +935,10 @@ var LayerPanel = /** @class */ (function () {
|
|
|
825
935
|
var end = convertGeoToPoint(bounds.latitude.max, bounds.longitude.max, null, layer, this.mapObject);
|
|
826
936
|
mapHeight = end.y - start.y;
|
|
827
937
|
mapWidth = end.x - start.x;
|
|
938
|
+
if (mapHeight === 0 || mapWidth === 0) {
|
|
939
|
+
mapWidth = mapSize.width / 2;
|
|
940
|
+
mapHeight = mapSize.height;
|
|
941
|
+
}
|
|
828
942
|
}
|
|
829
943
|
else {
|
|
830
944
|
mapHeight = mapWidth = 500;
|
|
@@ -919,15 +1033,28 @@ var LayerPanel = /** @class */ (function () {
|
|
|
919
1033
|
_this.calculateRectBox(point[0]);
|
|
920
1034
|
});
|
|
921
1035
|
break;
|
|
1036
|
+
case 'multilinestring':
|
|
1037
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1038
|
+
coordinates.map(function (multiPoint, index) {
|
|
1039
|
+
multiPoint.map(function (point, index) {
|
|
1040
|
+
_this.calculateRectBox(point, 'multilinestring', index === 0 ? true : false);
|
|
1041
|
+
});
|
|
1042
|
+
});
|
|
1043
|
+
break;
|
|
922
1044
|
case 'linestring':
|
|
923
1045
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
924
1046
|
coordinates.map(function (point, index) {
|
|
925
|
-
_this.calculateRectBox(point, '
|
|
1047
|
+
_this.calculateRectBox(point, 'linestring', index === 0 ? true : false);
|
|
926
1048
|
});
|
|
927
1049
|
break;
|
|
928
1050
|
case 'point':
|
|
929
1051
|
_this.calculateRectBox(coordinates, 'point');
|
|
930
1052
|
break;
|
|
1053
|
+
case 'multipoint':
|
|
1054
|
+
coordinates.map(function (point, index) {
|
|
1055
|
+
_this.calculateRectBox(point, 'multipoint', index === 0 ? true : false);
|
|
1056
|
+
});
|
|
1057
|
+
break;
|
|
931
1058
|
}
|
|
932
1059
|
}
|
|
933
1060
|
});
|
|
@@ -966,7 +1093,7 @@ var LayerPanel = /** @class */ (function () {
|
|
|
966
1093
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
967
1094
|
LayerPanel.prototype.calculateRectBox = function (coordinates, type, isFirstItem) {
|
|
968
1095
|
var _this = this;
|
|
969
|
-
if (type !== '
|
|
1096
|
+
if ((type !== 'linestring' && type !== 'multilinestring') && (type !== 'point' && type !== 'multipoint')) {
|
|
970
1097
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
971
1098
|
Array.prototype.forEach.call(coordinates, function (currentCoords) {
|
|
972
1099
|
if (isNullOrUndefined(_this.mapObject.baseMapBounds)) {
|
|
@@ -1035,7 +1162,7 @@ var LayerPanel = /** @class */ (function () {
|
|
|
1035
1162
|
var tile = new Tile(tileI % ycount, j);
|
|
1036
1163
|
tile.left = x;
|
|
1037
1164
|
tile.top = y;
|
|
1038
|
-
if (baseLayer.layerType === 'Bing') {
|
|
1165
|
+
if (baseLayer.layerType === 'Bing' || (bing && !isNullOrUndefined(baseLayer.urlTemplate) && baseLayer.urlTemplate !== '')) {
|
|
1039
1166
|
var key = baseLayer.key;
|
|
1040
1167
|
tile.src = bing.getBingMap(tile, key, baseLayer.bingMapType, userLang, bing.imageUrl, bing.subDomains);
|
|
1041
1168
|
}
|
|
@@ -1064,11 +1191,13 @@ var LayerPanel = /** @class */ (function () {
|
|
|
1064
1191
|
if (!(layer.type === 'SubLayer' && layer.visible)) {
|
|
1065
1192
|
continue;
|
|
1066
1193
|
}
|
|
1067
|
-
if (layer.layerType
|
|
1194
|
+
if ((layer.layerType !== 'Geometry' && layer.layerType !== 'GoogleStaticMap') || (layer.layerType === 'Geometry' &&
|
|
1195
|
+
isNullOrUndefined(layer.shapeData) && !isNullOrUndefined(layer.urlTemplate) && layer.urlTemplate !== '')) {
|
|
1068
1196
|
for (var _b = 0, proxTiles_1 = proxTiles; _b < proxTiles_1.length; _b++) {
|
|
1069
1197
|
var baseTile = proxTiles_1[_b];
|
|
1070
1198
|
var subtile = extend({}, baseTile, {}, true);
|
|
1071
1199
|
if (layer.layerType === 'Bing') {
|
|
1200
|
+
bing = new BingMap(this.mapObject);
|
|
1072
1201
|
subtile.src = bing.getBingMap(subtile, layer.key, layer.bingMapType, userLang, bing.imageUrl, bing.subDomains);
|
|
1073
1202
|
}
|
|
1074
1203
|
else {
|
|
@@ -1128,6 +1257,8 @@ var LayerPanel = /** @class */ (function () {
|
|
|
1128
1257
|
var id = 0;
|
|
1129
1258
|
var _loop_3 = function (tile) {
|
|
1130
1259
|
var imgElement = createElement('img');
|
|
1260
|
+
imgElement.setAttribute('height', '256px');
|
|
1261
|
+
imgElement.setAttribute('width', '256px');
|
|
1131
1262
|
imgElement.setAttribute('src', tile.src);
|
|
1132
1263
|
var mapId = _this.mapObject.element.id;
|
|
1133
1264
|
imgElement.onload = function () {
|