@syncfusion/ej2-maps 19.4.53 → 20.1.47
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 +30 -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 +144 -67
- package/dist/es6/ej2-maps.es2015.js.map +1 -1
- package/dist/es6/ej2-maps.es5.js +143 -66
- 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.d.ts +1 -0
- package/src/maps/maps.js +28 -17
- package/src/maps/model/export-image.js +15 -9
- package/src/maps/model/export-pdf.js +11 -6
- 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 +10 -10
- 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
|
@@ -1204,7 +1204,7 @@ function marker(eventArgs, markerSettings, markerData, dataIndex, location, tran
|
|
|
1204
1204
|
*/
|
|
1205
1205
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1206
1206
|
function markerTemplate(eventArgs, templateFn, markerID, data, markerIndex, markerTemplate, location, transPoint, scale, offset, maps) {
|
|
1207
|
-
templateFn = getTemplateFunction(eventArgs.template);
|
|
1207
|
+
templateFn = getTemplateFunction(eventArgs.template, maps);
|
|
1208
1208
|
if (templateFn && (templateFn(data, maps, eventArgs.template, maps.element.id + '_MarkerTemplate' + markerIndex, false).length)) {
|
|
1209
1209
|
const templateElement = templateFn(data, maps, eventArgs.template, maps.element.id + '_MarkerTemplate' + markerIndex, false);
|
|
1210
1210
|
const markerElement = convertElement(templateElement, markerID, data, markerIndex, maps);
|
|
@@ -1240,8 +1240,10 @@ function maintainSelection(elementId, elementClass, element, className) {
|
|
|
1240
1240
|
if (elementId) {
|
|
1241
1241
|
for (let index = 0; index < elementId.length; index++) {
|
|
1242
1242
|
if (element.getAttribute('id') === elementId[index]) {
|
|
1243
|
-
if (
|
|
1244
|
-
|
|
1243
|
+
if (index === 0 || element.tagName === 'g') {
|
|
1244
|
+
if (!isNullOrUndefined(elementClass) && !isNullOrUndefined(elementClass.id)) {
|
|
1245
|
+
document.body.appendChild(elementClass);
|
|
1246
|
+
}
|
|
1245
1247
|
if (element.id.indexOf('_MarkerIndex_') > -1 && element.childElementCount > 0) {
|
|
1246
1248
|
element.children[0].setAttribute('class', className);
|
|
1247
1249
|
}
|
|
@@ -2198,6 +2200,22 @@ function fixInitialScaleForTile(map) {
|
|
|
2198
2200
|
function getElementByID(id) {
|
|
2199
2201
|
return document.getElementById(id);
|
|
2200
2202
|
}
|
|
2203
|
+
/**
|
|
2204
|
+
* Function to get clientElement from id.
|
|
2205
|
+
*
|
|
2206
|
+
* @param {string} id - Specifies the id
|
|
2207
|
+
* @returns {Element} - Returns the element
|
|
2208
|
+
* @private
|
|
2209
|
+
*/
|
|
2210
|
+
function getClientElement(id) {
|
|
2211
|
+
const element = document.getElementById(id);
|
|
2212
|
+
if (!isNullOrUndefined(element)) {
|
|
2213
|
+
return element.getClientRects()[0];
|
|
2214
|
+
}
|
|
2215
|
+
else {
|
|
2216
|
+
return null;
|
|
2217
|
+
}
|
|
2218
|
+
}
|
|
2201
2219
|
/**
|
|
2202
2220
|
* To apply internalization
|
|
2203
2221
|
*
|
|
@@ -2218,7 +2236,7 @@ function Internalize(maps, value) {
|
|
|
2218
2236
|
* @private
|
|
2219
2237
|
*/
|
|
2220
2238
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2221
|
-
function getTemplateFunction(template) {
|
|
2239
|
+
function getTemplateFunction(template, maps) {
|
|
2222
2240
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2223
2241
|
let templateFn = null;
|
|
2224
2242
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -2226,6 +2244,9 @@ function getTemplateFunction(template) {
|
|
|
2226
2244
|
if (document.querySelectorAll(template).length) {
|
|
2227
2245
|
templateFn = compile(document.querySelector(template).innerHTML.trim());
|
|
2228
2246
|
}
|
|
2247
|
+
else if (maps.isVue || maps.isVue3) {
|
|
2248
|
+
templateFn = compile(template);
|
|
2249
|
+
}
|
|
2229
2250
|
}
|
|
2230
2251
|
catch (e) {
|
|
2231
2252
|
templateFn = compile(template);
|
|
@@ -2628,6 +2649,7 @@ function createTooltip(id, text, top, left, fontSize) {
|
|
|
2628
2649
|
'left:' + left.toString() + 'px;' +
|
|
2629
2650
|
'color: #000000; ' +
|
|
2630
2651
|
'background:' + '#FFFFFF' + ';' +
|
|
2652
|
+
'z-index: 2;' +
|
|
2631
2653
|
'position:absolute;border:1px solid #707070;font-size:' + fontSize + ';border-radius:2px;';
|
|
2632
2654
|
if (!tooltip) {
|
|
2633
2655
|
tooltip = createElement('div', {
|
|
@@ -2828,6 +2850,9 @@ function changeBorderWidth(element, index, scale, maps) {
|
|
|
2828
2850
|
currentStroke = (isNullOrUndefined(borderWidth) ? 0 : borderWidth);
|
|
2829
2851
|
}
|
|
2830
2852
|
}
|
|
2853
|
+
else {
|
|
2854
|
+
currentStroke = (isNullOrUndefined(borderWidth) ? 0 : borderWidth);
|
|
2855
|
+
}
|
|
2831
2856
|
}
|
|
2832
2857
|
else {
|
|
2833
2858
|
currentStroke = (isNullOrUndefined(borderWidth) ? 0 : borderWidth);
|
|
@@ -3354,11 +3379,11 @@ function getShapeColor(theme) {
|
|
|
3354
3379
|
themePalette = ['#5ECB9B', '#A860F1', '#EBA844', '#557EF7', '#E9599B',
|
|
3355
3380
|
'#BFC529', '#3BC6CF', '#7A68EC', '#74B706', '#EA6266'];
|
|
3356
3381
|
break;
|
|
3357
|
-
case '
|
|
3382
|
+
case 'fluent':
|
|
3358
3383
|
themePalette = ['#614570', '#4C6FB1', '#CC6952', '#3F579A', '#4EA09B',
|
|
3359
3384
|
'#6E7A89', '#D4515C', '#E6AF5D', '#639751', '#9D4D69'];
|
|
3360
3385
|
break;
|
|
3361
|
-
case '
|
|
3386
|
+
case 'fluentdark':
|
|
3362
3387
|
themePalette = ['#8AB113', '#2A72D5', '#43B786', '#584EC6', '#E85F9C',
|
|
3363
3388
|
'#6E7A89', '#EA6266', '#EBA844', '#26BC7A', '#BC4870'];
|
|
3364
3389
|
break;
|
|
@@ -3647,7 +3672,7 @@ function getThemeStyle(theme) {
|
|
|
3647
3672
|
shapeFill: '#495057'
|
|
3648
3673
|
};
|
|
3649
3674
|
break;
|
|
3650
|
-
case '
|
|
3675
|
+
case 'fluent':
|
|
3651
3676
|
style = {
|
|
3652
3677
|
backgroundColor: 'rgba(255,255,255, 0.0)',
|
|
3653
3678
|
areaBackgroundColor: 'rgba(255,255,255, 0.0)',
|
|
@@ -3670,7 +3695,7 @@ function getThemeStyle(theme) {
|
|
|
3670
3695
|
shapeFill: '#F3F2F1'
|
|
3671
3696
|
};
|
|
3672
3697
|
break;
|
|
3673
|
-
case '
|
|
3698
|
+
case 'fluentdark':
|
|
3674
3699
|
style = {
|
|
3675
3700
|
backgroundColor: 'rgba(255,255,255, 0.0)',
|
|
3676
3701
|
areaBackgroundColor: 'rgba(255,255,255, 0.0)',
|
|
@@ -4639,10 +4664,10 @@ class Marker {
|
|
|
4639
4664
|
eventArgs = markerShapeChoose(eventArgs, data);
|
|
4640
4665
|
const lng = (!isNullOrUndefined(markerSettings.longitudeValuePath)) ?
|
|
4641
4666
|
Number(getValueFromObject(data, markerSettings.longitudeValuePath)) : !isNullOrUndefined(data['longitude']) ?
|
|
4642
|
-
parseFloat(data['longitude']) : !isNullOrUndefined(data['Longitude']) ? parseFloat(data['Longitude']) :
|
|
4667
|
+
parseFloat(data['longitude']) : !isNullOrUndefined(data['Longitude']) ? parseFloat(data['Longitude']) : null;
|
|
4643
4668
|
const lat = (!isNullOrUndefined(markerSettings.latitudeValuePath)) ?
|
|
4644
4669
|
Number(getValueFromObject(data, markerSettings.latitudeValuePath)) : !isNullOrUndefined(data['latitude']) ?
|
|
4645
|
-
parseFloat(data['latitude']) : !isNullOrUndefined(data['Latitude']) ? parseFloat(data['Latitude']) :
|
|
4670
|
+
parseFloat(data['latitude']) : !isNullOrUndefined(data['Latitude']) ? parseFloat(data['Latitude']) : null;
|
|
4646
4671
|
const offset = markerSettings.offset;
|
|
4647
4672
|
if (!eventArgs.cancel && markerSettings.visible && !isNullOrUndefined(lng) && !isNullOrUndefined(lat)) {
|
|
4648
4673
|
const markerID = this.maps.element.id + '_LayerIndex_' + layerIndex + '_MarkerIndex_'
|
|
@@ -4687,7 +4712,7 @@ class Marker {
|
|
|
4687
4712
|
this.maps.renderReactTemplates();
|
|
4688
4713
|
}
|
|
4689
4714
|
}
|
|
4690
|
-
if (markerTemplateEle.childElementCount === (
|
|
4715
|
+
if (markerTemplateEle.childElementCount === (markerDataLength - markerCount - nullCount) && getElementByID(this.maps.element.id + '_Secondary_Element')) {
|
|
4691
4716
|
getElementByID(this.maps.element.id + '_Secondary_Element').appendChild(markerTemplateEle);
|
|
4692
4717
|
if (this.maps.checkInitialRender) {
|
|
4693
4718
|
if (currentLayer.markerClusterSettings.allowClustering) {
|
|
@@ -4937,7 +4962,7 @@ class Marker {
|
|
|
4937
4962
|
if ((target.indexOf('_cluster_') > -1)) {
|
|
4938
4963
|
let isClusterSame = false;
|
|
4939
4964
|
const clusterElement = document.getElementById(target.indexOf('_datalabel_') > -1 ? target.split('_datalabel_')[0] : target);
|
|
4940
|
-
const indexes = clusterElement.innerHTML.split(',').map(Number);
|
|
4965
|
+
const indexes = layer.markerClusterSettings.shape === 'Balloon' ? clusterElement.children[0].innerHTML.split(',').map(Number) : clusterElement.innerHTML.split(',').map(Number);
|
|
4941
4966
|
collection = [];
|
|
4942
4967
|
for (const i of indexes) {
|
|
4943
4968
|
collection.push({ data: marker$$1.dataSource[i], index: i });
|
|
@@ -6771,7 +6796,7 @@ class Annotations {
|
|
|
6771
6796
|
if (argsData.cancel) {
|
|
6772
6797
|
return;
|
|
6773
6798
|
}
|
|
6774
|
-
templateFn = getTemplateFunction(argsData.content);
|
|
6799
|
+
templateFn = getTemplateFunction(argsData.content, this.map);
|
|
6775
6800
|
if (templateFn && templateFn(this.map, this.map, argsData.content, this.map.element.id + '_ContentTemplate_' + annotationIndex).length) {
|
|
6776
6801
|
templateElement = Array.prototype.slice.call(templateFn(this.map, this.map, argsData.content, this.map.element.id + '_ContentTemplate_' + annotationIndex));
|
|
6777
6802
|
const length = templateElement.length;
|
|
@@ -7209,12 +7234,14 @@ let Maps = class Maps extends Component {
|
|
|
7209
7234
|
this.checkInitialRender = false;
|
|
7210
7235
|
}
|
|
7211
7236
|
}
|
|
7212
|
-
|
|
7213
|
-
|
|
7214
|
-
&& this.layers[i].markerSettings[k].
|
|
7215
|
-
|
|
7216
|
-
|
|
7217
|
-
|
|
7237
|
+
if (!this.isResize) {
|
|
7238
|
+
for (let k = 0; k < this.layers[i].markerSettings.length; k++) {
|
|
7239
|
+
if (this.layers[i].markerSettings[k].selectionSettings && this.layers[i].markerSettings[k].selectionSettings.enable
|
|
7240
|
+
&& this.layers[i].markerSettings[k].initialMarkerSelection.length > 0) {
|
|
7241
|
+
const markerSelectionValues = this.layers[i].markerSettings[k].initialMarkerSelection;
|
|
7242
|
+
for (let j = 0; j < markerSelectionValues.length; j++) {
|
|
7243
|
+
this.markerInitialSelection(i, k, this.layers[i].markerSettings[k], markerSelectionValues[j].latitude, markerSelectionValues[j].longitude);
|
|
7244
|
+
}
|
|
7218
7245
|
}
|
|
7219
7246
|
}
|
|
7220
7247
|
}
|
|
@@ -7292,7 +7319,8 @@ let Maps = class Maps extends Component {
|
|
|
7292
7319
|
markerSelection(selectionSettings, map, targetElement, data) {
|
|
7293
7320
|
const border = {
|
|
7294
7321
|
color: selectionSettings.border.color,
|
|
7295
|
-
width: selectionSettings.border.width / map.scale
|
|
7322
|
+
width: selectionSettings.border.width / map.scale,
|
|
7323
|
+
opacity: selectionSettings.border.opacity
|
|
7296
7324
|
};
|
|
7297
7325
|
const markerSelectionProperties = {
|
|
7298
7326
|
opacity: selectionSettings.opacity,
|
|
@@ -7312,9 +7340,11 @@ let Maps = class Maps extends Component {
|
|
|
7312
7340
|
if (this.selectedMarkerElementId.length === 0 || selectionSettings.enableMultiSelect) {
|
|
7313
7341
|
if (targetElement.tagName === 'g') {
|
|
7314
7342
|
targetElement.children[0].setAttribute('class', 'MarkerselectionMapStyle');
|
|
7343
|
+
this.selectedMarkerElementId.push(targetElement.children[0].id);
|
|
7315
7344
|
}
|
|
7316
7345
|
else {
|
|
7317
7346
|
targetElement.setAttribute('class', 'MarkerselectionMapStyle');
|
|
7347
|
+
this.selectedMarkerElementId.push(targetElement.id);
|
|
7318
7348
|
}
|
|
7319
7349
|
}
|
|
7320
7350
|
}
|
|
@@ -7829,20 +7859,23 @@ let Maps = class Maps extends Component {
|
|
|
7829
7859
|
this.notify(click, targetEle);
|
|
7830
7860
|
}
|
|
7831
7861
|
if (!eventArgs.cancel && targetEle.id.indexOf('shapeIndex') !== -1) {
|
|
7832
|
-
|
|
7833
|
-
const shapeSelectedEventArgs = triggerShapeEvent(targetId, this.layers[layerIndex].selectionSettings, this, shapeSelected);
|
|
7834
|
-
if (!shapeSelectedEventArgs.cancel && this.selectionModule && !isNullOrUndefined(this.shapeSelected)) {
|
|
7835
|
-
customizeStyle(this.selectionModule.selectionType + 'selectionMap', this.selectionModule.selectionType + 'selectionMapStyle', shapeSelectedEventArgs);
|
|
7836
|
-
}
|
|
7837
|
-
else if (shapeSelectedEventArgs.cancel && this.selectionModule
|
|
7838
|
-
&& isNullOrUndefined(shapeSelectedEventArgs['data'])) {
|
|
7839
|
-
removeClass(targetEle);
|
|
7840
|
-
this.selectionModule.removedSelectionList(targetEle);
|
|
7841
|
-
}
|
|
7862
|
+
this.triggerShapeSelection(targetEle);
|
|
7842
7863
|
}
|
|
7843
7864
|
});
|
|
7844
7865
|
}
|
|
7845
7866
|
}
|
|
7867
|
+
triggerShapeSelection(targetEle) {
|
|
7868
|
+
const layerIndex = parseInt(targetEle.id.split('_LayerIndex_')[1].split('_')[0], 10);
|
|
7869
|
+
const shapeSelectedEventArgs = triggerShapeEvent(targetEle.id, this.layers[layerIndex].selectionSettings, this, shapeSelected);
|
|
7870
|
+
if (!shapeSelectedEventArgs.cancel && this.selectionModule && !isNullOrUndefined(this.shapeSelected)) {
|
|
7871
|
+
customizeStyle(this.selectionModule.selectionType + 'selectionMap', this.selectionModule.selectionType + 'selectionMapStyle', shapeSelectedEventArgs);
|
|
7872
|
+
}
|
|
7873
|
+
else if (shapeSelectedEventArgs.cancel && this.selectionModule
|
|
7874
|
+
&& isNullOrUndefined(shapeSelectedEventArgs['data'])) {
|
|
7875
|
+
removeClass(targetEle);
|
|
7876
|
+
this.selectionModule.removedSelectionList(targetEle);
|
|
7877
|
+
}
|
|
7878
|
+
}
|
|
7846
7879
|
getClickLocation(targetId, pageX, pageY, targetElement, x, y) {
|
|
7847
7880
|
let layerIndex = 0;
|
|
7848
7881
|
let latLongValue;
|
|
@@ -7964,6 +7997,9 @@ let Maps = class Maps extends Component {
|
|
|
7964
7997
|
const markerModule = this.markerModule;
|
|
7965
7998
|
if (element.id.indexOf('shapeIndex') > -1 || element.id.indexOf('Tile') > -1) {
|
|
7966
7999
|
this.mergeCluster();
|
|
8000
|
+
if (element.id.indexOf('shapeIndex') > -1) {
|
|
8001
|
+
this.triggerShapeSelection(element);
|
|
8002
|
+
}
|
|
7967
8003
|
}
|
|
7968
8004
|
if (markerModule) {
|
|
7969
8005
|
markerModule.markerClick(e);
|
|
@@ -9607,7 +9643,7 @@ class DataLabel {
|
|
|
9607
9643
|
this.value[index] = { rightWidth: xpositionEnds, leftWidth: xpositionStart, heightTop: start, heightBottom: end };
|
|
9608
9644
|
let labelElement;
|
|
9609
9645
|
if (eventargs.template !== '') {
|
|
9610
|
-
templateFn = getTemplateFunction(eventargs.template);
|
|
9646
|
+
templateFn = getTemplateFunction(eventargs.template, this.maps);
|
|
9611
9647
|
const templateElement = templateFn ? templateFn(!isNullOrUndefined(datasrcObj) ?
|
|
9612
9648
|
datasrcObj : shapeData['properties'], this.maps, eventargs.template, this.maps.element.id + '_LabelTemplate', false) : document.createElement('div');
|
|
9613
9649
|
templateElement.innerHTML = !templateFn ? eventargs.template : '';
|
|
@@ -11214,7 +11250,7 @@ class Legend {
|
|
|
11214
11250
|
data[this.maps.legendSettings.showLegendPath];
|
|
11215
11251
|
if (marker$$1.visible && showLegend && (!isNullOrUndefined(data['latitude'])) && (!isNullOrUndefined(data['longitude']))) {
|
|
11216
11252
|
if (marker$$1.template) {
|
|
11217
|
-
templateFn = getTemplateFunction(marker$$1.template);
|
|
11253
|
+
templateFn = getTemplateFunction(marker$$1.template, this.maps);
|
|
11218
11254
|
const templateElement = templateFn(this.maps);
|
|
11219
11255
|
const markerEle = isNullOrUndefined(templateElement.childElementCount) ? templateElement[0] :
|
|
11220
11256
|
templateElement;
|
|
@@ -12687,6 +12723,10 @@ class MapsTooltip {
|
|
|
12687
12723
|
fill: tooltipArgs.fill || this.maps.themeStyle.tooltipFillColor
|
|
12688
12724
|
});
|
|
12689
12725
|
}
|
|
12726
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12727
|
+
if (this.maps.isVue || this.maps.isVue3) {
|
|
12728
|
+
this.svgTooltip.controlInstance = this.maps;
|
|
12729
|
+
}
|
|
12690
12730
|
this.svgTooltip.opacity = this.maps.themeStyle.tooltipFillOpacity || this.svgTooltip.opacity;
|
|
12691
12731
|
this.svgTooltip.appendTo(tooltipEle);
|
|
12692
12732
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -12700,9 +12740,7 @@ class MapsTooltip {
|
|
|
12700
12740
|
}
|
|
12701
12741
|
}
|
|
12702
12742
|
else {
|
|
12703
|
-
this.
|
|
12704
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12705
|
-
this.maps.clearTemplate();
|
|
12743
|
+
this.clearTooltip();
|
|
12706
12744
|
}
|
|
12707
12745
|
});
|
|
12708
12746
|
if (this.svgTooltip) {
|
|
@@ -12717,9 +12755,7 @@ class MapsTooltip {
|
|
|
12717
12755
|
});
|
|
12718
12756
|
}
|
|
12719
12757
|
else {
|
|
12720
|
-
this.
|
|
12721
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12722
|
-
this.maps.clearTemplate();
|
|
12758
|
+
this.clearTooltip();
|
|
12723
12759
|
}
|
|
12724
12760
|
}
|
|
12725
12761
|
else {
|
|
@@ -12729,9 +12765,7 @@ class MapsTooltip {
|
|
|
12729
12765
|
this.maps.notify(click, this);
|
|
12730
12766
|
}
|
|
12731
12767
|
else {
|
|
12732
|
-
this.
|
|
12733
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12734
|
-
this.maps.clearTemplate();
|
|
12768
|
+
this.clearTooltip();
|
|
12735
12769
|
}
|
|
12736
12770
|
}
|
|
12737
12771
|
}
|
|
@@ -12775,8 +12809,18 @@ class MapsTooltip {
|
|
|
12775
12809
|
}
|
|
12776
12810
|
}
|
|
12777
12811
|
removeTooltip() {
|
|
12812
|
+
let isTooltipRemoved = false;
|
|
12778
12813
|
if (document.getElementsByClassName('EJ2-maps-Tooltip').length > 0) {
|
|
12779
12814
|
remove(document.getElementsByClassName('EJ2-maps-Tooltip')[0]);
|
|
12815
|
+
isTooltipRemoved = true;
|
|
12816
|
+
}
|
|
12817
|
+
return isTooltipRemoved;
|
|
12818
|
+
}
|
|
12819
|
+
clearTooltip() {
|
|
12820
|
+
const isTooltipRemoved = this.removeTooltip();
|
|
12821
|
+
if (isTooltipRemoved) {
|
|
12822
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12823
|
+
this.maps.clearTemplate();
|
|
12780
12824
|
}
|
|
12781
12825
|
}
|
|
12782
12826
|
// eslint-disable-next-line valid-jsdoc
|
|
@@ -13363,10 +13407,10 @@ class Zoom {
|
|
|
13363
13407
|
}
|
|
13364
13408
|
const lati = (!isNullOrUndefined(markerSettings.latitudeValuePath)) ?
|
|
13365
13409
|
Number(getValueFromObject(data, markerSettings.latitudeValuePath)) : !isNullOrUndefined(data['latitude']) ?
|
|
13366
|
-
parseFloat(data['latitude']) : !isNullOrUndefined(data['Latitude']) ? data['Latitude'] :
|
|
13410
|
+
parseFloat(data['latitude']) : !isNullOrUndefined(data['Latitude']) ? data['Latitude'] : null;
|
|
13367
13411
|
const long = (!isNullOrUndefined(markerSettings.longitudeValuePath)) ?
|
|
13368
13412
|
Number(getValueFromObject(data, markerSettings.longitudeValuePath)) : !isNullOrUndefined(data['longitude']) ?
|
|
13369
|
-
parseFloat(data['longitude']) : !isNullOrUndefined(data['Longitude']) ? data['Longitude'] :
|
|
13413
|
+
parseFloat(data['longitude']) : !isNullOrUndefined(data['Longitude']) ? data['Longitude'] : null;
|
|
13370
13414
|
const offset = markerSettings.offset;
|
|
13371
13415
|
if (!eventArgs.cancel && markerSettings.visible && !isNullOrUndefined(long) && !isNullOrUndefined(lati)) {
|
|
13372
13416
|
const markerID = this.maps.element.id + '_LayerIndex_' + layerIndex + '_MarkerIndex_'
|
|
@@ -13386,10 +13430,10 @@ class Zoom {
|
|
|
13386
13430
|
nullCount += (!isNaN(lati) && !isNaN(long)) ? 0 : 1;
|
|
13387
13431
|
markerTemplateCounts += (eventArgs.cancel) ? 1 : 0;
|
|
13388
13432
|
markerCounts += (eventArgs.cancel) ? 1 : 0;
|
|
13389
|
-
this.maps.markerNullCount = (
|
|
13390
|
-
? this.maps.markerNullCount : this.maps.markerNullCount
|
|
13433
|
+
this.maps.markerNullCount = (isNullOrUndefined(lati) || isNullOrUndefined(long))
|
|
13434
|
+
? this.maps.markerNullCount + 1 : this.maps.markerNullCount;
|
|
13391
13435
|
const markerDataLength = markerDatas.length - this.maps.markerNullCount;
|
|
13392
|
-
if (markerSVGObject.childElementCount === (
|
|
13436
|
+
if (markerSVGObject.childElementCount === (markerDataLength - markerTemplateCounts - nullCount) && (type !== 'Template')) {
|
|
13393
13437
|
layerElement.appendChild(markerSVGObject);
|
|
13394
13438
|
if (currentLayers.markerClusterSettings.allowClustering) {
|
|
13395
13439
|
this.maps.svgObject.appendChild(markerSVGObject);
|
|
@@ -13397,7 +13441,7 @@ class Zoom {
|
|
|
13397
13441
|
clusterTemplate(currentLayers, markerSVGObject, this.maps, layerIndex, markerSVGObject, layerElement, true, true);
|
|
13398
13442
|
}
|
|
13399
13443
|
}
|
|
13400
|
-
if (markerTemplateElements.childElementCount === (
|
|
13444
|
+
if (markerTemplateElements.childElementCount === (markerDataLength - markerCounts - nullCount) && getElementByID(this.maps.element.id + '_Secondary_Element')) {
|
|
13401
13445
|
getElementByID(this.maps.element.id + '_Secondary_Element').appendChild(markerTemplateElements);
|
|
13402
13446
|
if (scale >= 1) {
|
|
13403
13447
|
if (currentLayers.markerClusterSettings.allowClustering) {
|
|
@@ -13837,7 +13881,7 @@ class Zoom {
|
|
|
13837
13881
|
const map = this.maps;
|
|
13838
13882
|
this.toolBarGroup = map.renderer.createGroup({
|
|
13839
13883
|
id: map.element.id + '_Zooming_KitCollection',
|
|
13840
|
-
opacity: map.theme.toLowerCase() === '
|
|
13884
|
+
opacity: map.theme.toLowerCase() === 'fluentdark' ? 0.6 : 0.3
|
|
13841
13885
|
});
|
|
13842
13886
|
const kitHeight = 16;
|
|
13843
13887
|
const kitWidth = 16;
|
|
@@ -14241,14 +14285,14 @@ class Zoom {
|
|
|
14241
14285
|
if (document.getElementById(map.element.id + '_Zooming_ToolBar_Pan_Group')) {
|
|
14242
14286
|
if (!this.maps.zoomSettings.enablePanning) {
|
|
14243
14287
|
if (target.id.indexOf('_Zooming_ToolBar') > -1 || target.id.indexOf('_Zooming_Rect') > -1) {
|
|
14244
|
-
getElementByID(map.element.id + '_Zooming_ToolBar_Pan_Rect').setAttribute('opacity', map.theme.toLowerCase() === '
|
|
14245
|
-
getElementByID(map.element.id + '_Zooming_ToolBar_Pan').setAttribute('opacity', map.theme.toLowerCase() === '
|
|
14288
|
+
getElementByID(map.element.id + '_Zooming_ToolBar_Pan_Rect').setAttribute('opacity', map.theme.toLowerCase() === 'fluentdark' ? '0.6' : '0.3');
|
|
14289
|
+
getElementByID(map.element.id + '_Zooming_ToolBar_Pan').setAttribute('opacity', map.theme.toLowerCase() === 'fluentdark' ? '0.6' : '0.3');
|
|
14246
14290
|
}
|
|
14247
14291
|
}
|
|
14248
14292
|
}
|
|
14249
14293
|
}
|
|
14250
14294
|
else {
|
|
14251
|
-
getElementByID(map.element.id + '_Zooming_KitCollection').setAttribute('opacity', map.theme.toLowerCase() === '
|
|
14295
|
+
getElementByID(map.element.id + '_Zooming_KitCollection').setAttribute('opacity', map.theme.toLowerCase() === 'fluentdark' ? '0.6' : '0.3');
|
|
14252
14296
|
if (!this.maps.zoomSettings.enablePanning && document.getElementById(map.element.id + '_Zooming_ToolBar_Pan_Group')) {
|
|
14253
14297
|
getElementByID(map.element.id + '_Zooming_ToolBar_Pan_Rect').setAttribute('opacity', '1');
|
|
14254
14298
|
getElementByID(map.element.id + '_Zooming_ToolBar_Pan').setAttribute('opacity', '1');
|
|
@@ -14453,7 +14497,29 @@ class Print {
|
|
|
14453
14497
|
* @private
|
|
14454
14498
|
*/
|
|
14455
14499
|
getHTMLContent(elements) {
|
|
14456
|
-
const
|
|
14500
|
+
const elementRect = getClientElement(this.control.element.id);
|
|
14501
|
+
let div = createElement('div');
|
|
14502
|
+
let divElement = this.control.element.cloneNode(true);
|
|
14503
|
+
if (this.control.isTileMap) {
|
|
14504
|
+
for (let i = 0; i < divElement.childElementCount; i++) {
|
|
14505
|
+
if (divElement.children[i].id === this.control.element.id + '_tile_parent') {
|
|
14506
|
+
divElement.children[i].style.removeProperty('height');
|
|
14507
|
+
divElement.children[i].style.removeProperty('width');
|
|
14508
|
+
divElement.children[i].style.removeProperty('top');
|
|
14509
|
+
divElement.children[i].style.removeProperty('left');
|
|
14510
|
+
divElement.children[i].style.removeProperty('right');
|
|
14511
|
+
divElement.children[i].style.removeProperty('overflow');
|
|
14512
|
+
const svgElement = document.getElementById(this.control.element.id + '_Tile_SVG_Parent');
|
|
14513
|
+
divElement.children[i].children[0].style.overflow = 'hidden';
|
|
14514
|
+
divElement.children[i].children[0].style.position = 'absolute';
|
|
14515
|
+
divElement.children[i].children[0].style.height = svgElement.style.height;
|
|
14516
|
+
divElement.children[i].children[0].style.width = svgElement.style.width;
|
|
14517
|
+
divElement.children[i].children[0].style.left = svgElement.style.left;
|
|
14518
|
+
divElement.children[i].children[0].style.top = svgElement.style.top;
|
|
14519
|
+
break;
|
|
14520
|
+
}
|
|
14521
|
+
}
|
|
14522
|
+
}
|
|
14457
14523
|
if (elements) {
|
|
14458
14524
|
if (elements instanceof Array) {
|
|
14459
14525
|
Array.prototype.forEach.call(elements, (value) => {
|
|
@@ -14468,7 +14534,7 @@ class Print {
|
|
|
14468
14534
|
}
|
|
14469
14535
|
}
|
|
14470
14536
|
else {
|
|
14471
|
-
div.appendChild(
|
|
14537
|
+
div.appendChild(divElement);
|
|
14472
14538
|
}
|
|
14473
14539
|
return div;
|
|
14474
14540
|
}
|
|
@@ -14532,17 +14598,19 @@ class ImageExport {
|
|
|
14532
14598
|
const toolbarEle = document.getElementById(this.control.element.id + '_ToolBar');
|
|
14533
14599
|
const svgParent = document.getElementById(this.control.element.id + '_Tile_SVG_Parent');
|
|
14534
14600
|
let svgDataElement;
|
|
14601
|
+
let tileSvg;
|
|
14602
|
+
let svgObject = getElementByID(this.control.element.id + '_svg').cloneNode(true);
|
|
14535
14603
|
if (!this.control.isTileMap) {
|
|
14536
14604
|
svgDataElement = '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">' +
|
|
14537
14605
|
this.control.svgObject.outerHTML + '</svg>';
|
|
14538
14606
|
}
|
|
14539
14607
|
else {
|
|
14540
|
-
|
|
14608
|
+
tileSvg = getElementByID(this.control.element.id + '_Tile_SVG').cloneNode(true);
|
|
14541
14609
|
svgDataElement = '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">' +
|
|
14542
|
-
|
|
14610
|
+
svgObject.outerHTML + tileSvg.outerHTML + '</svg>';
|
|
14543
14611
|
}
|
|
14544
14612
|
const url = window.URL.createObjectURL(new Blob(type === 'SVG' ? [svgDataElement] :
|
|
14545
|
-
[(new XMLSerializer()).serializeToString(
|
|
14613
|
+
[(new XMLSerializer()).serializeToString(svgObject)], { type: 'image/svg+xml' }));
|
|
14546
14614
|
if (type === 'SVG') {
|
|
14547
14615
|
if (allowDownload) {
|
|
14548
14616
|
triggerDownload(fileName, type, url, isDownload);
|
|
@@ -14582,8 +14650,11 @@ class ImageExport {
|
|
|
14582
14650
|
ctxt.fillStyle = this.control.background ? this.control.background : '#FFFFFF';
|
|
14583
14651
|
ctxt.fillRect(0, 0, this.control.availableSize.width, this.control.availableSize.height);
|
|
14584
14652
|
ctxt.font = this.control.titleSettings.textStyle.size + ' Arial';
|
|
14585
|
-
|
|
14586
|
-
|
|
14653
|
+
let titleElement = document.getElementById(this.control.element.id + '_Map_title');
|
|
14654
|
+
if (!isNullOrUndefined(titleElement)) {
|
|
14655
|
+
ctxt.fillStyle = titleElement.getAttribute('fill');
|
|
14656
|
+
ctxt.fillText(this.control.titleSettings.text, parseFloat(titleElement.getAttribute('x')), parseFloat(titleElement.getAttribute('y')));
|
|
14657
|
+
}
|
|
14587
14658
|
exportTileImg.onload = (() => {
|
|
14588
14659
|
if (i === 0 || i === imgTileLength + 1) {
|
|
14589
14660
|
if (i === 0) {
|
|
@@ -14596,8 +14667,9 @@ class ImageExport {
|
|
|
14596
14667
|
}
|
|
14597
14668
|
}
|
|
14598
14669
|
else {
|
|
14670
|
+
const tileParent = document.getElementById(this.control.element.id + '_tile_parent');
|
|
14599
14671
|
ctxt.setTransform(1, 0, 0, 1, parseFloat(tile.style.left) + 10, parseFloat(tile.style.top) +
|
|
14600
|
-
(parseFloat(
|
|
14672
|
+
(parseFloat(tileParent.style.top)));
|
|
14601
14673
|
}
|
|
14602
14674
|
ctxt.drawImage(exportTileImg, 0, 0);
|
|
14603
14675
|
if (i === imgTileLength + 1) {
|
|
@@ -14623,7 +14695,7 @@ class ImageExport {
|
|
|
14623
14695
|
}
|
|
14624
14696
|
else {
|
|
14625
14697
|
setTimeout(() => {
|
|
14626
|
-
exportTileImg.src = window.URL.createObjectURL(new Blob([(new XMLSerializer()).serializeToString(
|
|
14698
|
+
exportTileImg.src = window.URL.createObjectURL(new Blob([(new XMLSerializer()).serializeToString(tileSvg)], { type: 'image/svg+xml' }));
|
|
14627
14699
|
}, 300);
|
|
14628
14700
|
}
|
|
14629
14701
|
}
|
|
@@ -14701,8 +14773,8 @@ class PdfExport {
|
|
|
14701
14773
|
const exportElement = this.control.svgObject.cloneNode(true);
|
|
14702
14774
|
const backgroundElement = exportElement.childNodes[0];
|
|
14703
14775
|
const backgroundColor = backgroundElement.getAttribute('fill');
|
|
14704
|
-
if ((this.control.theme === 'Tailwind' || this.control.theme === 'TailwindDark' || this.control.theme === 'Bootstrap5' || this.control.theme === 'Bootstrap5Dark'
|
|
14705
|
-
&& (backgroundColor === 'rgba(255,255,255, 0.0)' || backgroundColor === 'transparent')) {
|
|
14776
|
+
if ((this.control.theme === 'Tailwind' || this.control.theme === 'TailwindDark' || this.control.theme === 'Bootstrap5' || this.control.theme === 'Bootstrap5Dark'
|
|
14777
|
+
|| this.control.theme === 'Fluent' || this.control.theme === 'FluentDark') && (backgroundColor === 'rgba(255,255,255, 0.0)' || backgroundColor === 'transparent')) {
|
|
14706
14778
|
exportElement.childNodes[0].setAttribute('fill', 'rgba(255,255,255, 1)');
|
|
14707
14779
|
}
|
|
14708
14780
|
const url = window.URL.createObjectURL(new Blob(type === 'SVG' ? [svgData] :
|
|
@@ -14740,8 +14812,11 @@ class PdfExport {
|
|
|
14740
14812
|
ctx.fillStyle = this.control.background ? this.control.background : '#FFFFFF';
|
|
14741
14813
|
ctx.fillRect(0, 0, this.control.availableSize.width, this.control.availableSize.height);
|
|
14742
14814
|
ctx.font = this.control.titleSettings.textStyle.size + ' Arial';
|
|
14743
|
-
|
|
14744
|
-
|
|
14815
|
+
let titleElement = document.getElementById(this.control.element.id + '_Map_title');
|
|
14816
|
+
if (!isNullOrUndefined(titleElement)) {
|
|
14817
|
+
ctx.fillStyle = titleElement.getAttribute('fill');
|
|
14818
|
+
ctx.fillText(this.control.titleSettings.text, parseFloat(titleElement.getAttribute('x')), parseFloat(titleElement.getAttribute('y')));
|
|
14819
|
+
}
|
|
14745
14820
|
tileImg.onload = (() => {
|
|
14746
14821
|
if (i === 0 || i === tileLength + 1) {
|
|
14747
14822
|
if (i === 0) {
|
|
@@ -14754,8 +14829,9 @@ class PdfExport {
|
|
|
14754
14829
|
}
|
|
14755
14830
|
}
|
|
14756
14831
|
else {
|
|
14832
|
+
const tileParent = document.getElementById(this.control.element.id + '_tile_parent');
|
|
14757
14833
|
ctx.setTransform(1, 0, 0, 1, parseFloat(tile.style.left) + 10, parseFloat(tile.style.top) +
|
|
14758
|
-
(parseFloat(
|
|
14834
|
+
(parseFloat(tileParent.style.top)));
|
|
14759
14835
|
}
|
|
14760
14836
|
ctx.drawImage(tileImg, 0, 0);
|
|
14761
14837
|
if (i === tileLength + 1) {
|
|
@@ -14781,7 +14857,8 @@ class PdfExport {
|
|
|
14781
14857
|
}
|
|
14782
14858
|
else {
|
|
14783
14859
|
setTimeout(() => {
|
|
14784
|
-
|
|
14860
|
+
let tileSvg = document.getElementById(this.control.element.id + '_Tile_SVG');
|
|
14861
|
+
tileImg.src = window.URL.createObjectURL(new Blob([(new XMLSerializer()).serializeToString(tileSvg)], { type: 'image/svg+xml' }));
|
|
14785
14862
|
}, 300);
|
|
14786
14863
|
}
|
|
14787
14864
|
}
|
|
@@ -14825,5 +14902,5 @@ class PdfExport {
|
|
|
14825
14902
|
* exporting all modules from maps index
|
|
14826
14903
|
*/
|
|
14827
14904
|
|
|
14828
|
-
export { Maps, load, loaded, click, rightClick, doubleClick, resize, tooltipRender, shapeSelected, shapeHighlight, mousemove, mouseup, mousedown, layerRendering, shapeRendering, markerRendering, markerClusterRendering, markerClick, markerClusterClick, markerMouseMove, markerClusterMouseMove, dataLabelRendering, bubbleRendering, bubbleClick, bubbleMouseMove, animationComplete, legendRendering, annotationRendering, itemSelection, itemHighlight, beforePrint, zoomIn, zoomOut, pan, Annotation, Arrow, Font, Border, CenterPosition, TooltipSettings, Margin, ConnectorLineSettings, MarkerClusterSettings, MarkerClusterData, ColorMappingSettings, InitialMarkerSelectionSettings, InitialShapeSelectionSettings, SelectionSettings, HighlightSettings, NavigationLineSettings, BubbleSettings, CommonTitleSettings, SubTitleSettings, TitleSettings, ZoomSettings, ToggleLegendSettings, LegendSettings, DataLabelSettings, ShapeSettings, MarkerBase, MarkerSettings, LayerSettings, Tile, MapsAreaSettings, Size, stringToNumber, calculateSize, createSvg, getMousePosition, degreesToRadians, radiansToDegrees, convertGeoToPoint, convertTileLatLongToPoint, xToCoordinate, yToCoordinate, aitoff, roundTo, sinci, acos, calculateBound, triggerDownload, Point, MinMax, GeoLocation, measureText, TextOption, PathOption, ColorValue, RectOption, CircleOption, PolygonOption, PolylineOption, LineOption, Line, MapLocation, Rect, PatternOptions, renderTextElement, convertElement, formatValue, convertStringToValue, convertElementFromLabel, drawSymbols, getValueFromObject, markerColorChoose, markerShapeChoose, clusterTemplate, mergeSeparateCluster, clusterSeparate, marker, markerTemplate, maintainSelection, maintainStyleClass, appendShape, drawCircle, drawRectangle, drawPath, drawPolygon, drawPolyline, drawLine, calculateShapes, drawDiamond, drawTriangle, drawCross, drawHorizontalLine, drawVerticalLine, drawStar, drawBalloon, drawPattern, getFieldData, checkShapeDataFields, checkPropertyPath, filter, getRatioOfBubble, findMidPointOfPolygon, isCustomPath, textTrim, findPosition, removeElement, calculateCenterFromPixel, getTranslate, getZoomTranslate, fixInitialScaleForTile, getElementByID, Internalize, getTemplateFunction, getElement, getShapeData, triggerShapeEvent, getElementsByClassName, querySelector, getTargetElement, createStyle, customizeStyle, triggerItemSelectionEvent, removeClass, elementAnimate, timeout, showTooltip, wordWrap, createTooltip, drawSymbol, renderLegendShape, getElementOffset, changeBorderWidth, changeNavaigationLineWidth, targetTouches, calculateScale, getDistance, getTouches, getTouchCenter, sum, zoomAnimate, animate, MapAjax, smoothTranslate, compareZoomFactor, calculateZoomLevel, processResult, LayerPanel, Bubble, BingMap, Marker, ColorMapping, DataLabel, NavigationLine, Legend, Highlight, Selection, MapsTooltip, Zoom, Annotations, Print, ImageExport, PdfExport };
|
|
14905
|
+
export { Maps, load, loaded, click, rightClick, doubleClick, resize, tooltipRender, shapeSelected, shapeHighlight, mousemove, mouseup, mousedown, layerRendering, shapeRendering, markerRendering, markerClusterRendering, markerClick, markerClusterClick, markerMouseMove, markerClusterMouseMove, dataLabelRendering, bubbleRendering, bubbleClick, bubbleMouseMove, animationComplete, legendRendering, annotationRendering, itemSelection, itemHighlight, beforePrint, zoomIn, zoomOut, pan, Annotation, Arrow, Font, Border, CenterPosition, TooltipSettings, Margin, ConnectorLineSettings, MarkerClusterSettings, MarkerClusterData, ColorMappingSettings, InitialMarkerSelectionSettings, InitialShapeSelectionSettings, SelectionSettings, HighlightSettings, NavigationLineSettings, BubbleSettings, CommonTitleSettings, SubTitleSettings, TitleSettings, ZoomSettings, ToggleLegendSettings, LegendSettings, DataLabelSettings, ShapeSettings, MarkerBase, MarkerSettings, LayerSettings, Tile, MapsAreaSettings, Size, stringToNumber, calculateSize, createSvg, getMousePosition, degreesToRadians, radiansToDegrees, convertGeoToPoint, convertTileLatLongToPoint, xToCoordinate, yToCoordinate, aitoff, roundTo, sinci, acos, calculateBound, triggerDownload, Point, MinMax, GeoLocation, measureText, TextOption, PathOption, ColorValue, RectOption, CircleOption, PolygonOption, PolylineOption, LineOption, Line, MapLocation, Rect, PatternOptions, renderTextElement, convertElement, formatValue, convertStringToValue, convertElementFromLabel, drawSymbols, getValueFromObject, markerColorChoose, markerShapeChoose, clusterTemplate, mergeSeparateCluster, clusterSeparate, marker, markerTemplate, maintainSelection, maintainStyleClass, appendShape, drawCircle, drawRectangle, drawPath, drawPolygon, drawPolyline, drawLine, calculateShapes, drawDiamond, drawTriangle, drawCross, drawHorizontalLine, drawVerticalLine, drawStar, drawBalloon, drawPattern, getFieldData, checkShapeDataFields, checkPropertyPath, filter, getRatioOfBubble, findMidPointOfPolygon, isCustomPath, textTrim, findPosition, removeElement, calculateCenterFromPixel, getTranslate, getZoomTranslate, fixInitialScaleForTile, getElementByID, getClientElement, Internalize, getTemplateFunction, getElement, getShapeData, triggerShapeEvent, getElementsByClassName, querySelector, getTargetElement, createStyle, customizeStyle, triggerItemSelectionEvent, removeClass, elementAnimate, timeout, showTooltip, wordWrap, createTooltip, drawSymbol, renderLegendShape, getElementOffset, changeBorderWidth, changeNavaigationLineWidth, targetTouches, calculateScale, getDistance, getTouches, getTouchCenter, sum, zoomAnimate, animate, MapAjax, smoothTranslate, compareZoomFactor, calculateZoomLevel, processResult, LayerPanel, Bubble, BingMap, Marker, ColorMapping, DataLabel, NavigationLine, Legend, Highlight, Selection, MapsTooltip, Zoom, Annotations, Print, ImageExport, PdfExport };
|
|
14829
14906
|
//# sourceMappingURL=ej2-maps.es2015.js.map
|