@syncfusion/ej2-maps 19.4.55 → 20.1.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/CHANGELOG.md +29 -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 +253 -117
- package/dist/es6/ej2-maps.es2015.js.map +1 -1
- package/dist/es6/ej2-maps.es5.js +254 -118
- 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/data-label.js +1 -1
- package/src/maps/layers/legend.js +1 -1
- package/src/maps/layers/marker.js +4 -4
- package/src/maps/maps.js +20 -8
- package/src/maps/model/export-image.js +21 -12
- package/src/maps/model/export-pdf.js +16 -9
- package/src/maps/model/print.js +24 -2
- package/src/maps/model/theme.js +4 -4
- package/src/maps/user-interaction/annotation.js +1 -1
- package/src/maps/user-interaction/tooltip.d.ts +2 -1
- package/src/maps/user-interaction/tooltip.js +17 -9
- package/src/maps/user-interaction/zoom.js +121 -68
- package/src/maps/utils/enum.d.ts +5 -1
- package/src/maps/utils/helper.d.ts +9 -1
- package/src/maps/utils/helper.js +29 -4
package/dist/global/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: index.d.ts
|
|
3
|
-
* version :
|
|
3
|
+
* version : 20.1.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@
|
|
3
|
+
"_id": "@syncfusion/ej2-maps@20.1.47",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512-
|
|
5
|
+
"_integrity": "sha512-AIYN3vlXCy9FrAV4jFucL91cSCEdhWgUxCpB5MPDnaJBbpo7zCb1TxdnUJsu1QB8ovMBZj5wix+lkYmYAGZhLw==",
|
|
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-
|
|
27
|
-
"_shasum": "
|
|
26
|
+
"_resolved": "http://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-maps/-/ej2-maps-20.1.47.tgz",
|
|
27
|
+
"_shasum": "4a50e290ff70a897de5c1f42dfdd8de89ed6d705",
|
|
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": "~
|
|
39
|
-
"@syncfusion/ej2-buttons": "~
|
|
40
|
-
"@syncfusion/ej2-compression": "~
|
|
41
|
-
"@syncfusion/ej2-data": "~
|
|
42
|
-
"@syncfusion/ej2-file-utils": "~
|
|
43
|
-
"@syncfusion/ej2-pdf-export": "~
|
|
44
|
-
"@syncfusion/ej2-svg-base": "~
|
|
38
|
+
"@syncfusion/ej2-base": "~20.1.48",
|
|
39
|
+
"@syncfusion/ej2-buttons": "~20.1.47",
|
|
40
|
+
"@syncfusion/ej2-compression": "~20.1.47",
|
|
41
|
+
"@syncfusion/ej2-data": "~20.1.47",
|
|
42
|
+
"@syncfusion/ej2-file-utils": "~20.1.47",
|
|
43
|
+
"@syncfusion/ej2-pdf-export": "~20.1.47",
|
|
44
|
+
"@syncfusion/ej2-svg-base": "~20.1.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": "
|
|
83
|
+
"version": "20.1.48",
|
|
84
84
|
"sideEffects": false
|
|
85
85
|
}
|
|
@@ -256,7 +256,7 @@ var DataLabel = /** @class */ (function () {
|
|
|
256
256
|
_this.value[index] = { rightWidth: xpositionEnds, leftWidth: xpositionStart, heightTop: start, heightBottom: end };
|
|
257
257
|
var labelElement;
|
|
258
258
|
if (eventargs_1.template !== '') {
|
|
259
|
-
templateFn = getTemplateFunction(eventargs_1.template);
|
|
259
|
+
templateFn = getTemplateFunction(eventargs_1.template, _this.maps);
|
|
260
260
|
var templateElement = templateFn ? templateFn(!isNullOrUndefined(datasrcObj) ?
|
|
261
261
|
datasrcObj : shapeData['properties'], _this.maps, eventargs_1.template, _this.maps.element.id + '_LabelTemplate', false) : document.createElement('div');
|
|
262
262
|
templateElement.innerHTML = !templateFn ? eventargs_1.template : '';
|
|
@@ -1303,7 +1303,7 @@ var Legend = /** @class */ (function () {
|
|
|
1303
1303
|
data[_this.maps.legendSettings.showLegendPath];
|
|
1304
1304
|
if (marker.visible && showLegend && (!isNullOrUndefined(data['latitude'])) && (!isNullOrUndefined(data['longitude']))) {
|
|
1305
1305
|
if (marker.template) {
|
|
1306
|
-
templateFn = getTemplateFunction(marker.template);
|
|
1306
|
+
templateFn = getTemplateFunction(marker.template, _this.maps);
|
|
1307
1307
|
var templateElement = templateFn(_this.maps);
|
|
1308
1308
|
var markerEle = isNullOrUndefined(templateElement.childElementCount) ? templateElement[0] :
|
|
1309
1309
|
templateElement;
|
|
@@ -53,10 +53,10 @@ var Marker = /** @class */ (function () {
|
|
|
53
53
|
eventArgs = markerShapeChoose(eventArgs, data);
|
|
54
54
|
var lng = (!isNullOrUndefined(markerSettings.longitudeValuePath)) ?
|
|
55
55
|
Number(getValueFromObject(data, markerSettings.longitudeValuePath)) : !isNullOrUndefined(data['longitude']) ?
|
|
56
|
-
parseFloat(data['longitude']) : !isNullOrUndefined(data['Longitude']) ? parseFloat(data['Longitude']) :
|
|
56
|
+
parseFloat(data['longitude']) : !isNullOrUndefined(data['Longitude']) ? parseFloat(data['Longitude']) : null;
|
|
57
57
|
var lat = (!isNullOrUndefined(markerSettings.latitudeValuePath)) ?
|
|
58
58
|
Number(getValueFromObject(data, markerSettings.latitudeValuePath)) : !isNullOrUndefined(data['latitude']) ?
|
|
59
|
-
parseFloat(data['latitude']) : !isNullOrUndefined(data['Latitude']) ? parseFloat(data['Latitude']) :
|
|
59
|
+
parseFloat(data['latitude']) : !isNullOrUndefined(data['Latitude']) ? parseFloat(data['Latitude']) : null;
|
|
60
60
|
var offset = markerSettings.offset;
|
|
61
61
|
if (!eventArgs.cancel && markerSettings.visible && !isNullOrUndefined(lng) && !isNullOrUndefined(lat)) {
|
|
62
62
|
var markerID = _this.maps.element.id + '_LayerIndex_' + layerIndex + '_MarkerIndex_'
|
|
@@ -101,7 +101,7 @@ var Marker = /** @class */ (function () {
|
|
|
101
101
|
_this.maps.renderReactTemplates();
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
|
-
if (markerTemplateEle.childElementCount === (
|
|
104
|
+
if (markerTemplateEle.childElementCount === (markerDataLength - markerCount - nullCount) && getElementByID(_this.maps.element.id + '_Secondary_Element')) {
|
|
105
105
|
getElementByID(_this.maps.element.id + '_Secondary_Element').appendChild(markerTemplateEle);
|
|
106
106
|
if (_this.maps.checkInitialRender) {
|
|
107
107
|
if (currentLayer.markerClusterSettings.allowClustering) {
|
|
@@ -354,7 +354,7 @@ var Marker = /** @class */ (function () {
|
|
|
354
354
|
if ((target.indexOf('_cluster_') > -1)) {
|
|
355
355
|
var isClusterSame = false;
|
|
356
356
|
var clusterElement = document.getElementById(target.indexOf('_datalabel_') > -1 ? target.split('_datalabel_')[0] : target);
|
|
357
|
-
var indexes = clusterElement.innerHTML.split(',').map(Number);
|
|
357
|
+
var indexes = layer.markerClusterSettings.shape === 'Balloon' ? clusterElement.children[0].innerHTML.split(',').map(Number) : clusterElement.innerHTML.split(',').map(Number);
|
|
358
358
|
collection_1 = [];
|
|
359
359
|
for (var _i = 0, indexes_1 = indexes; _i < indexes_1.length; _i++) {
|
|
360
360
|
var i = indexes_1[_i];
|
package/src/maps/maps.js
CHANGED
|
@@ -75,6 +75,10 @@ var Maps = /** @class */ (function (_super) {
|
|
|
75
75
|
* Resize the map
|
|
76
76
|
*/
|
|
77
77
|
_this.isResize = false;
|
|
78
|
+
/**
|
|
79
|
+
* @private
|
|
80
|
+
*/
|
|
81
|
+
_this.isReset = false;
|
|
78
82
|
/** @private */
|
|
79
83
|
_this.baseSize = new Size(0, 0);
|
|
80
84
|
/** @public */
|
|
@@ -417,12 +421,14 @@ var Maps = /** @class */ (function (_super) {
|
|
|
417
421
|
this.checkInitialRender = false;
|
|
418
422
|
}
|
|
419
423
|
}
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
&& this.layers[i].markerSettings[k].
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
424
|
+
if (!this.isResize) {
|
|
425
|
+
for (var k = 0; k < this.layers[i].markerSettings.length; k++) {
|
|
426
|
+
if (this.layers[i].markerSettings[k].selectionSettings && this.layers[i].markerSettings[k].selectionSettings.enable
|
|
427
|
+
&& this.layers[i].markerSettings[k].initialMarkerSelection.length > 0) {
|
|
428
|
+
var markerSelectionValues = this.layers[i].markerSettings[k].initialMarkerSelection;
|
|
429
|
+
for (var j = 0; j < markerSelectionValues.length; j++) {
|
|
430
|
+
this.markerInitialSelection(i, k, this.layers[i].markerSettings[k], markerSelectionValues[j].latitude, markerSelectionValues[j].longitude);
|
|
431
|
+
}
|
|
426
432
|
}
|
|
427
433
|
}
|
|
428
434
|
}
|
|
@@ -500,7 +506,8 @@ var Maps = /** @class */ (function (_super) {
|
|
|
500
506
|
Maps.prototype.markerSelection = function (selectionSettings, map, targetElement, data) {
|
|
501
507
|
var border = {
|
|
502
508
|
color: selectionSettings.border.color,
|
|
503
|
-
width: selectionSettings.border.width / map.scale
|
|
509
|
+
width: selectionSettings.border.width / map.scale,
|
|
510
|
+
opacity: selectionSettings.border.opacity
|
|
504
511
|
};
|
|
505
512
|
var markerSelectionProperties = {
|
|
506
513
|
opacity: selectionSettings.opacity,
|
|
@@ -520,9 +527,11 @@ var Maps = /** @class */ (function (_super) {
|
|
|
520
527
|
if (this.selectedMarkerElementId.length === 0 || selectionSettings.enableMultiSelect) {
|
|
521
528
|
if (targetElement.tagName === 'g') {
|
|
522
529
|
targetElement.children[0].setAttribute('class', 'MarkerselectionMapStyle');
|
|
530
|
+
this.selectedMarkerElementId.push(targetElement.children[0].id);
|
|
523
531
|
}
|
|
524
532
|
else {
|
|
525
533
|
targetElement.setAttribute('class', 'MarkerselectionMapStyle');
|
|
534
|
+
this.selectedMarkerElementId.push(targetElement.id);
|
|
526
535
|
}
|
|
527
536
|
}
|
|
528
537
|
};
|
|
@@ -1754,7 +1763,10 @@ var Maps = /** @class */ (function (_super) {
|
|
|
1754
1763
|
var collection = Object.keys(newProp.layers[x]);
|
|
1755
1764
|
for (var _b = 0, collection_1 = collection; _b < collection_1.length; _b++) {
|
|
1756
1765
|
var collectionProp = collection_1[_b];
|
|
1757
|
-
if (collectionProp === '
|
|
1766
|
+
if (collectionProp === 'layerType' && newProp.layers[x].layerType === 'OSM') {
|
|
1767
|
+
this.isReset = true;
|
|
1768
|
+
}
|
|
1769
|
+
else if (collectionProp === 'markerSettings') {
|
|
1758
1770
|
isMarker = true;
|
|
1759
1771
|
}
|
|
1760
1772
|
else if (collectionProp === 'staticMapType') {
|
|
@@ -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 } from '../utils/helper';
|
|
4
4
|
/**
|
|
5
5
|
* This module enables the export to Image functionality in Maps control.
|
|
6
6
|
*
|
|
@@ -39,17 +39,19 @@ var ImageExport = /** @class */ (function () {
|
|
|
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
41
|
var svgDataElement;
|
|
42
|
+
var tileSvg;
|
|
43
|
+
var svgObject = getElementByID(_this.control.element.id + '_svg').cloneNode(true);
|
|
42
44
|
if (!_this.control.isTileMap) {
|
|
43
45
|
svgDataElement = '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">' +
|
|
44
46
|
_this.control.svgObject.outerHTML + '</svg>';
|
|
45
47
|
}
|
|
46
48
|
else {
|
|
47
|
-
|
|
49
|
+
tileSvg = getElementByID(_this.control.element.id + '_Tile_SVG').cloneNode(true);
|
|
48
50
|
svgDataElement = '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">' +
|
|
49
|
-
|
|
51
|
+
svgObject.outerHTML + tileSvg.outerHTML + '</svg>';
|
|
50
52
|
}
|
|
51
53
|
var url = window.URL.createObjectURL(new Blob(type === 'SVG' ? [svgDataElement] :
|
|
52
|
-
[(new XMLSerializer()).serializeToString(
|
|
54
|
+
[(new XMLSerializer()).serializeToString(svgObject)], { type: 'image/svg+xml' }));
|
|
53
55
|
if (type === 'SVG') {
|
|
54
56
|
if (allowDownload) {
|
|
55
57
|
triggerDownload(fileName, type, url, isDownload);
|
|
@@ -80,6 +82,9 @@ var ImageExport = /** @class */ (function () {
|
|
|
80
82
|
image_1.src = url;
|
|
81
83
|
}
|
|
82
84
|
else {
|
|
85
|
+
var svgParentElement = document.getElementById(_this.control.element.id + '_MapAreaBorder');
|
|
86
|
+
var top_1 = parseFloat(svgParentElement.getAttribute('y'));
|
|
87
|
+
var left_1 = parseFloat(svgParentElement.getAttribute('x'));
|
|
83
88
|
var imgxHttp = new XMLHttpRequest();
|
|
84
89
|
var imgTileLength_1 = _this.control.mapLayerPanel.tiles.length;
|
|
85
90
|
var _loop_1 = function (i) {
|
|
@@ -89,22 +94,26 @@ var ImageExport = /** @class */ (function () {
|
|
|
89
94
|
ctxt_1.fillStyle = _this.control.background ? _this.control.background : '#FFFFFF';
|
|
90
95
|
ctxt_1.fillRect(0, 0, _this.control.availableSize.width, _this.control.availableSize.height);
|
|
91
96
|
ctxt_1.font = _this.control.titleSettings.textStyle.size + ' Arial';
|
|
92
|
-
|
|
93
|
-
|
|
97
|
+
var titleElement = document.getElementById(_this.control.element.id + '_Map_title');
|
|
98
|
+
if (!isNullOrUndefined(titleElement)) {
|
|
99
|
+
ctxt_1.fillStyle = titleElement.getAttribute('fill');
|
|
100
|
+
ctxt_1.fillText(_this.control.titleSettings.text, parseFloat(titleElement.getAttribute('x')), parseFloat(titleElement.getAttribute('y')));
|
|
101
|
+
}
|
|
94
102
|
exportTileImg.onload = (function () {
|
|
95
103
|
if (i === 0 || i === imgTileLength_1 + 1) {
|
|
96
104
|
if (i === 0) {
|
|
97
105
|
ctxt_1.setTransform(1, 0, 0, 1, 0, 0);
|
|
98
|
-
ctxt_1.rect(0,
|
|
106
|
+
ctxt_1.rect(0, top_1, parseFloat(svgParent.style.width), parseFloat(svgParent.style.height));
|
|
99
107
|
ctxt_1.clip();
|
|
100
108
|
}
|
|
101
109
|
else {
|
|
102
|
-
ctxt_1.setTransform(1, 0, 0, 1,
|
|
110
|
+
ctxt_1.setTransform(1, 0, 0, 1, left_1, top_1);
|
|
103
111
|
}
|
|
104
112
|
}
|
|
105
113
|
else {
|
|
106
|
-
|
|
107
|
-
|
|
114
|
+
var tileParent = document.getElementById(_this.control.element.id + '_tile_parent');
|
|
115
|
+
ctxt_1.setTransform(1, 0, 0, 1, parseFloat(tile.style.left) + left_1, parseFloat(tile.style.top) +
|
|
116
|
+
top_1);
|
|
108
117
|
}
|
|
109
118
|
ctxt_1.drawImage(exportTileImg, 0, 0);
|
|
110
119
|
if (i === imgTileLength_1 + 1) {
|
|
@@ -130,7 +139,7 @@ var ImageExport = /** @class */ (function () {
|
|
|
130
139
|
}
|
|
131
140
|
else {
|
|
132
141
|
setTimeout(function () {
|
|
133
|
-
exportTileImg.src = window.URL.createObjectURL(new Blob([(new XMLSerializer()).serializeToString(
|
|
142
|
+
exportTileImg.src = window.URL.createObjectURL(new Blob([(new XMLSerializer()).serializeToString(tileSvg)], { type: 'image/svg+xml' }));
|
|
134
143
|
}, 300);
|
|
135
144
|
}
|
|
136
145
|
}
|
|
@@ -42,8 +42,8 @@ var PdfExport = /** @class */ (function () {
|
|
|
42
42
|
var exportElement = _this.control.svgObject.cloneNode(true);
|
|
43
43
|
var backgroundElement = exportElement.childNodes[0];
|
|
44
44
|
var backgroundColor = backgroundElement.getAttribute('fill');
|
|
45
|
-
if ((_this.control.theme === 'Tailwind' || _this.control.theme === 'TailwindDark' || _this.control.theme === 'Bootstrap5' || _this.control.theme === 'Bootstrap5Dark'
|
|
46
|
-
&& (backgroundColor === 'rgba(255,255,255, 0.0)' || backgroundColor === 'transparent')) {
|
|
45
|
+
if ((_this.control.theme === 'Tailwind' || _this.control.theme === 'TailwindDark' || _this.control.theme === 'Bootstrap5' || _this.control.theme === 'Bootstrap5Dark'
|
|
46
|
+
|| _this.control.theme === 'Fluent' || _this.control.theme === 'FluentDark') && (backgroundColor === 'rgba(255,255,255, 0.0)' || backgroundColor === 'transparent')) {
|
|
47
47
|
exportElement.childNodes[0].setAttribute('fill', 'rgba(255,255,255, 1)');
|
|
48
48
|
}
|
|
49
49
|
var url = window.URL.createObjectURL(new Blob(type === 'SVG' ? [svgData] :
|
|
@@ -72,6 +72,9 @@ var PdfExport = /** @class */ (function () {
|
|
|
72
72
|
image.src = url;
|
|
73
73
|
}
|
|
74
74
|
else {
|
|
75
|
+
var svgParentElement = document.getElementById(_this.control.element.id + '_MapAreaBorder');
|
|
76
|
+
var top_1 = parseFloat(svgParentElement.getAttribute('y'));
|
|
77
|
+
var left_1 = parseFloat(svgParentElement.getAttribute('x'));
|
|
75
78
|
var xHttp = new XMLHttpRequest();
|
|
76
79
|
var tileLength_1 = _this.control.mapLayerPanel.tiles.length;
|
|
77
80
|
var _loop_1 = function (i) {
|
|
@@ -81,22 +84,25 @@ 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) {
|
|
89
95
|
ctx.setTransform(1, 0, 0, 1, 0, 0);
|
|
90
|
-
ctx.rect(0,
|
|
96
|
+
ctx.rect(0, top_1, parseFloat(svgParent.style.width), parseFloat(svgParent.style.height));
|
|
91
97
|
ctx.clip();
|
|
92
98
|
}
|
|
93
99
|
else {
|
|
94
|
-
ctx.setTransform(1, 0, 0, 1,
|
|
100
|
+
ctx.setTransform(1, 0, 0, 1, left_1, top_1);
|
|
95
101
|
}
|
|
96
102
|
}
|
|
97
103
|
else {
|
|
98
|
-
|
|
99
|
-
|
|
104
|
+
var tileParent = document.getElementById(_this.control.element.id + '_tile_parent');
|
|
105
|
+
ctx.setTransform(1, 0, 0, 1, parseFloat(tile.style.left) + left_1, parseFloat(tile.style.top) + top_1);
|
|
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,29 @@ 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
|
+
var divElement = this.control.element.cloneNode(true);
|
|
51
|
+
if (this.control.isTileMap) {
|
|
52
|
+
for (var i = 0; i < divElement.childElementCount; i++) {
|
|
53
|
+
if (divElement.children[i].id === this.control.element.id + '_tile_parent') {
|
|
54
|
+
divElement.children[i].style.removeProperty('height');
|
|
55
|
+
divElement.children[i].style.removeProperty('width');
|
|
56
|
+
divElement.children[i].style.removeProperty('top');
|
|
57
|
+
divElement.children[i].style.removeProperty('left');
|
|
58
|
+
divElement.children[i].style.removeProperty('right');
|
|
59
|
+
divElement.children[i].style.removeProperty('overflow');
|
|
60
|
+
var svgElement = document.getElementById(this.control.element.id + '_Tile_SVG_Parent');
|
|
61
|
+
divElement.children[i].children[0].style.overflow = 'hidden';
|
|
62
|
+
divElement.children[i].children[0].style.position = 'absolute';
|
|
63
|
+
divElement.children[i].children[0].style.height = svgElement.style.height;
|
|
64
|
+
divElement.children[i].children[0].style.width = svgElement.style.width;
|
|
65
|
+
divElement.children[i].children[0].style.left = svgElement.style.left;
|
|
66
|
+
divElement.children[i].children[0].style.top = svgElement.style.top;
|
|
67
|
+
break;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
49
71
|
if (elements) {
|
|
50
72
|
if (elements instanceof Array) {
|
|
51
73
|
Array.prototype.forEach.call(elements, function (value) {
|
|
@@ -60,7 +82,7 @@ var Print = /** @class */ (function () {
|
|
|
60
82
|
}
|
|
61
83
|
}
|
|
62
84
|
else {
|
|
63
|
-
div.appendChild(
|
|
85
|
+
div.appendChild(divElement);
|
|
64
86
|
}
|
|
65
87
|
return div;
|
|
66
88
|
};
|
package/src/maps/model/theme.js
CHANGED
|
@@ -183,11 +183,11 @@ export function getShapeColor(theme) {
|
|
|
183
183
|
themePalette = ['#5ECB9B', '#A860F1', '#EBA844', '#557EF7', '#E9599B',
|
|
184
184
|
'#BFC529', '#3BC6CF', '#7A68EC', '#74B706', '#EA6266'];
|
|
185
185
|
break;
|
|
186
|
-
case '
|
|
186
|
+
case 'fluent':
|
|
187
187
|
themePalette = ['#614570', '#4C6FB1', '#CC6952', '#3F579A', '#4EA09B',
|
|
188
188
|
'#6E7A89', '#D4515C', '#E6AF5D', '#639751', '#9D4D69'];
|
|
189
189
|
break;
|
|
190
|
-
case '
|
|
190
|
+
case 'fluentdark':
|
|
191
191
|
themePalette = ['#8AB113', '#2A72D5', '#43B786', '#584EC6', '#E85F9C',
|
|
192
192
|
'#6E7A89', '#EA6266', '#EBA844', '#26BC7A', '#BC4870'];
|
|
193
193
|
break;
|
|
@@ -476,7 +476,7 @@ export function getThemeStyle(theme) {
|
|
|
476
476
|
shapeFill: '#495057'
|
|
477
477
|
};
|
|
478
478
|
break;
|
|
479
|
-
case '
|
|
479
|
+
case 'fluent':
|
|
480
480
|
style = {
|
|
481
481
|
backgroundColor: 'rgba(255,255,255, 0.0)',
|
|
482
482
|
areaBackgroundColor: 'rgba(255,255,255, 0.0)',
|
|
@@ -499,7 +499,7 @@ export function getThemeStyle(theme) {
|
|
|
499
499
|
shapeFill: '#F3F2F1'
|
|
500
500
|
};
|
|
501
501
|
break;
|
|
502
|
-
case '
|
|
502
|
+
case 'fluentdark':
|
|
503
503
|
style = {
|
|
504
504
|
backgroundColor: 'rgba(255,255,255, 0.0)',
|
|
505
505
|
areaBackgroundColor: 'rgba(255,255,255, 0.0)',
|
|
@@ -53,7 +53,7 @@ var Annotations = /** @class */ (function () {
|
|
|
53
53
|
if (argsData.cancel) {
|
|
54
54
|
return;
|
|
55
55
|
}
|
|
56
|
-
templateFn = getTemplateFunction(argsData.content);
|
|
56
|
+
templateFn = getTemplateFunction(argsData.content, _this.map);
|
|
57
57
|
if (templateFn && templateFn(_this.map, _this.map, argsData.content, _this.map.element.id + '_ContentTemplate_' + annotationIndex).length) {
|
|
58
58
|
templateElement = Array.prototype.slice.call(templateFn(_this.map, _this.map, argsData.content, _this.map.element.id + '_ContentTemplate_' + annotationIndex));
|
|
59
59
|
var length_1 = templateElement.length;
|
|
@@ -27,7 +27,8 @@ export declare class MapsTooltip {
|
|
|
27
27
|
private setTooltipContent;
|
|
28
28
|
private formatter;
|
|
29
29
|
mouseUpHandler(e: PointerEvent): void;
|
|
30
|
-
removeTooltip():
|
|
30
|
+
removeTooltip(): boolean;
|
|
31
|
+
private clearTooltip;
|
|
31
32
|
/**
|
|
32
33
|
* To bind events for tooltip module
|
|
33
34
|
*/
|
|
@@ -228,6 +228,10 @@ var MapsTooltip = /** @class */ (function () {
|
|
|
228
228
|
fill: tooltipArgs.fill || _this.maps.themeStyle.tooltipFillColor
|
|
229
229
|
});
|
|
230
230
|
}
|
|
231
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
232
|
+
if (_this.maps.isVue || _this.maps.isVue3) {
|
|
233
|
+
_this.svgTooltip.controlInstance = _this.maps;
|
|
234
|
+
}
|
|
231
235
|
_this.svgTooltip.opacity = _this.maps.themeStyle.tooltipFillOpacity || _this.svgTooltip.opacity;
|
|
232
236
|
_this.svgTooltip.appendTo(tooltipEle);
|
|
233
237
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -241,9 +245,7 @@ var MapsTooltip = /** @class */ (function () {
|
|
|
241
245
|
}
|
|
242
246
|
}
|
|
243
247
|
else {
|
|
244
|
-
_this.
|
|
245
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
246
|
-
_this.maps.clearTemplate();
|
|
248
|
+
_this.clearTooltip();
|
|
247
249
|
}
|
|
248
250
|
});
|
|
249
251
|
if (this.svgTooltip) {
|
|
@@ -258,9 +260,7 @@ var MapsTooltip = /** @class */ (function () {
|
|
|
258
260
|
});
|
|
259
261
|
}
|
|
260
262
|
else {
|
|
261
|
-
this.
|
|
262
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
263
|
-
this.maps.clearTemplate();
|
|
263
|
+
this.clearTooltip();
|
|
264
264
|
}
|
|
265
265
|
}
|
|
266
266
|
else {
|
|
@@ -270,9 +270,7 @@ var MapsTooltip = /** @class */ (function () {
|
|
|
270
270
|
this.maps.notify(click, this);
|
|
271
271
|
}
|
|
272
272
|
else {
|
|
273
|
-
this.
|
|
274
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
275
|
-
this.maps.clearTemplate();
|
|
273
|
+
this.clearTooltip();
|
|
276
274
|
}
|
|
277
275
|
}
|
|
278
276
|
};
|
|
@@ -318,8 +316,18 @@ var MapsTooltip = /** @class */ (function () {
|
|
|
318
316
|
}
|
|
319
317
|
};
|
|
320
318
|
MapsTooltip.prototype.removeTooltip = function () {
|
|
319
|
+
var isTooltipRemoved = false;
|
|
321
320
|
if (document.getElementsByClassName('EJ2-maps-Tooltip').length > 0) {
|
|
322
321
|
remove(document.getElementsByClassName('EJ2-maps-Tooltip')[0]);
|
|
322
|
+
isTooltipRemoved = true;
|
|
323
|
+
}
|
|
324
|
+
return isTooltipRemoved;
|
|
325
|
+
};
|
|
326
|
+
MapsTooltip.prototype.clearTooltip = function () {
|
|
327
|
+
var isTooltipRemoved = this.removeTooltip();
|
|
328
|
+
if (isTooltipRemoved) {
|
|
329
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
330
|
+
this.maps.clearTemplate();
|
|
323
331
|
}
|
|
324
332
|
};
|
|
325
333
|
// eslint-disable-next-line valid-jsdoc
|