@syncfusion/ej2-maps 23.2.4 → 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 +20 -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 +1059 -765
- package/dist/es6/ej2-maps.es2015.js.map +1 -1
- package/dist/es6/ej2-maps.es5.js +1084 -775
- 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/navigation-selected-line.js +16 -16
- 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 +81 -17
- 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
package/dist/es6/ej2-maps.es5.js
CHANGED
|
@@ -213,6 +213,25 @@ function convertGeoToPoint(latitude, longitude, factor, layer, mapModel) {
|
|
|
213
213
|
}
|
|
214
214
|
return new Point(x, y);
|
|
215
215
|
}
|
|
216
|
+
/**
|
|
217
|
+
* @private
|
|
218
|
+
*/
|
|
219
|
+
function calculatePolygonPath(maps, factor, currentLayer, markerData) {
|
|
220
|
+
var path = '';
|
|
221
|
+
Array.prototype.forEach.call(markerData, function (data, dataIndex) {
|
|
222
|
+
var lat = data.latitude;
|
|
223
|
+
var lng = data.longitude;
|
|
224
|
+
var location = (maps.isTileMap) ? convertTileLatLongToPoint(new MapLocation(lng, lat), factor, maps.tileTranslatePoint, true) : convertGeoToPoint(lat, lng, factor, currentLayer, maps);
|
|
225
|
+
if (dataIndex === 0) {
|
|
226
|
+
path += 'M ' + location.x + ' ' + location.y;
|
|
227
|
+
}
|
|
228
|
+
else {
|
|
229
|
+
path += ' L ' + location.x + ' ' + location.y;
|
|
230
|
+
}
|
|
231
|
+
});
|
|
232
|
+
path += ' z ';
|
|
233
|
+
return path;
|
|
234
|
+
}
|
|
216
235
|
/**
|
|
217
236
|
* Converting tile latitude and longitude to point
|
|
218
237
|
*
|
|
@@ -355,6 +374,16 @@ var Point = /** @__PURE__ @class */ (function () {
|
|
|
355
374
|
}
|
|
356
375
|
return Point;
|
|
357
376
|
}());
|
|
377
|
+
/**
|
|
378
|
+
* Defines the latitude and longitude values that define a map location.
|
|
379
|
+
*/
|
|
380
|
+
var Coordinate = /** @__PURE__ @class */ (function () {
|
|
381
|
+
function Coordinate(latitude, longitude) {
|
|
382
|
+
this.latitude = latitude;
|
|
383
|
+
this.longitude = longitude;
|
|
384
|
+
}
|
|
385
|
+
return Coordinate;
|
|
386
|
+
}());
|
|
358
387
|
/**
|
|
359
388
|
* Map internal class for min and max
|
|
360
389
|
*
|
|
@@ -1112,12 +1141,24 @@ function clusterTemplate(currentLayer, markerTemplate, maps, layerIndex, markerC
|
|
|
1112
1141
|
getElementByID(maps.element.id + '_Secondary_Element').appendChild(markerCollection);
|
|
1113
1142
|
}
|
|
1114
1143
|
var element = document.getElementById(maps.element.id + '_LayerIndex_' + layerIndex + '_Polygon_Group');
|
|
1115
|
-
|
|
1144
|
+
var polygonElement = document.getElementById(maps.element.id + '_LayerIndex_' + layerIndex + '_Polygons_Group');
|
|
1145
|
+
if (isNullOrUndefined(element) && !maps.isTileMap) {
|
|
1116
1146
|
layerElement.insertBefore(markerCollection, layerElement.firstChild);
|
|
1117
1147
|
}
|
|
1118
|
-
else {
|
|
1148
|
+
else if (!maps.isTileMap) {
|
|
1119
1149
|
layerElement.appendChild(markerCollection);
|
|
1120
1150
|
}
|
|
1151
|
+
else {
|
|
1152
|
+
if (!isNullOrUndefined(polygonElement)) {
|
|
1153
|
+
polygonElement.insertAdjacentElement('afterend', markerCollection);
|
|
1154
|
+
}
|
|
1155
|
+
else if (!isNullOrUndefined(element)) {
|
|
1156
|
+
element.insertAdjacentElement('afterend', markerCollection);
|
|
1157
|
+
}
|
|
1158
|
+
else {
|
|
1159
|
+
layerElement.insertBefore(markerCollection, layerElement.firstChild);
|
|
1160
|
+
}
|
|
1161
|
+
}
|
|
1121
1162
|
var markerCluster = document.getElementById(maps.element.id + '_LayerIndex_' + layerIndex + '_markerCluster');
|
|
1122
1163
|
if (!isNullOrUndefined(markerCluster)) {
|
|
1123
1164
|
markerCluster.remove();
|
|
@@ -1649,7 +1690,7 @@ function drawBalloon(maps, options, size, location, type, element) {
|
|
|
1649
1690
|
var height = size.height;
|
|
1650
1691
|
var pathElement;
|
|
1651
1692
|
location.x -= width / 2;
|
|
1652
|
-
location.y -= height / 2;
|
|
1693
|
+
location.y -= ((options.id.indexOf('cluster') > -1) ? (height / 2) : options.id.indexOf('Legend') > -1 ? height / 1.25 : height);
|
|
1653
1694
|
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' +
|
|
1654
1695
|
'c-2.8,0-5-2.2-5-5s2.2-5,5-5s5,2.2,5,5S17.8,16,15,16z';
|
|
1655
1696
|
var balloon = maps.renderer.drawPath(options);
|
|
@@ -2058,7 +2099,8 @@ function getTranslate(mapObject, layer, animate) {
|
|
|
2058
2099
|
var topPosition = (((mapHeight + Math.abs(mapObject.mapAreaRect.height - mapHeight)) / 2) + mapObject.mapAreaRect.y) / factor;
|
|
2059
2100
|
var point = checkMethodeZoom ? calculateCenterFromPixel(mapObject, layer) :
|
|
2060
2101
|
convertGeoToPoint(centerLatitude, centerLongitude, mapObject.mapLayerPanel.calculateFactor(layer), layer, mapObject);
|
|
2061
|
-
if (isNullOrUndefined(mapObject.previousProjection) || mapObject.previousProjection !== mapObject.projectionType
|
|
2102
|
+
if (isNullOrUndefined(mapObject.previousProjection) || mapObject.previousProjection !== mapObject.projectionType
|
|
2103
|
+
|| mapObject.isMarkerZoomCompleted) {
|
|
2062
2104
|
x = -point.x + leftPosition;
|
|
2063
2105
|
y = -point.y + topPosition;
|
|
2064
2106
|
scaleFactor = zoomFactor;
|
|
@@ -3027,6 +3069,13 @@ function changeBorderWidth(element, index, scale, maps) {
|
|
|
3027
3069
|
if (childNode.id.indexOf('_NavigationGroup') > -1) {
|
|
3028
3070
|
changeNavaigationLineWidth(childNode, index, scale, maps);
|
|
3029
3071
|
}
|
|
3072
|
+
else if (childNode.id.indexOf('_Polygons_Group') > -1) {
|
|
3073
|
+
for (var i = 0; i < childNode.childElementCount; i++) {
|
|
3074
|
+
// eslint-disable-next-line
|
|
3075
|
+
var width = maps.layersCollection[index].polygonSettings.polygons[parseInt(childNode.children[i].id.split('_PolygonIndex_')[1])].borderWidth;
|
|
3076
|
+
childNode.children[i].setAttribute('stroke-width', (width / scale).toString());
|
|
3077
|
+
}
|
|
3078
|
+
}
|
|
3030
3079
|
else {
|
|
3031
3080
|
var currentStroke = void 0;
|
|
3032
3081
|
var value = 0;
|
|
@@ -4574,6 +4623,54 @@ var HighlightSettings = /** @__PURE__ @class */ (function (_super) {
|
|
|
4574
4623
|
], HighlightSettings.prototype, "border", void 0);
|
|
4575
4624
|
return HighlightSettings;
|
|
4576
4625
|
}(ChildProperty));
|
|
4626
|
+
/**
|
|
4627
|
+
* Defines the properties for a single polygon shape to render over the Maps, such as coordinates, fill, border, and opacity.
|
|
4628
|
+
*/
|
|
4629
|
+
var PolygonSetting = /** @__PURE__ @class */ (function (_super) {
|
|
4630
|
+
__extends$2(PolygonSetting, _super);
|
|
4631
|
+
function PolygonSetting() {
|
|
4632
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
4633
|
+
}
|
|
4634
|
+
__decorate$1([
|
|
4635
|
+
Property(1)
|
|
4636
|
+
], PolygonSetting.prototype, "borderWidth", void 0);
|
|
4637
|
+
__decorate$1([
|
|
4638
|
+
Property(1)
|
|
4639
|
+
], PolygonSetting.prototype, "borderOpacity", void 0);
|
|
4640
|
+
__decorate$1([
|
|
4641
|
+
Property(1)
|
|
4642
|
+
], PolygonSetting.prototype, "opacity", void 0);
|
|
4643
|
+
__decorate$1([
|
|
4644
|
+
Property('#FF471A')
|
|
4645
|
+
], PolygonSetting.prototype, "borderColor", void 0);
|
|
4646
|
+
__decorate$1([
|
|
4647
|
+
Property('#FF471A')
|
|
4648
|
+
], PolygonSetting.prototype, "fill", void 0);
|
|
4649
|
+
__decorate$1([
|
|
4650
|
+
Property([])
|
|
4651
|
+
], PolygonSetting.prototype, "points", void 0);
|
|
4652
|
+
return PolygonSetting;
|
|
4653
|
+
}(ChildProperty));
|
|
4654
|
+
/**
|
|
4655
|
+
* Defines the properties of the polygon shapes that will be rendered on a map layer.
|
|
4656
|
+
* The selection and highlight settings for polygon shapes can also be defined.
|
|
4657
|
+
*/
|
|
4658
|
+
var PolygonSettings = /** @__PURE__ @class */ (function (_super) {
|
|
4659
|
+
__extends$2(PolygonSettings, _super);
|
|
4660
|
+
function PolygonSettings() {
|
|
4661
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
4662
|
+
}
|
|
4663
|
+
__decorate$1([
|
|
4664
|
+
Collection([], PolygonSetting)
|
|
4665
|
+
], PolygonSettings.prototype, "polygons", void 0);
|
|
4666
|
+
__decorate$1([
|
|
4667
|
+
Complex({}, SelectionSettings)
|
|
4668
|
+
], PolygonSettings.prototype, "selectionSettings", void 0);
|
|
4669
|
+
__decorate$1([
|
|
4670
|
+
Complex({}, HighlightSettings)
|
|
4671
|
+
], PolygonSettings.prototype, "highlightSettings", void 0);
|
|
4672
|
+
return PolygonSettings;
|
|
4673
|
+
}(ChildProperty));
|
|
4577
4674
|
/**
|
|
4578
4675
|
* Gets or sets the options to customize the navigation lines in maps which is used to connect different locations.
|
|
4579
4676
|
*/
|
|
@@ -5185,6 +5282,9 @@ var LayerSettings = /** @__PURE__ @class */ (function (_super) {
|
|
|
5185
5282
|
__decorate$1([
|
|
5186
5283
|
Collection([], NavigationLineSettings)
|
|
5187
5284
|
], LayerSettings.prototype, "navigationLineSettings", void 0);
|
|
5285
|
+
__decorate$1([
|
|
5286
|
+
Complex({}, PolygonSettings)
|
|
5287
|
+
], LayerSettings.prototype, "polygonSettings", void 0);
|
|
5188
5288
|
__decorate$1([
|
|
5189
5289
|
Complex({}, TooltipSettings)
|
|
5190
5290
|
], LayerSettings.prototype, "tooltipSettings", void 0);
|
|
@@ -5240,501 +5340,7 @@ var MapsAreaSettings = /** @__PURE__ @class */ (function (_super) {
|
|
|
5240
5340
|
}(ChildProperty));
|
|
5241
5341
|
|
|
5242
5342
|
/**
|
|
5243
|
-
*
|
|
5244
|
-
*/
|
|
5245
|
-
var Marker = /** @__PURE__ @class */ (function () {
|
|
5246
|
-
function Marker(maps) {
|
|
5247
|
-
this.maps = maps;
|
|
5248
|
-
this.trackElements = [];
|
|
5249
|
-
this.sameMarkerData = [];
|
|
5250
|
-
}
|
|
5251
|
-
Marker.prototype.markerRender = function (maps, layerElement, layerIndex, factor, type) {
|
|
5252
|
-
var _this = this;
|
|
5253
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5254
|
-
var templateFn;
|
|
5255
|
-
var markerCount = 0;
|
|
5256
|
-
var nullCount = 0;
|
|
5257
|
-
var markerTemplateCount = 0;
|
|
5258
|
-
maps.translateType = 'marker';
|
|
5259
|
-
var currentLayer = maps.layersCollection[layerIndex];
|
|
5260
|
-
this.markerSVGObject = maps.renderer.createGroup({
|
|
5261
|
-
id: maps.element.id + '_Markers_Group',
|
|
5262
|
-
class: 'GroupElement'
|
|
5263
|
-
});
|
|
5264
|
-
this.markerSVGObject.style.pointerEvents = 'auto';
|
|
5265
|
-
var markerTemplateEle = createElement('div', {
|
|
5266
|
-
id: maps.element.id + '_LayerIndex_' + layerIndex + '_Markers_Template_Group',
|
|
5267
|
-
className: maps.element.id + '_template'
|
|
5268
|
-
});
|
|
5269
|
-
markerTemplateEle.style.cssText = 'overflow: hidden; position: absolute;pointer-events: none;' +
|
|
5270
|
-
'top:' + maps.mapAreaRect.y + 'px;' +
|
|
5271
|
-
'left:' + maps.mapAreaRect.x + 'px;' +
|
|
5272
|
-
'height:' + maps.mapAreaRect.height + 'px;' +
|
|
5273
|
-
'width:' + maps.mapAreaRect.width + 'px;';
|
|
5274
|
-
currentLayer.markerSettings.map(function (markerSettings, markerIndex) {
|
|
5275
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5276
|
-
var markerData = markerSettings.dataSource;
|
|
5277
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5278
|
-
Array.prototype.forEach.call(markerData, function (data, dataIndex) {
|
|
5279
|
-
maps.markerNullCount = markerIndex > 0 && dataIndex === 0 ? 0 : maps.markerNullCount;
|
|
5280
|
-
var eventArgs = {
|
|
5281
|
-
cancel: false, name: markerRendering, fill: markerSettings.fill, height: markerSettings.height,
|
|
5282
|
-
width: markerSettings.width, imageUrl: markerSettings.imageUrl, shape: markerSettings.shape,
|
|
5283
|
-
template: markerSettings.template, data: data, maps: maps, marker: markerSettings,
|
|
5284
|
-
border: markerSettings.border, colorValuePath: markerSettings.colorValuePath,
|
|
5285
|
-
shapeValuePath: markerSettings.shapeValuePath, imageUrlValuePath: markerSettings.imageUrlValuePath
|
|
5286
|
-
};
|
|
5287
|
-
maps.trigger('markerRendering', eventArgs, function (MarkerArgs) {
|
|
5288
|
-
eventArgs = markerColorChoose(eventArgs, data);
|
|
5289
|
-
eventArgs = markerShapeChoose(eventArgs, data);
|
|
5290
|
-
var lng = (!isNullOrUndefined(markerSettings.longitudeValuePath)) ?
|
|
5291
|
-
Number(getValueFromObject(data, markerSettings.longitudeValuePath)) : !isNullOrUndefined(data['longitude']) ?
|
|
5292
|
-
parseFloat(data['longitude']) : !isNullOrUndefined(data['Longitude']) ? parseFloat(data['Longitude']) : null;
|
|
5293
|
-
var lat = (!isNullOrUndefined(markerSettings.latitudeValuePath)) ?
|
|
5294
|
-
Number(getValueFromObject(data, markerSettings.latitudeValuePath)) : !isNullOrUndefined(data['latitude']) ?
|
|
5295
|
-
parseFloat(data['latitude']) : !isNullOrUndefined(data['Latitude']) ? parseFloat(data['Latitude']) : null;
|
|
5296
|
-
var offset = markerSettings.offset;
|
|
5297
|
-
if (!eventArgs.cancel && markerSettings.visible && !isNullOrUndefined(lng) && !isNullOrUndefined(lat)) {
|
|
5298
|
-
var markerID = maps.element.id + '_LayerIndex_' + layerIndex + '_MarkerIndex_'
|
|
5299
|
-
+ markerIndex + '_dataIndex_' + dataIndex;
|
|
5300
|
-
var location_1 = (maps.isTileMap) ? convertTileLatLongToPoint(new MapLocation(lng, lat), factor, maps.tileTranslatePoint, true) : convertGeoToPoint(lat, lng, factor, currentLayer, maps);
|
|
5301
|
-
var animate$$1 = (currentLayer.animationDuration !== 0 || animationMode === 'Enable') || isNullOrUndefined(maps.zoomModule);
|
|
5302
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5303
|
-
var translate = (maps.isTileMap) ? (currentLayer.type === 'SubLayer' && isNullOrUndefined(maps.zoomModule)) ? location_1 = convertTileLatLongToPoint(new MapLocation(lng, lat), maps.tileZoomLevel, maps.tileTranslatePoint, true) : new Object() :
|
|
5304
|
-
!isNullOrUndefined(maps.zoomModule) && maps.zoomSettings.zoomFactor > 1 ?
|
|
5305
|
-
getZoomTranslate(maps, currentLayer, animate$$1) :
|
|
5306
|
-
getTranslate(maps, currentLayer, animate$$1);
|
|
5307
|
-
var scale = type === 'AddMarker' ? maps.scale : translate['scale'];
|
|
5308
|
-
var transPoint = type === 'AddMarker' ? maps.translatePoint : translate['location'];
|
|
5309
|
-
if (eventArgs.template && (!isNaN(location_1.x) && !isNaN(location_1.y))) {
|
|
5310
|
-
markerTemplateCount++;
|
|
5311
|
-
markerTemplate(eventArgs, templateFn, markerID, data, markerIndex, markerTemplateEle, location_1, transPoint, scale, offset, maps);
|
|
5312
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5313
|
-
maps.renderReactTemplates();
|
|
5314
|
-
}
|
|
5315
|
-
else if (!eventArgs.template && (!isNaN(location_1.x) && !isNaN(location_1.y))) {
|
|
5316
|
-
markerCount++;
|
|
5317
|
-
marker(eventArgs, markerSettings, markerData, dataIndex, location_1, transPoint, markerID, offset, scale, maps, _this.markerSVGObject);
|
|
5318
|
-
}
|
|
5319
|
-
}
|
|
5320
|
-
nullCount += (!isNaN(lat) && !isNaN(lng)) ? 0 : 1;
|
|
5321
|
-
markerTemplateCount += (eventArgs.cancel) ? 1 : 0;
|
|
5322
|
-
markerCount += (eventArgs.cancel) ? 1 : 0;
|
|
5323
|
-
maps.markerNullCount = (isNullOrUndefined(lng) || isNullOrUndefined(lat)) ?
|
|
5324
|
-
maps.markerNullCount + 1 : maps.markerNullCount;
|
|
5325
|
-
var markerDataLength = markerData.length - maps.markerNullCount;
|
|
5326
|
-
if (_this.markerSVGObject.childElementCount === (markerDataLength - markerTemplateCount - nullCount) && (type !== 'Template')) {
|
|
5327
|
-
layerElement.appendChild(_this.markerSVGObject);
|
|
5328
|
-
if (currentLayer.markerClusterSettings.allowClustering) {
|
|
5329
|
-
maps.svgObject.appendChild(_this.markerSVGObject);
|
|
5330
|
-
maps.element.appendChild(maps.svgObject);
|
|
5331
|
-
if ((currentLayer.layerType === 'OSM' || (currentLayer.urlTemplate.indexOf('openstreetmap') !== -1 && isNullOrUndefined(currentLayer.shapeData)))
|
|
5332
|
-
&& maps.zoomSettings.enable) {
|
|
5333
|
-
clusterTemplate(currentLayer, _this.markerSVGObject, maps, layerIndex, _this.markerSVGObject, layerElement, true, false);
|
|
5334
|
-
layerElement.appendChild(_this.markerSVGObject);
|
|
5335
|
-
}
|
|
5336
|
-
else {
|
|
5337
|
-
clusterTemplate(currentLayer, _this.markerSVGObject, maps, layerIndex, _this.markerSVGObject, layerElement, true, false);
|
|
5338
|
-
}
|
|
5339
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5340
|
-
maps.renderReactTemplates();
|
|
5341
|
-
}
|
|
5342
|
-
}
|
|
5343
|
-
if (markerTemplateEle.childElementCount === (markerDataLength - markerCount - nullCount) && getElementByID(maps.element.id + '_Secondary_Element')) {
|
|
5344
|
-
getElementByID(maps.element.id + '_Secondary_Element').appendChild(markerTemplateEle);
|
|
5345
|
-
if (maps.checkInitialRender) {
|
|
5346
|
-
if (currentLayer.markerClusterSettings.allowClustering) {
|
|
5347
|
-
clusterTemplate(currentLayer, markerTemplateEle, maps, layerIndex, _this.markerSVGObject, layerElement, false, false);
|
|
5348
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5349
|
-
maps.renderReactTemplates();
|
|
5350
|
-
}
|
|
5351
|
-
}
|
|
5352
|
-
}
|
|
5353
|
-
});
|
|
5354
|
-
});
|
|
5355
|
-
});
|
|
5356
|
-
};
|
|
5357
|
-
/**
|
|
5358
|
-
* To find zoom level for individual layers like India, USA.
|
|
5359
|
-
*
|
|
5360
|
-
* @param {number} mapWidth - Specifies the width of the maps
|
|
5361
|
-
* @param {number} mapHeight - Specifies the height of the maps
|
|
5362
|
-
* @param {number} maxZoomFact - Specifies the maximum zoom factor
|
|
5363
|
-
* @returns {number} - Returns the scale factor
|
|
5364
|
-
*/
|
|
5365
|
-
Marker.prototype.calculateIndividualLayerMarkerZoomLevel = function (mapWidth, mapHeight, maxZoomFact) {
|
|
5366
|
-
var latZoom;
|
|
5367
|
-
var lngZoom;
|
|
5368
|
-
var height = Math.abs(this.maps.baseMapBounds.latitude.max - this.maps.baseMapBounds.latitude.min);
|
|
5369
|
-
var width = Math.abs(this.maps.baseMapBounds.longitude.max - this.maps.baseMapBounds.longitude.min);
|
|
5370
|
-
latZoom = Math.floor(Math.log(mapHeight / height));
|
|
5371
|
-
latZoom = (latZoom > maxZoomFact) ? maxZoomFact : latZoom;
|
|
5372
|
-
lngZoom = Math.floor(Math.log(mapWidth / width));
|
|
5373
|
-
lngZoom = (lngZoom > maxZoomFact) ? maxZoomFact : lngZoom;
|
|
5374
|
-
var result = Math.min(latZoom, lngZoom);
|
|
5375
|
-
var scaleFactor = Math.min(result, maxZoomFact - 1);
|
|
5376
|
-
if (!this.maps.isTileMap) {
|
|
5377
|
-
compareZoomFactor(scaleFactor, this.maps);
|
|
5378
|
-
}
|
|
5379
|
-
return scaleFactor;
|
|
5380
|
-
};
|
|
5381
|
-
/**
|
|
5382
|
-
* To calculate center position and factor value dynamically
|
|
5383
|
-
*
|
|
5384
|
-
* @param {LayerSettings[]} layersCollection - Specifies the layer settings instance.
|
|
5385
|
-
* @returns {void}
|
|
5386
|
-
* @private
|
|
5387
|
-
*/
|
|
5388
|
-
Marker.prototype.calculateZoomCenterPositionAndFactor = function (layersCollection) {
|
|
5389
|
-
if (!isNullOrUndefined(this.maps)) {
|
|
5390
|
-
if (this.maps.zoomSettings.shouldZoomInitially && this.maps.markerModule) {
|
|
5391
|
-
var minLong_1;
|
|
5392
|
-
var maxLat_1;
|
|
5393
|
-
var minLat_1;
|
|
5394
|
-
var maxLong_1;
|
|
5395
|
-
var zoomLevel = void 0;
|
|
5396
|
-
var centerLat = void 0;
|
|
5397
|
-
var centerLong = void 0;
|
|
5398
|
-
var maxZoomFact = this.maps.zoomSettings.maxZoom;
|
|
5399
|
-
var mapWidth = this.maps.mapAreaRect.width;
|
|
5400
|
-
var mapHeight = this.maps.mapAreaRect.height;
|
|
5401
|
-
this.maps.markerZoomedState = this.maps.markerZoomedState ? this.maps.markerZoomedState :
|
|
5402
|
-
isNullOrUndefined(this.maps.markerZoomFactor) ? !this.maps.markerZoomedState :
|
|
5403
|
-
this.maps.markerZoomFactor > 1 ? this.maps.markerZoomedState : !this.maps.markerZoomedState;
|
|
5404
|
-
this.maps.defaultState = this.maps.markerZoomedState ? !this.maps.markerZoomedState : this.maps.defaultState;
|
|
5405
|
-
Array.prototype.forEach.call(layersCollection, function (currentLayer) {
|
|
5406
|
-
var isMarker = currentLayer.markerSettings.length !== 0;
|
|
5407
|
-
if (isMarker) {
|
|
5408
|
-
Array.prototype.forEach.call(currentLayer.markerSettings, function (markerSetting) {
|
|
5409
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5410
|
-
var markerData = markerSetting.dataSource;
|
|
5411
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5412
|
-
Array.prototype.forEach.call(markerData, function (data, dataIndex) {
|
|
5413
|
-
var latitude = !isNullOrUndefined(data['latitude']) ? parseFloat(data['latitude']) :
|
|
5414
|
-
!isNullOrUndefined(data['Latitude']) ? parseFloat(data['Latitude']) : null;
|
|
5415
|
-
var longitude = !isNullOrUndefined(data['longitude']) ? parseFloat(data['longitude']) :
|
|
5416
|
-
!isNullOrUndefined(data['Longitude']) ? parseFloat(data['Longitude']) : null;
|
|
5417
|
-
minLong_1 = isNullOrUndefined(minLong_1) && dataIndex === 0 ?
|
|
5418
|
-
longitude : minLong_1;
|
|
5419
|
-
maxLat_1 = isNullOrUndefined(maxLat_1) && dataIndex === 0 ?
|
|
5420
|
-
latitude : maxLat_1;
|
|
5421
|
-
minLat_1 = isNullOrUndefined(minLat_1) && dataIndex === 0 ?
|
|
5422
|
-
latitude : minLat_1;
|
|
5423
|
-
maxLong_1 = isNullOrUndefined(maxLong_1) && dataIndex === 0 ?
|
|
5424
|
-
longitude : maxLong_1;
|
|
5425
|
-
if (minLong_1 > longitude) {
|
|
5426
|
-
minLong_1 = longitude;
|
|
5427
|
-
}
|
|
5428
|
-
if (minLat_1 > latitude) {
|
|
5429
|
-
minLat_1 = latitude;
|
|
5430
|
-
}
|
|
5431
|
-
if (maxLong_1 < longitude) {
|
|
5432
|
-
maxLong_1 = longitude;
|
|
5433
|
-
}
|
|
5434
|
-
if (maxLat_1 < latitude) {
|
|
5435
|
-
maxLat_1 = latitude;
|
|
5436
|
-
}
|
|
5437
|
-
});
|
|
5438
|
-
});
|
|
5439
|
-
}
|
|
5440
|
-
});
|
|
5441
|
-
if (!isNullOrUndefined(minLat_1) && !isNullOrUndefined(minLong_1) &&
|
|
5442
|
-
!isNullOrUndefined(maxLong_1) && !isNullOrUndefined(maxLat_1)) {
|
|
5443
|
-
// To find the center position
|
|
5444
|
-
centerLat = (minLat_1 + maxLat_1) / 2;
|
|
5445
|
-
centerLong = (minLong_1 + maxLong_1) / 2;
|
|
5446
|
-
this.maps.markerCenterLatitude = centerLat;
|
|
5447
|
-
this.maps.markerCenterLongitude = centerLong;
|
|
5448
|
-
if (isNullOrUndefined(this.maps.markerZoomCenterPoint) || this.maps.markerZoomedState) {
|
|
5449
|
-
this.maps.markerZoomCenterPoint = {
|
|
5450
|
-
latitude: centerLat,
|
|
5451
|
-
longitude: centerLong
|
|
5452
|
-
};
|
|
5453
|
-
}
|
|
5454
|
-
var markerFactor = void 0;
|
|
5455
|
-
if (this.maps.isTileMap || this.maps.baseMapRectBounds['min']['x'] === 0) {
|
|
5456
|
-
zoomLevel = calculateZoomLevel(minLat_1, maxLat_1, minLong_1, maxLong_1, mapWidth, mapHeight, this.maps, false);
|
|
5457
|
-
if (this.maps.isTileMap) {
|
|
5458
|
-
markerFactor = isNullOrUndefined(this.maps.markerZoomFactor) ?
|
|
5459
|
-
zoomLevel : isNullOrUndefined(this.maps.mapScaleValue) ?
|
|
5460
|
-
zoomLevel : this.maps.mapScaleValue > 1 && this.maps.markerZoomFactor !== 1 ?
|
|
5461
|
-
this.maps.mapScaleValue : zoomLevel;
|
|
5462
|
-
}
|
|
5463
|
-
else {
|
|
5464
|
-
markerFactor = isNullOrUndefined(this.maps.mapScaleValue) ? zoomLevel :
|
|
5465
|
-
(Math.floor(this.maps.scale) !== 1 &&
|
|
5466
|
-
this.maps.mapScaleValue !== zoomLevel)
|
|
5467
|
-
&&
|
|
5468
|
-
(isNullOrUndefined(this.maps.shouldZoomCurrentFactor))
|
|
5469
|
-
? this.maps.mapScaleValue : zoomLevel;
|
|
5470
|
-
if (((markerFactor === this.maps.mapScaleValue &&
|
|
5471
|
-
(this.maps.markerZoomFactor === 1 || this.maps.mapScaleValue === 1))
|
|
5472
|
-
&& (!this.maps.enablePersistence))) {
|
|
5473
|
-
markerFactor = zoomLevel;
|
|
5474
|
-
}
|
|
5475
|
-
}
|
|
5476
|
-
}
|
|
5477
|
-
else {
|
|
5478
|
-
zoomLevel = this.calculateIndividualLayerMarkerZoomLevel(mapWidth, mapHeight, maxZoomFact);
|
|
5479
|
-
markerFactor = isNullOrUndefined(this.maps.mapScaleValue) ? zoomLevel :
|
|
5480
|
-
(this.maps.mapScaleValue !== zoomLevel)
|
|
5481
|
-
? this.maps.mapScaleValue : zoomLevel;
|
|
5482
|
-
}
|
|
5483
|
-
this.maps.markerZoomFactor = markerFactor;
|
|
5484
|
-
}
|
|
5485
|
-
}
|
|
5486
|
-
else {
|
|
5487
|
-
this.maps.markerZoomedState = false;
|
|
5488
|
-
if (this.maps.markerZoomFactor > 1) {
|
|
5489
|
-
this.maps.markerCenterLatitude = null;
|
|
5490
|
-
this.maps.markerCenterLongitude = null;
|
|
5491
|
-
this.maps.markerZoomFactor = 1;
|
|
5492
|
-
if (!this.maps.enablePersistence) {
|
|
5493
|
-
this.maps.mapScaleValue = 1;
|
|
5494
|
-
}
|
|
5495
|
-
}
|
|
5496
|
-
if (this.maps.isTileMap && !this.maps.enablePersistence
|
|
5497
|
-
&& this.maps.mapScaleValue <= 1) {
|
|
5498
|
-
this.maps.tileZoomLevel = this.maps.mapScaleValue === 0 ? (this.maps.isZoomByPosition ? this.maps.tileZoomLevel : 1)
|
|
5499
|
-
: this.maps.mapScaleValue;
|
|
5500
|
-
if (this.maps.mapScaleValue === 1 && this.maps.markerZoomFactor === 1) {
|
|
5501
|
-
this.maps.tileTranslatePoint.x = 0;
|
|
5502
|
-
this.maps.tileTranslatePoint.y = 0;
|
|
5503
|
-
}
|
|
5504
|
-
}
|
|
5505
|
-
}
|
|
5506
|
-
}
|
|
5507
|
-
};
|
|
5508
|
-
/**
|
|
5509
|
-
* To check and trigger marker click event
|
|
5510
|
-
* @param {PointerEvent} e - Specifies the pointer event argument.
|
|
5511
|
-
* @returns {void}
|
|
5512
|
-
* @private
|
|
5513
|
-
*/
|
|
5514
|
-
Marker.prototype.markerClick = function (e) {
|
|
5515
|
-
var target = e.target.id;
|
|
5516
|
-
if (target.indexOf(this.maps.element.id) === -1) {
|
|
5517
|
-
var ancestor = e.target.closest('.' + this.maps.element.id + '_marker_template_element');
|
|
5518
|
-
if (!isNullOrUndefined(ancestor) && ancestor.id.indexOf('_MarkerIndex_') > -1) {
|
|
5519
|
-
target = ancestor.id;
|
|
5520
|
-
}
|
|
5521
|
-
}
|
|
5522
|
-
if (target.indexOf('_LayerIndex_') === -1 || target.indexOf('_cluster_') > 0) {
|
|
5523
|
-
return;
|
|
5524
|
-
}
|
|
5525
|
-
var options = this.getMarker(target);
|
|
5526
|
-
if (isNullOrUndefined(options)) {
|
|
5527
|
-
return;
|
|
5528
|
-
}
|
|
5529
|
-
if (options.marker.enableDrag) {
|
|
5530
|
-
document.getElementById(this.maps.element.id + "_svg").style.cursor = 'grabbing';
|
|
5531
|
-
}
|
|
5532
|
-
var eventArgs = {
|
|
5533
|
-
cancel: false, name: markerClick, data: options.data, maps: this.maps,
|
|
5534
|
-
marker: options.marker, target: target, x: e.clientX, y: e.clientY,
|
|
5535
|
-
latitude: options.data['latitude'] || options.data['Latitude'],
|
|
5536
|
-
longitude: options.data['longitude'] || options.data['Longitude'],
|
|
5537
|
-
value: options.data['name']
|
|
5538
|
-
};
|
|
5539
|
-
this.maps.trigger(markerClick, eventArgs);
|
|
5540
|
-
if (options.marker.enableDrag) {
|
|
5541
|
-
var isCluster = false;
|
|
5542
|
-
var layerIndex = parseInt(target.split('_LayerIndex_')[1].split('_')[0], 10);
|
|
5543
|
-
var markerIndex = parseInt(target.split('_MarkerIndex_')[1].split('_')[0], 10);
|
|
5544
|
-
var dataIndex_1 = parseInt(target.split('_dataIndex_')[1].split('_')[0], 10);
|
|
5545
|
-
var marker_1 = this.maps.layers[layerIndex].markerSettings[markerIndex];
|
|
5546
|
-
if (this.sameMarkerData.length > 0) {
|
|
5547
|
-
isCluster = (this.sameMarkerData[0].data.filter(function (el) { return (el['index'] == dataIndex_1); })).length > 0 &&
|
|
5548
|
-
this.sameMarkerData[0].layerIndex === layerIndex && this.sameMarkerData[0].markerIndex === markerIndex;
|
|
5549
|
-
}
|
|
5550
|
-
if (!isCluster) {
|
|
5551
|
-
var dragEventArgs = {
|
|
5552
|
-
name: markerDragStart, x: e.clientX, y: e.clientY,
|
|
5553
|
-
latitude: options.data['latitude'] || options.data['Latitude'],
|
|
5554
|
-
longitude: options.data['longitude'] || options.data['Longitude'],
|
|
5555
|
-
layerIndex: layerIndex, markerIndex: markerIndex, dataIndex: dataIndex_1
|
|
5556
|
-
};
|
|
5557
|
-
this.maps.trigger(markerDragStart, dragEventArgs);
|
|
5558
|
-
this.maps.markerDragArgument = {
|
|
5559
|
-
targetId: target, x: e.clientX, y: e.clientY,
|
|
5560
|
-
latitude: options.data['latitude'] || options.data['Latitude'],
|
|
5561
|
-
longitude: options.data['longitude'] || options.data['Longitude'],
|
|
5562
|
-
shape: isNullOrUndefined(marker_1.shapeValuePath) ? marker_1.shape : marker_1.dataSource[dataIndex_1][marker_1.shapeValuePath],
|
|
5563
|
-
layerIndex: layerIndex, markerIndex: markerIndex, dataIndex: dataIndex_1
|
|
5564
|
-
};
|
|
5565
|
-
}
|
|
5566
|
-
}
|
|
5567
|
-
};
|
|
5568
|
-
/**
|
|
5569
|
-
* To check and trigger Cluster click event
|
|
5570
|
-
* @param {PointerEvent} e - Specifies the pointer event argument.
|
|
5571
|
-
* @returns {void}
|
|
5572
|
-
* @private
|
|
5573
|
-
*/
|
|
5574
|
-
Marker.prototype.markerClusterClick = function (e) {
|
|
5575
|
-
var target = e.target.id;
|
|
5576
|
-
if (target.indexOf('_LayerIndex_') === -1 || target.indexOf('_cluster_') === -1) {
|
|
5577
|
-
return;
|
|
5578
|
-
}
|
|
5579
|
-
var options = this.getMarker(target);
|
|
5580
|
-
if (isNullOrUndefined(options)) {
|
|
5581
|
-
return;
|
|
5582
|
-
}
|
|
5583
|
-
if ((options.clusterCollection.length > 0 && this.maps.markerClusterExpand)) {
|
|
5584
|
-
if (getElement(this.maps.element.id + '_mapsTooltip') &&
|
|
5585
|
-
this.maps.mapsTooltipModule.tooltipTargetID.indexOf('_MarkerIndex_') > -1) {
|
|
5586
|
-
removeElement(this.maps.element.id + '_mapsTooltip');
|
|
5587
|
-
}
|
|
5588
|
-
if (this.sameMarkerData.length > 0 && !this.maps.markerClusterExpandCheck) {
|
|
5589
|
-
this.maps.markerClusterExpandCheck = true;
|
|
5590
|
-
mergeSeparateCluster(this.sameMarkerData, this.maps, this.markerSVGObject);
|
|
5591
|
-
}
|
|
5592
|
-
else {
|
|
5593
|
-
this.sameMarkerData = options.clusterCollection;
|
|
5594
|
-
this.maps.markerClusterExpandCheck = false;
|
|
5595
|
-
clusterSeparate(this.sameMarkerData, this.maps, this.markerSVGObject, true);
|
|
5596
|
-
}
|
|
5597
|
-
}
|
|
5598
|
-
var eventArgs = {
|
|
5599
|
-
cancel: false, name: markerClusterClick, data: options, maps: this.maps,
|
|
5600
|
-
target: target, x: e.clientX, y: e.clientY,
|
|
5601
|
-
latitude: options.data['latitude'] || options.data['Latitude'], longitude: options.data['longitude'] || options.data['Longitude'],
|
|
5602
|
-
markerClusterCollection: options['markCollection']
|
|
5603
|
-
};
|
|
5604
|
-
this.maps.trigger(markerClusterClick, eventArgs);
|
|
5605
|
-
};
|
|
5606
|
-
/**
|
|
5607
|
-
* To get marker from target id
|
|
5608
|
-
*
|
|
5609
|
-
* @param {string} target - Specifies the target
|
|
5610
|
-
* @returns {string} - Returns the string
|
|
5611
|
-
*/
|
|
5612
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5613
|
-
Marker.prototype.getMarker = function (target) {
|
|
5614
|
-
var id = target.split('_LayerIndex_');
|
|
5615
|
-
var index = parseInt(id[1].split('_')[0], 10);
|
|
5616
|
-
var layer = this.maps.layers[index];
|
|
5617
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5618
|
-
var data;
|
|
5619
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5620
|
-
var markCollection = [];
|
|
5621
|
-
var clusterCollection = [];
|
|
5622
|
-
var marker$$1;
|
|
5623
|
-
this.maps.markerClusterExpand = layer.markerClusterSettings.allowClusterExpand;
|
|
5624
|
-
if (target.indexOf('_MarkerIndex_') > -1) {
|
|
5625
|
-
var markerIndex = parseInt(id[1].split('_MarkerIndex_')[1].split('_')[0], 10);
|
|
5626
|
-
var dataIndex = parseInt(id[1].split('_dataIndex_')[1].split('_')[0], 10);
|
|
5627
|
-
marker$$1 = layer.markerSettings[markerIndex];
|
|
5628
|
-
if (!isNaN(markerIndex)) {
|
|
5629
|
-
data = marker$$1.dataSource[dataIndex];
|
|
5630
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5631
|
-
var collection_1 = [];
|
|
5632
|
-
if (!marker$$1.template && (target.indexOf('_cluster_') > -1) && (this.maps.layers[index].markerClusterSettings.allowClusterExpand)) {
|
|
5633
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5634
|
-
Array.prototype.forEach.call(marker$$1.dataSource, function (location, index) {
|
|
5635
|
-
if (location['latitude'] === data['latitude'] && location['longitude'] === data['longitude']) {
|
|
5636
|
-
collection_1.push({ data: data, index: index });
|
|
5637
|
-
}
|
|
5638
|
-
});
|
|
5639
|
-
}
|
|
5640
|
-
if ((target.indexOf('_cluster_') > -1)) {
|
|
5641
|
-
var isClusterSame = false;
|
|
5642
|
-
var 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);
|
|
5643
|
-
var indexes = layer.markerClusterSettings.shape === 'Balloon' ? clusterElement.children[0].textContent.split(',').map(Number) : clusterElement.textContent.split(',').map(Number);
|
|
5644
|
-
collection_1 = [];
|
|
5645
|
-
for (var _i = 0, indexes_1 = indexes; _i < indexes_1.length; _i++) {
|
|
5646
|
-
var i = indexes_1[_i];
|
|
5647
|
-
collection_1.push({ data: marker$$1.dataSource[i], index: i });
|
|
5648
|
-
markCollection.push(marker$$1.dataSource[i]);
|
|
5649
|
-
}
|
|
5650
|
-
isClusterSame = false;
|
|
5651
|
-
clusterCollection.push({
|
|
5652
|
-
data: collection_1, layerIndex: index, markerIndex: markerIndex, dataIndex: dataIndex,
|
|
5653
|
-
targetClusterIndex: +(target.split('_cluster_')[1].indexOf('_datalabel_') > -1 ? target.split('_cluster_')[1].split('_datalabel_')[0] : target.split('_cluster_')[1]),
|
|
5654
|
-
isClusterSame: isClusterSame
|
|
5655
|
-
});
|
|
5656
|
-
}
|
|
5657
|
-
return { marker: marker$$1, data: data, clusterCollection: clusterCollection, markCollection: markCollection };
|
|
5658
|
-
}
|
|
5659
|
-
}
|
|
5660
|
-
return null;
|
|
5661
|
-
};
|
|
5662
|
-
/**
|
|
5663
|
-
* To check and trigger marker move event
|
|
5664
|
-
*
|
|
5665
|
-
* @param {PointerEvent} e - Specifies the pointer event argument.
|
|
5666
|
-
* @returns {void}
|
|
5667
|
-
* @private
|
|
5668
|
-
*/
|
|
5669
|
-
Marker.prototype.markerMove = function (e) {
|
|
5670
|
-
var targetId = e.target.id;
|
|
5671
|
-
if (targetId.indexOf('_LayerIndex_') === -1 || targetId.indexOf('_cluster_') > 0) {
|
|
5672
|
-
return;
|
|
5673
|
-
}
|
|
5674
|
-
var options = this.getMarker(targetId);
|
|
5675
|
-
if (isNullOrUndefined(options)) {
|
|
5676
|
-
return;
|
|
5677
|
-
}
|
|
5678
|
-
if (options.marker.enableDrag) {
|
|
5679
|
-
document.getElementById(this.maps.element.id + "_svg").style.cursor = isNullOrUndefined(this.maps.markerDragArgument) ?
|
|
5680
|
-
'pointer' : 'grabbing';
|
|
5681
|
-
}
|
|
5682
|
-
var eventArgs = {
|
|
5683
|
-
cancel: false, name: markerMouseMove, data: options.data,
|
|
5684
|
-
maps: this.maps, target: targetId, x: e.clientX, y: e.clientY
|
|
5685
|
-
};
|
|
5686
|
-
this.maps.trigger(markerMouseMove, eventArgs);
|
|
5687
|
-
};
|
|
5688
|
-
/**
|
|
5689
|
-
* To check and trigger cluster move event
|
|
5690
|
-
*
|
|
5691
|
-
* @param {PointerEvent} e - Specifies the pointer event argument.
|
|
5692
|
-
* @returns {void}
|
|
5693
|
-
* @private
|
|
5694
|
-
*/
|
|
5695
|
-
Marker.prototype.markerClusterMouseMove = function (e) {
|
|
5696
|
-
var targetId = e.target.id;
|
|
5697
|
-
if (targetId.indexOf('_LayerIndex_') === -1 || targetId.indexOf('_cluster_') === -1) {
|
|
5698
|
-
return;
|
|
5699
|
-
}
|
|
5700
|
-
var options = this.getMarker(targetId);
|
|
5701
|
-
if (this.maps.markerClusterExpand) {
|
|
5702
|
-
e.target.style.cursor = 'pointer';
|
|
5703
|
-
}
|
|
5704
|
-
if (isNullOrUndefined(options)) {
|
|
5705
|
-
return;
|
|
5706
|
-
}
|
|
5707
|
-
var eventArgs = {
|
|
5708
|
-
cancel: false, name: markerClusterMouseMove, data: options.data, maps: this.maps,
|
|
5709
|
-
target: targetId, x: e.clientX, y: e.clientY
|
|
5710
|
-
};
|
|
5711
|
-
this.maps.trigger(markerClusterMouseMove, eventArgs);
|
|
5712
|
-
};
|
|
5713
|
-
/**
|
|
5714
|
-
* Get module name.
|
|
5715
|
-
*
|
|
5716
|
-
* @returns {string} - Returns the module name
|
|
5717
|
-
*/
|
|
5718
|
-
Marker.prototype.getModuleName = function () {
|
|
5719
|
-
return 'Marker';
|
|
5720
|
-
};
|
|
5721
|
-
/**
|
|
5722
|
-
* To destroy the layers.
|
|
5723
|
-
*
|
|
5724
|
-
* @returns {void}
|
|
5725
|
-
* @private
|
|
5726
|
-
*/
|
|
5727
|
-
Marker.prototype.destroy = function () {
|
|
5728
|
-
this.maps = null;
|
|
5729
|
-
this.trackElements = [];
|
|
5730
|
-
this.markerSVGObject = null;
|
|
5731
|
-
this.sameMarkerData = [];
|
|
5732
|
-
};
|
|
5733
|
-
return Marker;
|
|
5734
|
-
}());
|
|
5735
|
-
|
|
5736
|
-
/**
|
|
5737
|
-
* Maps constants doc
|
|
5343
|
+
* Maps constants doc
|
|
5738
5344
|
*/
|
|
5739
5345
|
/**
|
|
5740
5346
|
* Specifies the maps load event name.
|
|
@@ -6400,6 +6006,12 @@ var LayerPanel = /** @__PURE__ @class */ (function () {
|
|
|
6400
6006
|
&& panel.mapObject.previousZoomFactor !== panel.mapObject.zoomSettings.zoomFactor) {
|
|
6401
6007
|
panel.mapObject.previousZoomFactor = panel.mapObject.zoomSettings.zoomFactor;
|
|
6402
6008
|
}
|
|
6009
|
+
if (panel.mapObject.polygonModule) {
|
|
6010
|
+
var polygonElement = panel.mapObject.polygonModule.polygonRender(this.mapObject, layerIndex, panel.mapObject.tileZoomLevel);
|
|
6011
|
+
if (!isNullOrUndefined(polygonElement)) {
|
|
6012
|
+
panel.layerObject.appendChild(polygonElement);
|
|
6013
|
+
}
|
|
6014
|
+
}
|
|
6403
6015
|
if (panel.mapObject.navigationLineModule) {
|
|
6404
6016
|
var navigationLineElement = panel.mapObject.navigationLineModule.renderNavigation(panel.currentLayer, panel.mapObject.tileZoomLevel, layerIndex);
|
|
6405
6017
|
if (!isNullOrUndefined(navigationLineElement)) {
|
|
@@ -6865,6 +6477,9 @@ var LayerPanel = /** @__PURE__ @class */ (function () {
|
|
|
6865
6477
|
layerIndex, colors, renderData, labelTemplateEle) {
|
|
6866
6478
|
var _this = this;
|
|
6867
6479
|
var bubbleG;
|
|
6480
|
+
if (this.mapObject.polygonModule) {
|
|
6481
|
+
this.groupElements.push(this.mapObject.polygonModule.polygonRender(this.mapObject, layerIndex, (this.mapObject.isTileMap ? Math.floor(this.currentFactor) : this.currentFactor)));
|
|
6482
|
+
}
|
|
6868
6483
|
if (this.currentLayer.bubbleSettings.length && this.mapObject.bubbleModule) {
|
|
6869
6484
|
var length_1 = this.currentLayer.bubbleSettings.length;
|
|
6870
6485
|
var bubble_1;
|
|
@@ -7220,9 +6835,11 @@ var LayerPanel = /** @__PURE__ @class */ (function () {
|
|
|
7220
6835
|
(!(childNode.id.indexOf('_bubble_Group') > -1)) &&
|
|
7221
6836
|
(!(childNode.id.indexOf('_dataLableIndex_Group') > -1)) &&
|
|
7222
6837
|
(!(childNode.id.indexOf('_line_Group') > -1))) {
|
|
7223
|
-
|
|
7224
|
-
|
|
7225
|
-
|
|
6838
|
+
if (childNode.id.indexOf('_Polygons_Group') === -1) {
|
|
6839
|
+
var transform = 'scale( ' + this.mapObject.scale + ' ) ' + 'translate( ' + this.mapObject.translatePoint.x
|
|
6840
|
+
+ ' ' + this.mapObject.translatePoint.y + ' ) ';
|
|
6841
|
+
childNode.setAttribute('transform', transform);
|
|
6842
|
+
}
|
|
7226
6843
|
}
|
|
7227
6844
|
}
|
|
7228
6845
|
}
|
|
@@ -7939,6 +7556,8 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
|
|
|
7939
7556
|
/** @private */
|
|
7940
7557
|
_this.selectedNavigationElementId = [];
|
|
7941
7558
|
/** @private */
|
|
7559
|
+
_this.selectedPolygonElementId = [];
|
|
7560
|
+
/** @private */
|
|
7942
7561
|
_this.selectedLegendElementId = [];
|
|
7943
7562
|
/** @private */
|
|
7944
7563
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -7956,6 +7575,8 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
|
|
|
7956
7575
|
/** @private */
|
|
7957
7576
|
_this.initialTileTranslate = new Point(0, 0);
|
|
7958
7577
|
/** @private */
|
|
7578
|
+
_this.isMarkerZoomCompleted = false;
|
|
7579
|
+
/** @private */
|
|
7959
7580
|
_this.markerDragId = '';
|
|
7960
7581
|
/** @private */
|
|
7961
7582
|
_this.initialCheck = true;
|
|
@@ -8322,10 +7943,20 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
|
|
|
8322
7943
|
this.zoomModule.removeToolbarOpacity(this.isTileMap ? Math.round(this.tileZoomLevel) : this.mapScaleValue, this.element.id + '_Zooming_');
|
|
8323
7944
|
}
|
|
8324
7945
|
if (!this.isZoomByPosition && !this.zoomNotApplied) {
|
|
8325
|
-
this.
|
|
7946
|
+
this.triggerZoomEvent();
|
|
8326
7947
|
}
|
|
8327
7948
|
this.isResize = false;
|
|
8328
7949
|
};
|
|
7950
|
+
Maps.prototype.triggerZoomEvent = function () {
|
|
7951
|
+
var loadedArgs;
|
|
7952
|
+
var minMaxLatitudeLongitude = this.getMinMaxLatitudeLongitude();
|
|
7953
|
+
loadedArgs = {
|
|
7954
|
+
maps: this, isResized: this.isResize, minLatitude: minMaxLatitudeLongitude.minLatitude,
|
|
7955
|
+
maxLatitude: minMaxLatitudeLongitude.maxLatitude, minLongitude: minMaxLatitudeLongitude.minLongitude,
|
|
7956
|
+
maxLongitude: minMaxLatitudeLongitude.maxLongitude, cancel: false, name: 'Loaded'
|
|
7957
|
+
};
|
|
7958
|
+
this.trigger('loaded', loadedArgs);
|
|
7959
|
+
};
|
|
8329
7960
|
/**
|
|
8330
7961
|
* To apply color to the initial selected marker
|
|
8331
7962
|
*
|
|
@@ -8497,6 +8128,20 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
|
|
|
8497
8128
|
this.element.appendChild(secondaryElement);
|
|
8498
8129
|
}
|
|
8499
8130
|
};
|
|
8131
|
+
/**
|
|
8132
|
+
* @returns {void}
|
|
8133
|
+
*/
|
|
8134
|
+
Maps.prototype.getMinMaxLatitudeLongitude = function () {
|
|
8135
|
+
var element = document.getElementById(this.element.id).getBoundingClientRect();
|
|
8136
|
+
var 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);
|
|
8137
|
+
var maxPosition = this.isTileMap ? this.pointToLatLong(this.mapAreaRect.width, (this.mapAreaRect.height - this.mapAreaRect.y)) :
|
|
8138
|
+
this.getGeoLocation(0, (this.mapAreaRect.x + element.left + this.mapAreaRect.width), (this.mapAreaRect.y + this.mapAreaRect.height));
|
|
8139
|
+
var MinMaxLatitudeLongitude = {
|
|
8140
|
+
minLatitude: minPosition.latitude, maxLatitude: maxPosition.latitude, minLongitude: minPosition.longitude,
|
|
8141
|
+
maxLongitude: maxPosition.longitude
|
|
8142
|
+
};
|
|
8143
|
+
return MinMaxLatitudeLongitude;
|
|
8144
|
+
};
|
|
8500
8145
|
/**
|
|
8501
8146
|
* @returns {void}
|
|
8502
8147
|
* @private
|
|
@@ -9414,7 +9059,7 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
|
|
|
9414
9059
|
*/
|
|
9415
9060
|
Maps.prototype.zoomByPosition = function (centerPosition, zoomFactor) {
|
|
9416
9061
|
if (!this.isDestroyed) {
|
|
9417
|
-
this.zoomNotApplied = false;
|
|
9062
|
+
this.zoomNotApplied = this.isMarkerZoomCompleted = false;
|
|
9418
9063
|
var isRefresh = this.zoomSettings.zoomFactor === zoomFactor;
|
|
9419
9064
|
this.previousProjection = null;
|
|
9420
9065
|
if (!this.isTileMap && this.zoomModule) {
|
|
@@ -9511,15 +9156,14 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
|
|
|
9511
9156
|
* @returns {void}
|
|
9512
9157
|
*/
|
|
9513
9158
|
Maps.prototype.addMarker = function (layerIndex, markerCollection) {
|
|
9514
|
-
if (!this.isDestroyed) {
|
|
9159
|
+
if (!this.isDestroyed && !isNullOrUndefined(this.markerModule)) {
|
|
9515
9160
|
var layerEle = document.getElementById(this.element.id + '_LayerIndex_' + layerIndex);
|
|
9516
9161
|
if (markerCollection.length > 0 && layerEle) {
|
|
9517
9162
|
for (var _i = 0, markerCollection_1 = markerCollection; _i < markerCollection_1.length; _i++) {
|
|
9518
9163
|
var newMarker = markerCollection_1[_i];
|
|
9519
9164
|
this.layersCollection[layerIndex].markerSettings.push(new MarkerSettings(this, 'markerSettings', newMarker));
|
|
9520
9165
|
}
|
|
9521
|
-
|
|
9522
|
-
markerModule.markerRender(this, layerEle, layerIndex, this.mapLayerPanel['currentFactor'], 'AddMarker');
|
|
9166
|
+
this.markerModule.markerRender(this, layerEle, layerIndex, this.mapLayerPanel['currentFactor'], 'AddMarker');
|
|
9523
9167
|
this.arrangeTemplate();
|
|
9524
9168
|
}
|
|
9525
9169
|
}
|
|
@@ -9645,6 +9289,7 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
|
|
|
9645
9289
|
Maps.prototype.zoomToCoordinates = function (minLatitude, minLongitude, maxLatitude, maxLongitude) {
|
|
9646
9290
|
var _a, _b;
|
|
9647
9291
|
if (!this.isDestroyed) {
|
|
9292
|
+
this.isMarkerZoomCompleted = false;
|
|
9648
9293
|
var centerLatitude = void 0;
|
|
9649
9294
|
var centerLongtitude = void 0;
|
|
9650
9295
|
var isTwoCoordinates = false;
|
|
@@ -9683,12 +9328,15 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
|
|
|
9683
9328
|
this.maxLongOfGivenLocation = maxLongitude;
|
|
9684
9329
|
this.zoomNotApplied = true;
|
|
9685
9330
|
this.scaleOfGivenLocation = calculateZoomLevel(minLatitude, maxLatitude, minLongitude, maxLongitude, this.mapAreaRect.width, this.mapAreaRect.height, this, true);
|
|
9331
|
+
var minMaxLatitudeLongitude = this.getMinMaxLatitudeLongitude();
|
|
9686
9332
|
var zoomArgs = {
|
|
9687
9333
|
cancel: false, name: 'zoom', type: zoomIn, maps: this,
|
|
9688
9334
|
tileTranslatePoint: {}, translatePoint: {},
|
|
9689
9335
|
tileZoomLevel: this.isTileMap ? { previous: this.tileZoomLevel, current: this.scaleOfGivenLocation } : {},
|
|
9690
9336
|
scale: !this.isTileMap ? { previous: this.scale, current: this.scaleOfGivenLocation } :
|
|
9691
|
-
{ previous: this.tileZoomLevel, current: this.scaleOfGivenLocation }
|
|
9337
|
+
{ previous: this.tileZoomLevel, current: this.scaleOfGivenLocation },
|
|
9338
|
+
minLatitude: minMaxLatitudeLongitude.minLatitude, maxLatitude: minMaxLatitudeLongitude.maxLatitude,
|
|
9339
|
+
minLongitude: minMaxLatitudeLongitude.minLongitude, maxLongitude: minMaxLatitudeLongitude.maxLongitude
|
|
9692
9340
|
};
|
|
9693
9341
|
this.trigger('zoom', zoomArgs);
|
|
9694
9342
|
this.refresh();
|
|
@@ -9860,6 +9508,9 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
|
|
|
9860
9508
|
}
|
|
9861
9509
|
else if (newProp.zoomSettings.shouldZoomInitially !== oldProp.zoomSettings.shouldZoomInitially) {
|
|
9862
9510
|
this.zoomSettings.zoomFactor = 1;
|
|
9511
|
+
this.previousProjection = null;
|
|
9512
|
+
this.scale = this.isMarkerZoomCompleted ? null : this.scale;
|
|
9513
|
+
this.isMarkerZoomCompleted = !newProp.zoomSettings.shouldZoomInitially;
|
|
9863
9514
|
render = true;
|
|
9864
9515
|
}
|
|
9865
9516
|
else if (newProp.zoomSettings.enable !== oldProp.zoomSettings.enable) {
|
|
@@ -9958,6 +9609,12 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
|
|
|
9958
9609
|
args: [this]
|
|
9959
9610
|
});
|
|
9960
9611
|
}
|
|
9612
|
+
if (this.isPolygonVisible()) {
|
|
9613
|
+
modules.push({
|
|
9614
|
+
member: 'Polygon',
|
|
9615
|
+
args: [this]
|
|
9616
|
+
});
|
|
9617
|
+
}
|
|
9961
9618
|
if (isVisible.tooltip) {
|
|
9962
9619
|
modules.push({
|
|
9963
9620
|
member: 'MapsTooltip',
|
|
@@ -10039,6 +9696,23 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
|
|
|
10039
9696
|
});
|
|
10040
9697
|
return isVisible;
|
|
10041
9698
|
};
|
|
9699
|
+
/**
|
|
9700
|
+
* To find navigation line visibility
|
|
9701
|
+
*
|
|
9702
|
+
* @returns {boolean} - Returns whether the navigation lines are visible or not.
|
|
9703
|
+
*/
|
|
9704
|
+
Maps.prototype.isPolygonVisible = function () {
|
|
9705
|
+
var isVisible = false;
|
|
9706
|
+
Array.prototype.forEach.call(this.layers, function (layer) {
|
|
9707
|
+
for (var i = 0; i < layer.polygonSettings.polygons.length; i++) {
|
|
9708
|
+
if (layer.polygonSettings.polygons.length > 0) {
|
|
9709
|
+
isVisible = true;
|
|
9710
|
+
break;
|
|
9711
|
+
}
|
|
9712
|
+
}
|
|
9713
|
+
});
|
|
9714
|
+
return isVisible;
|
|
9715
|
+
};
|
|
10042
9716
|
/**
|
|
10043
9717
|
* To find marker visibility
|
|
10044
9718
|
*/
|
|
@@ -10152,23 +9826,31 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
|
|
|
10152
9826
|
if (isHighlight === void 0) { isHighlight = false; }
|
|
10153
9827
|
var bubbles;
|
|
10154
9828
|
var markers;
|
|
10155
|
-
var
|
|
9829
|
+
var polygonSetting;
|
|
10156
9830
|
for (var _i = 0, layers_1 = layers; _i < layers_1.length; _i++) {
|
|
10157
9831
|
var layer = layers_1[_i];
|
|
10158
9832
|
isLayerVisible = layer.visible || isLayerVisible;
|
|
10159
9833
|
if (layer.visible) {
|
|
10160
9834
|
bubbles = layer.bubbleSettings;
|
|
10161
9835
|
markers = layer.markerSettings;
|
|
10162
|
-
|
|
9836
|
+
polygonSetting = layer.polygonSettings;
|
|
9837
|
+
var navigationLine = layer.navigationLineSettings;
|
|
10163
9838
|
for (var _a = 0, navigationLine_1 = navigationLine; _a < navigationLine_1.length; _a++) {
|
|
10164
9839
|
var navigation = navigationLine_1[_a];
|
|
10165
9840
|
if (navigation.visible) {
|
|
10166
|
-
isSelection = navigation.highlightSettings.enable || isSelection;
|
|
10167
|
-
isHighlight = navigation.selectionSettings.enable || isHighlight;
|
|
9841
|
+
isSelection = (!isNullOrUndefined(navigation.highlightSettings) && navigation.highlightSettings.enable) || isSelection;
|
|
9842
|
+
isHighlight = (!isNullOrUndefined(navigation.selectionSettings) && navigation.selectionSettings.enable) || isHighlight;
|
|
9843
|
+
}
|
|
9844
|
+
}
|
|
9845
|
+
for (var _b = 0, _c = polygonSetting.polygons; _b < _c.length; _b++) {
|
|
9846
|
+
var polygon = _c[_b];
|
|
9847
|
+
if (polygon.points.length > 0) {
|
|
9848
|
+
isSelection = layer.polygonSettings.highlightSettings.enable || isSelection;
|
|
9849
|
+
isHighlight = layer.polygonSettings.selectionSettings.enable || isHighlight;
|
|
10168
9850
|
}
|
|
10169
9851
|
}
|
|
10170
|
-
for (var
|
|
10171
|
-
var marker$$1 = markers_1[
|
|
9852
|
+
for (var _d = 0, markers_1 = markers; _d < markers_1.length; _d++) {
|
|
9853
|
+
var marker$$1 = markers_1[_d];
|
|
10172
9854
|
if (marker$$1.visible) {
|
|
10173
9855
|
istooltipVisible = marker$$1.tooltipSettings.visible || istooltipVisible;
|
|
10174
9856
|
isSelection = marker$$1.selectionSettings.enable || isSelection;
|
|
@@ -10178,8 +9860,8 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
|
|
|
10178
9860
|
break;
|
|
10179
9861
|
}
|
|
10180
9862
|
}
|
|
10181
|
-
for (var
|
|
10182
|
-
var bubble = bubbles_1[
|
|
9863
|
+
for (var _e = 0, bubbles_1 = bubbles; _e < bubbles_1.length; _e++) {
|
|
9864
|
+
var bubble = bubbles_1[_e];
|
|
10183
9865
|
if (bubble.visible) {
|
|
10184
9866
|
istooltipVisible = bubble.tooltipSettings.visible || istooltipVisible;
|
|
10185
9867
|
isSelection = bubble.selectionSettings.enable || isSelection;
|
|
@@ -10263,7 +9945,7 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
|
|
|
10263
9945
|
Maps.prototype.pointToLatLong = function (pageX, pageY) {
|
|
10264
9946
|
var latitude = 0;
|
|
10265
9947
|
var longitude = 0;
|
|
10266
|
-
if (!this.isDestroyed) {
|
|
9948
|
+
if (!this.isDestroyed && !isNullOrUndefined(this.translatePoint)) {
|
|
10267
9949
|
var padding = this.layers[this.layers.length - 1].layerType === 'GoogleStaticMap' ? 0 : 10;
|
|
10268
9950
|
pageY = pageY + padding;
|
|
10269
9951
|
var mapSize = 256 * Math.pow(2, this.tileZoomLevel);
|
|
@@ -10449,283 +10131,836 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
|
|
|
10449
10131
|
}(Component));
|
|
10450
10132
|
|
|
10451
10133
|
/**
|
|
10452
|
-
* Bubble module class
|
|
10134
|
+
* Bubble module class
|
|
10135
|
+
*/
|
|
10136
|
+
var Bubble = /** @__PURE__ @class */ (function () {
|
|
10137
|
+
function Bubble(maps) {
|
|
10138
|
+
/**
|
|
10139
|
+
* Bubble Id for current layer
|
|
10140
|
+
* @private
|
|
10141
|
+
*/
|
|
10142
|
+
this.id = '';
|
|
10143
|
+
this.maps = maps;
|
|
10144
|
+
this.bubbleCollection = [];
|
|
10145
|
+
}
|
|
10146
|
+
// eslint-disable-next-line valid-jsdoc
|
|
10147
|
+
/**
|
|
10148
|
+
* To render bubble
|
|
10149
|
+
*
|
|
10150
|
+
* @private
|
|
10151
|
+
*/
|
|
10152
|
+
Bubble.prototype.renderBubble = function (
|
|
10153
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10154
|
+
bubbleSettings, shapeData, color, range, bubbleIndex, dataIndex, layerIndex, layer, group, bubbleID) {
|
|
10155
|
+
var _this = this;
|
|
10156
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10157
|
+
var layerData = layer.layerData;
|
|
10158
|
+
var colorValuePath = bubbleSettings.colorValuePath;
|
|
10159
|
+
var equalValue = (!isNullOrUndefined(colorValuePath)) ? ((colorValuePath.indexOf('.') > -1) ?
|
|
10160
|
+
(getValueFromObject(shapeData, bubbleSettings.colorValuePath)) : shapeData[colorValuePath]) :
|
|
10161
|
+
shapeData[colorValuePath];
|
|
10162
|
+
var colorValue = (!isNullOrUndefined(colorValuePath)) ? ((colorValuePath.indexOf('.') > -1) ?
|
|
10163
|
+
Number(getValueFromObject(shapeData, bubbleSettings.colorValuePath)) : Number(shapeData[colorValuePath])) :
|
|
10164
|
+
Number(shapeData[colorValuePath]);
|
|
10165
|
+
var bubbleValue = (!isNullOrUndefined(bubbleSettings.valuePath)) ? ((bubbleSettings.valuePath.indexOf('.') > -1) ?
|
|
10166
|
+
Number(getValueFromObject(shapeData, bubbleSettings.valuePath)) : Number(shapeData[bubbleSettings.valuePath])) :
|
|
10167
|
+
Number(shapeData[bubbleSettings.valuePath]);
|
|
10168
|
+
var opacity;
|
|
10169
|
+
var bubbleColor;
|
|
10170
|
+
if (isNaN(bubbleValue) && isNaN(colorValue) && isNullOrUndefined(equalValue)) {
|
|
10171
|
+
return null;
|
|
10172
|
+
}
|
|
10173
|
+
var radius = getRatioOfBubble(bubbleSettings.minRadius, bubbleSettings.maxRadius, bubbleValue, range.min, range.max);
|
|
10174
|
+
var colorMapping = new ColorMapping(this.maps);
|
|
10175
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10176
|
+
var shapeColor = colorMapping.getColorByValue(bubbleSettings.colorMapping, colorValue, equalValue);
|
|
10177
|
+
// eslint-disable-next-line prefer-const
|
|
10178
|
+
bubbleColor = (Object.prototype.toString.call(shapeColor) === '[object Object]' &&
|
|
10179
|
+
!isNullOrUndefined(shapeColor['fill'])) ? shapeColor['fill'] : color;
|
|
10180
|
+
// eslint-disable-next-line prefer-const
|
|
10181
|
+
opacity = (Object.prototype.toString.call(shapeColor) === '[object Object]' &&
|
|
10182
|
+
!isNullOrUndefined(shapeColor['opacity'])) ? shapeColor['opacity'] : bubbleSettings.opacity;
|
|
10183
|
+
var shapePoints = [[]];
|
|
10184
|
+
this.maps.translateType = 'bubble';
|
|
10185
|
+
var midIndex = 0;
|
|
10186
|
+
var pointsLength = 0;
|
|
10187
|
+
var currentLength = 0;
|
|
10188
|
+
for (var i = 0, len = layerData.length; i < len; i++) {
|
|
10189
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10190
|
+
var shape = layerData[i];
|
|
10191
|
+
shape = shape['property'];
|
|
10192
|
+
var shapePath = checkPropertyPath(shapeData[layer.shapeDataPath], layer.shapePropertyPath, shape);
|
|
10193
|
+
var shapeDataLayerPathValue = !isNullOrUndefined(shapeData[layer.shapeDataPath]) &&
|
|
10194
|
+
isNaN(shapeData[layer.shapeDataPath]) ? shapeData[layer.shapeDataPath].toLowerCase() : shapeData[layer.shapeDataPath];
|
|
10195
|
+
var shapePathValue = !isNullOrUndefined(shape[shapePath]) && isNaN(shape[shapePath])
|
|
10196
|
+
? shape[shapePath].toLowerCase() : shape[shapePath];
|
|
10197
|
+
if (shapeDataLayerPathValue === shapePathValue && (layerData[i].type !== 'LineString' && layerData[i].type !== 'MultiLineString' && layerData[i]['type'] !== 'Point' && layerData[i]['type'] !== 'MultiPoint')) {
|
|
10198
|
+
if (!layerData[i]['_isMultiPolygon']) {
|
|
10199
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10200
|
+
shapePoints.push(this.getPoints(layerData[i], []));
|
|
10201
|
+
currentLength = shapePoints[shapePoints.length - 1].length;
|
|
10202
|
+
if (pointsLength < currentLength) {
|
|
10203
|
+
pointsLength = currentLength;
|
|
10204
|
+
midIndex = shapePoints.length - 1;
|
|
10205
|
+
}
|
|
10206
|
+
}
|
|
10207
|
+
else {
|
|
10208
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10209
|
+
var layer_1 = layerData[i];
|
|
10210
|
+
for (var j = 0; j < layer_1.length; j++) {
|
|
10211
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10212
|
+
shapePoints.push(this.getPoints(layer_1[j], []));
|
|
10213
|
+
currentLength = shapePoints[shapePoints.length - 1].length;
|
|
10214
|
+
if (pointsLength < currentLength) {
|
|
10215
|
+
pointsLength = currentLength;
|
|
10216
|
+
midIndex = shapePoints.length - 1;
|
|
10217
|
+
}
|
|
10218
|
+
}
|
|
10219
|
+
}
|
|
10220
|
+
}
|
|
10221
|
+
}
|
|
10222
|
+
var projectionType = this.maps.projectionType;
|
|
10223
|
+
var centerY;
|
|
10224
|
+
var eventArgs;
|
|
10225
|
+
var bubbleBorder = {
|
|
10226
|
+
color: bubbleSettings.border.color, opacity: bubbleSettings.border.opacity,
|
|
10227
|
+
width: bubbleSettings.border.width
|
|
10228
|
+
};
|
|
10229
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10230
|
+
var center = findMidPointOfPolygon(shapePoints[midIndex], projectionType, layer.geometryType);
|
|
10231
|
+
if (bubbleSettings.visible) {
|
|
10232
|
+
if (!isNullOrUndefined(center)) {
|
|
10233
|
+
centerY = this.maps.projectionType === 'Mercator' ? center['y'] : (-center['y']);
|
|
10234
|
+
eventArgs = {
|
|
10235
|
+
cancel: false, name: bubbleRendering, border: bubbleBorder,
|
|
10236
|
+
cx: center['x'], cy: centerY, data: shapeData, fill: bubbleColor,
|
|
10237
|
+
maps: this.maps, radius: radius
|
|
10238
|
+
};
|
|
10239
|
+
}
|
|
10240
|
+
else {
|
|
10241
|
+
var shapePointsLength = shapePoints.length - 1;
|
|
10242
|
+
if (shapePoints[shapePointsLength]['x'] && shapePoints[shapePointsLength]['y']) {
|
|
10243
|
+
eventArgs = {
|
|
10244
|
+
cancel: false, name: bubbleRendering, border: bubbleBorder,
|
|
10245
|
+
cx: shapePoints[shapePointsLength]['x'], cy: shapePoints[shapePointsLength]['y'],
|
|
10246
|
+
data: shapeData, fill: bubbleColor, maps: this.maps,
|
|
10247
|
+
radius: radius
|
|
10248
|
+
};
|
|
10249
|
+
}
|
|
10250
|
+
else {
|
|
10251
|
+
return;
|
|
10252
|
+
}
|
|
10253
|
+
}
|
|
10254
|
+
this.maps.trigger('bubbleRendering', eventArgs, function (bubbleArgs) {
|
|
10255
|
+
if (eventArgs.cancel) {
|
|
10256
|
+
return;
|
|
10257
|
+
}
|
|
10258
|
+
var bubbleElement;
|
|
10259
|
+
eventArgs.border.opacity = isNullOrUndefined(eventArgs.border.opacity) ? opacity : eventArgs.border.opacity;
|
|
10260
|
+
if (bubbleSettings.bubbleType === 'Circle') {
|
|
10261
|
+
var circle = new CircleOption(bubbleID, eventArgs.fill, eventArgs.border, opacity, 0, 0, eventArgs.radius, null);
|
|
10262
|
+
bubbleElement = drawCircle(_this.maps, circle, group);
|
|
10263
|
+
}
|
|
10264
|
+
else {
|
|
10265
|
+
var y = _this.maps.projectionType === 'Mercator' ? (eventArgs.cy - radius) : (eventArgs.cy + radius);
|
|
10266
|
+
var rectangle = new RectOption(bubbleID, eventArgs.fill, eventArgs.border, opacity, new Rect(0, 0, radius * 2, radius * 2), 2, 2);
|
|
10267
|
+
eventArgs.cx -= radius;
|
|
10268
|
+
eventArgs.cy = y;
|
|
10269
|
+
bubbleElement = drawRectangle(_this.maps, rectangle, group);
|
|
10270
|
+
}
|
|
10271
|
+
maintainSelection(_this.maps.selectedBubbleElementId, _this.maps.bubbleSelectionClass, bubbleElement, 'BubbleselectionMapStyle');
|
|
10272
|
+
_this.bubbleCollection.push({
|
|
10273
|
+
LayerIndex: layerIndex,
|
|
10274
|
+
BubbleIndex: bubbleIndex,
|
|
10275
|
+
DataIndex: dataIndex,
|
|
10276
|
+
element: bubbleElement,
|
|
10277
|
+
center: { x: eventArgs.cx, y: eventArgs.cy }
|
|
10278
|
+
});
|
|
10279
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10280
|
+
var translate;
|
|
10281
|
+
var animate$$1 = (layer.animationDuration !== 0 || animationMode === 'Enable') || isNullOrUndefined(_this.maps.zoomModule);
|
|
10282
|
+
if (_this.maps.zoomSettings.zoomFactor > 1 && !isNullOrUndefined(_this.maps.zoomModule) && !_this.maps.isTileMap) {
|
|
10283
|
+
translate = getZoomTranslate(_this.maps, layer, animate$$1);
|
|
10284
|
+
}
|
|
10285
|
+
else {
|
|
10286
|
+
translate = getTranslate(_this.maps, layer, animate$$1);
|
|
10287
|
+
}
|
|
10288
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10289
|
+
var bubbleDataSource = bubbleSettings.dataSource;
|
|
10290
|
+
var scale = translate['scale'];
|
|
10291
|
+
var transPoint = translate['location'];
|
|
10292
|
+
var 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)));
|
|
10293
|
+
bubbleElement.setAttribute('transform', 'translate( ' + (position.x) + ' ' + (position.y) + ' )');
|
|
10294
|
+
var bubble = (bubbleDataSource.length - 1) === dataIndex ? 'bubble' : null;
|
|
10295
|
+
if (bubbleSettings.bubbleType === 'Square') {
|
|
10296
|
+
position.x += radius;
|
|
10297
|
+
position.y += radius * (_this.maps.projectionType === 'Mercator' ? 1 : -1);
|
|
10298
|
+
}
|
|
10299
|
+
else {
|
|
10300
|
+
radius = 0;
|
|
10301
|
+
}
|
|
10302
|
+
if (bubbleSettings.animationDuration > 0 || animationMode === 'Enable') {
|
|
10303
|
+
elementAnimate(bubbleElement, bubbleSettings.animationDelay, bubbleSettings.animationDuration, position, _this.maps, bubble, radius);
|
|
10304
|
+
}
|
|
10305
|
+
});
|
|
10306
|
+
}
|
|
10307
|
+
};
|
|
10308
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10309
|
+
Bubble.prototype.getPoints = function (shape, points) {
|
|
10310
|
+
if (isNullOrUndefined(shape.map)) {
|
|
10311
|
+
points = shape['point'];
|
|
10312
|
+
}
|
|
10313
|
+
else {
|
|
10314
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10315
|
+
shape.map(function (current) {
|
|
10316
|
+
points.push(new Point(current['point']['x'], current['point']['y']));
|
|
10317
|
+
});
|
|
10318
|
+
}
|
|
10319
|
+
return points;
|
|
10320
|
+
};
|
|
10321
|
+
/**
|
|
10322
|
+
* To check and trigger bubble click event
|
|
10323
|
+
*
|
|
10324
|
+
* @param {PointerEvent} e - Specifies the pointer event argument.
|
|
10325
|
+
* @returns {void}
|
|
10326
|
+
* @private
|
|
10327
|
+
*/
|
|
10328
|
+
Bubble.prototype.bubbleClick = function (e) {
|
|
10329
|
+
var target = e.target.id;
|
|
10330
|
+
if (target.indexOf('_LayerIndex_') === -1) {
|
|
10331
|
+
return;
|
|
10332
|
+
}
|
|
10333
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10334
|
+
var data = this.getbubble(target);
|
|
10335
|
+
if (isNullOrUndefined(data)) {
|
|
10336
|
+
return;
|
|
10337
|
+
}
|
|
10338
|
+
var eventArgs = {
|
|
10339
|
+
cancel: false, name: bubbleClick, data: data, maps: this.maps,
|
|
10340
|
+
target: target, x: e.clientX, y: e.clientY
|
|
10341
|
+
};
|
|
10342
|
+
this.maps.trigger(bubbleClick, eventArgs);
|
|
10343
|
+
};
|
|
10344
|
+
/**
|
|
10345
|
+
* To get bubble from target id
|
|
10346
|
+
*
|
|
10347
|
+
* @param {string} target - Specifies the target
|
|
10348
|
+
* @returns {object} - Returns the object
|
|
10349
|
+
*/
|
|
10350
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10351
|
+
Bubble.prototype.getbubble = function (target) {
|
|
10352
|
+
var id = target.split('_LayerIndex_');
|
|
10353
|
+
var index = parseInt(id[1].split('_')[0], 10);
|
|
10354
|
+
var layer = this.maps.layers[index];
|
|
10355
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10356
|
+
var data;
|
|
10357
|
+
if (target.indexOf('_BubbleIndex_') > -1) {
|
|
10358
|
+
var bubbleIndex = parseInt(id[1].split('_BubbleIndex_')[1], 10);
|
|
10359
|
+
var dataIndex = parseInt(id[1].split('_BubbleIndex_')[1].split('_dataIndex_')[1], 10);
|
|
10360
|
+
if (!isNaN(bubbleIndex)) {
|
|
10361
|
+
data = layer.bubbleSettings[bubbleIndex].dataSource[dataIndex];
|
|
10362
|
+
return data;
|
|
10363
|
+
}
|
|
10364
|
+
}
|
|
10365
|
+
return null;
|
|
10366
|
+
};
|
|
10367
|
+
// eslint-disable-next-line valid-jsdoc
|
|
10368
|
+
/**
|
|
10369
|
+
* To check and trigger bubble move event
|
|
10370
|
+
*
|
|
10371
|
+
* @param {PointerEvent} e - Specifies the pointer event argument.
|
|
10372
|
+
* @retruns {void}
|
|
10373
|
+
* @private
|
|
10374
|
+
*/
|
|
10375
|
+
Bubble.prototype.bubbleMove = function (e) {
|
|
10376
|
+
var target = e.target.id;
|
|
10377
|
+
if (target.indexOf('_LayerIndex_') === -1) {
|
|
10378
|
+
return;
|
|
10379
|
+
}
|
|
10380
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10381
|
+
var data = this.getbubble(target);
|
|
10382
|
+
if (isNullOrUndefined(data)) {
|
|
10383
|
+
return;
|
|
10384
|
+
}
|
|
10385
|
+
var eventArgs = {
|
|
10386
|
+
cancel: false, name: bubbleMouseMove, data: data, maps: this.maps,
|
|
10387
|
+
target: target, x: e.clientX, y: e.clientY
|
|
10388
|
+
};
|
|
10389
|
+
this.maps.trigger(bubbleMouseMove, eventArgs);
|
|
10390
|
+
};
|
|
10391
|
+
/**
|
|
10392
|
+
* Get module name.
|
|
10393
|
+
*
|
|
10394
|
+
* @returns {string} - Returns the module name.
|
|
10395
|
+
*/
|
|
10396
|
+
Bubble.prototype.getModuleName = function () {
|
|
10397
|
+
return 'Bubble';
|
|
10398
|
+
};
|
|
10399
|
+
/**
|
|
10400
|
+
* To destroy the bubble.
|
|
10401
|
+
*
|
|
10402
|
+
* @returns {void}
|
|
10403
|
+
* @private
|
|
10404
|
+
*/
|
|
10405
|
+
Bubble.prototype.destroy = function () {
|
|
10406
|
+
this.bubbleCollection = [];
|
|
10407
|
+
//TODO: Calling the below code throws spec issue.
|
|
10408
|
+
//this.maps = null;
|
|
10409
|
+
};
|
|
10410
|
+
return Bubble;
|
|
10411
|
+
}());
|
|
10412
|
+
|
|
10413
|
+
/**
|
|
10414
|
+
* Marker class
|
|
10453
10415
|
*/
|
|
10454
|
-
var
|
|
10455
|
-
function
|
|
10456
|
-
/**
|
|
10457
|
-
* Bubble Id for current layer
|
|
10458
|
-
* @private
|
|
10459
|
-
*/
|
|
10460
|
-
this.id = '';
|
|
10416
|
+
var Marker = /** @__PURE__ @class */ (function () {
|
|
10417
|
+
function Marker(maps) {
|
|
10461
10418
|
this.maps = maps;
|
|
10462
|
-
this.
|
|
10419
|
+
this.trackElements = [];
|
|
10420
|
+
this.sameMarkerData = [];
|
|
10463
10421
|
}
|
|
10464
|
-
|
|
10422
|
+
Marker.prototype.markerRender = function (maps, layerElement, layerIndex, factor, type) {
|
|
10423
|
+
var _this = this;
|
|
10424
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10425
|
+
var templateFn;
|
|
10426
|
+
var markerCount = 0;
|
|
10427
|
+
var nullCount = 0;
|
|
10428
|
+
var markerTemplateCount = 0;
|
|
10429
|
+
maps.translateType = 'marker';
|
|
10430
|
+
var currentLayer = maps.layersCollection[layerIndex];
|
|
10431
|
+
this.markerSVGObject = maps.renderer.createGroup({
|
|
10432
|
+
id: maps.element.id + '_Markers_Group',
|
|
10433
|
+
class: 'GroupElement'
|
|
10434
|
+
});
|
|
10435
|
+
this.markerSVGObject.style.pointerEvents = 'auto';
|
|
10436
|
+
var markerTemplateEle = createElement('div', {
|
|
10437
|
+
id: maps.element.id + '_LayerIndex_' + layerIndex + '_Markers_Template_Group',
|
|
10438
|
+
className: maps.element.id + '_template'
|
|
10439
|
+
});
|
|
10440
|
+
markerTemplateEle.style.cssText = 'overflow: hidden; position: absolute;pointer-events: none;' +
|
|
10441
|
+
'top:' + maps.mapAreaRect.y + 'px;' +
|
|
10442
|
+
'left:' + maps.mapAreaRect.x + 'px;' +
|
|
10443
|
+
'height:' + maps.mapAreaRect.height + 'px;' +
|
|
10444
|
+
'width:' + maps.mapAreaRect.width + 'px;';
|
|
10445
|
+
currentLayer.markerSettings.map(function (markerSettings, markerIndex) {
|
|
10446
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10447
|
+
var markerData = markerSettings.dataSource;
|
|
10448
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10449
|
+
Array.prototype.forEach.call(markerData, function (data, dataIndex) {
|
|
10450
|
+
maps.markerNullCount = markerIndex > 0 && dataIndex === 0 ? 0 : maps.markerNullCount;
|
|
10451
|
+
var eventArgs = {
|
|
10452
|
+
cancel: false, name: markerRendering, fill: markerSettings.fill, height: markerSettings.height,
|
|
10453
|
+
width: markerSettings.width, imageUrl: markerSettings.imageUrl, shape: markerSettings.shape,
|
|
10454
|
+
template: markerSettings.template, data: data, maps: maps, marker: markerSettings,
|
|
10455
|
+
border: markerSettings.border, colorValuePath: markerSettings.colorValuePath,
|
|
10456
|
+
shapeValuePath: markerSettings.shapeValuePath, imageUrlValuePath: markerSettings.imageUrlValuePath
|
|
10457
|
+
};
|
|
10458
|
+
maps.trigger('markerRendering', eventArgs, function (MarkerArgs) {
|
|
10459
|
+
eventArgs = markerColorChoose(eventArgs, data);
|
|
10460
|
+
eventArgs = markerShapeChoose(eventArgs, data);
|
|
10461
|
+
var lng = (!isNullOrUndefined(markerSettings.longitudeValuePath)) ?
|
|
10462
|
+
Number(getValueFromObject(data, markerSettings.longitudeValuePath)) : !isNullOrUndefined(data['longitude']) ?
|
|
10463
|
+
parseFloat(data['longitude']) : !isNullOrUndefined(data['Longitude']) ? parseFloat(data['Longitude']) : null;
|
|
10464
|
+
var lat = (!isNullOrUndefined(markerSettings.latitudeValuePath)) ?
|
|
10465
|
+
Number(getValueFromObject(data, markerSettings.latitudeValuePath)) : !isNullOrUndefined(data['latitude']) ?
|
|
10466
|
+
parseFloat(data['latitude']) : !isNullOrUndefined(data['Latitude']) ? parseFloat(data['Latitude']) : null;
|
|
10467
|
+
var offset = markerSettings.offset;
|
|
10468
|
+
if (!eventArgs.cancel && markerSettings.visible && !isNullOrUndefined(lng) && !isNullOrUndefined(lat)) {
|
|
10469
|
+
var markerID = maps.element.id + '_LayerIndex_' + layerIndex + '_MarkerIndex_'
|
|
10470
|
+
+ markerIndex + '_dataIndex_' + dataIndex;
|
|
10471
|
+
var location_1 = (maps.isTileMap) ? convertTileLatLongToPoint(new MapLocation(lng, lat), factor, maps.tileTranslatePoint, true) : convertGeoToPoint(lat, lng, factor, currentLayer, maps);
|
|
10472
|
+
var animate$$1 = (currentLayer.animationDuration !== 0 || animationMode === 'Enable') || isNullOrUndefined(maps.zoomModule);
|
|
10473
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10474
|
+
var translate = (maps.isTileMap) ? (currentLayer.type === 'SubLayer' && isNullOrUndefined(maps.zoomModule)) ? location_1 = convertTileLatLongToPoint(new MapLocation(lng, lat), maps.tileZoomLevel, maps.tileTranslatePoint, true) : new Object() :
|
|
10475
|
+
!isNullOrUndefined(maps.zoomModule) && maps.zoomSettings.zoomFactor > 1 ?
|
|
10476
|
+
getZoomTranslate(maps, currentLayer, animate$$1) :
|
|
10477
|
+
getTranslate(maps, currentLayer, animate$$1);
|
|
10478
|
+
var scale = type === 'AddMarker' ? maps.scale : translate['scale'];
|
|
10479
|
+
var transPoint = type === 'AddMarker' ? maps.translatePoint : translate['location'];
|
|
10480
|
+
if (eventArgs.template && (!isNaN(location_1.x) && !isNaN(location_1.y))) {
|
|
10481
|
+
markerTemplateCount++;
|
|
10482
|
+
markerTemplate(eventArgs, templateFn, markerID, data, markerIndex, markerTemplateEle, location_1, transPoint, scale, offset, maps);
|
|
10483
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10484
|
+
maps.renderReactTemplates();
|
|
10485
|
+
}
|
|
10486
|
+
else if (!eventArgs.template && (!isNaN(location_1.x) && !isNaN(location_1.y))) {
|
|
10487
|
+
markerCount++;
|
|
10488
|
+
marker(eventArgs, markerSettings, markerData, dataIndex, location_1, transPoint, markerID, offset, scale, maps, _this.markerSVGObject);
|
|
10489
|
+
}
|
|
10490
|
+
}
|
|
10491
|
+
nullCount += (!isNaN(lat) && !isNaN(lng)) ? 0 : 1;
|
|
10492
|
+
markerTemplateCount += (eventArgs.cancel) ? 1 : 0;
|
|
10493
|
+
markerCount += (eventArgs.cancel) ? 1 : 0;
|
|
10494
|
+
maps.markerNullCount = (isNullOrUndefined(lng) || isNullOrUndefined(lat)) ?
|
|
10495
|
+
maps.markerNullCount + 1 : maps.markerNullCount;
|
|
10496
|
+
var markerDataLength = markerData.length - maps.markerNullCount;
|
|
10497
|
+
if (_this.markerSVGObject.childElementCount === (markerDataLength - markerTemplateCount - nullCount) && (type !== 'Template')) {
|
|
10498
|
+
layerElement.appendChild(_this.markerSVGObject);
|
|
10499
|
+
if (currentLayer.markerClusterSettings.allowClustering) {
|
|
10500
|
+
maps.svgObject.appendChild(_this.markerSVGObject);
|
|
10501
|
+
maps.element.appendChild(maps.svgObject);
|
|
10502
|
+
if ((currentLayer.layerType === 'OSM' || (currentLayer.urlTemplate.indexOf('openstreetmap') !== -1 && isNullOrUndefined(currentLayer.shapeData)))
|
|
10503
|
+
&& maps.zoomSettings.enable) {
|
|
10504
|
+
clusterTemplate(currentLayer, _this.markerSVGObject, maps, layerIndex, _this.markerSVGObject, layerElement, true, false);
|
|
10505
|
+
layerElement.appendChild(_this.markerSVGObject);
|
|
10506
|
+
}
|
|
10507
|
+
else {
|
|
10508
|
+
clusterTemplate(currentLayer, _this.markerSVGObject, maps, layerIndex, _this.markerSVGObject, layerElement, true, false);
|
|
10509
|
+
}
|
|
10510
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10511
|
+
maps.renderReactTemplates();
|
|
10512
|
+
}
|
|
10513
|
+
}
|
|
10514
|
+
if (markerTemplateEle.childElementCount === (markerDataLength - markerCount - nullCount) && getElementByID(maps.element.id + '_Secondary_Element')) {
|
|
10515
|
+
getElementByID(maps.element.id + '_Secondary_Element').appendChild(markerTemplateEle);
|
|
10516
|
+
if (maps.checkInitialRender) {
|
|
10517
|
+
if (currentLayer.markerClusterSettings.allowClustering) {
|
|
10518
|
+
clusterTemplate(currentLayer, markerTemplateEle, maps, layerIndex, _this.markerSVGObject, layerElement, false, false);
|
|
10519
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10520
|
+
maps.renderReactTemplates();
|
|
10521
|
+
}
|
|
10522
|
+
}
|
|
10523
|
+
}
|
|
10524
|
+
});
|
|
10525
|
+
});
|
|
10526
|
+
});
|
|
10527
|
+
};
|
|
10465
10528
|
/**
|
|
10466
|
-
* To
|
|
10529
|
+
* To find zoom level for individual layers like India, USA.
|
|
10467
10530
|
*
|
|
10468
|
-
* @
|
|
10531
|
+
* @param {number} mapWidth - Specifies the width of the maps
|
|
10532
|
+
* @param {number} mapHeight - Specifies the height of the maps
|
|
10533
|
+
* @param {number} maxZoomFact - Specifies the maximum zoom factor
|
|
10534
|
+
* @returns {number} - Returns the scale factor
|
|
10469
10535
|
*/
|
|
10470
|
-
|
|
10471
|
-
|
|
10472
|
-
|
|
10473
|
-
var
|
|
10474
|
-
|
|
10475
|
-
|
|
10476
|
-
|
|
10477
|
-
|
|
10478
|
-
|
|
10479
|
-
|
|
10480
|
-
var
|
|
10481
|
-
|
|
10482
|
-
|
|
10483
|
-
var bubbleValue = (!isNullOrUndefined(bubbleSettings.valuePath)) ? ((bubbleSettings.valuePath.indexOf('.') > -1) ?
|
|
10484
|
-
Number(getValueFromObject(shapeData, bubbleSettings.valuePath)) : Number(shapeData[bubbleSettings.valuePath])) :
|
|
10485
|
-
Number(shapeData[bubbleSettings.valuePath]);
|
|
10486
|
-
var opacity;
|
|
10487
|
-
var bubbleColor;
|
|
10488
|
-
if (isNaN(bubbleValue) && isNaN(colorValue) && isNullOrUndefined(equalValue)) {
|
|
10489
|
-
return null;
|
|
10536
|
+
Marker.prototype.calculateIndividualLayerMarkerZoomLevel = function (mapWidth, mapHeight, maxZoomFact) {
|
|
10537
|
+
var latZoom;
|
|
10538
|
+
var lngZoom;
|
|
10539
|
+
var height = Math.abs(this.maps.baseMapBounds.latitude.max - this.maps.baseMapBounds.latitude.min);
|
|
10540
|
+
var width = Math.abs(this.maps.baseMapBounds.longitude.max - this.maps.baseMapBounds.longitude.min);
|
|
10541
|
+
latZoom = Math.floor(Math.log(mapHeight / height));
|
|
10542
|
+
latZoom = (latZoom > maxZoomFact) ? maxZoomFact : latZoom;
|
|
10543
|
+
lngZoom = Math.floor(Math.log(mapWidth / width));
|
|
10544
|
+
lngZoom = (lngZoom > maxZoomFact) ? maxZoomFact : lngZoom;
|
|
10545
|
+
var result = Math.min(latZoom, lngZoom);
|
|
10546
|
+
var scaleFactor = Math.min(result, maxZoomFact - 1);
|
|
10547
|
+
if (!this.maps.isTileMap) {
|
|
10548
|
+
compareZoomFactor(scaleFactor, this.maps);
|
|
10490
10549
|
}
|
|
10491
|
-
|
|
10492
|
-
|
|
10493
|
-
|
|
10494
|
-
|
|
10495
|
-
|
|
10496
|
-
|
|
10497
|
-
|
|
10498
|
-
|
|
10499
|
-
|
|
10500
|
-
|
|
10501
|
-
|
|
10502
|
-
|
|
10503
|
-
|
|
10504
|
-
|
|
10505
|
-
|
|
10506
|
-
|
|
10507
|
-
|
|
10508
|
-
|
|
10509
|
-
|
|
10510
|
-
|
|
10511
|
-
|
|
10512
|
-
|
|
10513
|
-
|
|
10514
|
-
|
|
10515
|
-
|
|
10516
|
-
|
|
10517
|
-
|
|
10518
|
-
|
|
10519
|
-
|
|
10520
|
-
|
|
10521
|
-
|
|
10522
|
-
|
|
10550
|
+
return scaleFactor;
|
|
10551
|
+
};
|
|
10552
|
+
/**
|
|
10553
|
+
* To calculate center position and factor value dynamically
|
|
10554
|
+
*
|
|
10555
|
+
* @param {LayerSettings[]} layersCollection - Specifies the layer settings instance.
|
|
10556
|
+
* @returns {void}
|
|
10557
|
+
* @private
|
|
10558
|
+
*/
|
|
10559
|
+
Marker.prototype.calculateZoomCenterPositionAndFactor = function (layersCollection) {
|
|
10560
|
+
if (!isNullOrUndefined(this.maps)) {
|
|
10561
|
+
if (this.maps.zoomSettings.shouldZoomInitially && this.maps.markerModule) {
|
|
10562
|
+
var minLong_1;
|
|
10563
|
+
var maxLat_1;
|
|
10564
|
+
var minLat_1;
|
|
10565
|
+
var maxLong_1;
|
|
10566
|
+
var zoomLevel = void 0;
|
|
10567
|
+
var centerLat = void 0;
|
|
10568
|
+
var centerLong = void 0;
|
|
10569
|
+
var maxZoomFact = this.maps.zoomSettings.maxZoom;
|
|
10570
|
+
var mapWidth = this.maps.mapAreaRect.width;
|
|
10571
|
+
var mapHeight = this.maps.mapAreaRect.height;
|
|
10572
|
+
this.maps.markerZoomedState = this.maps.markerZoomedState ? this.maps.markerZoomedState :
|
|
10573
|
+
isNullOrUndefined(this.maps.markerZoomFactor) ? !this.maps.markerZoomedState :
|
|
10574
|
+
this.maps.markerZoomFactor > 1 ? this.maps.markerZoomedState : !this.maps.markerZoomedState;
|
|
10575
|
+
this.maps.defaultState = this.maps.markerZoomedState ? !this.maps.markerZoomedState : this.maps.defaultState;
|
|
10576
|
+
Array.prototype.forEach.call(layersCollection, function (currentLayer) {
|
|
10577
|
+
var isMarker = currentLayer.markerSettings.length !== 0;
|
|
10578
|
+
if (isMarker) {
|
|
10579
|
+
Array.prototype.forEach.call(currentLayer.markerSettings, function (markerSetting) {
|
|
10580
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10581
|
+
var markerData = markerSetting.dataSource;
|
|
10582
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10583
|
+
Array.prototype.forEach.call(markerData, function (data, dataIndex) {
|
|
10584
|
+
var latitude = !isNullOrUndefined(data['latitude']) ? parseFloat(data['latitude']) :
|
|
10585
|
+
!isNullOrUndefined(data['Latitude']) ? parseFloat(data['Latitude']) : null;
|
|
10586
|
+
var longitude = !isNullOrUndefined(data['longitude']) ? parseFloat(data['longitude']) :
|
|
10587
|
+
!isNullOrUndefined(data['Longitude']) ? parseFloat(data['Longitude']) : null;
|
|
10588
|
+
if (!isNullOrUndefined(latitude) && !isNullOrUndefined(longitude)) {
|
|
10589
|
+
minLong_1 = isNullOrUndefined(minLong_1) && dataIndex === 0 ?
|
|
10590
|
+
longitude : minLong_1;
|
|
10591
|
+
maxLat_1 = isNullOrUndefined(maxLat_1) && dataIndex === 0 ?
|
|
10592
|
+
latitude : maxLat_1;
|
|
10593
|
+
minLat_1 = isNullOrUndefined(minLat_1) && dataIndex === 0 ?
|
|
10594
|
+
latitude : minLat_1;
|
|
10595
|
+
maxLong_1 = isNullOrUndefined(maxLong_1) && dataIndex === 0 ?
|
|
10596
|
+
longitude : maxLong_1;
|
|
10597
|
+
if (minLong_1 > longitude) {
|
|
10598
|
+
minLong_1 = longitude;
|
|
10599
|
+
}
|
|
10600
|
+
if (minLat_1 > latitude) {
|
|
10601
|
+
minLat_1 = latitude;
|
|
10602
|
+
}
|
|
10603
|
+
if (maxLong_1 < longitude) {
|
|
10604
|
+
maxLong_1 = longitude;
|
|
10605
|
+
}
|
|
10606
|
+
if (maxLat_1 < latitude) {
|
|
10607
|
+
maxLat_1 = latitude;
|
|
10608
|
+
}
|
|
10609
|
+
}
|
|
10610
|
+
});
|
|
10611
|
+
});
|
|
10523
10612
|
}
|
|
10524
|
-
}
|
|
10525
|
-
|
|
10526
|
-
|
|
10527
|
-
|
|
10528
|
-
|
|
10529
|
-
|
|
10530
|
-
|
|
10531
|
-
|
|
10532
|
-
|
|
10533
|
-
|
|
10534
|
-
|
|
10613
|
+
});
|
|
10614
|
+
if (!isNullOrUndefined(minLat_1) && !isNullOrUndefined(minLong_1) &&
|
|
10615
|
+
!isNullOrUndefined(maxLong_1) && !isNullOrUndefined(maxLat_1)) {
|
|
10616
|
+
// To find the center position
|
|
10617
|
+
centerLat = (minLat_1 + maxLat_1) / 2;
|
|
10618
|
+
centerLong = (minLong_1 + maxLong_1) / 2;
|
|
10619
|
+
this.maps.markerCenterLatitude = centerLat;
|
|
10620
|
+
this.maps.markerCenterLongitude = centerLong;
|
|
10621
|
+
if (isNullOrUndefined(this.maps.markerZoomCenterPoint) || this.maps.markerZoomedState) {
|
|
10622
|
+
this.maps.markerZoomCenterPoint = {
|
|
10623
|
+
latitude: centerLat,
|
|
10624
|
+
longitude: centerLong
|
|
10625
|
+
};
|
|
10626
|
+
}
|
|
10627
|
+
var markerFactor = void 0;
|
|
10628
|
+
if (this.maps.isTileMap || this.maps.baseMapRectBounds['min']['x'] === 0) {
|
|
10629
|
+
zoomLevel = calculateZoomLevel(minLat_1, maxLat_1, minLong_1, maxLong_1, mapWidth, mapHeight, this.maps, false);
|
|
10630
|
+
if (this.maps.isTileMap) {
|
|
10631
|
+
markerFactor = isNullOrUndefined(this.maps.markerZoomFactor) ?
|
|
10632
|
+
zoomLevel : isNullOrUndefined(this.maps.mapScaleValue) ?
|
|
10633
|
+
zoomLevel : this.maps.mapScaleValue > 1 && this.maps.markerZoomFactor !== 1 ?
|
|
10634
|
+
this.maps.mapScaleValue : zoomLevel;
|
|
10635
|
+
}
|
|
10636
|
+
else {
|
|
10637
|
+
markerFactor = isNullOrUndefined(this.maps.mapScaleValue) ? zoomLevel :
|
|
10638
|
+
(Math.floor(this.maps.scale) !== 1 &&
|
|
10639
|
+
this.maps.mapScaleValue !== zoomLevel)
|
|
10640
|
+
&&
|
|
10641
|
+
(isNullOrUndefined(this.maps.shouldZoomCurrentFactor))
|
|
10642
|
+
? this.maps.mapScaleValue : zoomLevel;
|
|
10643
|
+
if (((markerFactor === this.maps.mapScaleValue &&
|
|
10644
|
+
(this.maps.markerZoomFactor === 1 || this.maps.mapScaleValue === 1))
|
|
10645
|
+
&& (!this.maps.enablePersistence))) {
|
|
10646
|
+
markerFactor = zoomLevel;
|
|
10647
|
+
}
|
|
10535
10648
|
}
|
|
10536
10649
|
}
|
|
10650
|
+
else {
|
|
10651
|
+
zoomLevel = this.calculateIndividualLayerMarkerZoomLevel(mapWidth, mapHeight, maxZoomFact);
|
|
10652
|
+
markerFactor = isNullOrUndefined(this.maps.mapScaleValue) ? zoomLevel :
|
|
10653
|
+
(this.maps.mapScaleValue !== zoomLevel)
|
|
10654
|
+
? this.maps.mapScaleValue : zoomLevel;
|
|
10655
|
+
}
|
|
10656
|
+
this.maps.markerZoomFactor = markerFactor;
|
|
10537
10657
|
}
|
|
10538
10658
|
}
|
|
10539
|
-
}
|
|
10540
|
-
var projectionType = this.maps.projectionType;
|
|
10541
|
-
var centerY;
|
|
10542
|
-
var eventArgs;
|
|
10543
|
-
var bubbleBorder = {
|
|
10544
|
-
color: bubbleSettings.border.color, opacity: bubbleSettings.border.opacity,
|
|
10545
|
-
width: bubbleSettings.border.width
|
|
10546
|
-
};
|
|
10547
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10548
|
-
var center = findMidPointOfPolygon(shapePoints[midIndex], projectionType, layer.geometryType);
|
|
10549
|
-
if (bubbleSettings.visible) {
|
|
10550
|
-
if (!isNullOrUndefined(center)) {
|
|
10551
|
-
centerY = this.maps.projectionType === 'Mercator' ? center['y'] : (-center['y']);
|
|
10552
|
-
eventArgs = {
|
|
10553
|
-
cancel: false, name: bubbleRendering, border: bubbleBorder,
|
|
10554
|
-
cx: center['x'], cy: centerY, data: shapeData, fill: bubbleColor,
|
|
10555
|
-
maps: this.maps, radius: radius
|
|
10556
|
-
};
|
|
10557
|
-
}
|
|
10558
10659
|
else {
|
|
10559
|
-
|
|
10560
|
-
if (
|
|
10561
|
-
|
|
10562
|
-
|
|
10563
|
-
|
|
10564
|
-
|
|
10565
|
-
|
|
10566
|
-
}
|
|
10660
|
+
this.maps.markerZoomedState = false;
|
|
10661
|
+
if (this.maps.markerZoomFactor > 1) {
|
|
10662
|
+
this.maps.markerCenterLatitude = null;
|
|
10663
|
+
this.maps.markerCenterLongitude = null;
|
|
10664
|
+
this.maps.markerZoomFactor = 1;
|
|
10665
|
+
if (!this.maps.enablePersistence) {
|
|
10666
|
+
this.maps.mapScaleValue = 1;
|
|
10667
|
+
}
|
|
10567
10668
|
}
|
|
10568
|
-
|
|
10569
|
-
|
|
10669
|
+
if (this.maps.isTileMap && !this.maps.enablePersistence
|
|
10670
|
+
&& this.maps.mapScaleValue <= 1) {
|
|
10671
|
+
this.maps.tileZoomLevel = this.maps.mapScaleValue === 0 ? (this.maps.isZoomByPosition ? this.maps.tileZoomLevel : 1)
|
|
10672
|
+
: this.maps.mapScaleValue;
|
|
10673
|
+
if (this.maps.mapScaleValue === 1 && this.maps.markerZoomFactor === 1) {
|
|
10674
|
+
this.maps.tileTranslatePoint.x = 0;
|
|
10675
|
+
this.maps.tileTranslatePoint.y = 0;
|
|
10676
|
+
}
|
|
10570
10677
|
}
|
|
10571
10678
|
}
|
|
10572
|
-
this.maps.trigger('bubbleRendering', eventArgs, function (bubbleArgs) {
|
|
10573
|
-
if (eventArgs.cancel) {
|
|
10574
|
-
return;
|
|
10575
|
-
}
|
|
10576
|
-
var bubbleElement;
|
|
10577
|
-
eventArgs.border.opacity = isNullOrUndefined(eventArgs.border.opacity) ? opacity : eventArgs.border.opacity;
|
|
10578
|
-
if (bubbleSettings.bubbleType === 'Circle') {
|
|
10579
|
-
var circle = new CircleOption(bubbleID, eventArgs.fill, eventArgs.border, opacity, 0, 0, eventArgs.radius, null);
|
|
10580
|
-
bubbleElement = drawCircle(_this.maps, circle, group);
|
|
10581
|
-
}
|
|
10582
|
-
else {
|
|
10583
|
-
var y = _this.maps.projectionType === 'Mercator' ? (eventArgs.cy - radius) : (eventArgs.cy + radius);
|
|
10584
|
-
var rectangle = new RectOption(bubbleID, eventArgs.fill, eventArgs.border, opacity, new Rect(0, 0, radius * 2, radius * 2), 2, 2);
|
|
10585
|
-
eventArgs.cx -= radius;
|
|
10586
|
-
eventArgs.cy = y;
|
|
10587
|
-
bubbleElement = drawRectangle(_this.maps, rectangle, group);
|
|
10588
|
-
}
|
|
10589
|
-
maintainSelection(_this.maps.selectedBubbleElementId, _this.maps.bubbleSelectionClass, bubbleElement, 'BubbleselectionMapStyle');
|
|
10590
|
-
_this.bubbleCollection.push({
|
|
10591
|
-
LayerIndex: layerIndex,
|
|
10592
|
-
BubbleIndex: bubbleIndex,
|
|
10593
|
-
DataIndex: dataIndex,
|
|
10594
|
-
element: bubbleElement,
|
|
10595
|
-
center: { x: eventArgs.cx, y: eventArgs.cy }
|
|
10596
|
-
});
|
|
10597
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10598
|
-
var translate;
|
|
10599
|
-
var animate$$1 = (layer.animationDuration !== 0 || animationMode === 'Enable') || isNullOrUndefined(_this.maps.zoomModule);
|
|
10600
|
-
if (_this.maps.zoomSettings.zoomFactor > 1 && !isNullOrUndefined(_this.maps.zoomModule) && !_this.maps.isTileMap) {
|
|
10601
|
-
translate = getZoomTranslate(_this.maps, layer, animate$$1);
|
|
10602
|
-
}
|
|
10603
|
-
else {
|
|
10604
|
-
translate = getTranslate(_this.maps, layer, animate$$1);
|
|
10605
|
-
}
|
|
10606
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10607
|
-
var bubbleDataSource = bubbleSettings.dataSource;
|
|
10608
|
-
var scale = translate['scale'];
|
|
10609
|
-
var transPoint = translate['location'];
|
|
10610
|
-
var 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)));
|
|
10611
|
-
bubbleElement.setAttribute('transform', 'translate( ' + (position.x) + ' ' + (position.y) + ' )');
|
|
10612
|
-
var bubble = (bubbleDataSource.length - 1) === dataIndex ? 'bubble' : null;
|
|
10613
|
-
if (bubbleSettings.bubbleType === 'Square') {
|
|
10614
|
-
position.x += radius;
|
|
10615
|
-
position.y += radius * (_this.maps.projectionType === 'Mercator' ? 1 : -1);
|
|
10616
|
-
}
|
|
10617
|
-
else {
|
|
10618
|
-
radius = 0;
|
|
10619
|
-
}
|
|
10620
|
-
if (bubbleSettings.animationDuration > 0 || animationMode === 'Enable') {
|
|
10621
|
-
elementAnimate(bubbleElement, bubbleSettings.animationDelay, bubbleSettings.animationDuration, position, _this.maps, bubble, radius);
|
|
10622
|
-
}
|
|
10623
|
-
});
|
|
10624
10679
|
}
|
|
10625
10680
|
};
|
|
10626
|
-
|
|
10627
|
-
|
|
10628
|
-
|
|
10629
|
-
|
|
10681
|
+
/**
|
|
10682
|
+
* To check and trigger marker click event
|
|
10683
|
+
* @param {PointerEvent} e - Specifies the pointer event argument.
|
|
10684
|
+
* @returns {void}
|
|
10685
|
+
* @private
|
|
10686
|
+
*/
|
|
10687
|
+
Marker.prototype.markerClick = function (e) {
|
|
10688
|
+
var target = e.target.id;
|
|
10689
|
+
if (target.indexOf(this.maps.element.id) === -1) {
|
|
10690
|
+
var ancestor = e.target.closest('.' + this.maps.element.id + '_marker_template_element');
|
|
10691
|
+
if (!isNullOrUndefined(ancestor) && ancestor.id.indexOf('_MarkerIndex_') > -1) {
|
|
10692
|
+
target = ancestor.id;
|
|
10693
|
+
}
|
|
10630
10694
|
}
|
|
10631
|
-
|
|
10632
|
-
|
|
10633
|
-
|
|
10634
|
-
|
|
10635
|
-
|
|
10695
|
+
if (target.indexOf('_LayerIndex_') === -1 || target.indexOf('_cluster_') > 0) {
|
|
10696
|
+
return;
|
|
10697
|
+
}
|
|
10698
|
+
var options = this.getMarker(target);
|
|
10699
|
+
if (isNullOrUndefined(options)) {
|
|
10700
|
+
return;
|
|
10701
|
+
}
|
|
10702
|
+
if (options.marker.enableDrag) {
|
|
10703
|
+
document.getElementById(this.maps.element.id + "_svg").style.cursor = 'grabbing';
|
|
10704
|
+
}
|
|
10705
|
+
var eventArgs = {
|
|
10706
|
+
cancel: false, name: markerClick, data: options.data, maps: this.maps,
|
|
10707
|
+
marker: options.marker, target: target, x: e.clientX, y: e.clientY,
|
|
10708
|
+
latitude: options.data['latitude'] || options.data['Latitude'],
|
|
10709
|
+
longitude: options.data['longitude'] || options.data['Longitude'],
|
|
10710
|
+
value: options.data['name']
|
|
10711
|
+
};
|
|
10712
|
+
this.maps.trigger(markerClick, eventArgs);
|
|
10713
|
+
if (options.marker.enableDrag) {
|
|
10714
|
+
var isCluster = false;
|
|
10715
|
+
var layerIndex = parseInt(target.split('_LayerIndex_')[1].split('_')[0], 10);
|
|
10716
|
+
var markerIndex = parseInt(target.split('_MarkerIndex_')[1].split('_')[0], 10);
|
|
10717
|
+
var dataIndex_1 = parseInt(target.split('_dataIndex_')[1].split('_')[0], 10);
|
|
10718
|
+
var marker_1 = this.maps.layers[layerIndex].markerSettings[markerIndex];
|
|
10719
|
+
if (this.sameMarkerData.length > 0) {
|
|
10720
|
+
isCluster = (this.sameMarkerData[0].data.filter(function (el) { return (el['index'] == dataIndex_1); })).length > 0 &&
|
|
10721
|
+
this.sameMarkerData[0].layerIndex === layerIndex && this.sameMarkerData[0].markerIndex === markerIndex;
|
|
10722
|
+
}
|
|
10723
|
+
if (!isCluster) {
|
|
10724
|
+
var dragEventArgs = {
|
|
10725
|
+
name: markerDragStart, x: e.clientX, y: e.clientY,
|
|
10726
|
+
latitude: options.data['latitude'] || options.data['Latitude'],
|
|
10727
|
+
longitude: options.data['longitude'] || options.data['Longitude'],
|
|
10728
|
+
layerIndex: layerIndex, markerIndex: markerIndex, dataIndex: dataIndex_1
|
|
10729
|
+
};
|
|
10730
|
+
this.maps.trigger(markerDragStart, dragEventArgs);
|
|
10731
|
+
this.maps.markerDragArgument = {
|
|
10732
|
+
targetId: target, x: e.clientX, y: e.clientY,
|
|
10733
|
+
latitude: options.data['latitude'] || options.data['Latitude'],
|
|
10734
|
+
longitude: options.data['longitude'] || options.data['Longitude'],
|
|
10735
|
+
shape: isNullOrUndefined(marker_1.shapeValuePath) ? marker_1.shape : marker_1.dataSource[dataIndex_1][marker_1.shapeValuePath],
|
|
10736
|
+
layerIndex: layerIndex, markerIndex: markerIndex, dataIndex: dataIndex_1
|
|
10737
|
+
};
|
|
10738
|
+
}
|
|
10636
10739
|
}
|
|
10637
|
-
return points;
|
|
10638
10740
|
};
|
|
10639
10741
|
/**
|
|
10640
|
-
* To check and trigger
|
|
10641
|
-
*
|
|
10742
|
+
* To check and trigger Cluster click event
|
|
10642
10743
|
* @param {PointerEvent} e - Specifies the pointer event argument.
|
|
10643
10744
|
* @returns {void}
|
|
10644
10745
|
* @private
|
|
10645
10746
|
*/
|
|
10646
|
-
|
|
10747
|
+
Marker.prototype.markerClusterClick = function (e) {
|
|
10647
10748
|
var target = e.target.id;
|
|
10648
|
-
if (target.indexOf('_LayerIndex_') === -1) {
|
|
10749
|
+
if (target.indexOf('_LayerIndex_') === -1 || target.indexOf('_cluster_') === -1) {
|
|
10649
10750
|
return;
|
|
10650
10751
|
}
|
|
10651
|
-
|
|
10652
|
-
|
|
10653
|
-
if (isNullOrUndefined(data)) {
|
|
10752
|
+
var options = this.getMarker(target);
|
|
10753
|
+
if (isNullOrUndefined(options)) {
|
|
10654
10754
|
return;
|
|
10655
10755
|
}
|
|
10756
|
+
if ((options.clusterCollection.length > 0 && this.maps.markerClusterExpand)) {
|
|
10757
|
+
if (getElement(this.maps.element.id + '_mapsTooltip') &&
|
|
10758
|
+
this.maps.mapsTooltipModule.tooltipTargetID.indexOf('_MarkerIndex_') > -1) {
|
|
10759
|
+
removeElement(this.maps.element.id + '_mapsTooltip');
|
|
10760
|
+
}
|
|
10761
|
+
if (this.sameMarkerData.length > 0 && !this.maps.markerClusterExpandCheck) {
|
|
10762
|
+
this.maps.markerClusterExpandCheck = true;
|
|
10763
|
+
mergeSeparateCluster(this.sameMarkerData, this.maps, this.markerSVGObject);
|
|
10764
|
+
}
|
|
10765
|
+
else {
|
|
10766
|
+
this.sameMarkerData = options.clusterCollection;
|
|
10767
|
+
this.maps.markerClusterExpandCheck = false;
|
|
10768
|
+
clusterSeparate(this.sameMarkerData, this.maps, this.markerSVGObject, true);
|
|
10769
|
+
}
|
|
10770
|
+
}
|
|
10656
10771
|
var eventArgs = {
|
|
10657
|
-
cancel: false, name:
|
|
10658
|
-
target: target, x: e.clientX, y: e.clientY
|
|
10772
|
+
cancel: false, name: markerClusterClick, data: options, maps: this.maps,
|
|
10773
|
+
target: target, x: e.clientX, y: e.clientY,
|
|
10774
|
+
latitude: options.data['latitude'] || options.data['Latitude'], longitude: options.data['longitude'] || options.data['Longitude'],
|
|
10775
|
+
markerClusterCollection: options['markCollection']
|
|
10659
10776
|
};
|
|
10660
|
-
this.maps.trigger(
|
|
10777
|
+
this.maps.trigger(markerClusterClick, eventArgs);
|
|
10661
10778
|
};
|
|
10662
10779
|
/**
|
|
10663
|
-
* To get
|
|
10780
|
+
* To get marker from target id
|
|
10664
10781
|
*
|
|
10665
10782
|
* @param {string} target - Specifies the target
|
|
10666
|
-
* @returns {
|
|
10783
|
+
* @returns {string} - Returns the string
|
|
10667
10784
|
*/
|
|
10668
10785
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10669
|
-
|
|
10786
|
+
Marker.prototype.getMarker = function (target) {
|
|
10670
10787
|
var id = target.split('_LayerIndex_');
|
|
10671
10788
|
var index = parseInt(id[1].split('_')[0], 10);
|
|
10672
10789
|
var layer = this.maps.layers[index];
|
|
10673
10790
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10674
10791
|
var data;
|
|
10675
|
-
|
|
10676
|
-
|
|
10677
|
-
|
|
10678
|
-
|
|
10679
|
-
|
|
10680
|
-
|
|
10792
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10793
|
+
var markCollection = [];
|
|
10794
|
+
var clusterCollection = [];
|
|
10795
|
+
var marker$$1;
|
|
10796
|
+
this.maps.markerClusterExpand = layer.markerClusterSettings.allowClusterExpand;
|
|
10797
|
+
if (target.indexOf('_MarkerIndex_') > -1) {
|
|
10798
|
+
var markerIndex = parseInt(id[1].split('_MarkerIndex_')[1].split('_')[0], 10);
|
|
10799
|
+
var dataIndex = parseInt(id[1].split('_dataIndex_')[1].split('_')[0], 10);
|
|
10800
|
+
marker$$1 = layer.markerSettings[markerIndex];
|
|
10801
|
+
if (!isNaN(markerIndex)) {
|
|
10802
|
+
data = marker$$1.dataSource[dataIndex];
|
|
10803
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10804
|
+
var collection_1 = [];
|
|
10805
|
+
if (!marker$$1.template && (target.indexOf('_cluster_') > -1) && (this.maps.layers[index].markerClusterSettings.allowClusterExpand)) {
|
|
10806
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10807
|
+
Array.prototype.forEach.call(marker$$1.dataSource, function (location, index) {
|
|
10808
|
+
if (location['latitude'] === data['latitude'] && location['longitude'] === data['longitude']) {
|
|
10809
|
+
collection_1.push({ data: data, index: index });
|
|
10810
|
+
}
|
|
10811
|
+
});
|
|
10812
|
+
}
|
|
10813
|
+
if ((target.indexOf('_cluster_') > -1)) {
|
|
10814
|
+
var isClusterSame = false;
|
|
10815
|
+
var 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);
|
|
10816
|
+
var indexes = layer.markerClusterSettings.shape === 'Balloon' ? clusterElement.children[0].textContent.split(',').map(Number) : clusterElement.textContent.split(',').map(Number);
|
|
10817
|
+
collection_1 = [];
|
|
10818
|
+
for (var _i = 0, indexes_1 = indexes; _i < indexes_1.length; _i++) {
|
|
10819
|
+
var i = indexes_1[_i];
|
|
10820
|
+
collection_1.push({ data: marker$$1.dataSource[i], index: i });
|
|
10821
|
+
markCollection.push(marker$$1.dataSource[i]);
|
|
10822
|
+
}
|
|
10823
|
+
isClusterSame = false;
|
|
10824
|
+
clusterCollection.push({
|
|
10825
|
+
data: collection_1, layerIndex: index, markerIndex: markerIndex, dataIndex: dataIndex,
|
|
10826
|
+
targetClusterIndex: +(target.split('_cluster_')[1].indexOf('_datalabel_') > -1 ? target.split('_cluster_')[1].split('_datalabel_')[0] : target.split('_cluster_')[1]),
|
|
10827
|
+
isClusterSame: isClusterSame
|
|
10828
|
+
});
|
|
10829
|
+
}
|
|
10830
|
+
return { marker: marker$$1, data: data, clusterCollection: clusterCollection, markCollection: markCollection };
|
|
10681
10831
|
}
|
|
10682
10832
|
}
|
|
10683
10833
|
return null;
|
|
10684
10834
|
};
|
|
10685
|
-
// eslint-disable-next-line valid-jsdoc
|
|
10686
10835
|
/**
|
|
10687
|
-
* To check and trigger
|
|
10836
|
+
* To check and trigger marker move event
|
|
10688
10837
|
*
|
|
10689
10838
|
* @param {PointerEvent} e - Specifies the pointer event argument.
|
|
10690
|
-
* @
|
|
10839
|
+
* @returns {void}
|
|
10691
10840
|
* @private
|
|
10692
10841
|
*/
|
|
10693
|
-
|
|
10694
|
-
var
|
|
10695
|
-
if (
|
|
10842
|
+
Marker.prototype.markerMove = function (e) {
|
|
10843
|
+
var targetId = e.target.id;
|
|
10844
|
+
if (targetId.indexOf('_LayerIndex_') === -1 || targetId.indexOf('_cluster_') > 0) {
|
|
10696
10845
|
return;
|
|
10697
10846
|
}
|
|
10698
|
-
|
|
10699
|
-
|
|
10700
|
-
if (isNullOrUndefined(data)) {
|
|
10847
|
+
var options = this.getMarker(targetId);
|
|
10848
|
+
if (isNullOrUndefined(options)) {
|
|
10701
10849
|
return;
|
|
10702
10850
|
}
|
|
10851
|
+
if (options.marker.enableDrag) {
|
|
10852
|
+
document.getElementById(this.maps.element.id + "_svg").style.cursor = isNullOrUndefined(this.maps.markerDragArgument) ?
|
|
10853
|
+
'pointer' : 'grabbing';
|
|
10854
|
+
}
|
|
10703
10855
|
var eventArgs = {
|
|
10704
|
-
cancel: false, name:
|
|
10705
|
-
target:
|
|
10856
|
+
cancel: false, name: markerMouseMove, data: options.data,
|
|
10857
|
+
maps: this.maps, target: targetId, x: e.clientX, y: e.clientY
|
|
10706
10858
|
};
|
|
10707
|
-
this.maps.trigger(
|
|
10859
|
+
this.maps.trigger(markerMouseMove, eventArgs);
|
|
10860
|
+
};
|
|
10861
|
+
/**
|
|
10862
|
+
* To check and trigger cluster move event
|
|
10863
|
+
*
|
|
10864
|
+
* @param {PointerEvent} e - Specifies the pointer event argument.
|
|
10865
|
+
* @returns {void}
|
|
10866
|
+
* @private
|
|
10867
|
+
*/
|
|
10868
|
+
Marker.prototype.markerClusterMouseMove = function (e) {
|
|
10869
|
+
var targetId = e.target.id;
|
|
10870
|
+
if (targetId.indexOf('_LayerIndex_') === -1 || targetId.indexOf('_cluster_') === -1) {
|
|
10871
|
+
return;
|
|
10872
|
+
}
|
|
10873
|
+
var options = this.getMarker(targetId);
|
|
10874
|
+
if (this.maps.markerClusterExpand) {
|
|
10875
|
+
e.target.style.cursor = 'pointer';
|
|
10876
|
+
}
|
|
10877
|
+
if (isNullOrUndefined(options)) {
|
|
10878
|
+
return;
|
|
10879
|
+
}
|
|
10880
|
+
var eventArgs = {
|
|
10881
|
+
cancel: false, name: markerClusterMouseMove, data: options.data, maps: this.maps,
|
|
10882
|
+
target: targetId, x: e.clientX, y: e.clientY
|
|
10883
|
+
};
|
|
10884
|
+
this.maps.trigger(markerClusterMouseMove, eventArgs);
|
|
10708
10885
|
};
|
|
10709
10886
|
/**
|
|
10710
10887
|
* Get module name.
|
|
10711
10888
|
*
|
|
10712
|
-
* @returns {string} - Returns the module name
|
|
10889
|
+
* @returns {string} - Returns the module name
|
|
10713
10890
|
*/
|
|
10714
|
-
|
|
10715
|
-
return '
|
|
10891
|
+
Marker.prototype.getModuleName = function () {
|
|
10892
|
+
return 'Marker';
|
|
10716
10893
|
};
|
|
10717
10894
|
/**
|
|
10718
|
-
* To destroy the
|
|
10895
|
+
* To destroy the layers.
|
|
10719
10896
|
*
|
|
10720
10897
|
* @returns {void}
|
|
10721
10898
|
* @private
|
|
10722
10899
|
*/
|
|
10723
|
-
|
|
10724
|
-
this.
|
|
10725
|
-
|
|
10726
|
-
|
|
10900
|
+
Marker.prototype.destroy = function () {
|
|
10901
|
+
this.maps = null;
|
|
10902
|
+
this.trackElements = [];
|
|
10903
|
+
this.markerSVGObject = null;
|
|
10904
|
+
this.sameMarkerData = [];
|
|
10727
10905
|
};
|
|
10728
|
-
return
|
|
10906
|
+
return Marker;
|
|
10907
|
+
}());
|
|
10908
|
+
|
|
10909
|
+
/**
|
|
10910
|
+
* When injected, this module will be used to render polygon shapes over the Maps.
|
|
10911
|
+
*/
|
|
10912
|
+
var Polygon = /** @__PURE__ @class */ (function () {
|
|
10913
|
+
function Polygon(maps) {
|
|
10914
|
+
this.maps = maps;
|
|
10915
|
+
}
|
|
10916
|
+
/**
|
|
10917
|
+
* To render polygon for maps
|
|
10918
|
+
*
|
|
10919
|
+
* @param {Maps} maps - Specifies the layer instance to which the polygon is to be rendered.
|
|
10920
|
+
* @param {number} layerIndex -Specifies the index of current layer.
|
|
10921
|
+
* @param {number} factor - Specifies the current zoom factor of the Maps.
|
|
10922
|
+
* @returns {Element} - Returns the polygon element.
|
|
10923
|
+
* @private
|
|
10924
|
+
*/
|
|
10925
|
+
Polygon.prototype.polygonRender = function (maps, layerIndex, factor) {
|
|
10926
|
+
var _this = this;
|
|
10927
|
+
var currentLayer = maps.layersCollection[layerIndex];
|
|
10928
|
+
var polygonsSVGObject = maps.renderer.createGroup({
|
|
10929
|
+
id: maps.element.id + '_LayerIndex_' + layerIndex + '_Polygons_Group'
|
|
10930
|
+
});
|
|
10931
|
+
currentLayer.polygonSettings.polygons.map(function (polygonSetting, polygonIndex) {
|
|
10932
|
+
var polygonSVGObject = maps.renderer.createGroup({
|
|
10933
|
+
id: maps.element.id + '_LayerIndex_' + layerIndex + '_Polygons_Group_' + polygonIndex
|
|
10934
|
+
});
|
|
10935
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10936
|
+
var polygonData = polygonSetting.points;
|
|
10937
|
+
var path = calculatePolygonPath(maps, factor, currentLayer, polygonData);
|
|
10938
|
+
var pathOptions = new PathOption(maps.element.id + '_LayerIndex_' + layerIndex + '_PolygonIndex_' + polygonIndex, polygonSetting.fill, (polygonSetting.borderWidth / factor), polygonSetting.borderColor, polygonSetting.opacity, polygonSetting.borderOpacity, '', path);
|
|
10939
|
+
var polygonEle = maps.renderer.drawPath(pathOptions);
|
|
10940
|
+
maintainSelection(_this.maps.selectedPolygonElementId, _this.maps.polygonSelectionClass, polygonEle, 'PolygonselectionMapStyle');
|
|
10941
|
+
polygonSVGObject.appendChild(polygonEle);
|
|
10942
|
+
polygonsSVGObject.appendChild(polygonSVGObject);
|
|
10943
|
+
});
|
|
10944
|
+
return polygonsSVGObject;
|
|
10945
|
+
};
|
|
10946
|
+
/**
|
|
10947
|
+
* Get module name.
|
|
10948
|
+
*
|
|
10949
|
+
* @returns {string} - Returns the module name
|
|
10950
|
+
*/
|
|
10951
|
+
Polygon.prototype.getModuleName = function () {
|
|
10952
|
+
return 'Polygon';
|
|
10953
|
+
};
|
|
10954
|
+
/**
|
|
10955
|
+
* To destroy the layers.
|
|
10956
|
+
*
|
|
10957
|
+
* @returns {void}
|
|
10958
|
+
* @private
|
|
10959
|
+
*/
|
|
10960
|
+
Polygon.prototype.destroy = function () {
|
|
10961
|
+
this.maps = null;
|
|
10962
|
+
};
|
|
10963
|
+
return Polygon;
|
|
10729
10964
|
}());
|
|
10730
10965
|
|
|
10731
10966
|
/**
|
|
@@ -11224,17 +11459,17 @@ var NavigationLine = /** @__PURE__ @class */ (function () {
|
|
|
11224
11459
|
id: this.maps.element.id + '_LayerIndex_' + layerIndex + '_line_Group'
|
|
11225
11460
|
}));
|
|
11226
11461
|
for (var i = 0; i < navigation.length; i++) {
|
|
11227
|
-
latitude = navigation[i]
|
|
11228
|
-
longitude = navigation[i]
|
|
11229
|
-
visible = navigation[i][
|
|
11230
|
-
angle = navigation[i][
|
|
11231
|
-
width = navigation[i]
|
|
11232
|
-
color = navigation[i]
|
|
11233
|
-
dashArray = navigation[i]
|
|
11234
|
-
arrowSettings = navigation[i]
|
|
11235
|
-
showArrow =
|
|
11236
|
-
if (longitude
|
|
11237
|
-
for (var i_1 = 0; i_1 < longitude
|
|
11462
|
+
latitude = navigation[i].latitude;
|
|
11463
|
+
longitude = navigation[i].longitude;
|
|
11464
|
+
visible = !isNullOrUndefined(navigation[i].visible) ? navigation[i].visible : false;
|
|
11465
|
+
angle = !isNullOrUndefined(navigation[i].angle) ? navigation[i].angle : 0;
|
|
11466
|
+
width = navigation[i].width || 1;
|
|
11467
|
+
color = navigation[i].color;
|
|
11468
|
+
dashArray = navigation[i].dashArray;
|
|
11469
|
+
arrowSettings = navigation[i].arrowSettings;
|
|
11470
|
+
showArrow = !isNullOrUndefined(arrowSettings) ? arrowSettings.showArrow : false;
|
|
11471
|
+
if (longitude.length === latitude.length && visible) {
|
|
11472
|
+
for (var i_1 = 0; i_1 < longitude.length; i_1++) {
|
|
11238
11473
|
var location_1 = (this.maps.isTileMap) ? convertTileLatLongToPoint(new Point(longitude[i_1], latitude[i_1]), factor, this.maps.tileTranslatePoint, true) : convertGeoToPoint(latitude[i_1], longitude[i_1], factor, layer, this.maps);
|
|
11239
11474
|
point.push(location_1);
|
|
11240
11475
|
}
|
|
@@ -11242,7 +11477,7 @@ var NavigationLine = /** @__PURE__ @class */ (function () {
|
|
|
11242
11477
|
navigationGroup = (this.maps.renderer.createGroup({
|
|
11243
11478
|
id: this.maps.element.id + '_LayerIndex_' + layerIndex + '_NavigationGroup' + i + ''
|
|
11244
11479
|
}));
|
|
11245
|
-
for (var j = 0; j < point
|
|
11480
|
+
for (var j = 0; j < point.length - 1; j++) {
|
|
11246
11481
|
angle = (-1 > angle) ? -1 : angle;
|
|
11247
11482
|
angle = (1 < angle) ? 1 : angle;
|
|
11248
11483
|
var arcId = this.maps.element.id + '_LayerIndex_' + layerIndex + '_NavigationIndex_' + i + '_Line' + j + '';
|
|
@@ -11260,11 +11495,11 @@ var NavigationLine = /** @__PURE__ @class */ (function () {
|
|
|
11260
11495
|
}
|
|
11261
11496
|
}
|
|
11262
11497
|
if (showArrow) {
|
|
11263
|
-
arrowColor = arrowSettings
|
|
11264
|
-
arrowSize = arrowSettings
|
|
11265
|
-
offSetValue = (arrowSettings
|
|
11498
|
+
arrowColor = arrowSettings.color;
|
|
11499
|
+
arrowSize = arrowSettings.size;
|
|
11500
|
+
offSetValue = !isNullOrUndefined(arrowSettings.offSet) ? arrowSettings.offSet : 0;
|
|
11266
11501
|
var divide = (Math.round(arrowSize / 2));
|
|
11267
|
-
arrowPosition = arrowSettings
|
|
11502
|
+
arrowPosition = arrowSettings.position;
|
|
11268
11503
|
startArrow = (arrowPosition === 'Start') ? 'url(#triangle' + i + ')' : null;
|
|
11269
11504
|
endArrow = (arrowPosition === 'End') ? 'url(#triangle' + i + ')' : null;
|
|
11270
11505
|
if (offSet !== 0 && angle === 0) {
|
|
@@ -13121,7 +13356,7 @@ var Legend = /** @__PURE__ @class */ (function () {
|
|
|
13121
13356
|
var legendToggleBorderWidth = this.maps.legendSettings.toggleLegendSettings.border.width;
|
|
13122
13357
|
var legendToggleBorderOpacity = isNullOrUndefined(this.maps.legendSettings.toggleLegendSettings.border.opacity) ?
|
|
13123
13358
|
this.maps.legendSettings.toggleLegendSettings.opacity : this.maps.legendSettings.toggleLegendSettings.border.opacity;
|
|
13124
|
-
if (targetEle.parentNode['id'].indexOf(this.maps.element.id + '_Legend_Index_') > -1) {
|
|
13359
|
+
if (!isNullOrUndefined(targetEle.parentNode) && targetEle.parentNode['id'].indexOf(this.maps.element.id + '_Legend_Index_') > -1) {
|
|
13125
13360
|
var mapElement = void 0;
|
|
13126
13361
|
var legendIndex = parseFloat(targetEle.parentElement.id.substr((this.maps.element.id + '_Legend_Index_').length));
|
|
13127
13362
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -13617,6 +13852,7 @@ var Highlight = /** @__PURE__ @class */ (function () {
|
|
|
13617
13852
|
targetEle.getAttribute('class') !== 'MarkerselectionMapStyle' &&
|
|
13618
13853
|
targetEle.getAttribute('class') !== 'BubbleselectionMapStyle' &&
|
|
13619
13854
|
targetEle.getAttribute('class') !== 'navigationlineselectionMapStyle' &&
|
|
13855
|
+
targetEle.getAttribute('class') !== 'PolygonselectionMapStyle' &&
|
|
13620
13856
|
targetEle.getAttribute('class') !== 'LineselectionMapStyle') {
|
|
13621
13857
|
layerIndex = parseInt(targetEle.id.split('_LayerIndex_')[1].split('_')[0], 10);
|
|
13622
13858
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -13646,6 +13882,11 @@ var Highlight = /** @__PURE__ @class */ (function () {
|
|
|
13646
13882
|
data = this.maps.layers[layerIndex].markerSettings[marker$$1].dataSource[dataIndex];
|
|
13647
13883
|
this.highlightSettings = this.maps.layers[layerIndex].markerSettings[marker$$1].highlightSettings;
|
|
13648
13884
|
}
|
|
13885
|
+
else if (targetEle.id.indexOf('_PolygonIndex_') > -1) {
|
|
13886
|
+
dataIndex = parseInt(targetEle.id.split('_PolygonIndex_')[1].split('_')[0], 10);
|
|
13887
|
+
data = this.maps.layers[layerIndex].polygonSettings.polygons[dataIndex].points;
|
|
13888
|
+
this.highlightSettings = this.maps.layers[layerIndex].polygonSettings.highlightSettings;
|
|
13889
|
+
}
|
|
13649
13890
|
else {
|
|
13650
13891
|
var index = parseInt(targetEle.id.split('_NavigationIndex_')[1].split('_')[0], 10);
|
|
13651
13892
|
layerIndex = parseInt(targetEle.id.split('_LayerIndex_')[1].split('_')[0], 10);
|
|
@@ -13884,6 +14125,12 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
13884
14125
|
this.selectionsettings = this.maps.layers[layerIndex].markerSettings[markerIndex].selectionSettings;
|
|
13885
14126
|
this.selectionType = 'Marker';
|
|
13886
14127
|
}
|
|
14128
|
+
else if (targetElement.id.indexOf('_PolygonIndex_') > -1) {
|
|
14129
|
+
dataIndex = parseInt(targetElement.id.split('_PolygonIndex_')[1].split('_')[0], 10);
|
|
14130
|
+
data = this.maps.layers[layerIndex].polygonSettings.polygons[dataIndex].points;
|
|
14131
|
+
this.selectionsettings = this.maps.layers[layerIndex].polygonSettings.selectionSettings;
|
|
14132
|
+
this.selectionType = 'Polygon';
|
|
14133
|
+
}
|
|
13887
14134
|
else if (targetElement.id.indexOf('NavigationIndex') > -1) {
|
|
13888
14135
|
var index = parseInt(targetElement.id.split('_NavigationIndex_')[1].split('_')[0], 10);
|
|
13889
14136
|
shapeData = null;
|
|
@@ -14059,6 +14306,10 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
14059
14306
|
_this.maps.navigationSelectionClass = getElement(_this.selectionType + 'selectionMap');
|
|
14060
14307
|
_this.maps.selectedNavigationElementId.push(targetElement.getAttribute('id'));
|
|
14061
14308
|
}
|
|
14309
|
+
if (targetElement.getAttribute('class') === 'PolygonselectionMapStyle') {
|
|
14310
|
+
_this.maps.polygonSelectionClass = getElement(_this.selectionType + 'selectionMap');
|
|
14311
|
+
_this.maps.selectedPolygonElementId.push(targetElement.getAttribute('id'));
|
|
14312
|
+
}
|
|
14062
14313
|
}
|
|
14063
14314
|
}
|
|
14064
14315
|
});
|
|
@@ -14098,6 +14349,9 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
14098
14349
|
if (this.selectionType === 'navigationline') {
|
|
14099
14350
|
this.maps.selectedBubbleElementId.splice(this.maps.selectedBubbleElementId.indexOf(targetElement.getAttribute('id')), 1);
|
|
14100
14351
|
}
|
|
14352
|
+
if (this.selectionType === 'Polygon') {
|
|
14353
|
+
this.maps.selectedPolygonElementId.splice(this.maps.selectedPolygonElementId.indexOf(targetElement.getAttribute('id')), 1);
|
|
14354
|
+
}
|
|
14101
14355
|
};
|
|
14102
14356
|
/**
|
|
14103
14357
|
* Get module name.
|
|
@@ -14140,7 +14394,6 @@ var MapsTooltip = /** @__PURE__ @class */ (function () {
|
|
|
14140
14394
|
var target;
|
|
14141
14395
|
var touchArg;
|
|
14142
14396
|
var tooltipArgs;
|
|
14143
|
-
var tooltipTemplateElement;
|
|
14144
14397
|
if (e.type.indexOf('touch') !== -1) {
|
|
14145
14398
|
this.isTouch = true;
|
|
14146
14399
|
touchArg = e;
|
|
@@ -14291,7 +14544,12 @@ var MapsTooltip = /** @__PURE__ @class */ (function () {
|
|
|
14291
14544
|
id: this.maps.element.id + '_mapsTooltip',
|
|
14292
14545
|
className: 'EJ2-maps-Tooltip'
|
|
14293
14546
|
});
|
|
14294
|
-
|
|
14547
|
+
if (isNullOrUndefined(option.template) || option.template === '' || this.maps.tooltipDisplayMode === 'MouseMove') {
|
|
14548
|
+
tooltipEle.style.cssText = 'position: absolute;pointer-events:none;';
|
|
14549
|
+
}
|
|
14550
|
+
else {
|
|
14551
|
+
tooltipEle.style.position = 'absolute';
|
|
14552
|
+
}
|
|
14295
14553
|
document.getElementById(this.maps.element.id + '_Secondary_Element').appendChild(tooltipEle);
|
|
14296
14554
|
}
|
|
14297
14555
|
if (typeof option.template !== 'function' && option.template !== null && Object.keys(typeof option.template === 'object' ? option.template : {}).length === 1) {
|
|
@@ -14335,8 +14593,8 @@ var MapsTooltip = /** @__PURE__ @class */ (function () {
|
|
|
14335
14593
|
header: '',
|
|
14336
14594
|
data: option['data'],
|
|
14337
14595
|
template: option['template'],
|
|
14338
|
-
content: tooltipArgs.content.toString() !== currentData.toString() ? [
|
|
14339
|
-
[
|
|
14596
|
+
content: tooltipArgs.content.toString() !== currentData.toString() ? [tooltipArgs.content.toString()] :
|
|
14597
|
+
[currentData.toString()],
|
|
14340
14598
|
shapes: [],
|
|
14341
14599
|
location: option['location'],
|
|
14342
14600
|
palette: [markerFill],
|
|
@@ -14353,8 +14611,8 @@ var MapsTooltip = /** @__PURE__ @class */ (function () {
|
|
|
14353
14611
|
header: '',
|
|
14354
14612
|
data: tooltipArgs.options['data'],
|
|
14355
14613
|
template: tooltipArgs.options['template'],
|
|
14356
|
-
content: tooltipArgs.content.toString() !== currentData.toString() ? [
|
|
14357
|
-
[
|
|
14614
|
+
content: tooltipArgs.content.toString() !== currentData.toString() ? [tooltipArgs.content.toString()] :
|
|
14615
|
+
[currentData.toString()],
|
|
14358
14616
|
shapes: [],
|
|
14359
14617
|
location: tooltipArgs.options['location'],
|
|
14360
14618
|
palette: [markerFill],
|
|
@@ -14373,13 +14631,6 @@ var MapsTooltip = /** @__PURE__ @class */ (function () {
|
|
|
14373
14631
|
_this.svgTooltip.appendTo(tooltipEle);
|
|
14374
14632
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
14375
14633
|
_this.maps.renderReactTemplates();
|
|
14376
|
-
tooltipTemplateElement = document.getElementById(_this.maps.element.id + '_mapsTooltip');
|
|
14377
|
-
if (tooltipTemplateElement !== null && tooltipTemplateElement.innerHTML.indexOf('href') !== -1
|
|
14378
|
-
&& tooltipTemplateElement.innerHTML.indexOf('</a>') !== -1) {
|
|
14379
|
-
var templateStyle = tooltipTemplateElement.getAttribute('style');
|
|
14380
|
-
templateStyle = templateStyle.replace('pointer-events: none;', 'position-events:all;');
|
|
14381
|
-
tooltipTemplateElement.style.cssText = templateStyle;
|
|
14382
|
-
}
|
|
14383
14634
|
}
|
|
14384
14635
|
else {
|
|
14385
14636
|
_this.clearTooltip(e.target);
|
|
@@ -14401,12 +14652,8 @@ var MapsTooltip = /** @__PURE__ @class */ (function () {
|
|
|
14401
14652
|
}
|
|
14402
14653
|
}
|
|
14403
14654
|
else {
|
|
14404
|
-
|
|
14405
|
-
if (
|
|
14406
|
-
&& tooltipTemplateElement.innerHTML.indexOf('</a>') !== -1) {
|
|
14407
|
-
this.maps.notify(click, this);
|
|
14408
|
-
}
|
|
14409
|
-
else {
|
|
14655
|
+
var tooltipElement = e.target.closest('#' + this.maps.element.id + '_mapsTooltipparent_template');
|
|
14656
|
+
if (isNullOrUndefined(tooltipElement)) {
|
|
14410
14657
|
this.clearTooltip(e.target);
|
|
14411
14658
|
}
|
|
14412
14659
|
}
|
|
@@ -14600,10 +14847,10 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
14600
14847
|
Zoom.prototype.performZooming = function (position, newZoomFactor, type) {
|
|
14601
14848
|
var _this = this;
|
|
14602
14849
|
var map = this.maps;
|
|
14603
|
-
map.previousProjection = map.projectionType;
|
|
14850
|
+
map.previousProjection = newZoomFactor <= 1.5 ? undefined : map.projectionType;
|
|
14604
14851
|
map.defaultState = false;
|
|
14605
14852
|
map.initialCheck = false;
|
|
14606
|
-
map.markerZoomedState = false;
|
|
14853
|
+
map.markerZoomedState = map.isMarkerZoomCompleted = false;
|
|
14607
14854
|
map.zoomPersistence = map.enablePersistence;
|
|
14608
14855
|
var prevLevel = map.tileZoomLevel;
|
|
14609
14856
|
var scale = map.previousScale = map.scale;
|
|
@@ -14651,6 +14898,7 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
14651
14898
|
map.translatePoint = new Point(translatePointX, translatePointY);
|
|
14652
14899
|
}
|
|
14653
14900
|
map.scale = newZoomFactor;
|
|
14901
|
+
map.zoomTranslatePoint = map.translatePoint;
|
|
14654
14902
|
if (this.triggerZoomEvent(prevTilePoint, prevLevel, type)) {
|
|
14655
14903
|
map.translatePoint = map.previousPoint;
|
|
14656
14904
|
map.scale = map.mapScaleValue = map.previousScale;
|
|
@@ -14672,6 +14920,7 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
14672
14920
|
newZoomFactor = map.tileZoomLevel = map.mapScaleValue = map.initialZoomLevel;
|
|
14673
14921
|
map.scale = Math.pow(2, newZoomFactor - 1);
|
|
14674
14922
|
}
|
|
14923
|
+
map.mapScaleValue = isNaN(map.mapScaleValue) ? 1 : map.mapScaleValue;
|
|
14675
14924
|
map.translatePoint.y = (map.tileTranslatePoint.y - (0.01 * map.mapScaleValue)) / map.scale;
|
|
14676
14925
|
map.translatePoint.x = (map.tileTranslatePoint.x - (0.01 * map.mapScaleValue)) / map.scale;
|
|
14677
14926
|
if (this.triggerZoomEvent(prevTilePoint, prevLevel, type)) {
|
|
@@ -14725,18 +14974,28 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
14725
14974
|
Zoom.prototype.triggerZoomEvent = function (prevTilePoint, prevLevel, type) {
|
|
14726
14975
|
var map = this.maps;
|
|
14727
14976
|
var zoomArgs;
|
|
14977
|
+
if (map.isTileMap) {
|
|
14978
|
+
map.mapScaleValue = isNullOrUndefined(map.mapScaleValue) ? 1 : map.mapScaleValue;
|
|
14979
|
+
map.translatePoint.y = (map.tileTranslatePoint.y - (0.01 * map.mapScaleValue)) / map.scale;
|
|
14980
|
+
map.translatePoint.x = (map.tileTranslatePoint.x - (0.01 * map.mapScaleValue)) / map.scale;
|
|
14981
|
+
}
|
|
14982
|
+
var minMaxLatitudeLongitude = this.maps.getMinMaxLatitudeLongitude();
|
|
14728
14983
|
if (!map.isTileMap) {
|
|
14729
14984
|
zoomArgs = {
|
|
14730
14985
|
cancel: false, name: 'zoom', type: type, maps: map,
|
|
14731
14986
|
tileTranslatePoint: {}, translatePoint: { previous: map.previousPoint, current: map.translatePoint },
|
|
14732
|
-
tileZoomLevel: {}, scale: { previous: map.previousScale, current: map.scale }
|
|
14987
|
+
tileZoomLevel: {}, scale: { previous: map.previousScale, current: map.scale },
|
|
14988
|
+
minLatitude: minMaxLatitudeLongitude.minLatitude, maxLatitude: minMaxLatitudeLongitude.maxLatitude,
|
|
14989
|
+
minLongitude: minMaxLatitudeLongitude.minLongitude, maxLongitude: minMaxLatitudeLongitude.maxLongitude
|
|
14733
14990
|
};
|
|
14734
14991
|
}
|
|
14735
14992
|
else {
|
|
14736
14993
|
zoomArgs = {
|
|
14737
14994
|
cancel: false, name: 'zoom', type: type, maps: map,
|
|
14738
14995
|
tileTranslatePoint: { previous: prevTilePoint, current: map.tileTranslatePoint }, translatePoint: { previous: map.previousPoint, current: map.translatePoint },
|
|
14739
|
-
tileZoomLevel: { previous: prevLevel, current: map.tileZoomLevel }, scale: { previous: map.previousScale, current: map.scale }
|
|
14996
|
+
tileZoomLevel: { previous: prevLevel, current: map.tileZoomLevel }, scale: { previous: map.previousScale, current: map.scale },
|
|
14997
|
+
minLatitude: minMaxLatitudeLongitude.minLatitude, maxLatitude: minMaxLatitudeLongitude.maxLatitude,
|
|
14998
|
+
minLongitude: minMaxLatitudeLongitude.minLongitude, maxLongitude: minMaxLatitudeLongitude.maxLongitude
|
|
14740
14999
|
};
|
|
14741
15000
|
}
|
|
14742
15001
|
map.trigger('zoom', zoomArgs);
|
|
@@ -14785,6 +15044,7 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
14785
15044
|
map.translatePoint = new Point(translatePointX, translatePointY);
|
|
14786
15045
|
}
|
|
14787
15046
|
map.scale = zoomCalculationFactor < this.maps.zoomSettings.maxZoom ? zoomCalculationFactor : this.maps.zoomSettings.maxZoom;
|
|
15047
|
+
map.zoomTranslatePoint = map.translatePoint;
|
|
14788
15048
|
isZoomCancelled = this.triggerZoomEvent(prevTilePoint, prevLevel, '');
|
|
14789
15049
|
if (isZoomCancelled) {
|
|
14790
15050
|
map.translatePoint = map.previousPoint;
|
|
@@ -14840,6 +15100,7 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
14840
15100
|
var map = this.maps;
|
|
14841
15101
|
var prevLevel = map.tileZoomLevel;
|
|
14842
15102
|
var availSize = map.mapAreaRect;
|
|
15103
|
+
map.isMarkerZoomCompleted = false;
|
|
14843
15104
|
map.previousScale = map.scale;
|
|
14844
15105
|
map.previousPoint = map.translatePoint;
|
|
14845
15106
|
map.previousProjection = map.projectionType;
|
|
@@ -14955,7 +15216,9 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
14955
15216
|
Zoom.prototype.animateTransform = function (element, animate$$1, x, y, scale) {
|
|
14956
15217
|
var duration = this.currentLayer.animationDuration === 0 && animationMode === 'Enable' ? 1000 : this.currentLayer.animationDuration;
|
|
14957
15218
|
if (!animate$$1 || duration === 0 || this.maps.isTileMap) {
|
|
14958
|
-
|
|
15219
|
+
if (!(this.maps.isTileMap && element.id.indexOf('_Polygons_Group') > -1)) {
|
|
15220
|
+
element.setAttribute('transform', 'scale(' + (scale) + ') translate( ' + x + ' ' + y + ' )');
|
|
15221
|
+
}
|
|
14959
15222
|
return;
|
|
14960
15223
|
}
|
|
14961
15224
|
if (!this.maps.isTileMap) {
|
|
@@ -14966,6 +15229,7 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
14966
15229
|
* @private
|
|
14967
15230
|
*/
|
|
14968
15231
|
Zoom.prototype.applyTransform = function (maps, animate$$1) {
|
|
15232
|
+
var _this = this;
|
|
14969
15233
|
var layerIndex;
|
|
14970
15234
|
this.templateCount = 0;
|
|
14971
15235
|
var markerStyle;
|
|
@@ -14999,6 +15263,17 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
14999
15263
|
layerElement.appendChild(maps.navigationLineModule.renderNavigation(this.currentLayer, maps.tileZoomLevel, this.index));
|
|
15000
15264
|
}
|
|
15001
15265
|
}
|
|
15266
|
+
else if (maps.isTileMap && (currentEle.id.indexOf('_Polygons_Group') > -1)) {
|
|
15267
|
+
if (this.currentLayer.polygonSettings.polygons.length > 0) {
|
|
15268
|
+
this.currentLayer.polygonSettings.polygons.map(function (polygonSettings, polygonIndex) {
|
|
15269
|
+
var markerData = polygonSettings.points;
|
|
15270
|
+
var path = calculatePolygonPath(maps, maps.tileZoomLevel, _this.currentLayer, markerData);
|
|
15271
|
+
var element = document.getElementById(maps.element.id + '_LayerIndex_' + _this.index + '_PolygonIndex_' + polygonIndex);
|
|
15272
|
+
element.setAttribute('d', path);
|
|
15273
|
+
});
|
|
15274
|
+
document.getElementById(maps.element.id + '_LayerIndex_' + this.index + '_Polygons_Group').style.visibility = '';
|
|
15275
|
+
}
|
|
15276
|
+
}
|
|
15002
15277
|
else if (currentEle.id.indexOf('Legend') === -1) {
|
|
15003
15278
|
changeBorderWidth(currentEle, this.index, scale, maps);
|
|
15004
15279
|
maps.zoomTranslatePoint = maps.translatePoint;
|
|
@@ -15006,7 +15281,7 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
15006
15281
|
}
|
|
15007
15282
|
}
|
|
15008
15283
|
else if (currentEle.id.indexOf('_Markers_Group') > -1) {
|
|
15009
|
-
if (!this.isPanning && !isNullOrUndefined(currentEle.childNodes[0])) {
|
|
15284
|
+
if ((!this.isPanning) && !isNullOrUndefined(currentEle.childNodes[0])) {
|
|
15010
15285
|
this.markerTranslates(currentEle.childNodes[0], factor, x, y, scale, 'Marker', layerElement, animate$$1);
|
|
15011
15286
|
}
|
|
15012
15287
|
currentEle = layerElement.childNodes[j];
|
|
@@ -15225,7 +15500,19 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
15225
15500
|
var markerDataLength = markerDatas.length - _this.maps.markerNullCount;
|
|
15226
15501
|
if (markerSVGObject.childElementCount === (markerDataLength - markerTemplateCounts - nullCount) && (type !== 'Template')) {
|
|
15227
15502
|
if (_this.maps.isTileMap) {
|
|
15228
|
-
|
|
15503
|
+
var polygonsElement = document.getElementById(_this.maps.element.id + '_LayerIndex_' + layerIndex + '_Polygons_Group');
|
|
15504
|
+
var polygonElement = document.getElementById(_this.maps.element.id + '_LayerIndex_' + layerIndex + '_Polygon_Group');
|
|
15505
|
+
if (!isNullOrUndefined(polygonsElement)) {
|
|
15506
|
+
polygonsElement.insertAdjacentElement('afterend', markerSVGObject);
|
|
15507
|
+
}
|
|
15508
|
+
else {
|
|
15509
|
+
if (!isNullOrUndefined(polygonElement)) {
|
|
15510
|
+
polygonElement.insertAdjacentElement('afterend', markerSVGObject);
|
|
15511
|
+
}
|
|
15512
|
+
else {
|
|
15513
|
+
layerElement.insertBefore(markerSVGObject, layerElement.firstElementChild);
|
|
15514
|
+
}
|
|
15515
|
+
}
|
|
15229
15516
|
}
|
|
15230
15517
|
else {
|
|
15231
15518
|
layerElement.appendChild(markerSVGObject);
|
|
@@ -15265,6 +15552,8 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
15265
15552
|
i + '_Markers_Template_Group');
|
|
15266
15553
|
var datalabelTemplateElemement = getElementByID(maps.element.id + '_LayerIndex_'
|
|
15267
15554
|
+ i + '_Label_Template_Group');
|
|
15555
|
+
var polygonElement = getElementByID(maps.element.id + '_LayerIndex_'
|
|
15556
|
+
+ i + '_Polygons_Group');
|
|
15268
15557
|
if ((!isNullOrUndefined(markerTemplateElement)) && markerTemplateElement.childElementCount > 0) {
|
|
15269
15558
|
markerTemplateElement.style.visibility = 'visible';
|
|
15270
15559
|
for (var k = 0; k < markerTemplateElement.childElementCount; k++) {
|
|
@@ -15276,6 +15565,12 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
15276
15565
|
this.dataLabelTranslate(datalabelTemplateElemement.childNodes[k], factor, x, y, scale, 'Template');
|
|
15277
15566
|
}
|
|
15278
15567
|
}
|
|
15568
|
+
if (!isNullOrUndefined(polygonElement)) {
|
|
15569
|
+
for (var k = 0; k < polygonElement.childElementCount; k++) {
|
|
15570
|
+
var width = maps.layersCollection[i].polygonSettings.polygons[k].borderWidth;
|
|
15571
|
+
polygonElement.childNodes[k].childNodes[0].setAttribute('stroke-width', (width / scale).toString());
|
|
15572
|
+
}
|
|
15573
|
+
}
|
|
15279
15574
|
}
|
|
15280
15575
|
};
|
|
15281
15576
|
Zoom.prototype.dataLabelTranslate = function (element, factor, x, y, scale, type, animate$$1) {
|
|
@@ -15330,7 +15625,6 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
15330
15625
|
zoomtextSize = measureText(zoomtext, style);
|
|
15331
15626
|
var start = labelY - zoomtextSize['height'] / 4;
|
|
15332
15627
|
var end = labelY + zoomtextSize['height'] / 4;
|
|
15333
|
-
labelY = end;
|
|
15334
15628
|
var xpositionEnds = labelX + zoomtextSize['width'] / 2;
|
|
15335
15629
|
var xpositionStart = labelX - zoomtextSize['width'] / 2;
|
|
15336
15630
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -15503,12 +15797,16 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
15503
15797
|
for (var i = 0; i < map.layersCollection.length; i++) {
|
|
15504
15798
|
var markerTemplateElement = getElementByID(this.maps.element.id + '_LayerIndex_' + i + '_Markers_Template_Group');
|
|
15505
15799
|
var lineElement = getElementByID(this.maps.element.id + '_LayerIndex_' + i + '_line_Group');
|
|
15800
|
+
var polygonElement = getElementByID(this.maps.element.id + '_LayerIndex_' + i + '_Polygons_Group');
|
|
15506
15801
|
if (!isNullOrUndefined(markerTemplateElement)) {
|
|
15507
15802
|
markerTemplateElement.style.visibility = 'hidden';
|
|
15508
15803
|
}
|
|
15509
15804
|
if (!isNullOrUndefined(lineElement)) {
|
|
15510
15805
|
lineElement.style.visibility = 'hidden';
|
|
15511
15806
|
}
|
|
15807
|
+
if (!isNullOrUndefined(polygonElement)) {
|
|
15808
|
+
polygonElement.style.visibility = 'hidden';
|
|
15809
|
+
}
|
|
15512
15810
|
}
|
|
15513
15811
|
}
|
|
15514
15812
|
};
|
|
@@ -15550,10 +15848,13 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
15550
15848
|
((layerRect.top + layerRect.height + legendHeight + map.margin.top) >= (elementRect.top + elementRect.height))));
|
|
15551
15849
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
15552
15850
|
var location_3 = this.maps.getGeoLocation(this.maps.layersCollection.length - 1, mouseLocation['layerX'], mouseLocation['layerY']);
|
|
15851
|
+
var minMaxLatitudeLongitude = this.maps.getMinMaxLatitudeLongitude();
|
|
15553
15852
|
panArgs = {
|
|
15554
15853
|
cancel: false, name: pan, maps: map,
|
|
15555
15854
|
tileTranslatePoint: {}, translatePoint: { previous: translatePoint, current: new Point(x, y) },
|
|
15556
|
-
scale: map.scale, tileZoomLevel: map.tileZoomLevel, latitude: location_3['latitude'], longitude: location_3['longitude']
|
|
15855
|
+
scale: map.scale, tileZoomLevel: map.tileZoomLevel, latitude: location_3['latitude'], longitude: location_3['longitude'],
|
|
15856
|
+
minLatitude: minMaxLatitudeLongitude.minLatitude, maxLatitude: minMaxLatitudeLongitude.maxLatitude,
|
|
15857
|
+
minLongitude: minMaxLatitudeLongitude.minLongitude, maxLongitude: minMaxLatitudeLongitude.maxLongitude
|
|
15557
15858
|
};
|
|
15558
15859
|
map.trigger(pan, panArgs);
|
|
15559
15860
|
if (!panArgs.cancel) {
|
|
@@ -15587,11 +15888,14 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
15587
15888
|
map.translatePoint.y = (map.tileTranslatePoint.y - yDifference) / map.scale;
|
|
15588
15889
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
15589
15890
|
var location_4 = this.maps.getTileGeoLocation(mouseLocation['layerX'], mouseLocation['layerY']);
|
|
15891
|
+
var minMaxLatitudeLongitude = this.maps.getMinMaxLatitudeLongitude();
|
|
15590
15892
|
panArgs = {
|
|
15591
15893
|
cancel: false, name: pan, maps: map,
|
|
15592
15894
|
tileTranslatePoint: { previous: prevTilePoint, current: map.tileTranslatePoint },
|
|
15593
15895
|
translatePoint: { previous: translatePoint, current: map.translatePoint }, scale: map.scale,
|
|
15594
|
-
tileZoomLevel: map.tileZoomLevel, latitude: location_4['latitude'], longitude: location_4['longitude']
|
|
15896
|
+
tileZoomLevel: map.tileZoomLevel, latitude: location_4['latitude'], longitude: location_4['longitude'],
|
|
15897
|
+
minLatitude: minMaxLatitudeLongitude.minLatitude, maxLatitude: minMaxLatitudeLongitude.maxLatitude,
|
|
15898
|
+
minLongitude: minMaxLatitudeLongitude.minLongitude, maxLongitude: minMaxLatitudeLongitude.maxLongitude
|
|
15595
15899
|
};
|
|
15596
15900
|
map.trigger(pan, panArgs);
|
|
15597
15901
|
map.mapLayerPanel.generateTiles(map.tileZoomLevel, map.tileTranslatePoint, 'Pan');
|
|
@@ -15614,7 +15918,7 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
15614
15918
|
Zoom.prototype.toolBarZooming = function (zoomFactor, type) {
|
|
15615
15919
|
var _this = this;
|
|
15616
15920
|
var map = this.maps;
|
|
15617
|
-
map.initialCheck = false;
|
|
15921
|
+
map.initialCheck = map.isMarkerZoomCompleted = false;
|
|
15618
15922
|
map.defaultState = ((type === 'Reset' && zoomFactor === 1 && !(map.zoomSettings.resetToInitial && map.applyZoomReset))
|
|
15619
15923
|
|| (type === 'ZoomOut' && zoomFactor === 1));
|
|
15620
15924
|
var prevLevel = map.tileZoomLevel;
|
|
@@ -15627,7 +15931,7 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
15627
15931
|
var size = map.mapAreaRect;
|
|
15628
15932
|
var translatePoint = map.previousPoint = map.translatePoint;
|
|
15629
15933
|
var prevTilePoint = map.tileTranslatePoint;
|
|
15630
|
-
map.previousProjection =
|
|
15934
|
+
map.previousProjection = type === 'Reset' ? undefined : map.projectionType;
|
|
15631
15935
|
zoomFactor = (type === 'ZoomOut') ? (Math.round(zoomFactor) === 1 ? 1 : zoomFactor) : zoomFactor;
|
|
15632
15936
|
zoomFactor = (type === 'Reset') ? minZoom : (Math.round(zoomFactor) === 0) ? 1 : zoomFactor;
|
|
15633
15937
|
zoomFactor = (minZoom > zoomFactor && type === 'ZoomIn') ? minZoom + 1 : zoomFactor;
|
|
@@ -15885,7 +16189,10 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
15885
16189
|
isToolbarPerform = (this.maps.isTileMap ? this.maps.tileZoomLevel : this.maps.scale) + 1 <= this.maps.zoomSettings.maxZoom;
|
|
15886
16190
|
break;
|
|
15887
16191
|
case 'zoomout':
|
|
15888
|
-
|
|
16192
|
+
var scaleValue = this.maps.isTileMap ? this.maps.tileZoomLevel : this.maps.scale;
|
|
16193
|
+
isToolbarPerform = (this.maps.projectionType === 'Miller' || this.maps.projectionType === 'Winkel3' ||
|
|
16194
|
+
this.maps.projectionType === 'AitOff') ? Math.round(scaleValue) - 1 >= this.maps.zoomSettings.minZoom :
|
|
16195
|
+
(scaleValue) - 1 >= this.maps.zoomSettings.minZoom;
|
|
15889
16196
|
break;
|
|
15890
16197
|
case 'reset':
|
|
15891
16198
|
isToolbarPerform = Math.round(this.maps.isTileMap ? this.maps.tileZoomLevel : this.maps.scale) != this.maps.zoomSettings.minZoom;
|
|
@@ -16319,8 +16626,9 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
16319
16626
|
var pageX = e.pageX;
|
|
16320
16627
|
var pageY = e.pageY;
|
|
16321
16628
|
var target = e.target;
|
|
16629
|
+
var tooltipElement = e.target.closest('#' + this.maps.element.id + '_mapsTooltipparent_template');
|
|
16322
16630
|
if (this.maps.zoomSettings.enable && this.maps.zoomSettings.doubleClickZoom
|
|
16323
|
-
&& !(e.target['id'].indexOf('_Zooming_') > -1)) {
|
|
16631
|
+
&& !(e.target['id'].indexOf('_Zooming_') > -1) && isNullOrUndefined(tooltipElement)) {
|
|
16324
16632
|
var position = this.getMousePosition(pageX, pageY);
|
|
16325
16633
|
var map = this.maps;
|
|
16326
16634
|
var size = map.availableSize;
|
|
@@ -16493,8 +16801,9 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
16493
16801
|
*/
|
|
16494
16802
|
Zoom.prototype.click = function (e) {
|
|
16495
16803
|
var map = this.maps;
|
|
16804
|
+
var tooltipElement = e.target.closest('#' + this.maps.element.id + '_mapsTooltipparent_template');
|
|
16496
16805
|
if ((map.markerModule && map.markerModule.sameMarkerData.length > 0) ||
|
|
16497
|
-
(e.target['id'].indexOf('MarkerIndex') > -1 && e.target['id'].indexOf('cluster') === -1)) {
|
|
16806
|
+
(e.target['id'].indexOf('MarkerIndex') > -1 && e.target['id'].indexOf('cluster') === -1) || !isNullOrUndefined(tooltipElement)) {
|
|
16498
16807
|
return null;
|
|
16499
16808
|
}
|
|
16500
16809
|
if (this.isSingleClick && map.zoomSettings.zoomOnClick && !(e.target['id'].indexOf('_Zooming_') > -1) && !map.zoomSettings.doubleClickZoom
|
|
@@ -17075,5 +17384,5 @@ var PdfExport = /** @__PURE__ @class */ (function () {
|
|
|
17075
17384
|
* exporting all modules from maps index
|
|
17076
17385
|
*/
|
|
17077
17386
|
|
|
17078
|
-
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 };
|
|
17387
|
+
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 };
|
|
17079
17388
|
//# sourceMappingURL=ej2-maps.es5.js.map
|