@syncfusion/ej2-maps 20.3.49 → 20.4.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/.eslintrc.json +16 -1
- package/CHANGELOG.md +19 -0
- package/README.md +65 -51
- package/dist/ej2-maps.min.js +2 -2
- package/dist/ej2-maps.umd.min.js +2 -2
- package/dist/ej2-maps.umd.min.js.map +1 -1
- package/dist/es6/ej2-maps.es2015.js +1030 -781
- package/dist/es6/ej2-maps.es2015.js.map +1 -1
- package/dist/es6/ej2-maps.es5.js +1017 -772
- 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 +34 -21
- package/src/maps/layers/bing-map.d.ts +1 -0
- package/src/maps/layers/bing-map.js +1 -0
- package/src/maps/layers/bubble.d.ts +4 -0
- package/src/maps/layers/bubble.js +7 -3
- package/src/maps/layers/color-mapping.d.ts +5 -0
- package/src/maps/layers/color-mapping.js +5 -3
- package/src/maps/layers/data-label.d.ts +0 -1
- package/src/maps/layers/data-label.js +13 -14
- package/src/maps/layers/layer-panel.d.ts +7 -7
- package/src/maps/layers/layer-panel.js +119 -72
- package/src/maps/layers/legend.js +30 -25
- package/src/maps/layers/marker.d.ts +13 -0
- package/src/maps/layers/marker.js +133 -115
- package/src/maps/layers/navigation-selected-line.d.ts +5 -0
- package/src/maps/layers/navigation-selected-line.js +70 -65
- package/src/maps/maps-model.d.ts +1 -1
- package/src/maps/maps.d.ts +19 -0
- package/src/maps/maps.js +469 -382
- package/src/maps/model/base.js +2 -2
- package/src/maps/model/export-image.d.ts +4 -3
- package/src/maps/model/export-image.js +7 -6
- package/src/maps/model/export-pdf.d.ts +6 -6
- package/src/maps/model/export-pdf.js +8 -7
- package/src/maps/model/interface.d.ts +2 -2
- package/src/maps/model/print.d.ts +4 -2
- package/src/maps/model/print.js +6 -3
- package/src/maps/user-interaction/annotation.js +2 -3
- package/src/maps/user-interaction/highlight.js +37 -13
- package/src/maps/user-interaction/selection.js +4 -2
- package/src/maps/user-interaction/tooltip.js +8 -8
- package/src/maps/user-interaction/zoom.d.ts +5 -0
- package/src/maps/user-interaction/zoom.js +39 -29
- package/src/maps/utils/helper.d.ts +2 -0
- package/src/maps/utils/helper.js +58 -45
package/src/maps/model/base.js
CHANGED
|
@@ -17,7 +17,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
17
17
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
18
18
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
19
19
|
};
|
|
20
|
-
/* eslint-disable
|
|
20
|
+
/* eslint-disable max-len */
|
|
21
21
|
/**
|
|
22
22
|
* Maps base document
|
|
23
23
|
*/
|
|
@@ -598,7 +598,7 @@ var ZoomSettings = /** @class */ (function (_super) {
|
|
|
598
598
|
Property(false)
|
|
599
599
|
], ZoomSettings.prototype, "doubleClickZoom", void 0);
|
|
600
600
|
__decorate([
|
|
601
|
-
Property(
|
|
601
|
+
Property(true)
|
|
602
602
|
], ZoomSettings.prototype, "pinchZooming", void 0);
|
|
603
603
|
__decorate([
|
|
604
604
|
Property(false)
|
|
@@ -15,10 +15,11 @@ export declare class ImageExport {
|
|
|
15
15
|
/**
|
|
16
16
|
* To export the file as image/svg format
|
|
17
17
|
*
|
|
18
|
-
* @param {
|
|
19
|
-
* @param {
|
|
18
|
+
* @param {Maps} maps - Specifies the Maps instance.
|
|
19
|
+
* @param {ExportType} type - Specifies the type of the image file for exporting.
|
|
20
|
+
* @param {string} fileName - Specifies the file name of the image file for exporting.
|
|
20
21
|
* @param {boolean} allowDownload - Specifies whether to download image as a file or not.
|
|
21
|
-
* @returns {Promise<string>} -
|
|
22
|
+
* @returns {Promise<string>} - Specifies the base64 string of the exported image which is returned when the allowDownload is set to false.
|
|
22
23
|
* @private
|
|
23
24
|
*/
|
|
24
25
|
export(maps: Maps, type: ExportType, fileName: string, allowDownload?: boolean): Promise<string>;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
2
1
|
import { createElement, Browser, isNullOrUndefined } from '@syncfusion/ej2-base';
|
|
3
2
|
import { triggerDownload, getElementByID } from '../utils/helper';
|
|
4
3
|
/**
|
|
@@ -12,19 +11,21 @@ var ImageExport = /** @class */ (function () {
|
|
|
12
11
|
*
|
|
13
12
|
* @param {Maps} control - Specifies the instance of the map
|
|
14
13
|
*/
|
|
14
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-empty-function
|
|
15
15
|
function ImageExport(control) {
|
|
16
16
|
}
|
|
17
17
|
/**
|
|
18
18
|
* To export the file as image/svg format
|
|
19
19
|
*
|
|
20
|
-
* @param {
|
|
21
|
-
* @param {
|
|
20
|
+
* @param {Maps} maps - Specifies the Maps instance.
|
|
21
|
+
* @param {ExportType} type - Specifies the type of the image file for exporting.
|
|
22
|
+
* @param {string} fileName - Specifies the file name of the image file for exporting.
|
|
22
23
|
* @param {boolean} allowDownload - Specifies whether to download image as a file or not.
|
|
23
|
-
* @returns {Promise<string>} -
|
|
24
|
+
* @returns {Promise<string>} - Specifies the base64 string of the exported image which is returned when the allowDownload is set to false.
|
|
24
25
|
* @private
|
|
25
26
|
*/
|
|
26
27
|
ImageExport.prototype.export = function (maps, type, fileName, allowDownload) {
|
|
27
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
28
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars
|
|
28
29
|
var promise = new Promise(function (resolve, reject) {
|
|
29
30
|
var imageCanvasElement = createElement('canvas', {
|
|
30
31
|
id: 'ej2-canvas',
|
|
@@ -34,7 +35,6 @@ var ImageExport = /** @class */ (function () {
|
|
|
34
35
|
}
|
|
35
36
|
});
|
|
36
37
|
var isDownload = !(Browser.userAgent.toString().indexOf('HeadlessChrome') > -1);
|
|
37
|
-
var toolbarEle = document.getElementById(maps.element.id + '_ToolBar');
|
|
38
38
|
var svgParent = document.getElementById(maps.element.id + '_Tile_SVG_Parent');
|
|
39
39
|
var svgDataElement;
|
|
40
40
|
var tileSvg;
|
|
@@ -168,6 +168,7 @@ var ImageExport = /** @class */ (function () {
|
|
|
168
168
|
* @returns {void}
|
|
169
169
|
* @private
|
|
170
170
|
*/
|
|
171
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-empty-function
|
|
171
172
|
ImageExport.prototype.destroy = function () { };
|
|
172
173
|
return ImageExport;
|
|
173
174
|
}());
|
|
@@ -10,17 +10,17 @@ export declare class PdfExport {
|
|
|
10
10
|
/**
|
|
11
11
|
* Constructor for Maps
|
|
12
12
|
*
|
|
13
|
-
* @param {Maps} control Specifies the instance of the map
|
|
14
13
|
*/
|
|
15
14
|
constructor();
|
|
16
15
|
/**
|
|
17
16
|
* To export the file as image/svg format
|
|
18
17
|
*
|
|
19
|
-
* @param {
|
|
20
|
-
* @param {
|
|
21
|
-
* @param {
|
|
22
|
-
* @param {
|
|
23
|
-
* @
|
|
18
|
+
* @param {Maps} maps - Specifies the Maps instance.
|
|
19
|
+
* @param {ExportType} type - Specifies the type of the document.
|
|
20
|
+
* @param {string} fileName - Specifies the name of the PDF document.
|
|
21
|
+
* @param {boolean} allowDownload - Specifies whether to download the document or not.
|
|
22
|
+
* @param {PdfPageOrientation} orientation - Specifies the orientation of the PDF document to export the component.
|
|
23
|
+
* @returns {Promise<string>} - Returns "null" value when the allowDownload is set to false.
|
|
24
24
|
* @private
|
|
25
25
|
*/
|
|
26
26
|
export(maps: Maps, type: ExportType, fileName: string, allowDownload?: boolean, orientation?: PdfPageOrientation): Promise<string>;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
2
1
|
import { createElement, isNullOrUndefined } from '@syncfusion/ej2-base';
|
|
3
2
|
import { PdfPageOrientation, PdfDocument, PdfBitmap } from '@syncfusion/ej2-pdf-export';
|
|
4
3
|
/**
|
|
@@ -10,18 +9,19 @@ var PdfExport = /** @class */ (function () {
|
|
|
10
9
|
/**
|
|
11
10
|
* Constructor for Maps
|
|
12
11
|
*
|
|
13
|
-
* @param {Maps} control Specifies the instance of the map
|
|
14
12
|
*/
|
|
13
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-empty-function
|
|
15
14
|
function PdfExport() {
|
|
16
15
|
}
|
|
17
16
|
/**
|
|
18
17
|
* To export the file as image/svg format
|
|
19
18
|
*
|
|
20
|
-
* @param {
|
|
21
|
-
* @param {
|
|
22
|
-
* @param {
|
|
23
|
-
* @param {
|
|
24
|
-
* @
|
|
19
|
+
* @param {Maps} maps - Specifies the Maps instance.
|
|
20
|
+
* @param {ExportType} type - Specifies the type of the document.
|
|
21
|
+
* @param {string} fileName - Specifies the name of the PDF document.
|
|
22
|
+
* @param {boolean} allowDownload - Specifies whether to download the document or not.
|
|
23
|
+
* @param {PdfPageOrientation} orientation - Specifies the orientation of the PDF document to export the component.
|
|
24
|
+
* @returns {Promise<string>} - Returns "null" value when the allowDownload is set to false.
|
|
25
25
|
* @private
|
|
26
26
|
*/
|
|
27
27
|
PdfExport.prototype.export = function (maps, type, fileName, allowDownload, orientation) {
|
|
@@ -157,6 +157,7 @@ var PdfExport = /** @class */ (function () {
|
|
|
157
157
|
* @returns {void}
|
|
158
158
|
* @private
|
|
159
159
|
*/
|
|
160
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-empty-function
|
|
160
161
|
PdfExport.prototype.destroy = function () { };
|
|
161
162
|
return PdfExport;
|
|
162
163
|
}());
|
|
@@ -508,8 +508,8 @@ export interface ILabelRenderingEventArgs extends IMapsEventArgs {
|
|
|
508
508
|
*/
|
|
509
509
|
offsetX: number;
|
|
510
510
|
/**
|
|
511
|
-
|
|
512
|
-
|
|
511
|
+
* Defines the top and bottom position of text for the data-label in event argument.
|
|
512
|
+
*/
|
|
513
513
|
offsetY: number;
|
|
514
514
|
/**
|
|
515
515
|
* Defines the color and width of the border for the data-label in event argument.
|
|
@@ -8,13 +8,14 @@ export declare class Print {
|
|
|
8
8
|
/**
|
|
9
9
|
* Constructor for Maps
|
|
10
10
|
*
|
|
11
|
-
* @param {Maps} control - Specifies the instance of the
|
|
11
|
+
* @param {Maps} control - Specifies the instance of the Maps
|
|
12
12
|
*/
|
|
13
13
|
constructor(control: Maps);
|
|
14
14
|
/**
|
|
15
15
|
* To print the Maps
|
|
16
16
|
*
|
|
17
|
-
* @param {
|
|
17
|
+
* @param {Maps} maps -Specifies the Maps instance.
|
|
18
|
+
* @param {string[] | string | Element} elements - Specifies the element of the Maps
|
|
18
19
|
* @returns {void}
|
|
19
20
|
* @private
|
|
20
21
|
*/
|
|
@@ -22,6 +23,7 @@ export declare class Print {
|
|
|
22
23
|
/**
|
|
23
24
|
* To get the html string of the Maps
|
|
24
25
|
*
|
|
26
|
+
* @param {Maps} maps -Specifies the Maps instance.
|
|
25
27
|
* @param {string[] | string | Element} elements - Specifies the html element
|
|
26
28
|
* @returns {Element} - Returns the div element
|
|
27
29
|
* @private
|
package/src/maps/model/print.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
2
1
|
import { print as printFunction, createElement } from '@syncfusion/ej2-base';
|
|
3
2
|
import { getElement } from '../utils/helper';
|
|
4
3
|
import { beforePrint } from '../model/constants';
|
|
@@ -11,14 +10,16 @@ var Print = /** @class */ (function () {
|
|
|
11
10
|
/**
|
|
12
11
|
* Constructor for Maps
|
|
13
12
|
*
|
|
14
|
-
* @param {Maps} control - Specifies the instance of the
|
|
13
|
+
* @param {Maps} control - Specifies the instance of the Maps
|
|
15
14
|
*/
|
|
15
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-empty-function
|
|
16
16
|
function Print(control) {
|
|
17
17
|
}
|
|
18
18
|
/**
|
|
19
19
|
* To print the Maps
|
|
20
20
|
*
|
|
21
|
-
* @param {
|
|
21
|
+
* @param {Maps} maps -Specifies the Maps instance.
|
|
22
|
+
* @param {string[] | string | Element} elements - Specifies the element of the Maps
|
|
22
23
|
* @returns {void}
|
|
23
24
|
* @private
|
|
24
25
|
*/
|
|
@@ -38,6 +39,7 @@ var Print = /** @class */ (function () {
|
|
|
38
39
|
/**
|
|
39
40
|
* To get the html string of the Maps
|
|
40
41
|
*
|
|
42
|
+
* @param {Maps} maps -Specifies the Maps instance.
|
|
41
43
|
* @param {string[] | string | Element} elements - Specifies the html element
|
|
42
44
|
* @returns {Element} - Returns the div element
|
|
43
45
|
* @private
|
|
@@ -97,6 +99,7 @@ var Print = /** @class */ (function () {
|
|
|
97
99
|
* @returns {void}
|
|
98
100
|
* @private
|
|
99
101
|
*/
|
|
102
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
100
103
|
Print.prototype.destroy = function () { };
|
|
101
104
|
return Print;
|
|
102
105
|
}());
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
2
|
-
/* eslint-disable jsdoc/require-param */
|
|
3
1
|
import { annotationRendering } from '../index';
|
|
4
2
|
import { createElement, isNullOrUndefined } from '@syncfusion/ej2-base';
|
|
5
3
|
import { getTemplateFunction, getElementOffset, getElementByID } from '../utils/helper';
|
|
@@ -43,8 +41,9 @@ var Annotations = /** @class */ (function () {
|
|
|
43
41
|
var availSize = map.availableSize;
|
|
44
42
|
var id = map.element.id + '_Annotation_' + annotationIndex;
|
|
45
43
|
var childElement = createElement('div', {
|
|
46
|
-
id: map.element.id + '_Annotation_' + annotationIndex
|
|
44
|
+
id: map.element.id + '_Annotation_' + annotationIndex
|
|
47
45
|
});
|
|
46
|
+
childElement.style.cssText = 'position: absolute; z-index:' + annotation.zIndex + ';';
|
|
48
47
|
var argsData = {
|
|
49
48
|
cancel: false, name: annotationRendering, content: annotation.content,
|
|
50
49
|
annotation: annotation
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { itemHighlight } from '../index';
|
|
1
|
+
import { itemHighlight, shapeHighlight } from '../index';
|
|
2
2
|
import { Browser, isNullOrUndefined } from '@syncfusion/ej2-base';
|
|
3
3
|
import { getElementsByClassName, getElement, removeClass, createStyle, customizeStyle, getTargetElement } from '../utils/helper';
|
|
4
4
|
/**
|
|
@@ -158,16 +158,37 @@ var Highlight = /** @class */ (function () {
|
|
|
158
158
|
var marker = parseInt(targetEle.id.split('_MarkerIndex_')[1].split('_')[0], 10);
|
|
159
159
|
isMarkerSelect = this.maps.layers[layerIndex].markerSettings[marker].highlightSettings.enable;
|
|
160
160
|
}
|
|
161
|
-
var
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
161
|
+
var borderColor = (targetEle.parentElement.id.indexOf('LineString') === -1) ? this.highlightSettings.border.color : (this.highlightSettings.fill || this.highlightSettings.border.color);
|
|
162
|
+
var borderWidth = (targetEle.parentElement.id.indexOf('LineString') === -1) ? (this.highlightSettings.border.width / (isMarkerSelect ? 1 : this.maps.scale)) : (this.highlightSettings.border.width / this.maps.scale);
|
|
163
|
+
var borderOpacity = isNullOrUndefined(this.highlightSettings.border.opacity) ? this.highlightSettings.opacity :
|
|
164
|
+
this.highlightSettings.border.opacity;
|
|
165
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
166
166
|
var eventArgs = {
|
|
167
167
|
opacity: this.highlightSettings.opacity,
|
|
168
168
|
fill: (targetEle.parentElement.id.indexOf('LineString') === -1) ? (targetEle.id.indexOf('NavigationIndex') === -1 ? !isNullOrUndefined(this.highlightSettings.fill)
|
|
169
169
|
? this.highlightSettings.fill : targetEle.getAttribute('fill') : 'none') : 'transparent',
|
|
170
|
-
border:
|
|
170
|
+
border: { color: borderColor, width: borderWidth, opacity: borderOpacity },
|
|
171
|
+
cancel: false
|
|
172
|
+
};
|
|
173
|
+
var shapeEventArgs = {
|
|
174
|
+
opacity: eventArgs.opacity,
|
|
175
|
+
fill: eventArgs.fill,
|
|
176
|
+
border: { color: borderColor, width: borderWidth, opacity: borderOpacity },
|
|
177
|
+
name: shapeHighlight,
|
|
178
|
+
target: targetEle.id,
|
|
179
|
+
cancel: false,
|
|
180
|
+
shapeData: shapeData,
|
|
181
|
+
data: data,
|
|
182
|
+
maps: this.maps
|
|
183
|
+
};
|
|
184
|
+
if (targetEle.id.indexOf('shapeIndex') > -1) {
|
|
185
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
186
|
+
this.maps.trigger(shapeHighlight, shapeEventArgs, function () { });
|
|
187
|
+
}
|
|
188
|
+
var itemEventArgs = {
|
|
189
|
+
opacity: eventArgs.opacity,
|
|
190
|
+
fill: eventArgs.fill,
|
|
191
|
+
border: { color: borderColor, width: borderWidth, opacity: borderOpacity },
|
|
171
192
|
name: itemHighlight,
|
|
172
193
|
target: targetEle.id,
|
|
173
194
|
cancel: false,
|
|
@@ -175,15 +196,18 @@ var Highlight = /** @class */ (function () {
|
|
|
175
196
|
data: data,
|
|
176
197
|
maps: this.maps
|
|
177
198
|
};
|
|
178
|
-
this.maps.trigger(itemHighlight,
|
|
179
|
-
eventArgs.
|
|
180
|
-
|
|
199
|
+
this.maps.trigger(itemHighlight, itemEventArgs, function () {
|
|
200
|
+
itemEventArgs.cancel = eventArgs.cancel !== itemEventArgs.cancel ? itemEventArgs.cancel : targetEle.id.indexOf('shapeIndex') > -1 ? shapeEventArgs.cancel : eventArgs.cancel;
|
|
201
|
+
itemEventArgs.fill = eventArgs.fill !== itemEventArgs.fill ? itemEventArgs.fill : targetEle.id.indexOf('shapeIndex') > -1 ? shapeEventArgs.fill : eventArgs.fill;
|
|
202
|
+
itemEventArgs.opacity = eventArgs.opacity !== itemEventArgs.opacity ? itemEventArgs.opacity : targetEle.id.indexOf('shapeIndex') > -1 ? shapeEventArgs.opacity : eventArgs.opacity;
|
|
203
|
+
itemEventArgs.border.color = eventArgs.border.color !== itemEventArgs.border.color ? itemEventArgs.border.color : targetEle.id.indexOf('shapeIndex') > -1 ? shapeEventArgs.border.color : eventArgs.border.color;
|
|
204
|
+
itemEventArgs.border.width = eventArgs.border.width !== itemEventArgs.border.width ? itemEventArgs.border.width : targetEle.id.indexOf('shapeIndex') > -1 ? shapeEventArgs.border.width : eventArgs.border.width;
|
|
205
|
+
itemEventArgs.border.opacity = eventArgs.border.opacity !== itemEventArgs.border.opacity ? itemEventArgs.border.opacity : targetEle.id.indexOf('shapeIndex') > -1 ? shapeEventArgs.border.opacity : eventArgs.border.opacity;
|
|
206
|
+
_this.highlightMap(targetEle, itemEventArgs);
|
|
181
207
|
});
|
|
182
208
|
};
|
|
183
209
|
Highlight.prototype.highlightMap = function (targetEle, eventArgs) {
|
|
184
|
-
|
|
185
|
-
var children;
|
|
186
|
-
if (targetEle.getAttribute('class') === 'highlightMapStyle') {
|
|
210
|
+
if (targetEle.getAttribute('class') === 'highlightMapStyle' || eventArgs.cancel) {
|
|
187
211
|
return;
|
|
188
212
|
}
|
|
189
213
|
else {
|
|
@@ -138,7 +138,8 @@ var Selection = /** @class */ (function () {
|
|
|
138
138
|
var isLineStringShape = targetElement.parentElement.id.indexOf('LineString') > -1;
|
|
139
139
|
var selectionsettings = this.selectionsettings;
|
|
140
140
|
var border = {
|
|
141
|
-
color: isLineStringShape ? (this.selectionsettings.fill || this.selectionsettings.border.color) :
|
|
141
|
+
color: isLineStringShape ? (this.selectionsettings.fill || this.selectionsettings.border.color) :
|
|
142
|
+
this.selectionsettings.border.color,
|
|
142
143
|
width: isLineStringShape ? (this.selectionsettings.border.width / this.maps.scale) :
|
|
143
144
|
(this.selectionsettings.border.width / (this.selectionType === 'Marker' ? 1 : this.maps.scale)),
|
|
144
145
|
opacity: this.selectionsettings.border.opacity
|
|
@@ -155,7 +156,8 @@ var Selection = /** @class */ (function () {
|
|
|
155
156
|
maps: this.maps
|
|
156
157
|
};
|
|
157
158
|
this.maps.trigger('itemSelection', eventArgs, function (observedArgs) {
|
|
158
|
-
eventArgs.border.opacity = isNullOrUndefined(_this.selectionsettings.border.opacity) ?
|
|
159
|
+
eventArgs.border.opacity = isNullOrUndefined(_this.selectionsettings.border.opacity) ?
|
|
160
|
+
_this.selectionsettings.opacity : _this.selectionsettings.border.opacity;
|
|
159
161
|
if (!eventArgs.cancel) {
|
|
160
162
|
if (targetElement.getAttribute('class') === _this.selectionType + 'selectionMapStyle'
|
|
161
163
|
|| targetElement.getAttribute('class') === 'LineselectionMapStyle') {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
2
1
|
import { tooltipRender } from '../index';
|
|
3
2
|
import { Tooltip } from '@syncfusion/ej2-svg-base';
|
|
4
3
|
import { createElement, Browser, isNullOrUndefined, extend, remove } from '@syncfusion/ej2-base';
|
|
@@ -36,9 +35,7 @@ var MapsTooltip = /** @class */ (function () {
|
|
|
36
35
|
}
|
|
37
36
|
var option;
|
|
38
37
|
var currentData = '';
|
|
39
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
40
38
|
var targetId = target.id;
|
|
41
|
-
var item = {};
|
|
42
39
|
var tooltipEle;
|
|
43
40
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
44
41
|
var templateData = [];
|
|
@@ -161,9 +158,9 @@ var MapsTooltip = /** @class */ (function () {
|
|
|
161
158
|
else {
|
|
162
159
|
tooltipEle = createElement('div', {
|
|
163
160
|
id: this.maps.element.id + '_mapsTooltip',
|
|
164
|
-
className: 'EJ2-maps-Tooltip'
|
|
165
|
-
styles: 'position: absolute;pointer-events:none;'
|
|
161
|
+
className: 'EJ2-maps-Tooltip'
|
|
166
162
|
});
|
|
163
|
+
tooltipEle.style.cssText = 'position: absolute;pointer-events:none;';
|
|
167
164
|
document.getElementById(this.maps.element.id + '_Secondary_Element').appendChild(tooltipEle);
|
|
168
165
|
}
|
|
169
166
|
if (option.template !== null && Object.keys(typeof option.template === 'object' ? option.template : {}).length === 1) {
|
|
@@ -186,6 +183,7 @@ var MapsTooltip = /** @class */ (function () {
|
|
|
186
183
|
maps: this.maps,
|
|
187
184
|
element: target, eventArgs: e, content: !isNullOrUndefined(currentData) ? currentData.toString() : ''
|
|
188
185
|
};
|
|
186
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
189
187
|
this.maps.trigger(tooltipRender, tooltipArgs, function (args) {
|
|
190
188
|
if (!tooltipArgs.cancel && option.visible && !isNullOrUndefined(currentData) &&
|
|
191
189
|
(targetId.indexOf('_cluster_') === -1 && targetId.indexOf('_dataLabel_') === -1)) {
|
|
@@ -202,7 +200,8 @@ var MapsTooltip = /** @class */ (function () {
|
|
|
202
200
|
header: '',
|
|
203
201
|
data: option['data'],
|
|
204
202
|
template: option['template'],
|
|
205
|
-
content: tooltipArgs.content.toString()
|
|
203
|
+
content: tooltipArgs.content.toString() !== currentData.toString() ? [tooltipArgs.content.toString()] :
|
|
204
|
+
[currentData.toString()],
|
|
206
205
|
shapes: [],
|
|
207
206
|
location: option['location'],
|
|
208
207
|
palette: [markerFill],
|
|
@@ -218,7 +217,8 @@ var MapsTooltip = /** @class */ (function () {
|
|
|
218
217
|
header: '',
|
|
219
218
|
data: tooltipArgs.options['data'],
|
|
220
219
|
template: tooltipArgs.options['template'],
|
|
221
|
-
content: tooltipArgs.content.toString()
|
|
220
|
+
content: tooltipArgs.content.toString() !== currentData.toString() ? [tooltipArgs.content.toString()] :
|
|
221
|
+
[currentData.toString()],
|
|
222
222
|
shapes: [],
|
|
223
223
|
location: tooltipArgs.options['location'],
|
|
224
224
|
palette: [markerFill],
|
|
@@ -241,7 +241,7 @@ var MapsTooltip = /** @class */ (function () {
|
|
|
241
241
|
&& tooltipTemplateElement.innerHTML.indexOf('</a>') !== -1) {
|
|
242
242
|
var templateStyle = tooltipTemplateElement.getAttribute('style');
|
|
243
243
|
templateStyle = templateStyle.replace('pointer-events: none;', 'position-events:all;');
|
|
244
|
-
tooltipTemplateElement.
|
|
244
|
+
tooltipTemplateElement.style.cssText = templateStyle;
|
|
245
245
|
}
|
|
246
246
|
}
|
|
247
247
|
else {
|
|
@@ -100,6 +100,11 @@ export declare class Zoom {
|
|
|
100
100
|
private markerTranslate;
|
|
101
101
|
private markerLineAnimation;
|
|
102
102
|
/**
|
|
103
|
+
* @param {PanDirection} direction - Specifies the direction of the panning.
|
|
104
|
+
* @param {number} xDifference - Specifies the distance moved in the horizontal direction.
|
|
105
|
+
* @param {number} yDifference - Specifies the distance moved in the vertical direction.
|
|
106
|
+
* @param {PointerEvent | TouchEvent | KeyboardEvent} mouseLocation - Specifies the pointer event argument.
|
|
107
|
+
* @returns {void}
|
|
103
108
|
* @private
|
|
104
109
|
*/
|
|
105
110
|
panning(direction: PanDirection, xDifference: number, yDifference: number, mouseLocation?: PointerEvent | TouchEvent | KeyboardEvent): void;
|
|
@@ -150,6 +150,7 @@ var Zoom = /** @class */ (function () {
|
|
|
150
150
|
}
|
|
151
151
|
this.maps.zoomNotApplied = false;
|
|
152
152
|
};
|
|
153
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
153
154
|
Zoom.prototype.calculateInitalZoomTranslatePoint = function (newZoomFactor, mapTotalWidth, mapTotalHeight, availSize, minBounds, map) {
|
|
154
155
|
mapTotalWidth *= newZoomFactor;
|
|
155
156
|
mapTotalHeight *= newZoomFactor;
|
|
@@ -417,7 +418,7 @@ var Zoom = /** @class */ (function () {
|
|
|
417
418
|
layerElement.appendChild(maps.navigationLineModule.renderNavigation(this.currentLayer, maps.tileZoomLevel, this.index));
|
|
418
419
|
}
|
|
419
420
|
}
|
|
420
|
-
else if (currentEle.id.indexOf('Legend')
|
|
421
|
+
else if (currentEle.id.indexOf('Legend') === -1) {
|
|
421
422
|
changeBorderWidth(currentEle, this.index, scale, maps);
|
|
422
423
|
maps.zoomTranslatePoint = maps.translatePoint;
|
|
423
424
|
this.animateTransform(currentEle, animate, x, y, scale);
|
|
@@ -455,7 +456,7 @@ var Zoom = /** @class */ (function () {
|
|
|
455
456
|
}
|
|
456
457
|
else {
|
|
457
458
|
markerStyle = 'visibility:hidden';
|
|
458
|
-
currentEle.
|
|
459
|
+
currentEle.style.cssText = markerStyle;
|
|
459
460
|
}
|
|
460
461
|
}
|
|
461
462
|
}
|
|
@@ -495,7 +496,6 @@ var Zoom = /** @class */ (function () {
|
|
|
495
496
|
var childElement = void 0;
|
|
496
497
|
for (var k = 0; k < currentEle.childElementCount; k++) {
|
|
497
498
|
childElement = currentEle.childNodes[k];
|
|
498
|
-
var bubbleTransform = childElement.getAttribute('transform');
|
|
499
499
|
layerIndex = parseFloat(childElement.id.split('_LayerIndex_')[1].split('_')[0]);
|
|
500
500
|
var bubleIndex = parseFloat(childElement.id.split('_BubbleIndex_')[1].split('_')[0]);
|
|
501
501
|
var dataIndex = parseFloat(childElement.id.split('_BubbleIndex_')[1].split('_')[2]);
|
|
@@ -573,22 +573,22 @@ var Zoom = /** @class */ (function () {
|
|
|
573
573
|
var layerIndex = parseInt((element ? element : layerElement).id.split('_LayerIndex_')[1].split('_')[0], 10);
|
|
574
574
|
var markerSVGObject = this.maps.renderer.createGroup({
|
|
575
575
|
id: this.maps.element.id + '_Markers_Group',
|
|
576
|
-
class: 'GroupElement'
|
|
577
|
-
style: 'pointer-events: auto;'
|
|
576
|
+
class: 'GroupElement'
|
|
578
577
|
});
|
|
578
|
+
markerSVGObject.style.pointerEvents = 'auto';
|
|
579
579
|
if (document.getElementById(markerSVGObject.id)) {
|
|
580
580
|
removeElement(markerSVGObject.id);
|
|
581
581
|
}
|
|
582
582
|
var mapsAreaRect = this.maps.mapAreaRect;
|
|
583
583
|
var markerTemplateElements = createElement('div', {
|
|
584
584
|
id: this.maps.element.id + '_LayerIndex_' + layerIndex + '_Markers_Template_Group',
|
|
585
|
-
className: 'template'
|
|
586
|
-
styles: 'overflow: hidden; position: absolute;pointer-events: none;' +
|
|
587
|
-
'top:' + mapsAreaRect.y + 'px;' +
|
|
588
|
-
'left:' + mapsAreaRect.x + 'px;' +
|
|
589
|
-
'height:' + mapsAreaRect.height + 'px;' +
|
|
590
|
-
'width:' + mapsAreaRect.width + 'px;'
|
|
585
|
+
className: 'template'
|
|
591
586
|
});
|
|
587
|
+
markerTemplateElements.style.cssText = 'overflow: hidden; position: absolute;pointer-events: none;' +
|
|
588
|
+
'top:' + mapsAreaRect.y + 'px;' +
|
|
589
|
+
'left:' + mapsAreaRect.x + 'px;' +
|
|
590
|
+
'height:' + mapsAreaRect.height + 'px;' +
|
|
591
|
+
'width:' + mapsAreaRect.width + 'px;';
|
|
592
592
|
if (document.getElementById(markerTemplateElements.id)) {
|
|
593
593
|
removeElement(markerTemplateElements.id);
|
|
594
594
|
}
|
|
@@ -626,7 +626,6 @@ var Zoom = /** @class */ (function () {
|
|
|
626
626
|
var markerID = _this.maps.element.id + '_LayerIndex_' + layerIndex + '_MarkerIndex_'
|
|
627
627
|
+ markerIndex + '_dataIndex_' + dataIndex;
|
|
628
628
|
var location_1 = (_this.maps.isTileMap) ? convertTileLatLongToPoint(new MapLocation(long, lati), _this.maps.tileZoomLevel, _this.maps.tileTranslatePoint, true) : convertGeoToPoint(lati, long, factor, currentLayers, _this.maps);
|
|
629
|
-
var animate_1 = currentLayers.animationDuration !== 0 || isNullOrUndefined(_this.maps.zoomModule);
|
|
630
629
|
var transPoint = { x: x, y: y };
|
|
631
630
|
if (eventArgs.template && (!isNaN(location_1.x) && !isNaN(location_1.y))) {
|
|
632
631
|
markerTemplateCounts++;
|
|
@@ -696,15 +695,12 @@ var Zoom = /** @class */ (function () {
|
|
|
696
695
|
if (animate === void 0) { animate = false; }
|
|
697
696
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
698
697
|
var labelCollection = this.maps.dataLabelModule.dataLabelCollections;
|
|
699
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
700
|
-
var zoomelement = element.getBoundingClientRect();
|
|
701
698
|
var text;
|
|
702
699
|
var trimmedLable;
|
|
703
700
|
var style = this.maps.layers[this.index].dataLabelSettings.textStyle;
|
|
704
701
|
var zoomtext;
|
|
705
702
|
var zoomtextSize;
|
|
706
703
|
var zoomtrimLabel;
|
|
707
|
-
var labelPath = this.maps.layers[this.index].dataLabelSettings.labelPath;
|
|
708
704
|
var layerIndex = parseFloat(element.id.split('_LayerIndex_')[1].split('_')[0]);
|
|
709
705
|
var shapeIndex = parseFloat(element.id.split('_shapeIndex_')[1].split('_')[0]);
|
|
710
706
|
var labelIndex;
|
|
@@ -720,16 +716,25 @@ var Zoom = /** @class */ (function () {
|
|
|
720
716
|
var labelX = label['location']['x'];
|
|
721
717
|
var labelY = label['location']['y'];
|
|
722
718
|
if (type === 'Template') {
|
|
723
|
-
var
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
719
|
+
var locationX = 0;
|
|
720
|
+
var locationY = 0;
|
|
721
|
+
if (this.maps.isTileMap) {
|
|
722
|
+
zoomtext = label['dataLabelText'];
|
|
723
|
+
zoomtextSize = measureText(zoomtext, style);
|
|
724
|
+
locationX = ((labelX + x) * scale) - (zoomtextSize['width'] / 2);
|
|
725
|
+
locationY = ((labelY + y) * scale) - (zoomtextSize['height']);
|
|
726
|
+
}
|
|
727
|
+
else {
|
|
728
|
+
var layerEle = getElementByID(this.maps.element.id + '_Layer_Collections');
|
|
729
|
+
labelX = ((Math.abs(this.maps.baseMapRectBounds['min']['x'] - labelX)) * scale);
|
|
730
|
+
labelY = ((Math.abs(this.maps.baseMapRectBounds['min']['y'] - labelY)) * scale);
|
|
731
|
+
var layerOffset = layerEle.getBoundingClientRect();
|
|
732
|
+
var elementOffset = element.parentElement.getBoundingClientRect();
|
|
733
|
+
locationX = ((labelX) + (layerOffset.left - elementOffset.left));
|
|
734
|
+
locationY = ((labelY) + (layerOffset.top - elementOffset.top));
|
|
735
|
+
}
|
|
736
|
+
element.style.left = locationX + 'px';
|
|
737
|
+
element.style.top = locationY + 'px';
|
|
733
738
|
}
|
|
734
739
|
else {
|
|
735
740
|
labelX = ((labelX + x) * scale);
|
|
@@ -861,10 +866,10 @@ var Zoom = /** @class */ (function () {
|
|
|
861
866
|
if (element['style']['display'] !== 'none') {
|
|
862
867
|
if ((staticMapOffset['x'] > templateOffset['x'] || staticMapOffset['x'] + staticMapOffsetWidth < templateOffset['x'] + templateOffset['width'])
|
|
863
868
|
&& (staticMapOffset['y'] > templateOffset['y'] || staticMapOffset['y'] + staticMapOffset['height'] < templateOffset['y'] + templateOffset['height'])) {
|
|
864
|
-
element
|
|
869
|
+
element.style.display = 'none';
|
|
865
870
|
}
|
|
866
871
|
else if ((staticMapOffset['x'] > templateOffset['x'] || staticMapOffset['x'] + staticMapOffsetWidth < templateOffset['x'] + templateOffset['width'])) {
|
|
867
|
-
element
|
|
872
|
+
element.style.display = 'none';
|
|
868
873
|
}
|
|
869
874
|
}
|
|
870
875
|
}
|
|
@@ -920,6 +925,11 @@ var Zoom = /** @class */ (function () {
|
|
|
920
925
|
}
|
|
921
926
|
};
|
|
922
927
|
/**
|
|
928
|
+
* @param {PanDirection} direction - Specifies the direction of the panning.
|
|
929
|
+
* @param {number} xDifference - Specifies the distance moved in the horizontal direction.
|
|
930
|
+
* @param {number} yDifference - Specifies the distance moved in the vertical direction.
|
|
931
|
+
* @param {PointerEvent | TouchEvent | KeyboardEvent} mouseLocation - Specifies the pointer event argument.
|
|
932
|
+
* @returns {void}
|
|
923
933
|
* @private
|
|
924
934
|
*/
|
|
925
935
|
Zoom.prototype.panning = function (direction, xDifference, yDifference, mouseLocation) {
|
|
@@ -1001,7 +1011,6 @@ var Zoom = /** @class */ (function () {
|
|
|
1001
1011
|
}
|
|
1002
1012
|
map.zoomTranslatePoint = map.translatePoint;
|
|
1003
1013
|
this.mouseDownPoints = this.mouseMovePoints;
|
|
1004
|
-
this.maps.zoomNotApplied = false;
|
|
1005
1014
|
this.isSingleClick = false;
|
|
1006
1015
|
};
|
|
1007
1016
|
Zoom.prototype.toAlignSublayer = function () {
|
|
@@ -1352,7 +1361,8 @@ var Zoom = /** @class */ (function () {
|
|
|
1352
1361
|
Zoom.prototype.alignToolBar = function () {
|
|
1353
1362
|
var map = this.maps;
|
|
1354
1363
|
var padding = 10;
|
|
1355
|
-
var element = createElement('div', { id: map.element.id + '_ToolBar'
|
|
1364
|
+
var element = createElement('div', { id: map.element.id + '_ToolBar' });
|
|
1365
|
+
element.style.cssText = 'position:absolute;z-index:2';
|
|
1356
1366
|
var rectSVGObject = map.renderer.createSvg({
|
|
1357
1367
|
id: map.element.id + '_Zooming_ToolBar', width: 10, height: 10
|
|
1358
1368
|
});
|
|
@@ -674,6 +674,7 @@ export declare function drawStar(maps: Maps, options: PathOption, size: Size, lo
|
|
|
674
674
|
* @param {PathOption} options - Specifies the path options
|
|
675
675
|
* @param {Size} size - Specifies the size
|
|
676
676
|
* @param {MapLocation} location - Specifies the map location
|
|
677
|
+
* @param {string} type - Specifies the type.
|
|
677
678
|
* @param {Element} element - Specifies the element
|
|
678
679
|
* @returns {Element} - Returns the element
|
|
679
680
|
* @private
|
|
@@ -838,6 +839,7 @@ export declare function Internalize(maps: Maps, value: number): string;
|
|
|
838
839
|
* Function to compile the template function for maps.
|
|
839
840
|
*
|
|
840
841
|
* @param {string} template - Specifies the template
|
|
842
|
+
* @param {Maps} maps - Specifies the Maps instance.
|
|
841
843
|
* @returns {Function} - Returns the function
|
|
842
844
|
* @private
|
|
843
845
|
*/
|