@syncfusion/ej2-maps 20.3.56 → 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 +9 -1
- 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 +915 -722
- package/dist/es6/ej2-maps.es2015.js.map +1 -1
- package/dist/es6/ej2-maps.es5.js +901 -712
- 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 +33 -20
- 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 +5 -12
- package/src/maps/layers/layer-panel.d.ts +7 -7
- package/src/maps/layers/layer-panel.js +98 -53
- package/src/maps/layers/legend.js +19 -19
- package/src/maps/layers/marker.d.ts +13 -0
- package/src/maps/layers/marker.js +124 -107
- package/src/maps/layers/navigation-selected-line.d.ts +5 -0
- package/src/maps/layers/navigation-selected-line.js +111 -104
- package/src/maps/maps-model.d.ts +1 -1
- package/src/maps/maps.d.ts +17 -0
- package/src/maps/maps.js +448 -364
- package/src/maps/model/base.js +1 -1
- 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 +0 -2
- package/src/maps/user-interaction/highlight.js +4 -3
- package/src/maps/user-interaction/selection.js +4 -2
- package/src/maps/user-interaction/tooltip.js +5 -5
- package/src/maps/user-interaction/zoom.d.ts +5 -0
- package/src/maps/user-interaction/zoom.js +7 -7
- package/src/maps/utils/helper.d.ts +2 -0
- package/src/maps/utils/helper.js +37 -30
|
@@ -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
|
|
@@ -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,11 +698,12 @@ 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
708
|
innerHTML: templateHtml
|
|
708
709
|
});
|
|
@@ -809,7 +810,7 @@ function markerShapeChoose(eventArgs, data) {
|
|
|
809
810
|
const shape = ((eventArgs.shapeValuePath.indexOf('.') > -1) ?
|
|
810
811
|
(getValueFromObject(data, eventArgs.shapeValuePath).toString()) :
|
|
811
812
|
data[eventArgs.shapeValuePath]);
|
|
812
|
-
eventArgs.shape = (shape.toString() !==
|
|
813
|
+
eventArgs.shape = (shape.toString() !== '') ? shape : eventArgs.shape;
|
|
813
814
|
if (data[eventArgs.shapeValuePath] === 'Image') {
|
|
814
815
|
eventArgs.imageUrl = (!isNullOrUndefined(eventArgs.imageUrlValuePath)) ?
|
|
815
816
|
((eventArgs.imageUrlValuePath.indexOf('.') > -1) ? getValueFromObject(data, eventArgs.imageUrlValuePath).toString() : (!isNullOrUndefined(data[eventArgs.imageUrlValuePath]) ?
|
|
@@ -818,7 +819,7 @@ function markerShapeChoose(eventArgs, data) {
|
|
|
818
819
|
}
|
|
819
820
|
else {
|
|
820
821
|
const shapes = (!isNullOrUndefined(eventArgs.shapeValuePath)) ? ((eventArgs.shapeValuePath.indexOf('.') > -1) ? getValueFromObject(data, eventArgs.shapeValuePath).toString() : eventArgs.shape) : eventArgs.shape;
|
|
821
|
-
eventArgs.shape = (shapes.toString() !==
|
|
822
|
+
eventArgs.shape = (shapes.toString() !== '') ? shapes : eventArgs.shape;
|
|
822
823
|
const shapeImage = (!isNullOrUndefined(eventArgs.imageUrlValuePath)) ?
|
|
823
824
|
((eventArgs.imageUrlValuePath.indexOf('.') > -1) ? getValueFromObject(data, eventArgs.imageUrlValuePath).toString() : (!isNullOrUndefined(data[eventArgs.imageUrlValuePath]) ?
|
|
824
825
|
data[eventArgs.imageUrlValuePath] : eventArgs.imageUrl)) : eventArgs.imageUrl;
|
|
@@ -897,8 +898,6 @@ function clusterTemplate(currentLayer, markerTemplate, maps, layerIndex, markerC
|
|
|
897
898
|
container['top'] : (container['bottom'] - container['top'])));
|
|
898
899
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
899
900
|
const translate = (maps.isTileMap) ? new Object() : getTranslate(maps, currentLayer, false);
|
|
900
|
-
const transPoint = (maps.isTileMap) ? { x: 0, y: 0 } : (maps.translatePoint.x !== 0) ?
|
|
901
|
-
maps.translatePoint : translate['location'];
|
|
902
901
|
const dataIndex = parseInt(markerTemplate.childNodes[o]['id'].split('_dataIndex_')[1].split('_')[0], 10);
|
|
903
902
|
const markerIndex = parseInt(markerTemplate.childNodes[o]['id'].split('_MarkerIndex_')[1].split('_')[0], 10);
|
|
904
903
|
const markerSetting = currentLayer.markerSettings[markerIndex];
|
|
@@ -1040,7 +1039,7 @@ function clusterTemplate(currentLayer, markerTemplate, maps, layerIndex, markerC
|
|
|
1040
1039
|
markerCluster.remove();
|
|
1041
1040
|
}
|
|
1042
1041
|
if (zoomCheck) {
|
|
1043
|
-
|
|
1042
|
+
const layerGroupElement = document.getElementById(maps.element.id + '_Layer_Collections');
|
|
1044
1043
|
if (!isNullOrUndefined(layerGroupElement)) {
|
|
1045
1044
|
layerGroupElement.appendChild(layerElement);
|
|
1046
1045
|
}
|
|
@@ -1547,6 +1546,7 @@ function drawStar(maps, options, size, location, element) {
|
|
|
1547
1546
|
* @param {PathOption} options - Specifies the path options
|
|
1548
1547
|
* @param {Size} size - Specifies the size
|
|
1549
1548
|
* @param {MapLocation} location - Specifies the map location
|
|
1549
|
+
* @param {string} type - Specifies the type.
|
|
1550
1550
|
* @param {Element} element - Specifies the element
|
|
1551
1551
|
* @returns {Element} - Returns the element
|
|
1552
1552
|
* @private
|
|
@@ -2034,7 +2034,8 @@ function getTranslate(mapObject, layer, animate) {
|
|
|
2034
2034
|
mapObject.zoomTranslatePoint.y = y;
|
|
2035
2035
|
}
|
|
2036
2036
|
else {
|
|
2037
|
-
if (!isNullOrUndefined(mapObject.previousProjection) && (mapObject.mapScaleValue === 1
|
|
2037
|
+
if (!isNullOrUndefined(mapObject.previousProjection) && (mapObject.mapScaleValue === 1
|
|
2038
|
+
|| mapObject.mapScaleValue <= 1.05) && !mapObject.zoomModule.isDragZoom) {
|
|
2038
2039
|
scaleFactor = parseFloat(Math.min(size.width / mapWidth, size.height / mapHeight).toFixed(2));
|
|
2039
2040
|
scaleFactor = scaleFactor > 1.05 ? 1 : scaleFactor;
|
|
2040
2041
|
mapWidth *= scaleFactor;
|
|
@@ -2052,8 +2053,10 @@ function getTranslate(mapObject, layer, animate) {
|
|
|
2052
2053
|
}
|
|
2053
2054
|
}
|
|
2054
2055
|
if (!isNullOrUndefined(mapObject.translatePoint)) {
|
|
2055
|
-
x = (mapObject.enablePersistence && mapObject.translatePoint.x !== 0 && !mapObject.zoomNotApplied) ?
|
|
2056
|
-
|
|
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;
|
|
2057
2060
|
}
|
|
2058
2061
|
}
|
|
2059
2062
|
scaleFactor = (mapObject.enablePersistence) ? ((mapObject.mapScaleValue >= 1) ? mapObject.mapScaleValue : 1) : scaleFactor;
|
|
@@ -2104,9 +2107,11 @@ function getZoomTranslate(mapObject, layer, animate) {
|
|
|
2104
2107
|
mapObject.mapScaleValue = mapObject.zoomSettings.zoomFactor !== 1 &&
|
|
2105
2108
|
mapObject.zoomSettings.zoomFactor ===
|
|
2106
2109
|
mapObject.mapScaleValue ? mapObject.zoomSettings.zoomFactor :
|
|
2107
|
-
mapObject.zoomSettings.zoomFactor !== mapObject.mapScaleValue && !mapObject.centerPositionChanged ?
|
|
2110
|
+
mapObject.zoomSettings.zoomFactor !== mapObject.mapScaleValue && !mapObject.centerPositionChanged ?
|
|
2111
|
+
mapObject.mapScaleValue : mapObject.zoomSettings.zoomFactor;
|
|
2108
2112
|
if (mapObject.zoomSettings.shouldZoomInitially && !mapObject.isZoomByPosition) {
|
|
2109
|
-
mapObject.mapScaleValue = zoomFactorValue = scaleFactor = ((mapObject.enablePersistence
|
|
2113
|
+
mapObject.mapScaleValue = zoomFactorValue = scaleFactor = ((mapObject.enablePersistence
|
|
2114
|
+
|| mapObject.zoomSettings.shouldZoomInitially) && mapObject.scale === 1)
|
|
2110
2115
|
? mapObject.scale : (isNullOrUndefined(mapObject.markerZoomFactor)) ? mapObject.mapScaleValue : mapObject.markerZoomFactor;
|
|
2111
2116
|
zoomFactorValue = mapObject.mapScaleValue;
|
|
2112
2117
|
if (!isNullOrUndefined(mapObject.markerCenterLatitude) && !isNullOrUndefined(mapObject.markerCenterLongitude)) {
|
|
@@ -2133,7 +2138,8 @@ function getZoomTranslate(mapObject, layer, animate) {
|
|
|
2133
2138
|
const leftPosition = ((mapWidth + Math.abs(mapObject.mapAreaRect.width - mapWidth)) / 2) / factor;
|
|
2134
2139
|
const point = checkZoomMethod ? calculateCenterFromPixel(mapObject, layer) :
|
|
2135
2140
|
convertGeoToPoint(latitude, longitude, mapObject.mapLayerPanel.calculateFactor(layer), layer, mapObject);
|
|
2136
|
-
if ((!isNullOrUndefined(mapObject.zoomTranslatePoint) || !isNullOrUndefined(mapObject.previousProjection)) &&
|
|
2141
|
+
if ((!isNullOrUndefined(mapObject.zoomTranslatePoint) || !isNullOrUndefined(mapObject.previousProjection)) &&
|
|
2142
|
+
!mapObject.zoomNotApplied) {
|
|
2137
2143
|
if (mapObject.previousProjection !== mapObject.projectionType) {
|
|
2138
2144
|
x = -point.x + leftPosition;
|
|
2139
2145
|
y = -point.y + topPosition;
|
|
@@ -2153,8 +2159,10 @@ function getZoomTranslate(mapObject, layer, animate) {
|
|
|
2153
2159
|
y = -point.y + topPosition + mapObject.mapAreaRect.y / zoomFactor;
|
|
2154
2160
|
}
|
|
2155
2161
|
if (!isNullOrUndefined(mapObject.translatePoint)) {
|
|
2156
|
-
y = (mapObject.enablePersistence && mapObject.translatePoint.y !== 0 && !mapObject.zoomNotApplied) ?
|
|
2157
|
-
|
|
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;
|
|
2158
2166
|
}
|
|
2159
2167
|
scaleFactor = zoomFactorValue !== 0 ? zoomFactorValue : 1;
|
|
2160
2168
|
}
|
|
@@ -2192,8 +2200,10 @@ function getZoomTranslate(mapObject, layer, animate) {
|
|
|
2192
2200
|
}
|
|
2193
2201
|
}
|
|
2194
2202
|
if (!isNullOrUndefined(mapObject.translatePoint)) {
|
|
2195
|
-
x = (mapObject.enablePersistence && mapObject.translatePoint.x !== 0 && !mapObject.zoomNotApplied) ?
|
|
2196
|
-
|
|
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;
|
|
2197
2207
|
}
|
|
2198
2208
|
}
|
|
2199
2209
|
scaleFactor = (mapObject.enablePersistence) ? (mapObject.mapScaleValue === 0 ? 1 : mapObject.mapScaleValue) : scaleFactor;
|
|
@@ -2258,6 +2268,7 @@ function Internalize(maps, value) {
|
|
|
2258
2268
|
* Function to compile the template function for maps.
|
|
2259
2269
|
*
|
|
2260
2270
|
* @param {string} template - Specifies the template
|
|
2271
|
+
* @param {Maps} maps - Specifies the Maps instance.
|
|
2261
2272
|
* @returns {Function} - Returns the function
|
|
2262
2273
|
* @private
|
|
2263
2274
|
*/
|
|
@@ -2265,10 +2276,10 @@ function Internalize(maps, value) {
|
|
|
2265
2276
|
function getTemplateFunction(template, maps) {
|
|
2266
2277
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2267
2278
|
let templateFn = null;
|
|
2268
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2269
2279
|
try {
|
|
2270
2280
|
if (document.querySelectorAll(template).length) {
|
|
2271
2281
|
templateFn = compile(document.querySelector(template).innerHTML.trim());
|
|
2282
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2272
2283
|
}
|
|
2273
2284
|
else if (maps.isVue || maps.isVue3) {
|
|
2274
2285
|
templateFn = compile(template);
|
|
@@ -2473,7 +2484,8 @@ shapeData, data) {
|
|
|
2473
2484
|
maps: map
|
|
2474
2485
|
};
|
|
2475
2486
|
map.trigger('itemSelection', eventArgs, (observedArgs) => {
|
|
2476
|
-
eventArgs.border.opacity = isNullOrUndefined(selectionSettings.border.opacity) ? selectionSettings.opacity :
|
|
2487
|
+
eventArgs.border.opacity = isNullOrUndefined(selectionSettings.border.opacity) ? selectionSettings.opacity :
|
|
2488
|
+
selectionSettings.border.opacity;
|
|
2477
2489
|
map.shapeSelectionItem.push(eventArgs.shapeData);
|
|
2478
2490
|
if (!getElement('ShapeselectionMap')) {
|
|
2479
2491
|
document.body.appendChild(createStyle('ShapeselectionMap', 'ShapeselectionMapStyle', eventArgs));
|
|
@@ -2572,7 +2584,7 @@ function showTooltip(text, size, x, y, areaWidth, areaHeight, id, element, isTou
|
|
|
2572
2584
|
let demo = str[0].length;
|
|
2573
2585
|
for (let i = 1; i < str.length; i++) {
|
|
2574
2586
|
if (demo < str[i].length) {
|
|
2575
|
-
demo = str[i].length;
|
|
2587
|
+
demo = (str[i]).length;
|
|
2576
2588
|
}
|
|
2577
2589
|
}
|
|
2578
2590
|
if (!tooltip) {
|
|
@@ -2642,7 +2654,7 @@ function wordWrap(tooltip, text, x, y, size1, width, areaWidth, element) {
|
|
|
2642
2654
|
// if (touches) {
|
|
2643
2655
|
// touchList = [];
|
|
2644
2656
|
// for (let i: number = 0, length: number = touches.length; i < length; i++) {
|
|
2645
|
-
// 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 });
|
|
2646
2658
|
// }
|
|
2647
2659
|
// } else {
|
|
2648
2660
|
// touchList = touchList ? touchList : [];
|
|
@@ -2650,8 +2662,8 @@ function wordWrap(tooltip, text, x, y, size1, width, areaWidth, element) {
|
|
|
2650
2662
|
// touchList.push({ pageX: e.clientX, pageY: e.clientY, pointerId: e.pointerId });
|
|
2651
2663
|
// } else {
|
|
2652
2664
|
// for (let i: number = 0, length: number = touchList.length; i < length; i++) {
|
|
2653
|
-
// if (touchList[i].pointerId === e.pointerId) {
|
|
2654
|
-
// 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 };
|
|
2655
2667
|
// } else {
|
|
2656
2668
|
// touchList.push({ pageX: e.clientX, pageY: e.clientY, pointerId: e.pointerId });
|
|
2657
2669
|
// }
|
|
@@ -3081,7 +3093,7 @@ function animate(element, delay, duration, process, end) {
|
|
|
3081
3093
|
window.cancelAnimationFrame(clearAnimation);
|
|
3082
3094
|
end.call(this, { element: element });
|
|
3083
3095
|
if (element.id.indexOf('Marker') > -1) {
|
|
3084
|
-
|
|
3096
|
+
const markerElement = getElementByID(element.id.split('_Layer')[0] + '_Markers_Group');
|
|
3085
3097
|
markerElement.style.cssText = markerStyle;
|
|
3086
3098
|
}
|
|
3087
3099
|
}
|
|
@@ -3781,7 +3793,7 @@ var __decorate$1 = (undefined && undefined.__decorate) || function (decorators,
|
|
|
3781
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;
|
|
3782
3794
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3783
3795
|
};
|
|
3784
|
-
/* eslint-disable
|
|
3796
|
+
/* eslint-disable max-len */
|
|
3785
3797
|
/**
|
|
3786
3798
|
* Maps base document
|
|
3787
3799
|
*/
|
|
@@ -4729,7 +4741,8 @@ class Marker {
|
|
|
4729
4741
|
nullCount += (!isNaN(lat) && !isNaN(lng)) ? 0 : 1;
|
|
4730
4742
|
markerTemplateCount += (eventArgs.cancel) ? 1 : 0;
|
|
4731
4743
|
markerCount += (eventArgs.cancel) ? 1 : 0;
|
|
4732
|
-
maps.markerNullCount = (isNullOrUndefined(lng) || isNullOrUndefined(lat)) ?
|
|
4744
|
+
maps.markerNullCount = (isNullOrUndefined(lng) || isNullOrUndefined(lat)) ?
|
|
4745
|
+
maps.markerNullCount + 1 : maps.markerNullCount;
|
|
4733
4746
|
const markerDataLength = markerData.length - maps.markerNullCount;
|
|
4734
4747
|
if (this.markerSVGObject.childElementCount === (markerDataLength - markerTemplateCount - nullCount) && (type !== 'Template')) {
|
|
4735
4748
|
layerElement.appendChild(this.markerSVGObject);
|
|
@@ -4787,126 +4800,134 @@ class Marker {
|
|
|
4787
4800
|
}
|
|
4788
4801
|
/**
|
|
4789
4802
|
* To calculate center position and factor value dynamically
|
|
4803
|
+
*
|
|
4804
|
+
* @param {LayerSettings[]} layersCollection - Specifies the layer settings instance.
|
|
4805
|
+
* @returns {void}
|
|
4790
4806
|
*/
|
|
4791
4807
|
calculateZoomCenterPositionAndFactor(layersCollection) {
|
|
4792
|
-
if (this.maps
|
|
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
|
-
|
|
4832
|
-
|
|
4833
|
-
|
|
4834
|
-
|
|
4835
|
-
|
|
4836
|
-
|
|
4837
|
-
|
|
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
|
+
});
|
|
4838
4857
|
});
|
|
4839
|
-
}
|
|
4840
|
-
}
|
|
4841
|
-
|
|
4842
|
-
|
|
4843
|
-
|
|
4844
|
-
|
|
4845
|
-
|
|
4846
|
-
|
|
4847
|
-
|
|
4848
|
-
|
|
4849
|
-
|
|
4850
|
-
|
|
4851
|
-
|
|
4852
|
-
|
|
4853
|
-
}
|
|
4854
|
-
|
|
4855
|
-
|
|
4856
|
-
|
|
4857
|
-
|
|
4858
|
-
|
|
4859
|
-
|
|
4860
|
-
|
|
4861
|
-
|
|
4862
|
-
|
|
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
|
+
}
|
|
4863
4895
|
}
|
|
4864
4896
|
else {
|
|
4897
|
+
zoomLevel = this.calculateIndividualLayerMarkerZoomLevel(mapWidth, mapHeight, maxZoomFact);
|
|
4865
4898
|
markerFactor = isNullOrUndefined(this.maps.mapScaleValue) ? zoomLevel :
|
|
4866
|
-
(
|
|
4867
|
-
this.maps.mapScaleValue !== zoomLevel)
|
|
4868
|
-
&&
|
|
4869
|
-
(isNullOrUndefined(this.maps.shouldZoomCurrentFactor))
|
|
4899
|
+
(this.maps.mapScaleValue !== zoomLevel)
|
|
4870
4900
|
? this.maps.mapScaleValue : zoomLevel;
|
|
4871
|
-
if (((markerFactor === this.maps.mapScaleValue &&
|
|
4872
|
-
(this.maps.markerZoomFactor === 1 || this.maps.mapScaleValue === 1))
|
|
4873
|
-
&& (!this.maps.enablePersistence))) {
|
|
4874
|
-
markerFactor = zoomLevel;
|
|
4875
|
-
}
|
|
4876
4901
|
}
|
|
4902
|
+
this.maps.markerZoomFactor = markerFactor;
|
|
4877
4903
|
}
|
|
4878
|
-
else {
|
|
4879
|
-
zoomLevel = this.calculateIndividualLayerMarkerZoomLevel(mapWidth, mapHeight, maxZoomFact);
|
|
4880
|
-
markerFactor = isNullOrUndefined(this.maps.mapScaleValue) ? zoomLevel :
|
|
4881
|
-
(this.maps.mapScaleValue !== zoomLevel)
|
|
4882
|
-
? this.maps.mapScaleValue : zoomLevel;
|
|
4883
|
-
}
|
|
4884
|
-
this.maps.markerZoomFactor = markerFactor;
|
|
4885
4904
|
}
|
|
4886
|
-
|
|
4887
|
-
|
|
4888
|
-
|
|
4889
|
-
|
|
4890
|
-
|
|
4891
|
-
|
|
4892
|
-
|
|
4893
|
-
|
|
4894
|
-
|
|
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
|
+
}
|
|
4895
4914
|
}
|
|
4896
|
-
|
|
4897
|
-
|
|
4898
|
-
|
|
4899
|
-
|
|
4900
|
-
|
|
4901
|
-
|
|
4902
|
-
|
|
4903
|
-
|
|
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
|
+
}
|
|
4904
4923
|
}
|
|
4905
4924
|
}
|
|
4906
4925
|
}
|
|
4907
4926
|
}
|
|
4908
4927
|
/**
|
|
4909
4928
|
* To check and trigger marker click event
|
|
4929
|
+
* @param {PointerEvent} e - Specifies the pointer event argument.
|
|
4930
|
+
* @returns {void}
|
|
4910
4931
|
*/
|
|
4911
4932
|
markerClick(e) {
|
|
4912
4933
|
const target = e.target.id;
|
|
@@ -4928,6 +4949,8 @@ class Marker {
|
|
|
4928
4949
|
}
|
|
4929
4950
|
/**
|
|
4930
4951
|
* To check and trigger Cluster click event
|
|
4952
|
+
* @param {PointerEvent} e - Specifies the pointer event argument.
|
|
4953
|
+
* @returns {void}
|
|
4931
4954
|
*/
|
|
4932
4955
|
markerClusterClick(e) {
|
|
4933
4956
|
const target = e.target.id;
|
|
@@ -5018,6 +5041,9 @@ class Marker {
|
|
|
5018
5041
|
}
|
|
5019
5042
|
/**
|
|
5020
5043
|
* To check and trigger marker move event
|
|
5044
|
+
*
|
|
5045
|
+
* @param {PointerEvent} e - Specifies the pointer event argument.
|
|
5046
|
+
* @returns {void}
|
|
5021
5047
|
*/
|
|
5022
5048
|
markerMove(e) {
|
|
5023
5049
|
const targetId = e.target.id;
|
|
@@ -5036,6 +5062,9 @@ class Marker {
|
|
|
5036
5062
|
}
|
|
5037
5063
|
/**
|
|
5038
5064
|
* To check and trigger cluster move event
|
|
5065
|
+
*
|
|
5066
|
+
* @param {PointerEvent} e - Specifies the pointer event argument.
|
|
5067
|
+
* @returns {void}
|
|
5039
5068
|
*/
|
|
5040
5069
|
markerClusterMouseMove(e) {
|
|
5041
5070
|
const targetId = e.target.id;
|
|
@@ -5308,6 +5337,7 @@ class BingMap {
|
|
|
5308
5337
|
}
|
|
5309
5338
|
}
|
|
5310
5339
|
/**
|
|
5340
|
+
* @returns {void}
|
|
5311
5341
|
* @private
|
|
5312
5342
|
*/
|
|
5313
5343
|
destroy() {
|
|
@@ -5344,6 +5374,11 @@ class ColorMapping {
|
|
|
5344
5374
|
}
|
|
5345
5375
|
/**
|
|
5346
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.
|
|
5347
5382
|
*/
|
|
5348
5383
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5349
5384
|
getColorByValue(colorMapping, colorValue, equalValue) {
|
|
@@ -5534,10 +5569,7 @@ class ColorMapping {
|
|
|
5534
5569
|
}
|
|
5535
5570
|
}
|
|
5536
5571
|
|
|
5537
|
-
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
|
5538
|
-
/* eslint-disable jsdoc/require-param */
|
|
5539
5572
|
/* eslint-disable no-case-declarations */
|
|
5540
|
-
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
5541
5573
|
/**
|
|
5542
5574
|
* To calculate and render the shape layer
|
|
5543
5575
|
*/
|
|
@@ -5725,7 +5757,10 @@ class LayerPanel {
|
|
|
5725
5757
|
panel.mapObject.previousZoomFactor = panel.mapObject.zoomSettings.zoomFactor;
|
|
5726
5758
|
}
|
|
5727
5759
|
if (panel.mapObject.navigationLineModule) {
|
|
5728
|
-
panel.
|
|
5760
|
+
const navigationLineElement = panel.mapObject.navigationLineModule.renderNavigation(panel.currentLayer, panel.mapObject.tileZoomLevel, layerIndex);
|
|
5761
|
+
if (!isNullOrUndefined(navigationLineElement)) {
|
|
5762
|
+
panel.layerObject.appendChild(navigationLineElement);
|
|
5763
|
+
}
|
|
5729
5764
|
}
|
|
5730
5765
|
if (panel.mapObject.markerModule) {
|
|
5731
5766
|
panel.mapObject.markerModule.markerRender(this.mapObject, panel.layerObject, layerIndex, panel.mapObject.tileZoomLevel, null);
|
|
@@ -5792,7 +5827,6 @@ class LayerPanel {
|
|
|
5792
5827
|
const imageUrl = resource['imageUrl'];
|
|
5793
5828
|
const subDomains = resource['imageUrlSubdomains'];
|
|
5794
5829
|
const maxZoom = resource['zoomMax'];
|
|
5795
|
-
const markerGroupElement = document.getElementById(proxy.mapObject.element.id + '_Markers_Group');
|
|
5796
5830
|
if (imageUrl !== null && imageUrl !== undefined && imageUrl !== bing.imageUrl) {
|
|
5797
5831
|
bing.imageUrl = imageUrl;
|
|
5798
5832
|
}
|
|
@@ -5953,8 +5987,6 @@ class LayerPanel {
|
|
|
5953
5987
|
fill = Object.prototype.toString.call(getShapeColor$$1) === '[object Object]' && !isNullOrUndefined(getShapeColor$$1['fill'])
|
|
5954
5988
|
? getShapeColor$$1['fill'] : fill;
|
|
5955
5989
|
if (this.currentLayer.shapeSettings.borderColorValuePath || this.currentLayer.shapeSettings.borderWidthValuePath) {
|
|
5956
|
-
const borderColorValue = this.currentLayer.shapeSettings.borderColorValuePath;
|
|
5957
|
-
const borderWidthValue = this.currentLayer.shapeSettings.borderWidthValuePath;
|
|
5958
5990
|
k = checkShapeDataFields(
|
|
5959
5991
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5960
5992
|
this.currentLayer.dataSource, currentShapeData['property'], this.currentLayer.shapeDataPath, this.currentLayer.shapePropertyPath, this.currentLayer);
|
|
@@ -6081,7 +6113,9 @@ class LayerPanel {
|
|
|
6081
6113
|
case 'Point':
|
|
6082
6114
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6083
6115
|
const pointData = currentShapeData['point'];
|
|
6084
|
-
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);
|
|
6085
6119
|
circleOptions = new CircleOption(shapeID, eventArgs.fill, eventArgs.border, opacity, pointData['x'], pointData['y'], circleRadius, shapeSettings.dashArray);
|
|
6086
6120
|
pathEle = this.mapObject.renderer.drawCircle(circleOptions);
|
|
6087
6121
|
break;
|
|
@@ -6091,7 +6125,7 @@ class LayerPanel {
|
|
|
6091
6125
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6092
6126
|
const pointData = multiPointData['point'];
|
|
6093
6127
|
const circleRadius = (this.mapObject.layers[layerIndex].type !== 'SubLayer') ? shapeSettings.circleRadius : shapeSettings.circleRadius / (this.mapObject.isTileMap ? this.mapObject.scale : this.currentFactor);
|
|
6094
|
-
circleOptions = new CircleOption((shapeID +
|
|
6128
|
+
circleOptions = new CircleOption((shapeID + '_multiLine_' + index), eventArgs.fill, eventArgs.border, opacity, pointData['x'], pointData['y'], circleRadius, shapeSettings.dashArray);
|
|
6095
6129
|
pathEle = this.mapObject.renderer.drawCircle(circleOptions);
|
|
6096
6130
|
this.pathAttributeCalculate(groupElement, pathEle, drawingType, currentShapeData, i);
|
|
6097
6131
|
});
|
|
@@ -6120,15 +6154,16 @@ class LayerPanel {
|
|
|
6120
6154
|
/**
|
|
6121
6155
|
* layer features as bubble, marker, datalabel, navigation line.
|
|
6122
6156
|
*
|
|
6123
|
-
* @param {
|
|
6124
|
-
* @param {
|
|
6125
|
-
* @param {
|
|
6126
|
-
* @param {
|
|
6127
|
-
* @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.
|
|
6128
6162
|
* @returns {void}
|
|
6129
6163
|
*/
|
|
6164
|
+
pathAttributeCalculate(groupElement, pathEle, drawingType,
|
|
6130
6165
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6131
|
-
|
|
6166
|
+
currentShapeData, index) {
|
|
6132
6167
|
const property = (Object.prototype.toString.call(this.currentLayer.shapePropertyPath) === '[object Array]' ?
|
|
6133
6168
|
this.currentLayer.shapePropertyPath : [this.currentLayer.shapePropertyPath]);
|
|
6134
6169
|
let properties;
|
|
@@ -6155,7 +6190,7 @@ class LayerPanel {
|
|
|
6155
6190
|
pathEle.setAttribute('stroke', styleProperty.border.color);
|
|
6156
6191
|
pathEle.setAttribute('fill-opacity', (styleProperty.opacity).toString());
|
|
6157
6192
|
pathEle.setAttribute('stroke-opacity', (isNullOrUndefined(styleProperty.border.opacity) ? styleProperty.opacity : styleProperty.border.opacity).toString());
|
|
6158
|
-
pathEle.setAttribute('stroke-width', (styleProperty.border.width).toString());
|
|
6193
|
+
pathEle.setAttribute('stroke-width', (isNullOrUndefined(styleProperty.border.width) ? 0 : styleProperty.border.width).toString());
|
|
6159
6194
|
}
|
|
6160
6195
|
}
|
|
6161
6196
|
}
|
|
@@ -6216,8 +6251,8 @@ class LayerPanel {
|
|
|
6216
6251
|
this.layerObject.appendChild(element);
|
|
6217
6252
|
});
|
|
6218
6253
|
if (this.mapObject.markerModule) {
|
|
6219
|
-
this.mapObject.markerModule.markerRender(this.mapObject, this.layerObject, layerIndex, (this.mapObject.isTileMap ? Math.floor(this.currentFactor)
|
|
6220
|
-
|
|
6254
|
+
this.mapObject.markerModule.markerRender(this.mapObject, this.layerObject, layerIndex, (this.mapObject.isTileMap ? Math.floor(this.currentFactor) :
|
|
6255
|
+
this.currentFactor), null);
|
|
6221
6256
|
}
|
|
6222
6257
|
this.translateLayerElements(this.layerObject, layerIndex);
|
|
6223
6258
|
this.layerGroup.appendChild(this.layerObject);
|
|
@@ -6227,11 +6262,11 @@ class LayerPanel {
|
|
|
6227
6262
|
*
|
|
6228
6263
|
* @param {LayerSettings} layer - Specifies the layer
|
|
6229
6264
|
* @param {number} layerIndex - Specifies the layer index
|
|
6230
|
-
* @param {
|
|
6265
|
+
* @param {any[]} shape - Specifies the shape
|
|
6231
6266
|
* @param {Element} group - Specifies the group
|
|
6232
6267
|
* @param {number} shapeIndex - Specifies the shape index
|
|
6233
6268
|
* @param {HTMLElement} labelTemplateEle - Specifies the label template element
|
|
6234
|
-
* @param {
|
|
6269
|
+
* @param {any[]} intersect - Specifies the intersect
|
|
6235
6270
|
* @returns {void}
|
|
6236
6271
|
*/
|
|
6237
6272
|
renderLabel(layer, layerIndex,
|
|
@@ -6329,10 +6364,12 @@ class LayerPanel {
|
|
|
6329
6364
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6330
6365
|
const multiPolygonDatas = [];
|
|
6331
6366
|
for (let i = 0; i < coordinates.length; i++) {
|
|
6332
|
-
|
|
6333
|
-
|
|
6334
|
-
|
|
6335
|
-
|
|
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
|
+
}
|
|
6336
6373
|
}
|
|
6337
6374
|
}
|
|
6338
6375
|
multiPolygonDatas['property'] = properties;
|
|
@@ -6341,15 +6378,15 @@ class LayerPanel {
|
|
|
6341
6378
|
this.currentLayer.layerData.push(multiPolygonDatas);
|
|
6342
6379
|
break;
|
|
6343
6380
|
case 'linestring':
|
|
6344
|
-
const
|
|
6381
|
+
const lineExtraSpace = !isNullOrUndefined(this.currentLayer.shapeSettings.border.width) ?
|
|
6345
6382
|
(typeof (this.currentLayer.shapeSettings.border.width) === 'string' ?
|
|
6346
6383
|
parseInt(this.currentLayer.shapeSettings.border.width, 10) : this.currentLayer.shapeSettings.border.width) : 1;
|
|
6347
6384
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6348
|
-
coordinates.map((points
|
|
6385
|
+
coordinates.map((points) => {
|
|
6349
6386
|
latitude = points[1];
|
|
6350
6387
|
longitude = points[0];
|
|
6351
6388
|
const point = convertGeoToPoint(latitude, longitude, this.currentFactor, this.currentLayer, this.mapObject);
|
|
6352
|
-
this.calculateBox(point,
|
|
6389
|
+
this.calculateBox(point, lineExtraSpace);
|
|
6353
6390
|
newData.push({
|
|
6354
6391
|
point: point, lat: latitude, lng: longitude
|
|
6355
6392
|
});
|
|
@@ -6362,10 +6399,12 @@ class LayerPanel {
|
|
|
6362
6399
|
const extraSpaces = !isNullOrUndefined(this.currentLayer.shapeSettings.border.width) ?
|
|
6363
6400
|
(typeof (this.currentLayer.shapeSettings.border.width) === 'string' ?
|
|
6364
6401
|
parseInt(this.currentLayer.shapeSettings.border.width, 10) : this.currentLayer.shapeSettings.border.width) : 1;
|
|
6402
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6365
6403
|
const multiLineData = [];
|
|
6366
6404
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6367
6405
|
coordinates.map((multiPoints) => {
|
|
6368
6406
|
newData = [];
|
|
6407
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6369
6408
|
multiPoints.map((points) => {
|
|
6370
6409
|
latitude = points[1];
|
|
6371
6410
|
longitude = points[0];
|
|
@@ -6394,7 +6433,7 @@ class LayerPanel {
|
|
|
6394
6433
|
point: point, type: type, lat: latitude, lng: longitude, property: properties
|
|
6395
6434
|
});
|
|
6396
6435
|
break;
|
|
6397
|
-
case 'multipoint':
|
|
6436
|
+
case 'multipoint':
|
|
6398
6437
|
const extraSpace = (!isNullOrUndefined(this.currentLayer.shapeSettings.border.width) ?
|
|
6399
6438
|
(typeof (this.currentLayer.shapeSettings.border.width) === 'string' ?
|
|
6400
6439
|
parseInt(this.currentLayer.shapeSettings.border.width, 10) : this.currentLayer.shapeSettings.border.width) : 1) +
|
|
@@ -6414,7 +6453,6 @@ class LayerPanel {
|
|
|
6414
6453
|
newData['type'] = type;
|
|
6415
6454
|
this.currentLayer.layerData.push(newData);
|
|
6416
6455
|
break;
|
|
6417
|
-
}
|
|
6418
6456
|
case 'path':
|
|
6419
6457
|
this.currentLayer.layerData.push({
|
|
6420
6458
|
point: data['d'], type: type, property: properties
|
|
@@ -6424,7 +6462,8 @@ class LayerPanel {
|
|
|
6424
6462
|
}
|
|
6425
6463
|
calculateBox(point, extraSpace) {
|
|
6426
6464
|
if (isNullOrUndefined(this.rectBounds)) {
|
|
6427
|
-
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 } };
|
|
6428
6467
|
}
|
|
6429
6468
|
else {
|
|
6430
6469
|
this.rectBounds['min']['x'] = Math.min(this.rectBounds['min']['x'], point.x - extraSpace);
|
|
@@ -6547,6 +6586,7 @@ class LayerPanel {
|
|
|
6547
6586
|
case 'multilinestring':
|
|
6548
6587
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6549
6588
|
coordinates.map((multiPoint, index) => {
|
|
6589
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6550
6590
|
multiPoint.map((point, index) => {
|
|
6551
6591
|
this.calculateRectBox(point, 'multilinestring', index === 0 ? true : false);
|
|
6552
6592
|
});
|
|
@@ -6562,6 +6602,7 @@ class LayerPanel {
|
|
|
6562
6602
|
this.calculateRectBox(coordinates, 'point');
|
|
6563
6603
|
break;
|
|
6564
6604
|
case 'multipoint':
|
|
6605
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6565
6606
|
coordinates.map((point, index) => {
|
|
6566
6607
|
this.calculateRectBox(point, 'multipoint', index === 0 ? true : false);
|
|
6567
6608
|
});
|
|
@@ -6576,7 +6617,7 @@ class LayerPanel {
|
|
|
6576
6617
|
const newData = [];
|
|
6577
6618
|
const bounds = this.mapObject.baseMapBounds;
|
|
6578
6619
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6579
|
-
coordinates.map((currentPoint
|
|
6620
|
+
coordinates.map((currentPoint) => {
|
|
6580
6621
|
const latitude = currentPoint[1];
|
|
6581
6622
|
const longitude = currentPoint[0];
|
|
6582
6623
|
if ((longitude >= bounds.longitude.min && longitude <= bounds.longitude.max)
|
|
@@ -6669,8 +6710,8 @@ class LayerPanel {
|
|
|
6669
6710
|
tileI = (tileI % ycount) + ycount;
|
|
6670
6711
|
}
|
|
6671
6712
|
const tile = new Tile(tileI % ycount, j);
|
|
6672
|
-
tile.left = x;
|
|
6673
|
-
tile.top = y;
|
|
6713
|
+
tile.left = Math.round(x);
|
|
6714
|
+
tile.top = Math.round(y);
|
|
6674
6715
|
if (baseLayer.layerType === 'Bing' || (bing && !isNullOrUndefined(baseLayer.urlTemplate) && baseLayer.urlTemplate !== '')) {
|
|
6675
6716
|
const key = baseLayer.key;
|
|
6676
6717
|
tile.src = bing.getBingMap(tile, key, baseLayer.bingMapType, userLang, bing.imageUrl, bing.subDomains);
|
|
@@ -6761,18 +6802,45 @@ class LayerPanel {
|
|
|
6761
6802
|
animateElement = element ? element.children[0] : null;
|
|
6762
6803
|
}
|
|
6763
6804
|
}
|
|
6764
|
-
let id = 0;
|
|
6765
|
-
|
|
6766
|
-
|
|
6767
|
-
imgElement.setAttribute('height', '256px');
|
|
6768
|
-
imgElement.setAttribute('width', '256px');
|
|
6769
|
-
imgElement.setAttribute('src', tile.src);
|
|
6770
|
-
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;
|
|
6771
6808
|
const mapId = this.mapObject.element.id;
|
|
6772
|
-
|
|
6773
|
-
|
|
6774
|
-
|
|
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');
|
|
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);
|
|
6775
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'));
|
|
6776
6844
|
const child = createElement('div', { id: mapId + '_tile_' + id });
|
|
6777
6845
|
child.style.position = 'absolute';
|
|
6778
6846
|
child.style.left = tile.left + 'px';
|
|
@@ -6783,11 +6851,27 @@ class LayerPanel {
|
|
|
6783
6851
|
if (animateElement) {
|
|
6784
6852
|
animateElement.appendChild(child);
|
|
6785
6853
|
}
|
|
6786
|
-
|
|
6787
|
-
|
|
6788
|
-
|
|
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
|
+
}
|
|
6789
6867
|
}
|
|
6790
|
-
|
|
6868
|
+
if (isExistingElement) {
|
|
6869
|
+
animateElement.children[l].style.display = 'none';
|
|
6870
|
+
}
|
|
6871
|
+
else {
|
|
6872
|
+
animateElement.removeChild(animateElement.children[l]);
|
|
6873
|
+
}
|
|
6874
|
+
}
|
|
6791
6875
|
}
|
|
6792
6876
|
}, timeOut);
|
|
6793
6877
|
}
|
|
@@ -6956,8 +7040,6 @@ class LayerPanel {
|
|
|
6956
7040
|
}
|
|
6957
7041
|
}
|
|
6958
7042
|
|
|
6959
|
-
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
6960
|
-
/* eslint-disable jsdoc/require-param */
|
|
6961
7043
|
/**
|
|
6962
7044
|
* Represents the annotation elements for map.
|
|
6963
7045
|
*/
|
|
@@ -7081,11 +7163,6 @@ var __decorate = (undefined && undefined.__decorate) || function (decorators, ta
|
|
|
7081
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;
|
|
7082
7164
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7083
7165
|
};
|
|
7084
|
-
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
|
7085
|
-
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
7086
|
-
/* eslint-disable radix */
|
|
7087
|
-
/* eslint-disable max-len */
|
|
7088
|
-
/* eslint-disable valid-jsdoc */
|
|
7089
7166
|
/**
|
|
7090
7167
|
* Maps Component file
|
|
7091
7168
|
*/
|
|
@@ -7262,18 +7339,20 @@ let Maps = class Maps extends Component {
|
|
|
7262
7339
|
this.setCulture();
|
|
7263
7340
|
}
|
|
7264
7341
|
renderElements() {
|
|
7265
|
-
this.
|
|
7266
|
-
|
|
7267
|
-
|
|
7268
|
-
|
|
7269
|
-
|
|
7270
|
-
|
|
7271
|
-
|
|
7272
|
-
|
|
7273
|
-
|
|
7274
|
-
|
|
7275
|
-
|
|
7276
|
-
|
|
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
|
+
}
|
|
7277
7356
|
}
|
|
7278
7357
|
/**
|
|
7279
7358
|
* To Initialize the control rendering.
|
|
@@ -7322,7 +7401,8 @@ let Maps = class Maps extends Component {
|
|
|
7322
7401
|
if (layer.markerSettings[i].dataSource instanceof DataManager) {
|
|
7323
7402
|
this.serverProcess['request']++;
|
|
7324
7403
|
dataModule = layer.markerSettings[i].dataSource;
|
|
7325
|
-
queryModule = layer.markerSettings[i].query instanceof Query ?
|
|
7404
|
+
queryModule = layer.markerSettings[i].query instanceof Query ?
|
|
7405
|
+
layer.markerSettings[i].query : new Query();
|
|
7326
7406
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
7327
7407
|
const dataManager = dataModule.executeQuery(queryModule);
|
|
7328
7408
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -7338,7 +7418,8 @@ let Maps = class Maps extends Component {
|
|
|
7338
7418
|
if (layer.bubbleSettings[i].dataSource instanceof DataManager) {
|
|
7339
7419
|
this.serverProcess['request']++;
|
|
7340
7420
|
dataModule = layer.bubbleSettings[i].dataSource;
|
|
7341
|
-
queryModule = layer.bubbleSettings[i].query instanceof Query ?
|
|
7421
|
+
queryModule = layer.bubbleSettings[i].query instanceof Query ?
|
|
7422
|
+
layer.bubbleSettings[i].query : new Query();
|
|
7342
7423
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
7343
7424
|
const dataManager = dataModule.executeQuery(queryModule);
|
|
7344
7425
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -7423,7 +7504,7 @@ let Maps = class Maps extends Component {
|
|
|
7423
7504
|
const position = this.getExtraPosition();
|
|
7424
7505
|
for (let i = 0; i < this.layers.length; i++) {
|
|
7425
7506
|
if (position.x !== 0 || position.y !== 0) {
|
|
7426
|
-
|
|
7507
|
+
const markerTemplate$$1 = document.getElementById(this.element.id + '_LayerIndex_' + i + '_Markers_Template_Group');
|
|
7427
7508
|
if (!isNullOrUndefined(markerTemplate$$1)) {
|
|
7428
7509
|
markerTemplate$$1.style.top = this.mapAreaRect.y + position.y + 'px';
|
|
7429
7510
|
markerTemplate$$1.style.left = this.mapAreaRect.x + position.x + 'px';
|
|
@@ -7444,6 +7525,7 @@ let Maps = class Maps extends Component {
|
|
|
7444
7525
|
}
|
|
7445
7526
|
if (!this.isResize) {
|
|
7446
7527
|
for (let k = 0; k < this.layers[i].markerSettings.length; k++) {
|
|
7528
|
+
// eslint-disable-next-line max-len
|
|
7447
7529
|
if (this.layers[i].markerSettings[k].selectionSettings && this.layers[i].markerSettings[k].selectionSettings.enable
|
|
7448
7530
|
&& this.layers[i].markerSettings[k].initialMarkerSelection.length > 0) {
|
|
7449
7531
|
const markerSelectionValues = this.layers[i].markerSettings[k].initialMarkerSelection;
|
|
@@ -7629,8 +7711,8 @@ let Maps = class Maps extends Component {
|
|
|
7629
7711
|
this.zoomModule.layerCollectionEle = getElementByID(this.element.id + '_Layer_Collections');
|
|
7630
7712
|
}
|
|
7631
7713
|
if (this.isTileMap && getElementByID(this.element.id + '_Tile_SVG') && getElementByID(this.element.id + '_tile_parent')) {
|
|
7632
|
-
|
|
7633
|
-
|
|
7714
|
+
const tileElement = getElementByID(this.element.id + '_tile_parent');
|
|
7715
|
+
const tileSvgElement = getElementByID(this.element.id + '_Tile_SVG');
|
|
7634
7716
|
const tileSvgParentElement = getElementByID(this.element.id + '_Tile_SVG_Parent');
|
|
7635
7717
|
const tileRect = tileElement.getBoundingClientRect();
|
|
7636
7718
|
const tileSvgRect = tileSvgElement.getBoundingClientRect();
|
|
@@ -7639,8 +7721,10 @@ let Maps = class Maps extends Component {
|
|
|
7639
7721
|
tileSvgParentElement.style.left = left + 'px';
|
|
7640
7722
|
tileSvgParentElement.style.top = top + 'px';
|
|
7641
7723
|
if (!isNullOrUndefined(this.legendModule) && this.legendModule.totalPages.length > 0) {
|
|
7642
|
-
tileElement.style.width = tileSvgElement.style.width =
|
|
7643
|
-
|
|
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();
|
|
7644
7728
|
tileSvgParentElement.style.width = this.legendModule.legendTotalRect.width + 'px';
|
|
7645
7729
|
tileSvgParentElement.style.height = this.legendModule.legendTotalRect.height + 'px';
|
|
7646
7730
|
}
|
|
@@ -7661,7 +7745,7 @@ let Maps = class Maps extends Component {
|
|
|
7661
7745
|
if (!isNullOrUndefined(elements) && elements.childElementCount > 0) {
|
|
7662
7746
|
for (let i = 0; i < elements.childNodes.length; i++) {
|
|
7663
7747
|
const childElement = elements.childNodes[i];
|
|
7664
|
-
if (childElement.tagName === 'g' && childElement.id.indexOf('_Legend_Group')
|
|
7748
|
+
if (childElement.tagName === 'g' && childElement.id.indexOf('_Legend_Group') === -1) {
|
|
7665
7749
|
const layerIndex = parseFloat(childElement.id.split('_LayerIndex_')[1].split('_')[0]);
|
|
7666
7750
|
for (let j = 0; j < childElement.childNodes.length; j++) {
|
|
7667
7751
|
const childNode = childElement.childNodes[j];
|
|
@@ -7791,7 +7875,7 @@ let Maps = class Maps extends Component {
|
|
|
7791
7875
|
break;
|
|
7792
7876
|
}
|
|
7793
7877
|
}
|
|
7794
|
-
subLayers.map((subLayer
|
|
7878
|
+
subLayers.map((subLayer) => {
|
|
7795
7879
|
if (subLayer.visible) {
|
|
7796
7880
|
this.layersCollection.push(subLayer);
|
|
7797
7881
|
}
|
|
@@ -7951,6 +8035,9 @@ let Maps = class Maps extends Component {
|
|
|
7951
8035
|
}
|
|
7952
8036
|
keyUpHandler(event) {
|
|
7953
8037
|
const id = event.target['id'];
|
|
8038
|
+
if (this.isTileMap) {
|
|
8039
|
+
this.removeTileMap();
|
|
8040
|
+
}
|
|
7954
8041
|
if (event.code === 'Tab' && id.indexOf('_LayerIndex_') > -1 && id.indexOf('shapeIndex') > -1) {
|
|
7955
8042
|
this.keyboardHighlightSelection(id, event.type);
|
|
7956
8043
|
}
|
|
@@ -7984,6 +8071,13 @@ let Maps = class Maps extends Component {
|
|
|
7984
8071
|
}
|
|
7985
8072
|
keyDownHandler(event) {
|
|
7986
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
|
+
}
|
|
7987
8081
|
if ((event.key === '+' || event.code === 'Equal') && zoom) {
|
|
7988
8082
|
zoom.performZoomingByToolBar('zoomin');
|
|
7989
8083
|
}
|
|
@@ -8058,6 +8152,7 @@ let Maps = class Maps extends Component {
|
|
|
8058
8152
|
* This method is used to perform the operations when a click operation is performed on maps.
|
|
8059
8153
|
*
|
|
8060
8154
|
* @param {PointerEvent} e - Specifies the pointer event on maps.
|
|
8155
|
+
* @returns {void}
|
|
8061
8156
|
*/
|
|
8062
8157
|
mapsOnClick(e) {
|
|
8063
8158
|
const targetEle = e.target;
|
|
@@ -8122,8 +8217,9 @@ let Maps = class Maps extends Component {
|
|
|
8122
8217
|
getClickLocation(targetId, pageX, pageY, targetElement, x, y) {
|
|
8123
8218
|
let layerIndex = 0;
|
|
8124
8219
|
let latLongValue;
|
|
8125
|
-
if (targetId.indexOf('_LayerIndex_') !== -1 && !this.isTileMap &&
|
|
8126
|
-
|
|
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))) {
|
|
8127
8223
|
layerIndex = parseFloat(targetId.split('_LayerIndex_')[1].split('_')[0]);
|
|
8128
8224
|
if (this.layers[layerIndex].geometryType === 'Normal') {
|
|
8129
8225
|
if (targetId.indexOf('_shapeIndex_') > -1) {
|
|
@@ -8160,12 +8256,21 @@ let Maps = class Maps extends Component {
|
|
|
8160
8256
|
latLongValue = this.getGeoLocation(layerIndex, x, y);
|
|
8161
8257
|
}
|
|
8162
8258
|
}
|
|
8163
|
-
else if (this.isTileMap && (parseInt(this.mouseDownEvent['x']) === parseInt(this.mouseClickEvent['x']))
|
|
8164
|
-
|
|
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))) {
|
|
8165
8261
|
latLongValue = this.getTileGeoLocation(x, y);
|
|
8166
8262
|
}
|
|
8167
8263
|
return latLongValue;
|
|
8168
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
|
+
}
|
|
8169
8274
|
/**
|
|
8170
8275
|
* This method is used to perform operations when mouse click on maps.
|
|
8171
8276
|
*
|
|
@@ -8197,6 +8302,9 @@ let Maps = class Maps extends Component {
|
|
|
8197
8302
|
pageY = e.pageY;
|
|
8198
8303
|
target = e.target;
|
|
8199
8304
|
}
|
|
8305
|
+
if (this.isTileMap) {
|
|
8306
|
+
this.removeTileMap();
|
|
8307
|
+
}
|
|
8200
8308
|
if (this.isTouch) {
|
|
8201
8309
|
if (targetEle.id.indexOf('_ToolBar') === -1) {
|
|
8202
8310
|
const latLongValue = this.getClickLocation(targetId, pageX, pageY, targetEle, pageX, pageY);
|
|
@@ -8229,6 +8337,10 @@ let Maps = class Maps extends Component {
|
|
|
8229
8337
|
}
|
|
8230
8338
|
const rect = this.element.getBoundingClientRect();
|
|
8231
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
|
+
}
|
|
8232
8344
|
if (element.id.indexOf('_ToolBar') === -1) {
|
|
8233
8345
|
const markerModule = this.markerModule;
|
|
8234
8346
|
if (element.id.indexOf('shapeIndex') > -1 || element.id.indexOf('Tile') > -1) {
|
|
@@ -8261,6 +8373,7 @@ let Maps = class Maps extends Component {
|
|
|
8261
8373
|
* This method is used to perform operations when performing the double click operation on maps.
|
|
8262
8374
|
*
|
|
8263
8375
|
* @param {PointerEvent} e - Specifies the pointer event.
|
|
8376
|
+
* @returns {void}
|
|
8264
8377
|
*/
|
|
8265
8378
|
mapsOnDoubleClick(e) {
|
|
8266
8379
|
this.notify('dblclick', e);
|
|
@@ -8284,8 +8397,10 @@ let Maps = class Maps extends Component {
|
|
|
8284
8397
|
latitude = latLongValue['latitude'];
|
|
8285
8398
|
longitude = latLongValue['longitude'];
|
|
8286
8399
|
}
|
|
8287
|
-
const doubleClickArgs = {
|
|
8288
|
-
|
|
8400
|
+
const doubleClickArgs = {
|
|
8401
|
+
cancel: false, name: doubleClick, x: e.clientX, y: e.clientY,
|
|
8402
|
+
target: targetId, latitude: latitude, longitude: longitude, isShapeSelected: null
|
|
8403
|
+
};
|
|
8289
8404
|
this.trigger('doubleClick', doubleClickArgs);
|
|
8290
8405
|
}
|
|
8291
8406
|
}
|
|
@@ -8376,28 +8491,30 @@ let Maps = class Maps extends Component {
|
|
|
8376
8491
|
* @param e - Specifies the arguments of window resize event.
|
|
8377
8492
|
*/
|
|
8378
8493
|
mapsOnResize(e) {
|
|
8379
|
-
|
|
8380
|
-
|
|
8381
|
-
|
|
8382
|
-
|
|
8383
|
-
|
|
8384
|
-
|
|
8385
|
-
|
|
8386
|
-
|
|
8387
|
-
|
|
8388
|
-
|
|
8389
|
-
if (
|
|
8390
|
-
|
|
8391
|
-
|
|
8392
|
-
|
|
8393
|
-
this.
|
|
8394
|
-
this.
|
|
8395
|
-
|
|
8396
|
-
|
|
8397
|
-
|
|
8398
|
-
|
|
8399
|
-
|
|
8400
|
-
|
|
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
|
+
}
|
|
8401
8518
|
}
|
|
8402
8519
|
}
|
|
8403
8520
|
return false;
|
|
@@ -8412,69 +8529,79 @@ let Maps = class Maps extends Component {
|
|
|
8412
8529
|
* @returns {void}
|
|
8413
8530
|
*/
|
|
8414
8531
|
zoomByPosition(centerPosition, zoomFactor) {
|
|
8415
|
-
this.
|
|
8416
|
-
|
|
8417
|
-
|
|
8418
|
-
if (!
|
|
8419
|
-
|
|
8420
|
-
|
|
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
|
+
}
|
|
8549
|
+
}
|
|
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;
|
|
8421
8554
|
this.centerPosition = centerPosition;
|
|
8422
8555
|
this.isZoomByPosition = true;
|
|
8423
|
-
this.mapScaleValue = null;
|
|
8424
8556
|
}
|
|
8425
|
-
|
|
8426
|
-
this.
|
|
8427
|
-
this.isZoomByPosition = true;
|
|
8428
|
-
this.mapScaleValue = null;
|
|
8557
|
+
if (isRefresh) {
|
|
8558
|
+
this.refresh();
|
|
8429
8559
|
}
|
|
8430
8560
|
}
|
|
8431
|
-
else if (this.zoomModule) {
|
|
8432
|
-
this.tileZoomLevel = this.zoomSettings.zoomFactor = zoomFactor;
|
|
8433
|
-
isRefresh = this.centerPosition.latitude === centerPosition.latitude && this.centerPosition.longitude === centerPosition.longitude ? true : isRefresh;
|
|
8434
|
-
this.centerPosition = centerPosition;
|
|
8435
|
-
this.isZoomByPosition = true;
|
|
8436
|
-
}
|
|
8437
|
-
if (isRefresh) {
|
|
8438
|
-
this.refresh();
|
|
8439
|
-
}
|
|
8440
8561
|
}
|
|
8441
8562
|
/**
|
|
8442
8563
|
* This method is used to perform panning by specifying the direction.
|
|
8443
8564
|
*
|
|
8444
8565
|
* @param {PanDirection} direction - Specifies the direction in which the panning is performed.
|
|
8445
8566
|
* @param {PointerEvent | TouchEvent} mouseLocation - Specifies the location of the mouse pointer in maps.
|
|
8567
|
+
* @returns {void}
|
|
8446
8568
|
*/
|
|
8447
8569
|
panByDirection(direction, mouseLocation) {
|
|
8448
|
-
|
|
8449
|
-
|
|
8450
|
-
|
|
8451
|
-
|
|
8452
|
-
|
|
8453
|
-
|
|
8454
|
-
|
|
8455
|
-
|
|
8456
|
-
|
|
8457
|
-
|
|
8458
|
-
|
|
8459
|
-
|
|
8460
|
-
|
|
8461
|
-
|
|
8462
|
-
|
|
8463
|
-
|
|
8464
|
-
|
|
8465
|
-
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
|
+
}
|
|
8466
8590
|
}
|
|
8467
8591
|
}
|
|
8468
8592
|
/**
|
|
8469
8593
|
* This method is used to add the layers dynamically to the maps.
|
|
8470
8594
|
*
|
|
8471
8595
|
* @param {Object} layer - Specifies the layer for the maps.
|
|
8596
|
+
* @returns {void}
|
|
8472
8597
|
*/
|
|
8473
8598
|
addLayer(layer) {
|
|
8474
|
-
|
|
8475
|
-
|
|
8476
|
-
|
|
8477
|
-
|
|
8599
|
+
if (!this.isDestroyed) {
|
|
8600
|
+
const mapsLayer = this.layers;
|
|
8601
|
+
mapsLayer.push(layer);
|
|
8602
|
+
this.isAddLayer = true;
|
|
8603
|
+
this.layers = mapsLayer;
|
|
8604
|
+
}
|
|
8478
8605
|
}
|
|
8479
8606
|
/**
|
|
8480
8607
|
* This method is used to remove a layer from map.
|
|
@@ -8483,9 +8610,11 @@ let Maps = class Maps extends Component {
|
|
|
8483
8610
|
* @returns {void}
|
|
8484
8611
|
*/
|
|
8485
8612
|
removeLayer(index) {
|
|
8486
|
-
|
|
8487
|
-
|
|
8488
|
-
|
|
8613
|
+
if (!this.isDestroyed) {
|
|
8614
|
+
const mapsLayer = this.layers;
|
|
8615
|
+
mapsLayer.splice(index, 1);
|
|
8616
|
+
this.layers = mapsLayer;
|
|
8617
|
+
}
|
|
8489
8618
|
}
|
|
8490
8619
|
/**
|
|
8491
8620
|
* This method is used to add markers dynamically in the maps.
|
|
@@ -8497,14 +8626,16 @@ let Maps = class Maps extends Component {
|
|
|
8497
8626
|
* @returns {void}
|
|
8498
8627
|
*/
|
|
8499
8628
|
addMarker(layerIndex, markerCollection) {
|
|
8500
|
-
|
|
8501
|
-
|
|
8502
|
-
|
|
8503
|
-
|
|
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();
|
|
8504
8638
|
}
|
|
8505
|
-
const markerModule = new Marker(this);
|
|
8506
|
-
markerModule.markerRender(this, layerEle, layerIndex, this.mapLayerPanel['currentFactor'], 'AddMarker');
|
|
8507
|
-
this.arrangeTemplate();
|
|
8508
8639
|
}
|
|
8509
8640
|
}
|
|
8510
8641
|
/**
|
|
@@ -8517,93 +8648,96 @@ let Maps = class Maps extends Component {
|
|
|
8517
8648
|
* @returns {void}
|
|
8518
8649
|
*/
|
|
8519
8650
|
shapeSelection(layerIndex, propertyName, name, enable) {
|
|
8520
|
-
|
|
8521
|
-
|
|
8522
|
-
|
|
8523
|
-
|
|
8524
|
-
enable
|
|
8525
|
-
|
|
8526
|
-
|
|
8527
|
-
|
|
8528
|
-
this.
|
|
8529
|
-
|
|
8530
|
-
|
|
8531
|
-
|
|
8532
|
-
|
|
8533
|
-
|
|
8534
|
-
|
|
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
|
+
}
|
|
8535
8668
|
}
|
|
8536
8669
|
}
|
|
8537
|
-
|
|
8538
|
-
|
|
8539
|
-
|
|
8540
|
-
|
|
8541
|
-
|
|
8542
|
-
|
|
8543
|
-
|
|
8544
|
-
|
|
8545
|
-
|
|
8546
|
-
|
|
8547
|
-
|
|
8548
|
-
|
|
8549
|
-
|
|
8550
|
-
|
|
8551
|
-
|
|
8552
|
-
|
|
8553
|
-
|
|
8554
|
-
|
|
8555
|
-
|
|
8556
|
-
|
|
8557
|
-
|
|
8558
|
-
|
|
8559
|
-
|
|
8560
|
-
|
|
8561
|
-
|
|
8562
|
-
|
|
8563
|
-
|
|
8564
|
-
targetId = this.element.id + '_' + 'LayerIndex_' + indexValue + '_shapeIndex_' + i + '_dataIndex_' + k;
|
|
8565
|
-
targetEle = getElement(targetId);
|
|
8566
|
-
if (isNullOrUndefined(k) && isNullOrUndefined(targetEle)) {
|
|
8567
|
-
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;
|
|
8568
8697
|
targetEle = getElement(targetId);
|
|
8569
|
-
|
|
8570
|
-
|
|
8571
|
-
|
|
8572
|
-
this.layers[layerIndex].shapeData['features'][shapeIndex]['properties'] : null;
|
|
8573
|
-
dataIndex = parseInt(targetEle.id.split('_dataIndex_')[1].split('_')[0], 10);
|
|
8574
|
-
data = isNullOrUndefined(dataIndex) ? null : this.layers[layerIndex].dataSource[dataIndex];
|
|
8575
|
-
if (enable) {
|
|
8576
|
-
triggerItemSelectionEvent(selectionsettings, this, targetEle, shapeDataValue, data);
|
|
8577
|
-
this.shapeSelectionClass = getElement('ShapeselectionMap');
|
|
8578
|
-
if (this.legendSettings.visible && targetEle.id.indexOf('_MarkerIndex_') === -1) {
|
|
8579
|
-
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);
|
|
8580
8701
|
}
|
|
8581
|
-
|
|
8582
|
-
|
|
8583
|
-
|
|
8584
|
-
|
|
8585
|
-
|
|
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);
|
|
8586
8712
|
}
|
|
8587
|
-
|
|
8588
|
-
|
|
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
|
+
}
|
|
8589
8722
|
}
|
|
8590
8723
|
}
|
|
8591
|
-
|
|
8592
|
-
|
|
8593
|
-
|
|
8594
|
-
|
|
8595
|
-
|
|
8596
|
-
|
|
8597
|
-
|
|
8598
|
-
|
|
8599
|
-
|
|
8600
|
-
|
|
8601
|
-
|
|
8602
|
-
|
|
8603
|
-
|
|
8604
|
-
|
|
8605
|
-
|
|
8606
|
-
|
|
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
|
+
}
|
|
8607
8741
|
}
|
|
8608
8742
|
}
|
|
8609
8743
|
}
|
|
@@ -8623,53 +8757,55 @@ let Maps = class Maps extends Component {
|
|
|
8623
8757
|
* @returns {void}
|
|
8624
8758
|
*/
|
|
8625
8759
|
zoomToCoordinates(minLatitude, minLongitude, maxLatitude, maxLongitude) {
|
|
8626
|
-
|
|
8627
|
-
|
|
8628
|
-
|
|
8629
|
-
|
|
8630
|
-
|
|
8631
|
-
|
|
8632
|
-
|
|
8633
|
-
|
|
8634
|
-
|
|
8635
|
-
|
|
8636
|
-
|
|
8637
|
-
|
|
8638
|
-
|
|
8639
|
-
|
|
8640
|
-
|
|
8641
|
-
|
|
8642
|
-
|
|
8643
|
-
|
|
8644
|
-
|
|
8645
|
-
|
|
8646
|
-
|
|
8647
|
-
|
|
8648
|
-
|
|
8649
|
-
|
|
8650
|
-
|
|
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();
|
|
8651
8808
|
}
|
|
8652
|
-
else {
|
|
8653
|
-
centerLatitude = (minLatitude + maxLatitude);
|
|
8654
|
-
centerLongtitude = (minLongitude + maxLongitude);
|
|
8655
|
-
}
|
|
8656
|
-
this.centerLatOfGivenLocation = centerLatitude;
|
|
8657
|
-
this.centerLongOfGivenLocation = centerLongtitude;
|
|
8658
|
-
this.minLatOfGivenLocation = minLatitude;
|
|
8659
|
-
this.minLongOfGivenLocation = minLongitude;
|
|
8660
|
-
this.maxLatOfGivenLocation = maxLatitude;
|
|
8661
|
-
this.maxLongOfGivenLocation = maxLongitude;
|
|
8662
|
-
this.zoomNotApplied = true;
|
|
8663
|
-
this.scaleOfGivenLocation = calculateZoomLevel(minLatitude, maxLatitude, minLongitude, maxLongitude, this.mapAreaRect.width, this.mapAreaRect.height, this);
|
|
8664
|
-
const zoomArgs = {
|
|
8665
|
-
cancel: false, name: 'zoom', type: zoomIn, maps: this,
|
|
8666
|
-
tileTranslatePoint: {}, translatePoint: {},
|
|
8667
|
-
tileZoomLevel: this.isTileMap ? { previous: this.tileZoomLevel, current: this.scaleOfGivenLocation } : {},
|
|
8668
|
-
scale: !this.isTileMap ? { previous: this.scale, current: this.scaleOfGivenLocation } :
|
|
8669
|
-
{ previous: this.tileZoomLevel, current: this.scaleOfGivenLocation }
|
|
8670
|
-
};
|
|
8671
|
-
this.trigger('zoom', zoomArgs);
|
|
8672
|
-
this.refresh();
|
|
8673
8809
|
}
|
|
8674
8810
|
/**
|
|
8675
8811
|
* This method is used to remove multiple selected shapes in the maps.
|
|
@@ -8720,6 +8856,8 @@ let Maps = class Maps extends Component {
|
|
|
8720
8856
|
}
|
|
8721
8857
|
/**
|
|
8722
8858
|
* This method disposes the maps component.
|
|
8859
|
+
*
|
|
8860
|
+
* @returns {void}
|
|
8723
8861
|
*/
|
|
8724
8862
|
destroy() {
|
|
8725
8863
|
this.unWireEVents();
|
|
@@ -8776,91 +8914,94 @@ let Maps = class Maps extends Component {
|
|
|
8776
8914
|
* @private
|
|
8777
8915
|
*/
|
|
8778
8916
|
onPropertyChanged(newProp, oldProp) {
|
|
8779
|
-
|
|
8780
|
-
|
|
8781
|
-
|
|
8782
|
-
|
|
8783
|
-
|
|
8784
|
-
|
|
8785
|
-
|
|
8786
|
-
|
|
8787
|
-
|
|
8788
|
-
|
|
8789
|
-
|
|
8790
|
-
|
|
8791
|
-
|
|
8792
|
-
|
|
8793
|
-
|
|
8794
|
-
|
|
8795
|
-
|
|
8796
|
-
|
|
8797
|
-
|
|
8798
|
-
|
|
8799
|
-
|
|
8800
|
-
|
|
8801
|
-
|
|
8802
|
-
|
|
8803
|
-
|
|
8804
|
-
|
|
8805
|
-
|
|
8806
|
-
|
|
8807
|
-
|
|
8808
|
-
|
|
8809
|
-
|
|
8810
|
-
|
|
8811
|
-
|
|
8812
|
-
|
|
8813
|
-
|
|
8814
|
-
|
|
8815
|
-
|
|
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
|
+
}
|
|
8816
8957
|
}
|
|
8817
8958
|
}
|
|
8818
8959
|
}
|
|
8819
8960
|
}
|
|
8820
|
-
|
|
8821
|
-
|
|
8822
|
-
|
|
8823
|
-
|
|
8824
|
-
|
|
8825
|
-
|
|
8826
|
-
|
|
8827
|
-
|
|
8828
|
-
|
|
8829
|
-
|
|
8830
|
-
|
|
8831
|
-
|
|
8832
|
-
|
|
8833
|
-
|
|
8834
|
-
|
|
8835
|
-
|
|
8836
|
-
|
|
8837
|
-
|
|
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
|
+
}
|
|
8838
8979
|
}
|
|
8839
|
-
|
|
8840
|
-
|
|
8841
|
-
|
|
8842
|
-
|
|
8843
|
-
|
|
8844
|
-
|
|
8980
|
+
break;
|
|
8981
|
+
case 'locale':
|
|
8982
|
+
case 'currencyCode':
|
|
8983
|
+
super.refresh();
|
|
8984
|
+
break;
|
|
8985
|
+
}
|
|
8845
8986
|
}
|
|
8846
|
-
|
|
8847
|
-
|
|
8848
|
-
|
|
8849
|
-
|
|
8850
|
-
|
|
8851
|
-
|
|
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);
|
|
8852
8999
|
}
|
|
8853
9000
|
else {
|
|
8854
|
-
this.
|
|
9001
|
+
this.createSVG();
|
|
9002
|
+
this.renderElements();
|
|
8855
9003
|
}
|
|
8856
9004
|
}
|
|
8857
|
-
else if (newProp.layers && isStaticMapType) {
|
|
8858
|
-
this.mapLayerPanel.renderGoogleMap(this.layers[this.layers.length - 1].key, this.staticMapZoom);
|
|
8859
|
-
}
|
|
8860
|
-
else {
|
|
8861
|
-
this.createSVG();
|
|
8862
|
-
this.renderElements();
|
|
8863
|
-
}
|
|
8864
9005
|
}
|
|
8865
9006
|
}
|
|
8866
9007
|
/**
|
|
@@ -8873,7 +9014,7 @@ let Maps = class Maps extends Component {
|
|
|
8873
9014
|
const modules = [];
|
|
8874
9015
|
const isVisible = this.findVisibleLayers(this.layers);
|
|
8875
9016
|
let annotationEnable = false;
|
|
8876
|
-
this.annotations.map((annotation
|
|
9017
|
+
this.annotations.map((annotation) => {
|
|
8877
9018
|
annotationEnable = annotation.content != null;
|
|
8878
9019
|
});
|
|
8879
9020
|
if (this.isBubbleVisible()) {
|
|
@@ -8958,10 +9099,12 @@ let Maps = class Maps extends Component {
|
|
|
8958
9099
|
}
|
|
8959
9100
|
/**
|
|
8960
9101
|
* To find marker visibility
|
|
9102
|
+
*
|
|
9103
|
+
* @returns {boolean} - Returns whether the markers are visible or not.
|
|
8961
9104
|
*/
|
|
8962
9105
|
isMarkersVisible() {
|
|
8963
9106
|
let isVisible = false;
|
|
8964
|
-
Array.prototype.forEach.call(this.layers, (layer
|
|
9107
|
+
Array.prototype.forEach.call(this.layers, (layer) => {
|
|
8965
9108
|
for (let i = 0; i < layer.markerSettings.length; i++) {
|
|
8966
9109
|
if (layer.markerSettings[i].visible) {
|
|
8967
9110
|
isVisible = true;
|
|
@@ -8973,6 +9116,8 @@ let Maps = class Maps extends Component {
|
|
|
8973
9116
|
}
|
|
8974
9117
|
/**
|
|
8975
9118
|
* To find DataLabel visibility
|
|
9119
|
+
*
|
|
9120
|
+
* @returns {boolean} - Returns whether the data labels are visible or not.
|
|
8976
9121
|
*/
|
|
8977
9122
|
isDataLabelVisible() {
|
|
8978
9123
|
let isVisible = false;
|
|
@@ -8986,10 +9131,12 @@ let Maps = class Maps extends Component {
|
|
|
8986
9131
|
}
|
|
8987
9132
|
/**
|
|
8988
9133
|
* To find navigation line visibility
|
|
9134
|
+
*
|
|
9135
|
+
* @returns {boolean} - Returns whether the navigation lines are visible or not.
|
|
8989
9136
|
*/
|
|
8990
9137
|
isNavigationVisible() {
|
|
8991
9138
|
let isVisible = false;
|
|
8992
|
-
Array.prototype.forEach.call(this.layers, (layer
|
|
9139
|
+
Array.prototype.forEach.call(this.layers, (layer) => {
|
|
8993
9140
|
for (let i = 0; i < layer.navigationLineSettings.length; i++) {
|
|
8994
9141
|
if (layer.navigationLineSettings[i].visible) {
|
|
8995
9142
|
isVisible = true;
|
|
@@ -9001,6 +9148,8 @@ let Maps = class Maps extends Component {
|
|
|
9001
9148
|
}
|
|
9002
9149
|
/**
|
|
9003
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.
|
|
9004
9153
|
* @private
|
|
9005
9154
|
*/
|
|
9006
9155
|
getExtraPosition() {
|
|
@@ -9056,7 +9205,7 @@ let Maps = class Maps extends Component {
|
|
|
9056
9205
|
* @returns {void}
|
|
9057
9206
|
*/
|
|
9058
9207
|
print(id) {
|
|
9059
|
-
if ((this.allowPrint) && (this.printModule)) {
|
|
9208
|
+
if ((this.allowPrint) && (this.printModule) && !this.isDestroyed) {
|
|
9060
9209
|
this.printModule.print(this, id);
|
|
9061
9210
|
}
|
|
9062
9211
|
}
|
|
@@ -9070,18 +9219,20 @@ let Maps = class Maps extends Component {
|
|
|
9070
9219
|
* @returns {Promise<string>} - Returns the string value.
|
|
9071
9220
|
*/
|
|
9072
9221
|
export(type, fileName, orientation, allowDownload) {
|
|
9073
|
-
if (
|
|
9074
|
-
allowDownload
|
|
9075
|
-
|
|
9076
|
-
|
|
9077
|
-
|
|
9078
|
-
|
|
9079
|
-
|
|
9080
|
-
|
|
9081
|
-
|
|
9082
|
-
|
|
9083
|
-
|
|
9084
|
-
|
|
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
|
+
}
|
|
9085
9236
|
}
|
|
9086
9237
|
return null;
|
|
9087
9238
|
}
|
|
@@ -9092,19 +9243,22 @@ let Maps = class Maps extends Component {
|
|
|
9092
9243
|
* @returns {Promise<string>} - Returns the processed Bing URL as Promise.
|
|
9093
9244
|
*/
|
|
9094
9245
|
getBingUrlTemplate(url) {
|
|
9095
|
-
|
|
9096
|
-
|
|
9097
|
-
|
|
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();
|
|
9098
9260
|
});
|
|
9099
|
-
|
|
9100
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9101
|
-
const jsonObject = JSON.parse(json);
|
|
9102
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9103
|
-
const resource = jsonObject['resourceSets'][0]['resources'][0];
|
|
9104
|
-
resolve(resource['imageUrl']);
|
|
9105
|
-
};
|
|
9106
|
-
ajax.send();
|
|
9107
|
-
});
|
|
9261
|
+
}
|
|
9108
9262
|
return promise;
|
|
9109
9263
|
}
|
|
9110
9264
|
/**
|
|
@@ -9176,21 +9330,25 @@ let Maps = class Maps extends Component {
|
|
|
9176
9330
|
* @returns {GeoPosition}- Returns the geo position
|
|
9177
9331
|
*/
|
|
9178
9332
|
getGeoLocation(layerIndex, x, y) {
|
|
9179
|
-
|
|
9180
|
-
|
|
9181
|
-
|
|
9182
|
-
|
|
9183
|
-
|
|
9184
|
-
|
|
9185
|
-
|
|
9186
|
-
|
|
9187
|
-
|
|
9188
|
-
|
|
9189
|
-
|
|
9190
|
-
|
|
9191
|
-
|
|
9192
|
-
|
|
9193
|
-
|
|
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 };
|
|
9194
9352
|
}
|
|
9195
9353
|
clip(value, minVal, maxVal) {
|
|
9196
9354
|
return Math.min(Math.max(value, minVal), maxVal);
|
|
@@ -9203,10 +9361,16 @@ let Maps = class Maps extends Component {
|
|
|
9203
9361
|
* @returns {GeoPosition} - Returns the position
|
|
9204
9362
|
*/
|
|
9205
9363
|
getTileGeoLocation(x, y) {
|
|
9206
|
-
|
|
9207
|
-
|
|
9208
|
-
|
|
9209
|
-
|
|
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 };
|
|
9210
9374
|
}
|
|
9211
9375
|
/**
|
|
9212
9376
|
* This method is used to convert the point to latitude and longitude in maps.
|
|
@@ -9216,14 +9380,18 @@ let Maps = class Maps extends Component {
|
|
|
9216
9380
|
* @returns {Object} - Returns the object.
|
|
9217
9381
|
*/
|
|
9218
9382
|
pointToLatLong(pageX, pageY) {
|
|
9219
|
-
|
|
9220
|
-
|
|
9221
|
-
|
|
9222
|
-
|
|
9223
|
-
|
|
9224
|
-
|
|
9225
|
-
|
|
9226
|
-
|
|
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 };
|
|
9227
9395
|
}
|
|
9228
9396
|
};
|
|
9229
9397
|
__decorate([
|
|
@@ -9417,7 +9585,8 @@ class Bubble {
|
|
|
9417
9585
|
const layerData = layer.layerData;
|
|
9418
9586
|
const colorValuePath = bubbleSettings.colorValuePath;
|
|
9419
9587
|
const equalValue = (!isNullOrUndefined(colorValuePath)) ? ((colorValuePath.indexOf('.') > -1) ?
|
|
9420
|
-
(getValueFromObject(shapeData, bubbleSettings.colorValuePath)) : shapeData[colorValuePath]) :
|
|
9588
|
+
(getValueFromObject(shapeData, bubbleSettings.colorValuePath)) : shapeData[colorValuePath]) :
|
|
9589
|
+
shapeData[colorValuePath];
|
|
9421
9590
|
const colorValue = (!isNullOrUndefined(colorValuePath)) ? ((colorValuePath.indexOf('.') > -1) ?
|
|
9422
9591
|
Number(getValueFromObject(shapeData, bubbleSettings.colorValuePath)) : Number(shapeData[colorValuePath])) :
|
|
9423
9592
|
Number(shapeData[colorValuePath]);
|
|
@@ -9571,16 +9740,17 @@ class Bubble {
|
|
|
9571
9740
|
}
|
|
9572
9741
|
else {
|
|
9573
9742
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9574
|
-
shape.map((current
|
|
9743
|
+
shape.map((current) => {
|
|
9575
9744
|
points.push(new Point(current['point']['x'], current['point']['y']));
|
|
9576
9745
|
});
|
|
9577
9746
|
}
|
|
9578
9747
|
return points;
|
|
9579
9748
|
}
|
|
9580
|
-
// eslint-disable-next-line valid-jsdoc
|
|
9581
9749
|
/**
|
|
9582
9750
|
* To check and trigger bubble click event
|
|
9583
9751
|
*
|
|
9752
|
+
* @param {PointerEvent} e - Specifies the pointer event argument.
|
|
9753
|
+
* @returns {void}
|
|
9584
9754
|
* @private
|
|
9585
9755
|
*/
|
|
9586
9756
|
bubbleClick(e) {
|
|
@@ -9626,6 +9796,8 @@ class Bubble {
|
|
|
9626
9796
|
/**
|
|
9627
9797
|
* To check and trigger bubble move event
|
|
9628
9798
|
*
|
|
9799
|
+
* @param {PointerEvent} e - Specifies the pointer event argument.
|
|
9800
|
+
* @retruns {void}
|
|
9629
9801
|
* @private
|
|
9630
9802
|
*/
|
|
9631
9803
|
bubbleMove(e) {
|
|
@@ -9714,6 +9886,7 @@ class DataLabel {
|
|
|
9714
9886
|
layerData, group, labelTemplateElement, index, intersect) {
|
|
9715
9887
|
const dataLabel = layer.dataLabelSettings;
|
|
9716
9888
|
const style = layer.dataLabelSettings.textStyle;
|
|
9889
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9717
9890
|
let templateFn;
|
|
9718
9891
|
let options;
|
|
9719
9892
|
const dataLabelSettings = layer.dataLabelSettings;
|
|
@@ -9724,7 +9897,6 @@ class DataLabel {
|
|
|
9724
9897
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9725
9898
|
const shapeData = shape;
|
|
9726
9899
|
let element;
|
|
9727
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9728
9900
|
let text = '';
|
|
9729
9901
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9730
9902
|
let datasrcObj;
|
|
@@ -9746,7 +9918,7 @@ class DataLabel {
|
|
|
9746
9918
|
const properties = (Object.prototype.toString.call(layer.shapePropertyPath) === '[object Array]' ?
|
|
9747
9919
|
layer.shapePropertyPath : [layer.shapePropertyPath]);
|
|
9748
9920
|
let propertyPath;
|
|
9749
|
-
|
|
9921
|
+
const isPoint = false;
|
|
9750
9922
|
const animate$$1 = layer.animationDuration !== 0 || isNullOrUndefined(this.maps.zoomModule);
|
|
9751
9923
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9752
9924
|
const translate = (this.maps.isTileMap) ? new Object() : ((this.maps.zoomSettings.zoomFactor > 1 &&
|
|
@@ -9863,7 +10035,6 @@ class DataLabel {
|
|
|
9863
10035
|
if (eventargs.cancel) {
|
|
9864
10036
|
return;
|
|
9865
10037
|
}
|
|
9866
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9867
10038
|
let position = [];
|
|
9868
10039
|
let width = zoomLabelsPosition && scaleZoomValue > 1 && !this.maps.zoomNotApplied
|
|
9869
10040
|
&& this.maps.zoomShapeCollection.length > index ? this.maps.zoomShapeCollection[index]['width'] :
|
|
@@ -10049,7 +10220,7 @@ class DataLabel {
|
|
|
10049
10220
|
}
|
|
10050
10221
|
else {
|
|
10051
10222
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10052
|
-
shapes.map((current
|
|
10223
|
+
shapes.map((current) => {
|
|
10053
10224
|
points.push(new Point(current['point']['x'], current['point']['y']));
|
|
10054
10225
|
});
|
|
10055
10226
|
}
|
|
@@ -10064,7 +10235,6 @@ class DataLabel {
|
|
|
10064
10235
|
return 'DataLabel';
|
|
10065
10236
|
}
|
|
10066
10237
|
/**
|
|
10067
|
-
*
|
|
10068
10238
|
* @returns {void}
|
|
10069
10239
|
* @private
|
|
10070
10240
|
*/
|
|
@@ -10082,123 +10252,130 @@ class NavigationLine {
|
|
|
10082
10252
|
constructor(maps) {
|
|
10083
10253
|
this.maps = maps;
|
|
10084
10254
|
}
|
|
10085
|
-
// eslint-disable-next-line valid-jsdoc
|
|
10086
10255
|
/**
|
|
10087
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.
|
|
10088
10262
|
*/
|
|
10089
10263
|
renderNavigation(layer, factor, layerIndex) {
|
|
10090
|
-
let
|
|
10091
|
-
|
|
10092
|
-
|
|
10093
|
-
|
|
10094
|
-
|
|
10095
|
-
|
|
10096
|
-
|
|
10097
|
-
|
|
10098
|
-
|
|
10099
|
-
|
|
10100
|
-
|
|
10101
|
-
|
|
10102
|
-
|
|
10103
|
-
|
|
10104
|
-
|
|
10105
|
-
|
|
10106
|
-
|
|
10107
|
-
|
|
10108
|
-
|
|
10109
|
-
|
|
10110
|
-
|
|
10111
|
-
|
|
10112
|
-
|
|
10113
|
-
|
|
10114
|
-
|
|
10115
|
-
|
|
10116
|
-
|
|
10117
|
-
|
|
10118
|
-
|
|
10119
|
-
|
|
10120
|
-
|
|
10121
|
-
|
|
10122
|
-
latitude = navigation[i]['properties']['latitude'];
|
|
10123
|
-
longitude = navigation[i]['properties']['longitude'];
|
|
10124
|
-
visible = navigation[i]['properties']['visible'];
|
|
10125
|
-
angle = navigation[i]['angle'];
|
|
10126
|
-
width = navigation[i]['width'] || 1;
|
|
10127
|
-
color = navigation[i]['color'];
|
|
10128
|
-
dashArray = navigation[i]['properties']['dashArray'];
|
|
10129
|
-
arrowSettings = navigation[i]['properties']['arrowSettings'];
|
|
10130
|
-
showArrow = (isNullOrUndefined(arrowSettings)) ? false : arrowSettings['properties']['showArrow'];
|
|
10131
|
-
if (longitude['length'] === latitude['length'] && visible) {
|
|
10132
|
-
for (let i = 0; i < longitude['length']; i++) {
|
|
10133
|
-
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);
|
|
10134
|
-
point.push(location);
|
|
10135
|
-
}
|
|
10136
|
-
}
|
|
10137
|
-
navigationGroup = (this.maps.renderer.createGroup({
|
|
10138
|
-
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'
|
|
10139
10296
|
}));
|
|
10140
|
-
for (let
|
|
10141
|
-
|
|
10142
|
-
|
|
10143
|
-
|
|
10144
|
-
|
|
10145
|
-
|
|
10146
|
-
|
|
10147
|
-
|
|
10148
|
-
|
|
10149
|
-
|
|
10150
|
-
|
|
10151
|
-
|
|
10152
|
-
|
|
10153
|
-
|
|
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) {
|
|
10154
10322
|
direction = 0;
|
|
10323
|
+
if (point[j]['x'] > point[j + 1]['x']) {
|
|
10324
|
+
direction = 1;
|
|
10325
|
+
}
|
|
10155
10326
|
}
|
|
10156
|
-
|
|
10157
|
-
|
|
10158
|
-
|
|
10159
|
-
|
|
10160
|
-
|
|
10161
|
-
|
|
10162
|
-
|
|
10163
|
-
|
|
10164
|
-
|
|
10165
|
-
|
|
10166
|
-
|
|
10167
|
-
|
|
10168
|
-
|
|
10169
|
-
|
|
10170
|
-
|
|
10171
|
-
|
|
10172
|
-
|
|
10173
|
-
|
|
10174
|
-
|
|
10175
|
-
|
|
10176
|
-
|
|
10177
|
-
|
|
10178
|
-
|
|
10179
|
-
|
|
10327
|
+
if (angle >= -1 && angle < 0) {
|
|
10328
|
+
direction = 1;
|
|
10329
|
+
if (point[j]['x'] > point[j + 1]['x']) {
|
|
10330
|
+
direction = 0;
|
|
10331
|
+
}
|
|
10332
|
+
}
|
|
10333
|
+
if (showArrow) {
|
|
10334
|
+
arrowColor = arrowSettings['properties']['color'];
|
|
10335
|
+
arrowSize = arrowSettings['properties']['size'];
|
|
10336
|
+
offSetValue = (arrowSettings['properties']['offSet'] === undefined) ? 0 : arrowSettings['properties']['offSet'];
|
|
10337
|
+
const divide = (Math.round(arrowSize / 2));
|
|
10338
|
+
arrowPosition = arrowSettings['properties']['position'];
|
|
10339
|
+
startArrow = (arrowPosition === 'Start') ? 'url(#triangle' + i + ')' : null;
|
|
10340
|
+
endArrow = (arrowPosition === 'End') ? 'url(#triangle' + i + ')' : null;
|
|
10341
|
+
if (offSet !== 0 && angle === 0) {
|
|
10342
|
+
offSet = (arrowPosition === 'Start') ? offSetValue : -(offSetValue);
|
|
10343
|
+
}
|
|
10344
|
+
offSet = (isNullOrUndefined(offSet)) ? 0 : offSet;
|
|
10345
|
+
const triId = this.maps.element.id + '_triangle';
|
|
10346
|
+
const defElement = this.maps.renderer.createDefs();
|
|
10347
|
+
defElement.innerHTML += '<marker id="' + 'triangle' + i + '"></marker>';
|
|
10348
|
+
const markerEle = defElement.querySelector('#' + 'triangle' + i);
|
|
10349
|
+
markerEle.setAttribute('markerWidth', (arrowSize.toString()));
|
|
10350
|
+
markerEle.setAttribute('markerHeight', (arrowSize.toString()));
|
|
10351
|
+
markerEle.setAttribute('refX', (divide - offSet).toString());
|
|
10352
|
+
markerEle.setAttribute('refY', divide.toString());
|
|
10353
|
+
markerEle.setAttribute('orient', 'auto');
|
|
10354
|
+
const d2 = 'M 0,0 L 0,' + arrowSize + ' L ' + divide + ', ' + divide + ' Z';
|
|
10355
|
+
pathOption = new PathOption(triId, arrowColor, width, color, 1, 1, dashArray, d2);
|
|
10356
|
+
navigationEle = this.maps.renderer.drawPath(pathOption);
|
|
10357
|
+
markerEle.appendChild(navigationEle);
|
|
10358
|
+
defElement.appendChild(markerEle);
|
|
10359
|
+
navigationGroup.appendChild(defElement);
|
|
10360
|
+
}
|
|
10361
|
+
angle = Math.abs(angle);
|
|
10362
|
+
d = (angle === 0) ? 'M ' + point[j]['x'] + ',' + point[j]['y'] + 'L ' + point[j + 1]['x']
|
|
10363
|
+
+ ',' + point[j + 1]['y'] + ' ' :
|
|
10364
|
+
'M ' + point[j]['x'] + ',' + point[j]['y'] + ' A ' + (radius / 2 + (1 - angle) * radius / (angle * 10)) +
|
|
10365
|
+
' ' + (radius / 2 + (1 - angle) * radius / (angle * 10)) + ' ' + 0 + ',' + 0 + ','
|
|
10366
|
+
+ direction + ' , ' + point[j + 1]['x'] + ',' + point[j + 1]['y'] + ' ';
|
|
10367
|
+
pathOption = new PathOption(arcId, 'none', width, color, 1, 1, dashArray, d);
|
|
10180
10368
|
navigationEle = this.maps.renderer.drawPath(pathOption);
|
|
10181
|
-
|
|
10182
|
-
|
|
10183
|
-
|
|
10184
|
-
|
|
10185
|
-
|
|
10186
|
-
|
|
10187
|
-
|
|
10188
|
-
|
|
10189
|
-
|
|
10190
|
-
|
|
10191
|
-
pathOption = new PathOption(arcId, 'none', width, color, 1, 1, dashArray, d);
|
|
10192
|
-
navigationEle = this.maps.renderer.drawPath(pathOption);
|
|
10193
|
-
if (!isNullOrUndefined(arrowPosition)) {
|
|
10194
|
-
const position = (arrowPosition === 'Start') ? navigationEle.setAttribute('marker-start', startArrow)
|
|
10195
|
-
: navigationEle.setAttribute('marker-end', endArrow);
|
|
10196
|
-
}
|
|
10197
|
-
maintainSelection(this.maps.selectedNavigationElementId, this.maps.navigationSelectionClass, navigationEle, 'navigationlineselectionMapStyle');
|
|
10198
|
-
navigationGroup.appendChild(navigationEle);
|
|
10199
|
-
group.appendChild(navigationGroup);
|
|
10200
|
-
}
|
|
10201
|
-
point = [];
|
|
10369
|
+
if (!isNullOrUndefined(arrowPosition)) {
|
|
10370
|
+
const position = (arrowPosition === 'Start') ? navigationEle.setAttribute('marker-start', startArrow)
|
|
10371
|
+
: navigationEle.setAttribute('marker-end', endArrow);
|
|
10372
|
+
}
|
|
10373
|
+
maintainSelection(this.maps.selectedNavigationElementId, this.maps.navigationSelectionClass, navigationEle, 'navigationlineselectionMapStyle');
|
|
10374
|
+
navigationGroup.appendChild(navigationEle);
|
|
10375
|
+
group.appendChild(navigationGroup);
|
|
10376
|
+
}
|
|
10377
|
+
point = [];
|
|
10378
|
+
}
|
|
10202
10379
|
}
|
|
10203
10380
|
return group;
|
|
10204
10381
|
}
|
|
@@ -10530,7 +10707,7 @@ class Legend {
|
|
|
10530
10707
|
}
|
|
10531
10708
|
}
|
|
10532
10709
|
else {
|
|
10533
|
-
|
|
10710
|
+
const padding = 10;
|
|
10534
10711
|
shapeX = shapeLocation[j - 1].x;
|
|
10535
10712
|
shapeY = prevPositionY + padding + (shapeHeight / 2);
|
|
10536
10713
|
}
|
|
@@ -10691,7 +10868,7 @@ class Legend {
|
|
|
10691
10868
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10692
10869
|
const collection = this.totalPages[page]['Collection'][i];
|
|
10693
10870
|
const shapeBorder = collection['shapeBorder'];
|
|
10694
|
-
|
|
10871
|
+
const legendElement = render.createGroup({ id: map.element.id + '_Legend_Index_' + collection['idIndex'] });
|
|
10695
10872
|
let legendText = collection['DisplayText'];
|
|
10696
10873
|
const pagingArrowPadding = 4;
|
|
10697
10874
|
const shape = ((legend.type === 'Markers') ? ((isNullOrUndefined(collection['ImageSrc'])) ?
|
|
@@ -10705,15 +10882,16 @@ class Legend {
|
|
|
10705
10882
|
const textId = map.element.id + '_Legend_Text_Index_' + collection['idIndex'];
|
|
10706
10883
|
const shapeLocation = new Point(collection['Shape']['x'], (collection['Shape']['y'] - pagingArrowPadding));
|
|
10707
10884
|
const textLocation = new Point(collection['Text']['x'], (collection['Text']['y'] - pagingArrowPadding));
|
|
10708
|
-
const imageUrl = ((isNullOrUndefined(collection['ImageSrc'])) ? legend.shape : collection['ImageSrc']);
|
|
10709
10885
|
const renderOptions = new PathOption(shapeId, collection['Fill'], strokeWidth, strokeColor, legend.opacity, isNullOrUndefined(shapeBorder.opacity) ? legend.opacity : shapeBorder.opacity, '');
|
|
10710
10886
|
const legendTextStyle = {
|
|
10711
10887
|
fontFamily: legend.textStyle.fontFamily, fontStyle: legend.textStyle.fontStyle,
|
|
10712
|
-
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
|
|
10713
10890
|
};
|
|
10714
10891
|
legendTextStyle.color = (legendTextStyle.color !== null) ? legendTextStyle.color :
|
|
10715
10892
|
this.maps.themeStyle.legendTextColor;
|
|
10716
|
-
legendTextStyle.fontFamily = !isNullOrUndefined(legendTextStyle.fontFamily) ? legendTextStyle.fontFamily :
|
|
10893
|
+
legendTextStyle.fontFamily = !isNullOrUndefined(legendTextStyle.fontFamily) ? legendTextStyle.fontFamily :
|
|
10894
|
+
this.maps.themeStyle.fontFamily;
|
|
10717
10895
|
legendTextStyle.size = map.themeStyle.legendFontSize || legendTextStyle.size;
|
|
10718
10896
|
if (i === 0) {
|
|
10719
10897
|
this.renderLegendBorder();
|
|
@@ -10723,7 +10901,7 @@ class Legend {
|
|
|
10723
10901
|
const marker$$1 = map.layers[legendShapeData['layerIndex']].markerSettings[legendShapeData['markerIndex']];
|
|
10724
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;
|
|
10725
10903
|
}
|
|
10726
|
-
if (legendShape ===
|
|
10904
|
+
if (legendShape === 'Balloon') {
|
|
10727
10905
|
legendElement.appendChild(drawBalloon(map, renderOptions, shapeSize, { x: shapeLocation.x, y: (shapeLocation.y + 5) }, 'Legend'));
|
|
10728
10906
|
}
|
|
10729
10907
|
else {
|
|
@@ -10789,7 +10967,7 @@ class Legend {
|
|
|
10789
10967
|
'opacity': 1,
|
|
10790
10968
|
'dominant-baseline': ''
|
|
10791
10969
|
};
|
|
10792
|
-
|
|
10970
|
+
const pagingTextElement = render.createText(pageTextOptions, pagingText);
|
|
10793
10971
|
pagingTextElement.style.cssText = 'user-select: none;';
|
|
10794
10972
|
pagingGroup.appendChild(pagingTextElement);
|
|
10795
10973
|
this.legendGroup.appendChild(pagingGroup);
|
|
@@ -11201,8 +11379,6 @@ class Legend {
|
|
|
11201
11379
|
}
|
|
11202
11380
|
if (selectionEle && (selectionEle['IsSelected'] && (targetElement.getAttribute('class') === 'ShapeselectionMapStyle'
|
|
11203
11381
|
|| targetElement.getAttribute('class') === 'LineselectionMapStyle'))) {
|
|
11204
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11205
|
-
const element = this.maps.legendSelectionCollection[selectionEle['SelectionIndex']];
|
|
11206
11382
|
let multiSelection = 0;
|
|
11207
11383
|
if (module.enableMultiSelect) {
|
|
11208
11384
|
for (let i = 0; i < shapeElement['Elements'].length; i++) {
|
|
@@ -11461,7 +11637,8 @@ class Legend {
|
|
|
11461
11637
|
const legendTitle = legend.title.text;
|
|
11462
11638
|
const textStyle = {
|
|
11463
11639
|
fontFamily: legend.titleStyle.fontFamily, fontStyle: legend.titleStyle.fontStyle,
|
|
11464
|
-
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
|
|
11465
11642
|
};
|
|
11466
11643
|
let textOptions;
|
|
11467
11644
|
const spacing = 10;
|
|
@@ -11522,7 +11699,8 @@ class Legend {
|
|
|
11522
11699
|
const locationX = !isNullOrUndefined(legend.location.x) ? legend.location.x : 0;
|
|
11523
11700
|
const locationY = !isNullOrUndefined(legend.location.y) ? legend.location.y : 0;
|
|
11524
11701
|
if (legend.position === 'Float') {
|
|
11525
|
-
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);
|
|
11526
11704
|
this.legendTotalRect = map.mapAreaRect;
|
|
11527
11705
|
}
|
|
11528
11706
|
else {
|
|
@@ -11604,7 +11782,8 @@ class Legend {
|
|
|
11604
11782
|
this.getOverallLegendItemsCollection(text, legendFill, newData, showLegend);
|
|
11605
11783
|
}
|
|
11606
11784
|
else {
|
|
11607
|
-
newData.push({ layerIndex: layerIndex, markerIndex: markerIndex, dataIndex: dataIndex, value: legendFill,
|
|
11785
|
+
newData.push({ layerIndex: layerIndex, markerIndex: markerIndex, dataIndex: dataIndex, value: legendFill,
|
|
11786
|
+
name: text,
|
|
11608
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) });
|
|
11609
11788
|
this.getOverallLegendItemsCollection(text, legendFill, newData, showLegend);
|
|
11610
11789
|
}
|
|
@@ -11783,6 +11962,7 @@ class Legend {
|
|
|
11783
11962
|
if (outOfRangeValues.length === 0) {
|
|
11784
11963
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11785
11964
|
let range = false;
|
|
11965
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11786
11966
|
Array.prototype.forEach.call(dataSource, (data, dataIndex) => {
|
|
11787
11967
|
range = false;
|
|
11788
11968
|
const rangeValue = data[colorValuePath];
|
|
@@ -12230,10 +12410,12 @@ class Legend {
|
|
|
12230
12410
|
this.maps.toggledShapeElementId.splice(toggledShapeIdIndex, 1);
|
|
12231
12411
|
}
|
|
12232
12412
|
mapLegendElement.setAttribute('fill-opacity', (this.maps.layers[k].shapeSettings.opacity).toString());
|
|
12233
|
-
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());
|
|
12234
12415
|
mapLegendElement.setAttribute('stroke', this.maps.layers[0].shapeSettings.border.color);
|
|
12235
12416
|
mapLegendElement.setAttribute('stroke-opacity', (isNullOrUndefined(this.maps.layers[k].shapeSettings.border.opacity) ?
|
|
12236
|
-
this.maps.layers[k].shapeSettings.opacity :
|
|
12417
|
+
this.maps.layers[k].shapeSettings.opacity :
|
|
12418
|
+
this.maps.layers[k].shapeSettings.border.opacity).toString());
|
|
12237
12419
|
mapLegendElement.setAttribute('fill', this.legendCollection[legendIndex]['fill']);
|
|
12238
12420
|
if (targetEle !== null) {
|
|
12239
12421
|
legendTextId = querySelector(this.maps.element.id + '_Legend_Index_' + legendIndex + '_Text', this.maps.element.id);
|
|
@@ -12297,7 +12479,7 @@ class Legend {
|
|
|
12297
12479
|
&& isNaN(shapeData['properties'][shapePath]) ?
|
|
12298
12480
|
shapeData['properties'][shapePath].toLowerCase() : shapeData['properties'][shapePath];
|
|
12299
12481
|
if (shapeDataValueCase === dataPathValueCase) {
|
|
12300
|
-
if (shapeData['geometry']['type']
|
|
12482
|
+
if (shapeData['geometry']['type'] !== 'MultiPoint') {
|
|
12301
12483
|
legendData.push({
|
|
12302
12484
|
layerIndex: layerIndex, shapeIndex: i, dataIndex: dataIndex,
|
|
12303
12485
|
name: data[dataPath], value: value, pointIndex: -1
|
|
@@ -12541,7 +12723,9 @@ class Highlight {
|
|
|
12541
12723
|
}
|
|
12542
12724
|
const borderColor = (targetEle.parentElement.id.indexOf('LineString') === -1) ? this.highlightSettings.border.color : (this.highlightSettings.fill || this.highlightSettings.border.color);
|
|
12543
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);
|
|
12544
|
-
const borderOpacity = isNullOrUndefined(this.highlightSettings.border.opacity) ? this.highlightSettings.opacity :
|
|
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
|
|
12545
12729
|
const eventArgs = {
|
|
12546
12730
|
opacity: this.highlightSettings.opacity,
|
|
12547
12731
|
fill: (targetEle.parentElement.id.indexOf('LineString') === -1) ? (targetEle.id.indexOf('NavigationIndex') === -1 ? !isNullOrUndefined(this.highlightSettings.fill)
|
|
@@ -12561,6 +12745,7 @@ class Highlight {
|
|
|
12561
12745
|
maps: this.maps
|
|
12562
12746
|
};
|
|
12563
12747
|
if (targetEle.id.indexOf('shapeIndex') > -1) {
|
|
12748
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
12564
12749
|
this.maps.trigger(shapeHighlight, shapeEventArgs, () => { });
|
|
12565
12750
|
}
|
|
12566
12751
|
const itemEventArgs = {
|
|
@@ -12762,7 +12947,8 @@ class Selection {
|
|
|
12762
12947
|
const isLineStringShape = targetElement.parentElement.id.indexOf('LineString') > -1;
|
|
12763
12948
|
const selectionsettings = this.selectionsettings;
|
|
12764
12949
|
const border = {
|
|
12765
|
-
color: isLineStringShape ? (this.selectionsettings.fill || this.selectionsettings.border.color) :
|
|
12950
|
+
color: isLineStringShape ? (this.selectionsettings.fill || this.selectionsettings.border.color) :
|
|
12951
|
+
this.selectionsettings.border.color,
|
|
12766
12952
|
width: isLineStringShape ? (this.selectionsettings.border.width / this.maps.scale) :
|
|
12767
12953
|
(this.selectionsettings.border.width / (this.selectionType === 'Marker' ? 1 : this.maps.scale)),
|
|
12768
12954
|
opacity: this.selectionsettings.border.opacity
|
|
@@ -12779,7 +12965,8 @@ class Selection {
|
|
|
12779
12965
|
maps: this.maps
|
|
12780
12966
|
};
|
|
12781
12967
|
this.maps.trigger('itemSelection', eventArgs, (observedArgs) => {
|
|
12782
|
-
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;
|
|
12783
12970
|
if (!eventArgs.cancel) {
|
|
12784
12971
|
if (targetElement.getAttribute('class') === this.selectionType + 'selectionMapStyle'
|
|
12785
12972
|
|| targetElement.getAttribute('class') === 'LineselectionMapStyle') {
|
|
@@ -12931,7 +13118,6 @@ class Selection {
|
|
|
12931
13118
|
}
|
|
12932
13119
|
}
|
|
12933
13120
|
|
|
12934
|
-
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
12935
13121
|
/**
|
|
12936
13122
|
* Map Tooltip
|
|
12937
13123
|
*/
|
|
@@ -12963,7 +13149,6 @@ class MapsTooltip {
|
|
|
12963
13149
|
}
|
|
12964
13150
|
let option;
|
|
12965
13151
|
let currentData = '';
|
|
12966
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12967
13152
|
const targetId = target.id;
|
|
12968
13153
|
let tooltipEle;
|
|
12969
13154
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -13112,6 +13297,7 @@ class MapsTooltip {
|
|
|
13112
13297
|
maps: this.maps,
|
|
13113
13298
|
element: target, eventArgs: e, content: !isNullOrUndefined(currentData) ? currentData.toString() : ''
|
|
13114
13299
|
};
|
|
13300
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
13115
13301
|
this.maps.trigger(tooltipRender, tooltipArgs, (args) => {
|
|
13116
13302
|
if (!tooltipArgs.cancel && option.visible && !isNullOrUndefined(currentData) &&
|
|
13117
13303
|
(targetId.indexOf('_cluster_') === -1 && targetId.indexOf('_dataLabel_') === -1)) {
|
|
@@ -13128,7 +13314,8 @@ class MapsTooltip {
|
|
|
13128
13314
|
header: '',
|
|
13129
13315
|
data: option['data'],
|
|
13130
13316
|
template: option['template'],
|
|
13131
|
-
content: tooltipArgs.content.toString()
|
|
13317
|
+
content: tooltipArgs.content.toString() !== currentData.toString() ? [tooltipArgs.content.toString()] :
|
|
13318
|
+
[currentData.toString()],
|
|
13132
13319
|
shapes: [],
|
|
13133
13320
|
location: option['location'],
|
|
13134
13321
|
palette: [markerFill],
|
|
@@ -13144,7 +13331,8 @@ class MapsTooltip {
|
|
|
13144
13331
|
header: '',
|
|
13145
13332
|
data: tooltipArgs.options['data'],
|
|
13146
13333
|
template: tooltipArgs.options['template'],
|
|
13147
|
-
content: tooltipArgs.content.toString()
|
|
13334
|
+
content: tooltipArgs.content.toString() !== currentData.toString() ? [tooltipArgs.content.toString()] :
|
|
13335
|
+
[currentData.toString()],
|
|
13148
13336
|
shapes: [],
|
|
13149
13337
|
location: tooltipArgs.options['location'],
|
|
13150
13338
|
palette: [markerFill],
|
|
@@ -13456,12 +13644,13 @@ class Zoom {
|
|
|
13456
13644
|
}
|
|
13457
13645
|
this.maps.zoomNotApplied = false;
|
|
13458
13646
|
}
|
|
13647
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13459
13648
|
calculateInitalZoomTranslatePoint(newZoomFactor, mapTotalWidth, mapTotalHeight, availSize, minBounds, map) {
|
|
13460
13649
|
mapTotalWidth *= newZoomFactor;
|
|
13461
13650
|
mapTotalHeight *= newZoomFactor;
|
|
13462
|
-
|
|
13463
|
-
|
|
13464
|
-
|
|
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)));
|
|
13465
13654
|
return new Point(translatePointX, translatePointY);
|
|
13466
13655
|
}
|
|
13467
13656
|
triggerZoomEvent(prevTilePoint, prevLevel, type) {
|
|
@@ -13717,7 +13906,7 @@ class Zoom {
|
|
|
13717
13906
|
layerElement.appendChild(maps.navigationLineModule.renderNavigation(this.currentLayer, maps.tileZoomLevel, this.index));
|
|
13718
13907
|
}
|
|
13719
13908
|
}
|
|
13720
|
-
else if (currentEle.id.indexOf('Legend')
|
|
13909
|
+
else if (currentEle.id.indexOf('Legend') === -1) {
|
|
13721
13910
|
changeBorderWidth(currentEle, this.index, scale, maps);
|
|
13722
13911
|
maps.zoomTranslatePoint = maps.translatePoint;
|
|
13723
13912
|
this.animateTransform(currentEle, animate$$1, x, y, scale);
|
|
@@ -13795,7 +13984,6 @@ class Zoom {
|
|
|
13795
13984
|
let childElement;
|
|
13796
13985
|
for (let k = 0; k < currentEle.childElementCount; k++) {
|
|
13797
13986
|
childElement = currentEle.childNodes[k];
|
|
13798
|
-
const bubbleTransform = childElement.getAttribute('transform');
|
|
13799
13987
|
layerIndex = parseFloat(childElement.id.split('_LayerIndex_')[1].split('_')[0]);
|
|
13800
13988
|
const bubleIndex = parseFloat(childElement.id.split('_BubbleIndex_')[1].split('_')[0]);
|
|
13801
13989
|
const dataIndex = parseFloat(childElement.id.split('_BubbleIndex_')[1].split('_')[2]);
|
|
@@ -13824,7 +14012,7 @@ class Zoom {
|
|
|
13824
14012
|
this.intersect = [];
|
|
13825
14013
|
maps.zoomLabelPositions = [];
|
|
13826
14014
|
maps.zoomLabelPositions = maps.dataLabelModule.dataLabelCollections;
|
|
13827
|
-
|
|
14015
|
+
const labelAnimate = !maps.isTileMap && animate$$1;
|
|
13828
14016
|
for (let k = 0; k < currentEle.childElementCount; k++) {
|
|
13829
14017
|
if (currentEle.childNodes[k]['id'].indexOf('_LabelIndex_') > -1) {
|
|
13830
14018
|
const labelIndex = parseFloat(currentEle.childNodes[k]['id'].split('_LabelIndex_')[1].split('_')[0]);
|
|
@@ -13924,7 +14112,6 @@ class Zoom {
|
|
|
13924
14112
|
const markerID = this.maps.element.id + '_LayerIndex_' + layerIndex + '_MarkerIndex_'
|
|
13925
14113
|
+ markerIndex + '_dataIndex_' + dataIndex;
|
|
13926
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);
|
|
13927
|
-
const animate$$1 = currentLayers.animationDuration !== 0 || isNullOrUndefined(this.maps.zoomModule);
|
|
13928
14115
|
const transPoint = { x: x, y: y };
|
|
13929
14116
|
if (eventArgs.template && (!isNaN(location.x) && !isNaN(location.y))) {
|
|
13930
14117
|
markerTemplateCounts++;
|
|
@@ -13993,15 +14180,12 @@ class Zoom {
|
|
|
13993
14180
|
dataLabelTranslate(element, factor, x, y, scale, type, animate$$1 = false) {
|
|
13994
14181
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13995
14182
|
const labelCollection = this.maps.dataLabelModule.dataLabelCollections;
|
|
13996
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13997
|
-
const zoomelement = element.getBoundingClientRect();
|
|
13998
14183
|
let text;
|
|
13999
14184
|
let trimmedLable;
|
|
14000
14185
|
const style = this.maps.layers[this.index].dataLabelSettings.textStyle;
|
|
14001
14186
|
let zoomtext;
|
|
14002
14187
|
let zoomtextSize;
|
|
14003
14188
|
let zoomtrimLabel;
|
|
14004
|
-
const labelPath = this.maps.layers[this.index].dataLabelSettings.labelPath;
|
|
14005
14189
|
const layerIndex = parseFloat(element.id.split('_LayerIndex_')[1].split('_')[0]);
|
|
14006
14190
|
const shapeIndex = parseFloat(element.id.split('_shapeIndex_')[1].split('_')[0]);
|
|
14007
14191
|
let labelIndex;
|
|
@@ -14029,7 +14213,6 @@ class Zoom {
|
|
|
14029
14213
|
const layerEle = getElementByID(this.maps.element.id + '_Layer_Collections');
|
|
14030
14214
|
labelX = ((Math.abs(this.maps.baseMapRectBounds['min']['x'] - labelX)) * scale);
|
|
14031
14215
|
labelY = ((Math.abs(this.maps.baseMapRectBounds['min']['y'] - labelY)) * scale);
|
|
14032
|
-
const templateOffset = element.getBoundingClientRect();
|
|
14033
14216
|
const layerOffset = layerEle.getBoundingClientRect();
|
|
14034
14217
|
const elementOffset = element.parentElement.getBoundingClientRect();
|
|
14035
14218
|
locationX = ((labelX) + (layerOffset.left - elementOffset.left));
|
|
@@ -14226,6 +14409,11 @@ class Zoom {
|
|
|
14226
14409
|
}
|
|
14227
14410
|
}
|
|
14228
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}
|
|
14229
14417
|
* @private
|
|
14230
14418
|
*/
|
|
14231
14419
|
panning(direction, xDifference, yDifference, mouseLocation) {
|
|
@@ -14689,7 +14877,7 @@ class Zoom {
|
|
|
14689
14877
|
}
|
|
14690
14878
|
break;
|
|
14691
14879
|
}
|
|
14692
|
-
|
|
14880
|
+
const extraPosition = map.getExtraPosition();
|
|
14693
14881
|
element.style.left = x + extraPosition.x + 'px';
|
|
14694
14882
|
element.style.top = y + extraPosition.y + 'px';
|
|
14695
14883
|
const color = this.maps.zoomSettings.highlightColor || this.maps.themeStyle.zoomSelectionColor;
|
|
@@ -15020,7 +15208,6 @@ class Zoom {
|
|
|
15020
15208
|
}
|
|
15021
15209
|
}
|
|
15022
15210
|
|
|
15023
|
-
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
15024
15211
|
/**
|
|
15025
15212
|
* This module enables the print functionality in maps.
|
|
15026
15213
|
*
|
|
@@ -15030,18 +15217,20 @@ class Print {
|
|
|
15030
15217
|
/**
|
|
15031
15218
|
* Constructor for Maps
|
|
15032
15219
|
*
|
|
15033
|
-
* @param {Maps} control - Specifies the instance of the
|
|
15220
|
+
* @param {Maps} control - Specifies the instance of the Maps
|
|
15034
15221
|
*/
|
|
15222
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-empty-function
|
|
15035
15223
|
constructor(control) { }
|
|
15036
15224
|
/**
|
|
15037
15225
|
* To print the Maps
|
|
15038
15226
|
*
|
|
15039
|
-
* @param {
|
|
15227
|
+
* @param {Maps} maps -Specifies the Maps instance.
|
|
15228
|
+
* @param {string[] | string | Element} elements - Specifies the element of the Maps
|
|
15040
15229
|
* @returns {void}
|
|
15041
15230
|
* @private
|
|
15042
15231
|
*/
|
|
15043
15232
|
print(maps, elements) {
|
|
15044
|
-
|
|
15233
|
+
const printWindow = window.open('', 'print', 'height=' + window.outerHeight + ',width=' + window.outerWidth + ',tabbar=no');
|
|
15045
15234
|
printWindow.moveTo(0, 0);
|
|
15046
15235
|
printWindow.resizeTo(screen.availWidth, screen.availHeight);
|
|
15047
15236
|
const argsData = {
|
|
@@ -15056,13 +15245,14 @@ class Print {
|
|
|
15056
15245
|
/**
|
|
15057
15246
|
* To get the html string of the Maps
|
|
15058
15247
|
*
|
|
15248
|
+
* @param {Maps} maps -Specifies the Maps instance.
|
|
15059
15249
|
* @param {string[] | string | Element} elements - Specifies the html element
|
|
15060
15250
|
* @returns {Element} - Returns the div element
|
|
15061
15251
|
* @private
|
|
15062
15252
|
*/
|
|
15063
15253
|
getHTMLContent(maps, elements) {
|
|
15064
|
-
|
|
15065
|
-
|
|
15254
|
+
const div = createElement('div');
|
|
15255
|
+
const divElement = maps.element.cloneNode(true);
|
|
15066
15256
|
if (maps.isTileMap) {
|
|
15067
15257
|
for (let i = 0; i < divElement.childElementCount; i++) {
|
|
15068
15258
|
if (divElement.children[i].id === maps.element.id + '_tile_parent') {
|
|
@@ -15115,10 +15305,10 @@ class Print {
|
|
|
15115
15305
|
* @returns {void}
|
|
15116
15306
|
* @private
|
|
15117
15307
|
*/
|
|
15308
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
15118
15309
|
destroy() { }
|
|
15119
15310
|
}
|
|
15120
15311
|
|
|
15121
|
-
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
15122
15312
|
/**
|
|
15123
15313
|
* This module enables the export to Image functionality in Maps control.
|
|
15124
15314
|
*
|
|
@@ -15130,19 +15320,21 @@ class ImageExport {
|
|
|
15130
15320
|
*
|
|
15131
15321
|
* @param {Maps} control - Specifies the instance of the map
|
|
15132
15322
|
*/
|
|
15323
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-empty-function
|
|
15133
15324
|
constructor(control) {
|
|
15134
15325
|
}
|
|
15135
15326
|
/**
|
|
15136
15327
|
* To export the file as image/svg format
|
|
15137
15328
|
*
|
|
15138
|
-
* @param {
|
|
15139
|
-
* @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.
|
|
15140
15332
|
* @param {boolean} allowDownload - Specifies whether to download image as a file or not.
|
|
15141
|
-
* @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.
|
|
15142
15334
|
* @private
|
|
15143
15335
|
*/
|
|
15144
15336
|
export(maps, type, fileName, allowDownload) {
|
|
15145
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
15337
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars
|
|
15146
15338
|
const promise = new Promise((resolve, reject) => {
|
|
15147
15339
|
const imageCanvasElement = createElement('canvas', {
|
|
15148
15340
|
id: 'ej2-canvas',
|
|
@@ -15152,11 +15344,10 @@ class ImageExport {
|
|
|
15152
15344
|
}
|
|
15153
15345
|
});
|
|
15154
15346
|
const isDownload = !(Browser.userAgent.toString().indexOf('HeadlessChrome') > -1);
|
|
15155
|
-
const toolbarEle = document.getElementById(maps.element.id + '_ToolBar');
|
|
15156
15347
|
const svgParent = document.getElementById(maps.element.id + '_Tile_SVG_Parent');
|
|
15157
15348
|
let svgDataElement;
|
|
15158
15349
|
let tileSvg;
|
|
15159
|
-
|
|
15350
|
+
const svgObject = getElementByID(maps.element.id + '_svg').cloneNode(true);
|
|
15160
15351
|
if (!maps.isTileMap) {
|
|
15161
15352
|
svgDataElement = '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">' +
|
|
15162
15353
|
maps.svgObject.outerHTML + '</svg>';
|
|
@@ -15199,8 +15390,8 @@ class ImageExport {
|
|
|
15199
15390
|
}
|
|
15200
15391
|
else {
|
|
15201
15392
|
const svgParentElement = document.getElementById(maps.element.id + '_MapAreaBorder');
|
|
15202
|
-
|
|
15203
|
-
|
|
15393
|
+
const top = parseFloat(svgParentElement.getAttribute('y'));
|
|
15394
|
+
const left = parseFloat(svgParentElement.getAttribute('x'));
|
|
15204
15395
|
const imgxHttp = new XMLHttpRequest();
|
|
15205
15396
|
const imgTileLength = maps.mapLayerPanel.tiles.length;
|
|
15206
15397
|
for (let i = 0; i <= imgTileLength + 1; i++) {
|
|
@@ -15210,7 +15401,7 @@ class ImageExport {
|
|
|
15210
15401
|
ctxt.fillStyle = maps.background ? maps.background : '#FFFFFF';
|
|
15211
15402
|
ctxt.fillRect(0, 0, maps.availableSize.width, maps.availableSize.height);
|
|
15212
15403
|
ctxt.font = maps.titleSettings.textStyle.size + ' Arial';
|
|
15213
|
-
|
|
15404
|
+
const titleElement = document.getElementById(maps.element.id + '_Map_title');
|
|
15214
15405
|
if (!isNullOrUndefined(titleElement)) {
|
|
15215
15406
|
ctxt.fillStyle = titleElement.getAttribute('fill');
|
|
15216
15407
|
ctxt.fillText(maps.titleSettings.text, parseFloat(titleElement.getAttribute('x')), parseFloat(titleElement.getAttribute('y')));
|
|
@@ -15283,10 +15474,10 @@ class ImageExport {
|
|
|
15283
15474
|
* @returns {void}
|
|
15284
15475
|
* @private
|
|
15285
15476
|
*/
|
|
15477
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-empty-function
|
|
15286
15478
|
destroy() { }
|
|
15287
15479
|
}
|
|
15288
15480
|
|
|
15289
|
-
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
15290
15481
|
/**
|
|
15291
15482
|
* This module enables the export to PDF functionality in Maps control.
|
|
15292
15483
|
*
|
|
@@ -15296,17 +15487,18 @@ class PdfExport {
|
|
|
15296
15487
|
/**
|
|
15297
15488
|
* Constructor for Maps
|
|
15298
15489
|
*
|
|
15299
|
-
* @param {Maps} control Specifies the instance of the map
|
|
15300
15490
|
*/
|
|
15491
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-empty-function
|
|
15301
15492
|
constructor() { }
|
|
15302
15493
|
/**
|
|
15303
15494
|
* To export the file as image/svg format
|
|
15304
15495
|
*
|
|
15305
|
-
* @param {
|
|
15306
|
-
* @param {
|
|
15307
|
-
* @param {
|
|
15308
|
-
* @param {
|
|
15309
|
-
* @
|
|
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.
|
|
15310
15502
|
* @private
|
|
15311
15503
|
*/
|
|
15312
15504
|
export(maps, type, fileName, allowDownload, orientation) {
|
|
@@ -15356,8 +15548,8 @@ class PdfExport {
|
|
|
15356
15548
|
}
|
|
15357
15549
|
else {
|
|
15358
15550
|
const svgParentElement = document.getElementById(maps.element.id + '_MapAreaBorder');
|
|
15359
|
-
|
|
15360
|
-
|
|
15551
|
+
const top = parseFloat(svgParentElement.getAttribute('y'));
|
|
15552
|
+
const left = parseFloat(svgParentElement.getAttribute('x'));
|
|
15361
15553
|
const xHttp = new XMLHttpRequest();
|
|
15362
15554
|
const tileLength = maps.mapLayerPanel.tiles.length;
|
|
15363
15555
|
for (let i = 0; i <= tileLength + 1; i++) {
|
|
@@ -15367,7 +15559,7 @@ class PdfExport {
|
|
|
15367
15559
|
ctx.fillStyle = maps.background ? maps.background : '#FFFFFF';
|
|
15368
15560
|
ctx.fillRect(0, 0, maps.availableSize.width, maps.availableSize.height);
|
|
15369
15561
|
ctx.font = maps.titleSettings.textStyle.size + ' Arial';
|
|
15370
|
-
|
|
15562
|
+
const titleElement = document.getElementById(maps.element.id + '_Map_title');
|
|
15371
15563
|
if (!isNullOrUndefined(titleElement)) {
|
|
15372
15564
|
ctx.fillStyle = titleElement.getAttribute('fill');
|
|
15373
15565
|
ctx.fillText(maps.titleSettings.text, parseFloat(titleElement.getAttribute('x')), parseFloat(titleElement.getAttribute('y')));
|
|
@@ -15410,7 +15602,7 @@ class PdfExport {
|
|
|
15410
15602
|
}
|
|
15411
15603
|
else {
|
|
15412
15604
|
setTimeout(() => {
|
|
15413
|
-
|
|
15605
|
+
const tileSvg = document.getElementById(maps.element.id + '_Tile_SVG');
|
|
15414
15606
|
tileImg.src = window.URL.createObjectURL(new Blob([(new XMLSerializer()).serializeToString(tileSvg)], { type: 'image/svg+xml' }));
|
|
15415
15607
|
}, 300);
|
|
15416
15608
|
}
|
|
@@ -15439,6 +15631,7 @@ class PdfExport {
|
|
|
15439
15631
|
* @returns {void}
|
|
15440
15632
|
* @private
|
|
15441
15633
|
*/
|
|
15634
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-empty-function
|
|
15442
15635
|
destroy() { }
|
|
15443
15636
|
}
|
|
15444
15637
|
|