@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
|
@@ -3,8 +3,6 @@ import { SvgRenderer, Tooltip } from '@syncfusion/ej2-svg-base';
|
|
|
3
3
|
import { DataManager, Query } from '@syncfusion/ej2-data';
|
|
4
4
|
import { PdfBitmap, PdfDocument, PdfPageOrientation } from '@syncfusion/ej2-pdf-export';
|
|
5
5
|
|
|
6
|
-
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
|
7
|
-
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
8
6
|
/* eslint-disable max-len */
|
|
9
7
|
/**
|
|
10
8
|
* Helper functions for maps control
|
|
@@ -614,9 +612,9 @@ function renderTextElement(option, style, color, parent, isMinus = false) {
|
|
|
614
612
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
615
613
|
function convertElement(element, markerId, data, index, mapObj) {
|
|
616
614
|
const childElement = createElement('div', {
|
|
617
|
-
id: markerId
|
|
618
|
-
styles: 'position: absolute;pointer-events: auto;'
|
|
615
|
+
id: markerId
|
|
619
616
|
});
|
|
617
|
+
childElement.style.cssText = 'position: absolute;pointer-events: auto;';
|
|
620
618
|
let elementLength = element.length;
|
|
621
619
|
while (elementLength > 0) {
|
|
622
620
|
childElement.appendChild(element[0]);
|
|
@@ -624,13 +622,14 @@ function convertElement(element, markerId, data, index, mapObj) {
|
|
|
624
622
|
}
|
|
625
623
|
let templateHtml = childElement.innerHTML;
|
|
626
624
|
const properties = Object.keys(data);
|
|
625
|
+
const regExp = RegExp;
|
|
627
626
|
for (let i = 0; i < properties.length; i++) {
|
|
628
627
|
if (typeof data[properties[i]] === 'object') {
|
|
629
628
|
templateHtml = convertStringToValue(templateHtml, '', data, mapObj);
|
|
630
629
|
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
631
630
|
}
|
|
632
631
|
else if (properties[i].toLowerCase() !== 'latitude' && properties[i].toLowerCase() !== 'longitude') {
|
|
633
|
-
templateHtml = templateHtml.replace(new
|
|
632
|
+
templateHtml = templateHtml.replace(new regExp('{{:' + properties[i] + '}}', 'g'), data[properties[i].toString()]);
|
|
634
633
|
}
|
|
635
634
|
}
|
|
636
635
|
childElement.innerHTML = templateHtml;
|
|
@@ -667,6 +666,7 @@ function formatValue(value, maps) {
|
|
|
667
666
|
function convertStringToValue(stringTemplate, format, data, maps) {
|
|
668
667
|
let templateHtml = (stringTemplate === '') ? format : stringTemplate;
|
|
669
668
|
const templateValue = (stringTemplate === '') ? templateHtml.split('${') : templateHtml.split('{{:');
|
|
669
|
+
const regExp = RegExp;
|
|
670
670
|
for (let i = 0; i < templateValue.length; i++) {
|
|
671
671
|
if ((templateValue[i].indexOf('}}') > -1 && templateValue[i].indexOf('.') > -1) ||
|
|
672
672
|
(templateValue[i].indexOf('}') > -1 && templateValue[i].search('.') > -1)) {
|
|
@@ -676,7 +676,7 @@ function convertStringToValue(stringTemplate, format, data, maps) {
|
|
|
676
676
|
const templateSplitValue = (getValueFromObject(data, split[j])).toString();
|
|
677
677
|
templateHtml = (stringTemplate === '') ?
|
|
678
678
|
templateHtml.split('${' + split[j] + '}').join(formatValue(templateSplitValue, maps)) :
|
|
679
|
-
templateHtml.replace(new
|
|
679
|
+
templateHtml.replace(new regExp('{{:' + split[j] + '}}', 'g'), templateSplitValue);
|
|
680
680
|
}
|
|
681
681
|
}
|
|
682
682
|
}
|
|
@@ -698,15 +698,17 @@ function convertElementFromLabel(element, labelId, data, index, mapObj) {
|
|
|
698
698
|
let templateHtml = labelEle.outerHTML;
|
|
699
699
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
700
700
|
const properties = Object.keys(data);
|
|
701
|
+
const regExp = RegExp;
|
|
701
702
|
for (let i = 0; i < properties.length; i++) {
|
|
702
703
|
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
703
|
-
templateHtml = templateHtml.replace(new
|
|
704
|
+
templateHtml = templateHtml.replace(new regExp('{{:' + properties[i] + '}}', 'g'), data[properties[i].toString()]);
|
|
704
705
|
}
|
|
705
|
-
|
|
706
|
+
const templateEle = createElement('div', {
|
|
706
707
|
id: labelId,
|
|
707
|
-
innerHTML: templateHtml
|
|
708
|
-
styles: 'position: absolute'
|
|
708
|
+
innerHTML: templateHtml
|
|
709
709
|
});
|
|
710
|
+
templateEle.style.position = 'absolute';
|
|
711
|
+
return templateEle;
|
|
710
712
|
}
|
|
711
713
|
/**
|
|
712
714
|
*
|
|
@@ -808,7 +810,7 @@ function markerShapeChoose(eventArgs, data) {
|
|
|
808
810
|
const shape = ((eventArgs.shapeValuePath.indexOf('.') > -1) ?
|
|
809
811
|
(getValueFromObject(data, eventArgs.shapeValuePath).toString()) :
|
|
810
812
|
data[eventArgs.shapeValuePath]);
|
|
811
|
-
eventArgs.shape = (shape.toString() !==
|
|
813
|
+
eventArgs.shape = (shape.toString() !== '') ? shape : eventArgs.shape;
|
|
812
814
|
if (data[eventArgs.shapeValuePath] === 'Image') {
|
|
813
815
|
eventArgs.imageUrl = (!isNullOrUndefined(eventArgs.imageUrlValuePath)) ?
|
|
814
816
|
((eventArgs.imageUrlValuePath.indexOf('.') > -1) ? getValueFromObject(data, eventArgs.imageUrlValuePath).toString() : (!isNullOrUndefined(data[eventArgs.imageUrlValuePath]) ?
|
|
@@ -817,7 +819,7 @@ function markerShapeChoose(eventArgs, data) {
|
|
|
817
819
|
}
|
|
818
820
|
else {
|
|
819
821
|
const shapes = (!isNullOrUndefined(eventArgs.shapeValuePath)) ? ((eventArgs.shapeValuePath.indexOf('.') > -1) ? getValueFromObject(data, eventArgs.shapeValuePath).toString() : eventArgs.shape) : eventArgs.shape;
|
|
820
|
-
eventArgs.shape = (shapes.toString() !==
|
|
822
|
+
eventArgs.shape = (shapes.toString() !== '') ? shapes : eventArgs.shape;
|
|
821
823
|
const shapeImage = (!isNullOrUndefined(eventArgs.imageUrlValuePath)) ?
|
|
822
824
|
((eventArgs.imageUrlValuePath.indexOf('.') > -1) ? getValueFromObject(data, eventArgs.imageUrlValuePath).toString() : (!isNullOrUndefined(data[eventArgs.imageUrlValuePath]) ?
|
|
823
825
|
data[eventArgs.imageUrlValuePath] : eventArgs.imageUrl)) : eventArgs.imageUrl;
|
|
@@ -896,8 +898,6 @@ function clusterTemplate(currentLayer, markerTemplate, maps, layerIndex, markerC
|
|
|
896
898
|
container['top'] : (container['bottom'] - container['top'])));
|
|
897
899
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
898
900
|
const translate = (maps.isTileMap) ? new Object() : getTranslate(maps, currentLayer, false);
|
|
899
|
-
const transPoint = (maps.isTileMap) ? { x: 0, y: 0 } : (maps.translatePoint.x !== 0) ?
|
|
900
|
-
maps.translatePoint : translate['location'];
|
|
901
901
|
const dataIndex = parseInt(markerTemplate.childNodes[o]['id'].split('_dataIndex_')[1].split('_')[0], 10);
|
|
902
902
|
const markerIndex = parseInt(markerTemplate.childNodes[o]['id'].split('_MarkerIndex_')[1].split('_')[0], 10);
|
|
903
903
|
const markerSetting = currentLayer.markerSettings[markerIndex];
|
|
@@ -1039,7 +1039,7 @@ function clusterTemplate(currentLayer, markerTemplate, maps, layerIndex, markerC
|
|
|
1039
1039
|
markerCluster.remove();
|
|
1040
1040
|
}
|
|
1041
1041
|
if (zoomCheck) {
|
|
1042
|
-
|
|
1042
|
+
const layerGroupElement = document.getElementById(maps.element.id + '_Layer_Collections');
|
|
1043
1043
|
if (!isNullOrUndefined(layerGroupElement)) {
|
|
1044
1044
|
layerGroupElement.appendChild(layerElement);
|
|
1045
1045
|
}
|
|
@@ -1546,6 +1546,7 @@ function drawStar(maps, options, size, location, element) {
|
|
|
1546
1546
|
* @param {PathOption} options - Specifies the path options
|
|
1547
1547
|
* @param {Size} size - Specifies the size
|
|
1548
1548
|
* @param {MapLocation} location - Specifies the map location
|
|
1549
|
+
* @param {string} type - Specifies the type.
|
|
1549
1550
|
* @param {Element} element - Specifies the element
|
|
1550
1551
|
* @returns {Element} - Returns the element
|
|
1551
1552
|
* @private
|
|
@@ -2033,7 +2034,8 @@ function getTranslate(mapObject, layer, animate) {
|
|
|
2033
2034
|
mapObject.zoomTranslatePoint.y = y;
|
|
2034
2035
|
}
|
|
2035
2036
|
else {
|
|
2036
|
-
if (!isNullOrUndefined(mapObject.previousProjection) && (mapObject.mapScaleValue === 1
|
|
2037
|
+
if (!isNullOrUndefined(mapObject.previousProjection) && (mapObject.mapScaleValue === 1
|
|
2038
|
+
|| mapObject.mapScaleValue <= 1.05) && !mapObject.zoomModule.isDragZoom) {
|
|
2037
2039
|
scaleFactor = parseFloat(Math.min(size.width / mapWidth, size.height / mapHeight).toFixed(2));
|
|
2038
2040
|
scaleFactor = scaleFactor > 1.05 ? 1 : scaleFactor;
|
|
2039
2041
|
mapWidth *= scaleFactor;
|
|
@@ -2051,8 +2053,10 @@ function getTranslate(mapObject, layer, animate) {
|
|
|
2051
2053
|
}
|
|
2052
2054
|
}
|
|
2053
2055
|
if (!isNullOrUndefined(mapObject.translatePoint)) {
|
|
2054
|
-
x = (mapObject.enablePersistence && mapObject.translatePoint.x !== 0 && !mapObject.zoomNotApplied) ?
|
|
2055
|
-
|
|
2056
|
+
x = (mapObject.enablePersistence && mapObject.translatePoint.x !== 0 && !mapObject.zoomNotApplied) ?
|
|
2057
|
+
mapObject.translatePoint.x : x;
|
|
2058
|
+
y = (mapObject.enablePersistence && mapObject.translatePoint.y !== 0 && !mapObject.zoomNotApplied) ?
|
|
2059
|
+
mapObject.translatePoint.y : y;
|
|
2056
2060
|
}
|
|
2057
2061
|
}
|
|
2058
2062
|
scaleFactor = (mapObject.enablePersistence) ? ((mapObject.mapScaleValue >= 1) ? mapObject.mapScaleValue : 1) : scaleFactor;
|
|
@@ -2103,9 +2107,11 @@ function getZoomTranslate(mapObject, layer, animate) {
|
|
|
2103
2107
|
mapObject.mapScaleValue = mapObject.zoomSettings.zoomFactor !== 1 &&
|
|
2104
2108
|
mapObject.zoomSettings.zoomFactor ===
|
|
2105
2109
|
mapObject.mapScaleValue ? mapObject.zoomSettings.zoomFactor :
|
|
2106
|
-
mapObject.zoomSettings.zoomFactor !== mapObject.mapScaleValue && !mapObject.centerPositionChanged ?
|
|
2107
|
-
|
|
2108
|
-
|
|
2110
|
+
mapObject.zoomSettings.zoomFactor !== mapObject.mapScaleValue && !mapObject.centerPositionChanged ?
|
|
2111
|
+
mapObject.mapScaleValue : mapObject.zoomSettings.zoomFactor;
|
|
2112
|
+
if (mapObject.zoomSettings.shouldZoomInitially && !mapObject.isZoomByPosition) {
|
|
2113
|
+
mapObject.mapScaleValue = zoomFactorValue = scaleFactor = ((mapObject.enablePersistence
|
|
2114
|
+
|| mapObject.zoomSettings.shouldZoomInitially) && mapObject.scale === 1)
|
|
2109
2115
|
? mapObject.scale : (isNullOrUndefined(mapObject.markerZoomFactor)) ? mapObject.mapScaleValue : mapObject.markerZoomFactor;
|
|
2110
2116
|
zoomFactorValue = mapObject.mapScaleValue;
|
|
2111
2117
|
if (!isNullOrUndefined(mapObject.markerCenterLatitude) && !isNullOrUndefined(mapObject.markerCenterLongitude)) {
|
|
@@ -2132,12 +2138,17 @@ function getZoomTranslate(mapObject, layer, animate) {
|
|
|
2132
2138
|
const leftPosition = ((mapWidth + Math.abs(mapObject.mapAreaRect.width - mapWidth)) / 2) / factor;
|
|
2133
2139
|
const point = checkZoomMethod ? calculateCenterFromPixel(mapObject, layer) :
|
|
2134
2140
|
convertGeoToPoint(latitude, longitude, mapObject.mapLayerPanel.calculateFactor(layer), layer, mapObject);
|
|
2135
|
-
if ((!isNullOrUndefined(mapObject.zoomTranslatePoint) || !isNullOrUndefined(mapObject.previousProjection)) &&
|
|
2141
|
+
if ((!isNullOrUndefined(mapObject.zoomTranslatePoint) || !isNullOrUndefined(mapObject.previousProjection)) &&
|
|
2142
|
+
!mapObject.zoomNotApplied) {
|
|
2136
2143
|
if (mapObject.previousProjection !== mapObject.projectionType) {
|
|
2137
2144
|
x = -point.x + leftPosition;
|
|
2138
2145
|
y = -point.y + topPosition;
|
|
2139
2146
|
}
|
|
2140
2147
|
else {
|
|
2148
|
+
if (mapObject.isZoomByPosition) {
|
|
2149
|
+
mapObject.zoomTranslatePoint.x = -point.x + leftPosition;
|
|
2150
|
+
mapObject.zoomTranslatePoint.y = -point.y + topPosition;
|
|
2151
|
+
}
|
|
2141
2152
|
x = mapObject.zoomTranslatePoint.x;
|
|
2142
2153
|
y = mapObject.zoomTranslatePoint.y;
|
|
2143
2154
|
zoomFactorValue = zoomFactor;
|
|
@@ -2148,8 +2159,10 @@ function getZoomTranslate(mapObject, layer, animate) {
|
|
|
2148
2159
|
y = -point.y + topPosition + mapObject.mapAreaRect.y / zoomFactor;
|
|
2149
2160
|
}
|
|
2150
2161
|
if (!isNullOrUndefined(mapObject.translatePoint)) {
|
|
2151
|
-
y = (mapObject.enablePersistence && mapObject.translatePoint.y !== 0 && !mapObject.zoomNotApplied) ?
|
|
2152
|
-
|
|
2162
|
+
y = (mapObject.enablePersistence && mapObject.translatePoint.y !== 0 && !mapObject.zoomNotApplied) ?
|
|
2163
|
+
mapObject.translatePoint.y : y;
|
|
2164
|
+
x = (mapObject.enablePersistence && mapObject.translatePoint.x !== 0 && !mapObject.zoomNotApplied) ?
|
|
2165
|
+
mapObject.translatePoint.x : x;
|
|
2153
2166
|
}
|
|
2154
2167
|
scaleFactor = zoomFactorValue !== 0 ? zoomFactorValue : 1;
|
|
2155
2168
|
}
|
|
@@ -2187,8 +2200,10 @@ function getZoomTranslate(mapObject, layer, animate) {
|
|
|
2187
2200
|
}
|
|
2188
2201
|
}
|
|
2189
2202
|
if (!isNullOrUndefined(mapObject.translatePoint)) {
|
|
2190
|
-
x = (mapObject.enablePersistence && mapObject.translatePoint.x !== 0 && !mapObject.zoomNotApplied) ?
|
|
2191
|
-
|
|
2203
|
+
x = (mapObject.enablePersistence && mapObject.translatePoint.x !== 0 && !mapObject.zoomNotApplied) ?
|
|
2204
|
+
mapObject.translatePoint.x : leftPosition;
|
|
2205
|
+
y = (mapObject.enablePersistence && mapObject.translatePoint.y !== 0 && !mapObject.zoomNotApplied) ?
|
|
2206
|
+
mapObject.translatePoint.y : topPosition;
|
|
2192
2207
|
}
|
|
2193
2208
|
}
|
|
2194
2209
|
scaleFactor = (mapObject.enablePersistence) ? (mapObject.mapScaleValue === 0 ? 1 : mapObject.mapScaleValue) : scaleFactor;
|
|
@@ -2253,6 +2268,7 @@ function Internalize(maps, value) {
|
|
|
2253
2268
|
* Function to compile the template function for maps.
|
|
2254
2269
|
*
|
|
2255
2270
|
* @param {string} template - Specifies the template
|
|
2271
|
+
* @param {Maps} maps - Specifies the Maps instance.
|
|
2256
2272
|
* @returns {Function} - Returns the function
|
|
2257
2273
|
* @private
|
|
2258
2274
|
*/
|
|
@@ -2260,10 +2276,10 @@ function Internalize(maps, value) {
|
|
|
2260
2276
|
function getTemplateFunction(template, maps) {
|
|
2261
2277
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2262
2278
|
let templateFn = null;
|
|
2263
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2264
2279
|
try {
|
|
2265
2280
|
if (document.querySelectorAll(template).length) {
|
|
2266
2281
|
templateFn = compile(document.querySelector(template).innerHTML.trim());
|
|
2282
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2267
2283
|
}
|
|
2268
2284
|
else if (maps.isVue || maps.isVue3) {
|
|
2269
2285
|
templateFn = compile(template);
|
|
@@ -2345,7 +2361,7 @@ function triggerShapeEvent(targetId, selection, maps, eventName) {
|
|
|
2345
2361
|
target: targetId,
|
|
2346
2362
|
maps: maps
|
|
2347
2363
|
};
|
|
2348
|
-
maps.trigger(eventName, eventArgs, (
|
|
2364
|
+
maps.trigger(eventName, eventArgs, () => {
|
|
2349
2365
|
eventArgs.border.opacity = isNullOrUndefined(eventArgs.border.opacity) ? eventArgs.opacity : eventArgs.border.opacity;
|
|
2350
2366
|
});
|
|
2351
2367
|
return eventArgs;
|
|
@@ -2468,7 +2484,8 @@ shapeData, data) {
|
|
|
2468
2484
|
maps: map
|
|
2469
2485
|
};
|
|
2470
2486
|
map.trigger('itemSelection', eventArgs, (observedArgs) => {
|
|
2471
|
-
eventArgs.border.opacity = isNullOrUndefined(selectionSettings.border.opacity) ? selectionSettings.opacity :
|
|
2487
|
+
eventArgs.border.opacity = isNullOrUndefined(selectionSettings.border.opacity) ? selectionSettings.opacity :
|
|
2488
|
+
selectionSettings.border.opacity;
|
|
2472
2489
|
map.shapeSelectionItem.push(eventArgs.shapeData);
|
|
2473
2490
|
if (!getElement('ShapeselectionMap')) {
|
|
2474
2491
|
document.body.appendChild(createStyle('ShapeselectionMap', 'ShapeselectionMapStyle', eventArgs));
|
|
@@ -2567,16 +2584,16 @@ function showTooltip(text, size, x, y, areaWidth, areaHeight, id, element, isTou
|
|
|
2567
2584
|
let demo = str[0].length;
|
|
2568
2585
|
for (let i = 1; i < str.length; i++) {
|
|
2569
2586
|
if (demo < str[i].length) {
|
|
2570
|
-
demo = str[i].length;
|
|
2587
|
+
demo = (str[i]).length;
|
|
2571
2588
|
}
|
|
2572
2589
|
}
|
|
2573
2590
|
if (!tooltip) {
|
|
2574
2591
|
tooltip = createElement('div', {
|
|
2575
|
-
id: id
|
|
2576
|
-
styles: 'background-color: rgb(255, 255, 255) !important; color:black !important; ' +
|
|
2577
|
-
'position:absolute;border:1px solid rgb(0, 0, 0); padding-left:5px;' +
|
|
2578
|
-
'font-size:12px; font-family: "Segoe UI"; text-align:center'
|
|
2592
|
+
id: id
|
|
2579
2593
|
});
|
|
2594
|
+
tooltip.style.cssText = 'background-color: rgb(255, 255, 255) !important; color:black !important; ' +
|
|
2595
|
+
'position:absolute;border:1px solid rgb(0, 0, 0); padding-left:5px;' +
|
|
2596
|
+
'font-size:12px; font-family: "Segoe UI"; text-align:center';
|
|
2580
2597
|
}
|
|
2581
2598
|
if (x < (areaWidth - width)) {
|
|
2582
2599
|
// eslint-disable-next-line no-self-assign
|
|
@@ -2637,7 +2654,7 @@ function wordWrap(tooltip, text, x, y, size1, width, areaWidth, element) {
|
|
|
2637
2654
|
// if (touches) {
|
|
2638
2655
|
// touchList = [];
|
|
2639
2656
|
// for (let i: number = 0, length: number = touches.length; i < length; i++) {
|
|
2640
|
-
// touchList.push({ pageX: touches[i].clientX, pageY: touches[i].clientY, pointerId: null });
|
|
2657
|
+
// touchList.push({ pageX: touches[i as number].clientX, pageY: touches[i as number].clientY, pointerId: null });
|
|
2641
2658
|
// }
|
|
2642
2659
|
// } else {
|
|
2643
2660
|
// touchList = touchList ? touchList : [];
|
|
@@ -2645,8 +2662,8 @@ function wordWrap(tooltip, text, x, y, size1, width, areaWidth, element) {
|
|
|
2645
2662
|
// touchList.push({ pageX: e.clientX, pageY: e.clientY, pointerId: e.pointerId });
|
|
2646
2663
|
// } else {
|
|
2647
2664
|
// for (let i: number = 0, length: number = touchList.length; i < length; i++) {
|
|
2648
|
-
// if (touchList[i].pointerId === e.pointerId) {
|
|
2649
|
-
// touchList[i] = { pageX: e.clientX, pageY: e.clientY, pointerId: e.pointerId };
|
|
2665
|
+
// if (touchList[i as number].pointerId === e.pointerId) {
|
|
2666
|
+
// touchList[i as number] = { pageX: e.clientX, pageY: e.clientY, pointerId: e.pointerId };
|
|
2650
2667
|
// } else {
|
|
2651
2668
|
// touchList.push({ pageX: e.clientX, pageY: e.clientY, pointerId: e.pointerId });
|
|
2652
2669
|
// }
|
|
@@ -2674,13 +2691,14 @@ function createTooltip(id, text, top, left, fontSize) {
|
|
|
2674
2691
|
'position:absolute;border:1px solid #707070;font-size:' + fontSize + ';border-radius:2px;';
|
|
2675
2692
|
if (!tooltip) {
|
|
2676
2693
|
tooltip = createElement('div', {
|
|
2677
|
-
id: id, innerHTML: ' ' + text + ' '
|
|
2694
|
+
id: id, innerHTML: ' ' + text + ' '
|
|
2678
2695
|
});
|
|
2696
|
+
tooltip.style.cssText = style;
|
|
2679
2697
|
document.body.appendChild(tooltip);
|
|
2680
2698
|
}
|
|
2681
2699
|
else {
|
|
2682
|
-
tooltip.
|
|
2683
|
-
tooltip.
|
|
2700
|
+
tooltip.innerHTML = ' ' + text + ' ';
|
|
2701
|
+
tooltip.style.cssText = style;
|
|
2684
2702
|
}
|
|
2685
2703
|
}
|
|
2686
2704
|
/**
|
|
@@ -3075,8 +3093,8 @@ function animate(element, delay, duration, process, end) {
|
|
|
3075
3093
|
window.cancelAnimationFrame(clearAnimation);
|
|
3076
3094
|
end.call(this, { element: element });
|
|
3077
3095
|
if (element.id.indexOf('Marker') > -1) {
|
|
3078
|
-
|
|
3079
|
-
markerElement.
|
|
3096
|
+
const markerElement = getElementByID(element.id.split('_Layer')[0] + '_Markers_Group');
|
|
3097
|
+
markerElement.style.cssText = markerStyle;
|
|
3080
3098
|
}
|
|
3081
3099
|
}
|
|
3082
3100
|
};
|
|
@@ -3775,7 +3793,7 @@ var __decorate$1 = (undefined && undefined.__decorate) || function (decorators,
|
|
|
3775
3793
|
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;
|
|
3776
3794
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3777
3795
|
};
|
|
3778
|
-
/* eslint-disable
|
|
3796
|
+
/* eslint-disable max-len */
|
|
3779
3797
|
/**
|
|
3780
3798
|
* Maps base document
|
|
3781
3799
|
*/
|
|
@@ -4230,7 +4248,7 @@ __decorate$1([
|
|
|
4230
4248
|
Property(false)
|
|
4231
4249
|
], ZoomSettings.prototype, "doubleClickZoom", void 0);
|
|
4232
4250
|
__decorate$1([
|
|
4233
|
-
Property(
|
|
4251
|
+
Property(true)
|
|
4234
4252
|
], ZoomSettings.prototype, "pinchZooming", void 0);
|
|
4235
4253
|
__decorate$1([
|
|
4236
4254
|
Property(false)
|
|
@@ -4662,18 +4680,18 @@ class Marker {
|
|
|
4662
4680
|
const currentLayer = maps.layersCollection[layerIndex];
|
|
4663
4681
|
this.markerSVGObject = maps.renderer.createGroup({
|
|
4664
4682
|
id: maps.element.id + '_Markers_Group',
|
|
4665
|
-
class: 'GroupElement'
|
|
4666
|
-
style: 'pointer-events: auto;'
|
|
4683
|
+
class: 'GroupElement'
|
|
4667
4684
|
});
|
|
4685
|
+
this.markerSVGObject.style.pointerEvents = 'auto';
|
|
4668
4686
|
const markerTemplateEle = createElement('div', {
|
|
4669
4687
|
id: maps.element.id + '_LayerIndex_' + layerIndex + '_Markers_Template_Group',
|
|
4670
|
-
className: maps.element.id + '_template'
|
|
4671
|
-
styles: 'overflow: hidden; position: absolute;pointer-events: none;' +
|
|
4672
|
-
'top:' + maps.mapAreaRect.y + 'px;' +
|
|
4673
|
-
'left:' + maps.mapAreaRect.x + 'px;' +
|
|
4674
|
-
'height:' + maps.mapAreaRect.height + 'px;' +
|
|
4675
|
-
'width:' + maps.mapAreaRect.width + 'px;'
|
|
4688
|
+
className: maps.element.id + '_template'
|
|
4676
4689
|
});
|
|
4690
|
+
markerTemplateEle.style.cssText = 'overflow: hidden; position: absolute;pointer-events: none;' +
|
|
4691
|
+
'top:' + maps.mapAreaRect.y + 'px;' +
|
|
4692
|
+
'left:' + maps.mapAreaRect.x + 'px;' +
|
|
4693
|
+
'height:' + maps.mapAreaRect.height + 'px;' +
|
|
4694
|
+
'width:' + maps.mapAreaRect.width + 'px;';
|
|
4677
4695
|
currentLayer.markerSettings.map((markerSettings, markerIndex) => {
|
|
4678
4696
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4679
4697
|
const markerData = markerSettings.dataSource;
|
|
@@ -4723,7 +4741,8 @@ class Marker {
|
|
|
4723
4741
|
nullCount += (!isNaN(lat) && !isNaN(lng)) ? 0 : 1;
|
|
4724
4742
|
markerTemplateCount += (eventArgs.cancel) ? 1 : 0;
|
|
4725
4743
|
markerCount += (eventArgs.cancel) ? 1 : 0;
|
|
4726
|
-
maps.markerNullCount = (isNullOrUndefined(lng) || isNullOrUndefined(lat)) ?
|
|
4744
|
+
maps.markerNullCount = (isNullOrUndefined(lng) || isNullOrUndefined(lat)) ?
|
|
4745
|
+
maps.markerNullCount + 1 : maps.markerNullCount;
|
|
4727
4746
|
const markerDataLength = markerData.length - maps.markerNullCount;
|
|
4728
4747
|
if (this.markerSVGObject.childElementCount === (markerDataLength - markerTemplateCount - nullCount) && (type !== 'Template')) {
|
|
4729
4748
|
layerElement.appendChild(this.markerSVGObject);
|
|
@@ -4781,125 +4800,134 @@ class Marker {
|
|
|
4781
4800
|
}
|
|
4782
4801
|
/**
|
|
4783
4802
|
* To calculate center position and factor value dynamically
|
|
4803
|
+
*
|
|
4804
|
+
* @param {LayerSettings[]} layersCollection - Specifies the layer settings instance.
|
|
4805
|
+
* @returns {void}
|
|
4784
4806
|
*/
|
|
4785
4807
|
calculateZoomCenterPositionAndFactor(layersCollection) {
|
|
4786
|
-
if (this.maps
|
|
4787
|
-
|
|
4788
|
-
|
|
4789
|
-
|
|
4790
|
-
|
|
4791
|
-
|
|
4792
|
-
|
|
4793
|
-
|
|
4794
|
-
|
|
4795
|
-
|
|
4796
|
-
|
|
4797
|
-
|
|
4798
|
-
|
|
4799
|
-
|
|
4800
|
-
|
|
4801
|
-
|
|
4802
|
-
|
|
4803
|
-
|
|
4804
|
-
|
|
4805
|
-
|
|
4806
|
-
|
|
4807
|
-
|
|
4808
|
-
|
|
4809
|
-
|
|
4810
|
-
|
|
4811
|
-
|
|
4812
|
-
|
|
4813
|
-
|
|
4814
|
-
|
|
4815
|
-
|
|
4816
|
-
|
|
4817
|
-
|
|
4818
|
-
|
|
4819
|
-
|
|
4820
|
-
|
|
4821
|
-
|
|
4822
|
-
|
|
4823
|
-
|
|
4824
|
-
|
|
4825
|
-
|
|
4826
|
-
|
|
4827
|
-
|
|
4828
|
-
|
|
4829
|
-
|
|
4830
|
-
|
|
4831
|
-
|
|
4808
|
+
if (!isNullOrUndefined(this.maps)) {
|
|
4809
|
+
if (this.maps.zoomSettings.shouldZoomInitially && this.maps.markerModule) {
|
|
4810
|
+
let minLong;
|
|
4811
|
+
let maxLat;
|
|
4812
|
+
let minLat;
|
|
4813
|
+
let maxLong;
|
|
4814
|
+
let zoomLevel;
|
|
4815
|
+
let centerLat;
|
|
4816
|
+
let centerLong;
|
|
4817
|
+
const maxZoomFact = this.maps.zoomSettings.maxZoom;
|
|
4818
|
+
const mapWidth = this.maps.mapAreaRect.width;
|
|
4819
|
+
const mapHeight = this.maps.mapAreaRect.height;
|
|
4820
|
+
this.maps.markerZoomedState = this.maps.markerZoomedState ? this.maps.markerZoomedState :
|
|
4821
|
+
isNullOrUndefined(this.maps.markerZoomFactor) ? !this.maps.markerZoomedState :
|
|
4822
|
+
this.maps.markerZoomFactor > 1 ? this.maps.markerZoomedState : !this.maps.markerZoomedState;
|
|
4823
|
+
this.maps.defaultState = this.maps.markerZoomedState ? !this.maps.markerZoomedState : this.maps.defaultState;
|
|
4824
|
+
Array.prototype.forEach.call(layersCollection, (currentLayer) => {
|
|
4825
|
+
const isMarker = currentLayer.markerSettings.length !== 0;
|
|
4826
|
+
if (isMarker) {
|
|
4827
|
+
Array.prototype.forEach.call(currentLayer.markerSettings, (markerSetting) => {
|
|
4828
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4829
|
+
const markerData = markerSetting.dataSource;
|
|
4830
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4831
|
+
Array.prototype.forEach.call(markerData, (data, dataIndex) => {
|
|
4832
|
+
const latitude = !isNullOrUndefined(data['latitude']) ? parseFloat(data['latitude']) :
|
|
4833
|
+
!isNullOrUndefined(data['Latitude']) ? parseFloat(data['Latitude']) : null;
|
|
4834
|
+
const longitude = !isNullOrUndefined(data['longitude']) ? parseFloat(data['longitude']) :
|
|
4835
|
+
!isNullOrUndefined(data['Longitude']) ? parseFloat(data['Longitude']) : null;
|
|
4836
|
+
minLong = isNullOrUndefined(minLong) && dataIndex === 0 ?
|
|
4837
|
+
longitude : minLong;
|
|
4838
|
+
maxLat = isNullOrUndefined(maxLat) && dataIndex === 0 ?
|
|
4839
|
+
latitude : maxLat;
|
|
4840
|
+
minLat = isNullOrUndefined(minLat) && dataIndex === 0 ?
|
|
4841
|
+
latitude : minLat;
|
|
4842
|
+
maxLong = isNullOrUndefined(maxLong) && dataIndex === 0 ?
|
|
4843
|
+
longitude : maxLong;
|
|
4844
|
+
if (minLong > longitude) {
|
|
4845
|
+
minLong = longitude;
|
|
4846
|
+
}
|
|
4847
|
+
if (minLat > latitude) {
|
|
4848
|
+
minLat = latitude;
|
|
4849
|
+
}
|
|
4850
|
+
if (maxLong < longitude) {
|
|
4851
|
+
maxLong = longitude;
|
|
4852
|
+
}
|
|
4853
|
+
if (maxLat < latitude) {
|
|
4854
|
+
maxLat = latitude;
|
|
4855
|
+
}
|
|
4856
|
+
});
|
|
4832
4857
|
});
|
|
4833
|
-
}
|
|
4834
|
-
}
|
|
4835
|
-
|
|
4836
|
-
|
|
4837
|
-
|
|
4838
|
-
|
|
4839
|
-
|
|
4840
|
-
|
|
4841
|
-
|
|
4842
|
-
|
|
4843
|
-
|
|
4844
|
-
|
|
4845
|
-
|
|
4846
|
-
|
|
4847
|
-
}
|
|
4848
|
-
|
|
4849
|
-
|
|
4850
|
-
|
|
4851
|
-
|
|
4852
|
-
|
|
4853
|
-
|
|
4854
|
-
|
|
4855
|
-
|
|
4856
|
-
|
|
4858
|
+
}
|
|
4859
|
+
});
|
|
4860
|
+
if (!isNullOrUndefined(minLat) && !isNullOrUndefined(minLong) &&
|
|
4861
|
+
!isNullOrUndefined(maxLong) && !isNullOrUndefined(maxLat)) {
|
|
4862
|
+
// To find the center position
|
|
4863
|
+
centerLat = (minLat + maxLat) / 2;
|
|
4864
|
+
centerLong = (minLong + maxLong) / 2;
|
|
4865
|
+
this.maps.markerCenterLatitude = centerLat;
|
|
4866
|
+
this.maps.markerCenterLongitude = centerLong;
|
|
4867
|
+
if (isNullOrUndefined(this.maps.markerZoomCenterPoint) || this.maps.markerZoomedState) {
|
|
4868
|
+
this.maps.markerZoomCenterPoint = {
|
|
4869
|
+
latitude: centerLat,
|
|
4870
|
+
longitude: centerLong
|
|
4871
|
+
};
|
|
4872
|
+
}
|
|
4873
|
+
let markerFactor;
|
|
4874
|
+
if (this.maps.isTileMap || this.maps.baseMapRectBounds['min']['x'] === 0) {
|
|
4875
|
+
zoomLevel = calculateZoomLevel(minLat, maxLat, minLong, maxLong, mapWidth, mapHeight, this.maps);
|
|
4876
|
+
if (this.maps.isTileMap) {
|
|
4877
|
+
markerFactor = isNullOrUndefined(this.maps.markerZoomFactor) ?
|
|
4878
|
+
zoomLevel : isNullOrUndefined(this.maps.mapScaleValue) ?
|
|
4879
|
+
zoomLevel : this.maps.mapScaleValue > 1 && this.maps.markerZoomFactor !== 1 ?
|
|
4880
|
+
this.maps.mapScaleValue : zoomLevel;
|
|
4881
|
+
}
|
|
4882
|
+
else {
|
|
4883
|
+
markerFactor = isNullOrUndefined(this.maps.mapScaleValue) ? zoomLevel :
|
|
4884
|
+
(Math.floor(this.maps.scale) !== 1 &&
|
|
4885
|
+
this.maps.mapScaleValue !== zoomLevel)
|
|
4886
|
+
&&
|
|
4887
|
+
(isNullOrUndefined(this.maps.shouldZoomCurrentFactor))
|
|
4888
|
+
? this.maps.mapScaleValue : zoomLevel;
|
|
4889
|
+
if (((markerFactor === this.maps.mapScaleValue &&
|
|
4890
|
+
(this.maps.markerZoomFactor === 1 || this.maps.mapScaleValue === 1))
|
|
4891
|
+
&& (!this.maps.enablePersistence))) {
|
|
4892
|
+
markerFactor = zoomLevel;
|
|
4893
|
+
}
|
|
4894
|
+
}
|
|
4857
4895
|
}
|
|
4858
4896
|
else {
|
|
4897
|
+
zoomLevel = this.calculateIndividualLayerMarkerZoomLevel(mapWidth, mapHeight, maxZoomFact);
|
|
4859
4898
|
markerFactor = isNullOrUndefined(this.maps.mapScaleValue) ? zoomLevel :
|
|
4860
|
-
(
|
|
4861
|
-
this.maps.mapScaleValue !== zoomLevel)
|
|
4862
|
-
&&
|
|
4863
|
-
(isNullOrUndefined(this.maps.shouldZoomCurrentFactor))
|
|
4899
|
+
(this.maps.mapScaleValue !== zoomLevel)
|
|
4864
4900
|
? this.maps.mapScaleValue : zoomLevel;
|
|
4865
|
-
if (((markerFactor === this.maps.mapScaleValue &&
|
|
4866
|
-
(this.maps.markerZoomFactor === 1 || this.maps.mapScaleValue === 1))
|
|
4867
|
-
&& (!this.maps.enablePersistence))) {
|
|
4868
|
-
markerFactor = zoomLevel;
|
|
4869
|
-
}
|
|
4870
4901
|
}
|
|
4902
|
+
this.maps.markerZoomFactor = markerFactor;
|
|
4871
4903
|
}
|
|
4872
|
-
else {
|
|
4873
|
-
zoomLevel = this.calculateIndividualLayerMarkerZoomLevel(mapWidth, mapHeight, maxZoomFact);
|
|
4874
|
-
markerFactor = isNullOrUndefined(this.maps.mapScaleValue) ? zoomLevel :
|
|
4875
|
-
(this.maps.mapScaleValue !== zoomLevel)
|
|
4876
|
-
? this.maps.mapScaleValue : zoomLevel;
|
|
4877
|
-
}
|
|
4878
|
-
this.maps.markerZoomFactor = markerFactor;
|
|
4879
4904
|
}
|
|
4880
|
-
|
|
4881
|
-
|
|
4882
|
-
|
|
4883
|
-
|
|
4884
|
-
|
|
4885
|
-
|
|
4886
|
-
|
|
4887
|
-
|
|
4888
|
-
|
|
4905
|
+
else {
|
|
4906
|
+
this.maps.markerZoomedState = false;
|
|
4907
|
+
if (this.maps.markerZoomFactor > 1) {
|
|
4908
|
+
this.maps.markerCenterLatitude = null;
|
|
4909
|
+
this.maps.markerCenterLongitude = null;
|
|
4910
|
+
this.maps.markerZoomFactor = 1;
|
|
4911
|
+
if (!this.maps.enablePersistence) {
|
|
4912
|
+
this.maps.mapScaleValue = 1;
|
|
4913
|
+
}
|
|
4889
4914
|
}
|
|
4890
|
-
|
|
4891
|
-
|
|
4892
|
-
|
|
4893
|
-
|
|
4894
|
-
|
|
4895
|
-
|
|
4896
|
-
|
|
4915
|
+
if (this.maps.isTileMap && !this.maps.enablePersistence
|
|
4916
|
+
&& this.maps.mapScaleValue <= 1) {
|
|
4917
|
+
this.maps.tileZoomLevel = this.maps.mapScaleValue === 0 ? (this.maps.isZoomByPosition ? this.maps.tileZoomLevel : 1)
|
|
4918
|
+
: this.maps.mapScaleValue;
|
|
4919
|
+
if (this.maps.mapScaleValue === 1 && this.maps.markerZoomFactor === 1) {
|
|
4920
|
+
this.maps.tileTranslatePoint.x = 0;
|
|
4921
|
+
this.maps.tileTranslatePoint.y = 0;
|
|
4922
|
+
}
|
|
4897
4923
|
}
|
|
4898
4924
|
}
|
|
4899
4925
|
}
|
|
4900
4926
|
}
|
|
4901
4927
|
/**
|
|
4902
4928
|
* To check and trigger marker click event
|
|
4929
|
+
* @param {PointerEvent} e - Specifies the pointer event argument.
|
|
4930
|
+
* @returns {void}
|
|
4903
4931
|
*/
|
|
4904
4932
|
markerClick(e) {
|
|
4905
4933
|
const target = e.target.id;
|
|
@@ -4921,6 +4949,8 @@ class Marker {
|
|
|
4921
4949
|
}
|
|
4922
4950
|
/**
|
|
4923
4951
|
* To check and trigger Cluster click event
|
|
4952
|
+
* @param {PointerEvent} e - Specifies the pointer event argument.
|
|
4953
|
+
* @returns {void}
|
|
4924
4954
|
*/
|
|
4925
4955
|
markerClusterClick(e) {
|
|
4926
4956
|
const target = e.target.id;
|
|
@@ -5011,6 +5041,9 @@ class Marker {
|
|
|
5011
5041
|
}
|
|
5012
5042
|
/**
|
|
5013
5043
|
* To check and trigger marker move event
|
|
5044
|
+
*
|
|
5045
|
+
* @param {PointerEvent} e - Specifies the pointer event argument.
|
|
5046
|
+
* @returns {void}
|
|
5014
5047
|
*/
|
|
5015
5048
|
markerMove(e) {
|
|
5016
5049
|
const targetId = e.target.id;
|
|
@@ -5029,6 +5062,9 @@ class Marker {
|
|
|
5029
5062
|
}
|
|
5030
5063
|
/**
|
|
5031
5064
|
* To check and trigger cluster move event
|
|
5065
|
+
*
|
|
5066
|
+
* @param {PointerEvent} e - Specifies the pointer event argument.
|
|
5067
|
+
* @returns {void}
|
|
5032
5068
|
*/
|
|
5033
5069
|
markerClusterMouseMove(e) {
|
|
5034
5070
|
const targetId = e.target.id;
|
|
@@ -5037,7 +5073,7 @@ class Marker {
|
|
|
5037
5073
|
}
|
|
5038
5074
|
const options = this.getMarker(targetId);
|
|
5039
5075
|
if (this.maps.markerClusterExpand) {
|
|
5040
|
-
e.target.
|
|
5076
|
+
e.target.style.cursor = 'pointer';
|
|
5041
5077
|
}
|
|
5042
5078
|
if (isNullOrUndefined(options)) {
|
|
5043
5079
|
return;
|
|
@@ -5301,6 +5337,7 @@ class BingMap {
|
|
|
5301
5337
|
}
|
|
5302
5338
|
}
|
|
5303
5339
|
/**
|
|
5340
|
+
* @returns {void}
|
|
5304
5341
|
* @private
|
|
5305
5342
|
*/
|
|
5306
5343
|
destroy() {
|
|
@@ -5337,6 +5374,11 @@ class ColorMapping {
|
|
|
5337
5374
|
}
|
|
5338
5375
|
/**
|
|
5339
5376
|
* To color by value and color mapping
|
|
5377
|
+
*
|
|
5378
|
+
* @param {ColorMappingSettingsModel[]} colorMapping - Specifies the color mapping instance.
|
|
5379
|
+
* @param {number} colorValue - Specifies the color value
|
|
5380
|
+
* @param {string} equalValue - Specifies the equal value.
|
|
5381
|
+
* @returns {any} - Returns the color mapping values.
|
|
5340
5382
|
*/
|
|
5341
5383
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5342
5384
|
getColorByValue(colorMapping, colorValue, equalValue) {
|
|
@@ -5527,10 +5569,7 @@ class ColorMapping {
|
|
|
5527
5569
|
}
|
|
5528
5570
|
}
|
|
5529
5571
|
|
|
5530
|
-
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
|
5531
|
-
/* eslint-disable jsdoc/require-param */
|
|
5532
5572
|
/* eslint-disable no-case-declarations */
|
|
5533
|
-
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
5534
5573
|
/**
|
|
5535
5574
|
* To calculate and render the shape layer
|
|
5536
5575
|
*/
|
|
@@ -5553,10 +5592,10 @@ class LayerPanel {
|
|
|
5553
5592
|
height: areaRect.height
|
|
5554
5593
|
});
|
|
5555
5594
|
const parentElement = createElement('div', {
|
|
5556
|
-
id: this.mapObject.element.id + '_Tile_SVG_Parent'
|
|
5557
|
-
(areaRect.height) + 'px; width: '
|
|
5558
|
-
+ (areaRect.width) + 'px;'
|
|
5595
|
+
id: this.mapObject.element.id + '_Tile_SVG_Parent'
|
|
5559
5596
|
});
|
|
5597
|
+
parentElement.style.cssText = 'position: absolute; height: ' + (areaRect.height) + 'px; width: ' +
|
|
5598
|
+
(areaRect.width) + 'px;';
|
|
5560
5599
|
parentElement.appendChild(this.tileSvgObject);
|
|
5561
5600
|
secondaryEle.appendChild(parentElement);
|
|
5562
5601
|
}
|
|
@@ -5610,13 +5649,13 @@ class LayerPanel {
|
|
|
5610
5649
|
(!isNullOrUndefined(panel.mapObject.tileZoomLevel) && panel.mapObject.tileZoomLevel !== 1)) ?
|
|
5611
5650
|
false : true;
|
|
5612
5651
|
if (isNullOrUndefined(panel.mapObject.previousCenterLatitude) &&
|
|
5613
|
-
isNullOrUndefined(panel.mapObject.previousCenterLongitude)) {
|
|
5652
|
+
isNullOrUndefined(panel.mapObject.previousCenterLongitude) && !panel.mapObject.isZoomByPosition) {
|
|
5614
5653
|
panel.mapObject.previousCenterLatitude = panel.mapObject.centerPosition.latitude;
|
|
5615
5654
|
panel.mapObject.previousCenterLongitude = panel.mapObject.centerPosition.longitude;
|
|
5616
5655
|
}
|
|
5617
|
-
else if (panel.mapObject.previousCenterLatitude !==
|
|
5656
|
+
else if ((panel.mapObject.previousCenterLatitude !==
|
|
5618
5657
|
panel.mapObject.centerPosition.latitude && panel.mapObject.previousCenterLongitude !==
|
|
5619
|
-
panel.mapObject.centerPosition.longitude) {
|
|
5658
|
+
panel.mapObject.centerPosition.longitude) || panel.mapObject.isZoomByPosition) {
|
|
5620
5659
|
panel.mapObject.centerPositionChanged = true;
|
|
5621
5660
|
panel.mapObject.previousCenterLatitude = panel.mapObject.centerPosition.latitude;
|
|
5622
5661
|
panel.mapObject.previousCenterLongitude = panel.mapObject.centerPosition.longitude;
|
|
@@ -5628,7 +5667,8 @@ class LayerPanel {
|
|
|
5628
5667
|
let centerTileMap = center;
|
|
5629
5668
|
if ((this.mapObject.isTileMap && panel.mapObject.markerModule) && panel.mapObject.zoomSettings.enable) {
|
|
5630
5669
|
panel.mapObject.markerModule.calculateZoomCenterPositionAndFactor(this.mapObject.layersCollection);
|
|
5631
|
-
if (!isNullOrUndefined(this.mapObject.markerCenterLatitude) && !isNullOrUndefined(this.mapObject.markerCenterLongitude)
|
|
5670
|
+
if (!isNullOrUndefined(this.mapObject.markerCenterLatitude) && !isNullOrUndefined(this.mapObject.markerCenterLongitude)
|
|
5671
|
+
&& !panel.mapObject.isZoomByPosition) {
|
|
5632
5672
|
centerTileMap = new Point(panel.mapObject.markerCenterLongitude, panel.mapObject.markerCenterLatitude);
|
|
5633
5673
|
}
|
|
5634
5674
|
}
|
|
@@ -5644,7 +5684,7 @@ class LayerPanel {
|
|
|
5644
5684
|
else {
|
|
5645
5685
|
center = { x: null, y: null };
|
|
5646
5686
|
}
|
|
5647
|
-
let zoomFactorValue = panel.mapObject.zoomSettings.shouldZoomInitially ?
|
|
5687
|
+
let zoomFactorValue = (panel.mapObject.zoomSettings.shouldZoomInitially && !panel.mapObject.isZoomByPosition) ?
|
|
5648
5688
|
isNullOrUndefined(panel.mapObject.markerZoomFactor) ? 1 :
|
|
5649
5689
|
panel.mapObject.markerZoomFactor : panel.mapObject.zoomSettings.zoomFactor;
|
|
5650
5690
|
zoomFactorValue = (panel.mapObject.enablePersistence) ? ((isNullOrUndefined(panel.mapObject.mapScaleValue))
|
|
@@ -5717,7 +5757,10 @@ class LayerPanel {
|
|
|
5717
5757
|
panel.mapObject.previousZoomFactor = panel.mapObject.zoomSettings.zoomFactor;
|
|
5718
5758
|
}
|
|
5719
5759
|
if (panel.mapObject.navigationLineModule) {
|
|
5720
|
-
panel.
|
|
5760
|
+
const navigationLineElement = panel.mapObject.navigationLineModule.renderNavigation(panel.currentLayer, panel.mapObject.tileZoomLevel, layerIndex);
|
|
5761
|
+
if (!isNullOrUndefined(navigationLineElement)) {
|
|
5762
|
+
panel.layerObject.appendChild(navigationLineElement);
|
|
5763
|
+
}
|
|
5721
5764
|
}
|
|
5722
5765
|
if (panel.mapObject.markerModule) {
|
|
5723
5766
|
panel.mapObject.markerModule.markerRender(this.mapObject, panel.layerObject, layerIndex, panel.mapObject.tileZoomLevel, null);
|
|
@@ -5784,7 +5827,6 @@ class LayerPanel {
|
|
|
5784
5827
|
const imageUrl = resource['imageUrl'];
|
|
5785
5828
|
const subDomains = resource['imageUrlSubdomains'];
|
|
5786
5829
|
const maxZoom = resource['zoomMax'];
|
|
5787
|
-
const markerGroupElement = document.getElementById(proxy.mapObject.element.id + '_Markers_Group');
|
|
5788
5830
|
if (imageUrl !== null && imageUrl !== undefined && imageUrl !== bing.imageUrl) {
|
|
5789
5831
|
bing.imageUrl = imageUrl;
|
|
5790
5832
|
}
|
|
@@ -5898,13 +5940,13 @@ class LayerPanel {
|
|
|
5898
5940
|
const colors = shapeSettings.palette.length > 1 ? shapeSettings.palette : getShapeColor(this.mapObject.theme);
|
|
5899
5941
|
const labelTemplateEle = createElement('div', {
|
|
5900
5942
|
id: this.mapObject.element.id + '_LayerIndex_' + layerIndex + '_Label_Template_Group',
|
|
5901
|
-
className: this.mapObject.element.id + '_template'
|
|
5902
|
-
styles: 'pointer-events: none; overflow: hidden; position: absolute;' +
|
|
5903
|
-
'top:' + this.mapObject.mapAreaRect.y + 'px;' +
|
|
5904
|
-
'left:' + this.mapObject.mapAreaRect.x + 'px;' +
|
|
5905
|
-
'height:' + this.mapObject.mapAreaRect.height + 'px;' +
|
|
5906
|
-
'width:' + this.mapObject.mapAreaRect.width + 'px;'
|
|
5943
|
+
className: this.mapObject.element.id + '_template'
|
|
5907
5944
|
});
|
|
5945
|
+
labelTemplateEle.style.cssText = 'pointer-events: none; overflow: hidden; position: absolute;' +
|
|
5946
|
+
'top:' + this.mapObject.mapAreaRect.y + 'px;' +
|
|
5947
|
+
'left:' + this.mapObject.mapAreaRect.x + 'px;' +
|
|
5948
|
+
'height:' + this.mapObject.mapAreaRect.height + 'px;' +
|
|
5949
|
+
'width:' + this.mapObject.mapAreaRect.width + 'px;';
|
|
5908
5950
|
if (this.currentLayer.layerData.length !== 0) {
|
|
5909
5951
|
for (let i = 0; i < this.currentLayer.layerData.length; i++) {
|
|
5910
5952
|
let k;
|
|
@@ -5945,8 +5987,6 @@ class LayerPanel {
|
|
|
5945
5987
|
fill = Object.prototype.toString.call(getShapeColor$$1) === '[object Object]' && !isNullOrUndefined(getShapeColor$$1['fill'])
|
|
5946
5988
|
? getShapeColor$$1['fill'] : fill;
|
|
5947
5989
|
if (this.currentLayer.shapeSettings.borderColorValuePath || this.currentLayer.shapeSettings.borderWidthValuePath) {
|
|
5948
|
-
const borderColorValue = this.currentLayer.shapeSettings.borderColorValuePath;
|
|
5949
|
-
const borderWidthValue = this.currentLayer.shapeSettings.borderWidthValuePath;
|
|
5950
5990
|
k = checkShapeDataFields(
|
|
5951
5991
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5952
5992
|
this.currentLayer.dataSource, currentShapeData['property'], this.currentLayer.shapeDataPath, this.currentLayer.shapePropertyPath, this.currentLayer);
|
|
@@ -6073,7 +6113,9 @@ class LayerPanel {
|
|
|
6073
6113
|
case 'Point':
|
|
6074
6114
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6075
6115
|
const pointData = currentShapeData['point'];
|
|
6076
|
-
const circleRadius = (this.mapObject.layers[layerIndex].type !== 'SubLayer') ?
|
|
6116
|
+
const circleRadius = (this.mapObject.layers[layerIndex].type !== 'SubLayer') ?
|
|
6117
|
+
shapeSettings.circleRadius : shapeSettings.circleRadius / (this.mapObject.isTileMap ?
|
|
6118
|
+
this.mapObject.scale : this.currentFactor);
|
|
6077
6119
|
circleOptions = new CircleOption(shapeID, eventArgs.fill, eventArgs.border, opacity, pointData['x'], pointData['y'], circleRadius, shapeSettings.dashArray);
|
|
6078
6120
|
pathEle = this.mapObject.renderer.drawCircle(circleOptions);
|
|
6079
6121
|
break;
|
|
@@ -6083,7 +6125,7 @@ class LayerPanel {
|
|
|
6083
6125
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6084
6126
|
const pointData = multiPointData['point'];
|
|
6085
6127
|
const circleRadius = (this.mapObject.layers[layerIndex].type !== 'SubLayer') ? shapeSettings.circleRadius : shapeSettings.circleRadius / (this.mapObject.isTileMap ? this.mapObject.scale : this.currentFactor);
|
|
6086
|
-
circleOptions = new CircleOption((shapeID +
|
|
6128
|
+
circleOptions = new CircleOption((shapeID + '_multiLine_' + index), eventArgs.fill, eventArgs.border, opacity, pointData['x'], pointData['y'], circleRadius, shapeSettings.dashArray);
|
|
6087
6129
|
pathEle = this.mapObject.renderer.drawCircle(circleOptions);
|
|
6088
6130
|
this.pathAttributeCalculate(groupElement, pathEle, drawingType, currentShapeData, i);
|
|
6089
6131
|
});
|
|
@@ -6112,15 +6154,16 @@ class LayerPanel {
|
|
|
6112
6154
|
/**
|
|
6113
6155
|
* layer features as bubble, marker, datalabel, navigation line.
|
|
6114
6156
|
*
|
|
6115
|
-
* @param {
|
|
6116
|
-
* @param {
|
|
6117
|
-
* @param {
|
|
6118
|
-
* @param {
|
|
6119
|
-
* @param {
|
|
6157
|
+
* @param {Element} groupElement - Specifies the element to append the group.
|
|
6158
|
+
* @param {Element} pathEle - Specifies the svg element.
|
|
6159
|
+
* @param {string} drawingType - Specifies the data type.
|
|
6160
|
+
* @param {any} currentShapeData - Specifies the layer of shapedata.
|
|
6161
|
+
* @param {number} index - Specifies the tab index.
|
|
6120
6162
|
* @returns {void}
|
|
6121
6163
|
*/
|
|
6164
|
+
pathAttributeCalculate(groupElement, pathEle, drawingType,
|
|
6122
6165
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6123
|
-
|
|
6166
|
+
currentShapeData, index) {
|
|
6124
6167
|
const property = (Object.prototype.toString.call(this.currentLayer.shapePropertyPath) === '[object Array]' ?
|
|
6125
6168
|
this.currentLayer.shapePropertyPath : [this.currentLayer.shapePropertyPath]);
|
|
6126
6169
|
let properties;
|
|
@@ -6132,10 +6175,10 @@ class LayerPanel {
|
|
|
6132
6175
|
}
|
|
6133
6176
|
pathEle.setAttribute('aria-label', ((!isNullOrUndefined(currentShapeData['property'])) ?
|
|
6134
6177
|
(currentShapeData['property'][properties]) : ''));
|
|
6135
|
-
pathEle.
|
|
6178
|
+
pathEle.tabIndex = this.mapObject.tabIndex + index + 3;
|
|
6136
6179
|
pathEle.setAttribute('role', '');
|
|
6137
6180
|
if (drawingType === 'LineString' || drawingType === 'MultiLineString') {
|
|
6138
|
-
pathEle.
|
|
6181
|
+
pathEle.style.cssText = 'outline:none';
|
|
6139
6182
|
}
|
|
6140
6183
|
maintainSelection(this.mapObject.selectedElementId, this.mapObject.shapeSelectionClass, pathEle, 'ShapeselectionMapStyle');
|
|
6141
6184
|
if (this.mapObject.toggledShapeElementId) {
|
|
@@ -6147,7 +6190,7 @@ class LayerPanel {
|
|
|
6147
6190
|
pathEle.setAttribute('stroke', styleProperty.border.color);
|
|
6148
6191
|
pathEle.setAttribute('fill-opacity', (styleProperty.opacity).toString());
|
|
6149
6192
|
pathEle.setAttribute('stroke-opacity', (isNullOrUndefined(styleProperty.border.opacity) ? styleProperty.opacity : styleProperty.border.opacity).toString());
|
|
6150
|
-
pathEle.setAttribute('stroke-width', (styleProperty.border.width).toString());
|
|
6193
|
+
pathEle.setAttribute('stroke-width', (isNullOrUndefined(styleProperty.border.width) ? 0 : styleProperty.border.width).toString());
|
|
6151
6194
|
}
|
|
6152
6195
|
}
|
|
6153
6196
|
}
|
|
@@ -6189,9 +6232,9 @@ class LayerPanel {
|
|
|
6189
6232
|
this.mapObject.markerModule.calculateZoomCenterPositionAndFactor(this.mapObject.layersCollection);
|
|
6190
6233
|
}
|
|
6191
6234
|
const group = (this.mapObject.renderer.createGroup({
|
|
6192
|
-
id: this.mapObject.element.id + '_LayerIndex_' + layerIndex + '_dataLableIndex_Group'
|
|
6193
|
-
style: 'pointer-events: none;'
|
|
6235
|
+
id: this.mapObject.element.id + '_LayerIndex_' + layerIndex + '_dataLableIndex_Group'
|
|
6194
6236
|
}));
|
|
6237
|
+
group.style.pointerEvents = 'none';
|
|
6195
6238
|
if (this.mapObject.dataLabelModule && this.currentLayer.dataLabelSettings.visible) {
|
|
6196
6239
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6197
6240
|
const intersect = [];
|
|
@@ -6208,8 +6251,8 @@ class LayerPanel {
|
|
|
6208
6251
|
this.layerObject.appendChild(element);
|
|
6209
6252
|
});
|
|
6210
6253
|
if (this.mapObject.markerModule) {
|
|
6211
|
-
this.mapObject.markerModule.markerRender(this.mapObject, this.layerObject, layerIndex, (this.mapObject.isTileMap ? Math.floor(this.currentFactor)
|
|
6212
|
-
|
|
6254
|
+
this.mapObject.markerModule.markerRender(this.mapObject, this.layerObject, layerIndex, (this.mapObject.isTileMap ? Math.floor(this.currentFactor) :
|
|
6255
|
+
this.currentFactor), null);
|
|
6213
6256
|
}
|
|
6214
6257
|
this.translateLayerElements(this.layerObject, layerIndex);
|
|
6215
6258
|
this.layerGroup.appendChild(this.layerObject);
|
|
@@ -6219,11 +6262,11 @@ class LayerPanel {
|
|
|
6219
6262
|
*
|
|
6220
6263
|
* @param {LayerSettings} layer - Specifies the layer
|
|
6221
6264
|
* @param {number} layerIndex - Specifies the layer index
|
|
6222
|
-
* @param {
|
|
6265
|
+
* @param {any[]} shape - Specifies the shape
|
|
6223
6266
|
* @param {Element} group - Specifies the group
|
|
6224
6267
|
* @param {number} shapeIndex - Specifies the shape index
|
|
6225
6268
|
* @param {HTMLElement} labelTemplateEle - Specifies the label template element
|
|
6226
|
-
* @param {
|
|
6269
|
+
* @param {any[]} intersect - Specifies the intersect
|
|
6227
6270
|
* @returns {void}
|
|
6228
6271
|
*/
|
|
6229
6272
|
renderLabel(layer, layerIndex,
|
|
@@ -6321,10 +6364,12 @@ class LayerPanel {
|
|
|
6321
6364
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6322
6365
|
const multiPolygonDatas = [];
|
|
6323
6366
|
for (let i = 0; i < coordinates.length; i++) {
|
|
6324
|
-
|
|
6325
|
-
|
|
6326
|
-
|
|
6327
|
-
|
|
6367
|
+
for (let j = 0; j < coordinates[i].length; j++) {
|
|
6368
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6369
|
+
newData = this.calculatePolygonBox(coordinates[i][j], data, properties);
|
|
6370
|
+
if (newData.length > 0) {
|
|
6371
|
+
multiPolygonDatas.push(newData);
|
|
6372
|
+
}
|
|
6328
6373
|
}
|
|
6329
6374
|
}
|
|
6330
6375
|
multiPolygonDatas['property'] = properties;
|
|
@@ -6333,15 +6378,15 @@ class LayerPanel {
|
|
|
6333
6378
|
this.currentLayer.layerData.push(multiPolygonDatas);
|
|
6334
6379
|
break;
|
|
6335
6380
|
case 'linestring':
|
|
6336
|
-
const
|
|
6381
|
+
const lineExtraSpace = !isNullOrUndefined(this.currentLayer.shapeSettings.border.width) ?
|
|
6337
6382
|
(typeof (this.currentLayer.shapeSettings.border.width) === 'string' ?
|
|
6338
6383
|
parseInt(this.currentLayer.shapeSettings.border.width, 10) : this.currentLayer.shapeSettings.border.width) : 1;
|
|
6339
6384
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6340
|
-
coordinates.map((points
|
|
6385
|
+
coordinates.map((points) => {
|
|
6341
6386
|
latitude = points[1];
|
|
6342
6387
|
longitude = points[0];
|
|
6343
6388
|
const point = convertGeoToPoint(latitude, longitude, this.currentFactor, this.currentLayer, this.mapObject);
|
|
6344
|
-
this.calculateBox(point,
|
|
6389
|
+
this.calculateBox(point, lineExtraSpace);
|
|
6345
6390
|
newData.push({
|
|
6346
6391
|
point: point, lat: latitude, lng: longitude
|
|
6347
6392
|
});
|
|
@@ -6354,10 +6399,12 @@ class LayerPanel {
|
|
|
6354
6399
|
const extraSpaces = !isNullOrUndefined(this.currentLayer.shapeSettings.border.width) ?
|
|
6355
6400
|
(typeof (this.currentLayer.shapeSettings.border.width) === 'string' ?
|
|
6356
6401
|
parseInt(this.currentLayer.shapeSettings.border.width, 10) : this.currentLayer.shapeSettings.border.width) : 1;
|
|
6402
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6357
6403
|
const multiLineData = [];
|
|
6358
6404
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6359
6405
|
coordinates.map((multiPoints) => {
|
|
6360
6406
|
newData = [];
|
|
6407
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6361
6408
|
multiPoints.map((points) => {
|
|
6362
6409
|
latitude = points[1];
|
|
6363
6410
|
longitude = points[0];
|
|
@@ -6386,7 +6433,7 @@ class LayerPanel {
|
|
|
6386
6433
|
point: point, type: type, lat: latitude, lng: longitude, property: properties
|
|
6387
6434
|
});
|
|
6388
6435
|
break;
|
|
6389
|
-
case 'multipoint':
|
|
6436
|
+
case 'multipoint':
|
|
6390
6437
|
const extraSpace = (!isNullOrUndefined(this.currentLayer.shapeSettings.border.width) ?
|
|
6391
6438
|
(typeof (this.currentLayer.shapeSettings.border.width) === 'string' ?
|
|
6392
6439
|
parseInt(this.currentLayer.shapeSettings.border.width, 10) : this.currentLayer.shapeSettings.border.width) : 1) +
|
|
@@ -6406,7 +6453,6 @@ class LayerPanel {
|
|
|
6406
6453
|
newData['type'] = type;
|
|
6407
6454
|
this.currentLayer.layerData.push(newData);
|
|
6408
6455
|
break;
|
|
6409
|
-
}
|
|
6410
6456
|
case 'path':
|
|
6411
6457
|
this.currentLayer.layerData.push({
|
|
6412
6458
|
point: data['d'], type: type, property: properties
|
|
@@ -6416,7 +6462,8 @@ class LayerPanel {
|
|
|
6416
6462
|
}
|
|
6417
6463
|
calculateBox(point, extraSpace) {
|
|
6418
6464
|
if (isNullOrUndefined(this.rectBounds)) {
|
|
6419
|
-
this.rectBounds = { min: { x: point.x - extraSpace, y: point.y - extraSpace }, max: { x: point.x + extraSpace,
|
|
6465
|
+
this.rectBounds = { min: { x: point.x - extraSpace, y: point.y - extraSpace }, max: { x: point.x + extraSpace,
|
|
6466
|
+
y: point.y + extraSpace } };
|
|
6420
6467
|
}
|
|
6421
6468
|
else {
|
|
6422
6469
|
this.rectBounds['min']['x'] = Math.min(this.rectBounds['min']['x'], point.x - extraSpace);
|
|
@@ -6539,6 +6586,7 @@ class LayerPanel {
|
|
|
6539
6586
|
case 'multilinestring':
|
|
6540
6587
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6541
6588
|
coordinates.map((multiPoint, index) => {
|
|
6589
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6542
6590
|
multiPoint.map((point, index) => {
|
|
6543
6591
|
this.calculateRectBox(point, 'multilinestring', index === 0 ? true : false);
|
|
6544
6592
|
});
|
|
@@ -6554,6 +6602,7 @@ class LayerPanel {
|
|
|
6554
6602
|
this.calculateRectBox(coordinates, 'point');
|
|
6555
6603
|
break;
|
|
6556
6604
|
case 'multipoint':
|
|
6605
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6557
6606
|
coordinates.map((point, index) => {
|
|
6558
6607
|
this.calculateRectBox(point, 'multipoint', index === 0 ? true : false);
|
|
6559
6608
|
});
|
|
@@ -6568,7 +6617,7 @@ class LayerPanel {
|
|
|
6568
6617
|
const newData = [];
|
|
6569
6618
|
const bounds = this.mapObject.baseMapBounds;
|
|
6570
6619
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6571
|
-
coordinates.map((currentPoint
|
|
6620
|
+
coordinates.map((currentPoint) => {
|
|
6572
6621
|
const latitude = currentPoint[1];
|
|
6573
6622
|
const longitude = currentPoint[0];
|
|
6574
6623
|
if ((longitude >= bounds.longitude.min && longitude <= bounds.longitude.max)
|
|
@@ -6661,8 +6710,8 @@ class LayerPanel {
|
|
|
6661
6710
|
tileI = (tileI % ycount) + ycount;
|
|
6662
6711
|
}
|
|
6663
6712
|
const tile = new Tile(tileI % ycount, j);
|
|
6664
|
-
tile.left = x;
|
|
6665
|
-
tile.top = y;
|
|
6713
|
+
tile.left = Math.round(x);
|
|
6714
|
+
tile.top = Math.round(y);
|
|
6666
6715
|
if (baseLayer.layerType === 'Bing' || (bing && !isNullOrUndefined(baseLayer.urlTemplate) && baseLayer.urlTemplate !== '')) {
|
|
6667
6716
|
const key = baseLayer.key;
|
|
6668
6717
|
tile.src = bing.getBingMap(tile, key, baseLayer.bingMapType, userLang, bing.imageUrl, bing.subDomains);
|
|
@@ -6707,7 +6756,8 @@ class LayerPanel {
|
|
|
6707
6756
|
}
|
|
6708
6757
|
}
|
|
6709
6758
|
}
|
|
6710
|
-
if (this.mapObject.previousScale !== this.mapObject.scale || this.mapObject.isReset
|
|
6759
|
+
if (this.mapObject.previousScale !== this.mapObject.scale || this.mapObject.isReset || this.mapObject.isZoomByPosition
|
|
6760
|
+
|| this.mapObject.zoomNotApplied) {
|
|
6711
6761
|
this.arrangeTiles(zoomType, this.animateToZoomX, this.animateToZoomY);
|
|
6712
6762
|
}
|
|
6713
6763
|
}
|
|
@@ -6752,18 +6802,45 @@ class LayerPanel {
|
|
|
6752
6802
|
animateElement = element ? element.children[0] : null;
|
|
6753
6803
|
}
|
|
6754
6804
|
}
|
|
6755
|
-
let id = 0;
|
|
6756
|
-
|
|
6757
|
-
|
|
6758
|
-
imgElement.setAttribute('height', '256px');
|
|
6759
|
-
imgElement.setAttribute('width', '256px');
|
|
6760
|
-
imgElement.setAttribute('src', tile.src);
|
|
6761
|
-
imgElement.setAttribute('alt', this.mapObject.getLocalizedLabel('ImageNotFound'));
|
|
6805
|
+
for (let id = 0; id < this.tiles.length; id++) {
|
|
6806
|
+
const tile = this.tiles[id];
|
|
6807
|
+
let imgElement = null;
|
|
6762
6808
|
const mapId = this.mapObject.element.id;
|
|
6763
|
-
|
|
6764
|
-
|
|
6765
|
-
|
|
6809
|
+
if (type === 'Pan') {
|
|
6810
|
+
let child = document.getElementById(mapId + '_tile_' + id);
|
|
6811
|
+
let isNewTile = false;
|
|
6812
|
+
if (isNullOrUndefined(child)) {
|
|
6813
|
+
isNewTile = true;
|
|
6814
|
+
child = createElement('div', { id: mapId + '_tile_' + id });
|
|
6815
|
+
imgElement = createElement('img');
|
|
6766
6816
|
}
|
|
6817
|
+
else {
|
|
6818
|
+
child.style.removeProperty('display');
|
|
6819
|
+
imgElement = child.children[0];
|
|
6820
|
+
}
|
|
6821
|
+
if (!isNewTile && imgElement && imgElement.src !== tile.src) {
|
|
6822
|
+
imgElement.src = tile.src;
|
|
6823
|
+
}
|
|
6824
|
+
child.style.position = 'absolute';
|
|
6825
|
+
child.style.left = tile.left + 'px';
|
|
6826
|
+
child.style.top = tile.top + 'px';
|
|
6827
|
+
child.style.height = tile.height + 'px';
|
|
6828
|
+
child.style.width = tile.width + 'px';
|
|
6829
|
+
if (isNewTile) {
|
|
6830
|
+
imgElement.setAttribute('height', '256px');
|
|
6831
|
+
imgElement.setAttribute('width', '256px');
|
|
6832
|
+
imgElement.setAttribute('src', tile.src);
|
|
6833
|
+
imgElement.setAttribute('alt', this.mapObject.getLocalizedLabel('ImageNotFound'));
|
|
6834
|
+
child.appendChild(imgElement);
|
|
6835
|
+
animateElement.appendChild(child);
|
|
6836
|
+
}
|
|
6837
|
+
}
|
|
6838
|
+
else {
|
|
6839
|
+
imgElement = createElement('img');
|
|
6840
|
+
imgElement.setAttribute('height', '256px');
|
|
6841
|
+
imgElement.setAttribute('width', '256px');
|
|
6842
|
+
imgElement.setAttribute('src', tile.src);
|
|
6843
|
+
imgElement.setAttribute('alt', this.mapObject.getLocalizedLabel('ImageNotFound'));
|
|
6767
6844
|
const child = createElement('div', { id: mapId + '_tile_' + id });
|
|
6768
6845
|
child.style.position = 'absolute';
|
|
6769
6846
|
child.style.left = tile.left + 'px';
|
|
@@ -6774,11 +6851,27 @@ class LayerPanel {
|
|
|
6774
6851
|
if (animateElement) {
|
|
6775
6852
|
animateElement.appendChild(child);
|
|
6776
6853
|
}
|
|
6777
|
-
|
|
6778
|
-
|
|
6779
|
-
|
|
6854
|
+
}
|
|
6855
|
+
if (id === (this.tiles.length - 1) && document.getElementById(this.mapObject.element.id + '_animated_tiles_old')) {
|
|
6856
|
+
removeElement(this.mapObject.element.id + '_animated_tiles_old');
|
|
6857
|
+
}
|
|
6858
|
+
}
|
|
6859
|
+
if (!isNullOrUndefined(this.mapObject.currentTiles)) {
|
|
6860
|
+
for (let l = this.tiles.length; l < animateElement.childElementCount; l++) {
|
|
6861
|
+
let isExistingElement = false;
|
|
6862
|
+
for (let a = 0; a < this.mapObject.currentTiles.childElementCount; a++) {
|
|
6863
|
+
if (!isExistingElement &&
|
|
6864
|
+
this.mapObject.currentTiles.children[a].id === animateElement.children[l].id) {
|
|
6865
|
+
isExistingElement = true;
|
|
6866
|
+
}
|
|
6780
6867
|
}
|
|
6781
|
-
|
|
6868
|
+
if (isExistingElement) {
|
|
6869
|
+
animateElement.children[l].style.display = 'none';
|
|
6870
|
+
}
|
|
6871
|
+
else {
|
|
6872
|
+
animateElement.removeChild(animateElement.children[l]);
|
|
6873
|
+
}
|
|
6874
|
+
}
|
|
6782
6875
|
}
|
|
6783
6876
|
}, timeOut);
|
|
6784
6877
|
}
|
|
@@ -6947,8 +7040,6 @@ class LayerPanel {
|
|
|
6947
7040
|
}
|
|
6948
7041
|
}
|
|
6949
7042
|
|
|
6950
|
-
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
6951
|
-
/* eslint-disable jsdoc/require-param */
|
|
6952
7043
|
/**
|
|
6953
7044
|
* Represents the annotation elements for map.
|
|
6954
7045
|
*/
|
|
@@ -6987,8 +7078,9 @@ class Annotations {
|
|
|
6987
7078
|
const availSize = map.availableSize;
|
|
6988
7079
|
const id = map.element.id + '_Annotation_' + annotationIndex;
|
|
6989
7080
|
const childElement = createElement('div', {
|
|
6990
|
-
id: map.element.id + '_Annotation_' + annotationIndex
|
|
7081
|
+
id: map.element.id + '_Annotation_' + annotationIndex
|
|
6991
7082
|
});
|
|
7083
|
+
childElement.style.cssText = 'position: absolute; z-index:' + annotation.zIndex + ';';
|
|
6992
7084
|
const argsData = {
|
|
6993
7085
|
cancel: false, name: annotationRendering, content: annotation.content,
|
|
6994
7086
|
annotation: annotation
|
|
@@ -7071,11 +7163,6 @@ var __decorate = (undefined && undefined.__decorate) || function (decorators, ta
|
|
|
7071
7163
|
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;
|
|
7072
7164
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7073
7165
|
};
|
|
7074
|
-
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
|
7075
|
-
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
7076
|
-
/* eslint-disable radix */
|
|
7077
|
-
/* eslint-disable max-len */
|
|
7078
|
-
/* eslint-disable valid-jsdoc */
|
|
7079
7166
|
/**
|
|
7080
7167
|
* Maps Component file
|
|
7081
7168
|
*/
|
|
@@ -7252,18 +7339,20 @@ let Maps = class Maps extends Component {
|
|
|
7252
7339
|
this.setCulture();
|
|
7253
7340
|
}
|
|
7254
7341
|
renderElements() {
|
|
7255
|
-
this.
|
|
7256
|
-
|
|
7257
|
-
|
|
7258
|
-
|
|
7259
|
-
|
|
7260
|
-
|
|
7261
|
-
|
|
7262
|
-
|
|
7263
|
-
|
|
7264
|
-
|
|
7265
|
-
|
|
7266
|
-
|
|
7342
|
+
if (!this.isDestroyed) {
|
|
7343
|
+
this.trigger(load, { maps: this });
|
|
7344
|
+
this.createSVG();
|
|
7345
|
+
this.findBaseAndSubLayers();
|
|
7346
|
+
this.createSecondaryElement();
|
|
7347
|
+
this.addTabIndex();
|
|
7348
|
+
this.themeStyle = getThemeStyle(this.theme);
|
|
7349
|
+
this.renderBorder();
|
|
7350
|
+
this.renderTitle(this.titleSettings, 'title', null, null);
|
|
7351
|
+
this.renderArea();
|
|
7352
|
+
this.processRequestJsonData();
|
|
7353
|
+
this.renderComplete();
|
|
7354
|
+
this.isAddLayer = !this.isTileMap ? false : this.isAddLayer;
|
|
7355
|
+
}
|
|
7267
7356
|
}
|
|
7268
7357
|
/**
|
|
7269
7358
|
* To Initialize the control rendering.
|
|
@@ -7312,7 +7401,8 @@ let Maps = class Maps extends Component {
|
|
|
7312
7401
|
if (layer.markerSettings[i].dataSource instanceof DataManager) {
|
|
7313
7402
|
this.serverProcess['request']++;
|
|
7314
7403
|
dataModule = layer.markerSettings[i].dataSource;
|
|
7315
|
-
queryModule = layer.markerSettings[i].query instanceof Query ?
|
|
7404
|
+
queryModule = layer.markerSettings[i].query instanceof Query ?
|
|
7405
|
+
layer.markerSettings[i].query : new Query();
|
|
7316
7406
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
7317
7407
|
const dataManager = dataModule.executeQuery(queryModule);
|
|
7318
7408
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -7328,7 +7418,8 @@ let Maps = class Maps extends Component {
|
|
|
7328
7418
|
if (layer.bubbleSettings[i].dataSource instanceof DataManager) {
|
|
7329
7419
|
this.serverProcess['request']++;
|
|
7330
7420
|
dataModule = layer.bubbleSettings[i].dataSource;
|
|
7331
|
-
queryModule = layer.bubbleSettings[i].query instanceof Query ?
|
|
7421
|
+
queryModule = layer.bubbleSettings[i].query instanceof Query ?
|
|
7422
|
+
layer.bubbleSettings[i].query : new Query();
|
|
7332
7423
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
7333
7424
|
const dataManager = dataModule.executeQuery(queryModule);
|
|
7334
7425
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -7413,7 +7504,7 @@ let Maps = class Maps extends Component {
|
|
|
7413
7504
|
const position = this.getExtraPosition();
|
|
7414
7505
|
for (let i = 0; i < this.layers.length; i++) {
|
|
7415
7506
|
if (position.x !== 0 || position.y !== 0) {
|
|
7416
|
-
|
|
7507
|
+
const markerTemplate$$1 = document.getElementById(this.element.id + '_LayerIndex_' + i + '_Markers_Template_Group');
|
|
7417
7508
|
if (!isNullOrUndefined(markerTemplate$$1)) {
|
|
7418
7509
|
markerTemplate$$1.style.top = this.mapAreaRect.y + position.y + 'px';
|
|
7419
7510
|
markerTemplate$$1.style.left = this.mapAreaRect.x + position.x + 'px';
|
|
@@ -7434,6 +7525,7 @@ let Maps = class Maps extends Component {
|
|
|
7434
7525
|
}
|
|
7435
7526
|
if (!this.isResize) {
|
|
7436
7527
|
for (let k = 0; k < this.layers[i].markerSettings.length; k++) {
|
|
7528
|
+
// eslint-disable-next-line max-len
|
|
7437
7529
|
if (this.layers[i].markerSettings[k].selectionSettings && this.layers[i].markerSettings[k].selectionSettings.enable
|
|
7438
7530
|
&& this.layers[i].markerSettings[k].initialMarkerSelection.length > 0) {
|
|
7439
7531
|
const markerSelectionValues = this.layers[i].markerSettings[k].initialMarkerSelection;
|
|
@@ -7505,7 +7597,9 @@ let Maps = class Maps extends Component {
|
|
|
7505
7597
|
}
|
|
7506
7598
|
}
|
|
7507
7599
|
this.zoomingChange();
|
|
7508
|
-
this.
|
|
7600
|
+
if (!this.isZoomByPosition && !this.zoomNotApplied) {
|
|
7601
|
+
this.trigger(loaded, { maps: this, isResized: this.isResize });
|
|
7602
|
+
}
|
|
7509
7603
|
this.isResize = false;
|
|
7510
7604
|
}
|
|
7511
7605
|
/**
|
|
@@ -7599,7 +7693,7 @@ let Maps = class Maps extends Component {
|
|
|
7599
7693
|
addTabIndex() {
|
|
7600
7694
|
this.element.setAttribute('aria-label', this.description || 'Maps Element');
|
|
7601
7695
|
this.element.setAttribute('role', '');
|
|
7602
|
-
this.element.
|
|
7696
|
+
this.element.tabIndex = this.tabIndex;
|
|
7603
7697
|
}
|
|
7604
7698
|
// private setSecondaryElementPosition(): void {
|
|
7605
7699
|
// if (!this.isTileMap) {
|
|
@@ -7617,8 +7711,8 @@ let Maps = class Maps extends Component {
|
|
|
7617
7711
|
this.zoomModule.layerCollectionEle = getElementByID(this.element.id + '_Layer_Collections');
|
|
7618
7712
|
}
|
|
7619
7713
|
if (this.isTileMap && getElementByID(this.element.id + '_Tile_SVG') && getElementByID(this.element.id + '_tile_parent')) {
|
|
7620
|
-
|
|
7621
|
-
|
|
7714
|
+
const tileElement = getElementByID(this.element.id + '_tile_parent');
|
|
7715
|
+
const tileSvgElement = getElementByID(this.element.id + '_Tile_SVG');
|
|
7622
7716
|
const tileSvgParentElement = getElementByID(this.element.id + '_Tile_SVG_Parent');
|
|
7623
7717
|
const tileRect = tileElement.getBoundingClientRect();
|
|
7624
7718
|
const tileSvgRect = tileSvgElement.getBoundingClientRect();
|
|
@@ -7627,8 +7721,10 @@ let Maps = class Maps extends Component {
|
|
|
7627
7721
|
tileSvgParentElement.style.left = left + 'px';
|
|
7628
7722
|
tileSvgParentElement.style.top = top + 'px';
|
|
7629
7723
|
if (!isNullOrUndefined(this.legendModule) && this.legendModule.totalPages.length > 0) {
|
|
7630
|
-
tileElement.style.width = tileSvgElement.style.width =
|
|
7631
|
-
|
|
7724
|
+
tileElement.style.width = tileSvgElement.style.width =
|
|
7725
|
+
this.legendModule.legendTotalRect.width.toString();
|
|
7726
|
+
tileElement.style.height = tileSvgElement.style.height =
|
|
7727
|
+
this.legendModule.legendTotalRect.height.toString();
|
|
7632
7728
|
tileSvgParentElement.style.width = this.legendModule.legendTotalRect.width + 'px';
|
|
7633
7729
|
tileSvgParentElement.style.height = this.legendModule.legendTotalRect.height + 'px';
|
|
7634
7730
|
}
|
|
@@ -7649,7 +7745,7 @@ let Maps = class Maps extends Component {
|
|
|
7649
7745
|
if (!isNullOrUndefined(elements) && elements.childElementCount > 0) {
|
|
7650
7746
|
for (let i = 0; i < elements.childNodes.length; i++) {
|
|
7651
7747
|
const childElement = elements.childNodes[i];
|
|
7652
|
-
if (childElement.tagName === 'g' && childElement.id.indexOf('_Legend_Group')
|
|
7748
|
+
if (childElement.tagName === 'g' && childElement.id.indexOf('_Legend_Group') === -1) {
|
|
7653
7749
|
const layerIndex = parseFloat(childElement.id.split('_LayerIndex_')[1].split('_')[0]);
|
|
7654
7750
|
for (let j = 0; j < childElement.childNodes.length; j++) {
|
|
7655
7751
|
const childNode = childElement.childNodes[j];
|
|
@@ -7662,7 +7758,7 @@ let Maps = class Maps extends Component {
|
|
|
7662
7758
|
}
|
|
7663
7759
|
}
|
|
7664
7760
|
}
|
|
7665
|
-
if (this.zoomModule && (this.previousScale !== this.scale)) {
|
|
7761
|
+
if (this.zoomModule && ((this.previousScale !== this.scale) || this.zoomNotApplied || this.isZoomByPosition)) {
|
|
7666
7762
|
this.zoomModule.applyTransform(this, true);
|
|
7667
7763
|
}
|
|
7668
7764
|
}
|
|
@@ -7670,9 +7766,9 @@ let Maps = class Maps extends Component {
|
|
|
7670
7766
|
createSecondaryElement() {
|
|
7671
7767
|
if (isNullOrUndefined(document.getElementById(this.element.id + '_Secondary_Element'))) {
|
|
7672
7768
|
const secondaryElement = createElement('div', {
|
|
7673
|
-
id: this.element.id + '_Secondary_Element'
|
|
7674
|
-
styles: 'position: absolute;z-index:2;'
|
|
7769
|
+
id: this.element.id + '_Secondary_Element'
|
|
7675
7770
|
});
|
|
7771
|
+
secondaryElement.style.cssText = 'position: absolute;z-index:2;';
|
|
7676
7772
|
this.element.appendChild(secondaryElement);
|
|
7677
7773
|
}
|
|
7678
7774
|
}
|
|
@@ -7726,18 +7822,20 @@ let Maps = class Maps extends Component {
|
|
|
7726
7822
|
removeElement(this.element.id + '_tiles');
|
|
7727
7823
|
removeElement('animated_tiles');
|
|
7728
7824
|
const ele = createElement('div', {
|
|
7729
|
-
id: this.element.id + '_tile_parent'
|
|
7730
|
-
(this.mapAreaRect.x) + 'px; right: ' + (this.margin.right) + 'px; top: '
|
|
7731
|
-
+ (this.mapAreaRect.y + padding) + 'px; height: ' +
|
|
7732
|
-
(this.mapAreaRect.height) + 'px; width: '
|
|
7733
|
-
+ (this.mapAreaRect.width) + 'px; overflow: hidden;'
|
|
7825
|
+
id: this.element.id + '_tile_parent'
|
|
7734
7826
|
});
|
|
7827
|
+
ele.style.cssText = 'position: absolute; left: ' +
|
|
7828
|
+
(this.mapAreaRect.x) + 'px; right: ' + (this.margin.right) + 'px; top: '
|
|
7829
|
+
+ (this.mapAreaRect.y + padding) + 'px; height: ' +
|
|
7830
|
+
(this.mapAreaRect.height) + 'px; width: '
|
|
7831
|
+
+ (this.mapAreaRect.width) + 'px; overflow: hidden;';
|
|
7735
7832
|
const ele1 = createElement('div', {
|
|
7736
|
-
id: this.element.id + '_tiles'
|
|
7737
|
-
(this.mapAreaRect.x) + 'px; right: ' + (this.margin.right) + 'px; top: '
|
|
7738
|
-
+ (this.mapAreaRect.y + padding) + 'px; height: ' + (this.mapAreaRect.height) + 'px; width: '
|
|
7739
|
-
+ (this.mapAreaRect.width) + 'px; overflow: hidden;'
|
|
7833
|
+
id: this.element.id + '_tiles'
|
|
7740
7834
|
});
|
|
7835
|
+
ele1.style.cssText = 'position: absolute; left: ' +
|
|
7836
|
+
(this.mapAreaRect.x) + 'px; right: ' + (this.margin.right) + 'px; top: '
|
|
7837
|
+
+ (this.mapAreaRect.y + padding) + 'px; height: ' + (this.mapAreaRect.height) + 'px; width: '
|
|
7838
|
+
+ (this.mapAreaRect.width) + 'px; overflow: hidden;';
|
|
7741
7839
|
this.element.appendChild(ele);
|
|
7742
7840
|
this.element.appendChild(ele1);
|
|
7743
7841
|
}
|
|
@@ -7777,7 +7875,7 @@ let Maps = class Maps extends Component {
|
|
|
7777
7875
|
break;
|
|
7778
7876
|
}
|
|
7779
7877
|
}
|
|
7780
|
-
subLayers.map((subLayer
|
|
7878
|
+
subLayers.map((subLayer) => {
|
|
7781
7879
|
if (subLayer.visible) {
|
|
7782
7880
|
this.layersCollection.push(subLayer);
|
|
7783
7881
|
}
|
|
@@ -7937,6 +8035,9 @@ let Maps = class Maps extends Component {
|
|
|
7937
8035
|
}
|
|
7938
8036
|
keyUpHandler(event) {
|
|
7939
8037
|
const id = event.target['id'];
|
|
8038
|
+
if (this.isTileMap) {
|
|
8039
|
+
this.removeTileMap();
|
|
8040
|
+
}
|
|
7940
8041
|
if (event.code === 'Tab' && id.indexOf('_LayerIndex_') > -1 && id.indexOf('shapeIndex') > -1) {
|
|
7941
8042
|
this.keyboardHighlightSelection(id, event.type);
|
|
7942
8043
|
}
|
|
@@ -7970,6 +8071,13 @@ let Maps = class Maps extends Component {
|
|
|
7970
8071
|
}
|
|
7971
8072
|
keyDownHandler(event) {
|
|
7972
8073
|
const zoom = this.zoomModule;
|
|
8074
|
+
if ((event.code === 'ArrowUp' || event.code === 'ArrowDown' || event.code === 'ArrowLeft'
|
|
8075
|
+
|| event.code === 'ArrowRight') && zoom) {
|
|
8076
|
+
const animatedTiles = document.getElementById(this.element.id + '_animated_tiles');
|
|
8077
|
+
if (this.isTileMap && !isNullOrUndefined(animatedTiles)) {
|
|
8078
|
+
this.currentTiles = animatedTiles.cloneNode(true);
|
|
8079
|
+
}
|
|
8080
|
+
}
|
|
7973
8081
|
if ((event.key === '+' || event.code === 'Equal') && zoom) {
|
|
7974
8082
|
zoom.performZoomingByToolBar('zoomin');
|
|
7975
8083
|
}
|
|
@@ -8044,6 +8152,7 @@ let Maps = class Maps extends Component {
|
|
|
8044
8152
|
* This method is used to perform the operations when a click operation is performed on maps.
|
|
8045
8153
|
*
|
|
8046
8154
|
* @param {PointerEvent} e - Specifies the pointer event on maps.
|
|
8155
|
+
* @returns {void}
|
|
8047
8156
|
*/
|
|
8048
8157
|
mapsOnClick(e) {
|
|
8049
8158
|
const targetEle = e.target;
|
|
@@ -8108,8 +8217,9 @@ let Maps = class Maps extends Component {
|
|
|
8108
8217
|
getClickLocation(targetId, pageX, pageY, targetElement, x, y) {
|
|
8109
8218
|
let layerIndex = 0;
|
|
8110
8219
|
let latLongValue;
|
|
8111
|
-
if (targetId.indexOf('_LayerIndex_') !== -1 && !this.isTileMap &&
|
|
8112
|
-
|
|
8220
|
+
if (targetId.indexOf('_LayerIndex_') !== -1 && !this.isTileMap &&
|
|
8221
|
+
(parseInt(this.mouseDownEvent['x'], 10) === parseInt(this.mouseClickEvent['x'], 10)) &&
|
|
8222
|
+
(parseInt(this.mouseDownEvent['y'], 10) === parseInt(this.mouseClickEvent['y'], 10))) {
|
|
8113
8223
|
layerIndex = parseFloat(targetId.split('_LayerIndex_')[1].split('_')[0]);
|
|
8114
8224
|
if (this.layers[layerIndex].geometryType === 'Normal') {
|
|
8115
8225
|
if (targetId.indexOf('_shapeIndex_') > -1) {
|
|
@@ -8146,12 +8256,21 @@ let Maps = class Maps extends Component {
|
|
|
8146
8256
|
latLongValue = this.getGeoLocation(layerIndex, x, y);
|
|
8147
8257
|
}
|
|
8148
8258
|
}
|
|
8149
|
-
else if (this.isTileMap && (parseInt(this.mouseDownEvent['x']) === parseInt(this.mouseClickEvent['x']))
|
|
8150
|
-
|
|
8259
|
+
else if (this.isTileMap && (parseInt(this.mouseDownEvent['x'], 10) === parseInt(this.mouseClickEvent['x'], 10)) &&
|
|
8260
|
+
(parseInt(this.mouseDownEvent['y'], 10) === parseInt(this.mouseClickEvent['y'], 10))) {
|
|
8151
8261
|
latLongValue = this.getTileGeoLocation(x, y);
|
|
8152
8262
|
}
|
|
8153
8263
|
return latLongValue;
|
|
8154
8264
|
}
|
|
8265
|
+
removeTileMap() {
|
|
8266
|
+
const animateElement = document.getElementById(this.element.id + '_animated_tiles');
|
|
8267
|
+
if (!isNullOrUndefined(this.currentTiles) && animateElement.childElementCount !== this.currentTiles.childElementCount) {
|
|
8268
|
+
for (let l = animateElement.childElementCount - 1; l >= this.currentTiles.childElementCount; l--) {
|
|
8269
|
+
animateElement.removeChild(animateElement.children[l]);
|
|
8270
|
+
}
|
|
8271
|
+
}
|
|
8272
|
+
this.currentTiles = null;
|
|
8273
|
+
}
|
|
8155
8274
|
/**
|
|
8156
8275
|
* This method is used to perform operations when mouse click on maps.
|
|
8157
8276
|
*
|
|
@@ -8183,6 +8302,9 @@ let Maps = class Maps extends Component {
|
|
|
8183
8302
|
pageY = e.pageY;
|
|
8184
8303
|
target = e.target;
|
|
8185
8304
|
}
|
|
8305
|
+
if (this.isTileMap) {
|
|
8306
|
+
this.removeTileMap();
|
|
8307
|
+
}
|
|
8186
8308
|
if (this.isTouch) {
|
|
8187
8309
|
if (targetEle.id.indexOf('_ToolBar') === -1) {
|
|
8188
8310
|
const latLongValue = this.getClickLocation(targetId, pageX, pageY, targetEle, pageX, pageY);
|
|
@@ -8215,13 +8337,14 @@ let Maps = class Maps extends Component {
|
|
|
8215
8337
|
}
|
|
8216
8338
|
const rect = this.element.getBoundingClientRect();
|
|
8217
8339
|
const element = e.target;
|
|
8340
|
+
const animatedTiles = document.getElementById(this.element.id + '_animated_tiles');
|
|
8341
|
+
if (this.isTileMap && !isNullOrUndefined(animatedTiles)) {
|
|
8342
|
+
this.currentTiles = animatedTiles.cloneNode(true);
|
|
8343
|
+
}
|
|
8218
8344
|
if (element.id.indexOf('_ToolBar') === -1) {
|
|
8219
8345
|
const markerModule = this.markerModule;
|
|
8220
8346
|
if (element.id.indexOf('shapeIndex') > -1 || element.id.indexOf('Tile') > -1) {
|
|
8221
8347
|
this.mergeCluster();
|
|
8222
|
-
if (element.id.indexOf('shapeIndex') > -1) {
|
|
8223
|
-
this.triggerShapeSelection(element);
|
|
8224
|
-
}
|
|
8225
8348
|
}
|
|
8226
8349
|
if (markerModule) {
|
|
8227
8350
|
markerModule.markerClick(e);
|
|
@@ -8250,6 +8373,7 @@ let Maps = class Maps extends Component {
|
|
|
8250
8373
|
* This method is used to perform operations when performing the double click operation on maps.
|
|
8251
8374
|
*
|
|
8252
8375
|
* @param {PointerEvent} e - Specifies the pointer event.
|
|
8376
|
+
* @returns {void}
|
|
8253
8377
|
*/
|
|
8254
8378
|
mapsOnDoubleClick(e) {
|
|
8255
8379
|
this.notify('dblclick', e);
|
|
@@ -8273,8 +8397,10 @@ let Maps = class Maps extends Component {
|
|
|
8273
8397
|
latitude = latLongValue['latitude'];
|
|
8274
8398
|
longitude = latLongValue['longitude'];
|
|
8275
8399
|
}
|
|
8276
|
-
const doubleClickArgs = {
|
|
8277
|
-
|
|
8400
|
+
const doubleClickArgs = {
|
|
8401
|
+
cancel: false, name: doubleClick, x: e.clientX, y: e.clientY,
|
|
8402
|
+
target: targetId, latitude: latitude, longitude: longitude, isShapeSelected: null
|
|
8403
|
+
};
|
|
8278
8404
|
this.trigger('doubleClick', doubleClickArgs);
|
|
8279
8405
|
}
|
|
8280
8406
|
}
|
|
@@ -8365,28 +8491,30 @@ let Maps = class Maps extends Component {
|
|
|
8365
8491
|
* @param e - Specifies the arguments of window resize event.
|
|
8366
8492
|
*/
|
|
8367
8493
|
mapsOnResize(e) {
|
|
8368
|
-
|
|
8369
|
-
|
|
8370
|
-
|
|
8371
|
-
|
|
8372
|
-
|
|
8373
|
-
|
|
8374
|
-
|
|
8375
|
-
|
|
8376
|
-
|
|
8377
|
-
|
|
8378
|
-
if (
|
|
8379
|
-
|
|
8380
|
-
|
|
8381
|
-
|
|
8382
|
-
this.
|
|
8383
|
-
this.
|
|
8384
|
-
|
|
8385
|
-
|
|
8386
|
-
|
|
8387
|
-
|
|
8388
|
-
|
|
8389
|
-
|
|
8494
|
+
if (!this.isDestroyed) {
|
|
8495
|
+
this.isResize = this.isReset = true;
|
|
8496
|
+
const args = {
|
|
8497
|
+
cancel: false,
|
|
8498
|
+
name: resize,
|
|
8499
|
+
previousSize: this.availableSize,
|
|
8500
|
+
currentSize: calculateSize(this),
|
|
8501
|
+
maps: this
|
|
8502
|
+
};
|
|
8503
|
+
this.trigger(resize, args);
|
|
8504
|
+
if (!args.cancel) {
|
|
8505
|
+
if (this.resizeTo) {
|
|
8506
|
+
clearTimeout(this.resizeTo);
|
|
8507
|
+
}
|
|
8508
|
+
if (!isNullOrUndefined(this.element) && this.element.classList.contains('e-maps')) {
|
|
8509
|
+
this.resizeTo = setTimeout(() => {
|
|
8510
|
+
this.unWireEVents();
|
|
8511
|
+
this.createSVG();
|
|
8512
|
+
this.refreshing = true;
|
|
8513
|
+
this.wireEVents();
|
|
8514
|
+
this.render();
|
|
8515
|
+
this.refreshing = false;
|
|
8516
|
+
}, 500);
|
|
8517
|
+
}
|
|
8390
8518
|
}
|
|
8391
8519
|
}
|
|
8392
8520
|
return false;
|
|
@@ -8401,32 +8529,34 @@ let Maps = class Maps extends Component {
|
|
|
8401
8529
|
* @returns {void}
|
|
8402
8530
|
*/
|
|
8403
8531
|
zoomByPosition(centerPosition, zoomFactor) {
|
|
8404
|
-
|
|
8405
|
-
|
|
8406
|
-
|
|
8407
|
-
|
|
8408
|
-
|
|
8409
|
-
|
|
8410
|
-
|
|
8411
|
-
|
|
8412
|
-
|
|
8413
|
-
|
|
8414
|
-
|
|
8415
|
-
|
|
8416
|
-
|
|
8417
|
-
|
|
8418
|
-
|
|
8419
|
-
|
|
8532
|
+
if (!this.isDestroyed) {
|
|
8533
|
+
this.zoomNotApplied = false;
|
|
8534
|
+
let isRefresh = this.zoomSettings.zoomFactor === zoomFactor;
|
|
8535
|
+
if (!this.isTileMap && this.zoomModule) {
|
|
8536
|
+
if (!isNullOrUndefined(centerPosition)) {
|
|
8537
|
+
this.zoomSettings.zoomFactor = zoomFactor;
|
|
8538
|
+
isRefresh = this.centerPosition.latitude === centerPosition.latitude &&
|
|
8539
|
+
this.centerPosition.longitude === centerPosition.longitude ? true : isRefresh;
|
|
8540
|
+
this.centerPosition = centerPosition;
|
|
8541
|
+
this.isZoomByPosition = true;
|
|
8542
|
+
this.mapScaleValue = null;
|
|
8543
|
+
}
|
|
8544
|
+
else {
|
|
8545
|
+
this.zoomSettings.zoomFactor = zoomFactor;
|
|
8546
|
+
this.isZoomByPosition = true;
|
|
8547
|
+
this.mapScaleValue = null;
|
|
8548
|
+
}
|
|
8420
8549
|
}
|
|
8421
|
-
else {
|
|
8422
|
-
|
|
8423
|
-
this.
|
|
8550
|
+
else if (this.zoomModule) {
|
|
8551
|
+
this.tileZoomLevel = this.zoomSettings.zoomFactor = zoomFactor;
|
|
8552
|
+
isRefresh = this.centerPosition.latitude === centerPosition.latitude &&
|
|
8553
|
+
this.centerPosition.longitude === centerPosition.longitude ? true : isRefresh;
|
|
8554
|
+
this.centerPosition = centerPosition;
|
|
8555
|
+
this.isZoomByPosition = true;
|
|
8556
|
+
}
|
|
8557
|
+
if (isRefresh) {
|
|
8558
|
+
this.refresh();
|
|
8424
8559
|
}
|
|
8425
|
-
}
|
|
8426
|
-
else if (this.zoomModule) {
|
|
8427
|
-
this.tileZoomLevel = zoomFactor;
|
|
8428
|
-
this.tileTranslatePoint = this.mapLayerPanel['panTileMap'](this.availableSize.width, this.availableSize.height, { x: centerPosition.longitude, y: centerPosition.latitude });
|
|
8429
|
-
this.mapLayerPanel.generateTiles(zoomFactor, this.tileTranslatePoint, null, new BingMap(this));
|
|
8430
8560
|
}
|
|
8431
8561
|
}
|
|
8432
8562
|
/**
|
|
@@ -8434,38 +8564,44 @@ let Maps = class Maps extends Component {
|
|
|
8434
8564
|
*
|
|
8435
8565
|
* @param {PanDirection} direction - Specifies the direction in which the panning is performed.
|
|
8436
8566
|
* @param {PointerEvent | TouchEvent} mouseLocation - Specifies the location of the mouse pointer in maps.
|
|
8567
|
+
* @returns {void}
|
|
8437
8568
|
*/
|
|
8438
8569
|
panByDirection(direction, mouseLocation) {
|
|
8439
|
-
|
|
8440
|
-
|
|
8441
|
-
|
|
8442
|
-
|
|
8443
|
-
|
|
8444
|
-
|
|
8445
|
-
|
|
8446
|
-
|
|
8447
|
-
|
|
8448
|
-
|
|
8449
|
-
|
|
8450
|
-
|
|
8451
|
-
|
|
8452
|
-
|
|
8453
|
-
|
|
8454
|
-
|
|
8455
|
-
|
|
8456
|
-
this.zoomModule
|
|
8570
|
+
if (!this.isDestroyed) {
|
|
8571
|
+
let xDiff = 0;
|
|
8572
|
+
let yDiff = 0;
|
|
8573
|
+
switch (direction) {
|
|
8574
|
+
case 'Left':
|
|
8575
|
+
xDiff = -(this.mapAreaRect.width / 7);
|
|
8576
|
+
break;
|
|
8577
|
+
case 'Right':
|
|
8578
|
+
xDiff = (this.mapAreaRect.width / 7);
|
|
8579
|
+
break;
|
|
8580
|
+
case 'Top':
|
|
8581
|
+
yDiff = -(this.mapAreaRect.height / 7);
|
|
8582
|
+
break;
|
|
8583
|
+
case 'Bottom':
|
|
8584
|
+
yDiff = (this.mapAreaRect.height / 7);
|
|
8585
|
+
break;
|
|
8586
|
+
}
|
|
8587
|
+
if (this.zoomModule) {
|
|
8588
|
+
this.zoomModule.panning(direction, xDiff, yDiff, mouseLocation);
|
|
8589
|
+
}
|
|
8457
8590
|
}
|
|
8458
8591
|
}
|
|
8459
8592
|
/**
|
|
8460
8593
|
* This method is used to add the layers dynamically to the maps.
|
|
8461
8594
|
*
|
|
8462
8595
|
* @param {Object} layer - Specifies the layer for the maps.
|
|
8596
|
+
* @returns {void}
|
|
8463
8597
|
*/
|
|
8464
8598
|
addLayer(layer) {
|
|
8465
|
-
|
|
8466
|
-
|
|
8467
|
-
|
|
8468
|
-
|
|
8599
|
+
if (!this.isDestroyed) {
|
|
8600
|
+
const mapsLayer = this.layers;
|
|
8601
|
+
mapsLayer.push(layer);
|
|
8602
|
+
this.isAddLayer = true;
|
|
8603
|
+
this.layers = mapsLayer;
|
|
8604
|
+
}
|
|
8469
8605
|
}
|
|
8470
8606
|
/**
|
|
8471
8607
|
* This method is used to remove a layer from map.
|
|
@@ -8474,9 +8610,11 @@ let Maps = class Maps extends Component {
|
|
|
8474
8610
|
* @returns {void}
|
|
8475
8611
|
*/
|
|
8476
8612
|
removeLayer(index) {
|
|
8477
|
-
|
|
8478
|
-
|
|
8479
|
-
|
|
8613
|
+
if (!this.isDestroyed) {
|
|
8614
|
+
const mapsLayer = this.layers;
|
|
8615
|
+
mapsLayer.splice(index, 1);
|
|
8616
|
+
this.layers = mapsLayer;
|
|
8617
|
+
}
|
|
8480
8618
|
}
|
|
8481
8619
|
/**
|
|
8482
8620
|
* This method is used to add markers dynamically in the maps.
|
|
@@ -8488,14 +8626,16 @@ let Maps = class Maps extends Component {
|
|
|
8488
8626
|
* @returns {void}
|
|
8489
8627
|
*/
|
|
8490
8628
|
addMarker(layerIndex, markerCollection) {
|
|
8491
|
-
|
|
8492
|
-
|
|
8493
|
-
|
|
8494
|
-
|
|
8629
|
+
if (!this.isDestroyed) {
|
|
8630
|
+
const layerEle = document.getElementById(this.element.id + '_LayerIndex_' + layerIndex);
|
|
8631
|
+
if (markerCollection.length > 0 && layerEle) {
|
|
8632
|
+
for (const newMarker of markerCollection) {
|
|
8633
|
+
this.layersCollection[layerIndex].markerSettings.push(new MarkerSettings(this, 'markerSettings', newMarker));
|
|
8634
|
+
}
|
|
8635
|
+
const markerModule = new Marker(this);
|
|
8636
|
+
markerModule.markerRender(this, layerEle, layerIndex, this.mapLayerPanel['currentFactor'], 'AddMarker');
|
|
8637
|
+
this.arrangeTemplate();
|
|
8495
8638
|
}
|
|
8496
|
-
const markerModule = new Marker(this);
|
|
8497
|
-
markerModule.markerRender(this, layerEle, layerIndex, this.mapLayerPanel['currentFactor'], 'AddMarker');
|
|
8498
|
-
this.arrangeTemplate();
|
|
8499
8639
|
}
|
|
8500
8640
|
}
|
|
8501
8641
|
/**
|
|
@@ -8508,93 +8648,96 @@ let Maps = class Maps extends Component {
|
|
|
8508
8648
|
* @returns {void}
|
|
8509
8649
|
*/
|
|
8510
8650
|
shapeSelection(layerIndex, propertyName, name, enable) {
|
|
8511
|
-
|
|
8512
|
-
|
|
8513
|
-
|
|
8514
|
-
|
|
8515
|
-
enable
|
|
8516
|
-
|
|
8517
|
-
|
|
8518
|
-
|
|
8519
|
-
this.
|
|
8520
|
-
|
|
8521
|
-
|
|
8522
|
-
|
|
8523
|
-
|
|
8524
|
-
|
|
8525
|
-
|
|
8651
|
+
if (!this.isDestroyed) {
|
|
8652
|
+
let targetEle;
|
|
8653
|
+
let subLayerIndex;
|
|
8654
|
+
const popertyNameArray = Array.isArray(propertyName) ? propertyName : Array(propertyName);
|
|
8655
|
+
if (isNullOrUndefined(enable)) {
|
|
8656
|
+
enable = true;
|
|
8657
|
+
}
|
|
8658
|
+
const selectionsettings = this.layers[layerIndex].selectionSettings;
|
|
8659
|
+
if (!selectionsettings.enableMultiSelect && this.legendSelection && enable) {
|
|
8660
|
+
this.removeShapeSelection();
|
|
8661
|
+
}
|
|
8662
|
+
if (this.layers[layerIndex].type === 'SubLayer') {
|
|
8663
|
+
for (let i = 0; i < this.layersCollection.length; i++) {
|
|
8664
|
+
if ((this.layersCollection[i].shapeData === this.layers[layerIndex].shapeData)) {
|
|
8665
|
+
subLayerIndex = i;
|
|
8666
|
+
break;
|
|
8667
|
+
}
|
|
8526
8668
|
}
|
|
8527
8669
|
}
|
|
8528
|
-
|
|
8529
|
-
|
|
8530
|
-
|
|
8531
|
-
|
|
8532
|
-
|
|
8533
|
-
|
|
8534
|
-
|
|
8535
|
-
|
|
8536
|
-
|
|
8537
|
-
|
|
8538
|
-
|
|
8539
|
-
|
|
8540
|
-
|
|
8541
|
-
|
|
8542
|
-
|
|
8543
|
-
|
|
8544
|
-
|
|
8545
|
-
|
|
8546
|
-
|
|
8547
|
-
|
|
8548
|
-
|
|
8549
|
-
|
|
8550
|
-
|
|
8551
|
-
|
|
8552
|
-
|
|
8553
|
-
|
|
8554
|
-
|
|
8555
|
-
targetId = this.element.id + '_' + 'LayerIndex_' + indexValue + '_shapeIndex_' + i + '_dataIndex_' + k;
|
|
8556
|
-
targetEle = getElement(targetId);
|
|
8557
|
-
if (isNullOrUndefined(k) && isNullOrUndefined(targetEle)) {
|
|
8558
|
-
targetId = this.element.id + '_' + 'LayerIndex_' + layerIndex + '_shapeIndex_' + i + '_dataIndex_null';
|
|
8670
|
+
if (selectionsettings.enable) {
|
|
8671
|
+
let targetId;
|
|
8672
|
+
let dataIndex;
|
|
8673
|
+
let shapeIndex;
|
|
8674
|
+
let indexValue;
|
|
8675
|
+
let shapeDataValue;
|
|
8676
|
+
let data;
|
|
8677
|
+
const shapeData = this.layers[layerIndex].shapeData['features'];
|
|
8678
|
+
for (let i = 0; i < shapeData.length; i++) {
|
|
8679
|
+
for (let j = 0; j < popertyNameArray.length; j++) {
|
|
8680
|
+
const propertyName = !isNullOrUndefined(shapeData[i]['properties'][popertyNameArray[j]])
|
|
8681
|
+
&& isNaN(shapeData[i]['properties'][popertyNameArray[j]]) ?
|
|
8682
|
+
shapeData[i]['properties'][popertyNameArray[j]].toLowerCase() : shapeData[i]['properties'][popertyNameArray[j]];
|
|
8683
|
+
const shapeName = !isNullOrUndefined(name) && typeof name === 'string' ? name.toLowerCase() : name;
|
|
8684
|
+
let k;
|
|
8685
|
+
if (propertyName === shapeName) {
|
|
8686
|
+
if (!isNullOrUndefined(this.layers[layerIndex].shapeSettings.colorValuePath)) {
|
|
8687
|
+
k = checkShapeDataFields(this.layers[layerIndex].dataSource, shapeData[i]['properties'], this.layers[layerIndex].shapeDataPath, this.layers[layerIndex].shapePropertyPath, this.layers[layerIndex]);
|
|
8688
|
+
}
|
|
8689
|
+
const baseLayer = this.layers[layerIndex];
|
|
8690
|
+
if (this.baseLayerIndex >= 0 && baseLayer.isBaseLayer) {
|
|
8691
|
+
indexValue = 0;
|
|
8692
|
+
}
|
|
8693
|
+
else if (this.layers[layerIndex].type === 'SubLayer') {
|
|
8694
|
+
indexValue = subLayerIndex;
|
|
8695
|
+
}
|
|
8696
|
+
targetId = this.element.id + '_' + 'LayerIndex_' + indexValue + '_shapeIndex_' + i + '_dataIndex_' + k;
|
|
8559
8697
|
targetEle = getElement(targetId);
|
|
8560
|
-
|
|
8561
|
-
|
|
8562
|
-
|
|
8563
|
-
this.layers[layerIndex].shapeData['features'][shapeIndex]['properties'] : null;
|
|
8564
|
-
dataIndex = parseInt(targetEle.id.split('_dataIndex_')[1].split('_')[0], 10);
|
|
8565
|
-
data = isNullOrUndefined(dataIndex) ? null : this.layers[layerIndex].dataSource[dataIndex];
|
|
8566
|
-
if (enable) {
|
|
8567
|
-
triggerItemSelectionEvent(selectionsettings, this, targetEle, shapeDataValue, data);
|
|
8568
|
-
this.shapeSelectionClass = getElement('ShapeselectionMap');
|
|
8569
|
-
if (this.legendSettings.visible && targetEle.id.indexOf('_MarkerIndex_') === -1) {
|
|
8570
|
-
this.legendModule.shapeHighLightAndSelection(targetEle, data, selectionsettings, 'selection', layerIndex);
|
|
8698
|
+
if (isNullOrUndefined(k) && isNullOrUndefined(targetEle)) {
|
|
8699
|
+
targetId = this.element.id + '_' + 'LayerIndex_' + layerIndex + '_shapeIndex_' + i + '_dataIndex_null';
|
|
8700
|
+
targetEle = getElement(targetId);
|
|
8571
8701
|
}
|
|
8572
|
-
|
|
8573
|
-
|
|
8574
|
-
|
|
8575
|
-
|
|
8576
|
-
|
|
8702
|
+
shapeIndex = parseInt(targetEle.id.split('_shapeIndex_')[1].split('_')[0], 10);
|
|
8703
|
+
shapeDataValue = this.layers[layerIndex].shapeData['features']['length'] > shapeIndex ?
|
|
8704
|
+
this.layers[layerIndex].shapeData['features'][shapeIndex]['properties'] : null;
|
|
8705
|
+
dataIndex = parseInt(targetEle.id.split('_dataIndex_')[1].split('_')[0], 10);
|
|
8706
|
+
data = isNullOrUndefined(dataIndex) ? null : this.layers[layerIndex].dataSource[dataIndex];
|
|
8707
|
+
if (enable) {
|
|
8708
|
+
triggerItemSelectionEvent(selectionsettings, this, targetEle, shapeDataValue, data);
|
|
8709
|
+
this.shapeSelectionClass = getElement('ShapeselectionMap');
|
|
8710
|
+
if (this.legendSettings.visible && targetEle.id.indexOf('_MarkerIndex_') === -1) {
|
|
8711
|
+
this.legendModule.shapeHighLightAndSelection(targetEle, data, selectionsettings, 'selection', layerIndex);
|
|
8577
8712
|
}
|
|
8578
|
-
|
|
8579
|
-
|
|
8713
|
+
const shapeToggled = this.legendSettings.visible ? this.legendModule.shapeToggled : true;
|
|
8714
|
+
if (shapeToggled) {
|
|
8715
|
+
targetEle.setAttribute('class', 'ShapeselectionMapStyle');
|
|
8716
|
+
if (this.selectedElementId.indexOf(targetEle.getAttribute('id')) === -1) {
|
|
8717
|
+
this.selectedElementId.push(targetEle.getAttribute('id'));
|
|
8718
|
+
}
|
|
8719
|
+
if (!selectionsettings.enableMultiSelect) {
|
|
8720
|
+
return;
|
|
8721
|
+
}
|
|
8580
8722
|
}
|
|
8581
8723
|
}
|
|
8582
|
-
|
|
8583
|
-
|
|
8584
|
-
|
|
8585
|
-
|
|
8586
|
-
|
|
8587
|
-
|
|
8588
|
-
|
|
8589
|
-
|
|
8590
|
-
|
|
8591
|
-
|
|
8592
|
-
|
|
8593
|
-
|
|
8594
|
-
|
|
8595
|
-
|
|
8596
|
-
|
|
8597
|
-
|
|
8724
|
+
else {
|
|
8725
|
+
this.legendSelection = (!selectionsettings.enableMultiSelect && !this.legendSelection) ?
|
|
8726
|
+
true : this.legendSelection;
|
|
8727
|
+
if (this.legendSettings.visible && targetEle.id.indexOf('_MarkerIndex_') === -1 &&
|
|
8728
|
+
targetEle.getAttribute('class') === 'ShapeselectionMapStyle') {
|
|
8729
|
+
this.legendModule.shapeHighLightAndSelection(targetEle, data, selectionsettings, 'selection', layerIndex);
|
|
8730
|
+
}
|
|
8731
|
+
const shapeToggled = this.legendSettings.visible ? this.legendModule.shapeToggled : true;
|
|
8732
|
+
if (shapeToggled) {
|
|
8733
|
+
removeClass(targetEle);
|
|
8734
|
+
const selectedElementIdIndex = this.selectedElementId.indexOf(targetEle.getAttribute('id'));
|
|
8735
|
+
if (selectedElementIdIndex !== -1) {
|
|
8736
|
+
this.selectedElementId.splice(selectedElementIdIndex, 1);
|
|
8737
|
+
if (!selectionsettings.enableMultiSelect && this.legendSelection
|
|
8738
|
+
&& this.selectedElementId.length > 0) {
|
|
8739
|
+
this.removeShapeSelection();
|
|
8740
|
+
}
|
|
8598
8741
|
}
|
|
8599
8742
|
}
|
|
8600
8743
|
}
|
|
@@ -8614,48 +8757,55 @@ let Maps = class Maps extends Component {
|
|
|
8614
8757
|
* @returns {void}
|
|
8615
8758
|
*/
|
|
8616
8759
|
zoomToCoordinates(minLatitude, minLongitude, maxLatitude, maxLongitude) {
|
|
8617
|
-
|
|
8618
|
-
|
|
8619
|
-
|
|
8620
|
-
|
|
8621
|
-
|
|
8622
|
-
|
|
8623
|
-
|
|
8624
|
-
|
|
8625
|
-
|
|
8626
|
-
|
|
8627
|
-
|
|
8628
|
-
|
|
8629
|
-
|
|
8630
|
-
|
|
8631
|
-
|
|
8632
|
-
|
|
8633
|
-
|
|
8634
|
-
|
|
8635
|
-
|
|
8636
|
-
|
|
8760
|
+
if (!this.isDestroyed) {
|
|
8761
|
+
let centerLatitude;
|
|
8762
|
+
let centerLongtitude;
|
|
8763
|
+
let isTwoCoordinates = false;
|
|
8764
|
+
this.centerPosition = {
|
|
8765
|
+
latitude: null,
|
|
8766
|
+
longitude: null
|
|
8767
|
+
};
|
|
8768
|
+
this.isZoomByPosition = false;
|
|
8769
|
+
if (isNullOrUndefined(maxLatitude) && isNullOrUndefined(maxLongitude)
|
|
8770
|
+
|| isNullOrUndefined(minLatitude) && isNullOrUndefined(minLongitude)) {
|
|
8771
|
+
minLatitude = isNullOrUndefined(minLatitude) ? 0 : minLatitude;
|
|
8772
|
+
minLongitude = isNullOrUndefined(minLatitude) ? 0 : minLongitude;
|
|
8773
|
+
maxLatitude = isNullOrUndefined(maxLatitude) ? minLatitude : maxLatitude;
|
|
8774
|
+
maxLongitude = isNullOrUndefined(maxLongitude) ? minLongitude : maxLongitude;
|
|
8775
|
+
isTwoCoordinates = true;
|
|
8776
|
+
}
|
|
8777
|
+
if (minLatitude > maxLatitude) {
|
|
8778
|
+
[minLatitude, maxLatitude] = [maxLatitude, minLatitude];
|
|
8779
|
+
}
|
|
8780
|
+
if (minLongitude > maxLongitude) {
|
|
8781
|
+
[minLongitude, maxLongitude] = [maxLongitude, minLongitude];
|
|
8782
|
+
}
|
|
8783
|
+
if (!isTwoCoordinates) {
|
|
8784
|
+
centerLatitude = (minLatitude + maxLatitude) / 2;
|
|
8785
|
+
centerLongtitude = (minLongitude + maxLongitude) / 2;
|
|
8786
|
+
}
|
|
8787
|
+
else {
|
|
8788
|
+
centerLatitude = (minLatitude + maxLatitude);
|
|
8789
|
+
centerLongtitude = (minLongitude + maxLongitude);
|
|
8790
|
+
}
|
|
8791
|
+
this.centerLatOfGivenLocation = centerLatitude;
|
|
8792
|
+
this.centerLongOfGivenLocation = centerLongtitude;
|
|
8793
|
+
this.minLatOfGivenLocation = minLatitude;
|
|
8794
|
+
this.minLongOfGivenLocation = minLongitude;
|
|
8795
|
+
this.maxLatOfGivenLocation = maxLatitude;
|
|
8796
|
+
this.maxLongOfGivenLocation = maxLongitude;
|
|
8797
|
+
this.zoomNotApplied = true;
|
|
8798
|
+
this.scaleOfGivenLocation = calculateZoomLevel(minLatitude, maxLatitude, minLongitude, maxLongitude, this.mapAreaRect.width, this.mapAreaRect.height, this);
|
|
8799
|
+
const zoomArgs = {
|
|
8800
|
+
cancel: false, name: 'zoom', type: zoomIn, maps: this,
|
|
8801
|
+
tileTranslatePoint: {}, translatePoint: {},
|
|
8802
|
+
tileZoomLevel: this.isTileMap ? { previous: this.tileZoomLevel, current: this.scaleOfGivenLocation } : {},
|
|
8803
|
+
scale: !this.isTileMap ? { previous: this.scale, current: this.scaleOfGivenLocation } :
|
|
8804
|
+
{ previous: this.tileZoomLevel, current: this.scaleOfGivenLocation }
|
|
8805
|
+
};
|
|
8806
|
+
this.trigger('zoom', zoomArgs);
|
|
8807
|
+
this.refresh();
|
|
8637
8808
|
}
|
|
8638
|
-
else {
|
|
8639
|
-
centerLatitude = (minLatitude + maxLatitude);
|
|
8640
|
-
centerLongtitude = (minLongitude + maxLongitude);
|
|
8641
|
-
}
|
|
8642
|
-
this.centerLatOfGivenLocation = centerLatitude;
|
|
8643
|
-
this.centerLongOfGivenLocation = centerLongtitude;
|
|
8644
|
-
this.minLatOfGivenLocation = minLatitude;
|
|
8645
|
-
this.minLongOfGivenLocation = minLongitude;
|
|
8646
|
-
this.maxLatOfGivenLocation = maxLatitude;
|
|
8647
|
-
this.maxLongOfGivenLocation = maxLongitude;
|
|
8648
|
-
this.zoomNotApplied = true;
|
|
8649
|
-
this.scaleOfGivenLocation = calculateZoomLevel(minLatitude, maxLatitude, minLongitude, maxLongitude, this.mapAreaRect.width, this.mapAreaRect.height, this);
|
|
8650
|
-
const zoomArgs = {
|
|
8651
|
-
cancel: false, name: 'zoom', type: zoomIn, maps: this,
|
|
8652
|
-
tileTranslatePoint: {}, translatePoint: {},
|
|
8653
|
-
tileZoomLevel: this.isTileMap ? { previous: this.tileZoomLevel, current: this.scaleOfGivenLocation } : {},
|
|
8654
|
-
scale: !this.isTileMap ? { previous: this.scale, current: this.scaleOfGivenLocation } :
|
|
8655
|
-
{ previous: this.tileZoomLevel, current: this.scaleOfGivenLocation }
|
|
8656
|
-
};
|
|
8657
|
-
this.trigger('zoom', zoomArgs);
|
|
8658
|
-
this.refresh();
|
|
8659
8809
|
}
|
|
8660
8810
|
/**
|
|
8661
8811
|
* This method is used to remove multiple selected shapes in the maps.
|
|
@@ -8706,6 +8856,8 @@ let Maps = class Maps extends Component {
|
|
|
8706
8856
|
}
|
|
8707
8857
|
/**
|
|
8708
8858
|
* This method disposes the maps component.
|
|
8859
|
+
*
|
|
8860
|
+
* @returns {void}
|
|
8709
8861
|
*/
|
|
8710
8862
|
destroy() {
|
|
8711
8863
|
this.unWireEVents();
|
|
@@ -8762,91 +8914,94 @@ let Maps = class Maps extends Component {
|
|
|
8762
8914
|
* @private
|
|
8763
8915
|
*/
|
|
8764
8916
|
onPropertyChanged(newProp, oldProp) {
|
|
8765
|
-
|
|
8766
|
-
|
|
8767
|
-
|
|
8768
|
-
|
|
8769
|
-
|
|
8770
|
-
|
|
8771
|
-
|
|
8772
|
-
|
|
8773
|
-
|
|
8774
|
-
|
|
8775
|
-
|
|
8776
|
-
|
|
8777
|
-
|
|
8778
|
-
|
|
8779
|
-
|
|
8780
|
-
|
|
8781
|
-
|
|
8782
|
-
|
|
8783
|
-
|
|
8784
|
-
|
|
8785
|
-
|
|
8786
|
-
|
|
8787
|
-
|
|
8788
|
-
|
|
8789
|
-
|
|
8790
|
-
|
|
8791
|
-
|
|
8792
|
-
|
|
8793
|
-
|
|
8794
|
-
|
|
8795
|
-
|
|
8796
|
-
|
|
8797
|
-
|
|
8798
|
-
|
|
8799
|
-
|
|
8800
|
-
|
|
8801
|
-
|
|
8917
|
+
if (!this.isDestroyed) {
|
|
8918
|
+
let render = false;
|
|
8919
|
+
let isMarker = false;
|
|
8920
|
+
let isLayer = false;
|
|
8921
|
+
let isStaticMapType = false;
|
|
8922
|
+
let layerEle;
|
|
8923
|
+
if (newProp['layers']) {
|
|
8924
|
+
const newLayerLength = Object.keys(newProp['layers']).length;
|
|
8925
|
+
layerEle = document.getElementById(this.element.id + '_LayerIndex_' + (newLayerLength - 1));
|
|
8926
|
+
}
|
|
8927
|
+
for (const prop of Object.keys(newProp)) {
|
|
8928
|
+
switch (prop) {
|
|
8929
|
+
case 'background':
|
|
8930
|
+
this.renderBorder();
|
|
8931
|
+
break;
|
|
8932
|
+
case 'height':
|
|
8933
|
+
case 'width':
|
|
8934
|
+
case 'layers':
|
|
8935
|
+
case 'projectionType':
|
|
8936
|
+
case 'centerPosition':
|
|
8937
|
+
case 'legendSettings':
|
|
8938
|
+
case 'baseLayerIndex':
|
|
8939
|
+
if (prop === 'layers') {
|
|
8940
|
+
isLayer = true;
|
|
8941
|
+
const layerPropLength = Object.keys(newProp.layers).length;
|
|
8942
|
+
for (let x = 0; x < layerPropLength; x++) {
|
|
8943
|
+
if (!isNullOrUndefined(newProp.layers[x])) {
|
|
8944
|
+
const collection = Object.keys(newProp.layers[x]);
|
|
8945
|
+
for (const collectionProp of collection) {
|
|
8946
|
+
if ((collectionProp === 'layerType' && newProp.layers[x].layerType !== 'Geometry') ||
|
|
8947
|
+
(isNullOrUndefined(this.layers[x].shapeData)
|
|
8948
|
+
&& !isNullOrUndefined(this.layers[x].urlTemplate) && this.layers[x].urlTemplate !== '')) {
|
|
8949
|
+
this.isReset = true;
|
|
8950
|
+
}
|
|
8951
|
+
else if (collectionProp === 'markerSettings') {
|
|
8952
|
+
isMarker = true;
|
|
8953
|
+
}
|
|
8954
|
+
else if (collectionProp === 'staticMapType') {
|
|
8955
|
+
isStaticMapType = true;
|
|
8956
|
+
}
|
|
8802
8957
|
}
|
|
8803
8958
|
}
|
|
8804
8959
|
}
|
|
8805
8960
|
}
|
|
8806
|
-
|
|
8807
|
-
|
|
8808
|
-
|
|
8809
|
-
|
|
8810
|
-
|
|
8811
|
-
|
|
8812
|
-
|
|
8813
|
-
|
|
8814
|
-
|
|
8815
|
-
|
|
8816
|
-
|
|
8817
|
-
|
|
8818
|
-
|
|
8819
|
-
|
|
8820
|
-
|
|
8821
|
-
|
|
8822
|
-
|
|
8823
|
-
|
|
8961
|
+
render = true;
|
|
8962
|
+
break;
|
|
8963
|
+
case 'zoomSettings':
|
|
8964
|
+
if (!isNullOrUndefined(oldProp.zoomSettings)) {
|
|
8965
|
+
if (newProp.zoomSettings.zoomFactor !== oldProp.zoomSettings.zoomFactor && !isLayer) {
|
|
8966
|
+
render = false;
|
|
8967
|
+
}
|
|
8968
|
+
else if (newProp.zoomSettings.shouldZoomInitially !== oldProp.zoomSettings.shouldZoomInitially) {
|
|
8969
|
+
this.zoomSettings.zoomFactor = 1;
|
|
8970
|
+
render = true;
|
|
8971
|
+
}
|
|
8972
|
+
else if (newProp.zoomSettings.enable !== oldProp.zoomSettings.enable) {
|
|
8973
|
+
this.zoomSettings.zoomFactor = 1;
|
|
8974
|
+
render = true;
|
|
8975
|
+
}
|
|
8976
|
+
else {
|
|
8977
|
+
render = true;
|
|
8978
|
+
}
|
|
8824
8979
|
}
|
|
8825
|
-
|
|
8826
|
-
|
|
8827
|
-
|
|
8828
|
-
|
|
8829
|
-
|
|
8830
|
-
|
|
8980
|
+
break;
|
|
8981
|
+
case 'locale':
|
|
8982
|
+
case 'currencyCode':
|
|
8983
|
+
super.refresh();
|
|
8984
|
+
break;
|
|
8985
|
+
}
|
|
8831
8986
|
}
|
|
8832
|
-
|
|
8833
|
-
|
|
8834
|
-
|
|
8835
|
-
|
|
8836
|
-
|
|
8837
|
-
|
|
8987
|
+
if (render) {
|
|
8988
|
+
if (newProp.layers && isMarker) {
|
|
8989
|
+
removeElement(this.element.id + '_Markers_Group');
|
|
8990
|
+
if (this.isTileMap) {
|
|
8991
|
+
this.mapLayerPanel.renderTileLayer(this.mapLayerPanel, this.layers['currentFactor'], (this.layers.length - 1));
|
|
8992
|
+
}
|
|
8993
|
+
else {
|
|
8994
|
+
this.render();
|
|
8995
|
+
}
|
|
8996
|
+
}
|
|
8997
|
+
else if (newProp.layers && isStaticMapType) {
|
|
8998
|
+
this.mapLayerPanel.renderGoogleMap(this.layers[this.layers.length - 1].key, this.staticMapZoom);
|
|
8838
8999
|
}
|
|
8839
9000
|
else {
|
|
8840
|
-
this.
|
|
9001
|
+
this.createSVG();
|
|
9002
|
+
this.renderElements();
|
|
8841
9003
|
}
|
|
8842
9004
|
}
|
|
8843
|
-
else if (newProp.layers && isStaticMapType) {
|
|
8844
|
-
this.mapLayerPanel.renderGoogleMap(this.layers[this.layers.length - 1].key, this.staticMapZoom);
|
|
8845
|
-
}
|
|
8846
|
-
else {
|
|
8847
|
-
this.createSVG();
|
|
8848
|
-
this.renderElements();
|
|
8849
|
-
}
|
|
8850
9005
|
}
|
|
8851
9006
|
}
|
|
8852
9007
|
/**
|
|
@@ -8859,7 +9014,7 @@ let Maps = class Maps extends Component {
|
|
|
8859
9014
|
const modules = [];
|
|
8860
9015
|
const isVisible = this.findVisibleLayers(this.layers);
|
|
8861
9016
|
let annotationEnable = false;
|
|
8862
|
-
this.annotations.map((annotation
|
|
9017
|
+
this.annotations.map((annotation) => {
|
|
8863
9018
|
annotationEnable = annotation.content != null;
|
|
8864
9019
|
});
|
|
8865
9020
|
if (this.isBubbleVisible()) {
|
|
@@ -8944,10 +9099,12 @@ let Maps = class Maps extends Component {
|
|
|
8944
9099
|
}
|
|
8945
9100
|
/**
|
|
8946
9101
|
* To find marker visibility
|
|
9102
|
+
*
|
|
9103
|
+
* @returns {boolean} - Returns whether the markers are visible or not.
|
|
8947
9104
|
*/
|
|
8948
9105
|
isMarkersVisible() {
|
|
8949
9106
|
let isVisible = false;
|
|
8950
|
-
Array.prototype.forEach.call(this.layers, (layer
|
|
9107
|
+
Array.prototype.forEach.call(this.layers, (layer) => {
|
|
8951
9108
|
for (let i = 0; i < layer.markerSettings.length; i++) {
|
|
8952
9109
|
if (layer.markerSettings[i].visible) {
|
|
8953
9110
|
isVisible = true;
|
|
@@ -8959,6 +9116,8 @@ let Maps = class Maps extends Component {
|
|
|
8959
9116
|
}
|
|
8960
9117
|
/**
|
|
8961
9118
|
* To find DataLabel visibility
|
|
9119
|
+
*
|
|
9120
|
+
* @returns {boolean} - Returns whether the data labels are visible or not.
|
|
8962
9121
|
*/
|
|
8963
9122
|
isDataLabelVisible() {
|
|
8964
9123
|
let isVisible = false;
|
|
@@ -8972,10 +9131,12 @@ let Maps = class Maps extends Component {
|
|
|
8972
9131
|
}
|
|
8973
9132
|
/**
|
|
8974
9133
|
* To find navigation line visibility
|
|
9134
|
+
*
|
|
9135
|
+
* @returns {boolean} - Returns whether the navigation lines are visible or not.
|
|
8975
9136
|
*/
|
|
8976
9137
|
isNavigationVisible() {
|
|
8977
9138
|
let isVisible = false;
|
|
8978
|
-
Array.prototype.forEach.call(this.layers, (layer
|
|
9139
|
+
Array.prototype.forEach.call(this.layers, (layer) => {
|
|
8979
9140
|
for (let i = 0; i < layer.navigationLineSettings.length; i++) {
|
|
8980
9141
|
if (layer.navigationLineSettings[i].visible) {
|
|
8981
9142
|
isVisible = true;
|
|
@@ -8987,6 +9148,8 @@ let Maps = class Maps extends Component {
|
|
|
8987
9148
|
}
|
|
8988
9149
|
/**
|
|
8989
9150
|
* To find space between the secondary element and svg element.
|
|
9151
|
+
*
|
|
9152
|
+
* @returns {Point} - Returns the left and top value of the secondary element of Maps.
|
|
8990
9153
|
* @private
|
|
8991
9154
|
*/
|
|
8992
9155
|
getExtraPosition() {
|
|
@@ -9042,7 +9205,7 @@ let Maps = class Maps extends Component {
|
|
|
9042
9205
|
* @returns {void}
|
|
9043
9206
|
*/
|
|
9044
9207
|
print(id) {
|
|
9045
|
-
if ((this.allowPrint) && (this.printModule)) {
|
|
9208
|
+
if ((this.allowPrint) && (this.printModule) && !this.isDestroyed) {
|
|
9046
9209
|
this.printModule.print(this, id);
|
|
9047
9210
|
}
|
|
9048
9211
|
}
|
|
@@ -9056,18 +9219,20 @@ let Maps = class Maps extends Component {
|
|
|
9056
9219
|
* @returns {Promise<string>} - Returns the string value.
|
|
9057
9220
|
*/
|
|
9058
9221
|
export(type, fileName, orientation, allowDownload) {
|
|
9059
|
-
if (
|
|
9060
|
-
allowDownload
|
|
9061
|
-
|
|
9062
|
-
|
|
9063
|
-
|
|
9064
|
-
|
|
9065
|
-
|
|
9066
|
-
|
|
9067
|
-
|
|
9068
|
-
|
|
9069
|
-
|
|
9070
|
-
|
|
9222
|
+
if (!this.isDestroyed) {
|
|
9223
|
+
if (isNullOrUndefined(allowDownload)) {
|
|
9224
|
+
allowDownload = true;
|
|
9225
|
+
}
|
|
9226
|
+
if ((type !== 'PDF') && (this.allowImageExport) && (this.imageExportModule)) {
|
|
9227
|
+
return new Promise((resolve, reject) => {
|
|
9228
|
+
resolve(this.imageExportModule.export(this, type, fileName, allowDownload));
|
|
9229
|
+
});
|
|
9230
|
+
}
|
|
9231
|
+
else if ((this.allowPdfExport) && (this.pdfExportModule)) {
|
|
9232
|
+
return new Promise((resolve, reject) => {
|
|
9233
|
+
resolve(this.pdfExportModule.export(this, type, fileName, allowDownload, orientation));
|
|
9234
|
+
});
|
|
9235
|
+
}
|
|
9071
9236
|
}
|
|
9072
9237
|
return null;
|
|
9073
9238
|
}
|
|
@@ -9078,19 +9243,22 @@ let Maps = class Maps extends Component {
|
|
|
9078
9243
|
* @returns {Promise<string>} - Returns the processed Bing URL as Promise.
|
|
9079
9244
|
*/
|
|
9080
9245
|
getBingUrlTemplate(url) {
|
|
9081
|
-
|
|
9082
|
-
|
|
9083
|
-
|
|
9246
|
+
let promise;
|
|
9247
|
+
if (!this.isDestroyed) {
|
|
9248
|
+
promise = new Promise((resolve, reject) => {
|
|
9249
|
+
const ajax = new Ajax({
|
|
9250
|
+
url: url
|
|
9251
|
+
});
|
|
9252
|
+
ajax.onSuccess = (json) => {
|
|
9253
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9254
|
+
const jsonObject = JSON.parse(json);
|
|
9255
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9256
|
+
const resource = jsonObject['resourceSets'][0]['resources'][0];
|
|
9257
|
+
resolve(resource['imageUrl']);
|
|
9258
|
+
};
|
|
9259
|
+
ajax.send();
|
|
9084
9260
|
});
|
|
9085
|
-
|
|
9086
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9087
|
-
const jsonObject = JSON.parse(json);
|
|
9088
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9089
|
-
const resource = jsonObject['resourceSets'][0]['resources'][0];
|
|
9090
|
-
resolve(resource['imageUrl']);
|
|
9091
|
-
};
|
|
9092
|
-
ajax.send();
|
|
9093
|
-
});
|
|
9261
|
+
}
|
|
9094
9262
|
return promise;
|
|
9095
9263
|
}
|
|
9096
9264
|
/**
|
|
@@ -9162,21 +9330,25 @@ let Maps = class Maps extends Component {
|
|
|
9162
9330
|
* @returns {GeoPosition}- Returns the geo position
|
|
9163
9331
|
*/
|
|
9164
9332
|
getGeoLocation(layerIndex, x, y) {
|
|
9165
|
-
|
|
9166
|
-
|
|
9167
|
-
|
|
9168
|
-
|
|
9169
|
-
|
|
9170
|
-
|
|
9171
|
-
|
|
9172
|
-
|
|
9173
|
-
|
|
9174
|
-
|
|
9175
|
-
|
|
9176
|
-
|
|
9177
|
-
|
|
9178
|
-
|
|
9179
|
-
|
|
9333
|
+
let latitude = 0;
|
|
9334
|
+
let longitude = 0;
|
|
9335
|
+
if (!this.isDestroyed) {
|
|
9336
|
+
const container = document.getElementById(this.element.id);
|
|
9337
|
+
const pageX = x - container.offsetLeft;
|
|
9338
|
+
const pageY = y - container.offsetTop;
|
|
9339
|
+
const currentLayer = this.layersCollection[layerIndex];
|
|
9340
|
+
const translate = getTranslate(this, currentLayer, false);
|
|
9341
|
+
const translatePoint = translate['location'];
|
|
9342
|
+
const translatePointX = translatePoint.x * this.scale;
|
|
9343
|
+
const translatePointY = translatePoint.y * this.scale;
|
|
9344
|
+
const mapSize = (Math.min(this.mapAreaRect.height, this.mapAreaRect.width)
|
|
9345
|
+
* this.mapLayerPanel['currentFactor']) * this.scale;
|
|
9346
|
+
const xx = (this.clip(pageX - translatePointX, 0, mapSize - 1) / mapSize) - 0.5;
|
|
9347
|
+
const yy = 0.5 - (this.clip(pageY - translatePointY, 0, mapSize - 1) / mapSize);
|
|
9348
|
+
latitude = 90 - 360 * Math.atan(Math.exp(-yy * 2 * Math.PI)) / Math.PI;
|
|
9349
|
+
longitude = 360 * xx;
|
|
9350
|
+
}
|
|
9351
|
+
return { latitude: latitude, longitude: longitude };
|
|
9180
9352
|
}
|
|
9181
9353
|
clip(value, minVal, maxVal) {
|
|
9182
9354
|
return Math.min(Math.max(value, minVal), maxVal);
|
|
@@ -9189,10 +9361,16 @@ let Maps = class Maps extends Component {
|
|
|
9189
9361
|
* @returns {GeoPosition} - Returns the position
|
|
9190
9362
|
*/
|
|
9191
9363
|
getTileGeoLocation(x, y) {
|
|
9192
|
-
|
|
9193
|
-
|
|
9194
|
-
|
|
9195
|
-
|
|
9364
|
+
let latitude = 0;
|
|
9365
|
+
let longitude = 0;
|
|
9366
|
+
if (!this.isDestroyed) {
|
|
9367
|
+
const container = document.getElementById(this.element.id);
|
|
9368
|
+
const ele = document.getElementById(this.element.id + '_tile_parent');
|
|
9369
|
+
const latLong = this.pointToLatLong(x + this.mapAreaRect.x - (ele.offsetLeft - container.offsetLeft), y + this.mapAreaRect.y - (ele.offsetTop - container.offsetTop));
|
|
9370
|
+
latitude = latLong['latitude'];
|
|
9371
|
+
longitude = latLong['longitude'];
|
|
9372
|
+
}
|
|
9373
|
+
return { latitude: latitude, longitude: longitude };
|
|
9196
9374
|
}
|
|
9197
9375
|
/**
|
|
9198
9376
|
* This method is used to convert the point to latitude and longitude in maps.
|
|
@@ -9202,14 +9380,18 @@ let Maps = class Maps extends Component {
|
|
|
9202
9380
|
* @returns {Object} - Returns the object.
|
|
9203
9381
|
*/
|
|
9204
9382
|
pointToLatLong(pageX, pageY) {
|
|
9205
|
-
|
|
9206
|
-
|
|
9207
|
-
|
|
9208
|
-
|
|
9209
|
-
|
|
9210
|
-
|
|
9211
|
-
|
|
9212
|
-
|
|
9383
|
+
let latitude = 0;
|
|
9384
|
+
let longitude = 0;
|
|
9385
|
+
if (!this.isDestroyed) {
|
|
9386
|
+
const padding = this.layers[this.layers.length - 1].layerType === 'GoogleStaticMap' ? 0 : 10;
|
|
9387
|
+
pageY = (this.zoomSettings.enable) ? pageY + padding : pageY;
|
|
9388
|
+
const mapSize = 256 * Math.pow(2, this.tileZoomLevel);
|
|
9389
|
+
const x1 = (this.clip(pageX - (this.translatePoint.x * this.scale), 0, mapSize - 1) / mapSize) - 0.5;
|
|
9390
|
+
const y1 = 0.5 - (this.clip(pageY - (this.translatePoint.y * this.scale), 0, mapSize - 1) / mapSize);
|
|
9391
|
+
latitude = 90 - 360 * Math.atan(Math.exp(-y1 * 2 * Math.PI)) / Math.PI;
|
|
9392
|
+
longitude = 360 * x1;
|
|
9393
|
+
}
|
|
9394
|
+
return { latitude: latitude, longitude: longitude };
|
|
9213
9395
|
}
|
|
9214
9396
|
};
|
|
9215
9397
|
__decorate([
|
|
@@ -9403,7 +9585,8 @@ class Bubble {
|
|
|
9403
9585
|
const layerData = layer.layerData;
|
|
9404
9586
|
const colorValuePath = bubbleSettings.colorValuePath;
|
|
9405
9587
|
const equalValue = (!isNullOrUndefined(colorValuePath)) ? ((colorValuePath.indexOf('.') > -1) ?
|
|
9406
|
-
(getValueFromObject(shapeData, bubbleSettings.colorValuePath)) : shapeData[colorValuePath]) :
|
|
9588
|
+
(getValueFromObject(shapeData, bubbleSettings.colorValuePath)) : shapeData[colorValuePath]) :
|
|
9589
|
+
shapeData[colorValuePath];
|
|
9407
9590
|
const colorValue = (!isNullOrUndefined(colorValuePath)) ? ((colorValuePath.indexOf('.') > -1) ?
|
|
9408
9591
|
Number(getValueFromObject(shapeData, bubbleSettings.colorValuePath)) : Number(shapeData[colorValuePath])) :
|
|
9409
9592
|
Number(shapeData[colorValuePath]);
|
|
@@ -9557,16 +9740,17 @@ class Bubble {
|
|
|
9557
9740
|
}
|
|
9558
9741
|
else {
|
|
9559
9742
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9560
|
-
shape.map((current
|
|
9743
|
+
shape.map((current) => {
|
|
9561
9744
|
points.push(new Point(current['point']['x'], current['point']['y']));
|
|
9562
9745
|
});
|
|
9563
9746
|
}
|
|
9564
9747
|
return points;
|
|
9565
9748
|
}
|
|
9566
|
-
// eslint-disable-next-line valid-jsdoc
|
|
9567
9749
|
/**
|
|
9568
9750
|
* To check and trigger bubble click event
|
|
9569
9751
|
*
|
|
9752
|
+
* @param {PointerEvent} e - Specifies the pointer event argument.
|
|
9753
|
+
* @returns {void}
|
|
9570
9754
|
* @private
|
|
9571
9755
|
*/
|
|
9572
9756
|
bubbleClick(e) {
|
|
@@ -9612,6 +9796,8 @@ class Bubble {
|
|
|
9612
9796
|
/**
|
|
9613
9797
|
* To check and trigger bubble move event
|
|
9614
9798
|
*
|
|
9799
|
+
* @param {PointerEvent} e - Specifies the pointer event argument.
|
|
9800
|
+
* @retruns {void}
|
|
9615
9801
|
* @private
|
|
9616
9802
|
*/
|
|
9617
9803
|
bubbleMove(e) {
|
|
@@ -9700,6 +9886,7 @@ class DataLabel {
|
|
|
9700
9886
|
layerData, group, labelTemplateElement, index, intersect) {
|
|
9701
9887
|
const dataLabel = layer.dataLabelSettings;
|
|
9702
9888
|
const style = layer.dataLabelSettings.textStyle;
|
|
9889
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9703
9890
|
let templateFn;
|
|
9704
9891
|
let options;
|
|
9705
9892
|
const dataLabelSettings = layer.dataLabelSettings;
|
|
@@ -9710,7 +9897,6 @@ class DataLabel {
|
|
|
9710
9897
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9711
9898
|
const shapeData = shape;
|
|
9712
9899
|
let element;
|
|
9713
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9714
9900
|
let text = '';
|
|
9715
9901
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9716
9902
|
let datasrcObj;
|
|
@@ -9732,7 +9918,7 @@ class DataLabel {
|
|
|
9732
9918
|
const properties = (Object.prototype.toString.call(layer.shapePropertyPath) === '[object Array]' ?
|
|
9733
9919
|
layer.shapePropertyPath : [layer.shapePropertyPath]);
|
|
9734
9920
|
let propertyPath;
|
|
9735
|
-
|
|
9921
|
+
const isPoint = false;
|
|
9736
9922
|
const animate$$1 = layer.animationDuration !== 0 || isNullOrUndefined(this.maps.zoomModule);
|
|
9737
9923
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9738
9924
|
const translate = (this.maps.isTileMap) ? new Object() : ((this.maps.zoomSettings.zoomFactor > 1 &&
|
|
@@ -9849,7 +10035,6 @@ class DataLabel {
|
|
|
9849
10035
|
if (eventargs.cancel) {
|
|
9850
10036
|
return;
|
|
9851
10037
|
}
|
|
9852
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9853
10038
|
let position = [];
|
|
9854
10039
|
let width = zoomLabelsPosition && scaleZoomValue > 1 && !this.maps.zoomNotApplied
|
|
9855
10040
|
&& this.maps.zoomShapeCollection.length > index ? this.maps.zoomShapeCollection[index]['width'] :
|
|
@@ -9893,8 +10078,14 @@ class DataLabel {
|
|
|
9893
10078
|
datasrcObj : shapeData['properties'], this.maps, eventargs.template, this.maps.element.id + '_LabelTemplate', false) : document.createElement('div');
|
|
9894
10079
|
templateElement.innerHTML = !templateFn ? eventargs.template : '';
|
|
9895
10080
|
labelElement = convertElementFromLabel(templateElement, labelId, !isNullOrUndefined(datasrcObj) ? datasrcObj : shapeData['properties'], index, this.maps);
|
|
9896
|
-
|
|
9897
|
-
|
|
10081
|
+
if (this.maps.isTileMap) {
|
|
10082
|
+
labelElement.style.left = (((location['x'] + transPoint['x']) * scale) - (textSize['width'] / 2)) + 'px';
|
|
10083
|
+
labelElement.style.top = (((location['y'] + transPoint['y']) * scale) - textSize['height']) + 'px';
|
|
10084
|
+
}
|
|
10085
|
+
else {
|
|
10086
|
+
labelElement.style.left = ((Math.abs(this.maps.baseMapRectBounds['min']['x'] - location['x'])) * scale) + labelArgs.offsetX + 'px';
|
|
10087
|
+
labelElement.style.top = ((Math.abs(this.maps.baseMapRectBounds['min']['y'] - location['y'])) * scale) + labelArgs.offsetY + 'px';
|
|
10088
|
+
}
|
|
9898
10089
|
labelTemplateElement.appendChild(labelElement);
|
|
9899
10090
|
}
|
|
9900
10091
|
else {
|
|
@@ -10029,7 +10220,7 @@ class DataLabel {
|
|
|
10029
10220
|
}
|
|
10030
10221
|
else {
|
|
10031
10222
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10032
|
-
shapes.map((current
|
|
10223
|
+
shapes.map((current) => {
|
|
10033
10224
|
points.push(new Point(current['point']['x'], current['point']['y']));
|
|
10034
10225
|
});
|
|
10035
10226
|
}
|
|
@@ -10044,7 +10235,6 @@ class DataLabel {
|
|
|
10044
10235
|
return 'DataLabel';
|
|
10045
10236
|
}
|
|
10046
10237
|
/**
|
|
10047
|
-
*
|
|
10048
10238
|
* @returns {void}
|
|
10049
10239
|
* @private
|
|
10050
10240
|
*/
|
|
@@ -10062,79 +10252,84 @@ class NavigationLine {
|
|
|
10062
10252
|
constructor(maps) {
|
|
10063
10253
|
this.maps = maps;
|
|
10064
10254
|
}
|
|
10065
|
-
// eslint-disable-next-line valid-jsdoc
|
|
10066
10255
|
/**
|
|
10067
10256
|
* To render navigation line for maps
|
|
10257
|
+
*
|
|
10258
|
+
* @param {LayerSettings} layer - Specifies the layer instance to which the navigation line is to be rendered.
|
|
10259
|
+
* @param {number} factor - Specifies the current zoom factor of the Maps.
|
|
10260
|
+
* @param {number} layerIndex -Specifies the index of current layer.
|
|
10261
|
+
* @returns {Element} - Returns the navigation line element.
|
|
10068
10262
|
*/
|
|
10069
10263
|
renderNavigation(layer, factor, layerIndex) {
|
|
10070
|
-
let
|
|
10071
|
-
|
|
10072
|
-
|
|
10073
|
-
|
|
10074
|
-
|
|
10075
|
-
|
|
10076
|
-
|
|
10077
|
-
|
|
10078
|
-
|
|
10079
|
-
|
|
10080
|
-
|
|
10081
|
-
|
|
10082
|
-
|
|
10083
|
-
|
|
10084
|
-
|
|
10085
|
-
|
|
10086
|
-
|
|
10087
|
-
|
|
10088
|
-
|
|
10089
|
-
|
|
10090
|
-
|
|
10091
|
-
|
|
10092
|
-
|
|
10093
|
-
|
|
10094
|
-
|
|
10095
|
-
|
|
10096
|
-
|
|
10097
|
-
|
|
10098
|
-
|
|
10099
|
-
|
|
10100
|
-
|
|
10101
|
-
|
|
10102
|
-
latitude = navigation[i]['properties']['latitude'];
|
|
10103
|
-
longitude = navigation[i]['properties']['longitude'];
|
|
10104
|
-
visible = navigation[i]['properties']['visible'];
|
|
10105
|
-
angle = navigation[i]['angle'];
|
|
10106
|
-
width = navigation[i]['width'] || 1;
|
|
10107
|
-
color = navigation[i]['color'];
|
|
10108
|
-
dashArray = navigation[i]['properties']['dashArray'];
|
|
10109
|
-
arrowSettings = navigation[i]['properties']['arrowSettings'];
|
|
10110
|
-
showArrow = (isNullOrUndefined(arrowSettings)) ? false : arrowSettings['properties']['showArrow'];
|
|
10111
|
-
if (longitude['length'] === latitude['length'] && visible) {
|
|
10112
|
-
for (let i = 0; i < longitude['length']; i++) {
|
|
10113
|
-
const location = (this.maps.isTileMap) ? convertTileLatLongToPoint(new Point(longitude[i], latitude[i]), factor, this.maps.tileTranslatePoint, true) : convertGeoToPoint(latitude[i], longitude[i], factor, layer, this.maps);
|
|
10114
|
-
point.push(location);
|
|
10115
|
-
}
|
|
10116
|
-
}
|
|
10117
|
-
navigationGroup = (this.maps.renderer.createGroup({
|
|
10118
|
-
id: this.maps.element.id + '_LayerIndex_' + layerIndex + '_NavigationGroup' + i + ''
|
|
10264
|
+
let group;
|
|
10265
|
+
if (!isNullOrUndefined(this.maps)) {
|
|
10266
|
+
let navigationEle;
|
|
10267
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10268
|
+
const navigation = layer.navigationLineSettings;
|
|
10269
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10270
|
+
let longitude;
|
|
10271
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10272
|
+
let point = [];
|
|
10273
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10274
|
+
let latitude;
|
|
10275
|
+
let visible;
|
|
10276
|
+
let angle;
|
|
10277
|
+
let width;
|
|
10278
|
+
let color;
|
|
10279
|
+
let dashArray;
|
|
10280
|
+
let pathOption;
|
|
10281
|
+
let direction;
|
|
10282
|
+
let showArrow;
|
|
10283
|
+
let arrowColor;
|
|
10284
|
+
let arrowSize;
|
|
10285
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10286
|
+
let arrowSettings;
|
|
10287
|
+
let arrowPosition;
|
|
10288
|
+
let startArrow;
|
|
10289
|
+
let endArrow;
|
|
10290
|
+
let offSet;
|
|
10291
|
+
let offSetValue;
|
|
10292
|
+
let navigationGroup;
|
|
10293
|
+
let d;
|
|
10294
|
+
group = (this.maps.renderer.createGroup({
|
|
10295
|
+
id: this.maps.element.id + '_LayerIndex_' + layerIndex + '_line_Group'
|
|
10119
10296
|
}));
|
|
10120
|
-
for (let
|
|
10121
|
-
|
|
10122
|
-
|
|
10123
|
-
|
|
10124
|
-
|
|
10125
|
-
|
|
10126
|
-
|
|
10127
|
-
|
|
10128
|
-
|
|
10129
|
-
|
|
10130
|
-
|
|
10131
|
-
|
|
10132
|
-
|
|
10133
|
-
|
|
10297
|
+
for (let i = 0; i < navigation.length; i++) {
|
|
10298
|
+
latitude = navigation[i]['properties']['latitude'];
|
|
10299
|
+
longitude = navigation[i]['properties']['longitude'];
|
|
10300
|
+
visible = navigation[i]['properties']['visible'];
|
|
10301
|
+
angle = navigation[i]['angle'];
|
|
10302
|
+
width = navigation[i]['width'] || 1;
|
|
10303
|
+
color = navigation[i]['color'];
|
|
10304
|
+
dashArray = navigation[i]['properties']['dashArray'];
|
|
10305
|
+
arrowSettings = navigation[i]['properties']['arrowSettings'];
|
|
10306
|
+
showArrow = (isNullOrUndefined(arrowSettings)) ? false : arrowSettings['properties']['showArrow'];
|
|
10307
|
+
if (longitude['length'] === latitude['length'] && visible) {
|
|
10308
|
+
for (let i = 0; i < longitude['length']; i++) {
|
|
10309
|
+
const location = (this.maps.isTileMap) ? convertTileLatLongToPoint(new Point(longitude[i], latitude[i]), factor, this.maps.tileTranslatePoint, true) : convertGeoToPoint(latitude[i], longitude[i], factor, layer, this.maps);
|
|
10310
|
+
point.push(location);
|
|
10311
|
+
}
|
|
10312
|
+
}
|
|
10313
|
+
navigationGroup = (this.maps.renderer.createGroup({
|
|
10314
|
+
id: this.maps.element.id + '_LayerIndex_' + layerIndex + '_NavigationGroup' + i + ''
|
|
10315
|
+
}));
|
|
10316
|
+
for (let j = 0; j < point['length'] - 1; j++) {
|
|
10317
|
+
angle = (-1 > angle) ? -1 : angle;
|
|
10318
|
+
angle = (1 < angle) ? 1 : angle;
|
|
10319
|
+
const arcId = this.maps.element.id + '_LayerIndex_' + layerIndex + '_NavigationIndex_' + i + '_Line' + j + '';
|
|
10320
|
+
const radius = this.convertRadius(point[j], point[j + 1]);
|
|
10321
|
+
if (angle <= 1 && angle > 0) {
|
|
10134
10322
|
direction = 0;
|
|
10323
|
+
if (point[j]['x'] > point[j + 1]['x']) {
|
|
10324
|
+
direction = 1;
|
|
10325
|
+
}
|
|
10326
|
+
}
|
|
10327
|
+
if (angle >= -1 && angle < 0) {
|
|
10328
|
+
direction = 1;
|
|
10329
|
+
if (point[j]['x'] > point[j + 1]['x']) {
|
|
10330
|
+
direction = 0;
|
|
10331
|
+
}
|
|
10135
10332
|
}
|
|
10136
|
-
}
|
|
10137
|
-
if (point[j]['x'] !== point[j + 1]['x']) {
|
|
10138
10333
|
if (showArrow) {
|
|
10139
10334
|
arrowColor = arrowSettings['properties']['color'];
|
|
10140
10335
|
arrowSize = arrowSettings['properties']['size'];
|
|
@@ -10179,8 +10374,8 @@ class NavigationLine {
|
|
|
10179
10374
|
navigationGroup.appendChild(navigationEle);
|
|
10180
10375
|
group.appendChild(navigationGroup);
|
|
10181
10376
|
}
|
|
10377
|
+
point = [];
|
|
10182
10378
|
}
|
|
10183
|
-
point = [];
|
|
10184
10379
|
}
|
|
10185
10380
|
return group;
|
|
10186
10381
|
}
|
|
@@ -10512,7 +10707,7 @@ class Legend {
|
|
|
10512
10707
|
}
|
|
10513
10708
|
}
|
|
10514
10709
|
else {
|
|
10515
|
-
|
|
10710
|
+
const padding = 10;
|
|
10516
10711
|
shapeX = shapeLocation[j - 1].x;
|
|
10517
10712
|
shapeY = prevPositionY + padding + (shapeHeight / 2);
|
|
10518
10713
|
}
|
|
@@ -10673,7 +10868,7 @@ class Legend {
|
|
|
10673
10868
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10674
10869
|
const collection = this.totalPages[page]['Collection'][i];
|
|
10675
10870
|
const shapeBorder = collection['shapeBorder'];
|
|
10676
|
-
|
|
10871
|
+
const legendElement = render.createGroup({ id: map.element.id + '_Legend_Index_' + collection['idIndex'] });
|
|
10677
10872
|
let legendText = collection['DisplayText'];
|
|
10678
10873
|
const pagingArrowPadding = 4;
|
|
10679
10874
|
const shape = ((legend.type === 'Markers') ? ((isNullOrUndefined(collection['ImageSrc'])) ?
|
|
@@ -10687,15 +10882,16 @@ class Legend {
|
|
|
10687
10882
|
const textId = map.element.id + '_Legend_Text_Index_' + collection['idIndex'];
|
|
10688
10883
|
const shapeLocation = new Point(collection['Shape']['x'], (collection['Shape']['y'] - pagingArrowPadding));
|
|
10689
10884
|
const textLocation = new Point(collection['Text']['x'], (collection['Text']['y'] - pagingArrowPadding));
|
|
10690
|
-
const imageUrl = ((isNullOrUndefined(collection['ImageSrc'])) ? legend.shape : collection['ImageSrc']);
|
|
10691
10885
|
const renderOptions = new PathOption(shapeId, collection['Fill'], strokeWidth, strokeColor, legend.opacity, isNullOrUndefined(shapeBorder.opacity) ? legend.opacity : shapeBorder.opacity, '');
|
|
10692
10886
|
const legendTextStyle = {
|
|
10693
10887
|
fontFamily: legend.textStyle.fontFamily, fontStyle: legend.textStyle.fontStyle,
|
|
10694
|
-
fontWeight: legend.textStyle.fontWeight, size: legend.textStyle.size, color: legend.textStyle.color,
|
|
10888
|
+
fontWeight: legend.textStyle.fontWeight, size: legend.textStyle.size, color: legend.textStyle.color,
|
|
10889
|
+
opacity: legend.textStyle.opacity
|
|
10695
10890
|
};
|
|
10696
10891
|
legendTextStyle.color = (legendTextStyle.color !== null) ? legendTextStyle.color :
|
|
10697
10892
|
this.maps.themeStyle.legendTextColor;
|
|
10698
|
-
legendTextStyle.fontFamily = !isNullOrUndefined(legendTextStyle.fontFamily) ? legendTextStyle.fontFamily :
|
|
10893
|
+
legendTextStyle.fontFamily = !isNullOrUndefined(legendTextStyle.fontFamily) ? legendTextStyle.fontFamily :
|
|
10894
|
+
this.maps.themeStyle.fontFamily;
|
|
10699
10895
|
legendTextStyle.size = map.themeStyle.legendFontSize || legendTextStyle.size;
|
|
10700
10896
|
if (i === 0) {
|
|
10701
10897
|
this.renderLegendBorder();
|
|
@@ -10705,7 +10901,7 @@ class Legend {
|
|
|
10705
10901
|
const marker$$1 = map.layers[legendShapeData['layerIndex']].markerSettings[legendShapeData['markerIndex']];
|
|
10706
10902
|
legendShape = !isNullOrUndefined(marker$$1.dataSource[legendShapeData['dataIndex']][marker$$1['shapeValuePath']]) && marker$$1.dataSource[legendShapeData['dataIndex']][marker$$1['shapeValuePath']] !== '' ? marker$$1.dataSource[legendShapeData['dataIndex']][marker$$1['shapeValuePath']] : marker$$1.shape;
|
|
10707
10903
|
}
|
|
10708
|
-
if (legendShape ===
|
|
10904
|
+
if (legendShape === 'Balloon') {
|
|
10709
10905
|
legendElement.appendChild(drawBalloon(map, renderOptions, shapeSize, { x: shapeLocation.x, y: (shapeLocation.y + 5) }, 'Legend'));
|
|
10710
10906
|
}
|
|
10711
10907
|
else {
|
|
@@ -10744,14 +10940,14 @@ class Legend {
|
|
|
10744
10940
|
leftPageElement.appendChild(render.drawPath(leftPageOptions));
|
|
10745
10941
|
const leftRectPageOptions = new RectOption(map.element.id + '_Left_Page_Rect', 'transparent', {}, 1, new Rect(leftPageX - (width / 2), (locY - (height * 2)), width * 2, spacing * 2), null, null, '', '');
|
|
10746
10942
|
let pathEle = render.drawRectangle(leftRectPageOptions);
|
|
10747
|
-
pathEle.
|
|
10943
|
+
pathEle.tabIndex = (page + 1) === 1 ? -1 : (map.tabIndex + 1);
|
|
10748
10944
|
leftPageElement.appendChild(pathEle);
|
|
10749
10945
|
this.wireEvents(leftPageElement);
|
|
10750
10946
|
const rightPageOptions = new PathOption(map.element.id + '_Right_Page', '#a6a6a6', 0, '#a6a6a6', ((page + 1) === this.totalPages.length ? 0.5 : 1), 1, '', rightPath);
|
|
10751
10947
|
rightPageElement.appendChild(render.drawPath(rightPageOptions));
|
|
10752
10948
|
const rightRectPageOptions = new RectOption(map.element.id + '_Right_Page_Rect', 'transparent', {}, 1, new Rect(rightPageX - spacing - (width / 2), (locY - (height * 2)), width * 2, spacing * 2), null, null, '', '');
|
|
10753
10949
|
pathEle = render.drawRectangle(rightRectPageOptions);
|
|
10754
|
-
pathEle.
|
|
10950
|
+
pathEle.tabIndex = (page + 1) === this.totalPages.length ? -1 : (map.tabIndex + 2);
|
|
10755
10951
|
rightPageElement.appendChild(pathEle);
|
|
10756
10952
|
this.wireEvents(rightPageElement);
|
|
10757
10953
|
pagingGroup.appendChild(leftPageElement);
|
|
@@ -10771,8 +10967,8 @@ class Legend {
|
|
|
10771
10967
|
'opacity': 1,
|
|
10772
10968
|
'dominant-baseline': ''
|
|
10773
10969
|
};
|
|
10774
|
-
|
|
10775
|
-
pagingTextElement.
|
|
10970
|
+
const pagingTextElement = render.createText(pageTextOptions, pagingText);
|
|
10971
|
+
pagingTextElement.style.cssText = 'user-select: none;';
|
|
10776
10972
|
pagingGroup.appendChild(pagingTextElement);
|
|
10777
10973
|
this.legendGroup.appendChild(pagingGroup);
|
|
10778
10974
|
}
|
|
@@ -10906,11 +11102,14 @@ class Legend {
|
|
|
10906
11102
|
this.legendHighlightCollection[length - 1]['MapShapeCollection']['Elements'].push(shapeElement);
|
|
10907
11103
|
const shapeItemCount = this.legendHighlightCollection[length - 1]['MapShapeCollection']['Elements'].length - 1;
|
|
10908
11104
|
const shapeOldFillColor = shapeElement.getAttribute('fill');
|
|
11105
|
+
const shapeOldOpacity = shapeElement.getAttribute('fill-opacity');
|
|
10909
11106
|
this.legendHighlightCollection[length - 1]['shapeOldFillColor'].push(shapeOldFillColor);
|
|
11107
|
+
this.legendHighlightCollection[length - 1]['shapeOldOpacity'] = shapeOldOpacity;
|
|
10910
11108
|
const shapeOldColor = this.legendHighlightCollection[length - 1]['shapeOldFillColor'][shapeItemCount];
|
|
11109
|
+
const shapeOldFillOpacity = this.legendHighlightCollection[length - 1]['shapeOldOpacity'];
|
|
10911
11110
|
this.shapePreviousColor = this.legendHighlightCollection[length - 1]['shapeOldFillColor'];
|
|
10912
|
-
this.setColor(shapeElement, !isNullOrUndefined(module.fill) ? module.fill : shapeOldColor, module.opacity.toString(), module.border.color, module.border.width.toString(), 'highlight');
|
|
10913
|
-
this.setColor(targetElement, !isNullOrUndefined(module.fill) ? module.fill : legendHighlightColor, module.opacity.toString(), module.border.color, module.border.width.toString(), 'highlight');
|
|
11111
|
+
this.setColor(shapeElement, !isNullOrUndefined(module.fill) ? module.fill : shapeOldColor, isNullOrUndefined(module.opacity) ? shapeOldFillOpacity : module.opacity.toString(), module.border.color, module.border.width.toString(), 'highlight');
|
|
11112
|
+
this.setColor(targetElement, !isNullOrUndefined(module.fill) ? module.fill : legendHighlightColor, isNullOrUndefined(module.opacity) ? shapeOldFillOpacity : module.opacity.toString(), module.border.color, module.border.width.toString(), 'highlight');
|
|
10914
11113
|
}
|
|
10915
11114
|
else if (value === 'selection') {
|
|
10916
11115
|
this.legendHighlightCollection = [];
|
|
@@ -10975,6 +11174,7 @@ class Legend {
|
|
|
10975
11174
|
const length = collection.length;
|
|
10976
11175
|
collection[length - 1]['MapShapeCollection'] = { Elements: [] };
|
|
10977
11176
|
collection[length - 1]['shapeOldFillColor'] = [];
|
|
11177
|
+
collection[length - 1]['shapeOldOpacity'] = null;
|
|
10978
11178
|
}
|
|
10979
11179
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10980
11180
|
removeLegend(collection) {
|
|
@@ -10986,7 +11186,8 @@ class Legend {
|
|
|
10986
11186
|
for (let j = 0; j < dataCount; j++) {
|
|
10987
11187
|
const shapeFillColor = item['legendOldFill'].indexOf('url') !== -1
|
|
10988
11188
|
? item['shapeOldFillColor'][j] : item['legendOldFill'];
|
|
10989
|
-
|
|
11189
|
+
const shapeOpacity = !isNullOrUndefined(item['shapeOldOpacity']) ? item['shapeOldOpacity'] : item['shapeOpacity'];
|
|
11190
|
+
this.setColor(item['MapShapeCollection']['Elements'][j], shapeFillColor, shapeOpacity, item['shapeOldBorderColor'], item['shapeOldBorderWidth'], 'highlight');
|
|
10990
11191
|
}
|
|
10991
11192
|
}
|
|
10992
11193
|
}
|
|
@@ -11178,8 +11379,6 @@ class Legend {
|
|
|
11178
11379
|
}
|
|
11179
11380
|
if (selectionEle && (selectionEle['IsSelected'] && (targetElement.getAttribute('class') === 'ShapeselectionMapStyle'
|
|
11180
11381
|
|| targetElement.getAttribute('class') === 'LineselectionMapStyle'))) {
|
|
11181
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11182
|
-
const element = this.maps.legendSelectionCollection[selectionEle['SelectionIndex']];
|
|
11183
11382
|
let multiSelection = 0;
|
|
11184
11383
|
if (module.enableMultiSelect) {
|
|
11185
11384
|
for (let i = 0; i < shapeElement['Elements'].length; i++) {
|
|
@@ -11438,7 +11637,8 @@ class Legend {
|
|
|
11438
11637
|
const legendTitle = legend.title.text;
|
|
11439
11638
|
const textStyle = {
|
|
11440
11639
|
fontFamily: legend.titleStyle.fontFamily, fontStyle: legend.titleStyle.fontStyle,
|
|
11441
|
-
fontWeight: legend.titleStyle.fontWeight, size: legend.titleStyle.size, color: legend.titleStyle.color,
|
|
11640
|
+
fontWeight: legend.titleStyle.fontWeight, size: legend.titleStyle.size, color: legend.titleStyle.color,
|
|
11641
|
+
opacity: legend.titleStyle.opacity
|
|
11442
11642
|
};
|
|
11443
11643
|
let textOptions;
|
|
11444
11644
|
const spacing = 10;
|
|
@@ -11499,7 +11699,8 @@ class Legend {
|
|
|
11499
11699
|
const locationX = !isNullOrUndefined(legend.location.x) ? legend.location.x : 0;
|
|
11500
11700
|
const locationY = !isNullOrUndefined(legend.location.y) ? legend.location.y : 0;
|
|
11501
11701
|
if (legend.position === 'Float') {
|
|
11502
|
-
this.translate = map.isTileMap ? new Point(locationX, locationY + (spacing / 4)) :
|
|
11702
|
+
this.translate = map.isTileMap ? new Point(locationX, locationY + (spacing / 4)) :
|
|
11703
|
+
new Point(locationX + map.mapAreaRect.x, locationY + map.mapAreaRect.y);
|
|
11503
11704
|
this.legendTotalRect = map.mapAreaRect;
|
|
11504
11705
|
}
|
|
11505
11706
|
else {
|
|
@@ -11581,7 +11782,8 @@ class Legend {
|
|
|
11581
11782
|
this.getOverallLegendItemsCollection(text, legendFill, newData, showLegend);
|
|
11582
11783
|
}
|
|
11583
11784
|
else {
|
|
11584
|
-
newData.push({ layerIndex: layerIndex, markerIndex: markerIndex, dataIndex: dataIndex, value: legendFill,
|
|
11785
|
+
newData.push({ layerIndex: layerIndex, markerIndex: markerIndex, dataIndex: dataIndex, value: legendFill,
|
|
11786
|
+
name: text,
|
|
11585
11787
|
shape: (!isNullOrUndefined(marker$$1.shapeValuePath) && !isNullOrUndefined(data[marker$$1.shapeValuePath]) && data[marker$$1.shapeValuePath] !== '') ? data[marker$$1.shapeValuePath] : (this.maps.legendSettings.useMarkerShape ? marker$$1.shape : this.maps.legendSettings.shape) });
|
|
11586
11788
|
this.getOverallLegendItemsCollection(text, legendFill, newData, showLegend);
|
|
11587
11789
|
}
|
|
@@ -11760,6 +11962,7 @@ class Legend {
|
|
|
11760
11962
|
if (outOfRangeValues.length === 0) {
|
|
11761
11963
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11762
11964
|
let range = false;
|
|
11965
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11763
11966
|
Array.prototype.forEach.call(dataSource, (data, dataIndex) => {
|
|
11764
11967
|
range = false;
|
|
11765
11968
|
const rangeValue = data[colorValuePath];
|
|
@@ -12207,10 +12410,12 @@ class Legend {
|
|
|
12207
12410
|
this.maps.toggledShapeElementId.splice(toggledShapeIdIndex, 1);
|
|
12208
12411
|
}
|
|
12209
12412
|
mapLegendElement.setAttribute('fill-opacity', (this.maps.layers[k].shapeSettings.opacity).toString());
|
|
12210
|
-
mapLegendElement.setAttribute('stroke-width', (isNullOrUndefined(this.maps.layers[k].shapeSettings.border.width) ? 0 :
|
|
12413
|
+
mapLegendElement.setAttribute('stroke-width', (isNullOrUndefined(this.maps.layers[k].shapeSettings.border.width) ? 0 :
|
|
12414
|
+
this.maps.layers[k].shapeSettings.border.width).toString());
|
|
12211
12415
|
mapLegendElement.setAttribute('stroke', this.maps.layers[0].shapeSettings.border.color);
|
|
12212
12416
|
mapLegendElement.setAttribute('stroke-opacity', (isNullOrUndefined(this.maps.layers[k].shapeSettings.border.opacity) ?
|
|
12213
|
-
this.maps.layers[k].shapeSettings.opacity :
|
|
12417
|
+
this.maps.layers[k].shapeSettings.opacity :
|
|
12418
|
+
this.maps.layers[k].shapeSettings.border.opacity).toString());
|
|
12214
12419
|
mapLegendElement.setAttribute('fill', this.legendCollection[legendIndex]['fill']);
|
|
12215
12420
|
if (targetEle !== null) {
|
|
12216
12421
|
legendTextId = querySelector(this.maps.element.id + '_Legend_Index_' + legendIndex + '_Text', this.maps.element.id);
|
|
@@ -12274,7 +12479,7 @@ class Legend {
|
|
|
12274
12479
|
&& isNaN(shapeData['properties'][shapePath]) ?
|
|
12275
12480
|
shapeData['properties'][shapePath].toLowerCase() : shapeData['properties'][shapePath];
|
|
12276
12481
|
if (shapeDataValueCase === dataPathValueCase) {
|
|
12277
|
-
if (shapeData['geometry']['type']
|
|
12482
|
+
if (shapeData['geometry']['type'] !== 'MultiPoint') {
|
|
12278
12483
|
legendData.push({
|
|
12279
12484
|
layerIndex: layerIndex, shapeIndex: i, dataIndex: dataIndex,
|
|
12280
12485
|
name: data[dataPath], value: value, pointIndex: -1
|
|
@@ -12516,16 +12721,37 @@ class Highlight {
|
|
|
12516
12721
|
const marker$$1 = parseInt(targetEle.id.split('_MarkerIndex_')[1].split('_')[0], 10);
|
|
12517
12722
|
isMarkerSelect = this.maps.layers[layerIndex].markerSettings[marker$$1].highlightSettings.enable;
|
|
12518
12723
|
}
|
|
12519
|
-
const
|
|
12520
|
-
|
|
12521
|
-
|
|
12522
|
-
|
|
12523
|
-
|
|
12724
|
+
const borderColor = (targetEle.parentElement.id.indexOf('LineString') === -1) ? this.highlightSettings.border.color : (this.highlightSettings.fill || this.highlightSettings.border.color);
|
|
12725
|
+
const borderWidth = (targetEle.parentElement.id.indexOf('LineString') === -1) ? (this.highlightSettings.border.width / (isMarkerSelect ? 1 : this.maps.scale)) : (this.highlightSettings.border.width / this.maps.scale);
|
|
12726
|
+
const borderOpacity = isNullOrUndefined(this.highlightSettings.border.opacity) ? this.highlightSettings.opacity :
|
|
12727
|
+
this.highlightSettings.border.opacity;
|
|
12728
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12524
12729
|
const eventArgs = {
|
|
12525
12730
|
opacity: this.highlightSettings.opacity,
|
|
12526
12731
|
fill: (targetEle.parentElement.id.indexOf('LineString') === -1) ? (targetEle.id.indexOf('NavigationIndex') === -1 ? !isNullOrUndefined(this.highlightSettings.fill)
|
|
12527
12732
|
? this.highlightSettings.fill : targetEle.getAttribute('fill') : 'none') : 'transparent',
|
|
12528
|
-
border:
|
|
12733
|
+
border: { color: borderColor, width: borderWidth, opacity: borderOpacity },
|
|
12734
|
+
cancel: false
|
|
12735
|
+
};
|
|
12736
|
+
const shapeEventArgs = {
|
|
12737
|
+
opacity: eventArgs.opacity,
|
|
12738
|
+
fill: eventArgs.fill,
|
|
12739
|
+
border: { color: borderColor, width: borderWidth, opacity: borderOpacity },
|
|
12740
|
+
name: shapeHighlight,
|
|
12741
|
+
target: targetEle.id,
|
|
12742
|
+
cancel: false,
|
|
12743
|
+
shapeData: shapeData,
|
|
12744
|
+
data: data,
|
|
12745
|
+
maps: this.maps
|
|
12746
|
+
};
|
|
12747
|
+
if (targetEle.id.indexOf('shapeIndex') > -1) {
|
|
12748
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
12749
|
+
this.maps.trigger(shapeHighlight, shapeEventArgs, () => { });
|
|
12750
|
+
}
|
|
12751
|
+
const itemEventArgs = {
|
|
12752
|
+
opacity: eventArgs.opacity,
|
|
12753
|
+
fill: eventArgs.fill,
|
|
12754
|
+
border: { color: borderColor, width: borderWidth, opacity: borderOpacity },
|
|
12529
12755
|
name: itemHighlight,
|
|
12530
12756
|
target: targetEle.id,
|
|
12531
12757
|
cancel: false,
|
|
@@ -12533,13 +12759,18 @@ class Highlight {
|
|
|
12533
12759
|
data: data,
|
|
12534
12760
|
maps: this.maps
|
|
12535
12761
|
};
|
|
12536
|
-
this.maps.trigger(itemHighlight,
|
|
12537
|
-
eventArgs.
|
|
12538
|
-
|
|
12762
|
+
this.maps.trigger(itemHighlight, itemEventArgs, () => {
|
|
12763
|
+
itemEventArgs.cancel = eventArgs.cancel !== itemEventArgs.cancel ? itemEventArgs.cancel : targetEle.id.indexOf('shapeIndex') > -1 ? shapeEventArgs.cancel : eventArgs.cancel;
|
|
12764
|
+
itemEventArgs.fill = eventArgs.fill !== itemEventArgs.fill ? itemEventArgs.fill : targetEle.id.indexOf('shapeIndex') > -1 ? shapeEventArgs.fill : eventArgs.fill;
|
|
12765
|
+
itemEventArgs.opacity = eventArgs.opacity !== itemEventArgs.opacity ? itemEventArgs.opacity : targetEle.id.indexOf('shapeIndex') > -1 ? shapeEventArgs.opacity : eventArgs.opacity;
|
|
12766
|
+
itemEventArgs.border.color = eventArgs.border.color !== itemEventArgs.border.color ? itemEventArgs.border.color : targetEle.id.indexOf('shapeIndex') > -1 ? shapeEventArgs.border.color : eventArgs.border.color;
|
|
12767
|
+
itemEventArgs.border.width = eventArgs.border.width !== itemEventArgs.border.width ? itemEventArgs.border.width : targetEle.id.indexOf('shapeIndex') > -1 ? shapeEventArgs.border.width : eventArgs.border.width;
|
|
12768
|
+
itemEventArgs.border.opacity = eventArgs.border.opacity !== itemEventArgs.border.opacity ? itemEventArgs.border.opacity : targetEle.id.indexOf('shapeIndex') > -1 ? shapeEventArgs.border.opacity : eventArgs.border.opacity;
|
|
12769
|
+
this.highlightMap(targetEle, itemEventArgs);
|
|
12539
12770
|
});
|
|
12540
12771
|
}
|
|
12541
12772
|
highlightMap(targetEle, eventArgs) {
|
|
12542
|
-
if (targetEle.getAttribute('class') === 'highlightMapStyle') {
|
|
12773
|
+
if (targetEle.getAttribute('class') === 'highlightMapStyle' || eventArgs.cancel) {
|
|
12543
12774
|
return;
|
|
12544
12775
|
}
|
|
12545
12776
|
else {
|
|
@@ -12716,7 +12947,8 @@ class Selection {
|
|
|
12716
12947
|
const isLineStringShape = targetElement.parentElement.id.indexOf('LineString') > -1;
|
|
12717
12948
|
const selectionsettings = this.selectionsettings;
|
|
12718
12949
|
const border = {
|
|
12719
|
-
color: isLineStringShape ? (this.selectionsettings.fill || this.selectionsettings.border.color) :
|
|
12950
|
+
color: isLineStringShape ? (this.selectionsettings.fill || this.selectionsettings.border.color) :
|
|
12951
|
+
this.selectionsettings.border.color,
|
|
12720
12952
|
width: isLineStringShape ? (this.selectionsettings.border.width / this.maps.scale) :
|
|
12721
12953
|
(this.selectionsettings.border.width / (this.selectionType === 'Marker' ? 1 : this.maps.scale)),
|
|
12722
12954
|
opacity: this.selectionsettings.border.opacity
|
|
@@ -12733,7 +12965,8 @@ class Selection {
|
|
|
12733
12965
|
maps: this.maps
|
|
12734
12966
|
};
|
|
12735
12967
|
this.maps.trigger('itemSelection', eventArgs, (observedArgs) => {
|
|
12736
|
-
eventArgs.border.opacity = isNullOrUndefined(this.selectionsettings.border.opacity) ?
|
|
12968
|
+
eventArgs.border.opacity = isNullOrUndefined(this.selectionsettings.border.opacity) ?
|
|
12969
|
+
this.selectionsettings.opacity : this.selectionsettings.border.opacity;
|
|
12737
12970
|
if (!eventArgs.cancel) {
|
|
12738
12971
|
if (targetElement.getAttribute('class') === this.selectionType + 'selectionMapStyle'
|
|
12739
12972
|
|| targetElement.getAttribute('class') === 'LineselectionMapStyle') {
|
|
@@ -12885,7 +13118,6 @@ class Selection {
|
|
|
12885
13118
|
}
|
|
12886
13119
|
}
|
|
12887
13120
|
|
|
12888
|
-
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
12889
13121
|
/**
|
|
12890
13122
|
* Map Tooltip
|
|
12891
13123
|
*/
|
|
@@ -12917,7 +13149,6 @@ class MapsTooltip {
|
|
|
12917
13149
|
}
|
|
12918
13150
|
let option;
|
|
12919
13151
|
let currentData = '';
|
|
12920
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12921
13152
|
const targetId = target.id;
|
|
12922
13153
|
let tooltipEle;
|
|
12923
13154
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -13041,9 +13272,9 @@ class MapsTooltip {
|
|
|
13041
13272
|
else {
|
|
13042
13273
|
tooltipEle = createElement('div', {
|
|
13043
13274
|
id: this.maps.element.id + '_mapsTooltip',
|
|
13044
|
-
className: 'EJ2-maps-Tooltip'
|
|
13045
|
-
styles: 'position: absolute;pointer-events:none;'
|
|
13275
|
+
className: 'EJ2-maps-Tooltip'
|
|
13046
13276
|
});
|
|
13277
|
+
tooltipEle.style.cssText = 'position: absolute;pointer-events:none;';
|
|
13047
13278
|
document.getElementById(this.maps.element.id + '_Secondary_Element').appendChild(tooltipEle);
|
|
13048
13279
|
}
|
|
13049
13280
|
if (option.template !== null && Object.keys(typeof option.template === 'object' ? option.template : {}).length === 1) {
|
|
@@ -13066,6 +13297,7 @@ class MapsTooltip {
|
|
|
13066
13297
|
maps: this.maps,
|
|
13067
13298
|
element: target, eventArgs: e, content: !isNullOrUndefined(currentData) ? currentData.toString() : ''
|
|
13068
13299
|
};
|
|
13300
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
13069
13301
|
this.maps.trigger(tooltipRender, tooltipArgs, (args) => {
|
|
13070
13302
|
if (!tooltipArgs.cancel && option.visible && !isNullOrUndefined(currentData) &&
|
|
13071
13303
|
(targetId.indexOf('_cluster_') === -1 && targetId.indexOf('_dataLabel_') === -1)) {
|
|
@@ -13082,7 +13314,8 @@ class MapsTooltip {
|
|
|
13082
13314
|
header: '',
|
|
13083
13315
|
data: option['data'],
|
|
13084
13316
|
template: option['template'],
|
|
13085
|
-
content: tooltipArgs.content.toString()
|
|
13317
|
+
content: tooltipArgs.content.toString() !== currentData.toString() ? [tooltipArgs.content.toString()] :
|
|
13318
|
+
[currentData.toString()],
|
|
13086
13319
|
shapes: [],
|
|
13087
13320
|
location: option['location'],
|
|
13088
13321
|
palette: [markerFill],
|
|
@@ -13098,7 +13331,8 @@ class MapsTooltip {
|
|
|
13098
13331
|
header: '',
|
|
13099
13332
|
data: tooltipArgs.options['data'],
|
|
13100
13333
|
template: tooltipArgs.options['template'],
|
|
13101
|
-
content: tooltipArgs.content.toString()
|
|
13334
|
+
content: tooltipArgs.content.toString() !== currentData.toString() ? [tooltipArgs.content.toString()] :
|
|
13335
|
+
[currentData.toString()],
|
|
13102
13336
|
shapes: [],
|
|
13103
13337
|
location: tooltipArgs.options['location'],
|
|
13104
13338
|
palette: [markerFill],
|
|
@@ -13121,7 +13355,7 @@ class MapsTooltip {
|
|
|
13121
13355
|
&& tooltipTemplateElement.innerHTML.indexOf('</a>') !== -1) {
|
|
13122
13356
|
let templateStyle = tooltipTemplateElement.getAttribute('style');
|
|
13123
13357
|
templateStyle = templateStyle.replace('pointer-events: none;', 'position-events:all;');
|
|
13124
|
-
tooltipTemplateElement.
|
|
13358
|
+
tooltipTemplateElement.style.cssText = templateStyle;
|
|
13125
13359
|
}
|
|
13126
13360
|
}
|
|
13127
13361
|
else {
|
|
@@ -13410,12 +13644,13 @@ class Zoom {
|
|
|
13410
13644
|
}
|
|
13411
13645
|
this.maps.zoomNotApplied = false;
|
|
13412
13646
|
}
|
|
13647
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13413
13648
|
calculateInitalZoomTranslatePoint(newZoomFactor, mapTotalWidth, mapTotalHeight, availSize, minBounds, map) {
|
|
13414
13649
|
mapTotalWidth *= newZoomFactor;
|
|
13415
13650
|
mapTotalHeight *= newZoomFactor;
|
|
13416
|
-
|
|
13417
|
-
|
|
13418
|
-
|
|
13651
|
+
const widthDiff = minBounds['x'] !== 0 && map.translateType === 'layers' ? map.availableSize.width - availSize.width : 0;
|
|
13652
|
+
const translatePointX = availSize.x + ((-(minBounds['x'])) + ((availSize.width / 2) - (mapTotalWidth / 2))) - widthDiff;
|
|
13653
|
+
const translatePointY = availSize.y + ((-(minBounds['y'])) + ((availSize.height / 2) - (mapTotalHeight / 2)));
|
|
13419
13654
|
return new Point(translatePointX, translatePointY);
|
|
13420
13655
|
}
|
|
13421
13656
|
triggerZoomEvent(prevTilePoint, prevLevel, type) {
|
|
@@ -13671,7 +13906,7 @@ class Zoom {
|
|
|
13671
13906
|
layerElement.appendChild(maps.navigationLineModule.renderNavigation(this.currentLayer, maps.tileZoomLevel, this.index));
|
|
13672
13907
|
}
|
|
13673
13908
|
}
|
|
13674
|
-
else if (currentEle.id.indexOf('Legend')
|
|
13909
|
+
else if (currentEle.id.indexOf('Legend') === -1) {
|
|
13675
13910
|
changeBorderWidth(currentEle, this.index, scale, maps);
|
|
13676
13911
|
maps.zoomTranslatePoint = maps.translatePoint;
|
|
13677
13912
|
this.animateTransform(currentEle, animate$$1, x, y, scale);
|
|
@@ -13709,7 +13944,7 @@ class Zoom {
|
|
|
13709
13944
|
}
|
|
13710
13945
|
else {
|
|
13711
13946
|
markerStyle = 'visibility:hidden';
|
|
13712
|
-
currentEle.
|
|
13947
|
+
currentEle.style.cssText = markerStyle;
|
|
13713
13948
|
}
|
|
13714
13949
|
}
|
|
13715
13950
|
}
|
|
@@ -13749,7 +13984,6 @@ class Zoom {
|
|
|
13749
13984
|
let childElement;
|
|
13750
13985
|
for (let k = 0; k < currentEle.childElementCount; k++) {
|
|
13751
13986
|
childElement = currentEle.childNodes[k];
|
|
13752
|
-
const bubbleTransform = childElement.getAttribute('transform');
|
|
13753
13987
|
layerIndex = parseFloat(childElement.id.split('_LayerIndex_')[1].split('_')[0]);
|
|
13754
13988
|
const bubleIndex = parseFloat(childElement.id.split('_BubbleIndex_')[1].split('_')[0]);
|
|
13755
13989
|
const dataIndex = parseFloat(childElement.id.split('_BubbleIndex_')[1].split('_')[2]);
|
|
@@ -13778,7 +14012,7 @@ class Zoom {
|
|
|
13778
14012
|
this.intersect = [];
|
|
13779
14013
|
maps.zoomLabelPositions = [];
|
|
13780
14014
|
maps.zoomLabelPositions = maps.dataLabelModule.dataLabelCollections;
|
|
13781
|
-
|
|
14015
|
+
const labelAnimate = !maps.isTileMap && animate$$1;
|
|
13782
14016
|
for (let k = 0; k < currentEle.childElementCount; k++) {
|
|
13783
14017
|
if (currentEle.childNodes[k]['id'].indexOf('_LabelIndex_') > -1) {
|
|
13784
14018
|
const labelIndex = parseFloat(currentEle.childNodes[k]['id'].split('_LabelIndex_')[1].split('_')[0]);
|
|
@@ -13825,22 +14059,22 @@ class Zoom {
|
|
|
13825
14059
|
const layerIndex = parseInt((element ? element : layerElement).id.split('_LayerIndex_')[1].split('_')[0], 10);
|
|
13826
14060
|
const markerSVGObject = this.maps.renderer.createGroup({
|
|
13827
14061
|
id: this.maps.element.id + '_Markers_Group',
|
|
13828
|
-
class: 'GroupElement'
|
|
13829
|
-
style: 'pointer-events: auto;'
|
|
14062
|
+
class: 'GroupElement'
|
|
13830
14063
|
});
|
|
14064
|
+
markerSVGObject.style.pointerEvents = 'auto';
|
|
13831
14065
|
if (document.getElementById(markerSVGObject.id)) {
|
|
13832
14066
|
removeElement(markerSVGObject.id);
|
|
13833
14067
|
}
|
|
13834
14068
|
const mapsAreaRect = this.maps.mapAreaRect;
|
|
13835
14069
|
const markerTemplateElements = createElement('div', {
|
|
13836
14070
|
id: this.maps.element.id + '_LayerIndex_' + layerIndex + '_Markers_Template_Group',
|
|
13837
|
-
className: 'template'
|
|
13838
|
-
styles: 'overflow: hidden; position: absolute;pointer-events: none;' +
|
|
13839
|
-
'top:' + mapsAreaRect.y + 'px;' +
|
|
13840
|
-
'left:' + mapsAreaRect.x + 'px;' +
|
|
13841
|
-
'height:' + mapsAreaRect.height + 'px;' +
|
|
13842
|
-
'width:' + mapsAreaRect.width + 'px;'
|
|
14071
|
+
className: 'template'
|
|
13843
14072
|
});
|
|
14073
|
+
markerTemplateElements.style.cssText = 'overflow: hidden; position: absolute;pointer-events: none;' +
|
|
14074
|
+
'top:' + mapsAreaRect.y + 'px;' +
|
|
14075
|
+
'left:' + mapsAreaRect.x + 'px;' +
|
|
14076
|
+
'height:' + mapsAreaRect.height + 'px;' +
|
|
14077
|
+
'width:' + mapsAreaRect.width + 'px;';
|
|
13844
14078
|
if (document.getElementById(markerTemplateElements.id)) {
|
|
13845
14079
|
removeElement(markerTemplateElements.id);
|
|
13846
14080
|
}
|
|
@@ -13878,7 +14112,6 @@ class Zoom {
|
|
|
13878
14112
|
const markerID = this.maps.element.id + '_LayerIndex_' + layerIndex + '_MarkerIndex_'
|
|
13879
14113
|
+ markerIndex + '_dataIndex_' + dataIndex;
|
|
13880
14114
|
const location = (this.maps.isTileMap) ? convertTileLatLongToPoint(new MapLocation(long, lati), this.maps.tileZoomLevel, this.maps.tileTranslatePoint, true) : convertGeoToPoint(lati, long, factor, currentLayers, this.maps);
|
|
13881
|
-
const animate$$1 = currentLayers.animationDuration !== 0 || isNullOrUndefined(this.maps.zoomModule);
|
|
13882
14115
|
const transPoint = { x: x, y: y };
|
|
13883
14116
|
if (eventArgs.template && (!isNaN(location.x) && !isNaN(location.y))) {
|
|
13884
14117
|
markerTemplateCounts++;
|
|
@@ -13947,15 +14180,12 @@ class Zoom {
|
|
|
13947
14180
|
dataLabelTranslate(element, factor, x, y, scale, type, animate$$1 = false) {
|
|
13948
14181
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13949
14182
|
const labelCollection = this.maps.dataLabelModule.dataLabelCollections;
|
|
13950
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13951
|
-
const zoomelement = element.getBoundingClientRect();
|
|
13952
14183
|
let text;
|
|
13953
14184
|
let trimmedLable;
|
|
13954
14185
|
const style = this.maps.layers[this.index].dataLabelSettings.textStyle;
|
|
13955
14186
|
let zoomtext;
|
|
13956
14187
|
let zoomtextSize;
|
|
13957
14188
|
let zoomtrimLabel;
|
|
13958
|
-
const labelPath = this.maps.layers[this.index].dataLabelSettings.labelPath;
|
|
13959
14189
|
const layerIndex = parseFloat(element.id.split('_LayerIndex_')[1].split('_')[0]);
|
|
13960
14190
|
const shapeIndex = parseFloat(element.id.split('_shapeIndex_')[1].split('_')[0]);
|
|
13961
14191
|
let labelIndex;
|
|
@@ -13971,16 +14201,25 @@ class Zoom {
|
|
|
13971
14201
|
let labelX = label['location']['x'];
|
|
13972
14202
|
let labelY = label['location']['y'];
|
|
13973
14203
|
if (type === 'Template') {
|
|
13974
|
-
|
|
13975
|
-
|
|
13976
|
-
|
|
13977
|
-
|
|
13978
|
-
|
|
13979
|
-
|
|
13980
|
-
|
|
13981
|
-
|
|
13982
|
-
|
|
13983
|
-
|
|
14204
|
+
let locationX = 0;
|
|
14205
|
+
let locationY = 0;
|
|
14206
|
+
if (this.maps.isTileMap) {
|
|
14207
|
+
zoomtext = label['dataLabelText'];
|
|
14208
|
+
zoomtextSize = measureText(zoomtext, style);
|
|
14209
|
+
locationX = ((labelX + x) * scale) - (zoomtextSize['width'] / 2);
|
|
14210
|
+
locationY = ((labelY + y) * scale) - (zoomtextSize['height']);
|
|
14211
|
+
}
|
|
14212
|
+
else {
|
|
14213
|
+
const layerEle = getElementByID(this.maps.element.id + '_Layer_Collections');
|
|
14214
|
+
labelX = ((Math.abs(this.maps.baseMapRectBounds['min']['x'] - labelX)) * scale);
|
|
14215
|
+
labelY = ((Math.abs(this.maps.baseMapRectBounds['min']['y'] - labelY)) * scale);
|
|
14216
|
+
const layerOffset = layerEle.getBoundingClientRect();
|
|
14217
|
+
const elementOffset = element.parentElement.getBoundingClientRect();
|
|
14218
|
+
locationX = ((labelX) + (layerOffset.left - elementOffset.left));
|
|
14219
|
+
locationY = ((labelY) + (layerOffset.top - elementOffset.top));
|
|
14220
|
+
}
|
|
14221
|
+
element.style.left = locationX + 'px';
|
|
14222
|
+
element.style.top = locationY + 'px';
|
|
13984
14223
|
}
|
|
13985
14224
|
else {
|
|
13986
14225
|
labelX = ((labelX + x) * scale);
|
|
@@ -14111,10 +14350,10 @@ class Zoom {
|
|
|
14111
14350
|
if (element['style']['display'] !== 'none') {
|
|
14112
14351
|
if ((staticMapOffset['x'] > templateOffset['x'] || staticMapOffset['x'] + staticMapOffsetWidth < templateOffset['x'] + templateOffset['width'])
|
|
14113
14352
|
&& (staticMapOffset['y'] > templateOffset['y'] || staticMapOffset['y'] + staticMapOffset['height'] < templateOffset['y'] + templateOffset['height'])) {
|
|
14114
|
-
element
|
|
14353
|
+
element.style.display = 'none';
|
|
14115
14354
|
}
|
|
14116
14355
|
else if ((staticMapOffset['x'] > templateOffset['x'] || staticMapOffset['x'] + staticMapOffsetWidth < templateOffset['x'] + templateOffset['width'])) {
|
|
14117
|
-
element
|
|
14356
|
+
element.style.display = 'none';
|
|
14118
14357
|
}
|
|
14119
14358
|
}
|
|
14120
14359
|
}
|
|
@@ -14170,6 +14409,11 @@ class Zoom {
|
|
|
14170
14409
|
}
|
|
14171
14410
|
}
|
|
14172
14411
|
/**
|
|
14412
|
+
* @param {PanDirection} direction - Specifies the direction of the panning.
|
|
14413
|
+
* @param {number} xDifference - Specifies the distance moved in the horizontal direction.
|
|
14414
|
+
* @param {number} yDifference - Specifies the distance moved in the vertical direction.
|
|
14415
|
+
* @param {PointerEvent | TouchEvent | KeyboardEvent} mouseLocation - Specifies the pointer event argument.
|
|
14416
|
+
* @returns {void}
|
|
14173
14417
|
* @private
|
|
14174
14418
|
*/
|
|
14175
14419
|
panning(direction, xDifference, yDifference, mouseLocation) {
|
|
@@ -14251,7 +14495,6 @@ class Zoom {
|
|
|
14251
14495
|
}
|
|
14252
14496
|
map.zoomTranslatePoint = map.translatePoint;
|
|
14253
14497
|
this.mouseDownPoints = this.mouseMovePoints;
|
|
14254
|
-
this.maps.zoomNotApplied = false;
|
|
14255
14498
|
this.isSingleClick = false;
|
|
14256
14499
|
}
|
|
14257
14500
|
toAlignSublayer() {
|
|
@@ -14591,7 +14834,8 @@ class Zoom {
|
|
|
14591
14834
|
alignToolBar() {
|
|
14592
14835
|
const map = this.maps;
|
|
14593
14836
|
const padding = 10;
|
|
14594
|
-
const element = createElement('div', { id: map.element.id + '_ToolBar'
|
|
14837
|
+
const element = createElement('div', { id: map.element.id + '_ToolBar' });
|
|
14838
|
+
element.style.cssText = 'position:absolute;z-index:2';
|
|
14595
14839
|
const rectSVGObject = map.renderer.createSvg({
|
|
14596
14840
|
id: map.element.id + '_Zooming_ToolBar', width: 10, height: 10
|
|
14597
14841
|
});
|
|
@@ -14633,7 +14877,7 @@ class Zoom {
|
|
|
14633
14877
|
}
|
|
14634
14878
|
break;
|
|
14635
14879
|
}
|
|
14636
|
-
|
|
14880
|
+
const extraPosition = map.getExtraPosition();
|
|
14637
14881
|
element.style.left = x + extraPosition.x + 'px';
|
|
14638
14882
|
element.style.top = y + extraPosition.y + 'px';
|
|
14639
14883
|
const color = this.maps.zoomSettings.highlightColor || this.maps.themeStyle.zoomSelectionColor;
|
|
@@ -14964,7 +15208,6 @@ class Zoom {
|
|
|
14964
15208
|
}
|
|
14965
15209
|
}
|
|
14966
15210
|
|
|
14967
|
-
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
14968
15211
|
/**
|
|
14969
15212
|
* This module enables the print functionality in maps.
|
|
14970
15213
|
*
|
|
@@ -14974,18 +15217,20 @@ class Print {
|
|
|
14974
15217
|
/**
|
|
14975
15218
|
* Constructor for Maps
|
|
14976
15219
|
*
|
|
14977
|
-
* @param {Maps} control - Specifies the instance of the
|
|
15220
|
+
* @param {Maps} control - Specifies the instance of the Maps
|
|
14978
15221
|
*/
|
|
15222
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-empty-function
|
|
14979
15223
|
constructor(control) { }
|
|
14980
15224
|
/**
|
|
14981
15225
|
* To print the Maps
|
|
14982
15226
|
*
|
|
14983
|
-
* @param {
|
|
15227
|
+
* @param {Maps} maps -Specifies the Maps instance.
|
|
15228
|
+
* @param {string[] | string | Element} elements - Specifies the element of the Maps
|
|
14984
15229
|
* @returns {void}
|
|
14985
15230
|
* @private
|
|
14986
15231
|
*/
|
|
14987
15232
|
print(maps, elements) {
|
|
14988
|
-
|
|
15233
|
+
const printWindow = window.open('', 'print', 'height=' + window.outerHeight + ',width=' + window.outerWidth + ',tabbar=no');
|
|
14989
15234
|
printWindow.moveTo(0, 0);
|
|
14990
15235
|
printWindow.resizeTo(screen.availWidth, screen.availHeight);
|
|
14991
15236
|
const argsData = {
|
|
@@ -15000,13 +15245,14 @@ class Print {
|
|
|
15000
15245
|
/**
|
|
15001
15246
|
* To get the html string of the Maps
|
|
15002
15247
|
*
|
|
15248
|
+
* @param {Maps} maps -Specifies the Maps instance.
|
|
15003
15249
|
* @param {string[] | string | Element} elements - Specifies the html element
|
|
15004
15250
|
* @returns {Element} - Returns the div element
|
|
15005
15251
|
* @private
|
|
15006
15252
|
*/
|
|
15007
15253
|
getHTMLContent(maps, elements) {
|
|
15008
|
-
|
|
15009
|
-
|
|
15254
|
+
const div = createElement('div');
|
|
15255
|
+
const divElement = maps.element.cloneNode(true);
|
|
15010
15256
|
if (maps.isTileMap) {
|
|
15011
15257
|
for (let i = 0; i < divElement.childElementCount; i++) {
|
|
15012
15258
|
if (divElement.children[i].id === maps.element.id + '_tile_parent') {
|
|
@@ -15059,10 +15305,10 @@ class Print {
|
|
|
15059
15305
|
* @returns {void}
|
|
15060
15306
|
* @private
|
|
15061
15307
|
*/
|
|
15308
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
15062
15309
|
destroy() { }
|
|
15063
15310
|
}
|
|
15064
15311
|
|
|
15065
|
-
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
15066
15312
|
/**
|
|
15067
15313
|
* This module enables the export to Image functionality in Maps control.
|
|
15068
15314
|
*
|
|
@@ -15074,19 +15320,21 @@ class ImageExport {
|
|
|
15074
15320
|
*
|
|
15075
15321
|
* @param {Maps} control - Specifies the instance of the map
|
|
15076
15322
|
*/
|
|
15323
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-empty-function
|
|
15077
15324
|
constructor(control) {
|
|
15078
15325
|
}
|
|
15079
15326
|
/**
|
|
15080
15327
|
* To export the file as image/svg format
|
|
15081
15328
|
*
|
|
15082
|
-
* @param {
|
|
15083
|
-
* @param {
|
|
15329
|
+
* @param {Maps} maps - Specifies the Maps instance.
|
|
15330
|
+
* @param {ExportType} type - Specifies the type of the image file for exporting.
|
|
15331
|
+
* @param {string} fileName - Specifies the file name of the image file for exporting.
|
|
15084
15332
|
* @param {boolean} allowDownload - Specifies whether to download image as a file or not.
|
|
15085
|
-
* @returns {Promise<string>} -
|
|
15333
|
+
* @returns {Promise<string>} - Specifies the base64 string of the exported image which is returned when the allowDownload is set to false.
|
|
15086
15334
|
* @private
|
|
15087
15335
|
*/
|
|
15088
15336
|
export(maps, type, fileName, allowDownload) {
|
|
15089
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
15337
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars
|
|
15090
15338
|
const promise = new Promise((resolve, reject) => {
|
|
15091
15339
|
const imageCanvasElement = createElement('canvas', {
|
|
15092
15340
|
id: 'ej2-canvas',
|
|
@@ -15096,11 +15344,10 @@ class ImageExport {
|
|
|
15096
15344
|
}
|
|
15097
15345
|
});
|
|
15098
15346
|
const isDownload = !(Browser.userAgent.toString().indexOf('HeadlessChrome') > -1);
|
|
15099
|
-
const toolbarEle = document.getElementById(maps.element.id + '_ToolBar');
|
|
15100
15347
|
const svgParent = document.getElementById(maps.element.id + '_Tile_SVG_Parent');
|
|
15101
15348
|
let svgDataElement;
|
|
15102
15349
|
let tileSvg;
|
|
15103
|
-
|
|
15350
|
+
const svgObject = getElementByID(maps.element.id + '_svg').cloneNode(true);
|
|
15104
15351
|
if (!maps.isTileMap) {
|
|
15105
15352
|
svgDataElement = '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">' +
|
|
15106
15353
|
maps.svgObject.outerHTML + '</svg>';
|
|
@@ -15143,8 +15390,8 @@ class ImageExport {
|
|
|
15143
15390
|
}
|
|
15144
15391
|
else {
|
|
15145
15392
|
const svgParentElement = document.getElementById(maps.element.id + '_MapAreaBorder');
|
|
15146
|
-
|
|
15147
|
-
|
|
15393
|
+
const top = parseFloat(svgParentElement.getAttribute('y'));
|
|
15394
|
+
const left = parseFloat(svgParentElement.getAttribute('x'));
|
|
15148
15395
|
const imgxHttp = new XMLHttpRequest();
|
|
15149
15396
|
const imgTileLength = maps.mapLayerPanel.tiles.length;
|
|
15150
15397
|
for (let i = 0; i <= imgTileLength + 1; i++) {
|
|
@@ -15154,7 +15401,7 @@ class ImageExport {
|
|
|
15154
15401
|
ctxt.fillStyle = maps.background ? maps.background : '#FFFFFF';
|
|
15155
15402
|
ctxt.fillRect(0, 0, maps.availableSize.width, maps.availableSize.height);
|
|
15156
15403
|
ctxt.font = maps.titleSettings.textStyle.size + ' Arial';
|
|
15157
|
-
|
|
15404
|
+
const titleElement = document.getElementById(maps.element.id + '_Map_title');
|
|
15158
15405
|
if (!isNullOrUndefined(titleElement)) {
|
|
15159
15406
|
ctxt.fillStyle = titleElement.getAttribute('fill');
|
|
15160
15407
|
ctxt.fillText(maps.titleSettings.text, parseFloat(titleElement.getAttribute('x')), parseFloat(titleElement.getAttribute('y')));
|
|
@@ -15227,10 +15474,10 @@ class ImageExport {
|
|
|
15227
15474
|
* @returns {void}
|
|
15228
15475
|
* @private
|
|
15229
15476
|
*/
|
|
15477
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-empty-function
|
|
15230
15478
|
destroy() { }
|
|
15231
15479
|
}
|
|
15232
15480
|
|
|
15233
|
-
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
15234
15481
|
/**
|
|
15235
15482
|
* This module enables the export to PDF functionality in Maps control.
|
|
15236
15483
|
*
|
|
@@ -15240,17 +15487,18 @@ class PdfExport {
|
|
|
15240
15487
|
/**
|
|
15241
15488
|
* Constructor for Maps
|
|
15242
15489
|
*
|
|
15243
|
-
* @param {Maps} control Specifies the instance of the map
|
|
15244
15490
|
*/
|
|
15491
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-empty-function
|
|
15245
15492
|
constructor() { }
|
|
15246
15493
|
/**
|
|
15247
15494
|
* To export the file as image/svg format
|
|
15248
15495
|
*
|
|
15249
|
-
* @param {
|
|
15250
|
-
* @param {
|
|
15251
|
-
* @param {
|
|
15252
|
-
* @param {
|
|
15253
|
-
* @
|
|
15496
|
+
* @param {Maps} maps - Specifies the Maps instance.
|
|
15497
|
+
* @param {ExportType} type - Specifies the type of the document.
|
|
15498
|
+
* @param {string} fileName - Specifies the name of the PDF document.
|
|
15499
|
+
* @param {boolean} allowDownload - Specifies whether to download the document or not.
|
|
15500
|
+
* @param {PdfPageOrientation} orientation - Specifies the orientation of the PDF document to export the component.
|
|
15501
|
+
* @returns {Promise<string>} - Returns "null" value when the allowDownload is set to false.
|
|
15254
15502
|
* @private
|
|
15255
15503
|
*/
|
|
15256
15504
|
export(maps, type, fileName, allowDownload, orientation) {
|
|
@@ -15300,8 +15548,8 @@ class PdfExport {
|
|
|
15300
15548
|
}
|
|
15301
15549
|
else {
|
|
15302
15550
|
const svgParentElement = document.getElementById(maps.element.id + '_MapAreaBorder');
|
|
15303
|
-
|
|
15304
|
-
|
|
15551
|
+
const top = parseFloat(svgParentElement.getAttribute('y'));
|
|
15552
|
+
const left = parseFloat(svgParentElement.getAttribute('x'));
|
|
15305
15553
|
const xHttp = new XMLHttpRequest();
|
|
15306
15554
|
const tileLength = maps.mapLayerPanel.tiles.length;
|
|
15307
15555
|
for (let i = 0; i <= tileLength + 1; i++) {
|
|
@@ -15311,7 +15559,7 @@ class PdfExport {
|
|
|
15311
15559
|
ctx.fillStyle = maps.background ? maps.background : '#FFFFFF';
|
|
15312
15560
|
ctx.fillRect(0, 0, maps.availableSize.width, maps.availableSize.height);
|
|
15313
15561
|
ctx.font = maps.titleSettings.textStyle.size + ' Arial';
|
|
15314
|
-
|
|
15562
|
+
const titleElement = document.getElementById(maps.element.id + '_Map_title');
|
|
15315
15563
|
if (!isNullOrUndefined(titleElement)) {
|
|
15316
15564
|
ctx.fillStyle = titleElement.getAttribute('fill');
|
|
15317
15565
|
ctx.fillText(maps.titleSettings.text, parseFloat(titleElement.getAttribute('x')), parseFloat(titleElement.getAttribute('y')));
|
|
@@ -15354,7 +15602,7 @@ class PdfExport {
|
|
|
15354
15602
|
}
|
|
15355
15603
|
else {
|
|
15356
15604
|
setTimeout(() => {
|
|
15357
|
-
|
|
15605
|
+
const tileSvg = document.getElementById(maps.element.id + '_Tile_SVG');
|
|
15358
15606
|
tileImg.src = window.URL.createObjectURL(new Blob([(new XMLSerializer()).serializeToString(tileSvg)], { type: 'image/svg+xml' }));
|
|
15359
15607
|
}, 300);
|
|
15360
15608
|
}
|
|
@@ -15383,6 +15631,7 @@ class PdfExport {
|
|
|
15383
15631
|
* @returns {void}
|
|
15384
15632
|
* @private
|
|
15385
15633
|
*/
|
|
15634
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-empty-function
|
|
15386
15635
|
destroy() { }
|
|
15387
15636
|
}
|
|
15388
15637
|
|