@syncfusion/ej2-maps 19.4.55 → 19.4.56
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 +9 -0
- 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 +64 -26
- package/dist/es6/ej2-maps.es2015.js.map +1 -1
- package/dist/es6/ej2-maps.es5.js +63 -25
- 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 +5 -5
- package/src/maps/maps.js +12 -7
- package/src/maps/model/export-image.js +18 -11
- package/src/maps/model/export-pdf.js +13 -6
- package/src/maps/model/print.js +3 -1
- package/src/maps/utils/helper.d.ts +8 -0
- package/src/maps/utils/helper.js +20 -2
package/dist/global/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: index.d.ts
|
|
3
|
-
* version : 19.4.
|
|
3
|
+
* version : 19.4.56
|
|
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.4.
|
|
3
|
+
"_id": "@syncfusion/ej2-maps@19.4.55",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512-
|
|
5
|
+
"_integrity": "sha512-q9a3UHN4IPE+Dj7luY6xOJVNcEKEpTSLOkaXdJdNxCf883wYbcX5oTu88Ab2Pbj8tIPwPJuvt5bt8b7bfBPJ/A==",
|
|
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-19.4.
|
|
27
|
-
"_shasum": "
|
|
26
|
+
"_resolved": "http://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-maps/-/ej2-maps-19.4.55.tgz",
|
|
27
|
+
"_shasum": "68aeba0a91caa2c3c4aa2d6d01c2bc2e163e692c",
|
|
28
28
|
"_spec": "@syncfusion/ej2-maps@*",
|
|
29
29
|
"_where": "/jenkins/workspace/automation_release_19.1.0.1-ZPMUBNQ6AUYH6YGEFBPVYMEQLRRW2SLD4XCZ6GATNZJFYJ3RIAOA/packages/included",
|
|
30
30
|
"author": {
|
|
@@ -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.4.
|
|
83
|
+
"version": "19.4.56",
|
|
84
84
|
"sideEffects": false
|
|
85
85
|
}
|
package/src/maps/maps.js
CHANGED
|
@@ -417,12 +417,14 @@ var Maps = /** @class */ (function (_super) {
|
|
|
417
417
|
this.checkInitialRender = false;
|
|
418
418
|
}
|
|
419
419
|
}
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
&& this.layers[i].markerSettings[k].
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
420
|
+
if (!this.isResize) {
|
|
421
|
+
for (var k = 0; k < this.layers[i].markerSettings.length; k++) {
|
|
422
|
+
if (this.layers[i].markerSettings[k].selectionSettings && this.layers[i].markerSettings[k].selectionSettings.enable
|
|
423
|
+
&& this.layers[i].markerSettings[k].initialMarkerSelection.length > 0) {
|
|
424
|
+
var markerSelectionValues = this.layers[i].markerSettings[k].initialMarkerSelection;
|
|
425
|
+
for (var j = 0; j < markerSelectionValues.length; j++) {
|
|
426
|
+
this.markerInitialSelection(i, k, this.layers[i].markerSettings[k], markerSelectionValues[j].latitude, markerSelectionValues[j].longitude);
|
|
427
|
+
}
|
|
426
428
|
}
|
|
427
429
|
}
|
|
428
430
|
}
|
|
@@ -500,7 +502,8 @@ var Maps = /** @class */ (function (_super) {
|
|
|
500
502
|
Maps.prototype.markerSelection = function (selectionSettings, map, targetElement, data) {
|
|
501
503
|
var border = {
|
|
502
504
|
color: selectionSettings.border.color,
|
|
503
|
-
width: selectionSettings.border.width / map.scale
|
|
505
|
+
width: selectionSettings.border.width / map.scale,
|
|
506
|
+
opacity: selectionSettings.border.opacity
|
|
504
507
|
};
|
|
505
508
|
var markerSelectionProperties = {
|
|
506
509
|
opacity: selectionSettings.opacity,
|
|
@@ -520,9 +523,11 @@ var Maps = /** @class */ (function (_super) {
|
|
|
520
523
|
if (this.selectedMarkerElementId.length === 0 || selectionSettings.enableMultiSelect) {
|
|
521
524
|
if (targetElement.tagName === 'g') {
|
|
522
525
|
targetElement.children[0].setAttribute('class', 'MarkerselectionMapStyle');
|
|
526
|
+
this.selectedMarkerElementId.push(targetElement.children[0].id);
|
|
523
527
|
}
|
|
524
528
|
else {
|
|
525
529
|
targetElement.setAttribute('class', 'MarkerselectionMapStyle');
|
|
530
|
+
this.selectedMarkerElementId.push(targetElement.id);
|
|
526
531
|
}
|
|
527
532
|
}
|
|
528
533
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
2
|
-
import { createElement, Browser } from '@syncfusion/ej2-base';
|
|
3
|
-
import { triggerDownload } from '../utils/helper';
|
|
2
|
+
import { createElement, Browser, isNullOrUndefined } from '@syncfusion/ej2-base';
|
|
3
|
+
import { triggerDownload, getElementByID, getClientElement } from '../utils/helper';
|
|
4
4
|
/**
|
|
5
5
|
* This module enables the export to Image functionality in Maps control.
|
|
6
6
|
*
|
|
@@ -38,18 +38,21 @@ var ImageExport = /** @class */ (function () {
|
|
|
38
38
|
var isDownload = !(Browser.userAgent.toString().indexOf('HeadlessChrome') > -1);
|
|
39
39
|
var toolbarEle = document.getElementById(_this.control.element.id + '_ToolBar');
|
|
40
40
|
var svgParent = document.getElementById(_this.control.element.id + '_Tile_SVG_Parent');
|
|
41
|
+
var tileParent = document.getElementById(_this.control.element.id + '_tile_parent');
|
|
41
42
|
var svgDataElement;
|
|
43
|
+
var tileSvg;
|
|
44
|
+
var svgObject = getElementByID(_this.control.element.id + '_svg').cloneNode(true);
|
|
42
45
|
if (!_this.control.isTileMap) {
|
|
43
46
|
svgDataElement = '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">' +
|
|
44
47
|
_this.control.svgObject.outerHTML + '</svg>';
|
|
45
48
|
}
|
|
46
49
|
else {
|
|
47
|
-
|
|
50
|
+
tileSvg = getElementByID(_this.control.element.id + '_Tile_SVG').cloneNode(true);
|
|
48
51
|
svgDataElement = '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">' +
|
|
49
|
-
|
|
52
|
+
svgObject.outerHTML + tileSvg.outerHTML + '</svg>';
|
|
50
53
|
}
|
|
51
54
|
var url = window.URL.createObjectURL(new Blob(type === 'SVG' ? [svgDataElement] :
|
|
52
|
-
[(new XMLSerializer()).serializeToString(
|
|
55
|
+
[(new XMLSerializer()).serializeToString(svgObject)], { type: 'image/svg+xml' }));
|
|
53
56
|
if (type === 'SVG') {
|
|
54
57
|
if (allowDownload) {
|
|
55
58
|
triggerDownload(fileName, type, url, isDownload);
|
|
@@ -80,6 +83,7 @@ var ImageExport = /** @class */ (function () {
|
|
|
80
83
|
image_1.src = url;
|
|
81
84
|
}
|
|
82
85
|
else {
|
|
86
|
+
var extraSpace_1 = getClientElement(_this.control.element.id);
|
|
83
87
|
var imgxHttp = new XMLHttpRequest();
|
|
84
88
|
var imgTileLength_1 = _this.control.mapLayerPanel.tiles.length;
|
|
85
89
|
var _loop_1 = function (i) {
|
|
@@ -89,8 +93,11 @@ var ImageExport = /** @class */ (function () {
|
|
|
89
93
|
ctxt_1.fillStyle = _this.control.background ? _this.control.background : '#FFFFFF';
|
|
90
94
|
ctxt_1.fillRect(0, 0, _this.control.availableSize.width, _this.control.availableSize.height);
|
|
91
95
|
ctxt_1.font = _this.control.titleSettings.textStyle.size + ' Arial';
|
|
92
|
-
|
|
93
|
-
|
|
96
|
+
var titleElement = document.getElementById(_this.control.element.id + '_Map_title');
|
|
97
|
+
if (!isNullOrUndefined(titleElement)) {
|
|
98
|
+
ctxt_1.fillStyle = titleElement.getAttribute('fill');
|
|
99
|
+
ctxt_1.fillText(_this.control.titleSettings.text, parseFloat(titleElement.getAttribute('x')), parseFloat(titleElement.getAttribute('y')));
|
|
100
|
+
}
|
|
94
101
|
exportTileImg.onload = (function () {
|
|
95
102
|
if (i === 0 || i === imgTileLength_1 + 1) {
|
|
96
103
|
if (i === 0) {
|
|
@@ -99,12 +106,12 @@ var ImageExport = /** @class */ (function () {
|
|
|
99
106
|
ctxt_1.clip();
|
|
100
107
|
}
|
|
101
108
|
else {
|
|
102
|
-
ctxt_1.setTransform(1, 0, 0, 1, parseFloat(svgParent.style.left), parseFloat(
|
|
109
|
+
ctxt_1.setTransform(1, 0, 0, 1, parseFloat(svgParent.style.left), (parseFloat(tileParent.style.top) - extraSpace_1["top"]));
|
|
103
110
|
}
|
|
104
111
|
}
|
|
105
112
|
else {
|
|
106
|
-
ctxt_1.setTransform(1, 0, 0, 1, parseFloat(tile.style.left) +
|
|
107
|
-
(parseFloat(
|
|
113
|
+
ctxt_1.setTransform(1, 0, 0, 1, parseFloat(tile.style.left) + _this.control.margin.left, parseFloat(tile.style.top) +
|
|
114
|
+
(parseFloat(tileParent.style.top)) - extraSpace_1["top"]);
|
|
108
115
|
}
|
|
109
116
|
ctxt_1.drawImage(exportTileImg, 0, 0);
|
|
110
117
|
if (i === imgTileLength_1 + 1) {
|
|
@@ -130,7 +137,7 @@ var ImageExport = /** @class */ (function () {
|
|
|
130
137
|
}
|
|
131
138
|
else {
|
|
132
139
|
setTimeout(function () {
|
|
133
|
-
exportTileImg.src = window.URL.createObjectURL(new Blob([(new XMLSerializer()).serializeToString(
|
|
140
|
+
exportTileImg.src = window.URL.createObjectURL(new Blob([(new XMLSerializer()).serializeToString(tileSvg)], { type: 'image/svg+xml' }));
|
|
134
141
|
}, 300);
|
|
135
142
|
}
|
|
136
143
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
2
2
|
import { createElement, isNullOrUndefined } from '@syncfusion/ej2-base';
|
|
3
3
|
import { PdfPageOrientation, PdfDocument, PdfBitmap } from '@syncfusion/ej2-pdf-export';
|
|
4
|
+
import { getClientElement } from '../utils/helper';
|
|
4
5
|
/**
|
|
5
6
|
* This module enables the export to PDF functionality in Maps control.
|
|
6
7
|
*
|
|
@@ -40,6 +41,7 @@ var PdfExport = /** @class */ (function () {
|
|
|
40
41
|
var svgParent = document.getElementById(_this.control.element.id + '_Tile_SVG_Parent');
|
|
41
42
|
var svgData;
|
|
42
43
|
var exportElement = _this.control.svgObject.cloneNode(true);
|
|
44
|
+
var tileParent = document.getElementById(_this.control.element.id + '_tile_parent');
|
|
43
45
|
var backgroundElement = exportElement.childNodes[0];
|
|
44
46
|
var backgroundColor = backgroundElement.getAttribute('fill');
|
|
45
47
|
if ((_this.control.theme === 'Tailwind' || _this.control.theme === 'TailwindDark' || _this.control.theme === 'Bootstrap5' || _this.control.theme === 'Bootstrap5Dark')
|
|
@@ -72,6 +74,7 @@ var PdfExport = /** @class */ (function () {
|
|
|
72
74
|
image.src = url;
|
|
73
75
|
}
|
|
74
76
|
else {
|
|
77
|
+
var extraSpace_1 = getClientElement(_this.control.element.id);
|
|
75
78
|
var xHttp = new XMLHttpRequest();
|
|
76
79
|
var tileLength_1 = _this.control.mapLayerPanel.tiles.length;
|
|
77
80
|
var _loop_1 = function (i) {
|
|
@@ -81,8 +84,11 @@ var PdfExport = /** @class */ (function () {
|
|
|
81
84
|
ctx.fillStyle = _this.control.background ? _this.control.background : '#FFFFFF';
|
|
82
85
|
ctx.fillRect(0, 0, _this.control.availableSize.width, _this.control.availableSize.height);
|
|
83
86
|
ctx.font = _this.control.titleSettings.textStyle.size + ' Arial';
|
|
84
|
-
|
|
85
|
-
|
|
87
|
+
var titleElement = document.getElementById(_this.control.element.id + '_Map_title');
|
|
88
|
+
if (!isNullOrUndefined(titleElement)) {
|
|
89
|
+
ctx.fillStyle = titleElement.getAttribute('fill');
|
|
90
|
+
ctx.fillText(_this.control.titleSettings.text, parseFloat(titleElement.getAttribute('x')), parseFloat(titleElement.getAttribute('y')));
|
|
91
|
+
}
|
|
86
92
|
tileImg.onload = (function () {
|
|
87
93
|
if (i === 0 || i === tileLength_1 + 1) {
|
|
88
94
|
if (i === 0) {
|
|
@@ -91,12 +97,12 @@ var PdfExport = /** @class */ (function () {
|
|
|
91
97
|
ctx.clip();
|
|
92
98
|
}
|
|
93
99
|
else {
|
|
94
|
-
ctx.setTransform(1, 0, 0, 1, parseFloat(svgParent.style.left), parseFloat(
|
|
100
|
+
ctx.setTransform(1, 0, 0, 1, parseFloat(svgParent.style.left), (parseFloat(tileParent.style.top) - extraSpace_1["top"]));
|
|
95
101
|
}
|
|
96
102
|
}
|
|
97
103
|
else {
|
|
98
|
-
ctx.setTransform(1, 0, 0, 1, parseFloat(tile.style.left) +
|
|
99
|
-
(parseFloat(
|
|
104
|
+
ctx.setTransform(1, 0, 0, 1, parseFloat(tile.style.left) + _this.control.margin.left, (parseFloat(tile.style.top) +
|
|
105
|
+
(parseFloat(tileParent.style.top)) - extraSpace_1["top"]));
|
|
100
106
|
}
|
|
101
107
|
ctx.drawImage(tileImg, 0, 0);
|
|
102
108
|
if (i === tileLength_1 + 1) {
|
|
@@ -122,7 +128,8 @@ var PdfExport = /** @class */ (function () {
|
|
|
122
128
|
}
|
|
123
129
|
else {
|
|
124
130
|
setTimeout(function () {
|
|
125
|
-
|
|
131
|
+
var tileSvg = document.getElementById(_this.control.element.id + '_Tile_SVG');
|
|
132
|
+
tileImg.src = window.URL.createObjectURL(new Blob([(new XMLSerializer()).serializeToString(tileSvg)], { type: 'image/svg+xml' }));
|
|
126
133
|
}, 300);
|
|
127
134
|
}
|
|
128
135
|
}
|
package/src/maps/model/print.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
2
2
|
import { print as printWindow, createElement } from '@syncfusion/ej2-base';
|
|
3
|
-
import { getElement } from '../utils/helper';
|
|
3
|
+
import { getElement, getClientElement } from '../utils/helper';
|
|
4
4
|
import { beforePrint } from '../model/constants';
|
|
5
5
|
/**
|
|
6
6
|
* This module enables the print functionality in maps.
|
|
@@ -45,7 +45,9 @@ var Print = /** @class */ (function () {
|
|
|
45
45
|
* @private
|
|
46
46
|
*/
|
|
47
47
|
Print.prototype.getHTMLContent = function (elements) {
|
|
48
|
+
var elementRect = getClientElement(this.control.element.id);
|
|
48
49
|
var div = createElement('div');
|
|
50
|
+
div.setAttribute("style", "margin-top:" + elementRect["top"] + "px");
|
|
49
51
|
if (elements) {
|
|
50
52
|
if (elements instanceof Array) {
|
|
51
53
|
Array.prototype.forEach.call(elements, function (value) {
|
|
@@ -818,6 +818,14 @@ export declare function fixInitialScaleForTile(map: Maps): void;
|
|
|
818
818
|
* @returns {Element} - Returns the element
|
|
819
819
|
*/
|
|
820
820
|
export declare function getElementByID(id: string): Element;
|
|
821
|
+
/**
|
|
822
|
+
* Function to get clientElement from id.
|
|
823
|
+
*
|
|
824
|
+
* @param {string} id - Specifies the id
|
|
825
|
+
* @returns {Element} - Returns the element
|
|
826
|
+
* @private
|
|
827
|
+
*/
|
|
828
|
+
export declare function getClientElement(id: string): ClientRect;
|
|
821
829
|
/**
|
|
822
830
|
* To apply internalization
|
|
823
831
|
*
|
package/src/maps/utils/helper.js
CHANGED
|
@@ -1312,8 +1312,10 @@ export function maintainSelection(elementId, elementClass, element, className) {
|
|
|
1312
1312
|
if (elementId) {
|
|
1313
1313
|
for (var index = 0; index < elementId.length; index++) {
|
|
1314
1314
|
if (element.getAttribute('id') === elementId[index]) {
|
|
1315
|
-
if (
|
|
1316
|
-
|
|
1315
|
+
if (index === 0 || element.tagName === 'g') {
|
|
1316
|
+
if (!isNullOrUndefined(elementClass) && !isNullOrUndefined(elementClass.id)) {
|
|
1317
|
+
document.body.appendChild(elementClass);
|
|
1318
|
+
}
|
|
1317
1319
|
if (element.id.indexOf('_MarkerIndex_') > -1 && element.childElementCount > 0) {
|
|
1318
1320
|
element.children[0].setAttribute('class', className);
|
|
1319
1321
|
}
|
|
@@ -2274,6 +2276,22 @@ export function fixInitialScaleForTile(map) {
|
|
|
2274
2276
|
export function getElementByID(id) {
|
|
2275
2277
|
return document.getElementById(id);
|
|
2276
2278
|
}
|
|
2279
|
+
/**
|
|
2280
|
+
* Function to get clientElement from id.
|
|
2281
|
+
*
|
|
2282
|
+
* @param {string} id - Specifies the id
|
|
2283
|
+
* @returns {Element} - Returns the element
|
|
2284
|
+
* @private
|
|
2285
|
+
*/
|
|
2286
|
+
export function getClientElement(id) {
|
|
2287
|
+
var element = document.getElementById(id);
|
|
2288
|
+
if (!isNullOrUndefined(element)) {
|
|
2289
|
+
return element.getClientRects()[0];
|
|
2290
|
+
}
|
|
2291
|
+
else {
|
|
2292
|
+
return null;
|
|
2293
|
+
}
|
|
2294
|
+
}
|
|
2277
2295
|
/**
|
|
2278
2296
|
* To apply internalization
|
|
2279
2297
|
*
|