@syncfusion/ej2-maps 19.4.55 → 19.4.56-105067
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.json +18 -3
- package/.github/PULL_REQUEST_TEMPLATE/Bug.md +72 -72
- package/.github/PULL_REQUEST_TEMPLATE/Feature.md +49 -49
- package/CHANGELOG.md +441 -430
- package/README.md +73 -73
- package/dist/ej2-maps.umd.min.js +1 -10
- package/dist/ej2-maps.umd.min.js.map +1 -1
- package/dist/es6/ej2-maps.es2015.js +1205 -644
- package/dist/es6/ej2-maps.es2015.js.map +1 -1
- package/dist/es6/ej2-maps.es5.js +1243 -683
- package/dist/es6/ej2-maps.es5.js.map +1 -1
- package/dist/global/ej2-maps.min.js +1 -10
- package/dist/global/ej2-maps.min.js.map +1 -1
- package/dist/global/index.d.ts +0 -9
- package/dist/ts/maps/layers/bing-map.ts +50 -0
- package/dist/ts/maps/layers/bubble.ts +290 -0
- package/dist/ts/maps/layers/color-mapping.ts +226 -0
- package/dist/ts/maps/layers/data-label.ts +418 -0
- package/dist/ts/maps/layers/layer-panel.ts +1480 -0
- package/dist/ts/maps/layers/legend.ts +2236 -0
- package/dist/ts/maps/layers/marker.ts +453 -0
- package/dist/ts/maps/layers/navigation-selected-line.ts +167 -0
- package/dist/ts/maps/maps.ts +2886 -0
- package/dist/ts/maps/model/base.ts +1843 -0
- package/dist/ts/maps/model/constants.ts +200 -0
- package/dist/ts/maps/model/export-image.ts +178 -0
- package/dist/ts/maps/model/export-pdf.ts +170 -0
- package/dist/ts/maps/model/interface.ts +823 -0
- package/dist/ts/maps/model/print.ts +104 -0
- package/dist/ts/maps/model/theme.ts +554 -0
- package/dist/ts/maps/user-interaction/annotation.ts +127 -0
- package/dist/ts/maps/user-interaction/highlight.ts +233 -0
- package/dist/ts/maps/user-interaction/selection.ts +321 -0
- package/dist/ts/maps/user-interaction/tooltip.ts +387 -0
- package/dist/ts/maps/user-interaction/zoom.ts +1767 -0
- package/dist/ts/maps/utils/enum.ts +368 -0
- package/dist/ts/maps/utils/helper.ts +3421 -0
- package/helper/e2e/index.js +3 -3
- package/helper/e2e/maps-helper.js +13 -13
- package/license +9 -9
- package/package.json +85 -85
- package/src/maps/layers/bing-map.d.ts +4 -0
- package/src/maps/layers/bing-map.js +16 -3
- package/src/maps/layers/bubble.d.ts +1 -2
- package/src/maps/layers/bubble.js +7 -12
- package/src/maps/layers/data-label.d.ts +1 -4
- package/src/maps/layers/data-label.js +32 -35
- package/src/maps/layers/layer-panel.d.ts +18 -1
- package/src/maps/layers/layer-panel.js +226 -72
- package/src/maps/layers/legend.d.ts +5 -2
- package/src/maps/layers/legend.js +170 -61
- package/src/maps/layers/marker.d.ts +2 -4
- package/src/maps/layers/marker.js +49 -48
- package/src/maps/layers/navigation-selected-line.d.ts +1 -2
- package/src/maps/layers/navigation-selected-line.js +7 -13
- package/src/maps/maps-model.d.ts +259 -251
- package/src/maps/maps.d.ts +24 -3
- package/src/maps/maps.js +164 -97
- package/src/maps/model/base-model.d.ts +1025 -1021
- package/src/maps/model/base.d.ts +5 -1
- package/src/maps/model/base.js +24 -24
- package/src/maps/model/constants.d.ts +6 -0
- package/src/maps/model/constants.js +6 -0
- package/src/maps/model/export-image.d.ts +2 -4
- package/src/maps/model/export-image.js +34 -33
- package/src/maps/model/export-pdf.d.ts +4 -6
- package/src/maps/model/export-pdf.js +31 -32
- package/src/maps/model/interface.d.ts +34 -26
- package/src/maps/model/print.d.ts +2 -5
- package/src/maps/model/print.js +32 -18
- package/src/maps/model/theme.js +7 -4
- package/src/maps/user-interaction/annotation.d.ts +1 -2
- package/src/maps/user-interaction/annotation.js +3 -4
- package/src/maps/user-interaction/highlight.d.ts +1 -2
- package/src/maps/user-interaction/highlight.js +11 -10
- package/src/maps/user-interaction/selection.d.ts +1 -2
- package/src/maps/user-interaction/selection.js +42 -19
- package/src/maps/user-interaction/tooltip.d.ts +3 -5
- package/src/maps/user-interaction/tooltip.js +27 -14
- package/src/maps/user-interaction/zoom.d.ts +3 -8
- package/src/maps/user-interaction/zoom.js +282 -162
- package/src/maps/utils/enum.d.ts +5 -1
- package/src/maps/utils/helper.d.ts +9 -1
- package/src/maps/utils/helper.js +82 -33
|
@@ -56,8 +56,7 @@ var LayerPanel = /** @class */ (function () {
|
|
|
56
56
|
else {
|
|
57
57
|
this.clipRectElement = this.mapObject.renderer.drawClipPath(new RectOption(this.mapObject.element.id + '_MapArea_ClipRect', 'transparent', { width: 1, color: 'Gray' }, 1, {
|
|
58
58
|
x: this.mapObject.isTileMap ? 0 : areaRect.x, y: this.mapObject.isTileMap ? 0 : areaRect.y,
|
|
59
|
-
width: areaRect.width, height:
|
|
60
|
-
this.mapObject.legendModule.totalPages.length > 0 ? this.mapObject.legendModule.legendTotalRect.height : areaRect.height
|
|
59
|
+
width: areaRect.width, height: areaRect.height
|
|
61
60
|
}));
|
|
62
61
|
}
|
|
63
62
|
this.layerGroup.appendChild(this.clipRectElement);
|
|
@@ -68,6 +67,14 @@ var LayerPanel = /** @class */ (function () {
|
|
|
68
67
|
_this.currentLayer = layer;
|
|
69
68
|
_this.processLayers(layer, index);
|
|
70
69
|
});
|
|
70
|
+
if (!isNullOrUndefined(this.mapObject.legendModule) && this.mapObject.legendSettings.position === 'Float') {
|
|
71
|
+
if (this.mapObject.isTileMap) {
|
|
72
|
+
this.layerGroup.appendChild(this.mapObject.legendModule.legendGroup);
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
this.mapObject.svgObject.appendChild(this.mapObject.legendModule.legendGroup);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
71
78
|
};
|
|
72
79
|
/**
|
|
73
80
|
* Tile rendering
|
|
@@ -195,7 +202,7 @@ var LayerPanel = /** @class */ (function () {
|
|
|
195
202
|
panel.layerObject.appendChild(panel.mapObject.navigationLineModule.renderNavigation(panel.currentLayer, panel.mapObject.tileZoomLevel, layerIndex));
|
|
196
203
|
}
|
|
197
204
|
if (panel.mapObject.markerModule) {
|
|
198
|
-
panel.mapObject.markerModule.markerRender(panel.layerObject, layerIndex, panel.mapObject.tileZoomLevel, null);
|
|
205
|
+
panel.mapObject.markerModule.markerRender(this.mapObject, panel.layerObject, layerIndex, panel.mapObject.tileZoomLevel, null);
|
|
199
206
|
}
|
|
200
207
|
panel.translateLayerElements(panel.layerObject, layerIndex);
|
|
201
208
|
panel.layerGroup.appendChild(panel.layerObject);
|
|
@@ -227,9 +234,21 @@ var LayerPanel = /** @class */ (function () {
|
|
|
227
234
|
};
|
|
228
235
|
this.mapObject.trigger('layerRendering', eventArgs, function (observedArgs) {
|
|
229
236
|
if (!eventArgs.cancel && eventArgs.visible) {
|
|
230
|
-
if (layer.layerType
|
|
237
|
+
if (layer.layerType === 'OSM') {
|
|
238
|
+
layer.urlTemplate = 'https://a.tile.openstreetmap.org/level/tileX/tileY.png';
|
|
239
|
+
}
|
|
240
|
+
if (layer.layerType === 'Google') {
|
|
241
|
+
layer.urlTemplate = 'https://mt1.google.com/vt/lyrs=m@129&hl=en&x=tileX&y=tileY&z=level';
|
|
242
|
+
}
|
|
243
|
+
if (layer.layerType !== 'Geometry' || (isNullOrUndefined(layer.shapeData) && !isNullOrUndefined(layer.urlTemplate) && layer.urlTemplate !== '')) {
|
|
231
244
|
if (layer.layerType !== 'Bing' || _this.bing) {
|
|
232
|
-
|
|
245
|
+
if (!isNullOrUndefined(layer.urlTemplate) && layer.urlTemplate.indexOf('quadkey') > -1) {
|
|
246
|
+
var bing = new BingMap(_this.mapObject);
|
|
247
|
+
_this.bingMapCalculation(layer, layerIndex, _this, bing);
|
|
248
|
+
}
|
|
249
|
+
else {
|
|
250
|
+
_this.renderTileLayer(_this, layer, layerIndex);
|
|
251
|
+
}
|
|
233
252
|
}
|
|
234
253
|
else if (layer.key && layer.key.length > 1) {
|
|
235
254
|
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
@@ -262,7 +281,7 @@ var LayerPanel = /** @class */ (function () {
|
|
|
262
281
|
proxy_1.renderTileLayer(proxy_1, layer, layerIndex, bing_1);
|
|
263
282
|
_this.mapObject.arrangeTemplate();
|
|
264
283
|
if (_this.mapObject.zoomModule && (_this.mapObject.previousScale !== _this.mapObject.scale)) {
|
|
265
|
-
_this.mapObject.zoomModule.applyTransform(true);
|
|
284
|
+
_this.mapObject.zoomModule.applyTransform(_this.mapObject, true);
|
|
266
285
|
}
|
|
267
286
|
};
|
|
268
287
|
ajax.send();
|
|
@@ -298,6 +317,17 @@ var LayerPanel = /** @class */ (function () {
|
|
|
298
317
|
this.mapObject.baseMapBounds = null;
|
|
299
318
|
}
|
|
300
319
|
};
|
|
320
|
+
LayerPanel.prototype.bingMapCalculation = function (layer, layerIndex, proxy, bing) {
|
|
321
|
+
bing.imageUrl = layer.urlTemplate;
|
|
322
|
+
bing.subDomains = ['t0', 't1', 't2', 't3'];
|
|
323
|
+
bing.maxZoom = '21';
|
|
324
|
+
proxy.mapObject['bingMap'] = bing;
|
|
325
|
+
proxy.renderTileLayer(proxy, layer, layerIndex, bing);
|
|
326
|
+
this.mapObject.arrangeTemplate();
|
|
327
|
+
if (this.mapObject.zoomModule && (this.mapObject.previousScale !== this.mapObject.scale)) {
|
|
328
|
+
this.mapObject.zoomModule.applyTransform(this.mapObject, true);
|
|
329
|
+
}
|
|
330
|
+
};
|
|
301
331
|
LayerPanel.prototype.bubbleCalculation = function (bubbleSettings, range) {
|
|
302
332
|
if (bubbleSettings.dataSource != null && bubbleSettings != null) {
|
|
303
333
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -493,60 +523,66 @@ var LayerPanel = /** @class */ (function () {
|
|
|
493
523
|
}
|
|
494
524
|
break;
|
|
495
525
|
case 'LineString':
|
|
496
|
-
path += 'M ' + (currentShapeData[0]['point']['x']) + ' ' + (currentShapeData[0]['point']['y']);
|
|
497
526
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
498
|
-
currentShapeData.map(function (lineData) {
|
|
499
|
-
|
|
527
|
+
currentShapeData.map(function (lineData, index) {
|
|
528
|
+
if (index === 0) {
|
|
529
|
+
path += 'M ' + (lineData['point']['x']) + ' ' + (lineData['point']['y']);
|
|
530
|
+
}
|
|
531
|
+
else {
|
|
532
|
+
path += 'L' + (lineData['point']['x']) + ' , ' + (lineData['point']['y']) + ' ';
|
|
533
|
+
}
|
|
534
|
+
});
|
|
535
|
+
if (path.length > 3) {
|
|
536
|
+
pathOptions = new PathOption(shapeID, 'transparent', !isNullOrUndefined(eventArgs.border.width) ? eventArgs.border.width : 1, !isNullOrUndefined(eventArgs.fill) ? eventArgs.fill :
|
|
537
|
+
eventArgs.border.color, opacity, eventArgs.border.opacity, shapeSettings.dashArray, path);
|
|
538
|
+
pathEle = _this.mapObject.renderer.drawPath(pathOptions);
|
|
539
|
+
}
|
|
540
|
+
break;
|
|
541
|
+
case 'MultiLineString':
|
|
542
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
543
|
+
currentShapeData.map(function (multilineData) {
|
|
544
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
545
|
+
multilineData.map(function (lineData, index) {
|
|
546
|
+
if (index === 0) {
|
|
547
|
+
path += 'M ' + (lineData['point']['x']) + ' ' + (lineData['point']['y']);
|
|
548
|
+
}
|
|
549
|
+
else {
|
|
550
|
+
path += 'L' + (lineData['point']['x']) + ' , ' + (lineData['point']['y']) + ' ';
|
|
551
|
+
}
|
|
552
|
+
});
|
|
500
553
|
});
|
|
501
554
|
if (path.length > 3) {
|
|
502
|
-
pathOptions = new PathOption(shapeID, 'transparent', !isNullOrUndefined(eventArgs.border.width) ? eventArgs.border.width : 1, eventArgs.
|
|
555
|
+
pathOptions = new PathOption(shapeID, 'transparent', !isNullOrUndefined(eventArgs.border.width) ? eventArgs.border.width : 1, !isNullOrUndefined(eventArgs.fill) ? eventArgs.fill :
|
|
556
|
+
eventArgs.border.color, opacity, eventArgs.border.opacity, shapeSettings.dashArray, path);
|
|
503
557
|
pathEle = _this.mapObject.renderer.drawPath(pathOptions);
|
|
504
558
|
}
|
|
505
559
|
break;
|
|
506
560
|
case 'Point':
|
|
507
561
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
508
562
|
var pointData = currentShapeData['point'];
|
|
509
|
-
var circleRadius = (_this.mapObject.layers[layerIndex].type !== 'SubLayer') ? shapeSettings.circleRadius : shapeSettings.circleRadius / _this.currentFactor;
|
|
510
|
-
circleOptions = new CircleOption(shapeID, eventArgs.fill, eventArgs.border, opacity, pointData['x'], pointData['y'], circleRadius,
|
|
563
|
+
var circleRadius = (_this.mapObject.layers[layerIndex].type !== 'SubLayer') ? shapeSettings.circleRadius : shapeSettings.circleRadius / (_this.mapObject.isTileMap ? _this.mapObject.scale : _this.currentFactor);
|
|
564
|
+
circleOptions = new CircleOption(shapeID, eventArgs.fill, eventArgs.border, opacity, pointData['x'], pointData['y'], circleRadius, shapeSettings.dashArray);
|
|
511
565
|
pathEle = _this.mapObject.renderer.drawCircle(circleOptions);
|
|
512
566
|
break;
|
|
567
|
+
case 'MultiPoint':
|
|
568
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
569
|
+
currentShapeData.map(function (multiPointData, index) {
|
|
570
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
571
|
+
var pointData = multiPointData['point'];
|
|
572
|
+
var circleRadius = (_this.mapObject.layers[layerIndex].type !== 'SubLayer') ? shapeSettings.circleRadius : shapeSettings.circleRadius / (_this.mapObject.isTileMap ? _this.mapObject.scale : _this.currentFactor);
|
|
573
|
+
circleOptions = new CircleOption((shapeID + "_multiLine_" + index), eventArgs.fill, eventArgs.border, opacity, pointData['x'], pointData['y'], circleRadius, shapeSettings.dashArray);
|
|
574
|
+
pathEle = _this.mapObject.renderer.drawCircle(circleOptions);
|
|
575
|
+
_this.pathAttributeCalculate(groupElement, pathEle, drawingType, currentShapeData, i);
|
|
576
|
+
});
|
|
577
|
+
break;
|
|
513
578
|
case 'Path':
|
|
514
579
|
path = currentShapeData['point'];
|
|
515
580
|
pathOptions = new PathOption(shapeID, eventArgs.fill, eventArgs.border.width, eventArgs.border.color, opacity, eventArgs.border.opacity, shapeSettings.dashArray, path);
|
|
516
581
|
pathEle = _this.mapObject.renderer.drawPath(pathOptions);
|
|
517
582
|
break;
|
|
518
583
|
}
|
|
519
|
-
if (!isNullOrUndefined(pathEle)) {
|
|
520
|
-
|
|
521
|
-
_this.currentLayer.shapePropertyPath : [_this.currentLayer.shapePropertyPath]);
|
|
522
|
-
var properties = void 0;
|
|
523
|
-
for (var j = 0; j < property.length; j++) {
|
|
524
|
-
if (!isNullOrUndefined(currentShapeData['property'])) {
|
|
525
|
-
properties = property[j];
|
|
526
|
-
break;
|
|
527
|
-
}
|
|
528
|
-
}
|
|
529
|
-
pathEle.setAttribute('aria-label', ((!isNullOrUndefined(currentShapeData['property'])) ?
|
|
530
|
-
(currentShapeData['property'][properties]) : ''));
|
|
531
|
-
pathEle.setAttribute('tabindex', (_this.mapObject.tabIndex + i + 3).toString());
|
|
532
|
-
if (drawingType === 'LineString') {
|
|
533
|
-
pathEle.setAttribute('style', 'outline:none');
|
|
534
|
-
}
|
|
535
|
-
maintainSelection(_this.mapObject.selectedElementId, _this.mapObject.shapeSelectionClass, pathEle, 'ShapeselectionMapStyle');
|
|
536
|
-
if (_this.mapObject.toggledShapeElementId) {
|
|
537
|
-
for (var j = 0; j < _this.mapObject.toggledShapeElementId.length; j++) {
|
|
538
|
-
var styleProperty = _this.mapObject.legendSettings.toggleLegendSettings.applyShapeSettings ?
|
|
539
|
-
_this.currentLayer.shapeSettings : _this.mapObject.legendSettings.toggleLegendSettings;
|
|
540
|
-
if (_this.mapObject.toggledShapeElementId[j] === pathEle.id) {
|
|
541
|
-
pathEle.setAttribute('fill', styleProperty.fill);
|
|
542
|
-
pathEle.setAttribute('stroke', styleProperty.border.color);
|
|
543
|
-
pathEle.setAttribute('fill-opacity', (styleProperty.opacity).toString());
|
|
544
|
-
pathEle.setAttribute('stroke-opacity', (isNullOrUndefined(styleProperty.border.opacity) ? styleProperty.opacity : styleProperty.border.opacity).toString());
|
|
545
|
-
pathEle.setAttribute('stroke-width', (styleProperty.border.width).toString());
|
|
546
|
-
}
|
|
547
|
-
}
|
|
548
|
-
}
|
|
549
|
-
groupElement.appendChild(pathEle);
|
|
584
|
+
if (!isNullOrUndefined(pathEle) && drawingType !== 'MultiPoint') {
|
|
585
|
+
_this.pathAttributeCalculate(groupElement, pathEle, drawingType, currentShapeData, i);
|
|
550
586
|
}
|
|
551
587
|
if (i === _this.currentLayer.layerData.length - 1) {
|
|
552
588
|
_this.layerFeatures(layerIndex, colors, renderData, labelTemplateEle);
|
|
@@ -564,6 +600,50 @@ var LayerPanel = /** @class */ (function () {
|
|
|
564
600
|
this.layerFeatures(layerIndex, colors, renderData, labelTemplateEle);
|
|
565
601
|
}
|
|
566
602
|
};
|
|
603
|
+
/**
|
|
604
|
+
* layer features as bubble, marker, datalabel, navigation line.
|
|
605
|
+
*
|
|
606
|
+
* @param {groupElement} Element - Specifies the element to append the group
|
|
607
|
+
* @param {pathEle} Element - Specifies the svg element
|
|
608
|
+
* @param {drawingType} string - Specifies the data type
|
|
609
|
+
* @param {currentShapeData} any - Specifies the layer of shapedata.
|
|
610
|
+
* @param {index} number - Specifies the tab index.
|
|
611
|
+
* @returns {void}
|
|
612
|
+
*/
|
|
613
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
614
|
+
LayerPanel.prototype.pathAttributeCalculate = function (groupElement, pathEle, drawingType, currentShapeData, index) {
|
|
615
|
+
var property = (Object.prototype.toString.call(this.currentLayer.shapePropertyPath) === '[object Array]' ?
|
|
616
|
+
this.currentLayer.shapePropertyPath : [this.currentLayer.shapePropertyPath]);
|
|
617
|
+
var properties;
|
|
618
|
+
for (var j = 0; j < property.length; j++) {
|
|
619
|
+
if (!isNullOrUndefined(currentShapeData['property'])) {
|
|
620
|
+
properties = property[j];
|
|
621
|
+
break;
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
pathEle.setAttribute('aria-label', ((!isNullOrUndefined(currentShapeData['property'])) ?
|
|
625
|
+
(currentShapeData['property'][properties]) : ''));
|
|
626
|
+
pathEle.setAttribute('tabindex', (this.mapObject.tabIndex + index + 3).toString());
|
|
627
|
+
pathEle.setAttribute('role', '');
|
|
628
|
+
if (drawingType === 'LineString' || drawingType === 'MultiLineString') {
|
|
629
|
+
pathEle.setAttribute('style', 'outline:none');
|
|
630
|
+
}
|
|
631
|
+
maintainSelection(this.mapObject.selectedElementId, this.mapObject.shapeSelectionClass, pathEle, 'ShapeselectionMapStyle');
|
|
632
|
+
if (this.mapObject.toggledShapeElementId) {
|
|
633
|
+
for (var j = 0; j < this.mapObject.toggledShapeElementId.length; j++) {
|
|
634
|
+
var styleProperty = this.mapObject.legendSettings.toggleLegendSettings.applyShapeSettings ?
|
|
635
|
+
this.currentLayer.shapeSettings : this.mapObject.legendSettings.toggleLegendSettings;
|
|
636
|
+
if (this.mapObject.toggledShapeElementId[j] === pathEle.id) {
|
|
637
|
+
pathEle.setAttribute('fill', styleProperty.fill);
|
|
638
|
+
pathEle.setAttribute('stroke', styleProperty.border.color);
|
|
639
|
+
pathEle.setAttribute('fill-opacity', (styleProperty.opacity).toString());
|
|
640
|
+
pathEle.setAttribute('stroke-opacity', (isNullOrUndefined(styleProperty.border.opacity) ? styleProperty.opacity : styleProperty.border.opacity).toString());
|
|
641
|
+
pathEle.setAttribute('stroke-width', (styleProperty.border.width).toString());
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
groupElement.appendChild(pathEle);
|
|
646
|
+
};
|
|
567
647
|
/**
|
|
568
648
|
* layer features as bubble, marker, datalabel, navigation line.
|
|
569
649
|
*
|
|
@@ -624,7 +704,7 @@ var LayerPanel = /** @class */ (function () {
|
|
|
624
704
|
_this.layerObject.appendChild(element);
|
|
625
705
|
});
|
|
626
706
|
if (this.mapObject.markerModule) {
|
|
627
|
-
this.mapObject.markerModule.markerRender(this.layerObject, layerIndex, (this.mapObject.isTileMap ? Math.floor(this.currentFactor)
|
|
707
|
+
this.mapObject.markerModule.markerRender(this.mapObject, this.layerObject, layerIndex, (this.mapObject.isTileMap ? Math.floor(this.currentFactor)
|
|
628
708
|
: this.currentFactor), null);
|
|
629
709
|
}
|
|
630
710
|
this.translateLayerElements(this.layerObject, layerIndex);
|
|
@@ -751,7 +831,8 @@ var LayerPanel = /** @class */ (function () {
|
|
|
751
831
|
break;
|
|
752
832
|
case 'linestring':
|
|
753
833
|
var extraSpace_1 = !isNullOrUndefined(this.currentLayer.shapeSettings.border.width) ?
|
|
754
|
-
this.currentLayer.shapeSettings.border.width
|
|
834
|
+
(typeof (this.currentLayer.shapeSettings.border.width) === 'string' ?
|
|
835
|
+
parseInt(this.currentLayer.shapeSettings.border.width, 10) : this.currentLayer.shapeSettings.border.width) : 1;
|
|
755
836
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
756
837
|
coordinates.map(function (points, index) {
|
|
757
838
|
latitude = points[1];
|
|
@@ -766,31 +847,61 @@ var LayerPanel = /** @class */ (function () {
|
|
|
766
847
|
newData['type'] = type;
|
|
767
848
|
this.currentLayer.layerData.push(newData);
|
|
768
849
|
break;
|
|
769
|
-
case '
|
|
770
|
-
var
|
|
771
|
-
|
|
772
|
-
|
|
850
|
+
case 'multilinestring':
|
|
851
|
+
var extraSpaces_1 = !isNullOrUndefined(this.currentLayer.shapeSettings.border.width) ?
|
|
852
|
+
(typeof (this.currentLayer.shapeSettings.border.width) === 'string' ?
|
|
853
|
+
parseInt(this.currentLayer.shapeSettings.border.width, 10) : this.currentLayer.shapeSettings.border.width) : 1;
|
|
854
|
+
var multiLineData_1 = [];
|
|
773
855
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
774
|
-
coordinates.map(function (
|
|
775
|
-
|
|
856
|
+
coordinates.map(function (multiPoints) {
|
|
857
|
+
newData = [];
|
|
858
|
+
multiPoints.map(function (points) {
|
|
776
859
|
latitude = points[1];
|
|
777
860
|
longitude = points[0];
|
|
778
|
-
arrayCollections_1 = true;
|
|
779
861
|
var point = convertGeoToPoint(latitude, longitude, _this.currentFactor, _this.currentLayer, _this.mapObject);
|
|
780
|
-
_this.
|
|
781
|
-
|
|
862
|
+
_this.calculateBox(point, extraSpaces_1);
|
|
863
|
+
newData.push({
|
|
864
|
+
point: point, lat: latitude, lng: longitude
|
|
782
865
|
});
|
|
783
|
-
}
|
|
866
|
+
});
|
|
867
|
+
multiLineData_1.push(newData);
|
|
784
868
|
});
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
869
|
+
multiLineData_1['property'] = properties;
|
|
870
|
+
multiLineData_1['type'] = type;
|
|
871
|
+
this.currentLayer.layerData.push(multiLineData_1);
|
|
872
|
+
break;
|
|
873
|
+
case 'point':
|
|
874
|
+
var pointExtraSpace = (!isNullOrUndefined(this.currentLayer.shapeSettings.border.width) ?
|
|
875
|
+
(typeof (this.currentLayer.shapeSettings.border.width) === 'string' ?
|
|
876
|
+
parseInt(this.currentLayer.shapeSettings.border.width, 10) : this.currentLayer.shapeSettings.border.width) : 1) +
|
|
877
|
+
(this.currentLayer.shapeSettings.circleRadius * 2);
|
|
878
|
+
latitude = coordinates[1];
|
|
879
|
+
longitude = coordinates[0];
|
|
880
|
+
var point = convertGeoToPoint(latitude, longitude, this.currentFactor, this.currentLayer, this.mapObject);
|
|
881
|
+
this.calculateBox(point, pointExtraSpace);
|
|
882
|
+
this.currentLayer.layerData.push({
|
|
883
|
+
point: point, type: type, lat: latitude, lng: longitude, property: properties
|
|
884
|
+
});
|
|
885
|
+
break;
|
|
886
|
+
case 'multipoint': {
|
|
887
|
+
var extraSpace_2 = (!isNullOrUndefined(this.currentLayer.shapeSettings.border.width) ?
|
|
888
|
+
(typeof (this.currentLayer.shapeSettings.border.width) === 'string' ?
|
|
889
|
+
parseInt(this.currentLayer.shapeSettings.border.width, 10) : this.currentLayer.shapeSettings.border.width) : 1) +
|
|
890
|
+
(this.currentLayer.shapeSettings.circleRadius * 2);
|
|
891
|
+
newData = [];
|
|
892
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
893
|
+
coordinates.map(function (points) {
|
|
894
|
+
latitude = points[1];
|
|
895
|
+
longitude = points[0];
|
|
896
|
+
var point = convertGeoToPoint(latitude, longitude, _this.currentFactor, _this.currentLayer, _this.mapObject);
|
|
897
|
+
_this.calculateBox(point, extraSpace_2);
|
|
898
|
+
newData.push({
|
|
899
|
+
point: point, lat: latitude, lng: longitude
|
|
792
900
|
});
|
|
793
|
-
}
|
|
901
|
+
});
|
|
902
|
+
newData['property'] = properties;
|
|
903
|
+
newData['type'] = type;
|
|
904
|
+
this.currentLayer.layerData.push(newData);
|
|
794
905
|
break;
|
|
795
906
|
}
|
|
796
907
|
case 'path':
|
|
@@ -802,12 +913,12 @@ var LayerPanel = /** @class */ (function () {
|
|
|
802
913
|
};
|
|
803
914
|
LayerPanel.prototype.calculateBox = function (point, extraSpace) {
|
|
804
915
|
if (isNullOrUndefined(this.rectBounds)) {
|
|
805
|
-
this.rectBounds = { min: { x: point.x, y: point.y - extraSpace }, max: { x: point.x, y: point.y + extraSpace } };
|
|
916
|
+
this.rectBounds = { min: { x: point.x - extraSpace, y: point.y - extraSpace }, max: { x: point.x + extraSpace, y: point.y + extraSpace } };
|
|
806
917
|
}
|
|
807
918
|
else {
|
|
808
|
-
this.rectBounds['min']['x'] = Math.min(this.rectBounds['min']['x'], point.x);
|
|
919
|
+
this.rectBounds['min']['x'] = Math.min(this.rectBounds['min']['x'], point.x - extraSpace);
|
|
809
920
|
this.rectBounds['min']['y'] = Math.min(this.rectBounds['min']['y'], point.y - extraSpace);
|
|
810
|
-
this.rectBounds['max']['x'] = Math.max(this.rectBounds['max']['x'], point.x);
|
|
921
|
+
this.rectBounds['max']['x'] = Math.max(this.rectBounds['max']['x'], point.x + extraSpace);
|
|
811
922
|
this.rectBounds['max']['y'] = Math.max(this.rectBounds['max']['y'], point.y + extraSpace);
|
|
812
923
|
}
|
|
813
924
|
};
|
|
@@ -825,6 +936,10 @@ var LayerPanel = /** @class */ (function () {
|
|
|
825
936
|
var end = convertGeoToPoint(bounds.latitude.max, bounds.longitude.max, null, layer, this.mapObject);
|
|
826
937
|
mapHeight = end.y - start.y;
|
|
827
938
|
mapWidth = end.x - start.x;
|
|
939
|
+
if (mapHeight === 0 || mapWidth === 0) {
|
|
940
|
+
mapWidth = mapSize.width / 2;
|
|
941
|
+
mapHeight = mapSize.height;
|
|
942
|
+
}
|
|
828
943
|
}
|
|
829
944
|
else {
|
|
830
945
|
mapHeight = mapWidth = 500;
|
|
@@ -919,15 +1034,28 @@ var LayerPanel = /** @class */ (function () {
|
|
|
919
1034
|
_this.calculateRectBox(point[0]);
|
|
920
1035
|
});
|
|
921
1036
|
break;
|
|
1037
|
+
case 'multilinestring':
|
|
1038
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1039
|
+
coordinates.map(function (multiPoint, index) {
|
|
1040
|
+
multiPoint.map(function (point, index) {
|
|
1041
|
+
_this.calculateRectBox(point, 'multilinestring', index === 0 ? true : false);
|
|
1042
|
+
});
|
|
1043
|
+
});
|
|
1044
|
+
break;
|
|
922
1045
|
case 'linestring':
|
|
923
1046
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
924
1047
|
coordinates.map(function (point, index) {
|
|
925
|
-
_this.calculateRectBox(point, '
|
|
1048
|
+
_this.calculateRectBox(point, 'linestring', index === 0 ? true : false);
|
|
926
1049
|
});
|
|
927
1050
|
break;
|
|
928
1051
|
case 'point':
|
|
929
1052
|
_this.calculateRectBox(coordinates, 'point');
|
|
930
1053
|
break;
|
|
1054
|
+
case 'multipoint':
|
|
1055
|
+
coordinates.map(function (point, index) {
|
|
1056
|
+
_this.calculateRectBox(point, 'multipoint', index === 0 ? true : false);
|
|
1057
|
+
});
|
|
1058
|
+
break;
|
|
931
1059
|
}
|
|
932
1060
|
}
|
|
933
1061
|
});
|
|
@@ -966,7 +1094,7 @@ var LayerPanel = /** @class */ (function () {
|
|
|
966
1094
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
967
1095
|
LayerPanel.prototype.calculateRectBox = function (coordinates, type, isFirstItem) {
|
|
968
1096
|
var _this = this;
|
|
969
|
-
if (type !== '
|
|
1097
|
+
if ((type !== 'linestring' && type !== 'multilinestring') && (type !== 'point' && type !== 'multipoint')) {
|
|
970
1098
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
971
1099
|
Array.prototype.forEach.call(coordinates, function (currentCoords) {
|
|
972
1100
|
if (isNullOrUndefined(_this.mapObject.baseMapBounds)) {
|
|
@@ -1035,7 +1163,7 @@ var LayerPanel = /** @class */ (function () {
|
|
|
1035
1163
|
var tile = new Tile(tileI % ycount, j);
|
|
1036
1164
|
tile.left = x;
|
|
1037
1165
|
tile.top = y;
|
|
1038
|
-
if (baseLayer.layerType === 'Bing') {
|
|
1166
|
+
if (baseLayer.layerType === 'Bing' || (bing && !isNullOrUndefined(baseLayer.urlTemplate) && baseLayer.urlTemplate !== '')) {
|
|
1039
1167
|
var key = baseLayer.key;
|
|
1040
1168
|
tile.src = bing.getBingMap(tile, key, baseLayer.bingMapType, userLang, bing.imageUrl, bing.subDomains);
|
|
1041
1169
|
}
|
|
@@ -1064,11 +1192,13 @@ var LayerPanel = /** @class */ (function () {
|
|
|
1064
1192
|
if (!(layer.type === 'SubLayer' && layer.visible)) {
|
|
1065
1193
|
continue;
|
|
1066
1194
|
}
|
|
1067
|
-
if (layer.layerType
|
|
1195
|
+
if ((layer.layerType !== 'Geometry' && layer.layerType !== 'GoogleStaticMap') || (layer.layerType === 'Geometry' &&
|
|
1196
|
+
isNullOrUndefined(layer.shapeData) && !isNullOrUndefined(layer.urlTemplate) && layer.urlTemplate !== '')) {
|
|
1068
1197
|
for (var _b = 0, proxTiles_1 = proxTiles; _b < proxTiles_1.length; _b++) {
|
|
1069
1198
|
var baseTile = proxTiles_1[_b];
|
|
1070
1199
|
var subtile = extend({}, baseTile, {}, true);
|
|
1071
1200
|
if (layer.layerType === 'Bing') {
|
|
1201
|
+
bing = new BingMap(this.mapObject);
|
|
1072
1202
|
subtile.src = bing.getBingMap(subtile, layer.key, layer.bingMapType, userLang, bing.imageUrl, bing.subDomains);
|
|
1073
1203
|
}
|
|
1074
1204
|
else {
|
|
@@ -1114,7 +1244,7 @@ var LayerPanel = /** @class */ (function () {
|
|
|
1114
1244
|
else {
|
|
1115
1245
|
if (type !== 'Pan' && element1 && element) {
|
|
1116
1246
|
element1.appendChild(element.children[0]);
|
|
1117
|
-
if (!isNullOrUndefined(document.getElementById(_this.mapObject.element.id + '_animated_tiles'))) {
|
|
1247
|
+
if (!_this.mapObject.isAddLayer && !isNullOrUndefined(document.getElementById(_this.mapObject.element.id + '_animated_tiles'))) {
|
|
1118
1248
|
document.getElementById(_this.mapObject.element.id + '_animated_tiles').id =
|
|
1119
1249
|
_this.mapObject.element.id + '_animated_tiles_old';
|
|
1120
1250
|
}
|
|
@@ -1128,7 +1258,10 @@ var LayerPanel = /** @class */ (function () {
|
|
|
1128
1258
|
var id = 0;
|
|
1129
1259
|
var _loop_3 = function (tile) {
|
|
1130
1260
|
var imgElement = createElement('img');
|
|
1261
|
+
imgElement.setAttribute('height', '256px');
|
|
1262
|
+
imgElement.setAttribute('width', '256px');
|
|
1131
1263
|
imgElement.setAttribute('src', tile.src);
|
|
1264
|
+
imgElement.setAttribute('alt', _this.mapObject.getLocalizedLabel('ImageNotFound'));
|
|
1132
1265
|
var mapId = _this.mapObject.element.id;
|
|
1133
1266
|
imgElement.onload = function () {
|
|
1134
1267
|
if (document.getElementById(mapId + '_tile_' + id) && type === 'Pan') {
|
|
@@ -1240,7 +1373,7 @@ var LayerPanel = /** @class */ (function () {
|
|
|
1240
1373
|
'&zoom=' + zoom + '¢er=' + center + '&maptype=' + mapType + '&key=' + apikey;
|
|
1241
1374
|
document.getElementById(this.mapObject.element.id + '_tile_parent').innerHTML
|
|
1242
1375
|
= '<div id="' + this.mapObject.element.id + '_StaticGoogleMap"' + 'style="position:absolute; left:' + eleWidth + 'px; top:'
|
|
1243
|
-
+ eleHeight + 'px"><img src="' + staticMapString + '"></div>';
|
|
1376
|
+
+ eleHeight + 'px"><img src="' + staticMapString + '"' + 'alt="' + this.mapObject.getLocalizedLabel('ImageNotFound') + '"></div>';
|
|
1244
1377
|
};
|
|
1245
1378
|
/**
|
|
1246
1379
|
* To find the tile translate point
|
|
@@ -1298,6 +1431,27 @@ var LayerPanel = /** @class */ (function () {
|
|
|
1298
1431
|
this.mapObject.previousTileHeight = factorY;
|
|
1299
1432
|
return new Point(x, y);
|
|
1300
1433
|
};
|
|
1434
|
+
/**
|
|
1435
|
+
* @returns {void}
|
|
1436
|
+
* @private
|
|
1437
|
+
*/
|
|
1438
|
+
LayerPanel.prototype.destroy = function () {
|
|
1439
|
+
this.mapObject = null;
|
|
1440
|
+
this.groupElements = [];
|
|
1441
|
+
this.layerObject = null;
|
|
1442
|
+
this.currentLayer = null;
|
|
1443
|
+
this.rectBounds = null;
|
|
1444
|
+
this.tiles = [];
|
|
1445
|
+
this.clipRectElement = null;
|
|
1446
|
+
this.tileSvgObject = null;
|
|
1447
|
+
this.ajaxModule = null;
|
|
1448
|
+
this.ajaxResponse = [];
|
|
1449
|
+
this.layerGroup = null;
|
|
1450
|
+
if (!isNullOrUndefined(this.bing)) {
|
|
1451
|
+
this.bing.destroy();
|
|
1452
|
+
}
|
|
1453
|
+
this.bing = null;
|
|
1454
|
+
};
|
|
1301
1455
|
return LayerPanel;
|
|
1302
1456
|
}());
|
|
1303
1457
|
export { LayerPanel };
|
|
@@ -20,6 +20,10 @@ export declare class Legend {
|
|
|
20
20
|
* @private
|
|
21
21
|
*/
|
|
22
22
|
legendBorderRect: Rect;
|
|
23
|
+
/**
|
|
24
|
+
* @private
|
|
25
|
+
*/
|
|
26
|
+
initialMapAreaRect: Rect;
|
|
23
27
|
/**
|
|
24
28
|
* @private
|
|
25
29
|
*/
|
|
@@ -149,9 +153,8 @@ export declare class Legend {
|
|
|
149
153
|
/**
|
|
150
154
|
* To destroy the legend.
|
|
151
155
|
*
|
|
152
|
-
* @param {Maps} maps - Specifies the instance of the maps
|
|
153
156
|
* @returns {void}
|
|
154
157
|
* @private
|
|
155
158
|
*/
|
|
156
|
-
destroy(
|
|
159
|
+
destroy(): void;
|
|
157
160
|
}
|