@syncfusion/ej2-maps 23.2.7 → 24.1.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -1
- 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 +1041 -747
- package/dist/es6/ej2-maps.es2015.js.map +1 -1
- package/dist/es6/ej2-maps.es5.js +1066 -757
- 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 +13 -13
- package/src/global.js +1 -1
- package/src/maps/index.d.ts +1 -0
- package/src/maps/index.js +1 -0
- package/src/maps/layers/layer-panel.js +14 -3
- package/src/maps/layers/legend.js +1 -1
- package/src/maps/layers/marker.js +21 -19
- package/src/maps/layers/polygon.d.ts +31 -0
- package/src/maps/layers/polygon.js +58 -0
- package/src/maps/maps-model.d.ts +1 -1
- package/src/maps/maps.d.ts +25 -1
- package/src/maps/maps.js +79 -15
- package/src/maps/model/base-model.d.ts +103 -25
- package/src/maps/model/base.d.ts +72 -7
- package/src/maps/model/base.js +53 -0
- package/src/maps/model/interface.d.ts +24 -3
- package/src/maps/user-interaction/highlight.js +6 -0
- package/src/maps/user-interaction/selection.js +13 -0
- package/src/maps/user-interaction/tooltip.js +13 -21
- package/src/maps/user-interaction/zoom.js +78 -16
- package/src/maps/utils/helper.d.ts +18 -0
- package/src/maps/utils/helper.js +54 -4
|
@@ -199,6 +199,25 @@ function convertGeoToPoint(latitude, longitude, factor, layer, mapModel) {
|
|
|
199
199
|
}
|
|
200
200
|
return new Point(x, y);
|
|
201
201
|
}
|
|
202
|
+
/**
|
|
203
|
+
* @private
|
|
204
|
+
*/
|
|
205
|
+
function calculatePolygonPath(maps, factor, currentLayer, markerData) {
|
|
206
|
+
let path = '';
|
|
207
|
+
Array.prototype.forEach.call(markerData, (data, dataIndex) => {
|
|
208
|
+
let lat = data.latitude;
|
|
209
|
+
let lng = data.longitude;
|
|
210
|
+
let location = (maps.isTileMap) ? convertTileLatLongToPoint(new MapLocation(lng, lat), factor, maps.tileTranslatePoint, true) : convertGeoToPoint(lat, lng, factor, currentLayer, maps);
|
|
211
|
+
if (dataIndex === 0) {
|
|
212
|
+
path += 'M ' + location.x + ' ' + location.y;
|
|
213
|
+
}
|
|
214
|
+
else {
|
|
215
|
+
path += ' L ' + location.x + ' ' + location.y;
|
|
216
|
+
}
|
|
217
|
+
});
|
|
218
|
+
path += ' z ';
|
|
219
|
+
return path;
|
|
220
|
+
}
|
|
202
221
|
/**
|
|
203
222
|
* Converting tile latitude and longitude to point
|
|
204
223
|
*
|
|
@@ -340,6 +359,15 @@ class Point {
|
|
|
340
359
|
this.y = y;
|
|
341
360
|
}
|
|
342
361
|
}
|
|
362
|
+
/**
|
|
363
|
+
* Defines the latitude and longitude values that define a map location.
|
|
364
|
+
*/
|
|
365
|
+
class Coordinate {
|
|
366
|
+
constructor(latitude, longitude) {
|
|
367
|
+
this.latitude = latitude;
|
|
368
|
+
this.longitude = longitude;
|
|
369
|
+
}
|
|
370
|
+
}
|
|
343
371
|
/**
|
|
344
372
|
* Map internal class for min and max
|
|
345
373
|
*
|
|
@@ -1059,12 +1087,24 @@ function clusterTemplate(currentLayer, markerTemplate, maps, layerIndex, markerC
|
|
|
1059
1087
|
getElementByID(maps.element.id + '_Secondary_Element').appendChild(markerCollection);
|
|
1060
1088
|
}
|
|
1061
1089
|
const element = document.getElementById(maps.element.id + '_LayerIndex_' + layerIndex + '_Polygon_Group');
|
|
1062
|
-
|
|
1090
|
+
const polygonElement = document.getElementById(maps.element.id + '_LayerIndex_' + layerIndex + '_Polygons_Group');
|
|
1091
|
+
if (isNullOrUndefined(element) && !maps.isTileMap) {
|
|
1063
1092
|
layerElement.insertBefore(markerCollection, layerElement.firstChild);
|
|
1064
1093
|
}
|
|
1065
|
-
else {
|
|
1094
|
+
else if (!maps.isTileMap) {
|
|
1066
1095
|
layerElement.appendChild(markerCollection);
|
|
1067
1096
|
}
|
|
1097
|
+
else {
|
|
1098
|
+
if (!isNullOrUndefined(polygonElement)) {
|
|
1099
|
+
polygonElement.insertAdjacentElement('afterend', markerCollection);
|
|
1100
|
+
}
|
|
1101
|
+
else if (!isNullOrUndefined(element)) {
|
|
1102
|
+
element.insertAdjacentElement('afterend', markerCollection);
|
|
1103
|
+
}
|
|
1104
|
+
else {
|
|
1105
|
+
layerElement.insertBefore(markerCollection, layerElement.firstChild);
|
|
1106
|
+
}
|
|
1107
|
+
}
|
|
1068
1108
|
const markerCluster = document.getElementById(maps.element.id + '_LayerIndex_' + layerIndex + '_markerCluster');
|
|
1069
1109
|
if (!isNullOrUndefined(markerCluster)) {
|
|
1070
1110
|
markerCluster.remove();
|
|
@@ -1596,7 +1636,7 @@ function drawBalloon(maps, options, size, location, type, element) {
|
|
|
1596
1636
|
const height = size.height;
|
|
1597
1637
|
let pathElement;
|
|
1598
1638
|
location.x -= width / 2;
|
|
1599
|
-
location.y -= height / 2;
|
|
1639
|
+
location.y -= ((options.id.indexOf('cluster') > -1) ? (height / 2) : options.id.indexOf('Legend') > -1 ? height / 1.25 : height);
|
|
1600
1640
|
options.d = 'M15,0C8.8,0,3.8,5,3.8,11.2C3.8,17.5,9.4,24.4,15,30c5.6-5.6,11.2-12.5,11.2-18.8C26.2,5,21.2,0,15,0z M15,16' +
|
|
1601
1641
|
'c-2.8,0-5-2.2-5-5s2.2-5,5-5s5,2.2,5,5S17.8,16,15,16z';
|
|
1602
1642
|
const balloon = maps.renderer.drawPath(options);
|
|
@@ -2002,7 +2042,8 @@ function getTranslate(mapObject, layer, animate) {
|
|
|
2002
2042
|
const topPosition = (((mapHeight + Math.abs(mapObject.mapAreaRect.height - mapHeight)) / 2) + mapObject.mapAreaRect.y) / factor;
|
|
2003
2043
|
const point = checkMethodeZoom ? calculateCenterFromPixel(mapObject, layer) :
|
|
2004
2044
|
convertGeoToPoint(centerLatitude, centerLongitude, mapObject.mapLayerPanel.calculateFactor(layer), layer, mapObject);
|
|
2005
|
-
if (isNullOrUndefined(mapObject.previousProjection) || mapObject.previousProjection !== mapObject.projectionType
|
|
2045
|
+
if (isNullOrUndefined(mapObject.previousProjection) || mapObject.previousProjection !== mapObject.projectionType
|
|
2046
|
+
|| mapObject.isMarkerZoomCompleted) {
|
|
2006
2047
|
x = -point.x + leftPosition;
|
|
2007
2048
|
y = -point.y + topPosition;
|
|
2008
2049
|
scaleFactor = zoomFactor;
|
|
@@ -2970,6 +3011,13 @@ function changeBorderWidth(element, index, scale, maps) {
|
|
|
2970
3011
|
if (childNode.id.indexOf('_NavigationGroup') > -1) {
|
|
2971
3012
|
changeNavaigationLineWidth(childNode, index, scale, maps);
|
|
2972
3013
|
}
|
|
3014
|
+
else if (childNode.id.indexOf('_Polygons_Group') > -1) {
|
|
3015
|
+
for (var i = 0; i < childNode.childElementCount; i++) {
|
|
3016
|
+
// eslint-disable-next-line
|
|
3017
|
+
const width = maps.layersCollection[index].polygonSettings.polygons[parseInt(childNode.children[i].id.split('_PolygonIndex_')[1])].borderWidth;
|
|
3018
|
+
childNode.children[i].setAttribute('stroke-width', (width / scale).toString());
|
|
3019
|
+
}
|
|
3020
|
+
}
|
|
2973
3021
|
else {
|
|
2974
3022
|
let currentStroke;
|
|
2975
3023
|
let value = 0;
|
|
@@ -4412,6 +4460,44 @@ __decorate$1([
|
|
|
4412
4460
|
__decorate$1([
|
|
4413
4461
|
Complex({ color: 'transparent', width: 0 }, Border)
|
|
4414
4462
|
], HighlightSettings.prototype, "border", void 0);
|
|
4463
|
+
/**
|
|
4464
|
+
* Defines the properties for a single polygon shape to render over the Maps, such as coordinates, fill, border, and opacity.
|
|
4465
|
+
*/
|
|
4466
|
+
class PolygonSetting extends ChildProperty {
|
|
4467
|
+
}
|
|
4468
|
+
__decorate$1([
|
|
4469
|
+
Property(1)
|
|
4470
|
+
], PolygonSetting.prototype, "borderWidth", void 0);
|
|
4471
|
+
__decorate$1([
|
|
4472
|
+
Property(1)
|
|
4473
|
+
], PolygonSetting.prototype, "borderOpacity", void 0);
|
|
4474
|
+
__decorate$1([
|
|
4475
|
+
Property(1)
|
|
4476
|
+
], PolygonSetting.prototype, "opacity", void 0);
|
|
4477
|
+
__decorate$1([
|
|
4478
|
+
Property('#FF471A')
|
|
4479
|
+
], PolygonSetting.prototype, "borderColor", void 0);
|
|
4480
|
+
__decorate$1([
|
|
4481
|
+
Property('#FF471A')
|
|
4482
|
+
], PolygonSetting.prototype, "fill", void 0);
|
|
4483
|
+
__decorate$1([
|
|
4484
|
+
Property([])
|
|
4485
|
+
], PolygonSetting.prototype, "points", void 0);
|
|
4486
|
+
/**
|
|
4487
|
+
* Defines the properties of the polygon shapes that will be rendered on a map layer.
|
|
4488
|
+
* The selection and highlight settings for polygon shapes can also be defined.
|
|
4489
|
+
*/
|
|
4490
|
+
class PolygonSettings extends ChildProperty {
|
|
4491
|
+
}
|
|
4492
|
+
__decorate$1([
|
|
4493
|
+
Collection([], PolygonSetting)
|
|
4494
|
+
], PolygonSettings.prototype, "polygons", void 0);
|
|
4495
|
+
__decorate$1([
|
|
4496
|
+
Complex({}, SelectionSettings)
|
|
4497
|
+
], PolygonSettings.prototype, "selectionSettings", void 0);
|
|
4498
|
+
__decorate$1([
|
|
4499
|
+
Complex({}, HighlightSettings)
|
|
4500
|
+
], PolygonSettings.prototype, "highlightSettings", void 0);
|
|
4415
4501
|
/**
|
|
4416
4502
|
* Gets or sets the options to customize the navigation lines in maps which is used to connect different locations.
|
|
4417
4503
|
*/
|
|
@@ -4965,6 +5051,9 @@ __decorate$1([
|
|
|
4965
5051
|
__decorate$1([
|
|
4966
5052
|
Collection([], NavigationLineSettings)
|
|
4967
5053
|
], LayerSettings.prototype, "navigationLineSettings", void 0);
|
|
5054
|
+
__decorate$1([
|
|
5055
|
+
Complex({}, PolygonSettings)
|
|
5056
|
+
], LayerSettings.prototype, "polygonSettings", void 0);
|
|
4968
5057
|
__decorate$1([
|
|
4969
5058
|
Complex({}, TooltipSettings)
|
|
4970
5059
|
], LayerSettings.prototype, "tooltipSettings", void 0);
|
|
@@ -5007,498 +5096,7 @@ __decorate$1([
|
|
|
5007
5096
|
], MapsAreaSettings.prototype, "border", void 0);
|
|
5008
5097
|
|
|
5009
5098
|
/**
|
|
5010
|
-
*
|
|
5011
|
-
*/
|
|
5012
|
-
class Marker {
|
|
5013
|
-
constructor(maps) {
|
|
5014
|
-
this.maps = maps;
|
|
5015
|
-
this.trackElements = [];
|
|
5016
|
-
this.sameMarkerData = [];
|
|
5017
|
-
}
|
|
5018
|
-
markerRender(maps, layerElement, layerIndex, factor, type) {
|
|
5019
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5020
|
-
let templateFn;
|
|
5021
|
-
let markerCount = 0;
|
|
5022
|
-
let nullCount = 0;
|
|
5023
|
-
let markerTemplateCount = 0;
|
|
5024
|
-
maps.translateType = 'marker';
|
|
5025
|
-
const currentLayer = maps.layersCollection[layerIndex];
|
|
5026
|
-
this.markerSVGObject = maps.renderer.createGroup({
|
|
5027
|
-
id: maps.element.id + '_Markers_Group',
|
|
5028
|
-
class: 'GroupElement'
|
|
5029
|
-
});
|
|
5030
|
-
this.markerSVGObject.style.pointerEvents = 'auto';
|
|
5031
|
-
const markerTemplateEle = createElement('div', {
|
|
5032
|
-
id: maps.element.id + '_LayerIndex_' + layerIndex + '_Markers_Template_Group',
|
|
5033
|
-
className: maps.element.id + '_template'
|
|
5034
|
-
});
|
|
5035
|
-
markerTemplateEle.style.cssText = 'overflow: hidden; position: absolute;pointer-events: none;' +
|
|
5036
|
-
'top:' + maps.mapAreaRect.y + 'px;' +
|
|
5037
|
-
'left:' + maps.mapAreaRect.x + 'px;' +
|
|
5038
|
-
'height:' + maps.mapAreaRect.height + 'px;' +
|
|
5039
|
-
'width:' + maps.mapAreaRect.width + 'px;';
|
|
5040
|
-
currentLayer.markerSettings.map((markerSettings, markerIndex) => {
|
|
5041
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5042
|
-
const markerData = markerSettings.dataSource;
|
|
5043
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5044
|
-
Array.prototype.forEach.call(markerData, (data, dataIndex) => {
|
|
5045
|
-
maps.markerNullCount = markerIndex > 0 && dataIndex === 0 ? 0 : maps.markerNullCount;
|
|
5046
|
-
let eventArgs = {
|
|
5047
|
-
cancel: false, name: markerRendering, fill: markerSettings.fill, height: markerSettings.height,
|
|
5048
|
-
width: markerSettings.width, imageUrl: markerSettings.imageUrl, shape: markerSettings.shape,
|
|
5049
|
-
template: markerSettings.template, data: data, maps: maps, marker: markerSettings,
|
|
5050
|
-
border: markerSettings.border, colorValuePath: markerSettings.colorValuePath,
|
|
5051
|
-
shapeValuePath: markerSettings.shapeValuePath, imageUrlValuePath: markerSettings.imageUrlValuePath
|
|
5052
|
-
};
|
|
5053
|
-
maps.trigger('markerRendering', eventArgs, (MarkerArgs) => {
|
|
5054
|
-
eventArgs = markerColorChoose(eventArgs, data);
|
|
5055
|
-
eventArgs = markerShapeChoose(eventArgs, data);
|
|
5056
|
-
const lng = (!isNullOrUndefined(markerSettings.longitudeValuePath)) ?
|
|
5057
|
-
Number(getValueFromObject(data, markerSettings.longitudeValuePath)) : !isNullOrUndefined(data['longitude']) ?
|
|
5058
|
-
parseFloat(data['longitude']) : !isNullOrUndefined(data['Longitude']) ? parseFloat(data['Longitude']) : null;
|
|
5059
|
-
const lat = (!isNullOrUndefined(markerSettings.latitudeValuePath)) ?
|
|
5060
|
-
Number(getValueFromObject(data, markerSettings.latitudeValuePath)) : !isNullOrUndefined(data['latitude']) ?
|
|
5061
|
-
parseFloat(data['latitude']) : !isNullOrUndefined(data['Latitude']) ? parseFloat(data['Latitude']) : null;
|
|
5062
|
-
const offset = markerSettings.offset;
|
|
5063
|
-
if (!eventArgs.cancel && markerSettings.visible && !isNullOrUndefined(lng) && !isNullOrUndefined(lat)) {
|
|
5064
|
-
const markerID = maps.element.id + '_LayerIndex_' + layerIndex + '_MarkerIndex_'
|
|
5065
|
-
+ markerIndex + '_dataIndex_' + dataIndex;
|
|
5066
|
-
let location = (maps.isTileMap) ? convertTileLatLongToPoint(new MapLocation(lng, lat), factor, maps.tileTranslatePoint, true) : convertGeoToPoint(lat, lng, factor, currentLayer, maps);
|
|
5067
|
-
const animate$$1 = (currentLayer.animationDuration !== 0 || animationMode === 'Enable') || isNullOrUndefined(maps.zoomModule);
|
|
5068
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5069
|
-
const translate = (maps.isTileMap) ? (currentLayer.type === 'SubLayer' && isNullOrUndefined(maps.zoomModule)) ? location = convertTileLatLongToPoint(new MapLocation(lng, lat), maps.tileZoomLevel, maps.tileTranslatePoint, true) : new Object() :
|
|
5070
|
-
!isNullOrUndefined(maps.zoomModule) && maps.zoomSettings.zoomFactor > 1 ?
|
|
5071
|
-
getZoomTranslate(maps, currentLayer, animate$$1) :
|
|
5072
|
-
getTranslate(maps, currentLayer, animate$$1);
|
|
5073
|
-
const scale = type === 'AddMarker' ? maps.scale : translate['scale'];
|
|
5074
|
-
const transPoint = type === 'AddMarker' ? maps.translatePoint : translate['location'];
|
|
5075
|
-
if (eventArgs.template && (!isNaN(location.x) && !isNaN(location.y))) {
|
|
5076
|
-
markerTemplateCount++;
|
|
5077
|
-
markerTemplate(eventArgs, templateFn, markerID, data, markerIndex, markerTemplateEle, location, transPoint, scale, offset, maps);
|
|
5078
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5079
|
-
maps.renderReactTemplates();
|
|
5080
|
-
}
|
|
5081
|
-
else if (!eventArgs.template && (!isNaN(location.x) && !isNaN(location.y))) {
|
|
5082
|
-
markerCount++;
|
|
5083
|
-
marker(eventArgs, markerSettings, markerData, dataIndex, location, transPoint, markerID, offset, scale, maps, this.markerSVGObject);
|
|
5084
|
-
}
|
|
5085
|
-
}
|
|
5086
|
-
nullCount += (!isNaN(lat) && !isNaN(lng)) ? 0 : 1;
|
|
5087
|
-
markerTemplateCount += (eventArgs.cancel) ? 1 : 0;
|
|
5088
|
-
markerCount += (eventArgs.cancel) ? 1 : 0;
|
|
5089
|
-
maps.markerNullCount = (isNullOrUndefined(lng) || isNullOrUndefined(lat)) ?
|
|
5090
|
-
maps.markerNullCount + 1 : maps.markerNullCount;
|
|
5091
|
-
const markerDataLength = markerData.length - maps.markerNullCount;
|
|
5092
|
-
if (this.markerSVGObject.childElementCount === (markerDataLength - markerTemplateCount - nullCount) && (type !== 'Template')) {
|
|
5093
|
-
layerElement.appendChild(this.markerSVGObject);
|
|
5094
|
-
if (currentLayer.markerClusterSettings.allowClustering) {
|
|
5095
|
-
maps.svgObject.appendChild(this.markerSVGObject);
|
|
5096
|
-
maps.element.appendChild(maps.svgObject);
|
|
5097
|
-
if ((currentLayer.layerType === 'OSM' || (currentLayer.urlTemplate.indexOf('openstreetmap') !== -1 && isNullOrUndefined(currentLayer.shapeData)))
|
|
5098
|
-
&& maps.zoomSettings.enable) {
|
|
5099
|
-
clusterTemplate(currentLayer, this.markerSVGObject, maps, layerIndex, this.markerSVGObject, layerElement, true, false);
|
|
5100
|
-
layerElement.appendChild(this.markerSVGObject);
|
|
5101
|
-
}
|
|
5102
|
-
else {
|
|
5103
|
-
clusterTemplate(currentLayer, this.markerSVGObject, maps, layerIndex, this.markerSVGObject, layerElement, true, false);
|
|
5104
|
-
}
|
|
5105
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5106
|
-
maps.renderReactTemplates();
|
|
5107
|
-
}
|
|
5108
|
-
}
|
|
5109
|
-
if (markerTemplateEle.childElementCount === (markerDataLength - markerCount - nullCount) && getElementByID(maps.element.id + '_Secondary_Element')) {
|
|
5110
|
-
getElementByID(maps.element.id + '_Secondary_Element').appendChild(markerTemplateEle);
|
|
5111
|
-
if (maps.checkInitialRender) {
|
|
5112
|
-
if (currentLayer.markerClusterSettings.allowClustering) {
|
|
5113
|
-
clusterTemplate(currentLayer, markerTemplateEle, maps, layerIndex, this.markerSVGObject, layerElement, false, false);
|
|
5114
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5115
|
-
maps.renderReactTemplates();
|
|
5116
|
-
}
|
|
5117
|
-
}
|
|
5118
|
-
}
|
|
5119
|
-
});
|
|
5120
|
-
});
|
|
5121
|
-
});
|
|
5122
|
-
}
|
|
5123
|
-
/**
|
|
5124
|
-
* To find zoom level for individual layers like India, USA.
|
|
5125
|
-
*
|
|
5126
|
-
* @param {number} mapWidth - Specifies the width of the maps
|
|
5127
|
-
* @param {number} mapHeight - Specifies the height of the maps
|
|
5128
|
-
* @param {number} maxZoomFact - Specifies the maximum zoom factor
|
|
5129
|
-
* @returns {number} - Returns the scale factor
|
|
5130
|
-
*/
|
|
5131
|
-
calculateIndividualLayerMarkerZoomLevel(mapWidth, mapHeight, maxZoomFact) {
|
|
5132
|
-
let latZoom;
|
|
5133
|
-
let lngZoom;
|
|
5134
|
-
const height = Math.abs(this.maps.baseMapBounds.latitude.max - this.maps.baseMapBounds.latitude.min);
|
|
5135
|
-
const width = Math.abs(this.maps.baseMapBounds.longitude.max - this.maps.baseMapBounds.longitude.min);
|
|
5136
|
-
latZoom = Math.floor(Math.log(mapHeight / height));
|
|
5137
|
-
latZoom = (latZoom > maxZoomFact) ? maxZoomFact : latZoom;
|
|
5138
|
-
lngZoom = Math.floor(Math.log(mapWidth / width));
|
|
5139
|
-
lngZoom = (lngZoom > maxZoomFact) ? maxZoomFact : lngZoom;
|
|
5140
|
-
const result = Math.min(latZoom, lngZoom);
|
|
5141
|
-
const scaleFactor = Math.min(result, maxZoomFact - 1);
|
|
5142
|
-
if (!this.maps.isTileMap) {
|
|
5143
|
-
compareZoomFactor(scaleFactor, this.maps);
|
|
5144
|
-
}
|
|
5145
|
-
return scaleFactor;
|
|
5146
|
-
}
|
|
5147
|
-
/**
|
|
5148
|
-
* To calculate center position and factor value dynamically
|
|
5149
|
-
*
|
|
5150
|
-
* @param {LayerSettings[]} layersCollection - Specifies the layer settings instance.
|
|
5151
|
-
* @returns {void}
|
|
5152
|
-
* @private
|
|
5153
|
-
*/
|
|
5154
|
-
calculateZoomCenterPositionAndFactor(layersCollection) {
|
|
5155
|
-
if (!isNullOrUndefined(this.maps)) {
|
|
5156
|
-
if (this.maps.zoomSettings.shouldZoomInitially && this.maps.markerModule) {
|
|
5157
|
-
let minLong;
|
|
5158
|
-
let maxLat;
|
|
5159
|
-
let minLat;
|
|
5160
|
-
let maxLong;
|
|
5161
|
-
let zoomLevel;
|
|
5162
|
-
let centerLat;
|
|
5163
|
-
let centerLong;
|
|
5164
|
-
const maxZoomFact = this.maps.zoomSettings.maxZoom;
|
|
5165
|
-
const mapWidth = this.maps.mapAreaRect.width;
|
|
5166
|
-
const mapHeight = this.maps.mapAreaRect.height;
|
|
5167
|
-
this.maps.markerZoomedState = this.maps.markerZoomedState ? this.maps.markerZoomedState :
|
|
5168
|
-
isNullOrUndefined(this.maps.markerZoomFactor) ? !this.maps.markerZoomedState :
|
|
5169
|
-
this.maps.markerZoomFactor > 1 ? this.maps.markerZoomedState : !this.maps.markerZoomedState;
|
|
5170
|
-
this.maps.defaultState = this.maps.markerZoomedState ? !this.maps.markerZoomedState : this.maps.defaultState;
|
|
5171
|
-
Array.prototype.forEach.call(layersCollection, (currentLayer) => {
|
|
5172
|
-
const isMarker = currentLayer.markerSettings.length !== 0;
|
|
5173
|
-
if (isMarker) {
|
|
5174
|
-
Array.prototype.forEach.call(currentLayer.markerSettings, (markerSetting) => {
|
|
5175
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5176
|
-
const markerData = markerSetting.dataSource;
|
|
5177
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5178
|
-
Array.prototype.forEach.call(markerData, (data, dataIndex) => {
|
|
5179
|
-
const latitude = !isNullOrUndefined(data['latitude']) ? parseFloat(data['latitude']) :
|
|
5180
|
-
!isNullOrUndefined(data['Latitude']) ? parseFloat(data['Latitude']) : null;
|
|
5181
|
-
const longitude = !isNullOrUndefined(data['longitude']) ? parseFloat(data['longitude']) :
|
|
5182
|
-
!isNullOrUndefined(data['Longitude']) ? parseFloat(data['Longitude']) : null;
|
|
5183
|
-
minLong = isNullOrUndefined(minLong) && dataIndex === 0 ?
|
|
5184
|
-
longitude : minLong;
|
|
5185
|
-
maxLat = isNullOrUndefined(maxLat) && dataIndex === 0 ?
|
|
5186
|
-
latitude : maxLat;
|
|
5187
|
-
minLat = isNullOrUndefined(minLat) && dataIndex === 0 ?
|
|
5188
|
-
latitude : minLat;
|
|
5189
|
-
maxLong = isNullOrUndefined(maxLong) && dataIndex === 0 ?
|
|
5190
|
-
longitude : maxLong;
|
|
5191
|
-
if (minLong > longitude) {
|
|
5192
|
-
minLong = longitude;
|
|
5193
|
-
}
|
|
5194
|
-
if (minLat > latitude) {
|
|
5195
|
-
minLat = latitude;
|
|
5196
|
-
}
|
|
5197
|
-
if (maxLong < longitude) {
|
|
5198
|
-
maxLong = longitude;
|
|
5199
|
-
}
|
|
5200
|
-
if (maxLat < latitude) {
|
|
5201
|
-
maxLat = latitude;
|
|
5202
|
-
}
|
|
5203
|
-
});
|
|
5204
|
-
});
|
|
5205
|
-
}
|
|
5206
|
-
});
|
|
5207
|
-
if (!isNullOrUndefined(minLat) && !isNullOrUndefined(minLong) &&
|
|
5208
|
-
!isNullOrUndefined(maxLong) && !isNullOrUndefined(maxLat)) {
|
|
5209
|
-
// To find the center position
|
|
5210
|
-
centerLat = (minLat + maxLat) / 2;
|
|
5211
|
-
centerLong = (minLong + maxLong) / 2;
|
|
5212
|
-
this.maps.markerCenterLatitude = centerLat;
|
|
5213
|
-
this.maps.markerCenterLongitude = centerLong;
|
|
5214
|
-
if (isNullOrUndefined(this.maps.markerZoomCenterPoint) || this.maps.markerZoomedState) {
|
|
5215
|
-
this.maps.markerZoomCenterPoint = {
|
|
5216
|
-
latitude: centerLat,
|
|
5217
|
-
longitude: centerLong
|
|
5218
|
-
};
|
|
5219
|
-
}
|
|
5220
|
-
let markerFactor;
|
|
5221
|
-
if (this.maps.isTileMap || this.maps.baseMapRectBounds['min']['x'] === 0) {
|
|
5222
|
-
zoomLevel = calculateZoomLevel(minLat, maxLat, minLong, maxLong, mapWidth, mapHeight, this.maps, false);
|
|
5223
|
-
if (this.maps.isTileMap) {
|
|
5224
|
-
markerFactor = isNullOrUndefined(this.maps.markerZoomFactor) ?
|
|
5225
|
-
zoomLevel : isNullOrUndefined(this.maps.mapScaleValue) ?
|
|
5226
|
-
zoomLevel : this.maps.mapScaleValue > 1 && this.maps.markerZoomFactor !== 1 ?
|
|
5227
|
-
this.maps.mapScaleValue : zoomLevel;
|
|
5228
|
-
}
|
|
5229
|
-
else {
|
|
5230
|
-
markerFactor = isNullOrUndefined(this.maps.mapScaleValue) ? zoomLevel :
|
|
5231
|
-
(Math.floor(this.maps.scale) !== 1 &&
|
|
5232
|
-
this.maps.mapScaleValue !== zoomLevel)
|
|
5233
|
-
&&
|
|
5234
|
-
(isNullOrUndefined(this.maps.shouldZoomCurrentFactor))
|
|
5235
|
-
? this.maps.mapScaleValue : zoomLevel;
|
|
5236
|
-
if (((markerFactor === this.maps.mapScaleValue &&
|
|
5237
|
-
(this.maps.markerZoomFactor === 1 || this.maps.mapScaleValue === 1))
|
|
5238
|
-
&& (!this.maps.enablePersistence))) {
|
|
5239
|
-
markerFactor = zoomLevel;
|
|
5240
|
-
}
|
|
5241
|
-
}
|
|
5242
|
-
}
|
|
5243
|
-
else {
|
|
5244
|
-
zoomLevel = this.calculateIndividualLayerMarkerZoomLevel(mapWidth, mapHeight, maxZoomFact);
|
|
5245
|
-
markerFactor = isNullOrUndefined(this.maps.mapScaleValue) ? zoomLevel :
|
|
5246
|
-
(this.maps.mapScaleValue !== zoomLevel)
|
|
5247
|
-
? this.maps.mapScaleValue : zoomLevel;
|
|
5248
|
-
}
|
|
5249
|
-
this.maps.markerZoomFactor = markerFactor;
|
|
5250
|
-
}
|
|
5251
|
-
}
|
|
5252
|
-
else {
|
|
5253
|
-
this.maps.markerZoomedState = false;
|
|
5254
|
-
if (this.maps.markerZoomFactor > 1) {
|
|
5255
|
-
this.maps.markerCenterLatitude = null;
|
|
5256
|
-
this.maps.markerCenterLongitude = null;
|
|
5257
|
-
this.maps.markerZoomFactor = 1;
|
|
5258
|
-
if (!this.maps.enablePersistence) {
|
|
5259
|
-
this.maps.mapScaleValue = 1;
|
|
5260
|
-
}
|
|
5261
|
-
}
|
|
5262
|
-
if (this.maps.isTileMap && !this.maps.enablePersistence
|
|
5263
|
-
&& this.maps.mapScaleValue <= 1) {
|
|
5264
|
-
this.maps.tileZoomLevel = this.maps.mapScaleValue === 0 ? (this.maps.isZoomByPosition ? this.maps.tileZoomLevel : 1)
|
|
5265
|
-
: this.maps.mapScaleValue;
|
|
5266
|
-
if (this.maps.mapScaleValue === 1 && this.maps.markerZoomFactor === 1) {
|
|
5267
|
-
this.maps.tileTranslatePoint.x = 0;
|
|
5268
|
-
this.maps.tileTranslatePoint.y = 0;
|
|
5269
|
-
}
|
|
5270
|
-
}
|
|
5271
|
-
}
|
|
5272
|
-
}
|
|
5273
|
-
}
|
|
5274
|
-
/**
|
|
5275
|
-
* To check and trigger marker click event
|
|
5276
|
-
* @param {PointerEvent} e - Specifies the pointer event argument.
|
|
5277
|
-
* @returns {void}
|
|
5278
|
-
* @private
|
|
5279
|
-
*/
|
|
5280
|
-
markerClick(e) {
|
|
5281
|
-
let target = e.target.id;
|
|
5282
|
-
if (target.indexOf(this.maps.element.id) === -1) {
|
|
5283
|
-
const ancestor = e.target.closest('.' + this.maps.element.id + '_marker_template_element');
|
|
5284
|
-
if (!isNullOrUndefined(ancestor) && ancestor.id.indexOf('_MarkerIndex_') > -1) {
|
|
5285
|
-
target = ancestor.id;
|
|
5286
|
-
}
|
|
5287
|
-
}
|
|
5288
|
-
if (target.indexOf('_LayerIndex_') === -1 || target.indexOf('_cluster_') > 0) {
|
|
5289
|
-
return;
|
|
5290
|
-
}
|
|
5291
|
-
const options = this.getMarker(target);
|
|
5292
|
-
if (isNullOrUndefined(options)) {
|
|
5293
|
-
return;
|
|
5294
|
-
}
|
|
5295
|
-
if (options.marker.enableDrag) {
|
|
5296
|
-
document.getElementById(this.maps.element.id + "_svg").style.cursor = 'grabbing';
|
|
5297
|
-
}
|
|
5298
|
-
const eventArgs = {
|
|
5299
|
-
cancel: false, name: markerClick, data: options.data, maps: this.maps,
|
|
5300
|
-
marker: options.marker, target: target, x: e.clientX, y: e.clientY,
|
|
5301
|
-
latitude: options.data['latitude'] || options.data['Latitude'],
|
|
5302
|
-
longitude: options.data['longitude'] || options.data['Longitude'],
|
|
5303
|
-
value: options.data['name']
|
|
5304
|
-
};
|
|
5305
|
-
this.maps.trigger(markerClick, eventArgs);
|
|
5306
|
-
if (options.marker.enableDrag) {
|
|
5307
|
-
let isCluster = false;
|
|
5308
|
-
const layerIndex = parseInt(target.split('_LayerIndex_')[1].split('_')[0], 10);
|
|
5309
|
-
const markerIndex = parseInt(target.split('_MarkerIndex_')[1].split('_')[0], 10);
|
|
5310
|
-
const dataIndex = parseInt(target.split('_dataIndex_')[1].split('_')[0], 10);
|
|
5311
|
-
const marker$$1 = this.maps.layers[layerIndex].markerSettings[markerIndex];
|
|
5312
|
-
if (this.sameMarkerData.length > 0) {
|
|
5313
|
-
isCluster = (this.sameMarkerData[0].data.filter((el) => { return (el['index'] == dataIndex); })).length > 0 &&
|
|
5314
|
-
this.sameMarkerData[0].layerIndex === layerIndex && this.sameMarkerData[0].markerIndex === markerIndex;
|
|
5315
|
-
}
|
|
5316
|
-
if (!isCluster) {
|
|
5317
|
-
const dragEventArgs = {
|
|
5318
|
-
name: markerDragStart, x: e.clientX, y: e.clientY,
|
|
5319
|
-
latitude: options.data['latitude'] || options.data['Latitude'],
|
|
5320
|
-
longitude: options.data['longitude'] || options.data['Longitude'],
|
|
5321
|
-
layerIndex: layerIndex, markerIndex: markerIndex, dataIndex: dataIndex
|
|
5322
|
-
};
|
|
5323
|
-
this.maps.trigger(markerDragStart, dragEventArgs);
|
|
5324
|
-
this.maps.markerDragArgument = {
|
|
5325
|
-
targetId: target, x: e.clientX, y: e.clientY,
|
|
5326
|
-
latitude: options.data['latitude'] || options.data['Latitude'],
|
|
5327
|
-
longitude: options.data['longitude'] || options.data['Longitude'],
|
|
5328
|
-
shape: isNullOrUndefined(marker$$1.shapeValuePath) ? marker$$1.shape : marker$$1.dataSource[dataIndex][marker$$1.shapeValuePath],
|
|
5329
|
-
layerIndex: layerIndex, markerIndex: markerIndex, dataIndex: dataIndex
|
|
5330
|
-
};
|
|
5331
|
-
}
|
|
5332
|
-
}
|
|
5333
|
-
}
|
|
5334
|
-
/**
|
|
5335
|
-
* To check and trigger Cluster click event
|
|
5336
|
-
* @param {PointerEvent} e - Specifies the pointer event argument.
|
|
5337
|
-
* @returns {void}
|
|
5338
|
-
* @private
|
|
5339
|
-
*/
|
|
5340
|
-
markerClusterClick(e) {
|
|
5341
|
-
const target = e.target.id;
|
|
5342
|
-
if (target.indexOf('_LayerIndex_') === -1 || target.indexOf('_cluster_') === -1) {
|
|
5343
|
-
return;
|
|
5344
|
-
}
|
|
5345
|
-
const options = this.getMarker(target);
|
|
5346
|
-
if (isNullOrUndefined(options)) {
|
|
5347
|
-
return;
|
|
5348
|
-
}
|
|
5349
|
-
if ((options.clusterCollection.length > 0 && this.maps.markerClusterExpand)) {
|
|
5350
|
-
if (getElement(this.maps.element.id + '_mapsTooltip') &&
|
|
5351
|
-
this.maps.mapsTooltipModule.tooltipTargetID.indexOf('_MarkerIndex_') > -1) {
|
|
5352
|
-
removeElement(this.maps.element.id + '_mapsTooltip');
|
|
5353
|
-
}
|
|
5354
|
-
if (this.sameMarkerData.length > 0 && !this.maps.markerClusterExpandCheck) {
|
|
5355
|
-
this.maps.markerClusterExpandCheck = true;
|
|
5356
|
-
mergeSeparateCluster(this.sameMarkerData, this.maps, this.markerSVGObject);
|
|
5357
|
-
}
|
|
5358
|
-
else {
|
|
5359
|
-
this.sameMarkerData = options.clusterCollection;
|
|
5360
|
-
this.maps.markerClusterExpandCheck = false;
|
|
5361
|
-
clusterSeparate(this.sameMarkerData, this.maps, this.markerSVGObject, true);
|
|
5362
|
-
}
|
|
5363
|
-
}
|
|
5364
|
-
const eventArgs = {
|
|
5365
|
-
cancel: false, name: markerClusterClick, data: options, maps: this.maps,
|
|
5366
|
-
target: target, x: e.clientX, y: e.clientY,
|
|
5367
|
-
latitude: options.data['latitude'] || options.data['Latitude'], longitude: options.data['longitude'] || options.data['Longitude'],
|
|
5368
|
-
markerClusterCollection: options['markCollection']
|
|
5369
|
-
};
|
|
5370
|
-
this.maps.trigger(markerClusterClick, eventArgs);
|
|
5371
|
-
}
|
|
5372
|
-
/**
|
|
5373
|
-
* To get marker from target id
|
|
5374
|
-
*
|
|
5375
|
-
* @param {string} target - Specifies the target
|
|
5376
|
-
* @returns {string} - Returns the string
|
|
5377
|
-
*/
|
|
5378
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5379
|
-
getMarker(target) {
|
|
5380
|
-
const id = target.split('_LayerIndex_');
|
|
5381
|
-
const index = parseInt(id[1].split('_')[0], 10);
|
|
5382
|
-
const layer = this.maps.layers[index];
|
|
5383
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5384
|
-
let data;
|
|
5385
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5386
|
-
const markCollection = [];
|
|
5387
|
-
const clusterCollection = [];
|
|
5388
|
-
let marker$$1;
|
|
5389
|
-
this.maps.markerClusterExpand = layer.markerClusterSettings.allowClusterExpand;
|
|
5390
|
-
if (target.indexOf('_MarkerIndex_') > -1) {
|
|
5391
|
-
const markerIndex = parseInt(id[1].split('_MarkerIndex_')[1].split('_')[0], 10);
|
|
5392
|
-
const dataIndex = parseInt(id[1].split('_dataIndex_')[1].split('_')[0], 10);
|
|
5393
|
-
marker$$1 = layer.markerSettings[markerIndex];
|
|
5394
|
-
if (!isNaN(markerIndex)) {
|
|
5395
|
-
data = marker$$1.dataSource[dataIndex];
|
|
5396
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5397
|
-
let collection = [];
|
|
5398
|
-
if (!marker$$1.template && (target.indexOf('_cluster_') > -1) && (this.maps.layers[index].markerClusterSettings.allowClusterExpand)) {
|
|
5399
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5400
|
-
Array.prototype.forEach.call(marker$$1.dataSource, (location, index) => {
|
|
5401
|
-
if (location['latitude'] === data['latitude'] && location['longitude'] === data['longitude']) {
|
|
5402
|
-
collection.push({ data: data, index: index });
|
|
5403
|
-
}
|
|
5404
|
-
});
|
|
5405
|
-
}
|
|
5406
|
-
if ((target.indexOf('_cluster_') > -1)) {
|
|
5407
|
-
let isClusterSame = false;
|
|
5408
|
-
const clusterElement = document.getElementById(target.indexOf('_datalabel_') > -1 ? layer.markerClusterSettings.shape === 'Balloon' ? target.split('_datalabel_')[0] + '_Group' : target.split('_datalabel_')[0] : layer.markerClusterSettings.shape === 'Balloon' ? target + '_Group' : target);
|
|
5409
|
-
const indexes = layer.markerClusterSettings.shape === 'Balloon' ? clusterElement.children[0].textContent.split(',').map(Number) : clusterElement.textContent.split(',').map(Number);
|
|
5410
|
-
collection = [];
|
|
5411
|
-
for (const i of indexes) {
|
|
5412
|
-
collection.push({ data: marker$$1.dataSource[i], index: i });
|
|
5413
|
-
markCollection.push(marker$$1.dataSource[i]);
|
|
5414
|
-
}
|
|
5415
|
-
isClusterSame = false;
|
|
5416
|
-
clusterCollection.push({
|
|
5417
|
-
data: collection, layerIndex: index, markerIndex: markerIndex, dataIndex: dataIndex,
|
|
5418
|
-
targetClusterIndex: +(target.split('_cluster_')[1].indexOf('_datalabel_') > -1 ? target.split('_cluster_')[1].split('_datalabel_')[0] : target.split('_cluster_')[1]),
|
|
5419
|
-
isClusterSame: isClusterSame
|
|
5420
|
-
});
|
|
5421
|
-
}
|
|
5422
|
-
return { marker: marker$$1, data: data, clusterCollection: clusterCollection, markCollection: markCollection };
|
|
5423
|
-
}
|
|
5424
|
-
}
|
|
5425
|
-
return null;
|
|
5426
|
-
}
|
|
5427
|
-
/**
|
|
5428
|
-
* To check and trigger marker move event
|
|
5429
|
-
*
|
|
5430
|
-
* @param {PointerEvent} e - Specifies the pointer event argument.
|
|
5431
|
-
* @returns {void}
|
|
5432
|
-
* @private
|
|
5433
|
-
*/
|
|
5434
|
-
markerMove(e) {
|
|
5435
|
-
const targetId = e.target.id;
|
|
5436
|
-
if (targetId.indexOf('_LayerIndex_') === -1 || targetId.indexOf('_cluster_') > 0) {
|
|
5437
|
-
return;
|
|
5438
|
-
}
|
|
5439
|
-
const options = this.getMarker(targetId);
|
|
5440
|
-
if (isNullOrUndefined(options)) {
|
|
5441
|
-
return;
|
|
5442
|
-
}
|
|
5443
|
-
if (options.marker.enableDrag) {
|
|
5444
|
-
document.getElementById(this.maps.element.id + "_svg").style.cursor = isNullOrUndefined(this.maps.markerDragArgument) ?
|
|
5445
|
-
'pointer' : 'grabbing';
|
|
5446
|
-
}
|
|
5447
|
-
const eventArgs = {
|
|
5448
|
-
cancel: false, name: markerMouseMove, data: options.data,
|
|
5449
|
-
maps: this.maps, target: targetId, x: e.clientX, y: e.clientY
|
|
5450
|
-
};
|
|
5451
|
-
this.maps.trigger(markerMouseMove, eventArgs);
|
|
5452
|
-
}
|
|
5453
|
-
/**
|
|
5454
|
-
* To check and trigger cluster move event
|
|
5455
|
-
*
|
|
5456
|
-
* @param {PointerEvent} e - Specifies the pointer event argument.
|
|
5457
|
-
* @returns {void}
|
|
5458
|
-
* @private
|
|
5459
|
-
*/
|
|
5460
|
-
markerClusterMouseMove(e) {
|
|
5461
|
-
const targetId = e.target.id;
|
|
5462
|
-
if (targetId.indexOf('_LayerIndex_') === -1 || targetId.indexOf('_cluster_') === -1) {
|
|
5463
|
-
return;
|
|
5464
|
-
}
|
|
5465
|
-
const options = this.getMarker(targetId);
|
|
5466
|
-
if (this.maps.markerClusterExpand) {
|
|
5467
|
-
e.target.style.cursor = 'pointer';
|
|
5468
|
-
}
|
|
5469
|
-
if (isNullOrUndefined(options)) {
|
|
5470
|
-
return;
|
|
5471
|
-
}
|
|
5472
|
-
const eventArgs = {
|
|
5473
|
-
cancel: false, name: markerClusterMouseMove, data: options.data, maps: this.maps,
|
|
5474
|
-
target: targetId, x: e.clientX, y: e.clientY
|
|
5475
|
-
};
|
|
5476
|
-
this.maps.trigger(markerClusterMouseMove, eventArgs);
|
|
5477
|
-
}
|
|
5478
|
-
/**
|
|
5479
|
-
* Get module name.
|
|
5480
|
-
*
|
|
5481
|
-
* @returns {string} - Returns the module name
|
|
5482
|
-
*/
|
|
5483
|
-
getModuleName() {
|
|
5484
|
-
return 'Marker';
|
|
5485
|
-
}
|
|
5486
|
-
/**
|
|
5487
|
-
* To destroy the layers.
|
|
5488
|
-
*
|
|
5489
|
-
* @returns {void}
|
|
5490
|
-
* @private
|
|
5491
|
-
*/
|
|
5492
|
-
destroy() {
|
|
5493
|
-
this.maps = null;
|
|
5494
|
-
this.trackElements = [];
|
|
5495
|
-
this.markerSVGObject = null;
|
|
5496
|
-
this.sameMarkerData = [];
|
|
5497
|
-
}
|
|
5498
|
-
}
|
|
5499
|
-
|
|
5500
|
-
/**
|
|
5501
|
-
* Maps constants doc
|
|
5099
|
+
* Maps constants doc
|
|
5502
5100
|
*/
|
|
5503
5101
|
/**
|
|
5504
5102
|
* Specifies the maps load event name.
|
|
@@ -6160,6 +5758,12 @@ class LayerPanel {
|
|
|
6160
5758
|
&& panel.mapObject.previousZoomFactor !== panel.mapObject.zoomSettings.zoomFactor) {
|
|
6161
5759
|
panel.mapObject.previousZoomFactor = panel.mapObject.zoomSettings.zoomFactor;
|
|
6162
5760
|
}
|
|
5761
|
+
if (panel.mapObject.polygonModule) {
|
|
5762
|
+
const polygonElement = panel.mapObject.polygonModule.polygonRender(this.mapObject, layerIndex, panel.mapObject.tileZoomLevel);
|
|
5763
|
+
if (!isNullOrUndefined(polygonElement)) {
|
|
5764
|
+
panel.layerObject.appendChild(polygonElement);
|
|
5765
|
+
}
|
|
5766
|
+
}
|
|
6163
5767
|
if (panel.mapObject.navigationLineModule) {
|
|
6164
5768
|
const navigationLineElement = panel.mapObject.navigationLineModule.renderNavigation(panel.currentLayer, panel.mapObject.tileZoomLevel, layerIndex);
|
|
6165
5769
|
if (!isNullOrUndefined(navigationLineElement)) {
|
|
@@ -6618,6 +6222,9 @@ class LayerPanel {
|
|
|
6618
6222
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6619
6223
|
layerIndex, colors, renderData, labelTemplateEle) {
|
|
6620
6224
|
let bubbleG;
|
|
6225
|
+
if (this.mapObject.polygonModule) {
|
|
6226
|
+
this.groupElements.push(this.mapObject.polygonModule.polygonRender(this.mapObject, layerIndex, (this.mapObject.isTileMap ? Math.floor(this.currentFactor) : this.currentFactor)));
|
|
6227
|
+
}
|
|
6621
6228
|
if (this.currentLayer.bubbleSettings.length && this.mapObject.bubbleModule) {
|
|
6622
6229
|
const length = this.currentLayer.bubbleSettings.length;
|
|
6623
6230
|
let bubble;
|
|
@@ -6968,9 +6575,11 @@ class LayerPanel {
|
|
|
6968
6575
|
(!(childNode.id.indexOf('_bubble_Group') > -1)) &&
|
|
6969
6576
|
(!(childNode.id.indexOf('_dataLableIndex_Group') > -1)) &&
|
|
6970
6577
|
(!(childNode.id.indexOf('_line_Group') > -1))) {
|
|
6971
|
-
|
|
6972
|
-
|
|
6973
|
-
|
|
6578
|
+
if (childNode.id.indexOf('_Polygons_Group') === -1) {
|
|
6579
|
+
const transform = 'scale( ' + this.mapObject.scale + ' ) ' + 'translate( ' + this.mapObject.translatePoint.x
|
|
6580
|
+
+ ' ' + this.mapObject.translatePoint.y + ' ) ';
|
|
6581
|
+
childNode.setAttribute('transform', transform);
|
|
6582
|
+
}
|
|
6974
6583
|
}
|
|
6975
6584
|
}
|
|
6976
6585
|
}
|
|
@@ -7663,6 +7272,8 @@ let Maps = class Maps extends Component {
|
|
|
7663
7272
|
/** @private */
|
|
7664
7273
|
this.selectedNavigationElementId = [];
|
|
7665
7274
|
/** @private */
|
|
7275
|
+
this.selectedPolygonElementId = [];
|
|
7276
|
+
/** @private */
|
|
7666
7277
|
this.selectedLegendElementId = [];
|
|
7667
7278
|
/** @private */
|
|
7668
7279
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -7680,6 +7291,8 @@ let Maps = class Maps extends Component {
|
|
|
7680
7291
|
/** @private */
|
|
7681
7292
|
this.initialTileTranslate = new Point(0, 0);
|
|
7682
7293
|
/** @private */
|
|
7294
|
+
this.isMarkerZoomCompleted = false;
|
|
7295
|
+
/** @private */
|
|
7683
7296
|
this.markerDragId = '';
|
|
7684
7297
|
/** @private */
|
|
7685
7298
|
this.initialCheck = true;
|
|
@@ -7870,8 +7483,8 @@ let Maps = class Maps extends Component {
|
|
|
7870
7483
|
const fetchApiModule = new Fetch(localAjax.dataOptions, localAjax.type, localAjax.contentType);
|
|
7871
7484
|
fetchApiModule.onSuccess = (args) => {
|
|
7872
7485
|
if (!isNullOrUndefined(args.type) && args.type === 'application/octet-stream') {
|
|
7873
|
-
|
|
7874
|
-
|
|
7486
|
+
const reader = new FileReader();
|
|
7487
|
+
const map = this;
|
|
7875
7488
|
reader.onload = function (data) {
|
|
7876
7489
|
args = JSON.parse(reader.result.toString());
|
|
7877
7490
|
map.processResponseJsonData('Fetch', args, layer, type);
|
|
@@ -8032,10 +7645,20 @@ let Maps = class Maps extends Component {
|
|
|
8032
7645
|
this.zoomModule.removeToolbarOpacity(this.isTileMap ? Math.round(this.tileZoomLevel) : this.mapScaleValue, this.element.id + '_Zooming_');
|
|
8033
7646
|
}
|
|
8034
7647
|
if (!this.isZoomByPosition && !this.zoomNotApplied) {
|
|
8035
|
-
this.
|
|
7648
|
+
this.triggerZoomEvent();
|
|
8036
7649
|
}
|
|
8037
7650
|
this.isResize = false;
|
|
8038
7651
|
}
|
|
7652
|
+
triggerZoomEvent() {
|
|
7653
|
+
let loadedArgs;
|
|
7654
|
+
const minMaxLatitudeLongitude = this.getMinMaxLatitudeLongitude();
|
|
7655
|
+
loadedArgs = {
|
|
7656
|
+
maps: this, isResized: this.isResize, minLatitude: minMaxLatitudeLongitude.minLatitude,
|
|
7657
|
+
maxLatitude: minMaxLatitudeLongitude.maxLatitude, minLongitude: minMaxLatitudeLongitude.minLongitude,
|
|
7658
|
+
maxLongitude: minMaxLatitudeLongitude.maxLongitude, cancel: false, name: 'Loaded'
|
|
7659
|
+
};
|
|
7660
|
+
this.trigger('loaded', loadedArgs);
|
|
7661
|
+
}
|
|
8039
7662
|
/**
|
|
8040
7663
|
* To apply color to the initial selected marker
|
|
8041
7664
|
*
|
|
@@ -8207,6 +7830,20 @@ let Maps = class Maps extends Component {
|
|
|
8207
7830
|
this.element.appendChild(secondaryElement);
|
|
8208
7831
|
}
|
|
8209
7832
|
}
|
|
7833
|
+
/**
|
|
7834
|
+
* @returns {void}
|
|
7835
|
+
*/
|
|
7836
|
+
getMinMaxLatitudeLongitude() {
|
|
7837
|
+
const element = document.getElementById(this.element.id).getBoundingClientRect();
|
|
7838
|
+
let minPosition = this.isTileMap ? this.pointToLatLong((this.mapAreaRect.x - this.margin.left), -this.mapAreaRect.y) : this.getGeoLocation(0, (this.mapAreaRect.x + element.left), this.mapAreaRect.y);
|
|
7839
|
+
let maxPosition = this.isTileMap ? this.pointToLatLong(this.mapAreaRect.width, (this.mapAreaRect.height - this.mapAreaRect.y)) :
|
|
7840
|
+
this.getGeoLocation(0, (this.mapAreaRect.x + element.left + this.mapAreaRect.width), (this.mapAreaRect.y + this.mapAreaRect.height));
|
|
7841
|
+
const MinMaxLatitudeLongitude = {
|
|
7842
|
+
minLatitude: minPosition.latitude, maxLatitude: maxPosition.latitude, minLongitude: minPosition.longitude,
|
|
7843
|
+
maxLongitude: maxPosition.longitude
|
|
7844
|
+
};
|
|
7845
|
+
return MinMaxLatitudeLongitude;
|
|
7846
|
+
}
|
|
8210
7847
|
/**
|
|
8211
7848
|
* @returns {void}
|
|
8212
7849
|
* @private
|
|
@@ -9121,7 +8758,7 @@ let Maps = class Maps extends Component {
|
|
|
9121
8758
|
*/
|
|
9122
8759
|
zoomByPosition(centerPosition, zoomFactor) {
|
|
9123
8760
|
if (!this.isDestroyed) {
|
|
9124
|
-
this.zoomNotApplied = false;
|
|
8761
|
+
this.zoomNotApplied = this.isMarkerZoomCompleted = false;
|
|
9125
8762
|
let isRefresh = this.zoomSettings.zoomFactor === zoomFactor;
|
|
9126
8763
|
this.previousProjection = null;
|
|
9127
8764
|
if (!this.isTileMap && this.zoomModule) {
|
|
@@ -9218,14 +8855,13 @@ let Maps = class Maps extends Component {
|
|
|
9218
8855
|
* @returns {void}
|
|
9219
8856
|
*/
|
|
9220
8857
|
addMarker(layerIndex, markerCollection) {
|
|
9221
|
-
if (!this.isDestroyed) {
|
|
8858
|
+
if (!this.isDestroyed && !isNullOrUndefined(this.markerModule)) {
|
|
9222
8859
|
const layerEle = document.getElementById(this.element.id + '_LayerIndex_' + layerIndex);
|
|
9223
8860
|
if (markerCollection.length > 0 && layerEle) {
|
|
9224
8861
|
for (const newMarker of markerCollection) {
|
|
9225
8862
|
this.layersCollection[layerIndex].markerSettings.push(new MarkerSettings(this, 'markerSettings', newMarker));
|
|
9226
8863
|
}
|
|
9227
|
-
|
|
9228
|
-
markerModule.markerRender(this, layerEle, layerIndex, this.mapLayerPanel['currentFactor'], 'AddMarker');
|
|
8864
|
+
this.markerModule.markerRender(this, layerEle, layerIndex, this.mapLayerPanel['currentFactor'], 'AddMarker');
|
|
9229
8865
|
this.arrangeTemplate();
|
|
9230
8866
|
}
|
|
9231
8867
|
}
|
|
@@ -9350,6 +8986,7 @@ let Maps = class Maps extends Component {
|
|
|
9350
8986
|
*/
|
|
9351
8987
|
zoomToCoordinates(minLatitude, minLongitude, maxLatitude, maxLongitude) {
|
|
9352
8988
|
if (!this.isDestroyed) {
|
|
8989
|
+
this.isMarkerZoomCompleted = false;
|
|
9353
8990
|
let centerLatitude;
|
|
9354
8991
|
let centerLongtitude;
|
|
9355
8992
|
let isTwoCoordinates = false;
|
|
@@ -9388,12 +9025,15 @@ let Maps = class Maps extends Component {
|
|
|
9388
9025
|
this.maxLongOfGivenLocation = maxLongitude;
|
|
9389
9026
|
this.zoomNotApplied = true;
|
|
9390
9027
|
this.scaleOfGivenLocation = calculateZoomLevel(minLatitude, maxLatitude, minLongitude, maxLongitude, this.mapAreaRect.width, this.mapAreaRect.height, this, true);
|
|
9028
|
+
const minMaxLatitudeLongitude = this.getMinMaxLatitudeLongitude();
|
|
9391
9029
|
const zoomArgs = {
|
|
9392
9030
|
cancel: false, name: 'zoom', type: zoomIn, maps: this,
|
|
9393
9031
|
tileTranslatePoint: {}, translatePoint: {},
|
|
9394
9032
|
tileZoomLevel: this.isTileMap ? { previous: this.tileZoomLevel, current: this.scaleOfGivenLocation } : {},
|
|
9395
9033
|
scale: !this.isTileMap ? { previous: this.scale, current: this.scaleOfGivenLocation } :
|
|
9396
|
-
{ previous: this.tileZoomLevel, current: this.scaleOfGivenLocation }
|
|
9034
|
+
{ previous: this.tileZoomLevel, current: this.scaleOfGivenLocation },
|
|
9035
|
+
minLatitude: minMaxLatitudeLongitude.minLatitude, maxLatitude: minMaxLatitudeLongitude.maxLatitude,
|
|
9036
|
+
minLongitude: minMaxLatitudeLongitude.minLongitude, maxLongitude: minMaxLatitudeLongitude.maxLongitude
|
|
9397
9037
|
};
|
|
9398
9038
|
this.trigger('zoom', zoomArgs);
|
|
9399
9039
|
this.refresh();
|
|
@@ -9563,6 +9203,9 @@ let Maps = class Maps extends Component {
|
|
|
9563
9203
|
}
|
|
9564
9204
|
else if (newProp.zoomSettings.shouldZoomInitially !== oldProp.zoomSettings.shouldZoomInitially) {
|
|
9565
9205
|
this.zoomSettings.zoomFactor = 1;
|
|
9206
|
+
this.previousProjection = null;
|
|
9207
|
+
this.scale = this.isMarkerZoomCompleted ? null : this.scale;
|
|
9208
|
+
this.isMarkerZoomCompleted = !newProp.zoomSettings.shouldZoomInitially;
|
|
9566
9209
|
render = true;
|
|
9567
9210
|
}
|
|
9568
9211
|
else if (newProp.zoomSettings.enable !== oldProp.zoomSettings.enable) {
|
|
@@ -9661,6 +9304,12 @@ let Maps = class Maps extends Component {
|
|
|
9661
9304
|
args: [this]
|
|
9662
9305
|
});
|
|
9663
9306
|
}
|
|
9307
|
+
if (this.isPolygonVisible()) {
|
|
9308
|
+
modules.push({
|
|
9309
|
+
member: 'Polygon',
|
|
9310
|
+
args: [this]
|
|
9311
|
+
});
|
|
9312
|
+
}
|
|
9664
9313
|
if (isVisible.tooltip) {
|
|
9665
9314
|
modules.push({
|
|
9666
9315
|
member: 'MapsTooltip',
|
|
@@ -9742,6 +9391,23 @@ let Maps = class Maps extends Component {
|
|
|
9742
9391
|
});
|
|
9743
9392
|
return isVisible;
|
|
9744
9393
|
}
|
|
9394
|
+
/**
|
|
9395
|
+
* To find navigation line visibility
|
|
9396
|
+
*
|
|
9397
|
+
* @returns {boolean} - Returns whether the navigation lines are visible or not.
|
|
9398
|
+
*/
|
|
9399
|
+
isPolygonVisible() {
|
|
9400
|
+
let isVisible = false;
|
|
9401
|
+
Array.prototype.forEach.call(this.layers, (layer) => {
|
|
9402
|
+
for (let i = 0; i < layer.polygonSettings.polygons.length; i++) {
|
|
9403
|
+
if (layer.polygonSettings.polygons.length > 0) {
|
|
9404
|
+
isVisible = true;
|
|
9405
|
+
break;
|
|
9406
|
+
}
|
|
9407
|
+
}
|
|
9408
|
+
});
|
|
9409
|
+
return isVisible;
|
|
9410
|
+
}
|
|
9745
9411
|
/**
|
|
9746
9412
|
* To find marker visibility
|
|
9747
9413
|
*/
|
|
@@ -9847,19 +9513,26 @@ let Maps = class Maps extends Component {
|
|
|
9847
9513
|
findVisibleLayers(layers, isLayerVisible = false, isBubblevisible = false, istooltipVisible = false, isSelection = false, isHighlight = false) {
|
|
9848
9514
|
let bubbles;
|
|
9849
9515
|
let markers;
|
|
9850
|
-
let
|
|
9516
|
+
let polygonSetting;
|
|
9851
9517
|
for (const layer of layers) {
|
|
9852
9518
|
isLayerVisible = layer.visible || isLayerVisible;
|
|
9853
9519
|
if (layer.visible) {
|
|
9854
9520
|
bubbles = layer.bubbleSettings;
|
|
9855
9521
|
markers = layer.markerSettings;
|
|
9856
|
-
|
|
9522
|
+
polygonSetting = layer.polygonSettings;
|
|
9523
|
+
let navigationLine = layer.navigationLineSettings;
|
|
9857
9524
|
for (const navigation of navigationLine) {
|
|
9858
9525
|
if (navigation.visible) {
|
|
9859
9526
|
isSelection = (!isNullOrUndefined(navigation.highlightSettings) && navigation.highlightSettings.enable) || isSelection;
|
|
9860
9527
|
isHighlight = (!isNullOrUndefined(navigation.selectionSettings) && navigation.selectionSettings.enable) || isHighlight;
|
|
9861
9528
|
}
|
|
9862
9529
|
}
|
|
9530
|
+
for (const polygon of polygonSetting.polygons) {
|
|
9531
|
+
if (polygon.points.length > 0) {
|
|
9532
|
+
isSelection = layer.polygonSettings.highlightSettings.enable || isSelection;
|
|
9533
|
+
isHighlight = layer.polygonSettings.selectionSettings.enable || isHighlight;
|
|
9534
|
+
}
|
|
9535
|
+
}
|
|
9863
9536
|
for (const marker$$1 of markers) {
|
|
9864
9537
|
if (marker$$1.visible) {
|
|
9865
9538
|
istooltipVisible = marker$$1.tooltipSettings.visible || istooltipVisible;
|
|
@@ -9954,7 +9627,7 @@ let Maps = class Maps extends Component {
|
|
|
9954
9627
|
pointToLatLong(pageX, pageY) {
|
|
9955
9628
|
let latitude = 0;
|
|
9956
9629
|
let longitude = 0;
|
|
9957
|
-
if (!this.isDestroyed) {
|
|
9630
|
+
if (!this.isDestroyed && !isNullOrUndefined(this.translatePoint)) {
|
|
9958
9631
|
const padding = this.layers[this.layers.length - 1].layerType === 'GoogleStaticMap' ? 0 : 10;
|
|
9959
9632
|
pageY = pageY + padding;
|
|
9960
9633
|
const mapSize = 256 * Math.pow(2, this.tileZoomLevel);
|
|
@@ -10139,280 +9812,828 @@ Maps = __decorate([
|
|
|
10139
9812
|
], Maps);
|
|
10140
9813
|
|
|
10141
9814
|
/**
|
|
10142
|
-
* Bubble module class
|
|
9815
|
+
* Bubble module class
|
|
9816
|
+
*/
|
|
9817
|
+
class Bubble {
|
|
9818
|
+
constructor(maps) {
|
|
9819
|
+
/**
|
|
9820
|
+
* Bubble Id for current layer
|
|
9821
|
+
* @private
|
|
9822
|
+
*/
|
|
9823
|
+
this.id = '';
|
|
9824
|
+
this.maps = maps;
|
|
9825
|
+
this.bubbleCollection = [];
|
|
9826
|
+
}
|
|
9827
|
+
// eslint-disable-next-line valid-jsdoc
|
|
9828
|
+
/**
|
|
9829
|
+
* To render bubble
|
|
9830
|
+
*
|
|
9831
|
+
* @private
|
|
9832
|
+
*/
|
|
9833
|
+
renderBubble(
|
|
9834
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9835
|
+
bubbleSettings, shapeData, color, range, bubbleIndex, dataIndex, layerIndex, layer, group, bubbleID) {
|
|
9836
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9837
|
+
const layerData = layer.layerData;
|
|
9838
|
+
const colorValuePath = bubbleSettings.colorValuePath;
|
|
9839
|
+
const equalValue = (!isNullOrUndefined(colorValuePath)) ? ((colorValuePath.indexOf('.') > -1) ?
|
|
9840
|
+
(getValueFromObject(shapeData, bubbleSettings.colorValuePath)) : shapeData[colorValuePath]) :
|
|
9841
|
+
shapeData[colorValuePath];
|
|
9842
|
+
const colorValue = (!isNullOrUndefined(colorValuePath)) ? ((colorValuePath.indexOf('.') > -1) ?
|
|
9843
|
+
Number(getValueFromObject(shapeData, bubbleSettings.colorValuePath)) : Number(shapeData[colorValuePath])) :
|
|
9844
|
+
Number(shapeData[colorValuePath]);
|
|
9845
|
+
const bubbleValue = (!isNullOrUndefined(bubbleSettings.valuePath)) ? ((bubbleSettings.valuePath.indexOf('.') > -1) ?
|
|
9846
|
+
Number(getValueFromObject(shapeData, bubbleSettings.valuePath)) : Number(shapeData[bubbleSettings.valuePath])) :
|
|
9847
|
+
Number(shapeData[bubbleSettings.valuePath]);
|
|
9848
|
+
let opacity;
|
|
9849
|
+
let bubbleColor;
|
|
9850
|
+
if (isNaN(bubbleValue) && isNaN(colorValue) && isNullOrUndefined(equalValue)) {
|
|
9851
|
+
return null;
|
|
9852
|
+
}
|
|
9853
|
+
let radius = getRatioOfBubble(bubbleSettings.minRadius, bubbleSettings.maxRadius, bubbleValue, range.min, range.max);
|
|
9854
|
+
const colorMapping = new ColorMapping(this.maps);
|
|
9855
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9856
|
+
const shapeColor = colorMapping.getColorByValue(bubbleSettings.colorMapping, colorValue, equalValue);
|
|
9857
|
+
// eslint-disable-next-line prefer-const
|
|
9858
|
+
bubbleColor = (Object.prototype.toString.call(shapeColor) === '[object Object]' &&
|
|
9859
|
+
!isNullOrUndefined(shapeColor['fill'])) ? shapeColor['fill'] : color;
|
|
9860
|
+
// eslint-disable-next-line prefer-const
|
|
9861
|
+
opacity = (Object.prototype.toString.call(shapeColor) === '[object Object]' &&
|
|
9862
|
+
!isNullOrUndefined(shapeColor['opacity'])) ? shapeColor['opacity'] : bubbleSettings.opacity;
|
|
9863
|
+
const shapePoints = [[]];
|
|
9864
|
+
this.maps.translateType = 'bubble';
|
|
9865
|
+
let midIndex = 0;
|
|
9866
|
+
let pointsLength = 0;
|
|
9867
|
+
let currentLength = 0;
|
|
9868
|
+
for (let i = 0, len = layerData.length; i < len; i++) {
|
|
9869
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9870
|
+
let shape = layerData[i];
|
|
9871
|
+
shape = shape['property'];
|
|
9872
|
+
const shapePath = checkPropertyPath(shapeData[layer.shapeDataPath], layer.shapePropertyPath, shape);
|
|
9873
|
+
const shapeDataLayerPathValue = !isNullOrUndefined(shapeData[layer.shapeDataPath]) &&
|
|
9874
|
+
isNaN(shapeData[layer.shapeDataPath]) ? shapeData[layer.shapeDataPath].toLowerCase() : shapeData[layer.shapeDataPath];
|
|
9875
|
+
const shapePathValue = !isNullOrUndefined(shape[shapePath]) && isNaN(shape[shapePath])
|
|
9876
|
+
? shape[shapePath].toLowerCase() : shape[shapePath];
|
|
9877
|
+
if (shapeDataLayerPathValue === shapePathValue && (layerData[i].type !== 'LineString' && layerData[i].type !== 'MultiLineString' && layerData[i]['type'] !== 'Point' && layerData[i]['type'] !== 'MultiPoint')) {
|
|
9878
|
+
if (!layerData[i]['_isMultiPolygon']) {
|
|
9879
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9880
|
+
shapePoints.push(this.getPoints(layerData[i], []));
|
|
9881
|
+
currentLength = shapePoints[shapePoints.length - 1].length;
|
|
9882
|
+
if (pointsLength < currentLength) {
|
|
9883
|
+
pointsLength = currentLength;
|
|
9884
|
+
midIndex = shapePoints.length - 1;
|
|
9885
|
+
}
|
|
9886
|
+
}
|
|
9887
|
+
else {
|
|
9888
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9889
|
+
const layer = layerData[i];
|
|
9890
|
+
for (let j = 0; j < layer.length; j++) {
|
|
9891
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9892
|
+
shapePoints.push(this.getPoints(layer[j], []));
|
|
9893
|
+
currentLength = shapePoints[shapePoints.length - 1].length;
|
|
9894
|
+
if (pointsLength < currentLength) {
|
|
9895
|
+
pointsLength = currentLength;
|
|
9896
|
+
midIndex = shapePoints.length - 1;
|
|
9897
|
+
}
|
|
9898
|
+
}
|
|
9899
|
+
}
|
|
9900
|
+
}
|
|
9901
|
+
}
|
|
9902
|
+
const projectionType = this.maps.projectionType;
|
|
9903
|
+
let centerY;
|
|
9904
|
+
let eventArgs;
|
|
9905
|
+
const bubbleBorder = {
|
|
9906
|
+
color: bubbleSettings.border.color, opacity: bubbleSettings.border.opacity,
|
|
9907
|
+
width: bubbleSettings.border.width
|
|
9908
|
+
};
|
|
9909
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9910
|
+
const center = findMidPointOfPolygon(shapePoints[midIndex], projectionType, layer.geometryType);
|
|
9911
|
+
if (bubbleSettings.visible) {
|
|
9912
|
+
if (!isNullOrUndefined(center)) {
|
|
9913
|
+
centerY = this.maps.projectionType === 'Mercator' ? center['y'] : (-center['y']);
|
|
9914
|
+
eventArgs = {
|
|
9915
|
+
cancel: false, name: bubbleRendering, border: bubbleBorder,
|
|
9916
|
+
cx: center['x'], cy: centerY, data: shapeData, fill: bubbleColor,
|
|
9917
|
+
maps: this.maps, radius: radius
|
|
9918
|
+
};
|
|
9919
|
+
}
|
|
9920
|
+
else {
|
|
9921
|
+
const shapePointsLength = shapePoints.length - 1;
|
|
9922
|
+
if (shapePoints[shapePointsLength]['x'] && shapePoints[shapePointsLength]['y']) {
|
|
9923
|
+
eventArgs = {
|
|
9924
|
+
cancel: false, name: bubbleRendering, border: bubbleBorder,
|
|
9925
|
+
cx: shapePoints[shapePointsLength]['x'], cy: shapePoints[shapePointsLength]['y'],
|
|
9926
|
+
data: shapeData, fill: bubbleColor, maps: this.maps,
|
|
9927
|
+
radius: radius
|
|
9928
|
+
};
|
|
9929
|
+
}
|
|
9930
|
+
else {
|
|
9931
|
+
return;
|
|
9932
|
+
}
|
|
9933
|
+
}
|
|
9934
|
+
this.maps.trigger('bubbleRendering', eventArgs, (bubbleArgs) => {
|
|
9935
|
+
if (eventArgs.cancel) {
|
|
9936
|
+
return;
|
|
9937
|
+
}
|
|
9938
|
+
let bubbleElement;
|
|
9939
|
+
eventArgs.border.opacity = isNullOrUndefined(eventArgs.border.opacity) ? opacity : eventArgs.border.opacity;
|
|
9940
|
+
if (bubbleSettings.bubbleType === 'Circle') {
|
|
9941
|
+
const circle = new CircleOption(bubbleID, eventArgs.fill, eventArgs.border, opacity, 0, 0, eventArgs.radius, null);
|
|
9942
|
+
bubbleElement = drawCircle(this.maps, circle, group);
|
|
9943
|
+
}
|
|
9944
|
+
else {
|
|
9945
|
+
const y = this.maps.projectionType === 'Mercator' ? (eventArgs.cy - radius) : (eventArgs.cy + radius);
|
|
9946
|
+
const rectangle = new RectOption(bubbleID, eventArgs.fill, eventArgs.border, opacity, new Rect(0, 0, radius * 2, radius * 2), 2, 2);
|
|
9947
|
+
eventArgs.cx -= radius;
|
|
9948
|
+
eventArgs.cy = y;
|
|
9949
|
+
bubbleElement = drawRectangle(this.maps, rectangle, group);
|
|
9950
|
+
}
|
|
9951
|
+
maintainSelection(this.maps.selectedBubbleElementId, this.maps.bubbleSelectionClass, bubbleElement, 'BubbleselectionMapStyle');
|
|
9952
|
+
this.bubbleCollection.push({
|
|
9953
|
+
LayerIndex: layerIndex,
|
|
9954
|
+
BubbleIndex: bubbleIndex,
|
|
9955
|
+
DataIndex: dataIndex,
|
|
9956
|
+
element: bubbleElement,
|
|
9957
|
+
center: { x: eventArgs.cx, y: eventArgs.cy }
|
|
9958
|
+
});
|
|
9959
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9960
|
+
let translate;
|
|
9961
|
+
const animate$$1 = (layer.animationDuration !== 0 || animationMode === 'Enable') || isNullOrUndefined(this.maps.zoomModule);
|
|
9962
|
+
if (this.maps.zoomSettings.zoomFactor > 1 && !isNullOrUndefined(this.maps.zoomModule) && !this.maps.isTileMap) {
|
|
9963
|
+
translate = getZoomTranslate(this.maps, layer, animate$$1);
|
|
9964
|
+
}
|
|
9965
|
+
else {
|
|
9966
|
+
translate = getTranslate(this.maps, layer, animate$$1);
|
|
9967
|
+
}
|
|
9968
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9969
|
+
const bubbleDataSource = bubbleSettings.dataSource;
|
|
9970
|
+
const scale = translate['scale'];
|
|
9971
|
+
const transPoint = translate['location'];
|
|
9972
|
+
const position = new MapLocation((this.maps.isTileMap ? ((eventArgs.cx + this.maps.translatePoint.x) * this.maps.tileZoomLevel) : ((eventArgs.cx + transPoint.x) * scale)), (this.maps.isTileMap ? ((eventArgs.cy + this.maps.translatePoint.y) * this.maps.tileZoomLevel) : ((eventArgs.cy + transPoint.y) * scale)));
|
|
9973
|
+
bubbleElement.setAttribute('transform', 'translate( ' + (position.x) + ' ' + (position.y) + ' )');
|
|
9974
|
+
const bubble = (bubbleDataSource.length - 1) === dataIndex ? 'bubble' : null;
|
|
9975
|
+
if (bubbleSettings.bubbleType === 'Square') {
|
|
9976
|
+
position.x += radius;
|
|
9977
|
+
position.y += radius * (this.maps.projectionType === 'Mercator' ? 1 : -1);
|
|
9978
|
+
}
|
|
9979
|
+
else {
|
|
9980
|
+
radius = 0;
|
|
9981
|
+
}
|
|
9982
|
+
if (bubbleSettings.animationDuration > 0 || animationMode === 'Enable') {
|
|
9983
|
+
elementAnimate(bubbleElement, bubbleSettings.animationDelay, bubbleSettings.animationDuration, position, this.maps, bubble, radius);
|
|
9984
|
+
}
|
|
9985
|
+
});
|
|
9986
|
+
}
|
|
9987
|
+
}
|
|
9988
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9989
|
+
getPoints(shape, points) {
|
|
9990
|
+
if (isNullOrUndefined(shape.map)) {
|
|
9991
|
+
points = shape['point'];
|
|
9992
|
+
}
|
|
9993
|
+
else {
|
|
9994
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9995
|
+
shape.map((current) => {
|
|
9996
|
+
points.push(new Point(current['point']['x'], current['point']['y']));
|
|
9997
|
+
});
|
|
9998
|
+
}
|
|
9999
|
+
return points;
|
|
10000
|
+
}
|
|
10001
|
+
/**
|
|
10002
|
+
* To check and trigger bubble click event
|
|
10003
|
+
*
|
|
10004
|
+
* @param {PointerEvent} e - Specifies the pointer event argument.
|
|
10005
|
+
* @returns {void}
|
|
10006
|
+
* @private
|
|
10007
|
+
*/
|
|
10008
|
+
bubbleClick(e) {
|
|
10009
|
+
const target = e.target.id;
|
|
10010
|
+
if (target.indexOf('_LayerIndex_') === -1) {
|
|
10011
|
+
return;
|
|
10012
|
+
}
|
|
10013
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10014
|
+
const data = this.getbubble(target);
|
|
10015
|
+
if (isNullOrUndefined(data)) {
|
|
10016
|
+
return;
|
|
10017
|
+
}
|
|
10018
|
+
const eventArgs = {
|
|
10019
|
+
cancel: false, name: bubbleClick, data: data, maps: this.maps,
|
|
10020
|
+
target: target, x: e.clientX, y: e.clientY
|
|
10021
|
+
};
|
|
10022
|
+
this.maps.trigger(bubbleClick, eventArgs);
|
|
10023
|
+
}
|
|
10024
|
+
/**
|
|
10025
|
+
* To get bubble from target id
|
|
10026
|
+
*
|
|
10027
|
+
* @param {string} target - Specifies the target
|
|
10028
|
+
* @returns {object} - Returns the object
|
|
10029
|
+
*/
|
|
10030
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10031
|
+
getbubble(target) {
|
|
10032
|
+
const id = target.split('_LayerIndex_');
|
|
10033
|
+
const index = parseInt(id[1].split('_')[0], 10);
|
|
10034
|
+
const layer = this.maps.layers[index];
|
|
10035
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10036
|
+
let data;
|
|
10037
|
+
if (target.indexOf('_BubbleIndex_') > -1) {
|
|
10038
|
+
const bubbleIndex = parseInt(id[1].split('_BubbleIndex_')[1], 10);
|
|
10039
|
+
const dataIndex = parseInt(id[1].split('_BubbleIndex_')[1].split('_dataIndex_')[1], 10);
|
|
10040
|
+
if (!isNaN(bubbleIndex)) {
|
|
10041
|
+
data = layer.bubbleSettings[bubbleIndex].dataSource[dataIndex];
|
|
10042
|
+
return data;
|
|
10043
|
+
}
|
|
10044
|
+
}
|
|
10045
|
+
return null;
|
|
10046
|
+
}
|
|
10047
|
+
// eslint-disable-next-line valid-jsdoc
|
|
10048
|
+
/**
|
|
10049
|
+
* To check and trigger bubble move event
|
|
10050
|
+
*
|
|
10051
|
+
* @param {PointerEvent} e - Specifies the pointer event argument.
|
|
10052
|
+
* @retruns {void}
|
|
10053
|
+
* @private
|
|
10054
|
+
*/
|
|
10055
|
+
bubbleMove(e) {
|
|
10056
|
+
const target = e.target.id;
|
|
10057
|
+
if (target.indexOf('_LayerIndex_') === -1) {
|
|
10058
|
+
return;
|
|
10059
|
+
}
|
|
10060
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10061
|
+
const data = this.getbubble(target);
|
|
10062
|
+
if (isNullOrUndefined(data)) {
|
|
10063
|
+
return;
|
|
10064
|
+
}
|
|
10065
|
+
const eventArgs = {
|
|
10066
|
+
cancel: false, name: bubbleMouseMove, data: data, maps: this.maps,
|
|
10067
|
+
target: target, x: e.clientX, y: e.clientY
|
|
10068
|
+
};
|
|
10069
|
+
this.maps.trigger(bubbleMouseMove, eventArgs);
|
|
10070
|
+
}
|
|
10071
|
+
/**
|
|
10072
|
+
* Get module name.
|
|
10073
|
+
*
|
|
10074
|
+
* @returns {string} - Returns the module name.
|
|
10075
|
+
*/
|
|
10076
|
+
getModuleName() {
|
|
10077
|
+
return 'Bubble';
|
|
10078
|
+
}
|
|
10079
|
+
/**
|
|
10080
|
+
* To destroy the bubble.
|
|
10081
|
+
*
|
|
10082
|
+
* @returns {void}
|
|
10083
|
+
* @private
|
|
10084
|
+
*/
|
|
10085
|
+
destroy() {
|
|
10086
|
+
this.bubbleCollection = [];
|
|
10087
|
+
//TODO: Calling the below code throws spec issue.
|
|
10088
|
+
//this.maps = null;
|
|
10089
|
+
}
|
|
10090
|
+
}
|
|
10091
|
+
|
|
10092
|
+
/**
|
|
10093
|
+
* Marker class
|
|
10143
10094
|
*/
|
|
10144
|
-
class
|
|
10095
|
+
class Marker {
|
|
10145
10096
|
constructor(maps) {
|
|
10146
|
-
/**
|
|
10147
|
-
* Bubble Id for current layer
|
|
10148
|
-
* @private
|
|
10149
|
-
*/
|
|
10150
|
-
this.id = '';
|
|
10151
10097
|
this.maps = maps;
|
|
10152
|
-
this.
|
|
10098
|
+
this.trackElements = [];
|
|
10099
|
+
this.sameMarkerData = [];
|
|
10100
|
+
}
|
|
10101
|
+
markerRender(maps, layerElement, layerIndex, factor, type) {
|
|
10102
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10103
|
+
let templateFn;
|
|
10104
|
+
let markerCount = 0;
|
|
10105
|
+
let nullCount = 0;
|
|
10106
|
+
let markerTemplateCount = 0;
|
|
10107
|
+
maps.translateType = 'marker';
|
|
10108
|
+
const currentLayer = maps.layersCollection[layerIndex];
|
|
10109
|
+
this.markerSVGObject = maps.renderer.createGroup({
|
|
10110
|
+
id: maps.element.id + '_Markers_Group',
|
|
10111
|
+
class: 'GroupElement'
|
|
10112
|
+
});
|
|
10113
|
+
this.markerSVGObject.style.pointerEvents = 'auto';
|
|
10114
|
+
const markerTemplateEle = createElement('div', {
|
|
10115
|
+
id: maps.element.id + '_LayerIndex_' + layerIndex + '_Markers_Template_Group',
|
|
10116
|
+
className: maps.element.id + '_template'
|
|
10117
|
+
});
|
|
10118
|
+
markerTemplateEle.style.cssText = 'overflow: hidden; position: absolute;pointer-events: none;' +
|
|
10119
|
+
'top:' + maps.mapAreaRect.y + 'px;' +
|
|
10120
|
+
'left:' + maps.mapAreaRect.x + 'px;' +
|
|
10121
|
+
'height:' + maps.mapAreaRect.height + 'px;' +
|
|
10122
|
+
'width:' + maps.mapAreaRect.width + 'px;';
|
|
10123
|
+
currentLayer.markerSettings.map((markerSettings, markerIndex) => {
|
|
10124
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10125
|
+
const markerData = markerSettings.dataSource;
|
|
10126
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10127
|
+
Array.prototype.forEach.call(markerData, (data, dataIndex) => {
|
|
10128
|
+
maps.markerNullCount = markerIndex > 0 && dataIndex === 0 ? 0 : maps.markerNullCount;
|
|
10129
|
+
let eventArgs = {
|
|
10130
|
+
cancel: false, name: markerRendering, fill: markerSettings.fill, height: markerSettings.height,
|
|
10131
|
+
width: markerSettings.width, imageUrl: markerSettings.imageUrl, shape: markerSettings.shape,
|
|
10132
|
+
template: markerSettings.template, data: data, maps: maps, marker: markerSettings,
|
|
10133
|
+
border: markerSettings.border, colorValuePath: markerSettings.colorValuePath,
|
|
10134
|
+
shapeValuePath: markerSettings.shapeValuePath, imageUrlValuePath: markerSettings.imageUrlValuePath
|
|
10135
|
+
};
|
|
10136
|
+
maps.trigger('markerRendering', eventArgs, (MarkerArgs) => {
|
|
10137
|
+
eventArgs = markerColorChoose(eventArgs, data);
|
|
10138
|
+
eventArgs = markerShapeChoose(eventArgs, data);
|
|
10139
|
+
const lng = (!isNullOrUndefined(markerSettings.longitudeValuePath)) ?
|
|
10140
|
+
Number(getValueFromObject(data, markerSettings.longitudeValuePath)) : !isNullOrUndefined(data['longitude']) ?
|
|
10141
|
+
parseFloat(data['longitude']) : !isNullOrUndefined(data['Longitude']) ? parseFloat(data['Longitude']) : null;
|
|
10142
|
+
const lat = (!isNullOrUndefined(markerSettings.latitudeValuePath)) ?
|
|
10143
|
+
Number(getValueFromObject(data, markerSettings.latitudeValuePath)) : !isNullOrUndefined(data['latitude']) ?
|
|
10144
|
+
parseFloat(data['latitude']) : !isNullOrUndefined(data['Latitude']) ? parseFloat(data['Latitude']) : null;
|
|
10145
|
+
const offset = markerSettings.offset;
|
|
10146
|
+
if (!eventArgs.cancel && markerSettings.visible && !isNullOrUndefined(lng) && !isNullOrUndefined(lat)) {
|
|
10147
|
+
const markerID = maps.element.id + '_LayerIndex_' + layerIndex + '_MarkerIndex_'
|
|
10148
|
+
+ markerIndex + '_dataIndex_' + dataIndex;
|
|
10149
|
+
let location = (maps.isTileMap) ? convertTileLatLongToPoint(new MapLocation(lng, lat), factor, maps.tileTranslatePoint, true) : convertGeoToPoint(lat, lng, factor, currentLayer, maps);
|
|
10150
|
+
const animate$$1 = (currentLayer.animationDuration !== 0 || animationMode === 'Enable') || isNullOrUndefined(maps.zoomModule);
|
|
10151
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10152
|
+
const translate = (maps.isTileMap) ? (currentLayer.type === 'SubLayer' && isNullOrUndefined(maps.zoomModule)) ? location = convertTileLatLongToPoint(new MapLocation(lng, lat), maps.tileZoomLevel, maps.tileTranslatePoint, true) : new Object() :
|
|
10153
|
+
!isNullOrUndefined(maps.zoomModule) && maps.zoomSettings.zoomFactor > 1 ?
|
|
10154
|
+
getZoomTranslate(maps, currentLayer, animate$$1) :
|
|
10155
|
+
getTranslate(maps, currentLayer, animate$$1);
|
|
10156
|
+
const scale = type === 'AddMarker' ? maps.scale : translate['scale'];
|
|
10157
|
+
const transPoint = type === 'AddMarker' ? maps.translatePoint : translate['location'];
|
|
10158
|
+
if (eventArgs.template && (!isNaN(location.x) && !isNaN(location.y))) {
|
|
10159
|
+
markerTemplateCount++;
|
|
10160
|
+
markerTemplate(eventArgs, templateFn, markerID, data, markerIndex, markerTemplateEle, location, transPoint, scale, offset, maps);
|
|
10161
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10162
|
+
maps.renderReactTemplates();
|
|
10163
|
+
}
|
|
10164
|
+
else if (!eventArgs.template && (!isNaN(location.x) && !isNaN(location.y))) {
|
|
10165
|
+
markerCount++;
|
|
10166
|
+
marker(eventArgs, markerSettings, markerData, dataIndex, location, transPoint, markerID, offset, scale, maps, this.markerSVGObject);
|
|
10167
|
+
}
|
|
10168
|
+
}
|
|
10169
|
+
nullCount += (!isNaN(lat) && !isNaN(lng)) ? 0 : 1;
|
|
10170
|
+
markerTemplateCount += (eventArgs.cancel) ? 1 : 0;
|
|
10171
|
+
markerCount += (eventArgs.cancel) ? 1 : 0;
|
|
10172
|
+
maps.markerNullCount = (isNullOrUndefined(lng) || isNullOrUndefined(lat)) ?
|
|
10173
|
+
maps.markerNullCount + 1 : maps.markerNullCount;
|
|
10174
|
+
const markerDataLength = markerData.length - maps.markerNullCount;
|
|
10175
|
+
if (this.markerSVGObject.childElementCount === (markerDataLength - markerTemplateCount - nullCount) && (type !== 'Template')) {
|
|
10176
|
+
layerElement.appendChild(this.markerSVGObject);
|
|
10177
|
+
if (currentLayer.markerClusterSettings.allowClustering) {
|
|
10178
|
+
maps.svgObject.appendChild(this.markerSVGObject);
|
|
10179
|
+
maps.element.appendChild(maps.svgObject);
|
|
10180
|
+
if ((currentLayer.layerType === 'OSM' || (currentLayer.urlTemplate.indexOf('openstreetmap') !== -1 && isNullOrUndefined(currentLayer.shapeData)))
|
|
10181
|
+
&& maps.zoomSettings.enable) {
|
|
10182
|
+
clusterTemplate(currentLayer, this.markerSVGObject, maps, layerIndex, this.markerSVGObject, layerElement, true, false);
|
|
10183
|
+
layerElement.appendChild(this.markerSVGObject);
|
|
10184
|
+
}
|
|
10185
|
+
else {
|
|
10186
|
+
clusterTemplate(currentLayer, this.markerSVGObject, maps, layerIndex, this.markerSVGObject, layerElement, true, false);
|
|
10187
|
+
}
|
|
10188
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10189
|
+
maps.renderReactTemplates();
|
|
10190
|
+
}
|
|
10191
|
+
}
|
|
10192
|
+
if (markerTemplateEle.childElementCount === (markerDataLength - markerCount - nullCount) && getElementByID(maps.element.id + '_Secondary_Element')) {
|
|
10193
|
+
getElementByID(maps.element.id + '_Secondary_Element').appendChild(markerTemplateEle);
|
|
10194
|
+
if (maps.checkInitialRender) {
|
|
10195
|
+
if (currentLayer.markerClusterSettings.allowClustering) {
|
|
10196
|
+
clusterTemplate(currentLayer, markerTemplateEle, maps, layerIndex, this.markerSVGObject, layerElement, false, false);
|
|
10197
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10198
|
+
maps.renderReactTemplates();
|
|
10199
|
+
}
|
|
10200
|
+
}
|
|
10201
|
+
}
|
|
10202
|
+
});
|
|
10203
|
+
});
|
|
10204
|
+
});
|
|
10153
10205
|
}
|
|
10154
|
-
// eslint-disable-next-line valid-jsdoc
|
|
10155
10206
|
/**
|
|
10156
|
-
* To
|
|
10207
|
+
* To find zoom level for individual layers like India, USA.
|
|
10157
10208
|
*
|
|
10158
|
-
* @
|
|
10209
|
+
* @param {number} mapWidth - Specifies the width of the maps
|
|
10210
|
+
* @param {number} mapHeight - Specifies the height of the maps
|
|
10211
|
+
* @param {number} maxZoomFact - Specifies the maximum zoom factor
|
|
10212
|
+
* @returns {number} - Returns the scale factor
|
|
10159
10213
|
*/
|
|
10160
|
-
|
|
10161
|
-
|
|
10162
|
-
|
|
10163
|
-
|
|
10164
|
-
const
|
|
10165
|
-
|
|
10166
|
-
|
|
10167
|
-
|
|
10168
|
-
|
|
10169
|
-
const
|
|
10170
|
-
|
|
10171
|
-
|
|
10172
|
-
|
|
10173
|
-
Number(getValueFromObject(shapeData, bubbleSettings.valuePath)) : Number(shapeData[bubbleSettings.valuePath])) :
|
|
10174
|
-
Number(shapeData[bubbleSettings.valuePath]);
|
|
10175
|
-
let opacity;
|
|
10176
|
-
let bubbleColor;
|
|
10177
|
-
if (isNaN(bubbleValue) && isNaN(colorValue) && isNullOrUndefined(equalValue)) {
|
|
10178
|
-
return null;
|
|
10214
|
+
calculateIndividualLayerMarkerZoomLevel(mapWidth, mapHeight, maxZoomFact) {
|
|
10215
|
+
let latZoom;
|
|
10216
|
+
let lngZoom;
|
|
10217
|
+
const height = Math.abs(this.maps.baseMapBounds.latitude.max - this.maps.baseMapBounds.latitude.min);
|
|
10218
|
+
const width = Math.abs(this.maps.baseMapBounds.longitude.max - this.maps.baseMapBounds.longitude.min);
|
|
10219
|
+
latZoom = Math.floor(Math.log(mapHeight / height));
|
|
10220
|
+
latZoom = (latZoom > maxZoomFact) ? maxZoomFact : latZoom;
|
|
10221
|
+
lngZoom = Math.floor(Math.log(mapWidth / width));
|
|
10222
|
+
lngZoom = (lngZoom > maxZoomFact) ? maxZoomFact : lngZoom;
|
|
10223
|
+
const result = Math.min(latZoom, lngZoom);
|
|
10224
|
+
const scaleFactor = Math.min(result, maxZoomFact - 1);
|
|
10225
|
+
if (!this.maps.isTileMap) {
|
|
10226
|
+
compareZoomFactor(scaleFactor, this.maps);
|
|
10179
10227
|
}
|
|
10180
|
-
|
|
10181
|
-
|
|
10182
|
-
|
|
10183
|
-
|
|
10184
|
-
|
|
10185
|
-
|
|
10186
|
-
|
|
10187
|
-
|
|
10188
|
-
|
|
10189
|
-
|
|
10190
|
-
|
|
10191
|
-
|
|
10192
|
-
|
|
10193
|
-
|
|
10194
|
-
|
|
10195
|
-
|
|
10196
|
-
|
|
10197
|
-
|
|
10198
|
-
|
|
10199
|
-
|
|
10200
|
-
|
|
10201
|
-
|
|
10202
|
-
|
|
10203
|
-
|
|
10204
|
-
|
|
10205
|
-
|
|
10206
|
-
|
|
10207
|
-
|
|
10208
|
-
|
|
10209
|
-
|
|
10210
|
-
|
|
10211
|
-
|
|
10228
|
+
return scaleFactor;
|
|
10229
|
+
}
|
|
10230
|
+
/**
|
|
10231
|
+
* To calculate center position and factor value dynamically
|
|
10232
|
+
*
|
|
10233
|
+
* @param {LayerSettings[]} layersCollection - Specifies the layer settings instance.
|
|
10234
|
+
* @returns {void}
|
|
10235
|
+
* @private
|
|
10236
|
+
*/
|
|
10237
|
+
calculateZoomCenterPositionAndFactor(layersCollection) {
|
|
10238
|
+
if (!isNullOrUndefined(this.maps)) {
|
|
10239
|
+
if (this.maps.zoomSettings.shouldZoomInitially && this.maps.markerModule) {
|
|
10240
|
+
let minLong;
|
|
10241
|
+
let maxLat;
|
|
10242
|
+
let minLat;
|
|
10243
|
+
let maxLong;
|
|
10244
|
+
let zoomLevel;
|
|
10245
|
+
let centerLat;
|
|
10246
|
+
let centerLong;
|
|
10247
|
+
const maxZoomFact = this.maps.zoomSettings.maxZoom;
|
|
10248
|
+
const mapWidth = this.maps.mapAreaRect.width;
|
|
10249
|
+
const mapHeight = this.maps.mapAreaRect.height;
|
|
10250
|
+
this.maps.markerZoomedState = this.maps.markerZoomedState ? this.maps.markerZoomedState :
|
|
10251
|
+
isNullOrUndefined(this.maps.markerZoomFactor) ? !this.maps.markerZoomedState :
|
|
10252
|
+
this.maps.markerZoomFactor > 1 ? this.maps.markerZoomedState : !this.maps.markerZoomedState;
|
|
10253
|
+
this.maps.defaultState = this.maps.markerZoomedState ? !this.maps.markerZoomedState : this.maps.defaultState;
|
|
10254
|
+
Array.prototype.forEach.call(layersCollection, (currentLayer) => {
|
|
10255
|
+
const isMarker = currentLayer.markerSettings.length !== 0;
|
|
10256
|
+
if (isMarker) {
|
|
10257
|
+
Array.prototype.forEach.call(currentLayer.markerSettings, (markerSetting) => {
|
|
10258
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10259
|
+
const markerData = markerSetting.dataSource;
|
|
10260
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10261
|
+
Array.prototype.forEach.call(markerData, (data, dataIndex) => {
|
|
10262
|
+
const latitude = !isNullOrUndefined(data['latitude']) ? parseFloat(data['latitude']) :
|
|
10263
|
+
!isNullOrUndefined(data['Latitude']) ? parseFloat(data['Latitude']) : null;
|
|
10264
|
+
const longitude = !isNullOrUndefined(data['longitude']) ? parseFloat(data['longitude']) :
|
|
10265
|
+
!isNullOrUndefined(data['Longitude']) ? parseFloat(data['Longitude']) : null;
|
|
10266
|
+
if (!isNullOrUndefined(latitude) && !isNullOrUndefined(longitude)) {
|
|
10267
|
+
minLong = isNullOrUndefined(minLong) && dataIndex === 0 ?
|
|
10268
|
+
longitude : minLong;
|
|
10269
|
+
maxLat = isNullOrUndefined(maxLat) && dataIndex === 0 ?
|
|
10270
|
+
latitude : maxLat;
|
|
10271
|
+
minLat = isNullOrUndefined(minLat) && dataIndex === 0 ?
|
|
10272
|
+
latitude : minLat;
|
|
10273
|
+
maxLong = isNullOrUndefined(maxLong) && dataIndex === 0 ?
|
|
10274
|
+
longitude : maxLong;
|
|
10275
|
+
if (minLong > longitude) {
|
|
10276
|
+
minLong = longitude;
|
|
10277
|
+
}
|
|
10278
|
+
if (minLat > latitude) {
|
|
10279
|
+
minLat = latitude;
|
|
10280
|
+
}
|
|
10281
|
+
if (maxLong < longitude) {
|
|
10282
|
+
maxLong = longitude;
|
|
10283
|
+
}
|
|
10284
|
+
if (maxLat < latitude) {
|
|
10285
|
+
maxLat = latitude;
|
|
10286
|
+
}
|
|
10287
|
+
}
|
|
10288
|
+
});
|
|
10289
|
+
});
|
|
10212
10290
|
}
|
|
10213
|
-
}
|
|
10214
|
-
|
|
10215
|
-
|
|
10216
|
-
|
|
10217
|
-
|
|
10218
|
-
|
|
10219
|
-
|
|
10220
|
-
|
|
10221
|
-
|
|
10222
|
-
|
|
10223
|
-
|
|
10291
|
+
});
|
|
10292
|
+
if (!isNullOrUndefined(minLat) && !isNullOrUndefined(minLong) &&
|
|
10293
|
+
!isNullOrUndefined(maxLong) && !isNullOrUndefined(maxLat)) {
|
|
10294
|
+
// To find the center position
|
|
10295
|
+
centerLat = (minLat + maxLat) / 2;
|
|
10296
|
+
centerLong = (minLong + maxLong) / 2;
|
|
10297
|
+
this.maps.markerCenterLatitude = centerLat;
|
|
10298
|
+
this.maps.markerCenterLongitude = centerLong;
|
|
10299
|
+
if (isNullOrUndefined(this.maps.markerZoomCenterPoint) || this.maps.markerZoomedState) {
|
|
10300
|
+
this.maps.markerZoomCenterPoint = {
|
|
10301
|
+
latitude: centerLat,
|
|
10302
|
+
longitude: centerLong
|
|
10303
|
+
};
|
|
10304
|
+
}
|
|
10305
|
+
let markerFactor;
|
|
10306
|
+
if (this.maps.isTileMap || this.maps.baseMapRectBounds['min']['x'] === 0) {
|
|
10307
|
+
zoomLevel = calculateZoomLevel(minLat, maxLat, minLong, maxLong, mapWidth, mapHeight, this.maps, false);
|
|
10308
|
+
if (this.maps.isTileMap) {
|
|
10309
|
+
markerFactor = isNullOrUndefined(this.maps.markerZoomFactor) ?
|
|
10310
|
+
zoomLevel : isNullOrUndefined(this.maps.mapScaleValue) ?
|
|
10311
|
+
zoomLevel : this.maps.mapScaleValue > 1 && this.maps.markerZoomFactor !== 1 ?
|
|
10312
|
+
this.maps.mapScaleValue : zoomLevel;
|
|
10313
|
+
}
|
|
10314
|
+
else {
|
|
10315
|
+
markerFactor = isNullOrUndefined(this.maps.mapScaleValue) ? zoomLevel :
|
|
10316
|
+
(Math.floor(this.maps.scale) !== 1 &&
|
|
10317
|
+
this.maps.mapScaleValue !== zoomLevel)
|
|
10318
|
+
&&
|
|
10319
|
+
(isNullOrUndefined(this.maps.shouldZoomCurrentFactor))
|
|
10320
|
+
? this.maps.mapScaleValue : zoomLevel;
|
|
10321
|
+
if (((markerFactor === this.maps.mapScaleValue &&
|
|
10322
|
+
(this.maps.markerZoomFactor === 1 || this.maps.mapScaleValue === 1))
|
|
10323
|
+
&& (!this.maps.enablePersistence))) {
|
|
10324
|
+
markerFactor = zoomLevel;
|
|
10325
|
+
}
|
|
10224
10326
|
}
|
|
10225
10327
|
}
|
|
10328
|
+
else {
|
|
10329
|
+
zoomLevel = this.calculateIndividualLayerMarkerZoomLevel(mapWidth, mapHeight, maxZoomFact);
|
|
10330
|
+
markerFactor = isNullOrUndefined(this.maps.mapScaleValue) ? zoomLevel :
|
|
10331
|
+
(this.maps.mapScaleValue !== zoomLevel)
|
|
10332
|
+
? this.maps.mapScaleValue : zoomLevel;
|
|
10333
|
+
}
|
|
10334
|
+
this.maps.markerZoomFactor = markerFactor;
|
|
10226
10335
|
}
|
|
10227
10336
|
}
|
|
10228
|
-
}
|
|
10229
|
-
const projectionType = this.maps.projectionType;
|
|
10230
|
-
let centerY;
|
|
10231
|
-
let eventArgs;
|
|
10232
|
-
const bubbleBorder = {
|
|
10233
|
-
color: bubbleSettings.border.color, opacity: bubbleSettings.border.opacity,
|
|
10234
|
-
width: bubbleSettings.border.width
|
|
10235
|
-
};
|
|
10236
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10237
|
-
const center = findMidPointOfPolygon(shapePoints[midIndex], projectionType, layer.geometryType);
|
|
10238
|
-
if (bubbleSettings.visible) {
|
|
10239
|
-
if (!isNullOrUndefined(center)) {
|
|
10240
|
-
centerY = this.maps.projectionType === 'Mercator' ? center['y'] : (-center['y']);
|
|
10241
|
-
eventArgs = {
|
|
10242
|
-
cancel: false, name: bubbleRendering, border: bubbleBorder,
|
|
10243
|
-
cx: center['x'], cy: centerY, data: shapeData, fill: bubbleColor,
|
|
10244
|
-
maps: this.maps, radius: radius
|
|
10245
|
-
};
|
|
10246
|
-
}
|
|
10247
10337
|
else {
|
|
10248
|
-
|
|
10249
|
-
if (
|
|
10250
|
-
|
|
10251
|
-
|
|
10252
|
-
|
|
10253
|
-
|
|
10254
|
-
|
|
10255
|
-
}
|
|
10338
|
+
this.maps.markerZoomedState = false;
|
|
10339
|
+
if (this.maps.markerZoomFactor > 1) {
|
|
10340
|
+
this.maps.markerCenterLatitude = null;
|
|
10341
|
+
this.maps.markerCenterLongitude = null;
|
|
10342
|
+
this.maps.markerZoomFactor = 1;
|
|
10343
|
+
if (!this.maps.enablePersistence) {
|
|
10344
|
+
this.maps.mapScaleValue = 1;
|
|
10345
|
+
}
|
|
10256
10346
|
}
|
|
10257
|
-
|
|
10258
|
-
|
|
10347
|
+
if (this.maps.isTileMap && !this.maps.enablePersistence
|
|
10348
|
+
&& this.maps.mapScaleValue <= 1) {
|
|
10349
|
+
this.maps.tileZoomLevel = this.maps.mapScaleValue === 0 ? (this.maps.isZoomByPosition ? this.maps.tileZoomLevel : 1)
|
|
10350
|
+
: this.maps.mapScaleValue;
|
|
10351
|
+
if (this.maps.mapScaleValue === 1 && this.maps.markerZoomFactor === 1) {
|
|
10352
|
+
this.maps.tileTranslatePoint.x = 0;
|
|
10353
|
+
this.maps.tileTranslatePoint.y = 0;
|
|
10354
|
+
}
|
|
10259
10355
|
}
|
|
10260
10356
|
}
|
|
10261
|
-
this.maps.trigger('bubbleRendering', eventArgs, (bubbleArgs) => {
|
|
10262
|
-
if (eventArgs.cancel) {
|
|
10263
|
-
return;
|
|
10264
|
-
}
|
|
10265
|
-
let bubbleElement;
|
|
10266
|
-
eventArgs.border.opacity = isNullOrUndefined(eventArgs.border.opacity) ? opacity : eventArgs.border.opacity;
|
|
10267
|
-
if (bubbleSettings.bubbleType === 'Circle') {
|
|
10268
|
-
const circle = new CircleOption(bubbleID, eventArgs.fill, eventArgs.border, opacity, 0, 0, eventArgs.radius, null);
|
|
10269
|
-
bubbleElement = drawCircle(this.maps, circle, group);
|
|
10270
|
-
}
|
|
10271
|
-
else {
|
|
10272
|
-
const y = this.maps.projectionType === 'Mercator' ? (eventArgs.cy - radius) : (eventArgs.cy + radius);
|
|
10273
|
-
const rectangle = new RectOption(bubbleID, eventArgs.fill, eventArgs.border, opacity, new Rect(0, 0, radius * 2, radius * 2), 2, 2);
|
|
10274
|
-
eventArgs.cx -= radius;
|
|
10275
|
-
eventArgs.cy = y;
|
|
10276
|
-
bubbleElement = drawRectangle(this.maps, rectangle, group);
|
|
10277
|
-
}
|
|
10278
|
-
maintainSelection(this.maps.selectedBubbleElementId, this.maps.bubbleSelectionClass, bubbleElement, 'BubbleselectionMapStyle');
|
|
10279
|
-
this.bubbleCollection.push({
|
|
10280
|
-
LayerIndex: layerIndex,
|
|
10281
|
-
BubbleIndex: bubbleIndex,
|
|
10282
|
-
DataIndex: dataIndex,
|
|
10283
|
-
element: bubbleElement,
|
|
10284
|
-
center: { x: eventArgs.cx, y: eventArgs.cy }
|
|
10285
|
-
});
|
|
10286
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10287
|
-
let translate;
|
|
10288
|
-
const animate$$1 = (layer.animationDuration !== 0 || animationMode === 'Enable') || isNullOrUndefined(this.maps.zoomModule);
|
|
10289
|
-
if (this.maps.zoomSettings.zoomFactor > 1 && !isNullOrUndefined(this.maps.zoomModule) && !this.maps.isTileMap) {
|
|
10290
|
-
translate = getZoomTranslate(this.maps, layer, animate$$1);
|
|
10291
|
-
}
|
|
10292
|
-
else {
|
|
10293
|
-
translate = getTranslate(this.maps, layer, animate$$1);
|
|
10294
|
-
}
|
|
10295
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10296
|
-
const bubbleDataSource = bubbleSettings.dataSource;
|
|
10297
|
-
const scale = translate['scale'];
|
|
10298
|
-
const transPoint = translate['location'];
|
|
10299
|
-
const position = new MapLocation((this.maps.isTileMap ? ((eventArgs.cx + this.maps.translatePoint.x) * this.maps.tileZoomLevel) : ((eventArgs.cx + transPoint.x) * scale)), (this.maps.isTileMap ? ((eventArgs.cy + this.maps.translatePoint.y) * this.maps.tileZoomLevel) : ((eventArgs.cy + transPoint.y) * scale)));
|
|
10300
|
-
bubbleElement.setAttribute('transform', 'translate( ' + (position.x) + ' ' + (position.y) + ' )');
|
|
10301
|
-
const bubble = (bubbleDataSource.length - 1) === dataIndex ? 'bubble' : null;
|
|
10302
|
-
if (bubbleSettings.bubbleType === 'Square') {
|
|
10303
|
-
position.x += radius;
|
|
10304
|
-
position.y += radius * (this.maps.projectionType === 'Mercator' ? 1 : -1);
|
|
10305
|
-
}
|
|
10306
|
-
else {
|
|
10307
|
-
radius = 0;
|
|
10308
|
-
}
|
|
10309
|
-
if (bubbleSettings.animationDuration > 0 || animationMode === 'Enable') {
|
|
10310
|
-
elementAnimate(bubbleElement, bubbleSettings.animationDelay, bubbleSettings.animationDuration, position, this.maps, bubble, radius);
|
|
10311
|
-
}
|
|
10312
|
-
});
|
|
10313
10357
|
}
|
|
10314
10358
|
}
|
|
10315
|
-
|
|
10316
|
-
|
|
10317
|
-
|
|
10318
|
-
|
|
10359
|
+
/**
|
|
10360
|
+
* To check and trigger marker click event
|
|
10361
|
+
* @param {PointerEvent} e - Specifies the pointer event argument.
|
|
10362
|
+
* @returns {void}
|
|
10363
|
+
* @private
|
|
10364
|
+
*/
|
|
10365
|
+
markerClick(e) {
|
|
10366
|
+
let target = e.target.id;
|
|
10367
|
+
if (target.indexOf(this.maps.element.id) === -1) {
|
|
10368
|
+
const ancestor = e.target.closest('.' + this.maps.element.id + '_marker_template_element');
|
|
10369
|
+
if (!isNullOrUndefined(ancestor) && ancestor.id.indexOf('_MarkerIndex_') > -1) {
|
|
10370
|
+
target = ancestor.id;
|
|
10371
|
+
}
|
|
10372
|
+
}
|
|
10373
|
+
if (target.indexOf('_LayerIndex_') === -1 || target.indexOf('_cluster_') > 0) {
|
|
10374
|
+
return;
|
|
10375
|
+
}
|
|
10376
|
+
const options = this.getMarker(target);
|
|
10377
|
+
if (isNullOrUndefined(options)) {
|
|
10378
|
+
return;
|
|
10319
10379
|
}
|
|
10320
|
-
|
|
10321
|
-
|
|
10322
|
-
|
|
10323
|
-
|
|
10324
|
-
|
|
10380
|
+
if (options.marker.enableDrag) {
|
|
10381
|
+
document.getElementById(this.maps.element.id + "_svg").style.cursor = 'grabbing';
|
|
10382
|
+
}
|
|
10383
|
+
const eventArgs = {
|
|
10384
|
+
cancel: false, name: markerClick, data: options.data, maps: this.maps,
|
|
10385
|
+
marker: options.marker, target: target, x: e.clientX, y: e.clientY,
|
|
10386
|
+
latitude: options.data['latitude'] || options.data['Latitude'],
|
|
10387
|
+
longitude: options.data['longitude'] || options.data['Longitude'],
|
|
10388
|
+
value: options.data['name']
|
|
10389
|
+
};
|
|
10390
|
+
this.maps.trigger(markerClick, eventArgs);
|
|
10391
|
+
if (options.marker.enableDrag) {
|
|
10392
|
+
let isCluster = false;
|
|
10393
|
+
const layerIndex = parseInt(target.split('_LayerIndex_')[1].split('_')[0], 10);
|
|
10394
|
+
const markerIndex = parseInt(target.split('_MarkerIndex_')[1].split('_')[0], 10);
|
|
10395
|
+
const dataIndex = parseInt(target.split('_dataIndex_')[1].split('_')[0], 10);
|
|
10396
|
+
const marker$$1 = this.maps.layers[layerIndex].markerSettings[markerIndex];
|
|
10397
|
+
if (this.sameMarkerData.length > 0) {
|
|
10398
|
+
isCluster = (this.sameMarkerData[0].data.filter((el) => { return (el['index'] == dataIndex); })).length > 0 &&
|
|
10399
|
+
this.sameMarkerData[0].layerIndex === layerIndex && this.sameMarkerData[0].markerIndex === markerIndex;
|
|
10400
|
+
}
|
|
10401
|
+
if (!isCluster) {
|
|
10402
|
+
const dragEventArgs = {
|
|
10403
|
+
name: markerDragStart, x: e.clientX, y: e.clientY,
|
|
10404
|
+
latitude: options.data['latitude'] || options.data['Latitude'],
|
|
10405
|
+
longitude: options.data['longitude'] || options.data['Longitude'],
|
|
10406
|
+
layerIndex: layerIndex, markerIndex: markerIndex, dataIndex: dataIndex
|
|
10407
|
+
};
|
|
10408
|
+
this.maps.trigger(markerDragStart, dragEventArgs);
|
|
10409
|
+
this.maps.markerDragArgument = {
|
|
10410
|
+
targetId: target, x: e.clientX, y: e.clientY,
|
|
10411
|
+
latitude: options.data['latitude'] || options.data['Latitude'],
|
|
10412
|
+
longitude: options.data['longitude'] || options.data['Longitude'],
|
|
10413
|
+
shape: isNullOrUndefined(marker$$1.shapeValuePath) ? marker$$1.shape : marker$$1.dataSource[dataIndex][marker$$1.shapeValuePath],
|
|
10414
|
+
layerIndex: layerIndex, markerIndex: markerIndex, dataIndex: dataIndex
|
|
10415
|
+
};
|
|
10416
|
+
}
|
|
10325
10417
|
}
|
|
10326
|
-
return points;
|
|
10327
10418
|
}
|
|
10328
10419
|
/**
|
|
10329
|
-
* To check and trigger
|
|
10330
|
-
*
|
|
10420
|
+
* To check and trigger Cluster click event
|
|
10331
10421
|
* @param {PointerEvent} e - Specifies the pointer event argument.
|
|
10332
10422
|
* @returns {void}
|
|
10333
10423
|
* @private
|
|
10334
10424
|
*/
|
|
10335
|
-
|
|
10425
|
+
markerClusterClick(e) {
|
|
10336
10426
|
const target = e.target.id;
|
|
10337
|
-
if (target.indexOf('_LayerIndex_') === -1) {
|
|
10427
|
+
if (target.indexOf('_LayerIndex_') === -1 || target.indexOf('_cluster_') === -1) {
|
|
10338
10428
|
return;
|
|
10339
10429
|
}
|
|
10340
|
-
|
|
10341
|
-
|
|
10342
|
-
if (isNullOrUndefined(data)) {
|
|
10430
|
+
const options = this.getMarker(target);
|
|
10431
|
+
if (isNullOrUndefined(options)) {
|
|
10343
10432
|
return;
|
|
10344
10433
|
}
|
|
10434
|
+
if ((options.clusterCollection.length > 0 && this.maps.markerClusterExpand)) {
|
|
10435
|
+
if (getElement(this.maps.element.id + '_mapsTooltip') &&
|
|
10436
|
+
this.maps.mapsTooltipModule.tooltipTargetID.indexOf('_MarkerIndex_') > -1) {
|
|
10437
|
+
removeElement(this.maps.element.id + '_mapsTooltip');
|
|
10438
|
+
}
|
|
10439
|
+
if (this.sameMarkerData.length > 0 && !this.maps.markerClusterExpandCheck) {
|
|
10440
|
+
this.maps.markerClusterExpandCheck = true;
|
|
10441
|
+
mergeSeparateCluster(this.sameMarkerData, this.maps, this.markerSVGObject);
|
|
10442
|
+
}
|
|
10443
|
+
else {
|
|
10444
|
+
this.sameMarkerData = options.clusterCollection;
|
|
10445
|
+
this.maps.markerClusterExpandCheck = false;
|
|
10446
|
+
clusterSeparate(this.sameMarkerData, this.maps, this.markerSVGObject, true);
|
|
10447
|
+
}
|
|
10448
|
+
}
|
|
10345
10449
|
const eventArgs = {
|
|
10346
|
-
cancel: false, name:
|
|
10347
|
-
target: target, x: e.clientX, y: e.clientY
|
|
10450
|
+
cancel: false, name: markerClusterClick, data: options, maps: this.maps,
|
|
10451
|
+
target: target, x: e.clientX, y: e.clientY,
|
|
10452
|
+
latitude: options.data['latitude'] || options.data['Latitude'], longitude: options.data['longitude'] || options.data['Longitude'],
|
|
10453
|
+
markerClusterCollection: options['markCollection']
|
|
10348
10454
|
};
|
|
10349
|
-
this.maps.trigger(
|
|
10455
|
+
this.maps.trigger(markerClusterClick, eventArgs);
|
|
10350
10456
|
}
|
|
10351
10457
|
/**
|
|
10352
|
-
* To get
|
|
10458
|
+
* To get marker from target id
|
|
10353
10459
|
*
|
|
10354
10460
|
* @param {string} target - Specifies the target
|
|
10355
|
-
* @returns {
|
|
10461
|
+
* @returns {string} - Returns the string
|
|
10356
10462
|
*/
|
|
10357
10463
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10358
|
-
|
|
10464
|
+
getMarker(target) {
|
|
10359
10465
|
const id = target.split('_LayerIndex_');
|
|
10360
10466
|
const index = parseInt(id[1].split('_')[0], 10);
|
|
10361
10467
|
const layer = this.maps.layers[index];
|
|
10362
10468
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10363
10469
|
let data;
|
|
10364
|
-
|
|
10365
|
-
|
|
10366
|
-
|
|
10367
|
-
|
|
10368
|
-
|
|
10369
|
-
|
|
10470
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10471
|
+
const markCollection = [];
|
|
10472
|
+
const clusterCollection = [];
|
|
10473
|
+
let marker$$1;
|
|
10474
|
+
this.maps.markerClusterExpand = layer.markerClusterSettings.allowClusterExpand;
|
|
10475
|
+
if (target.indexOf('_MarkerIndex_') > -1) {
|
|
10476
|
+
const markerIndex = parseInt(id[1].split('_MarkerIndex_')[1].split('_')[0], 10);
|
|
10477
|
+
const dataIndex = parseInt(id[1].split('_dataIndex_')[1].split('_')[0], 10);
|
|
10478
|
+
marker$$1 = layer.markerSettings[markerIndex];
|
|
10479
|
+
if (!isNaN(markerIndex)) {
|
|
10480
|
+
data = marker$$1.dataSource[dataIndex];
|
|
10481
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10482
|
+
let collection = [];
|
|
10483
|
+
if (!marker$$1.template && (target.indexOf('_cluster_') > -1) && (this.maps.layers[index].markerClusterSettings.allowClusterExpand)) {
|
|
10484
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10485
|
+
Array.prototype.forEach.call(marker$$1.dataSource, (location, index) => {
|
|
10486
|
+
if (location['latitude'] === data['latitude'] && location['longitude'] === data['longitude']) {
|
|
10487
|
+
collection.push({ data: data, index: index });
|
|
10488
|
+
}
|
|
10489
|
+
});
|
|
10490
|
+
}
|
|
10491
|
+
if ((target.indexOf('_cluster_') > -1)) {
|
|
10492
|
+
let isClusterSame = false;
|
|
10493
|
+
const clusterElement = document.getElementById(target.indexOf('_datalabel_') > -1 ? layer.markerClusterSettings.shape === 'Balloon' ? target.split('_datalabel_')[0] + '_Group' : target.split('_datalabel_')[0] : layer.markerClusterSettings.shape === 'Balloon' ? target + '_Group' : target);
|
|
10494
|
+
const indexes = layer.markerClusterSettings.shape === 'Balloon' ? clusterElement.children[0].textContent.split(',').map(Number) : clusterElement.textContent.split(',').map(Number);
|
|
10495
|
+
collection = [];
|
|
10496
|
+
for (const i of indexes) {
|
|
10497
|
+
collection.push({ data: marker$$1.dataSource[i], index: i });
|
|
10498
|
+
markCollection.push(marker$$1.dataSource[i]);
|
|
10499
|
+
}
|
|
10500
|
+
isClusterSame = false;
|
|
10501
|
+
clusterCollection.push({
|
|
10502
|
+
data: collection, layerIndex: index, markerIndex: markerIndex, dataIndex: dataIndex,
|
|
10503
|
+
targetClusterIndex: +(target.split('_cluster_')[1].indexOf('_datalabel_') > -1 ? target.split('_cluster_')[1].split('_datalabel_')[0] : target.split('_cluster_')[1]),
|
|
10504
|
+
isClusterSame: isClusterSame
|
|
10505
|
+
});
|
|
10506
|
+
}
|
|
10507
|
+
return { marker: marker$$1, data: data, clusterCollection: clusterCollection, markCollection: markCollection };
|
|
10370
10508
|
}
|
|
10371
10509
|
}
|
|
10372
10510
|
return null;
|
|
10373
10511
|
}
|
|
10374
|
-
// eslint-disable-next-line valid-jsdoc
|
|
10375
10512
|
/**
|
|
10376
|
-
* To check and trigger
|
|
10513
|
+
* To check and trigger marker move event
|
|
10377
10514
|
*
|
|
10378
10515
|
* @param {PointerEvent} e - Specifies the pointer event argument.
|
|
10379
|
-
* @
|
|
10516
|
+
* @returns {void}
|
|
10380
10517
|
* @private
|
|
10381
10518
|
*/
|
|
10382
|
-
|
|
10383
|
-
const
|
|
10384
|
-
if (
|
|
10519
|
+
markerMove(e) {
|
|
10520
|
+
const targetId = e.target.id;
|
|
10521
|
+
if (targetId.indexOf('_LayerIndex_') === -1 || targetId.indexOf('_cluster_') > 0) {
|
|
10385
10522
|
return;
|
|
10386
10523
|
}
|
|
10387
|
-
|
|
10388
|
-
|
|
10389
|
-
if (isNullOrUndefined(data)) {
|
|
10524
|
+
const options = this.getMarker(targetId);
|
|
10525
|
+
if (isNullOrUndefined(options)) {
|
|
10390
10526
|
return;
|
|
10391
10527
|
}
|
|
10528
|
+
if (options.marker.enableDrag) {
|
|
10529
|
+
document.getElementById(this.maps.element.id + "_svg").style.cursor = isNullOrUndefined(this.maps.markerDragArgument) ?
|
|
10530
|
+
'pointer' : 'grabbing';
|
|
10531
|
+
}
|
|
10392
10532
|
const eventArgs = {
|
|
10393
|
-
cancel: false, name:
|
|
10394
|
-
target:
|
|
10533
|
+
cancel: false, name: markerMouseMove, data: options.data,
|
|
10534
|
+
maps: this.maps, target: targetId, x: e.clientX, y: e.clientY
|
|
10395
10535
|
};
|
|
10396
|
-
this.maps.trigger(
|
|
10536
|
+
this.maps.trigger(markerMouseMove, eventArgs);
|
|
10537
|
+
}
|
|
10538
|
+
/**
|
|
10539
|
+
* To check and trigger cluster move event
|
|
10540
|
+
*
|
|
10541
|
+
* @param {PointerEvent} e - Specifies the pointer event argument.
|
|
10542
|
+
* @returns {void}
|
|
10543
|
+
* @private
|
|
10544
|
+
*/
|
|
10545
|
+
markerClusterMouseMove(e) {
|
|
10546
|
+
const targetId = e.target.id;
|
|
10547
|
+
if (targetId.indexOf('_LayerIndex_') === -1 || targetId.indexOf('_cluster_') === -1) {
|
|
10548
|
+
return;
|
|
10549
|
+
}
|
|
10550
|
+
const options = this.getMarker(targetId);
|
|
10551
|
+
if (this.maps.markerClusterExpand) {
|
|
10552
|
+
e.target.style.cursor = 'pointer';
|
|
10553
|
+
}
|
|
10554
|
+
if (isNullOrUndefined(options)) {
|
|
10555
|
+
return;
|
|
10556
|
+
}
|
|
10557
|
+
const eventArgs = {
|
|
10558
|
+
cancel: false, name: markerClusterMouseMove, data: options.data, maps: this.maps,
|
|
10559
|
+
target: targetId, x: e.clientX, y: e.clientY
|
|
10560
|
+
};
|
|
10561
|
+
this.maps.trigger(markerClusterMouseMove, eventArgs);
|
|
10397
10562
|
}
|
|
10398
10563
|
/**
|
|
10399
10564
|
* Get module name.
|
|
10400
10565
|
*
|
|
10401
|
-
* @returns {string} - Returns the module name
|
|
10566
|
+
* @returns {string} - Returns the module name
|
|
10402
10567
|
*/
|
|
10403
10568
|
getModuleName() {
|
|
10404
|
-
return '
|
|
10569
|
+
return 'Marker';
|
|
10405
10570
|
}
|
|
10406
10571
|
/**
|
|
10407
|
-
* To destroy the
|
|
10572
|
+
* To destroy the layers.
|
|
10408
10573
|
*
|
|
10409
10574
|
* @returns {void}
|
|
10410
10575
|
* @private
|
|
10411
10576
|
*/
|
|
10412
10577
|
destroy() {
|
|
10413
|
-
this.
|
|
10414
|
-
|
|
10415
|
-
|
|
10578
|
+
this.maps = null;
|
|
10579
|
+
this.trackElements = [];
|
|
10580
|
+
this.markerSVGObject = null;
|
|
10581
|
+
this.sameMarkerData = [];
|
|
10582
|
+
}
|
|
10583
|
+
}
|
|
10584
|
+
|
|
10585
|
+
/**
|
|
10586
|
+
* When injected, this module will be used to render polygon shapes over the Maps.
|
|
10587
|
+
*/
|
|
10588
|
+
class Polygon {
|
|
10589
|
+
constructor(maps) {
|
|
10590
|
+
this.maps = maps;
|
|
10591
|
+
}
|
|
10592
|
+
/**
|
|
10593
|
+
* To render polygon for maps
|
|
10594
|
+
*
|
|
10595
|
+
* @param {Maps} maps - Specifies the layer instance to which the polygon is to be rendered.
|
|
10596
|
+
* @param {number} layerIndex -Specifies the index of current layer.
|
|
10597
|
+
* @param {number} factor - Specifies the current zoom factor of the Maps.
|
|
10598
|
+
* @returns {Element} - Returns the polygon element.
|
|
10599
|
+
* @private
|
|
10600
|
+
*/
|
|
10601
|
+
polygonRender(maps, layerIndex, factor) {
|
|
10602
|
+
const currentLayer = maps.layersCollection[layerIndex];
|
|
10603
|
+
const polygonsSVGObject = maps.renderer.createGroup({
|
|
10604
|
+
id: maps.element.id + '_LayerIndex_' + layerIndex + '_Polygons_Group'
|
|
10605
|
+
});
|
|
10606
|
+
currentLayer.polygonSettings.polygons.map((polygonSetting, polygonIndex) => {
|
|
10607
|
+
const polygonSVGObject = maps.renderer.createGroup({
|
|
10608
|
+
id: maps.element.id + '_LayerIndex_' + layerIndex + '_Polygons_Group_' + polygonIndex
|
|
10609
|
+
});
|
|
10610
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10611
|
+
const polygonData = polygonSetting.points;
|
|
10612
|
+
const path = calculatePolygonPath(maps, factor, currentLayer, polygonData);
|
|
10613
|
+
const pathOptions = new PathOption(maps.element.id + '_LayerIndex_' + layerIndex + '_PolygonIndex_' + polygonIndex, polygonSetting.fill, (polygonSetting.borderWidth / factor), polygonSetting.borderColor, polygonSetting.opacity, polygonSetting.borderOpacity, '', path);
|
|
10614
|
+
const polygonEle = maps.renderer.drawPath(pathOptions);
|
|
10615
|
+
maintainSelection(this.maps.selectedPolygonElementId, this.maps.polygonSelectionClass, polygonEle, 'PolygonselectionMapStyle');
|
|
10616
|
+
polygonSVGObject.appendChild(polygonEle);
|
|
10617
|
+
polygonsSVGObject.appendChild(polygonSVGObject);
|
|
10618
|
+
});
|
|
10619
|
+
return polygonsSVGObject;
|
|
10620
|
+
}
|
|
10621
|
+
/**
|
|
10622
|
+
* Get module name.
|
|
10623
|
+
*
|
|
10624
|
+
* @returns {string} - Returns the module name
|
|
10625
|
+
*/
|
|
10626
|
+
getModuleName() {
|
|
10627
|
+
return 'Polygon';
|
|
10628
|
+
}
|
|
10629
|
+
/**
|
|
10630
|
+
* To destroy the layers.
|
|
10631
|
+
*
|
|
10632
|
+
* @returns {void}
|
|
10633
|
+
* @private
|
|
10634
|
+
*/
|
|
10635
|
+
destroy() {
|
|
10636
|
+
this.maps = null;
|
|
10416
10637
|
}
|
|
10417
10638
|
}
|
|
10418
10639
|
|
|
@@ -12789,7 +13010,7 @@ class Legend {
|
|
|
12789
13010
|
const legendToggleBorderWidth = this.maps.legendSettings.toggleLegendSettings.border.width;
|
|
12790
13011
|
const legendToggleBorderOpacity = isNullOrUndefined(this.maps.legendSettings.toggleLegendSettings.border.opacity) ?
|
|
12791
13012
|
this.maps.legendSettings.toggleLegendSettings.opacity : this.maps.legendSettings.toggleLegendSettings.border.opacity;
|
|
12792
|
-
if (targetEle.parentNode['id'].indexOf(this.maps.element.id + '_Legend_Index_') > -1) {
|
|
13013
|
+
if (!isNullOrUndefined(targetEle.parentNode) && targetEle.parentNode['id'].indexOf(this.maps.element.id + '_Legend_Index_') > -1) {
|
|
12793
13014
|
let mapElement;
|
|
12794
13015
|
const legendIndex = parseFloat(targetEle.parentElement.id.substr((this.maps.element.id + '_Legend_Index_').length));
|
|
12795
13016
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -13284,6 +13505,7 @@ class Highlight {
|
|
|
13284
13505
|
targetEle.getAttribute('class') !== 'MarkerselectionMapStyle' &&
|
|
13285
13506
|
targetEle.getAttribute('class') !== 'BubbleselectionMapStyle' &&
|
|
13286
13507
|
targetEle.getAttribute('class') !== 'navigationlineselectionMapStyle' &&
|
|
13508
|
+
targetEle.getAttribute('class') !== 'PolygonselectionMapStyle' &&
|
|
13287
13509
|
targetEle.getAttribute('class') !== 'LineselectionMapStyle') {
|
|
13288
13510
|
layerIndex = parseInt(targetEle.id.split('_LayerIndex_')[1].split('_')[0], 10);
|
|
13289
13511
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -13313,6 +13535,11 @@ class Highlight {
|
|
|
13313
13535
|
data = this.maps.layers[layerIndex].markerSettings[marker$$1].dataSource[dataIndex];
|
|
13314
13536
|
this.highlightSettings = this.maps.layers[layerIndex].markerSettings[marker$$1].highlightSettings;
|
|
13315
13537
|
}
|
|
13538
|
+
else if (targetEle.id.indexOf('_PolygonIndex_') > -1) {
|
|
13539
|
+
dataIndex = parseInt(targetEle.id.split('_PolygonIndex_')[1].split('_')[0], 10);
|
|
13540
|
+
data = this.maps.layers[layerIndex].polygonSettings.polygons[dataIndex].points;
|
|
13541
|
+
this.highlightSettings = this.maps.layers[layerIndex].polygonSettings.highlightSettings;
|
|
13542
|
+
}
|
|
13316
13543
|
else {
|
|
13317
13544
|
const index = parseInt(targetEle.id.split('_NavigationIndex_')[1].split('_')[0], 10);
|
|
13318
13545
|
layerIndex = parseInt(targetEle.id.split('_LayerIndex_')[1].split('_')[0], 10);
|
|
@@ -13549,6 +13776,12 @@ class Selection {
|
|
|
13549
13776
|
this.selectionsettings = this.maps.layers[layerIndex].markerSettings[markerIndex].selectionSettings;
|
|
13550
13777
|
this.selectionType = 'Marker';
|
|
13551
13778
|
}
|
|
13779
|
+
else if (targetElement.id.indexOf('_PolygonIndex_') > -1) {
|
|
13780
|
+
dataIndex = parseInt(targetElement.id.split('_PolygonIndex_')[1].split('_')[0], 10);
|
|
13781
|
+
data = this.maps.layers[layerIndex].polygonSettings.polygons[dataIndex].points;
|
|
13782
|
+
this.selectionsettings = this.maps.layers[layerIndex].polygonSettings.selectionSettings;
|
|
13783
|
+
this.selectionType = 'Polygon';
|
|
13784
|
+
}
|
|
13552
13785
|
else if (targetElement.id.indexOf('NavigationIndex') > -1) {
|
|
13553
13786
|
const index = parseInt(targetElement.id.split('_NavigationIndex_')[1].split('_')[0], 10);
|
|
13554
13787
|
shapeData = null;
|
|
@@ -13723,6 +13956,10 @@ class Selection {
|
|
|
13723
13956
|
this.maps.navigationSelectionClass = getElement(this.selectionType + 'selectionMap');
|
|
13724
13957
|
this.maps.selectedNavigationElementId.push(targetElement.getAttribute('id'));
|
|
13725
13958
|
}
|
|
13959
|
+
if (targetElement.getAttribute('class') === 'PolygonselectionMapStyle') {
|
|
13960
|
+
this.maps.polygonSelectionClass = getElement(this.selectionType + 'selectionMap');
|
|
13961
|
+
this.maps.selectedPolygonElementId.push(targetElement.getAttribute('id'));
|
|
13962
|
+
}
|
|
13726
13963
|
}
|
|
13727
13964
|
}
|
|
13728
13965
|
});
|
|
@@ -13762,6 +13999,9 @@ class Selection {
|
|
|
13762
13999
|
if (this.selectionType === 'navigationline') {
|
|
13763
14000
|
this.maps.selectedBubbleElementId.splice(this.maps.selectedBubbleElementId.indexOf(targetElement.getAttribute('id')), 1);
|
|
13764
14001
|
}
|
|
14002
|
+
if (this.selectionType === 'Polygon') {
|
|
14003
|
+
this.maps.selectedPolygonElementId.splice(this.maps.selectedPolygonElementId.indexOf(targetElement.getAttribute('id')), 1);
|
|
14004
|
+
}
|
|
13765
14005
|
}
|
|
13766
14006
|
/**
|
|
13767
14007
|
* Get module name.
|
|
@@ -13802,7 +14042,6 @@ class MapsTooltip {
|
|
|
13802
14042
|
let target;
|
|
13803
14043
|
let touchArg;
|
|
13804
14044
|
let tooltipArgs;
|
|
13805
|
-
let tooltipTemplateElement;
|
|
13806
14045
|
if (e.type.indexOf('touch') !== -1) {
|
|
13807
14046
|
this.isTouch = true;
|
|
13808
14047
|
touchArg = e;
|
|
@@ -13953,7 +14192,12 @@ class MapsTooltip {
|
|
|
13953
14192
|
id: this.maps.element.id + '_mapsTooltip',
|
|
13954
14193
|
className: 'EJ2-maps-Tooltip'
|
|
13955
14194
|
});
|
|
13956
|
-
|
|
14195
|
+
if (isNullOrUndefined(option.template) || option.template === '' || this.maps.tooltipDisplayMode === 'MouseMove') {
|
|
14196
|
+
tooltipEle.style.cssText = 'position: absolute;pointer-events:none;';
|
|
14197
|
+
}
|
|
14198
|
+
else {
|
|
14199
|
+
tooltipEle.style.position = 'absolute';
|
|
14200
|
+
}
|
|
13957
14201
|
document.getElementById(this.maps.element.id + '_Secondary_Element').appendChild(tooltipEle);
|
|
13958
14202
|
}
|
|
13959
14203
|
if (typeof option.template !== 'function' && option.template !== null && Object.keys(typeof option.template === 'object' ? option.template : {}).length === 1) {
|
|
@@ -13997,8 +14241,8 @@ class MapsTooltip {
|
|
|
13997
14241
|
header: '',
|
|
13998
14242
|
data: option['data'],
|
|
13999
14243
|
template: option['template'],
|
|
14000
|
-
content: tooltipArgs.content.toString() !== currentData.toString() ? [
|
|
14001
|
-
[
|
|
14244
|
+
content: tooltipArgs.content.toString() !== currentData.toString() ? [tooltipArgs.content.toString()] :
|
|
14245
|
+
[currentData.toString()],
|
|
14002
14246
|
shapes: [],
|
|
14003
14247
|
location: option['location'],
|
|
14004
14248
|
palette: [markerFill],
|
|
@@ -14015,8 +14259,8 @@ class MapsTooltip {
|
|
|
14015
14259
|
header: '',
|
|
14016
14260
|
data: tooltipArgs.options['data'],
|
|
14017
14261
|
template: tooltipArgs.options['template'],
|
|
14018
|
-
content: tooltipArgs.content.toString() !== currentData.toString() ? [
|
|
14019
|
-
[
|
|
14262
|
+
content: tooltipArgs.content.toString() !== currentData.toString() ? [tooltipArgs.content.toString()] :
|
|
14263
|
+
[currentData.toString()],
|
|
14020
14264
|
shapes: [],
|
|
14021
14265
|
location: tooltipArgs.options['location'],
|
|
14022
14266
|
palette: [markerFill],
|
|
@@ -14035,13 +14279,6 @@ class MapsTooltip {
|
|
|
14035
14279
|
this.svgTooltip.appendTo(tooltipEle);
|
|
14036
14280
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
14037
14281
|
this.maps.renderReactTemplates();
|
|
14038
|
-
tooltipTemplateElement = document.getElementById(this.maps.element.id + '_mapsTooltip');
|
|
14039
|
-
if (tooltipTemplateElement !== null && tooltipTemplateElement.innerHTML.indexOf('href') !== -1
|
|
14040
|
-
&& tooltipTemplateElement.innerHTML.indexOf('</a>') !== -1) {
|
|
14041
|
-
let templateStyle = tooltipTemplateElement.getAttribute('style');
|
|
14042
|
-
templateStyle = templateStyle.replace('pointer-events: none;', 'position-events:all;');
|
|
14043
|
-
tooltipTemplateElement.style.cssText = templateStyle;
|
|
14044
|
-
}
|
|
14045
14282
|
}
|
|
14046
14283
|
else {
|
|
14047
14284
|
this.clearTooltip(e.target);
|
|
@@ -14063,12 +14300,8 @@ class MapsTooltip {
|
|
|
14063
14300
|
}
|
|
14064
14301
|
}
|
|
14065
14302
|
else {
|
|
14066
|
-
|
|
14067
|
-
if (
|
|
14068
|
-
&& tooltipTemplateElement.innerHTML.indexOf('</a>') !== -1) {
|
|
14069
|
-
this.maps.notify(click, this);
|
|
14070
|
-
}
|
|
14071
|
-
else {
|
|
14303
|
+
let tooltipElement = e.target.closest('#' + this.maps.element.id + '_mapsTooltipparent_template');
|
|
14304
|
+
if (isNullOrUndefined(tooltipElement)) {
|
|
14072
14305
|
this.clearTooltip(e.target);
|
|
14073
14306
|
}
|
|
14074
14307
|
}
|
|
@@ -14258,10 +14491,10 @@ class Zoom {
|
|
|
14258
14491
|
*/
|
|
14259
14492
|
performZooming(position, newZoomFactor, type) {
|
|
14260
14493
|
const map = this.maps;
|
|
14261
|
-
map.previousProjection = map.projectionType;
|
|
14494
|
+
map.previousProjection = newZoomFactor <= 1.5 ? undefined : map.projectionType;
|
|
14262
14495
|
map.defaultState = false;
|
|
14263
14496
|
map.initialCheck = false;
|
|
14264
|
-
map.markerZoomedState = false;
|
|
14497
|
+
map.markerZoomedState = map.isMarkerZoomCompleted = false;
|
|
14265
14498
|
map.zoomPersistence = map.enablePersistence;
|
|
14266
14499
|
const prevLevel = map.tileZoomLevel;
|
|
14267
14500
|
const scale = map.previousScale = map.scale;
|
|
@@ -14309,6 +14542,7 @@ class Zoom {
|
|
|
14309
14542
|
map.translatePoint = new Point(translatePointX, translatePointY);
|
|
14310
14543
|
}
|
|
14311
14544
|
map.scale = newZoomFactor;
|
|
14545
|
+
map.zoomTranslatePoint = map.translatePoint;
|
|
14312
14546
|
if (this.triggerZoomEvent(prevTilePoint, prevLevel, type)) {
|
|
14313
14547
|
map.translatePoint = map.previousPoint;
|
|
14314
14548
|
map.scale = map.mapScaleValue = map.previousScale;
|
|
@@ -14330,6 +14564,7 @@ class Zoom {
|
|
|
14330
14564
|
newZoomFactor = map.tileZoomLevel = map.mapScaleValue = map.initialZoomLevel;
|
|
14331
14565
|
map.scale = Math.pow(2, newZoomFactor - 1);
|
|
14332
14566
|
}
|
|
14567
|
+
map.mapScaleValue = isNaN(map.mapScaleValue) ? 1 : map.mapScaleValue;
|
|
14333
14568
|
map.translatePoint.y = (map.tileTranslatePoint.y - (0.01 * map.mapScaleValue)) / map.scale;
|
|
14334
14569
|
map.translatePoint.x = (map.tileTranslatePoint.x - (0.01 * map.mapScaleValue)) / map.scale;
|
|
14335
14570
|
if (this.triggerZoomEvent(prevTilePoint, prevLevel, type)) {
|
|
@@ -14383,18 +14618,28 @@ class Zoom {
|
|
|
14383
14618
|
triggerZoomEvent(prevTilePoint, prevLevel, type) {
|
|
14384
14619
|
const map = this.maps;
|
|
14385
14620
|
let zoomArgs;
|
|
14621
|
+
if (map.isTileMap) {
|
|
14622
|
+
map.mapScaleValue = isNullOrUndefined(map.mapScaleValue) ? 1 : map.mapScaleValue;
|
|
14623
|
+
map.translatePoint.y = (map.tileTranslatePoint.y - (0.01 * map.mapScaleValue)) / map.scale;
|
|
14624
|
+
map.translatePoint.x = (map.tileTranslatePoint.x - (0.01 * map.mapScaleValue)) / map.scale;
|
|
14625
|
+
}
|
|
14626
|
+
const minMaxLatitudeLongitude = this.maps.getMinMaxLatitudeLongitude();
|
|
14386
14627
|
if (!map.isTileMap) {
|
|
14387
14628
|
zoomArgs = {
|
|
14388
14629
|
cancel: false, name: 'zoom', type: type, maps: map,
|
|
14389
14630
|
tileTranslatePoint: {}, translatePoint: { previous: map.previousPoint, current: map.translatePoint },
|
|
14390
|
-
tileZoomLevel: {}, scale: { previous: map.previousScale, current: map.scale }
|
|
14631
|
+
tileZoomLevel: {}, scale: { previous: map.previousScale, current: map.scale },
|
|
14632
|
+
minLatitude: minMaxLatitudeLongitude.minLatitude, maxLatitude: minMaxLatitudeLongitude.maxLatitude,
|
|
14633
|
+
minLongitude: minMaxLatitudeLongitude.minLongitude, maxLongitude: minMaxLatitudeLongitude.maxLongitude
|
|
14391
14634
|
};
|
|
14392
14635
|
}
|
|
14393
14636
|
else {
|
|
14394
14637
|
zoomArgs = {
|
|
14395
14638
|
cancel: false, name: 'zoom', type: type, maps: map,
|
|
14396
14639
|
tileTranslatePoint: { previous: prevTilePoint, current: map.tileTranslatePoint }, translatePoint: { previous: map.previousPoint, current: map.translatePoint },
|
|
14397
|
-
tileZoomLevel: { previous: prevLevel, current: map.tileZoomLevel }, scale: { previous: map.previousScale, current: map.scale }
|
|
14640
|
+
tileZoomLevel: { previous: prevLevel, current: map.tileZoomLevel }, scale: { previous: map.previousScale, current: map.scale },
|
|
14641
|
+
minLatitude: minMaxLatitudeLongitude.minLatitude, maxLatitude: minMaxLatitudeLongitude.maxLatitude,
|
|
14642
|
+
minLongitude: minMaxLatitudeLongitude.minLongitude, maxLongitude: minMaxLatitudeLongitude.maxLongitude
|
|
14398
14643
|
};
|
|
14399
14644
|
}
|
|
14400
14645
|
map.trigger('zoom', zoomArgs);
|
|
@@ -14443,6 +14688,7 @@ class Zoom {
|
|
|
14443
14688
|
map.translatePoint = new Point(translatePointX, translatePointY);
|
|
14444
14689
|
}
|
|
14445
14690
|
map.scale = zoomCalculationFactor < this.maps.zoomSettings.maxZoom ? zoomCalculationFactor : this.maps.zoomSettings.maxZoom;
|
|
14691
|
+
map.zoomTranslatePoint = map.translatePoint;
|
|
14446
14692
|
isZoomCancelled = this.triggerZoomEvent(prevTilePoint, prevLevel, '');
|
|
14447
14693
|
if (isZoomCancelled) {
|
|
14448
14694
|
map.translatePoint = map.previousPoint;
|
|
@@ -14498,6 +14744,7 @@ class Zoom {
|
|
|
14498
14744
|
const map = this.maps;
|
|
14499
14745
|
const prevLevel = map.tileZoomLevel;
|
|
14500
14746
|
const availSize = map.mapAreaRect;
|
|
14747
|
+
map.isMarkerZoomCompleted = false;
|
|
14501
14748
|
map.previousScale = map.scale;
|
|
14502
14749
|
map.previousPoint = map.translatePoint;
|
|
14503
14750
|
map.previousProjection = map.projectionType;
|
|
@@ -14613,7 +14860,9 @@ class Zoom {
|
|
|
14613
14860
|
animateTransform(element, animate$$1, x, y, scale) {
|
|
14614
14861
|
const duration = this.currentLayer.animationDuration === 0 && animationMode === 'Enable' ? 1000 : this.currentLayer.animationDuration;
|
|
14615
14862
|
if (!animate$$1 || duration === 0 || this.maps.isTileMap) {
|
|
14616
|
-
|
|
14863
|
+
if (!(this.maps.isTileMap && element.id.indexOf('_Polygons_Group') > -1)) {
|
|
14864
|
+
element.setAttribute('transform', 'scale(' + (scale) + ') translate( ' + x + ' ' + y + ' )');
|
|
14865
|
+
}
|
|
14617
14866
|
return;
|
|
14618
14867
|
}
|
|
14619
14868
|
if (!this.maps.isTileMap) {
|
|
@@ -14657,6 +14906,17 @@ class Zoom {
|
|
|
14657
14906
|
layerElement.appendChild(maps.navigationLineModule.renderNavigation(this.currentLayer, maps.tileZoomLevel, this.index));
|
|
14658
14907
|
}
|
|
14659
14908
|
}
|
|
14909
|
+
else if (maps.isTileMap && (currentEle.id.indexOf('_Polygons_Group') > -1)) {
|
|
14910
|
+
if (this.currentLayer.polygonSettings.polygons.length > 0) {
|
|
14911
|
+
this.currentLayer.polygonSettings.polygons.map((polygonSettings, polygonIndex) => {
|
|
14912
|
+
const markerData = polygonSettings.points;
|
|
14913
|
+
const path = calculatePolygonPath(maps, maps.tileZoomLevel, this.currentLayer, markerData);
|
|
14914
|
+
let element = document.getElementById(maps.element.id + '_LayerIndex_' + this.index + '_PolygonIndex_' + polygonIndex);
|
|
14915
|
+
element.setAttribute('d', path);
|
|
14916
|
+
});
|
|
14917
|
+
document.getElementById(maps.element.id + '_LayerIndex_' + this.index + '_Polygons_Group').style.visibility = '';
|
|
14918
|
+
}
|
|
14919
|
+
}
|
|
14660
14920
|
else if (currentEle.id.indexOf('Legend') === -1) {
|
|
14661
14921
|
changeBorderWidth(currentEle, this.index, scale, maps);
|
|
14662
14922
|
maps.zoomTranslatePoint = maps.translatePoint;
|
|
@@ -14664,7 +14924,7 @@ class Zoom {
|
|
|
14664
14924
|
}
|
|
14665
14925
|
}
|
|
14666
14926
|
else if (currentEle.id.indexOf('_Markers_Group') > -1) {
|
|
14667
|
-
if (!this.isPanning && !isNullOrUndefined(currentEle.childNodes[0])) {
|
|
14927
|
+
if ((!this.isPanning) && !isNullOrUndefined(currentEle.childNodes[0])) {
|
|
14668
14928
|
this.markerTranslates(currentEle.childNodes[0], factor, x, y, scale, 'Marker', layerElement, animate$$1);
|
|
14669
14929
|
}
|
|
14670
14930
|
currentEle = layerElement.childNodes[j];
|
|
@@ -14881,7 +15141,19 @@ class Zoom {
|
|
|
14881
15141
|
const markerDataLength = markerDatas.length - this.maps.markerNullCount;
|
|
14882
15142
|
if (markerSVGObject.childElementCount === (markerDataLength - markerTemplateCounts - nullCount) && (type !== 'Template')) {
|
|
14883
15143
|
if (this.maps.isTileMap) {
|
|
14884
|
-
|
|
15144
|
+
const polygonsElement = document.getElementById(this.maps.element.id + '_LayerIndex_' + layerIndex + '_Polygons_Group');
|
|
15145
|
+
const polygonElement = document.getElementById(this.maps.element.id + '_LayerIndex_' + layerIndex + '_Polygon_Group');
|
|
15146
|
+
if (!isNullOrUndefined(polygonsElement)) {
|
|
15147
|
+
polygonsElement.insertAdjacentElement('afterend', markerSVGObject);
|
|
15148
|
+
}
|
|
15149
|
+
else {
|
|
15150
|
+
if (!isNullOrUndefined(polygonElement)) {
|
|
15151
|
+
polygonElement.insertAdjacentElement('afterend', markerSVGObject);
|
|
15152
|
+
}
|
|
15153
|
+
else {
|
|
15154
|
+
layerElement.insertBefore(markerSVGObject, layerElement.firstElementChild);
|
|
15155
|
+
}
|
|
15156
|
+
}
|
|
14885
15157
|
}
|
|
14886
15158
|
else {
|
|
14887
15159
|
layerElement.appendChild(markerSVGObject);
|
|
@@ -14921,6 +15193,8 @@ class Zoom {
|
|
|
14921
15193
|
i + '_Markers_Template_Group');
|
|
14922
15194
|
const datalabelTemplateElemement = getElementByID(maps.element.id + '_LayerIndex_'
|
|
14923
15195
|
+ i + '_Label_Template_Group');
|
|
15196
|
+
const polygonElement = getElementByID(maps.element.id + '_LayerIndex_'
|
|
15197
|
+
+ i + '_Polygons_Group');
|
|
14924
15198
|
if ((!isNullOrUndefined(markerTemplateElement)) && markerTemplateElement.childElementCount > 0) {
|
|
14925
15199
|
markerTemplateElement.style.visibility = 'visible';
|
|
14926
15200
|
for (let k = 0; k < markerTemplateElement.childElementCount; k++) {
|
|
@@ -14932,6 +15206,12 @@ class Zoom {
|
|
|
14932
15206
|
this.dataLabelTranslate(datalabelTemplateElemement.childNodes[k], factor, x, y, scale, 'Template');
|
|
14933
15207
|
}
|
|
14934
15208
|
}
|
|
15209
|
+
if (!isNullOrUndefined(polygonElement)) {
|
|
15210
|
+
for (let k = 0; k < polygonElement.childElementCount; k++) {
|
|
15211
|
+
let width = maps.layersCollection[i].polygonSettings.polygons[k].borderWidth;
|
|
15212
|
+
polygonElement.childNodes[k].childNodes[0].setAttribute('stroke-width', (width / scale).toString());
|
|
15213
|
+
}
|
|
15214
|
+
}
|
|
14935
15215
|
}
|
|
14936
15216
|
}
|
|
14937
15217
|
dataLabelTranslate(element, factor, x, y, scale, type, animate$$1 = false) {
|
|
@@ -14985,7 +15265,6 @@ class Zoom {
|
|
|
14985
15265
|
zoomtextSize = measureText(zoomtext, style);
|
|
14986
15266
|
const start = labelY - zoomtextSize['height'] / 4;
|
|
14987
15267
|
const end = labelY + zoomtextSize['height'] / 4;
|
|
14988
|
-
labelY = end;
|
|
14989
15268
|
const xpositionEnds = labelX + zoomtextSize['width'] / 2;
|
|
14990
15269
|
const xpositionStart = labelX - zoomtextSize['width'] / 2;
|
|
14991
15270
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -15157,12 +15436,16 @@ class Zoom {
|
|
|
15157
15436
|
for (let i = 0; i < map.layersCollection.length; i++) {
|
|
15158
15437
|
const markerTemplateElement = getElementByID(this.maps.element.id + '_LayerIndex_' + i + '_Markers_Template_Group');
|
|
15159
15438
|
const lineElement = getElementByID(this.maps.element.id + '_LayerIndex_' + i + '_line_Group');
|
|
15439
|
+
const polygonElement = getElementByID(this.maps.element.id + '_LayerIndex_' + i + '_Polygons_Group');
|
|
15160
15440
|
if (!isNullOrUndefined(markerTemplateElement)) {
|
|
15161
15441
|
markerTemplateElement.style.visibility = 'hidden';
|
|
15162
15442
|
}
|
|
15163
15443
|
if (!isNullOrUndefined(lineElement)) {
|
|
15164
15444
|
lineElement.style.visibility = 'hidden';
|
|
15165
15445
|
}
|
|
15446
|
+
if (!isNullOrUndefined(polygonElement)) {
|
|
15447
|
+
polygonElement.style.visibility = 'hidden';
|
|
15448
|
+
}
|
|
15166
15449
|
}
|
|
15167
15450
|
}
|
|
15168
15451
|
}
|
|
@@ -15204,10 +15487,13 @@ class Zoom {
|
|
|
15204
15487
|
((layerRect.top + layerRect.height + legendHeight + map.margin.top) >= (elementRect.top + elementRect.height))));
|
|
15205
15488
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
15206
15489
|
const location = this.maps.getGeoLocation(this.maps.layersCollection.length - 1, mouseLocation['layerX'], mouseLocation['layerY']);
|
|
15490
|
+
const minMaxLatitudeLongitude = this.maps.getMinMaxLatitudeLongitude();
|
|
15207
15491
|
panArgs = {
|
|
15208
15492
|
cancel: false, name: pan, maps: map,
|
|
15209
15493
|
tileTranslatePoint: {}, translatePoint: { previous: translatePoint, current: new Point(x, y) },
|
|
15210
|
-
scale: map.scale, tileZoomLevel: map.tileZoomLevel, latitude: location['latitude'], longitude: location['longitude']
|
|
15494
|
+
scale: map.scale, tileZoomLevel: map.tileZoomLevel, latitude: location['latitude'], longitude: location['longitude'],
|
|
15495
|
+
minLatitude: minMaxLatitudeLongitude.minLatitude, maxLatitude: minMaxLatitudeLongitude.maxLatitude,
|
|
15496
|
+
minLongitude: minMaxLatitudeLongitude.minLongitude, maxLongitude: minMaxLatitudeLongitude.maxLongitude
|
|
15211
15497
|
};
|
|
15212
15498
|
map.trigger(pan, panArgs);
|
|
15213
15499
|
if (!panArgs.cancel) {
|
|
@@ -15241,11 +15527,14 @@ class Zoom {
|
|
|
15241
15527
|
map.translatePoint.y = (map.tileTranslatePoint.y - yDifference) / map.scale;
|
|
15242
15528
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
15243
15529
|
const location = this.maps.getTileGeoLocation(mouseLocation['layerX'], mouseLocation['layerY']);
|
|
15530
|
+
const minMaxLatitudeLongitude = this.maps.getMinMaxLatitudeLongitude();
|
|
15244
15531
|
panArgs = {
|
|
15245
15532
|
cancel: false, name: pan, maps: map,
|
|
15246
15533
|
tileTranslatePoint: { previous: prevTilePoint, current: map.tileTranslatePoint },
|
|
15247
15534
|
translatePoint: { previous: translatePoint, current: map.translatePoint }, scale: map.scale,
|
|
15248
|
-
tileZoomLevel: map.tileZoomLevel, latitude: location['latitude'], longitude: location['longitude']
|
|
15535
|
+
tileZoomLevel: map.tileZoomLevel, latitude: location['latitude'], longitude: location['longitude'],
|
|
15536
|
+
minLatitude: minMaxLatitudeLongitude.minLatitude, maxLatitude: minMaxLatitudeLongitude.maxLatitude,
|
|
15537
|
+
minLongitude: minMaxLatitudeLongitude.minLongitude, maxLongitude: minMaxLatitudeLongitude.maxLongitude
|
|
15249
15538
|
};
|
|
15250
15539
|
map.trigger(pan, panArgs);
|
|
15251
15540
|
map.mapLayerPanel.generateTiles(map.tileZoomLevel, map.tileTranslatePoint, 'Pan');
|
|
@@ -15267,7 +15556,7 @@ class Zoom {
|
|
|
15267
15556
|
*/
|
|
15268
15557
|
toolBarZooming(zoomFactor, type) {
|
|
15269
15558
|
const map = this.maps;
|
|
15270
|
-
map.initialCheck = false;
|
|
15559
|
+
map.initialCheck = map.isMarkerZoomCompleted = false;
|
|
15271
15560
|
map.defaultState = ((type === 'Reset' && zoomFactor === 1 && !(map.zoomSettings.resetToInitial && map.applyZoomReset))
|
|
15272
15561
|
|| (type === 'ZoomOut' && zoomFactor === 1));
|
|
15273
15562
|
const prevLevel = map.tileZoomLevel;
|
|
@@ -15280,7 +15569,7 @@ class Zoom {
|
|
|
15280
15569
|
const size = map.mapAreaRect;
|
|
15281
15570
|
const translatePoint = map.previousPoint = map.translatePoint;
|
|
15282
15571
|
const prevTilePoint = map.tileTranslatePoint;
|
|
15283
|
-
map.previousProjection =
|
|
15572
|
+
map.previousProjection = type === 'Reset' ? undefined : map.projectionType;
|
|
15284
15573
|
zoomFactor = (type === 'ZoomOut') ? (Math.round(zoomFactor) === 1 ? 1 : zoomFactor) : zoomFactor;
|
|
15285
15574
|
zoomFactor = (type === 'Reset') ? minZoom : (Math.round(zoomFactor) === 0) ? 1 : zoomFactor;
|
|
15286
15575
|
zoomFactor = (minZoom > zoomFactor && type === 'ZoomIn') ? minZoom + 1 : zoomFactor;
|
|
@@ -15538,7 +15827,10 @@ class Zoom {
|
|
|
15538
15827
|
isToolbarPerform = (this.maps.isTileMap ? this.maps.tileZoomLevel : this.maps.scale) + 1 <= this.maps.zoomSettings.maxZoom;
|
|
15539
15828
|
break;
|
|
15540
15829
|
case 'zoomout':
|
|
15541
|
-
|
|
15830
|
+
const scaleValue = this.maps.isTileMap ? this.maps.tileZoomLevel : this.maps.scale;
|
|
15831
|
+
isToolbarPerform = (this.maps.projectionType === 'Miller' || this.maps.projectionType === 'Winkel3' ||
|
|
15832
|
+
this.maps.projectionType === 'AitOff') ? Math.round(scaleValue) - 1 >= this.maps.zoomSettings.minZoom :
|
|
15833
|
+
(scaleValue) - 1 >= this.maps.zoomSettings.minZoom;
|
|
15542
15834
|
break;
|
|
15543
15835
|
case 'reset':
|
|
15544
15836
|
isToolbarPerform = Math.round(this.maps.isTileMap ? this.maps.tileZoomLevel : this.maps.scale) != this.maps.zoomSettings.minZoom;
|
|
@@ -15972,8 +16264,9 @@ class Zoom {
|
|
|
15972
16264
|
const pageX = e.pageX;
|
|
15973
16265
|
const pageY = e.pageY;
|
|
15974
16266
|
const target = e.target;
|
|
16267
|
+
let tooltipElement = e.target.closest('#' + this.maps.element.id + '_mapsTooltipparent_template');
|
|
15975
16268
|
if (this.maps.zoomSettings.enable && this.maps.zoomSettings.doubleClickZoom
|
|
15976
|
-
&& !(e.target['id'].indexOf('_Zooming_') > -1)) {
|
|
16269
|
+
&& !(e.target['id'].indexOf('_Zooming_') > -1) && isNullOrUndefined(tooltipElement)) {
|
|
15977
16270
|
const position = this.getMousePosition(pageX, pageY);
|
|
15978
16271
|
const map = this.maps;
|
|
15979
16272
|
const size = map.availableSize;
|
|
@@ -16146,8 +16439,9 @@ class Zoom {
|
|
|
16146
16439
|
*/
|
|
16147
16440
|
click(e) {
|
|
16148
16441
|
const map = this.maps;
|
|
16442
|
+
let tooltipElement = e.target.closest('#' + this.maps.element.id + '_mapsTooltipparent_template');
|
|
16149
16443
|
if ((map.markerModule && map.markerModule.sameMarkerData.length > 0) ||
|
|
16150
|
-
(e.target['id'].indexOf('MarkerIndex') > -1 && e.target['id'].indexOf('cluster') === -1)) {
|
|
16444
|
+
(e.target['id'].indexOf('MarkerIndex') > -1 && e.target['id'].indexOf('cluster') === -1) || !isNullOrUndefined(tooltipElement)) {
|
|
16151
16445
|
return null;
|
|
16152
16446
|
}
|
|
16153
16447
|
if (this.isSingleClick && map.zoomSettings.zoomOnClick && !(e.target['id'].indexOf('_Zooming_') > -1) && !map.zoomSettings.doubleClickZoom
|
|
@@ -16716,5 +17010,5 @@ class PdfExport {
|
|
|
16716
17010
|
* exporting all modules from maps index
|
|
16717
17011
|
*/
|
|
16718
17012
|
|
|
16719
|
-
export { Maps, load, loaded, click, onclick, rightClick, doubleClick, resize, tooltipRender, shapeSelected, shapeHighlight, mousemove, mouseup, mousedown, layerRendering, shapeRendering, markerRendering, markerClusterRendering, markerClick, markerDragStart, markerDragEnd, markerClusterClick, markerMouseMove, markerClusterMouseMove, dataLabelRendering, bubbleRendering, bubbleClick, bubbleMouseMove, animationComplete, legendRendering, annotationRendering, itemSelection, itemHighlight, beforePrint, zoomIn, zoomOut, pan, Annotation, Arrow, Font, ZoomToolbarButtonSettings, ZoomToolbarTooltipSettings, ZoomToolbarSettings, Border, CenterPosition, TooltipSettings, Margin, ConnectorLineSettings, MarkerClusterSettings, MarkerClusterData, ColorMappingSettings, InitialMarkerSelectionSettings, InitialShapeSelectionSettings, SelectionSettings, HighlightSettings, NavigationLineSettings, BubbleSettings, CommonTitleSettings, SubTitleSettings, TitleSettings, ZoomSettings, ToggleLegendSettings, LegendSettings, DataLabelSettings, ShapeSettings, MarkerBase, MarkerSettings, LayerSettings, Tile, MapsAreaSettings, Size, stringToNumber, calculateSize, createSvg, getMousePosition, degreesToRadians, radiansToDegrees, convertGeoToPoint, convertTileLatLongToPoint, xToCoordinate, yToCoordinate, aitoff, roundTo, sinci, acos, calculateBound, triggerDownload, Point, MinMax, GeoLocation, measureText, TextOption, PathOption, ColorValue, RectOption, CircleOption, PolygonOption, PolylineOption, LineOption, Line, MapLocation, Rect, PatternOptions, renderTextElement, convertElement, formatValue, convertStringToValue, convertElementFromLabel, drawSymbols, getValueFromObject, markerColorChoose, markerShapeChoose, clusterTemplate, mergeSeparateCluster, clusterSeparate, marker, markerTemplate, maintainSelection, maintainStyleClass, appendShape, drawCircle, drawRectangle, drawPath, drawPolygon, drawPolyline, drawLine, calculateShapes, drawDiamond, drawTriangle, drawCross, drawHorizontalLine, drawVerticalLine, drawStar, drawBalloon, drawPattern, getFieldData, checkShapeDataFields, checkPropertyPath, filter, getRatioOfBubble, findMidPointOfPolygon, isCustomPath, textTrim, findPosition, removeElement, calculateCenterFromPixel, getTranslate, getZoomTranslate, fixInitialScaleForTile, getElementByID, getClientElement, Internalize, getTemplateFunction, getElement, getShapeData, triggerShapeEvent, getElementsByClassName, querySelector, getTargetElement, createStyle, customizeStyle, triggerItemSelectionEvent, removeClass, elementAnimate, timeout, showTooltip, wordWrap, createTooltip, getHexColor, drawSymbol, renderLegendShape, getElementOffset, changeBorderWidth, changeNavaigationLineWidth, targetTouches, calculateScale, getDistance, getTouches, getTouchCenter, sum, zoomAnimate, animate, MapAjax, smoothTranslate, compareZoomFactor, calculateZoomLevel, processResult, LayerPanel, Bubble, BingMap, Marker, ColorMapping, DataLabel, NavigationLine, Legend, Highlight, Selection, MapsTooltip, Zoom, Annotations, Print, ImageExport, PdfExport };
|
|
17013
|
+
export { Maps, load, loaded, click, onclick, rightClick, doubleClick, resize, tooltipRender, shapeSelected, shapeHighlight, mousemove, mouseup, mousedown, layerRendering, shapeRendering, markerRendering, markerClusterRendering, markerClick, markerDragStart, markerDragEnd, markerClusterClick, markerMouseMove, markerClusterMouseMove, dataLabelRendering, bubbleRendering, bubbleClick, bubbleMouseMove, animationComplete, legendRendering, annotationRendering, itemSelection, itemHighlight, beforePrint, zoomIn, zoomOut, pan, Annotation, Arrow, Font, ZoomToolbarButtonSettings, ZoomToolbarTooltipSettings, ZoomToolbarSettings, Border, CenterPosition, TooltipSettings, Margin, ConnectorLineSettings, MarkerClusterSettings, MarkerClusterData, ColorMappingSettings, InitialMarkerSelectionSettings, InitialShapeSelectionSettings, SelectionSettings, HighlightSettings, PolygonSetting, PolygonSettings, NavigationLineSettings, BubbleSettings, CommonTitleSettings, SubTitleSettings, TitleSettings, ZoomSettings, ToggleLegendSettings, LegendSettings, DataLabelSettings, ShapeSettings, MarkerBase, MarkerSettings, LayerSettings, Tile, MapsAreaSettings, Size, stringToNumber, calculateSize, createSvg, getMousePosition, degreesToRadians, radiansToDegrees, convertGeoToPoint, calculatePolygonPath, convertTileLatLongToPoint, xToCoordinate, yToCoordinate, aitoff, roundTo, sinci, acos, calculateBound, triggerDownload, Point, Coordinate, MinMax, GeoLocation, measureText, TextOption, PathOption, ColorValue, RectOption, CircleOption, PolygonOption, PolylineOption, LineOption, Line, MapLocation, Rect, PatternOptions, renderTextElement, convertElement, formatValue, convertStringToValue, convertElementFromLabel, drawSymbols, getValueFromObject, markerColorChoose, markerShapeChoose, clusterTemplate, mergeSeparateCluster, clusterSeparate, marker, markerTemplate, maintainSelection, maintainStyleClass, appendShape, drawCircle, drawRectangle, drawPath, drawPolygon, drawPolyline, drawLine, calculateShapes, drawDiamond, drawTriangle, drawCross, drawHorizontalLine, drawVerticalLine, drawStar, drawBalloon, drawPattern, getFieldData, checkShapeDataFields, checkPropertyPath, filter, getRatioOfBubble, findMidPointOfPolygon, isCustomPath, textTrim, findPosition, removeElement, calculateCenterFromPixel, getTranslate, getZoomTranslate, fixInitialScaleForTile, getElementByID, getClientElement, Internalize, getTemplateFunction, getElement, getShapeData, triggerShapeEvent, getElementsByClassName, querySelector, getTargetElement, createStyle, customizeStyle, triggerItemSelectionEvent, removeClass, elementAnimate, timeout, showTooltip, wordWrap, createTooltip, getHexColor, drawSymbol, renderLegendShape, getElementOffset, changeBorderWidth, changeNavaigationLineWidth, targetTouches, calculateScale, getDistance, getTouches, getTouchCenter, sum, zoomAnimate, animate, MapAjax, smoothTranslate, compareZoomFactor, calculateZoomLevel, processResult, LayerPanel, Bubble, BingMap, Marker, Polygon, ColorMapping, DataLabel, NavigationLine, Legend, Highlight, Selection, MapsTooltip, Zoom, Annotations, Print, ImageExport, PdfExport };
|
|
16720
17014
|
//# sourceMappingURL=ej2-maps.es2015.js.map
|