@syncfusion/ej2-maps 19.3.53 → 19.4.48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/PULL_REQUEST_TEMPLATE/Bug.md +72 -0
- package/.github/PULL_REQUEST_TEMPLATE/Feature.md +49 -0
- package/CHANGELOG.md +42 -1
- package/README.md +1 -1
- package/dist/ej2-maps.umd.min.js +2 -2
- package/dist/ej2-maps.umd.min.js.map +1 -1
- package/dist/es6/ej2-maps.es2015.js +663 -293
- package/dist/es6/ej2-maps.es2015.js.map +1 -1
- package/dist/es6/ej2-maps.es5.js +659 -289
- package/dist/es6/ej2-maps.es5.js.map +1 -1
- package/dist/global/ej2-maps.min.js +2 -2
- package/dist/global/ej2-maps.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +12 -12
- package/src/maps/layers/bubble.d.ts +6 -0
- package/src/maps/layers/bubble.js +7 -1
- package/src/maps/layers/data-label.js +1 -0
- package/src/maps/layers/layer-panel.d.ts +2 -1
- package/src/maps/layers/layer-panel.js +89 -52
- package/src/maps/layers/legend.d.ts +41 -2
- package/src/maps/layers/legend.js +90 -29
- package/src/maps/layers/marker.js +2 -8
- package/src/maps/maps-model.d.ts +1 -1
- package/src/maps/maps.d.ts +8 -0
- package/src/maps/maps.js +142 -19
- package/src/maps/model/base-model.d.ts +7 -0
- package/src/maps/model/base.d.ts +6 -0
- package/src/maps/model/base.js +5 -2
- package/src/maps/model/interface.d.ts +1 -3
- package/src/maps/model/theme.js +62 -5
- package/src/maps/user-interaction/highlight.d.ts +9 -1
- package/src/maps/user-interaction/highlight.js +22 -15
- package/src/maps/user-interaction/selection.d.ts +9 -1
- package/src/maps/user-interaction/selection.js +27 -19
- package/src/maps/user-interaction/tooltip.js +9 -3
- package/src/maps/user-interaction/zoom.d.ts +5 -1
- package/src/maps/user-interaction/zoom.js +82 -45
- package/src/maps/utils/enum.d.ts +3 -1
- package/src/maps/utils/helper.d.ts +4 -2
- package/src/maps/utils/helper.js +130 -98
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.48
|
|
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.47",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512-
|
|
5
|
+
"_integrity": "sha512-gFY2cYlS0ul2u+VnTBMpp7y3/9IXBZUOaCFTosfzKgBc0twsoKiTyqkVR6kPqdlzE3WnEjjv8PlTlGZtICjesg==",
|
|
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.47.tgz",
|
|
27
|
+
"_shasum": "53a776c701d92b8a6699ce476823e6f8a2474cc0",
|
|
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.48",
|
|
39
|
+
"@syncfusion/ej2-buttons": "~19.4.48",
|
|
40
|
+
"@syncfusion/ej2-compression": "~19.4.48",
|
|
41
|
+
"@syncfusion/ej2-data": "~19.4.48",
|
|
42
|
+
"@syncfusion/ej2-file-utils": "~19.4.48",
|
|
43
|
+
"@syncfusion/ej2-pdf-export": "~19.4.48",
|
|
44
|
+
"@syncfusion/ej2-svg-base": "~19.4.48"
|
|
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.48",
|
|
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
|
/**
|
|
@@ -18,6 +18,8 @@ var Bubble = /** @class */ (function () {
|
|
|
18
18
|
// eslint-disable-next-line valid-jsdoc
|
|
19
19
|
/**
|
|
20
20
|
* To render bubble
|
|
21
|
+
*
|
|
22
|
+
* @private
|
|
21
23
|
*/
|
|
22
24
|
Bubble.prototype.renderBubble = function (
|
|
23
25
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -63,7 +65,7 @@ var Bubble = /** @class */ (function () {
|
|
|
63
65
|
isNaN(shapeData[layer.shapeDataPath]) ? shapeData[layer.shapeDataPath].toLowerCase() : shapeData[layer.shapeDataPath];
|
|
64
66
|
var shapePathValue = !isNullOrUndefined(shape[shapePath]) && isNaN(shape[shapePath])
|
|
65
67
|
? shape[shapePath].toLowerCase() : shape[shapePath];
|
|
66
|
-
if (shapeDataLayerPathValue === shapePathValue) {
|
|
68
|
+
if (shapeDataLayerPathValue === shapePathValue && layerData[i].type !== 'LineString') {
|
|
67
69
|
if (layerData[i]['type'] === 'Point') {
|
|
68
70
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
69
71
|
shapePoints.push(this.getPoints(layerData[i], []));
|
|
@@ -194,6 +196,8 @@ var Bubble = /** @class */ (function () {
|
|
|
194
196
|
// eslint-disable-next-line valid-jsdoc
|
|
195
197
|
/**
|
|
196
198
|
* To check and trigger bubble click event
|
|
199
|
+
*
|
|
200
|
+
* @private
|
|
197
201
|
*/
|
|
198
202
|
Bubble.prototype.bubbleClick = function (e) {
|
|
199
203
|
var target = e.target.id;
|
|
@@ -237,6 +241,8 @@ var Bubble = /** @class */ (function () {
|
|
|
237
241
|
// eslint-disable-next-line valid-jsdoc
|
|
238
242
|
/**
|
|
239
243
|
* To check and trigger bubble move event
|
|
244
|
+
*
|
|
245
|
+
* @private
|
|
240
246
|
*/
|
|
241
247
|
Bubble.prototype.bubbleMove = function (e) {
|
|
242
248
|
var target = e.target.id;
|
|
@@ -267,6 +267,7 @@ var DataLabel = /** @class */ (function () {
|
|
|
267
267
|
}
|
|
268
268
|
else {
|
|
269
269
|
if (dataLabelSettings.smartLabelMode === 'Trim') {
|
|
270
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
270
271
|
var textType = typeof text === 'number' ? text.toString() : text;
|
|
271
272
|
trimmedLable = textTrim(width, textType, style);
|
|
272
273
|
elementSize = measureText(trimmedLable, style);
|
|
@@ -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
|
/**
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
5
5
|
import { isNullOrUndefined, extend, createElement, Ajax } from '@syncfusion/ej2-base';
|
|
6
6
|
import { getShapeColor } from '../model/theme';
|
|
7
|
-
import { GeoLocation, isCustomPath, convertGeoToPoint, Point, PathOption, Size,
|
|
7
|
+
import { GeoLocation, isCustomPath, convertGeoToPoint, Point, PathOption, Size, removeElement } from '../utils/helper';
|
|
8
8
|
import { getElementByID, maintainSelection, getValueFromObject } from '../utils/helper';
|
|
9
9
|
import { RectOption, getTranslate, convertTileLatLongToPoint, checkShapeDataFields, CircleOption } from '../utils/helper';
|
|
10
10
|
import { getZoomTranslate, fixInitialScaleForTile } from '../utils/helper';
|
|
@@ -56,7 +56,8 @@ 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: (areaRect.height < 0) ? 0 :
|
|
59
|
+
width: areaRect.width, height: (areaRect.height < 0) ? 0 : !isNullOrUndefined(this.mapObject.legendModule) &&
|
|
60
|
+
this.mapObject.legendModule.totalPages.length > 0 ? this.mapObject.legendModule.legendTotalRect.height : areaRect.height
|
|
60
61
|
}));
|
|
61
62
|
}
|
|
62
63
|
this.layerGroup.appendChild(this.clipRectElement);
|
|
@@ -178,7 +179,7 @@ var LayerPanel = /** @class */ (function () {
|
|
|
178
179
|
if (this.mapObject.zoomSettings.resetToInitial && this.mapObject.initialCheck && !isNullOrUndefined(panel.mapObject.height)
|
|
179
180
|
&& this.mapObject.availableSize.height > 512) {
|
|
180
181
|
this.mapObject.applyZoomReset = true;
|
|
181
|
-
this.mapObject.initialZoomLevel = Math.floor(this.mapObject.availableSize.height / 512)
|
|
182
|
+
this.mapObject.initialZoomLevel = Math.floor(this.mapObject.availableSize.height / 512);
|
|
182
183
|
var padding = this.mapObject.layers[this.mapObject.baseLayerIndex].layerType !== 'GoogleStaticMap' ?
|
|
183
184
|
20 : 0;
|
|
184
185
|
var totalSize = Math.pow(2, this.mapObject.initialZoomLevel) * 256;
|
|
@@ -260,6 +261,9 @@ var LayerPanel = /** @class */ (function () {
|
|
|
260
261
|
proxy_1.mapObject['bingMap'] = bing_1;
|
|
261
262
|
proxy_1.renderTileLayer(proxy_1, layer, layerIndex, bing_1);
|
|
262
263
|
_this.mapObject.arrangeTemplate();
|
|
264
|
+
if (_this.mapObject.zoomModule && (_this.mapObject.previousScale !== _this.mapObject.scale)) {
|
|
265
|
+
_this.mapObject.zoomModule.applyTransform(true);
|
|
266
|
+
}
|
|
263
267
|
};
|
|
264
268
|
ajax.send();
|
|
265
269
|
}
|
|
@@ -338,9 +342,7 @@ var LayerPanel = /** @class */ (function () {
|
|
|
338
342
|
var data = geometryData['geometry'];
|
|
339
343
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
340
344
|
var properties = geometryData['properties'];
|
|
341
|
-
|
|
342
|
-
_this.generatePoints(type, coords, data, properties);
|
|
343
|
-
}
|
|
345
|
+
_this.generatePoints(type, coords, data, properties);
|
|
344
346
|
}
|
|
345
347
|
});
|
|
346
348
|
this.currentLayer.rectBounds = this.rectBounds;
|
|
@@ -368,7 +370,7 @@ var LayerPanel = /** @class */ (function () {
|
|
|
368
370
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
369
371
|
var currentShapeData = this_1.currentLayer.layerData[i];
|
|
370
372
|
var pathOptions;
|
|
371
|
-
var polyLineOptions;
|
|
373
|
+
var polyLineOptions = void 0;
|
|
372
374
|
var circleOptions;
|
|
373
375
|
var groupElement;
|
|
374
376
|
var drawObject = void 0;
|
|
@@ -437,7 +439,7 @@ var LayerPanel = /** @class */ (function () {
|
|
|
437
439
|
if (isNullOrUndefined(shapeSettings.borderColorValuePath)) {
|
|
438
440
|
_this.mapObject.layers[layerIndex].shapeSettings.border.color = eventArgs.border.color;
|
|
439
441
|
}
|
|
440
|
-
|
|
442
|
+
if (isNullOrUndefined(shapeSettings.borderWidthValuePath)) {
|
|
441
443
|
_this.mapObject.layers[layerIndex].shapeSettings.border.width = eventArgs.border.width;
|
|
442
444
|
}
|
|
443
445
|
}
|
|
@@ -491,17 +493,21 @@ var LayerPanel = /** @class */ (function () {
|
|
|
491
493
|
}
|
|
492
494
|
break;
|
|
493
495
|
case 'LineString':
|
|
496
|
+
path += 'M ' + (currentShapeData[0]['point']['x']) + ' ' + (currentShapeData[0]['point']['y']);
|
|
494
497
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
495
498
|
currentShapeData.map(function (lineData) {
|
|
496
|
-
|
|
499
|
+
path += 'L' + (lineData['point']['x']) + ' , ' + (lineData['point']['y']) + ' ';
|
|
497
500
|
});
|
|
498
|
-
|
|
499
|
-
|
|
501
|
+
if (path.length > 3) {
|
|
502
|
+
pathOptions = new PathOption(shapeID, 'transparent', !isNullOrUndefined(eventArgs.border.width) ? eventArgs.border.width : 1, eventArgs.border.color, opacity, eventArgs.border.opacity, shapeSettings.dashArray, path);
|
|
503
|
+
pathEle = _this.mapObject.renderer.drawPath(pathOptions);
|
|
504
|
+
}
|
|
500
505
|
break;
|
|
501
506
|
case 'Point':
|
|
502
507
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
503
508
|
var pointData = currentShapeData['point'];
|
|
504
|
-
|
|
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, null);
|
|
505
511
|
pathEle = _this.mapObject.renderer.drawCircle(circleOptions);
|
|
506
512
|
break;
|
|
507
513
|
case 'Path':
|
|
@@ -522,7 +528,10 @@ var LayerPanel = /** @class */ (function () {
|
|
|
522
528
|
}
|
|
523
529
|
pathEle.setAttribute('aria-label', ((!isNullOrUndefined(currentShapeData['property'])) ?
|
|
524
530
|
(currentShapeData['property'][properties]) : ''));
|
|
525
|
-
pathEle.setAttribute('tabindex', (_this.mapObject.tabIndex + i +
|
|
531
|
+
pathEle.setAttribute('tabindex', (_this.mapObject.tabIndex + i + 3).toString());
|
|
532
|
+
if (drawingType === 'LineString') {
|
|
533
|
+
pathEle.setAttribute('style', 'outline:none');
|
|
534
|
+
}
|
|
526
535
|
maintainSelection(_this.mapObject.selectedElementId, _this.mapObject.shapeSelectionClass, pathEle, 'ShapeselectionMapStyle');
|
|
527
536
|
if (_this.mapObject.toggledShapeElementId) {
|
|
528
537
|
for (var j = 0; j < _this.mapObject.toggledShapeElementId.length; j++) {
|
|
@@ -741,11 +750,14 @@ var LayerPanel = /** @class */ (function () {
|
|
|
741
750
|
this.currentLayer.layerData.push(multiPolygonDatas);
|
|
742
751
|
break;
|
|
743
752
|
case 'linestring':
|
|
753
|
+
var extraSpace_1 = !isNullOrUndefined(this.currentLayer.shapeSettings.border.width) ?
|
|
754
|
+
this.currentLayer.shapeSettings.border.width : 1;
|
|
744
755
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
745
756
|
coordinates.map(function (points, index) {
|
|
746
757
|
latitude = points[1];
|
|
747
758
|
longitude = points[0];
|
|
748
759
|
var point = convertGeoToPoint(latitude, longitude, _this.currentFactor, _this.currentLayer, _this.mapObject);
|
|
760
|
+
_this.calculateBox(point, extraSpace_1);
|
|
749
761
|
newData.push({
|
|
750
762
|
point: point, lat: latitude, lng: longitude
|
|
751
763
|
});
|
|
@@ -756,6 +768,8 @@ var LayerPanel = /** @class */ (function () {
|
|
|
756
768
|
break;
|
|
757
769
|
case 'point': {
|
|
758
770
|
var arrayCollections_1 = false;
|
|
771
|
+
var extraSpace_2 = (!isNullOrUndefined(this.currentLayer.shapeSettings.border.width) ?
|
|
772
|
+
this.currentLayer.shapeSettings.border.width : 1) + (this.currentLayer.shapeSettings.circleRadius * 2);
|
|
759
773
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
760
774
|
coordinates.map(function (points, index) {
|
|
761
775
|
if (Object.prototype.toString.call(points) === '[object Array]') {
|
|
@@ -772,6 +786,7 @@ var LayerPanel = /** @class */ (function () {
|
|
|
772
786
|
latitude = coordinates[1];
|
|
773
787
|
longitude = coordinates[0];
|
|
774
788
|
var point = convertGeoToPoint(latitude, longitude, this.currentFactor, this.currentLayer, this.mapObject);
|
|
789
|
+
this.calculateBox(point, extraSpace_2);
|
|
775
790
|
this.currentLayer.layerData.push({
|
|
776
791
|
point: point, type: type, lat: latitude, lng: longitude, property: properties
|
|
777
792
|
});
|
|
@@ -785,6 +800,17 @@ var LayerPanel = /** @class */ (function () {
|
|
|
785
800
|
break;
|
|
786
801
|
}
|
|
787
802
|
};
|
|
803
|
+
LayerPanel.prototype.calculateBox = function (point, extraSpace) {
|
|
804
|
+
if (isNullOrUndefined(this.rectBounds)) {
|
|
805
|
+
this.rectBounds = { min: { x: point.x, y: point.y - extraSpace }, max: { x: point.x, y: point.y + extraSpace } };
|
|
806
|
+
}
|
|
807
|
+
else {
|
|
808
|
+
this.rectBounds['min']['x'] = Math.min(this.rectBounds['min']['x'], point.x);
|
|
809
|
+
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);
|
|
811
|
+
this.rectBounds['max']['y'] = Math.max(this.rectBounds['max']['y'], point.y + extraSpace);
|
|
812
|
+
}
|
|
813
|
+
};
|
|
788
814
|
LayerPanel.prototype.calculateFactor = function (layer) {
|
|
789
815
|
var horFactor;
|
|
790
816
|
var verFactor = 1;
|
|
@@ -893,6 +919,15 @@ var LayerPanel = /** @class */ (function () {
|
|
|
893
919
|
_this.calculateRectBox(point[0]);
|
|
894
920
|
});
|
|
895
921
|
break;
|
|
922
|
+
case 'linestring':
|
|
923
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
924
|
+
coordinates.map(function (point, index) {
|
|
925
|
+
_this.calculateRectBox(point, 'LineString', index === 0 ? true : false);
|
|
926
|
+
});
|
|
927
|
+
break;
|
|
928
|
+
case 'point':
|
|
929
|
+
_this.calculateRectBox(coordinates, 'point');
|
|
930
|
+
break;
|
|
896
931
|
}
|
|
897
932
|
}
|
|
898
933
|
});
|
|
@@ -929,20 +964,33 @@ var LayerPanel = /** @class */ (function () {
|
|
|
929
964
|
return newData;
|
|
930
965
|
};
|
|
931
966
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
932
|
-
LayerPanel.prototype.calculateRectBox = function (coordinates) {
|
|
967
|
+
LayerPanel.prototype.calculateRectBox = function (coordinates, type, isFirstItem) {
|
|
933
968
|
var _this = this;
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
_this.mapObject.baseMapBounds
|
|
969
|
+
if (type !== 'LineString' && type !== 'point') {
|
|
970
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
971
|
+
Array.prototype.forEach.call(coordinates, function (currentCoords) {
|
|
972
|
+
if (isNullOrUndefined(_this.mapObject.baseMapBounds)) {
|
|
973
|
+
_this.mapObject.baseMapBounds = new GeoLocation({ min: currentCoords[1], max: currentCoords[1] }, { min: currentCoords[0], max: currentCoords[0] });
|
|
974
|
+
}
|
|
975
|
+
else {
|
|
976
|
+
_this.mapObject.baseMapBounds.latitude.min = Math.min(_this.mapObject.baseMapBounds.latitude.min, currentCoords[1]);
|
|
977
|
+
_this.mapObject.baseMapBounds.latitude.max = Math.max(_this.mapObject.baseMapBounds.latitude.max, currentCoords[1]);
|
|
978
|
+
_this.mapObject.baseMapBounds.longitude.min = Math.min(_this.mapObject.baseMapBounds.longitude.min, currentCoords[0]);
|
|
979
|
+
_this.mapObject.baseMapBounds.longitude.max = Math.max(_this.mapObject.baseMapBounds.longitude.max, currentCoords[0]);
|
|
980
|
+
}
|
|
981
|
+
});
|
|
982
|
+
}
|
|
983
|
+
else {
|
|
984
|
+
if ((isFirstItem || type === 'point') && isNullOrUndefined(this.mapObject.baseMapBounds)) {
|
|
985
|
+
this.mapObject.baseMapBounds = new GeoLocation({ min: coordinates[1], max: coordinates[1] }, { min: coordinates[0], max: coordinates[0] });
|
|
938
986
|
}
|
|
939
987
|
else {
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
988
|
+
this.mapObject.baseMapBounds.latitude.min = Math.min(this.mapObject.baseMapBounds.latitude.min, coordinates[1]);
|
|
989
|
+
this.mapObject.baseMapBounds.latitude.max = Math.max(this.mapObject.baseMapBounds.latitude.max, coordinates[1]);
|
|
990
|
+
this.mapObject.baseMapBounds.longitude.min = Math.min(this.mapObject.baseMapBounds.longitude.min, coordinates[0]);
|
|
991
|
+
this.mapObject.baseMapBounds.longitude.max = Math.max(this.mapObject.baseMapBounds.longitude.max, coordinates[0]);
|
|
944
992
|
}
|
|
945
|
-
}
|
|
993
|
+
}
|
|
946
994
|
};
|
|
947
995
|
LayerPanel.prototype.generateTiles = function (zoomLevel, tileTranslatePoint, zoomType, bing, position) {
|
|
948
996
|
var userLang = this.mapObject.locale;
|
|
@@ -1031,16 +1079,18 @@ var LayerPanel = /** @class */ (function () {
|
|
|
1031
1079
|
}
|
|
1032
1080
|
}
|
|
1033
1081
|
}
|
|
1034
|
-
this.
|
|
1082
|
+
if (this.mapObject.previousScale !== this.mapObject.scale || this.mapObject.isReset) {
|
|
1083
|
+
this.arrangeTiles(zoomType, this.animateToZoomX, this.animateToZoomY);
|
|
1084
|
+
}
|
|
1035
1085
|
};
|
|
1036
1086
|
LayerPanel.prototype.arrangeTiles = function (type, x, y) {
|
|
1037
1087
|
var _this = this;
|
|
1038
1088
|
var element = document.getElementById(this.mapObject.element.id + '_tile_parent');
|
|
1039
1089
|
var element1 = document.getElementById(this.mapObject.element.id + '_tiles');
|
|
1040
1090
|
var timeOut;
|
|
1041
|
-
if (!isNullOrUndefined(type) && type !== 'Pan'
|
|
1091
|
+
if (!isNullOrUndefined(type) && type !== 'Pan') {
|
|
1042
1092
|
this.tileAnimation(type, x, y);
|
|
1043
|
-
timeOut =
|
|
1093
|
+
timeOut = this.mapObject.layersCollection[0].animationDuration;
|
|
1044
1094
|
}
|
|
1045
1095
|
else {
|
|
1046
1096
|
timeOut = 0;
|
|
@@ -1055,7 +1105,6 @@ var LayerPanel = /** @class */ (function () {
|
|
|
1055
1105
|
}
|
|
1056
1106
|
if (element1) {
|
|
1057
1107
|
element1.style.zIndex = '0';
|
|
1058
|
-
element1.style.visibility = 'hidden';
|
|
1059
1108
|
}
|
|
1060
1109
|
var animateElement;
|
|
1061
1110
|
if (!document.getElementById(_this.mapObject.element.id + '_animated_tiles') && element) {
|
|
@@ -1117,35 +1166,23 @@ var LayerPanel = /** @class */ (function () {
|
|
|
1117
1166
|
* @returns {void}
|
|
1118
1167
|
*/
|
|
1119
1168
|
LayerPanel.prototype.tileAnimation = function (zoomType, translateX, translateY) {
|
|
1120
|
-
var
|
|
1121
|
-
var
|
|
1122
|
-
var
|
|
1169
|
+
var tileParent = document.getElementById(this.mapObject.element.id + '_tile_parent');
|
|
1170
|
+
var animatedTiles = document.getElementById(this.mapObject.element.id + '_animated_tiles');
|
|
1171
|
+
var tileElement = document.getElementById(this.mapObject.element.id + '_tiles');
|
|
1123
1172
|
var scaleValue = '2';
|
|
1124
|
-
if (zoomType.indexOf('ZoomOut') === 0) {
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
ele.removeChild(ele.children[0]);
|
|
1130
|
-
}
|
|
1131
|
-
translateX = 0;
|
|
1132
|
-
translateY = 128 - 23;
|
|
1133
|
-
scaleValue = '0.5';
|
|
1134
|
-
}
|
|
1135
|
-
else if (zoomType === 'Reset') {
|
|
1136
|
-
ele.style.zIndex = '1';
|
|
1137
|
-
element.style.zIndex = '0';
|
|
1138
|
-
while (!(ele.childElementCount === 1) && !(ele.childElementCount === 0)) {
|
|
1139
|
-
ele.removeChild(ele.children[1]);
|
|
1173
|
+
if (zoomType.indexOf('ZoomOut') === 0 || zoomType === 'Reset') {
|
|
1174
|
+
tileElement.style.zIndex = '1';
|
|
1175
|
+
tileParent.style.zIndex = '0';
|
|
1176
|
+
while (tileElement.childElementCount >= 1) {
|
|
1177
|
+
tileElement.removeChild(tileElement.children[0]);
|
|
1140
1178
|
}
|
|
1141
|
-
element1 = ele.children[0];
|
|
1142
1179
|
translateX = 0;
|
|
1143
|
-
translateY = 0;
|
|
1144
|
-
scaleValue = '
|
|
1180
|
+
translateY = document.getElementById(this.mapObject.element.id + '_tile_parent').getClientRects()[0].height / 4;
|
|
1181
|
+
scaleValue = zoomType.indexOf('ZoomOut') === 0 ? '0.5' : '0.2';
|
|
1145
1182
|
}
|
|
1146
|
-
if (!isNullOrUndefined(
|
|
1147
|
-
|
|
1148
|
-
|
|
1183
|
+
if (!isNullOrUndefined(animatedTiles)) {
|
|
1184
|
+
animatedTiles.style.transition = this.mapObject.layersCollection[0].animationDuration + 'ms';
|
|
1185
|
+
animatedTiles.style.transform = 'translate(' + translateX + 'px, ' + translateY + 'px) scale(' + scaleValue + ')';
|
|
1149
1186
|
}
|
|
1150
1187
|
};
|
|
1151
1188
|
/**
|
|
@@ -7,10 +7,23 @@ import { ShapeSettings } from '../model/base';
|
|
|
7
7
|
* Legend module is used to render legend for the maps
|
|
8
8
|
*/
|
|
9
9
|
export declare class Legend {
|
|
10
|
+
/**
|
|
11
|
+
* @private
|
|
12
|
+
*/
|
|
10
13
|
legendCollection: any[];
|
|
14
|
+
/**
|
|
15
|
+
* @private
|
|
16
|
+
*/
|
|
11
17
|
legendRenderingCollections: any[];
|
|
12
18
|
private translate;
|
|
19
|
+
/**
|
|
20
|
+
* @private
|
|
21
|
+
*/
|
|
13
22
|
legendBorderRect: Rect;
|
|
23
|
+
/**
|
|
24
|
+
* @private
|
|
25
|
+
*/
|
|
26
|
+
legendTotalRect: Rect;
|
|
14
27
|
private maps;
|
|
15
28
|
/**
|
|
16
29
|
* @private
|
|
@@ -25,16 +38,37 @@ export declare class Legend {
|
|
|
25
38
|
private heightIncrement;
|
|
26
39
|
private widthIncrement;
|
|
27
40
|
private textMaxWidth;
|
|
28
|
-
|
|
41
|
+
/**
|
|
42
|
+
* @private
|
|
43
|
+
*/
|
|
44
|
+
legendGroup: Element;
|
|
29
45
|
private shapeHighlightCollection;
|
|
46
|
+
/**
|
|
47
|
+
* @private
|
|
48
|
+
*/
|
|
30
49
|
legendHighlightCollection: any[];
|
|
50
|
+
/**
|
|
51
|
+
* @private
|
|
52
|
+
*/
|
|
31
53
|
shapePreviousColor: string[];
|
|
54
|
+
/**
|
|
55
|
+
* @private
|
|
56
|
+
*/
|
|
32
57
|
selectedNonLegendShapes: any[];
|
|
58
|
+
/**
|
|
59
|
+
* @private
|
|
60
|
+
*/
|
|
33
61
|
shapeToggled: boolean;
|
|
34
62
|
private legendLinearGradient;
|
|
35
63
|
private currentLayer;
|
|
36
64
|
private defsElement;
|
|
65
|
+
/**
|
|
66
|
+
* @private
|
|
67
|
+
*/
|
|
37
68
|
legendElement: Element[];
|
|
69
|
+
/**
|
|
70
|
+
* @private
|
|
71
|
+
*/
|
|
38
72
|
oldShapeElement: Element;
|
|
39
73
|
constructor(maps: Maps);
|
|
40
74
|
/**
|
|
@@ -63,7 +97,12 @@ export declare class Legend {
|
|
|
63
97
|
* To draw the legend shape and text.
|
|
64
98
|
*/
|
|
65
99
|
drawLegend(): void;
|
|
66
|
-
|
|
100
|
+
/**
|
|
101
|
+
* @param {string} page - Specifies the legend page.
|
|
102
|
+
* @returns {void}
|
|
103
|
+
* @private
|
|
104
|
+
*/
|
|
105
|
+
drawLegendItem(page: number): void;
|
|
67
106
|
legendHighLightAndSelection(targetElement: Element, value: string): void;
|
|
68
107
|
private setColor;
|
|
69
108
|
pushCollection(targetElement: Element, collection: any[], oldElement: any, shapeSettings: ShapeSettings): void;
|