@syncfusion/ej2-maps 20.1.59 → 20.2.43
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 +17 -39
- 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 +657 -292
- package/dist/es6/ej2-maps.es2015.js.map +1 -1
- package/dist/es6/ej2-maps.es5.js +651 -286
- 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 +12 -12
- package/src/maps/layers/bing-map.js +9 -3
- package/src/maps/layers/bubble.js +3 -7
- package/src/maps/layers/data-label.js +18 -19
- package/src/maps/layers/layer-panel.d.ts +13 -1
- package/src/maps/layers/layer-panel.js +199 -68
- package/src/maps/layers/legend.d.ts +4 -0
- package/src/maps/layers/legend.js +143 -55
- package/src/maps/layers/marker.js +4 -3
- package/src/maps/maps-model.d.ts +10 -2
- package/src/maps/maps.d.ts +22 -1
- package/src/maps/maps.js +106 -61
- package/src/maps/model/base-model.d.ts +5 -1
- package/src/maps/model/base.d.ts +5 -1
- package/src/maps/model/base.js +5 -5
- package/src/maps/model/constants.d.ts +6 -0
- package/src/maps/model/constants.js +6 -0
- package/src/maps/model/theme.js +3 -0
- package/src/maps/user-interaction/highlight.js +8 -5
- package/src/maps/user-interaction/selection.js +39 -14
- package/src/maps/user-interaction/tooltip.js +3 -3
- package/src/maps/user-interaction/zoom.d.ts +1 -1
- package/src/maps/user-interaction/zoom.js +88 -38
- package/src/maps/utils/helper.js +20 -7
|
@@ -735,6 +735,8 @@ function drawSymbols(shape, imageUrl, location, markerID, shapeCustom, markerCol
|
|
|
735
735
|
const opacity = shapeCustom['opacity'];
|
|
736
736
|
let rectOptions;
|
|
737
737
|
const pathOptions = new PathOption(markerID, fill, borderWidth, borderColor, opacity, borderOpacity, dashArray, '');
|
|
738
|
+
size.width = typeof (size.width) === 'string' ? parseInt(size.width, 10) : size.width;
|
|
739
|
+
size.height = typeof (size.height) === 'string' ? parseInt(size.height, 10) : size.height;
|
|
738
740
|
if (shape === 'Circle') {
|
|
739
741
|
const radius = (size.width + size.height) / 4;
|
|
740
742
|
const circleOptions = new CircleOption(markerID, fill, border, opacity, location.x, location.y, radius, dashArray);
|
|
@@ -952,8 +954,8 @@ function clusterTemplate(currentLayer, markerTemplate, maps, layerIndex, markerC
|
|
|
952
954
|
shapeCustom['borderWidth'] = eventArg.border.width;
|
|
953
955
|
shapeCustom['borderOpacity'] = isNullOrUndefined(eventArg.border.opacity) ? clusters.opacity : eventArg.border.opacity;
|
|
954
956
|
}
|
|
955
|
-
tempX = (maps.isTileMap) ? tempX : (markerTemplate.id.indexOf('_Markers_Group') > -1) ? tempX :
|
|
956
|
-
tempY = (maps.isTileMap) ? tempY : (markerTemplate.id.indexOf('_Markers_Group') > -1) ? tempY :
|
|
957
|
+
tempX = (maps.isTileMap) ? tempX : (markerTemplate.id.indexOf('_Markers_Group') > -1) ? tempX : tempX + postionY - (eventArg.width / 2);
|
|
958
|
+
tempY = (maps.isTileMap) ? tempY : (markerTemplate.id.indexOf('_Markers_Group') > -1) ? tempY : tempY - (eventArg.height / 2);
|
|
957
959
|
if (maps.isTileMap && !maps.zoomSettings.enable) {
|
|
958
960
|
tempX = location.x;
|
|
959
961
|
tempY = location.y;
|
|
@@ -1032,7 +1034,7 @@ function clusterTemplate(currentLayer, markerTemplate, maps, layerIndex, markerC
|
|
|
1032
1034
|
getElementByID(maps.element.id + '_Secondary_Element').appendChild(markerCollection);
|
|
1033
1035
|
layerElement.appendChild(markerCollection);
|
|
1034
1036
|
}
|
|
1035
|
-
const markerCluster = document.getElementById(maps.element.id + '
|
|
1037
|
+
const markerCluster = document.getElementById(maps.element.id + '_LayerIndex_' + layerIndex + '_markerCluster');
|
|
1036
1038
|
if (!isNullOrUndefined(markerCluster)) {
|
|
1037
1039
|
markerCluster.remove();
|
|
1038
1040
|
}
|
|
@@ -1966,6 +1968,10 @@ function getTranslate(mapObject, layer, animate) {
|
|
|
1966
1968
|
}
|
|
1967
1969
|
else {
|
|
1968
1970
|
if (isNullOrUndefined(mapObject.previousProjection) || mapObject.previousProjection !== mapObject.projectionType) {
|
|
1971
|
+
if (mapHeight === 0 || mapWidth === 0 || mapHeight === mapWidth) {
|
|
1972
|
+
mapWidth = size.width / 2;
|
|
1973
|
+
mapHeight = size.height;
|
|
1974
|
+
}
|
|
1969
1975
|
scaleFactor = parseFloat(Math.min(size.width / mapWidth, size.height / mapHeight).toFixed(2));
|
|
1970
1976
|
mapWidth *= scaleFactor;
|
|
1971
1977
|
mapHeight *= scaleFactor;
|
|
@@ -2015,7 +2021,7 @@ function getTranslate(mapObject, layer, animate) {
|
|
|
2015
2021
|
mapObject.zoomTranslatePoint.y = y;
|
|
2016
2022
|
}
|
|
2017
2023
|
else {
|
|
2018
|
-
if (!isNullOrUndefined(mapObject.previousProjection) && mapObject.mapScaleValue === 1 && !mapObject.zoomModule.isDragZoom) {
|
|
2024
|
+
if (!isNullOrUndefined(mapObject.previousProjection) && (mapObject.mapScaleValue === 1 || mapObject.mapScaleValue <= 1.05) && !mapObject.zoomModule.isDragZoom) {
|
|
2019
2025
|
scaleFactor = parseFloat(Math.min(size.width / mapWidth, size.height / mapHeight).toFixed(2));
|
|
2020
2026
|
mapWidth *= scaleFactor;
|
|
2021
2027
|
x = size.x + ((-(min['x'])) + ((size.width / 2) - (mapWidth / 2)));
|
|
@@ -2173,6 +2179,8 @@ function getZoomTranslate(mapObject, layer, animate) {
|
|
|
2173
2179
|
}
|
|
2174
2180
|
}
|
|
2175
2181
|
scaleFactor = (mapObject.enablePersistence) ? (mapObject.mapScaleValue === 0 ? 1 : mapObject.mapScaleValue) : scaleFactor;
|
|
2182
|
+
mapObject.widthBeforeRefresh = mapObject.availableSize.width;
|
|
2183
|
+
mapObject.heightBeforeRefresh = mapObject.availableSize.height;
|
|
2176
2184
|
return { scale: animate ? 1 : scaleFactor, location: new Point(x, y) };
|
|
2177
2185
|
}
|
|
2178
2186
|
/**
|
|
@@ -2838,6 +2846,7 @@ function changeBorderWidth(element, index, scale, maps) {
|
|
|
2838
2846
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2839
2847
|
const borderWidthValue = maps.layersCollection[index].shapeSettings.borderWidthValuePath;
|
|
2840
2848
|
const borderWidth = maps.layersCollection[index].shapeSettings.border.width;
|
|
2849
|
+
const circleRadius = maps.layersCollection[index].shapeSettings.circleRadius;
|
|
2841
2850
|
if (maps.layersCollection[index].shapeSettings.borderWidthValuePath) {
|
|
2842
2851
|
value = checkShapeDataFields(
|
|
2843
2852
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -2858,8 +2867,8 @@ function changeBorderWidth(element, index, scale, maps) {
|
|
|
2858
2867
|
currentStroke = (isNullOrUndefined(borderWidth) ? 0 : borderWidth);
|
|
2859
2868
|
}
|
|
2860
2869
|
childNode.setAttribute('stroke-width', (currentStroke / scale).toString());
|
|
2861
|
-
if (element.id.indexOf('
|
|
2862
|
-
childNode.setAttribute('
|
|
2870
|
+
if (element.id.indexOf('_Point') > -1 || element.id.indexOf('_MultiPoint') > -1) {
|
|
2871
|
+
childNode.setAttribute('r', (circleRadius / scale).toString());
|
|
2863
2872
|
}
|
|
2864
2873
|
}
|
|
2865
2874
|
}
|
|
@@ -3052,7 +3061,11 @@ function animate(element, delay, duration, process, end) {
|
|
|
3052
3061
|
else {
|
|
3053
3062
|
window.cancelAnimationFrame(clearAnimation);
|
|
3054
3063
|
end.call(this, { element: element });
|
|
3055
|
-
element.
|
|
3064
|
+
if (element.id.indexOf('Marker') > -1) {
|
|
3065
|
+
console.log(element);
|
|
3066
|
+
let markerElement = getElementByID(element.id.split('_')[0] + '_Markers_Group');
|
|
3067
|
+
markerElement.setAttribute('style', markerStyle);
|
|
3068
|
+
}
|
|
3056
3069
|
}
|
|
3057
3070
|
};
|
|
3058
3071
|
clearAnimation = window.requestAnimationFrame(startAnimation);
|
|
@@ -3524,6 +3537,7 @@ function getThemeStyle(theme) {
|
|
|
3524
3537
|
backgroundColor: color,
|
|
3525
3538
|
areaBackgroundColor: color,
|
|
3526
3539
|
titleFontColor: '#FFFFFF',
|
|
3540
|
+
titleFontSize: '14px',
|
|
3527
3541
|
subTitleFontColor: '#FFFFFF',
|
|
3528
3542
|
legendTitleFontColor: '#DADADA',
|
|
3529
3543
|
legendTextColor: '#DADADA',
|
|
@@ -3543,6 +3557,7 @@ function getThemeStyle(theme) {
|
|
|
3543
3557
|
backgroundColor: '#000000',
|
|
3544
3558
|
areaBackgroundColor: '#000000',
|
|
3545
3559
|
titleFontColor: '#FFFFFF',
|
|
3560
|
+
titleFontSize: '14px',
|
|
3546
3561
|
subTitleFontColor: '#FFFFFF',
|
|
3547
3562
|
legendTitleFontColor: '#FFFFFF',
|
|
3548
3563
|
legendTextColor: '#FFFFFF',
|
|
@@ -3723,6 +3738,7 @@ function getThemeStyle(theme) {
|
|
|
3723
3738
|
backgroundColor: '#FFFFFF',
|
|
3724
3739
|
areaBackgroundColor: '#FFFFFF',
|
|
3725
3740
|
titleFontColor: '#424242',
|
|
3741
|
+
titleFontSize: '14px',
|
|
3726
3742
|
subTitleFontColor: '#424242',
|
|
3727
3743
|
legendTitleFontColor: '#757575',
|
|
3728
3744
|
legendTextColor: '#757575',
|
|
@@ -4141,7 +4157,7 @@ __decorate$1([
|
|
|
4141
4157
|
class SubTitleSettings extends CommonTitleSettings {
|
|
4142
4158
|
}
|
|
4143
4159
|
__decorate$1([
|
|
4144
|
-
Complex({ size:
|
|
4160
|
+
Complex({ size: null, fontWeight: null, fontFamily: null }, Font)
|
|
4145
4161
|
], SubTitleSettings.prototype, "textStyle", void 0);
|
|
4146
4162
|
__decorate$1([
|
|
4147
4163
|
Property('Center')
|
|
@@ -4152,7 +4168,7 @@ __decorate$1([
|
|
|
4152
4168
|
class TitleSettings extends CommonTitleSettings {
|
|
4153
4169
|
}
|
|
4154
4170
|
__decorate$1([
|
|
4155
|
-
Complex({ size:
|
|
4171
|
+
Complex({ size: null, fontWeight: null, fontFamily: null }, Font)
|
|
4156
4172
|
], TitleSettings.prototype, "textStyle", void 0);
|
|
4157
4173
|
__decorate$1([
|
|
4158
4174
|
Property('Center')
|
|
@@ -4281,7 +4297,7 @@ __decorate$1([
|
|
|
4281
4297
|
Property('')
|
|
4282
4298
|
], LegendSettings.prototype, "height", void 0);
|
|
4283
4299
|
__decorate$1([
|
|
4284
|
-
Complex({}, Font)
|
|
4300
|
+
Complex({ fontFamily: null }, Font)
|
|
4285
4301
|
], LegendSettings.prototype, "textStyle", void 0);
|
|
4286
4302
|
__decorate$1([
|
|
4287
4303
|
Property(15)
|
|
@@ -4302,7 +4318,7 @@ __decorate$1([
|
|
|
4302
4318
|
Complex({}, CommonTitleSettings)
|
|
4303
4319
|
], LegendSettings.prototype, "title", void 0);
|
|
4304
4320
|
__decorate$1([
|
|
4305
|
-
Complex(Theme.legendTitleFont, Font)
|
|
4321
|
+
Complex({ size: Theme.legendTitleFont.size, color: Theme.legendTitleFont.color, fontStyle: Theme.legendTitleFont.fontStyle, fontWeight: Theme.legendTitleFont.fontWeight, fontFamily: null }, Font)
|
|
4306
4322
|
], LegendSettings.prototype, "titleStyle", void 0);
|
|
4307
4323
|
__decorate$1([
|
|
4308
4324
|
Property('Bottom')
|
|
@@ -4545,7 +4561,7 @@ __decorate$1([
|
|
|
4545
4561
|
Property('Geometry')
|
|
4546
4562
|
], LayerSettings.prototype, "layerType", void 0);
|
|
4547
4563
|
__decorate$1([
|
|
4548
|
-
Property('
|
|
4564
|
+
Property('')
|
|
4549
4565
|
], LayerSettings.prototype, "urlTemplate", void 0);
|
|
4550
4566
|
__decorate$1([
|
|
4551
4567
|
Property(true)
|
|
@@ -4702,11 +4718,12 @@ class Marker {
|
|
|
4702
4718
|
if (currentLayer.markerClusterSettings.allowClustering) {
|
|
4703
4719
|
this.maps.svgObject.appendChild(this.markerSVGObject);
|
|
4704
4720
|
this.maps.element.appendChild(this.maps.svgObject);
|
|
4705
|
-
if (currentLayer.layerType
|
|
4706
|
-
|
|
4721
|
+
if ((currentLayer.layerType === 'OSM' || (currentLayer.urlTemplate.indexOf('openstreetmap') !== -1 && isNullOrUndefined(currentLayer.shapeData)))
|
|
4722
|
+
&& this.maps.zoomSettings.enable) {
|
|
4723
|
+
layerElement.appendChild(this.markerSVGObject);
|
|
4707
4724
|
}
|
|
4708
4725
|
else {
|
|
4709
|
-
|
|
4726
|
+
clusterTemplate(currentLayer, this.markerSVGObject, this.maps, layerIndex, this.markerSVGObject, layerElement, true, false);
|
|
4710
4727
|
}
|
|
4711
4728
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4712
4729
|
this.maps.renderReactTemplates();
|
|
@@ -5062,6 +5079,12 @@ const loaded = 'loaded';
|
|
|
5062
5079
|
* @private
|
|
5063
5080
|
*/
|
|
5064
5081
|
const click = 'click';
|
|
5082
|
+
/**
|
|
5083
|
+
* Specifies the maps onclick event name.
|
|
5084
|
+
*
|
|
5085
|
+
* @private
|
|
5086
|
+
*/
|
|
5087
|
+
const onclick = 'onclick';
|
|
5065
5088
|
/**
|
|
5066
5089
|
* Specifies the maps right click event name.
|
|
5067
5090
|
*
|
|
@@ -5256,9 +5279,14 @@ class BingMap {
|
|
|
5256
5279
|
}
|
|
5257
5280
|
quadKey = quadKey + '' + digit;
|
|
5258
5281
|
}
|
|
5259
|
-
|
|
5260
|
-
|
|
5261
|
-
|
|
5282
|
+
if (!isNullOrUndefined(subDomains)) {
|
|
5283
|
+
const subDomain = subDomains[Math.min(parseInt(quadKey.substr(quadKey.length - 1, 1), 10), subDomains.length)];
|
|
5284
|
+
imageUrl = imageUrl.replace('{quadkey}', quadKey).replace('{subdomain}', subDomain);
|
|
5285
|
+
return imageUrl += '&mkt=' + language + '&ur=IN&Key=' + key;
|
|
5286
|
+
}
|
|
5287
|
+
else {
|
|
5288
|
+
return '';
|
|
5289
|
+
}
|
|
5262
5290
|
}
|
|
5263
5291
|
}
|
|
5264
5292
|
|
|
@@ -5527,8 +5555,7 @@ class LayerPanel {
|
|
|
5527
5555
|
else {
|
|
5528
5556
|
this.clipRectElement = this.mapObject.renderer.drawClipPath(new RectOption(this.mapObject.element.id + '_MapArea_ClipRect', 'transparent', { width: 1, color: 'Gray' }, 1, {
|
|
5529
5557
|
x: this.mapObject.isTileMap ? 0 : areaRect.x, y: this.mapObject.isTileMap ? 0 : areaRect.y,
|
|
5530
|
-
width: areaRect.width, height:
|
|
5531
|
-
this.mapObject.legendModule.totalPages.length > 0 ? this.mapObject.legendModule.legendTotalRect.height : areaRect.height
|
|
5558
|
+
width: areaRect.width, height: areaRect.height
|
|
5532
5559
|
}));
|
|
5533
5560
|
}
|
|
5534
5561
|
this.layerGroup.appendChild(this.clipRectElement);
|
|
@@ -5539,6 +5566,14 @@ class LayerPanel {
|
|
|
5539
5566
|
this.currentLayer = layer;
|
|
5540
5567
|
this.processLayers(layer, index);
|
|
5541
5568
|
});
|
|
5569
|
+
if (!isNullOrUndefined(this.mapObject.legendModule) && this.mapObject.legendSettings.position === 'Float') {
|
|
5570
|
+
if (this.mapObject.isTileMap) {
|
|
5571
|
+
this.layerGroup.appendChild(this.mapObject.legendModule.legendGroup);
|
|
5572
|
+
}
|
|
5573
|
+
else {
|
|
5574
|
+
this.mapObject.svgObject.appendChild(this.mapObject.legendModule.legendGroup);
|
|
5575
|
+
}
|
|
5576
|
+
}
|
|
5542
5577
|
}
|
|
5543
5578
|
/**
|
|
5544
5579
|
* Tile rendering
|
|
@@ -5697,9 +5732,21 @@ class LayerPanel {
|
|
|
5697
5732
|
};
|
|
5698
5733
|
this.mapObject.trigger('layerRendering', eventArgs, (observedArgs) => {
|
|
5699
5734
|
if (!eventArgs.cancel && eventArgs.visible) {
|
|
5700
|
-
if (layer.layerType
|
|
5735
|
+
if (layer.layerType === 'OSM') {
|
|
5736
|
+
layer.urlTemplate = 'https://a.tile.openstreetmap.org/level/tileX/tileY.png';
|
|
5737
|
+
}
|
|
5738
|
+
if (layer.layerType === 'Google') {
|
|
5739
|
+
layer.urlTemplate = 'https://mt1.google.com/vt/lyrs=m@129&hl=en&x=tileX&y=tileY&z=level';
|
|
5740
|
+
}
|
|
5741
|
+
if (layer.layerType !== 'Geometry' || (isNullOrUndefined(layer.shapeData) && !isNullOrUndefined(layer.urlTemplate) && layer.urlTemplate !== '')) {
|
|
5701
5742
|
if (layer.layerType !== 'Bing' || this.bing) {
|
|
5702
|
-
|
|
5743
|
+
if (!isNullOrUndefined(layer.urlTemplate) && layer.urlTemplate.indexOf('quadkey') > -1) {
|
|
5744
|
+
const bing = new BingMap(this.mapObject);
|
|
5745
|
+
this.bingMapCalculation(layer, layerIndex, this, bing);
|
|
5746
|
+
}
|
|
5747
|
+
else {
|
|
5748
|
+
this.renderTileLayer(this, layer, layerIndex);
|
|
5749
|
+
}
|
|
5703
5750
|
}
|
|
5704
5751
|
else if (layer.key && layer.key.length > 1) {
|
|
5705
5752
|
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
@@ -5768,6 +5815,17 @@ class LayerPanel {
|
|
|
5768
5815
|
this.mapObject.baseMapBounds = null;
|
|
5769
5816
|
}
|
|
5770
5817
|
}
|
|
5818
|
+
bingMapCalculation(layer, layerIndex, proxy, bing) {
|
|
5819
|
+
bing.imageUrl = layer.urlTemplate;
|
|
5820
|
+
bing.subDomains = ['t0', 't1', 't2', 't3'];
|
|
5821
|
+
bing.maxZoom = '21';
|
|
5822
|
+
proxy.mapObject['bingMap'] = bing;
|
|
5823
|
+
proxy.renderTileLayer(proxy, layer, layerIndex, bing);
|
|
5824
|
+
this.mapObject.arrangeTemplate();
|
|
5825
|
+
if (this.mapObject.zoomModule && (this.mapObject.previousScale !== this.mapObject.scale)) {
|
|
5826
|
+
this.mapObject.zoomModule.applyTransform(true);
|
|
5827
|
+
}
|
|
5828
|
+
}
|
|
5771
5829
|
bubbleCalculation(bubbleSettings, range) {
|
|
5772
5830
|
if (bubbleSettings.dataSource != null && bubbleSettings != null) {
|
|
5773
5831
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -5959,60 +6017,66 @@ class LayerPanel {
|
|
|
5959
6017
|
}
|
|
5960
6018
|
break;
|
|
5961
6019
|
case 'LineString':
|
|
5962
|
-
path += 'M ' + (currentShapeData[0]['point']['x']) + ' ' + (currentShapeData[0]['point']['y']);
|
|
5963
6020
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5964
|
-
currentShapeData.map((lineData) => {
|
|
5965
|
-
|
|
6021
|
+
currentShapeData.map((lineData, index) => {
|
|
6022
|
+
if (index === 0) {
|
|
6023
|
+
path += 'M ' + (lineData['point']['x']) + ' ' + (lineData['point']['y']);
|
|
6024
|
+
}
|
|
6025
|
+
else {
|
|
6026
|
+
path += 'L' + (lineData['point']['x']) + ' , ' + (lineData['point']['y']) + ' ';
|
|
6027
|
+
}
|
|
5966
6028
|
});
|
|
5967
6029
|
if (path.length > 3) {
|
|
5968
|
-
pathOptions = new PathOption(shapeID, 'transparent', !isNullOrUndefined(eventArgs.border.width) ? eventArgs.border.width : 1, eventArgs.
|
|
6030
|
+
pathOptions = new PathOption(shapeID, 'transparent', !isNullOrUndefined(eventArgs.border.width) ? eventArgs.border.width : 1, !isNullOrUndefined(eventArgs.fill) ? eventArgs.fill :
|
|
6031
|
+
eventArgs.border.color, opacity, eventArgs.border.opacity, shapeSettings.dashArray, path);
|
|
6032
|
+
pathEle = this.mapObject.renderer.drawPath(pathOptions);
|
|
6033
|
+
}
|
|
6034
|
+
break;
|
|
6035
|
+
case 'MultiLineString':
|
|
6036
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6037
|
+
currentShapeData.map((multilineData) => {
|
|
6038
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6039
|
+
multilineData.map((lineData, index) => {
|
|
6040
|
+
if (index === 0) {
|
|
6041
|
+
path += 'M ' + (lineData['point']['x']) + ' ' + (lineData['point']['y']);
|
|
6042
|
+
}
|
|
6043
|
+
else {
|
|
6044
|
+
path += 'L' + (lineData['point']['x']) + ' , ' + (lineData['point']['y']) + ' ';
|
|
6045
|
+
}
|
|
6046
|
+
});
|
|
6047
|
+
});
|
|
6048
|
+
if (path.length > 3) {
|
|
6049
|
+
pathOptions = new PathOption(shapeID, 'transparent', !isNullOrUndefined(eventArgs.border.width) ? eventArgs.border.width : 1, !isNullOrUndefined(eventArgs.fill) ? eventArgs.fill :
|
|
6050
|
+
eventArgs.border.color, opacity, eventArgs.border.opacity, shapeSettings.dashArray, path);
|
|
5969
6051
|
pathEle = this.mapObject.renderer.drawPath(pathOptions);
|
|
5970
6052
|
}
|
|
5971
6053
|
break;
|
|
5972
6054
|
case 'Point':
|
|
5973
6055
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5974
6056
|
const pointData = currentShapeData['point'];
|
|
5975
|
-
const circleRadius = (this.mapObject.layers[layerIndex].type !== 'SubLayer') ? shapeSettings.circleRadius : shapeSettings.circleRadius / this.currentFactor;
|
|
5976
|
-
circleOptions = new CircleOption(shapeID, eventArgs.fill, eventArgs.border, opacity, pointData['x'], pointData['y'], circleRadius,
|
|
6057
|
+
const circleRadius = (this.mapObject.layers[layerIndex].type !== 'SubLayer') ? shapeSettings.circleRadius : shapeSettings.circleRadius / (this.mapObject.isTileMap ? this.mapObject.scale : this.currentFactor);
|
|
6058
|
+
circleOptions = new CircleOption(shapeID, eventArgs.fill, eventArgs.border, opacity, pointData['x'], pointData['y'], circleRadius, shapeSettings.dashArray);
|
|
5977
6059
|
pathEle = this.mapObject.renderer.drawCircle(circleOptions);
|
|
5978
6060
|
break;
|
|
6061
|
+
case 'MultiPoint':
|
|
6062
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6063
|
+
currentShapeData.map((multiPointData, index) => {
|
|
6064
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6065
|
+
const pointData = multiPointData['point'];
|
|
6066
|
+
const circleRadius = (this.mapObject.layers[layerIndex].type !== 'SubLayer') ? shapeSettings.circleRadius : shapeSettings.circleRadius / (this.mapObject.isTileMap ? this.mapObject.scale : this.currentFactor);
|
|
6067
|
+
circleOptions = new CircleOption((shapeID + "_multiLine_" + index), eventArgs.fill, eventArgs.border, opacity, pointData['x'], pointData['y'], circleRadius, shapeSettings.dashArray);
|
|
6068
|
+
pathEle = this.mapObject.renderer.drawCircle(circleOptions);
|
|
6069
|
+
this.pathAttributeCalculate(groupElement, pathEle, drawingType, currentShapeData, i);
|
|
6070
|
+
});
|
|
6071
|
+
break;
|
|
5979
6072
|
case 'Path':
|
|
5980
6073
|
path = currentShapeData['point'];
|
|
5981
6074
|
pathOptions = new PathOption(shapeID, eventArgs.fill, eventArgs.border.width, eventArgs.border.color, opacity, eventArgs.border.opacity, shapeSettings.dashArray, path);
|
|
5982
6075
|
pathEle = this.mapObject.renderer.drawPath(pathOptions);
|
|
5983
6076
|
break;
|
|
5984
6077
|
}
|
|
5985
|
-
if (!isNullOrUndefined(pathEle)) {
|
|
5986
|
-
|
|
5987
|
-
this.currentLayer.shapePropertyPath : [this.currentLayer.shapePropertyPath]);
|
|
5988
|
-
let properties;
|
|
5989
|
-
for (let j = 0; j < property.length; j++) {
|
|
5990
|
-
if (!isNullOrUndefined(currentShapeData['property'])) {
|
|
5991
|
-
properties = property[j];
|
|
5992
|
-
break;
|
|
5993
|
-
}
|
|
5994
|
-
}
|
|
5995
|
-
pathEle.setAttribute('aria-label', ((!isNullOrUndefined(currentShapeData['property'])) ?
|
|
5996
|
-
(currentShapeData['property'][properties]) : ''));
|
|
5997
|
-
pathEle.setAttribute('tabindex', (this.mapObject.tabIndex + i + 3).toString());
|
|
5998
|
-
if (drawingType === 'LineString') {
|
|
5999
|
-
pathEle.setAttribute('style', 'outline:none');
|
|
6000
|
-
}
|
|
6001
|
-
maintainSelection(this.mapObject.selectedElementId, this.mapObject.shapeSelectionClass, pathEle, 'ShapeselectionMapStyle');
|
|
6002
|
-
if (this.mapObject.toggledShapeElementId) {
|
|
6003
|
-
for (let j = 0; j < this.mapObject.toggledShapeElementId.length; j++) {
|
|
6004
|
-
const styleProperty = this.mapObject.legendSettings.toggleLegendSettings.applyShapeSettings ?
|
|
6005
|
-
this.currentLayer.shapeSettings : this.mapObject.legendSettings.toggleLegendSettings;
|
|
6006
|
-
if (this.mapObject.toggledShapeElementId[j] === pathEle.id) {
|
|
6007
|
-
pathEle.setAttribute('fill', styleProperty.fill);
|
|
6008
|
-
pathEle.setAttribute('stroke', styleProperty.border.color);
|
|
6009
|
-
pathEle.setAttribute('fill-opacity', (styleProperty.opacity).toString());
|
|
6010
|
-
pathEle.setAttribute('stroke-opacity', (isNullOrUndefined(styleProperty.border.opacity) ? styleProperty.opacity : styleProperty.border.opacity).toString());
|
|
6011
|
-
pathEle.setAttribute('stroke-width', (styleProperty.border.width).toString());
|
|
6012
|
-
}
|
|
6013
|
-
}
|
|
6014
|
-
}
|
|
6015
|
-
groupElement.appendChild(pathEle);
|
|
6078
|
+
if (!isNullOrUndefined(pathEle) && drawingType !== 'MultiPoint') {
|
|
6079
|
+
this.pathAttributeCalculate(groupElement, pathEle, drawingType, currentShapeData, i);
|
|
6016
6080
|
}
|
|
6017
6081
|
if (i === this.currentLayer.layerData.length - 1) {
|
|
6018
6082
|
this.layerFeatures(layerIndex, colors, renderData, labelTemplateEle);
|
|
@@ -6026,6 +6090,49 @@ class LayerPanel {
|
|
|
6026
6090
|
this.layerFeatures(layerIndex, colors, renderData, labelTemplateEle);
|
|
6027
6091
|
}
|
|
6028
6092
|
}
|
|
6093
|
+
/**
|
|
6094
|
+
* layer features as bubble, marker, datalabel, navigation line.
|
|
6095
|
+
*
|
|
6096
|
+
* @param {groupElement} Element - Specifies the element to append the group
|
|
6097
|
+
* @param {pathEle} Element - Specifies the svg element
|
|
6098
|
+
* @param {drawingType} string - Specifies the data type
|
|
6099
|
+
* @param {currentShapeData} any - Specifies the layer of shapedata.
|
|
6100
|
+
* @param {index} number - Specifies the tab index.
|
|
6101
|
+
* @returns {void}
|
|
6102
|
+
*/
|
|
6103
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6104
|
+
pathAttributeCalculate(groupElement, pathEle, drawingType, currentShapeData, index) {
|
|
6105
|
+
const property = (Object.prototype.toString.call(this.currentLayer.shapePropertyPath) === '[object Array]' ?
|
|
6106
|
+
this.currentLayer.shapePropertyPath : [this.currentLayer.shapePropertyPath]);
|
|
6107
|
+
let properties;
|
|
6108
|
+
for (let j = 0; j < property.length; j++) {
|
|
6109
|
+
if (!isNullOrUndefined(currentShapeData['property'])) {
|
|
6110
|
+
properties = property[j];
|
|
6111
|
+
break;
|
|
6112
|
+
}
|
|
6113
|
+
}
|
|
6114
|
+
pathEle.setAttribute('aria-label', ((!isNullOrUndefined(currentShapeData['property'])) ?
|
|
6115
|
+
(currentShapeData['property'][properties]) : ''));
|
|
6116
|
+
pathEle.setAttribute('tabindex', (this.mapObject.tabIndex + index + 3).toString());
|
|
6117
|
+
if (drawingType === 'LineString' || drawingType === 'MultiLineString') {
|
|
6118
|
+
pathEle.setAttribute('style', 'outline:none');
|
|
6119
|
+
}
|
|
6120
|
+
maintainSelection(this.mapObject.selectedElementId, this.mapObject.shapeSelectionClass, pathEle, 'ShapeselectionMapStyle');
|
|
6121
|
+
if (this.mapObject.toggledShapeElementId) {
|
|
6122
|
+
for (let j = 0; j < this.mapObject.toggledShapeElementId.length; j++) {
|
|
6123
|
+
const styleProperty = this.mapObject.legendSettings.toggleLegendSettings.applyShapeSettings ?
|
|
6124
|
+
this.currentLayer.shapeSettings : this.mapObject.legendSettings.toggleLegendSettings;
|
|
6125
|
+
if (this.mapObject.toggledShapeElementId[j] === pathEle.id) {
|
|
6126
|
+
pathEle.setAttribute('fill', styleProperty.fill);
|
|
6127
|
+
pathEle.setAttribute('stroke', styleProperty.border.color);
|
|
6128
|
+
pathEle.setAttribute('fill-opacity', (styleProperty.opacity).toString());
|
|
6129
|
+
pathEle.setAttribute('stroke-opacity', (isNullOrUndefined(styleProperty.border.opacity) ? styleProperty.opacity : styleProperty.border.opacity).toString());
|
|
6130
|
+
pathEle.setAttribute('stroke-width', (styleProperty.border.width).toString());
|
|
6131
|
+
}
|
|
6132
|
+
}
|
|
6133
|
+
}
|
|
6134
|
+
groupElement.appendChild(pathEle);
|
|
6135
|
+
}
|
|
6029
6136
|
/**
|
|
6030
6137
|
* layer features as bubble, marker, datalabel, navigation line.
|
|
6031
6138
|
*
|
|
@@ -6207,7 +6314,8 @@ class LayerPanel {
|
|
|
6207
6314
|
break;
|
|
6208
6315
|
case 'linestring':
|
|
6209
6316
|
const extraSpace = !isNullOrUndefined(this.currentLayer.shapeSettings.border.width) ?
|
|
6210
|
-
this.currentLayer.shapeSettings.border.width
|
|
6317
|
+
(typeof (this.currentLayer.shapeSettings.border.width) === 'string' ?
|
|
6318
|
+
parseInt(this.currentLayer.shapeSettings.border.width, 10) : this.currentLayer.shapeSettings.border.width) : 1;
|
|
6211
6319
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6212
6320
|
coordinates.map((points, index) => {
|
|
6213
6321
|
latitude = points[1];
|
|
@@ -6222,31 +6330,61 @@ class LayerPanel {
|
|
|
6222
6330
|
newData['type'] = type;
|
|
6223
6331
|
this.currentLayer.layerData.push(newData);
|
|
6224
6332
|
break;
|
|
6225
|
-
case '
|
|
6226
|
-
|
|
6227
|
-
|
|
6228
|
-
|
|
6333
|
+
case 'multilinestring':
|
|
6334
|
+
const extraSpaces = !isNullOrUndefined(this.currentLayer.shapeSettings.border.width) ?
|
|
6335
|
+
(typeof (this.currentLayer.shapeSettings.border.width) === 'string' ?
|
|
6336
|
+
parseInt(this.currentLayer.shapeSettings.border.width, 10) : this.currentLayer.shapeSettings.border.width) : 1;
|
|
6337
|
+
const multiLineData = [];
|
|
6229
6338
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6230
|
-
coordinates.map((
|
|
6231
|
-
|
|
6339
|
+
coordinates.map((multiPoints) => {
|
|
6340
|
+
newData = [];
|
|
6341
|
+
multiPoints.map((points) => {
|
|
6232
6342
|
latitude = points[1];
|
|
6233
6343
|
longitude = points[0];
|
|
6234
|
-
arrayCollections = true;
|
|
6235
6344
|
const point = convertGeoToPoint(latitude, longitude, this.currentFactor, this.currentLayer, this.mapObject);
|
|
6236
|
-
this.
|
|
6237
|
-
|
|
6345
|
+
this.calculateBox(point, extraSpaces);
|
|
6346
|
+
newData.push({
|
|
6347
|
+
point: point, lat: latitude, lng: longitude
|
|
6238
6348
|
});
|
|
6239
|
-
}
|
|
6349
|
+
});
|
|
6350
|
+
multiLineData.push(newData);
|
|
6351
|
+
});
|
|
6352
|
+
multiLineData['property'] = properties;
|
|
6353
|
+
multiLineData['type'] = type;
|
|
6354
|
+
this.currentLayer.layerData.push(multiLineData);
|
|
6355
|
+
break;
|
|
6356
|
+
case 'point':
|
|
6357
|
+
const pointExtraSpace = (!isNullOrUndefined(this.currentLayer.shapeSettings.border.width) ?
|
|
6358
|
+
(typeof (this.currentLayer.shapeSettings.border.width) === 'string' ?
|
|
6359
|
+
parseInt(this.currentLayer.shapeSettings.border.width, 10) : this.currentLayer.shapeSettings.border.width) : 1) +
|
|
6360
|
+
(this.currentLayer.shapeSettings.circleRadius * 2);
|
|
6361
|
+
latitude = coordinates[1];
|
|
6362
|
+
longitude = coordinates[0];
|
|
6363
|
+
const point = convertGeoToPoint(latitude, longitude, this.currentFactor, this.currentLayer, this.mapObject);
|
|
6364
|
+
this.calculateBox(point, pointExtraSpace);
|
|
6365
|
+
this.currentLayer.layerData.push({
|
|
6366
|
+
point: point, type: type, lat: latitude, lng: longitude, property: properties
|
|
6240
6367
|
});
|
|
6241
|
-
|
|
6242
|
-
|
|
6243
|
-
|
|
6368
|
+
break;
|
|
6369
|
+
case 'multipoint': {
|
|
6370
|
+
const extraSpace = (!isNullOrUndefined(this.currentLayer.shapeSettings.border.width) ?
|
|
6371
|
+
(typeof (this.currentLayer.shapeSettings.border.width) === 'string' ?
|
|
6372
|
+
parseInt(this.currentLayer.shapeSettings.border.width, 10) : this.currentLayer.shapeSettings.border.width) : 1) +
|
|
6373
|
+
(this.currentLayer.shapeSettings.circleRadius * 2);
|
|
6374
|
+
newData = [];
|
|
6375
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6376
|
+
coordinates.map((points) => {
|
|
6377
|
+
latitude = points[1];
|
|
6378
|
+
longitude = points[0];
|
|
6244
6379
|
const point = convertGeoToPoint(latitude, longitude, this.currentFactor, this.currentLayer, this.mapObject);
|
|
6245
6380
|
this.calculateBox(point, extraSpace);
|
|
6246
|
-
|
|
6247
|
-
point: point,
|
|
6381
|
+
newData.push({
|
|
6382
|
+
point: point, lat: latitude, lng: longitude
|
|
6248
6383
|
});
|
|
6249
|
-
}
|
|
6384
|
+
});
|
|
6385
|
+
newData['property'] = properties;
|
|
6386
|
+
newData['type'] = type;
|
|
6387
|
+
this.currentLayer.layerData.push(newData);
|
|
6250
6388
|
break;
|
|
6251
6389
|
}
|
|
6252
6390
|
case 'path':
|
|
@@ -6258,12 +6396,12 @@ class LayerPanel {
|
|
|
6258
6396
|
}
|
|
6259
6397
|
calculateBox(point, extraSpace) {
|
|
6260
6398
|
if (isNullOrUndefined(this.rectBounds)) {
|
|
6261
|
-
this.rectBounds = { min: { x: point.x, y: point.y - extraSpace }, max: { x: point.x, y: point.y + extraSpace } };
|
|
6399
|
+
this.rectBounds = { min: { x: point.x - extraSpace, y: point.y - extraSpace }, max: { x: point.x + extraSpace, y: point.y + extraSpace } };
|
|
6262
6400
|
}
|
|
6263
6401
|
else {
|
|
6264
|
-
this.rectBounds['min']['x'] = Math.min(this.rectBounds['min']['x'], point.x);
|
|
6402
|
+
this.rectBounds['min']['x'] = Math.min(this.rectBounds['min']['x'], point.x - extraSpace);
|
|
6265
6403
|
this.rectBounds['min']['y'] = Math.min(this.rectBounds['min']['y'], point.y - extraSpace);
|
|
6266
|
-
this.rectBounds['max']['x'] = Math.max(this.rectBounds['max']['x'], point.x);
|
|
6404
|
+
this.rectBounds['max']['x'] = Math.max(this.rectBounds['max']['x'], point.x + extraSpace);
|
|
6267
6405
|
this.rectBounds['max']['y'] = Math.max(this.rectBounds['max']['y'], point.y + extraSpace);
|
|
6268
6406
|
}
|
|
6269
6407
|
}
|
|
@@ -6281,6 +6419,10 @@ class LayerPanel {
|
|
|
6281
6419
|
const end = convertGeoToPoint(bounds.latitude.max, bounds.longitude.max, null, layer, this.mapObject);
|
|
6282
6420
|
mapHeight = end.y - start.y;
|
|
6283
6421
|
mapWidth = end.x - start.x;
|
|
6422
|
+
if (mapHeight === 0 || mapWidth === 0) {
|
|
6423
|
+
mapWidth = mapSize.width / 2;
|
|
6424
|
+
mapHeight = mapSize.height;
|
|
6425
|
+
}
|
|
6284
6426
|
}
|
|
6285
6427
|
else {
|
|
6286
6428
|
mapHeight = mapWidth = 500;
|
|
@@ -6374,15 +6516,28 @@ class LayerPanel {
|
|
|
6374
6516
|
this.calculateRectBox(point[0]);
|
|
6375
6517
|
});
|
|
6376
6518
|
break;
|
|
6519
|
+
case 'multilinestring':
|
|
6520
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6521
|
+
coordinates.map((multiPoint, index) => {
|
|
6522
|
+
multiPoint.map((point, index) => {
|
|
6523
|
+
this.calculateRectBox(point, 'multilinestring', index === 0 ? true : false);
|
|
6524
|
+
});
|
|
6525
|
+
});
|
|
6526
|
+
break;
|
|
6377
6527
|
case 'linestring':
|
|
6378
6528
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6379
6529
|
coordinates.map((point, index) => {
|
|
6380
|
-
this.calculateRectBox(point, '
|
|
6530
|
+
this.calculateRectBox(point, 'linestring', index === 0 ? true : false);
|
|
6381
6531
|
});
|
|
6382
6532
|
break;
|
|
6383
6533
|
case 'point':
|
|
6384
6534
|
this.calculateRectBox(coordinates, 'point');
|
|
6385
6535
|
break;
|
|
6536
|
+
case 'multipoint':
|
|
6537
|
+
coordinates.map((point, index) => {
|
|
6538
|
+
this.calculateRectBox(point, 'multipoint', index === 0 ? true : false);
|
|
6539
|
+
});
|
|
6540
|
+
break;
|
|
6386
6541
|
}
|
|
6387
6542
|
}
|
|
6388
6543
|
});
|
|
@@ -6419,7 +6574,7 @@ class LayerPanel {
|
|
|
6419
6574
|
}
|
|
6420
6575
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6421
6576
|
calculateRectBox(coordinates, type, isFirstItem) {
|
|
6422
|
-
if (type !== '
|
|
6577
|
+
if ((type !== 'linestring' && type !== 'multilinestring') && (type !== 'point' && type !== 'multipoint')) {
|
|
6423
6578
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6424
6579
|
Array.prototype.forEach.call(coordinates, (currentCoords) => {
|
|
6425
6580
|
if (isNullOrUndefined(this.mapObject.baseMapBounds)) {
|
|
@@ -6488,7 +6643,7 @@ class LayerPanel {
|
|
|
6488
6643
|
const tile = new Tile(tileI % ycount, j);
|
|
6489
6644
|
tile.left = x;
|
|
6490
6645
|
tile.top = y;
|
|
6491
|
-
if (baseLayer.layerType === 'Bing') {
|
|
6646
|
+
if (baseLayer.layerType === 'Bing' || (bing && !isNullOrUndefined(baseLayer.urlTemplate) && baseLayer.urlTemplate !== '')) {
|
|
6492
6647
|
const key = baseLayer.key;
|
|
6493
6648
|
tile.src = bing.getBingMap(tile, key, baseLayer.bingMapType, userLang, bing.imageUrl, bing.subDomains);
|
|
6494
6649
|
}
|
|
@@ -6516,10 +6671,12 @@ class LayerPanel {
|
|
|
6516
6671
|
if (!(layer.type === 'SubLayer' && layer.visible)) {
|
|
6517
6672
|
continue;
|
|
6518
6673
|
}
|
|
6519
|
-
if (layer.layerType
|
|
6674
|
+
if ((layer.layerType !== 'Geometry' && layer.layerType !== 'GoogleStaticMap') || (layer.layerType === 'Geometry' &&
|
|
6675
|
+
isNullOrUndefined(layer.shapeData) && !isNullOrUndefined(layer.urlTemplate) && layer.urlTemplate !== '')) {
|
|
6520
6676
|
for (const baseTile of proxTiles) {
|
|
6521
6677
|
const subtile = extend({}, baseTile, {}, true);
|
|
6522
6678
|
if (layer.layerType === 'Bing') {
|
|
6679
|
+
bing = new BingMap(this.mapObject);
|
|
6523
6680
|
subtile.src = bing.getBingMap(subtile, layer.key, layer.bingMapType, userLang, bing.imageUrl, bing.subDomains);
|
|
6524
6681
|
}
|
|
6525
6682
|
else {
|
|
@@ -6564,7 +6721,7 @@ class LayerPanel {
|
|
|
6564
6721
|
else {
|
|
6565
6722
|
if (type !== 'Pan' && element1 && element) {
|
|
6566
6723
|
element1.appendChild(element.children[0]);
|
|
6567
|
-
if (!isNullOrUndefined(document.getElementById(this.mapObject.element.id + '_animated_tiles'))) {
|
|
6724
|
+
if (!this.mapObject.isAddLayer && !isNullOrUndefined(document.getElementById(this.mapObject.element.id + '_animated_tiles'))) {
|
|
6568
6725
|
document.getElementById(this.mapObject.element.id + '_animated_tiles').id =
|
|
6569
6726
|
this.mapObject.element.id + '_animated_tiles_old';
|
|
6570
6727
|
}
|
|
@@ -6578,6 +6735,8 @@ class LayerPanel {
|
|
|
6578
6735
|
let id = 0;
|
|
6579
6736
|
for (const tile of this.tiles) {
|
|
6580
6737
|
const imgElement = createElement('img');
|
|
6738
|
+
imgElement.setAttribute('height', '256px');
|
|
6739
|
+
imgElement.setAttribute('width', '256px');
|
|
6581
6740
|
imgElement.setAttribute('src', tile.src);
|
|
6582
6741
|
const mapId = this.mapObject.element.id;
|
|
6583
6742
|
imgElement.onload = () => {
|
|
@@ -7063,6 +7222,7 @@ let Maps = class Maps extends Component {
|
|
|
7063
7222
|
this.renderArea();
|
|
7064
7223
|
this.processRequestJsonData();
|
|
7065
7224
|
this.renderComplete();
|
|
7225
|
+
this.isAddLayer = !this.isTileMap ? false : this.isAddLayer;
|
|
7066
7226
|
}
|
|
7067
7227
|
/**
|
|
7068
7228
|
* To Initialize the control rendering.
|
|
@@ -7195,16 +7355,7 @@ let Maps = class Maps extends Component {
|
|
|
7195
7355
|
}
|
|
7196
7356
|
renderMap() {
|
|
7197
7357
|
if (this.legendModule && this.legendSettings.visible) {
|
|
7198
|
-
|
|
7199
|
-
this.legendModule.renderLegend();
|
|
7200
|
-
}
|
|
7201
|
-
else {
|
|
7202
|
-
const layerCount = this.layersCollection.length - 1;
|
|
7203
|
-
if (!this.layersCollection[layerCount].isBaseLayer) {
|
|
7204
|
-
this.isTileMapSubLayer = true;
|
|
7205
|
-
this.legendModule.renderLegend();
|
|
7206
|
-
}
|
|
7207
|
-
}
|
|
7358
|
+
this.legendModule.renderLegend();
|
|
7208
7359
|
}
|
|
7209
7360
|
this.createTile();
|
|
7210
7361
|
if (this.zoomSettings.enable && this.zoomModule) {
|
|
@@ -7287,12 +7438,16 @@ let Maps = class Maps extends Component {
|
|
|
7287
7438
|
bottom = svg.bottom - tile.bottom - element.offsetTop;
|
|
7288
7439
|
top = parseFloat(tileElement.style.top) + element.offsetTop;
|
|
7289
7440
|
}
|
|
7290
|
-
top = (bottom <= 11) ? top : (top * 2);
|
|
7291
|
-
left = (bottom <= 11) ? left : (left * 2);
|
|
7441
|
+
top = (bottom <= 11) ? top : (!isNullOrUndefined(this.legendModule) && this.legendSettings.position === 'Bottom') ? this.mapAreaRect.y : (top * 2);
|
|
7442
|
+
left = (bottom <= 11) ? left : !isNullOrUndefined(this.legendModule) ? left : (left * 2);
|
|
7292
7443
|
tileElement.style.top = top + 'px';
|
|
7293
7444
|
tileElement.style.left = left + 'px';
|
|
7294
7445
|
tileElement1.style.top = top + 'px';
|
|
7295
7446
|
tileElement1.style.left = left + 'px';
|
|
7447
|
+
if (!isNullOrUndefined(this.legendModule) && this.legendModule.totalPages.length > 0) {
|
|
7448
|
+
tileElement.style.height = tileElement1.style.height = this.legendModule.legendTotalRect.height + 'px';
|
|
7449
|
+
tileElement.style.width = tileElement1.style.width = this.legendModule.legendTotalRect.width + 'px';
|
|
7450
|
+
}
|
|
7296
7451
|
}
|
|
7297
7452
|
this.arrangeTemplate();
|
|
7298
7453
|
if (this.annotationsModule) {
|
|
@@ -7418,12 +7573,21 @@ let Maps = class Maps extends Component {
|
|
|
7418
7573
|
this.zoomModule.layerCollectionEle = getElementByID(this.element.id + '_Layer_Collections');
|
|
7419
7574
|
}
|
|
7420
7575
|
if (this.isTileMap && getElementByID(this.element.id + '_Tile_SVG') && getElementByID(this.element.id + '_tile_parent')) {
|
|
7421
|
-
|
|
7422
|
-
|
|
7576
|
+
let tileElement = getElementByID(this.element.id + '_tile_parent');
|
|
7577
|
+
let tileSvgElement = getElementByID(this.element.id + '_Tile_SVG');
|
|
7578
|
+
const tileSvgParentElement = getElementByID(this.element.id + '_Tile_SVG_Parent');
|
|
7579
|
+
const tileRect = tileElement.getBoundingClientRect();
|
|
7580
|
+
const tileSvgRect = tileSvgElement.getBoundingClientRect();
|
|
7423
7581
|
left = (tileRect.left - tileSvgRect.left);
|
|
7424
7582
|
top = (tileRect.top - tileSvgRect.top);
|
|
7425
|
-
|
|
7426
|
-
|
|
7583
|
+
tileSvgParentElement.style.left = left + 'px';
|
|
7584
|
+
tileSvgParentElement.style.top = top + 'px';
|
|
7585
|
+
if (!isNullOrUndefined(this.legendModule) && this.legendModule.totalPages.length > 0) {
|
|
7586
|
+
tileElement.style.width = tileSvgElement.style.width = this.legendModule.legendTotalRect.width.toString();
|
|
7587
|
+
tileElement.style.height = tileSvgElement.style.height = this.legendModule.legendTotalRect.height.toString();
|
|
7588
|
+
tileSvgParentElement.style.width = this.legendModule.legendTotalRect.width + 'px';
|
|
7589
|
+
tileSvgParentElement.style.height = this.legendModule.legendTotalRect.height + 'px';
|
|
7590
|
+
}
|
|
7427
7591
|
const markerTemplateElements = document.getElementsByClassName('template');
|
|
7428
7592
|
if (!isNullOrUndefined(markerTemplateElements) && markerTemplateElements.length > 0) {
|
|
7429
7593
|
for (let i = 0; i < markerTemplateElements.length; i++) {
|
|
@@ -7441,7 +7605,7 @@ let Maps = class Maps extends Component {
|
|
|
7441
7605
|
if (!isNullOrUndefined(elements) && elements.childElementCount > 0) {
|
|
7442
7606
|
for (let i = 0; i < elements.childNodes.length; i++) {
|
|
7443
7607
|
const childElement = elements.childNodes[i];
|
|
7444
|
-
if (childElement.tagName === 'g') {
|
|
7608
|
+
if (childElement.tagName === 'g' && childElement.id.indexOf('_Legend_Group') == -1) {
|
|
7445
7609
|
const layerIndex = parseFloat(childElement.id.split('_LayerIndex_')[1].split('_')[0]);
|
|
7446
7610
|
for (let j = 0; j < childElement.childNodes.length; j++) {
|
|
7447
7611
|
const childNode = childElement.childNodes[j];
|
|
@@ -7478,7 +7642,7 @@ let Maps = class Maps extends Component {
|
|
|
7478
7642
|
}
|
|
7479
7643
|
const templateElements = document.getElementsByClassName(this.element.id + '_template');
|
|
7480
7644
|
if (!isNullOrUndefined(templateElements) && templateElements.length > 0 &&
|
|
7481
|
-
getElementByID(this.element.id + '_Layer_Collections') && this.
|
|
7645
|
+
getElementByID(this.element.id + '_Layer_Collections') && !this.isTileMap) {
|
|
7482
7646
|
for (let i = 0; i < templateElements.length; i++) {
|
|
7483
7647
|
let offSetLetValue = 0;
|
|
7484
7648
|
let offSetTopValue = 0;
|
|
@@ -7513,10 +7677,7 @@ let Maps = class Maps extends Component {
|
|
|
7513
7677
|
const mainLayer = this.layersCollection[0];
|
|
7514
7678
|
const padding = 0;
|
|
7515
7679
|
if (mainLayer.isBaseLayer && (mainLayer.layerType === 'OSM' || mainLayer.layerType === 'Bing' ||
|
|
7516
|
-
mainLayer.layerType === 'GoogleStaticMap' || mainLayer.layerType === 'Google')) {
|
|
7517
|
-
if (mainLayer.layerType === 'Google') {
|
|
7518
|
-
mainLayer.urlTemplate = 'https://mt1.google.com/vt/lyrs=m@129&hl=en&x=tileX&y=tileY&z=level';
|
|
7519
|
-
}
|
|
7680
|
+
mainLayer.layerType === 'GoogleStaticMap' || mainLayer.layerType === 'Google' || (!isNullOrUndefined(mainLayer.urlTemplate) && mainLayer.urlTemplate !== ''))) {
|
|
7520
7681
|
removeElement(this.element.id + '_tile_parent');
|
|
7521
7682
|
removeElement(this.element.id + '_tiles');
|
|
7522
7683
|
removeElement('animated_tiles');
|
|
@@ -7563,7 +7724,7 @@ let Maps = class Maps extends Component {
|
|
|
7563
7724
|
const baseLayer = mainLayers[i];
|
|
7564
7725
|
if (baseLayer.visible && baseIndex === i) {
|
|
7565
7726
|
baseLayer.isBaseLayer = true;
|
|
7566
|
-
this.isTileMap = (baseLayer.layerType === 'Geometry') ? false : true;
|
|
7727
|
+
this.isTileMap = (baseLayer.layerType === 'Geometry' && !isNullOrUndefined(baseLayer.shapeData)) ? false : true;
|
|
7567
7728
|
this.layersCollection.push(baseLayer);
|
|
7568
7729
|
break;
|
|
7569
7730
|
}
|
|
@@ -7610,12 +7771,19 @@ let Maps = class Maps extends Component {
|
|
|
7610
7771
|
* @private
|
|
7611
7772
|
*/
|
|
7612
7773
|
renderTitle(title, type, bounds, groupEle) {
|
|
7613
|
-
const style =
|
|
7774
|
+
const style = {
|
|
7775
|
+
size: title.textStyle.size,
|
|
7776
|
+
color: title.textStyle.color,
|
|
7777
|
+
fontFamily: title.textStyle.fontFamily,
|
|
7778
|
+
fontWeight: title.textStyle.fontWeight,
|
|
7779
|
+
fontStyle: title.textStyle.fontStyle,
|
|
7780
|
+
opacity: title.textStyle.opacity
|
|
7781
|
+
};
|
|
7614
7782
|
let height;
|
|
7615
7783
|
const width = Math.abs((this.margin.left + this.margin.right) - this.availableSize.width);
|
|
7616
|
-
style.fontFamily =
|
|
7784
|
+
style.fontFamily = !isNullOrUndefined(style.fontFamily) ? style.fontFamily : this.themeStyle.fontFamily;
|
|
7617
7785
|
style.fontWeight = style.fontWeight || this.themeStyle.titleFontWeight;
|
|
7618
|
-
style.size = this.themeStyle.titleFontSize
|
|
7786
|
+
style.size = type === 'title' ? (style.size || this.themeStyle.titleFontSize) : (style.size || Theme.mapsSubTitleFont.size);
|
|
7619
7787
|
if (title.text) {
|
|
7620
7788
|
if (isNullOrUndefined(groupEle)) {
|
|
7621
7789
|
groupEle = this.renderer.createGroup({ id: this.element.id + '_Title_Group' });
|
|
@@ -7785,6 +7953,7 @@ let Maps = class Maps extends Component {
|
|
|
7785
7953
|
const id = event.target['id'];
|
|
7786
7954
|
event.preventDefault();
|
|
7787
7955
|
if (this.legendModule && (id.indexOf('_Left_Page_Rect') > -1 || id.indexOf('_Right_Page_Rect') > -1)) {
|
|
7956
|
+
this.mapAreaRect = this.legendModule.initialMapAreaRect;
|
|
7788
7957
|
this.legendModule.currentPage = (id.indexOf('_Left_Page_') > -1) ? (this.legendModule.currentPage - 1) :
|
|
7789
7958
|
(this.legendModule.currentPage + 1);
|
|
7790
7959
|
this.legendModule.legendGroup = this.renderer.createGroup({ id: this.element.id + '_Legend_Group' });
|
|
@@ -7848,24 +8017,35 @@ let Maps = class Maps extends Component {
|
|
|
7848
8017
|
latitude: latitude, longitude: longitude,
|
|
7849
8018
|
isShapeSelected: this.SelectedElement(targetEle)
|
|
7850
8019
|
};
|
|
7851
|
-
this.
|
|
7852
|
-
|
|
7853
|
-
|
|
7854
|
-
|
|
7855
|
-
|
|
7856
|
-
|
|
7857
|
-
|
|
7858
|
-
|
|
7859
|
-
|
|
7860
|
-
|
|
7861
|
-
|
|
7862
|
-
|
|
7863
|
-
|
|
7864
|
-
|
|
7865
|
-
|
|
7866
|
-
|
|
7867
|
-
|
|
7868
|
-
|
|
8020
|
+
if (this.onclick) {
|
|
8021
|
+
eventArgs.name = onclick;
|
|
8022
|
+
this.trigger('onclick', eventArgs, (mouseArgs) => {
|
|
8023
|
+
this.clickHandler(e, eventArgs, targetEle);
|
|
8024
|
+
});
|
|
8025
|
+
}
|
|
8026
|
+
else {
|
|
8027
|
+
this.trigger('click', eventArgs, (mouseArgs) => {
|
|
8028
|
+
this.clickHandler(e, eventArgs, targetEle);
|
|
8029
|
+
});
|
|
8030
|
+
}
|
|
8031
|
+
}
|
|
8032
|
+
}
|
|
8033
|
+
clickHandler(e, eventArgs, targetEle) {
|
|
8034
|
+
if (targetEle.id.indexOf('shapeIndex') > -1) {
|
|
8035
|
+
this.mergeCluster();
|
|
8036
|
+
if (getElement(this.element.id + '_mapsTooltip') &&
|
|
8037
|
+
this.mapsTooltipModule.tooltipTargetID.indexOf('_MarkerIndex_') > -1) {
|
|
8038
|
+
removeElement(this.element.id + '_mapsTooltip');
|
|
8039
|
+
}
|
|
8040
|
+
}
|
|
8041
|
+
if (this.markerModule) {
|
|
8042
|
+
this.markerModule.markerClusterClick(e);
|
|
8043
|
+
}
|
|
8044
|
+
if (!eventArgs.cancel) {
|
|
8045
|
+
this.notify(click, targetEle);
|
|
8046
|
+
}
|
|
8047
|
+
if (!eventArgs.cancel && targetEle.id.indexOf('shapeIndex') !== -1) {
|
|
8048
|
+
this.triggerShapeSelection(targetEle);
|
|
7869
8049
|
}
|
|
7870
8050
|
}
|
|
7871
8051
|
triggerShapeSelection(targetEle) {
|
|
@@ -7965,13 +8145,6 @@ let Maps = class Maps extends Component {
|
|
|
7965
8145
|
latitude = latLongValue.latitude;
|
|
7966
8146
|
longitude = latLongValue.longitude;
|
|
7967
8147
|
}
|
|
7968
|
-
const eventArgs = {
|
|
7969
|
-
cancel: false, name: click, target: targetId, x: e.clientX, y: e.clientY,
|
|
7970
|
-
latitude: latitude, longitude: longitude, isShapeSelected: this.SelectedElement(targetEle)
|
|
7971
|
-
};
|
|
7972
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
7973
|
-
this.trigger('click', eventArgs, (mouseArgs) => {
|
|
7974
|
-
});
|
|
7975
8148
|
}
|
|
7976
8149
|
this.titleTooltip(e, pageX, pageY, true);
|
|
7977
8150
|
if (!isNullOrUndefined(this.legendModule)) {
|
|
@@ -7979,7 +8152,7 @@ let Maps = class Maps extends Component {
|
|
|
7979
8152
|
}
|
|
7980
8153
|
}
|
|
7981
8154
|
this.notify(Browser.touchEndEvent, e);
|
|
7982
|
-
if (e.cancelable) {
|
|
8155
|
+
if (e.cancelable && !this.isTouch) {
|
|
7983
8156
|
e.preventDefault();
|
|
7984
8157
|
}
|
|
7985
8158
|
return false;
|
|
@@ -8133,7 +8306,7 @@ let Maps = class Maps extends Component {
|
|
|
8133
8306
|
removeElement(this.element.id + '_EJ2_LegendTitle_Tooltip');
|
|
8134
8307
|
}
|
|
8135
8308
|
if ((targetId === (this.element.id + '_Map_title')) && (event.target.textContent.indexOf('...') > -1)) {
|
|
8136
|
-
showTooltip(this.titleSettings.text, this.titleSettings.textStyle.size, x, y, this.element.offsetWidth, this.element.offsetHeight, this.element.id + '_EJ2_Title_Tooltip', getElement(this.element.id + '_Secondary_Element'), isTouch);
|
|
8309
|
+
showTooltip(this.titleSettings.text, this.titleSettings.textStyle.size || this.themeStyle.titleFontSize, x, y, this.element.offsetWidth, this.element.offsetHeight, this.element.id + '_EJ2_Title_Tooltip', getElement(this.element.id + '_Secondary_Element'), isTouch);
|
|
8137
8310
|
}
|
|
8138
8311
|
else {
|
|
8139
8312
|
removeElement(this.element.id + '_EJ2_Title_Tooltip');
|
|
@@ -8244,8 +8417,10 @@ let Maps = class Maps extends Component {
|
|
|
8244
8417
|
* @param {Object} layer - Specifies the layer for the maps.
|
|
8245
8418
|
*/
|
|
8246
8419
|
addLayer(layer) {
|
|
8247
|
-
|
|
8248
|
-
|
|
8420
|
+
let mapsLayer = this.layers;
|
|
8421
|
+
mapsLayer.push(layer);
|
|
8422
|
+
this.isAddLayer = true;
|
|
8423
|
+
this.layers = mapsLayer;
|
|
8249
8424
|
}
|
|
8250
8425
|
/**
|
|
8251
8426
|
* This method is used to remove a layer from map.
|
|
@@ -8254,8 +8429,9 @@ let Maps = class Maps extends Component {
|
|
|
8254
8429
|
* @returns {void}
|
|
8255
8430
|
*/
|
|
8256
8431
|
removeLayer(index) {
|
|
8257
|
-
this.layers
|
|
8258
|
-
|
|
8432
|
+
let mapsLayer = this.layers;
|
|
8433
|
+
mapsLayer.splice(index, 1);
|
|
8434
|
+
this.layers = mapsLayer;
|
|
8259
8435
|
}
|
|
8260
8436
|
/**
|
|
8261
8437
|
* This method is used to add markers dynamically in the maps.
|
|
@@ -8538,6 +8714,7 @@ let Maps = class Maps extends Component {
|
|
|
8538
8714
|
onPropertyChanged(newProp, oldProp) {
|
|
8539
8715
|
let render = false;
|
|
8540
8716
|
let isMarker = false;
|
|
8717
|
+
let isLayer = false;
|
|
8541
8718
|
let isStaticMapType = false;
|
|
8542
8719
|
let layerEle;
|
|
8543
8720
|
if (newProp['layers']) {
|
|
@@ -8557,12 +8734,14 @@ let Maps = class Maps extends Component {
|
|
|
8557
8734
|
case 'legendSettings':
|
|
8558
8735
|
case 'baseLayerIndex':
|
|
8559
8736
|
if (prop === 'layers') {
|
|
8737
|
+
isLayer = true;
|
|
8560
8738
|
const layerPropLength = Object.keys(newProp.layers).length;
|
|
8561
8739
|
for (let x = 0; x < layerPropLength; x++) {
|
|
8562
8740
|
if (!isNullOrUndefined(newProp.layers[x])) {
|
|
8563
8741
|
const collection = Object.keys(newProp.layers[x]);
|
|
8564
8742
|
for (const collectionProp of collection) {
|
|
8565
|
-
if (collectionProp === 'layerType' && newProp.layers[x].layerType
|
|
8743
|
+
if ((collectionProp === 'layerType' && newProp.layers[x].layerType !== 'Geometry') || (isNullOrUndefined(this.layers[x].shapeData)
|
|
8744
|
+
&& !isNullOrUndefined(this.layers[x].urlTemplate) && this.layers[x].urlTemplate !== '')) {
|
|
8566
8745
|
this.isReset = true;
|
|
8567
8746
|
}
|
|
8568
8747
|
else if (collectionProp === 'markerSettings') {
|
|
@@ -8579,7 +8758,7 @@ let Maps = class Maps extends Component {
|
|
|
8579
8758
|
break;
|
|
8580
8759
|
case 'zoomSettings':
|
|
8581
8760
|
if (!isNullOrUndefined(oldProp.zoomSettings)) {
|
|
8582
|
-
if (newProp.zoomSettings.zoomFactor !== oldProp.zoomSettings.zoomFactor) {
|
|
8761
|
+
if (newProp.zoomSettings.zoomFactor !== oldProp.zoomSettings.zoomFactor && !isLayer) {
|
|
8583
8762
|
render = false;
|
|
8584
8763
|
}
|
|
8585
8764
|
else if (newProp.zoomSettings.shouldZoomInitially !== oldProp.zoomSettings.shouldZoomInitially) {
|
|
@@ -8842,6 +9021,28 @@ let Maps = class Maps extends Component {
|
|
|
8842
9021
|
}
|
|
8843
9022
|
return null;
|
|
8844
9023
|
}
|
|
9024
|
+
/**
|
|
9025
|
+
* This method is used to get the Bing maps URL.
|
|
9026
|
+
*
|
|
9027
|
+
* @param {string} url - Specifies the URL of the maps.
|
|
9028
|
+
* @returns {Promise<string>} - Returns the processed Bing URL as Promise.
|
|
9029
|
+
*/
|
|
9030
|
+
getBingUrlTemplate(url) {
|
|
9031
|
+
const promise = new Promise((resolve, reject) => {
|
|
9032
|
+
const ajax = new Ajax({
|
|
9033
|
+
url: url
|
|
9034
|
+
});
|
|
9035
|
+
ajax.onSuccess = (json) => {
|
|
9036
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9037
|
+
const jsonObject = JSON.parse(json);
|
|
9038
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9039
|
+
const resource = jsonObject['resourceSets'][0]['resources'][0];
|
|
9040
|
+
resolve(resource['imageUrl']);
|
|
9041
|
+
};
|
|
9042
|
+
ajax.send();
|
|
9043
|
+
});
|
|
9044
|
+
return promise;
|
|
9045
|
+
}
|
|
8845
9046
|
/**
|
|
8846
9047
|
* To find visibility of layers and markers for required modules load.
|
|
8847
9048
|
*
|
|
@@ -9042,6 +9243,9 @@ __decorate([
|
|
|
9042
9243
|
__decorate([
|
|
9043
9244
|
Event()
|
|
9044
9245
|
], Maps.prototype, "click", void 0);
|
|
9246
|
+
__decorate([
|
|
9247
|
+
Event()
|
|
9248
|
+
], Maps.prototype, "onclick", void 0);
|
|
9045
9249
|
__decorate([
|
|
9046
9250
|
Event()
|
|
9047
9251
|
], Maps.prototype, "doubleClick", void 0);
|
|
@@ -9185,12 +9389,8 @@ class Bubble {
|
|
|
9185
9389
|
isNaN(shapeData[layer.shapeDataPath]) ? shapeData[layer.shapeDataPath].toLowerCase() : shapeData[layer.shapeDataPath];
|
|
9186
9390
|
const shapePathValue = !isNullOrUndefined(shape[shapePath]) && isNaN(shape[shapePath])
|
|
9187
9391
|
? shape[shapePath].toLowerCase() : shape[shapePath];
|
|
9188
|
-
if (shapeDataLayerPathValue === shapePathValue && layerData[i].type !== 'LineString') {
|
|
9189
|
-
if (layerData[i]['
|
|
9190
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9191
|
-
shapePoints.push(this.getPoints(layerData[i], []));
|
|
9192
|
-
}
|
|
9193
|
-
else if (!layerData[i]['_isMultiPolygon']) {
|
|
9392
|
+
if (shapeDataLayerPathValue === shapePathValue && (layerData[i].type !== 'LineString' && layerData[i].type !== 'MultiLineString' && layerData[i]['type'] !== 'Point' && layerData[i]['type'] !== 'MultiPoint')) {
|
|
9393
|
+
if (!layerData[i]['_isMultiPolygon']) {
|
|
9194
9394
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9195
9395
|
shapePoints.push(this.getPoints(layerData[i], []));
|
|
9196
9396
|
currentLength = shapePoints[shapePoints.length - 1].length;
|
|
@@ -9274,7 +9474,7 @@ class Bubble {
|
|
|
9274
9474
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9275
9475
|
let translate;
|
|
9276
9476
|
const animate$$1 = layer.animationDuration !== 0 || isNullOrUndefined(this.maps.zoomModule);
|
|
9277
|
-
if (this.maps.zoomSettings.zoomFactor > 1 && !isNullOrUndefined(this.maps.zoomModule)) {
|
|
9477
|
+
if (this.maps.zoomSettings.zoomFactor > 1 && !isNullOrUndefined(this.maps.zoomModule) && !this.maps.isTileMap) {
|
|
9278
9478
|
translate = getZoomTranslate(this.maps, layer, animate$$1);
|
|
9279
9479
|
}
|
|
9280
9480
|
else {
|
|
@@ -9495,7 +9695,7 @@ class DataLabel {
|
|
|
9495
9695
|
let shapeWidth;
|
|
9496
9696
|
const scaleZoomValue = !isNullOrUndefined(this.maps.scale) ? Math.floor(this.maps.scale) : 1;
|
|
9497
9697
|
const zoomLabelsPosition = this.maps.zoomSettings.enable ? !isNullOrUndefined(this.maps.zoomShapeCollection) &&
|
|
9498
|
-
this.maps.zoomShapeCollection.length > 0 : this.maps.zoomSettings.enable;
|
|
9698
|
+
this.maps.zoomShapeCollection.length > 0 && !this.maps.isAddLayer : this.maps.zoomSettings.enable;
|
|
9499
9699
|
this.maps.translateType = 'labels';
|
|
9500
9700
|
for (let j = 0; j < properties.length; j++) {
|
|
9501
9701
|
if (shapeProperties[properties[j]]) {
|
|
@@ -9513,7 +9713,7 @@ class DataLabel {
|
|
|
9513
9713
|
layer.dataSource, layer.shapeDataPath, shapeData['properties'][propertyPath], layer.shapeDataPath);
|
|
9514
9714
|
if (!isNullOrUndefined(shapes['property'])) {
|
|
9515
9715
|
shapePoint = [[]];
|
|
9516
|
-
if (!layerData[index]['_isMultiPolygon'] && layerData[index]['type'] !== 'Point') {
|
|
9716
|
+
if (!layerData[index]['_isMultiPolygon'] && layerData[index]['type'] !== 'Point' && layerData[index]['type'] !== 'MultiPoint') {
|
|
9517
9717
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9518
9718
|
shapePoint.push(this.getPoint(layerData[index], []));
|
|
9519
9719
|
currentLength = shapePoint[shapePoint.length - 1].length;
|
|
@@ -9522,21 +9722,9 @@ class DataLabel {
|
|
|
9522
9722
|
midIndex = shapePoint.length - 1;
|
|
9523
9723
|
}
|
|
9524
9724
|
}
|
|
9525
|
-
else {
|
|
9725
|
+
else if (layerData[index]['type'] !== 'Point' && layerData[index]['type'] !== 'MultiPoint') {
|
|
9526
9726
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9527
9727
|
const layer = layerData[index];
|
|
9528
|
-
if (layer['type'] === 'Point') {
|
|
9529
|
-
isPoint = true;
|
|
9530
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9531
|
-
const layerPoints = [];
|
|
9532
|
-
layerPoints.push(this.getPoint(layerData, []));
|
|
9533
|
-
shapePoint = layerPoints;
|
|
9534
|
-
currentLength = shapePoint[shapePoint.length - 1].length;
|
|
9535
|
-
if (pointsLength < currentLength) {
|
|
9536
|
-
pointsLength = currentLength;
|
|
9537
|
-
midIndex = shapePoint.length - 1;
|
|
9538
|
-
}
|
|
9539
|
-
}
|
|
9540
9728
|
for (let j = 0; j < layer.length; j++) {
|
|
9541
9729
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9542
9730
|
shapePoint.push(this.getPoint(layer[j], []));
|
|
@@ -9781,10 +9969,21 @@ class DataLabel {
|
|
|
9781
9969
|
}
|
|
9782
9970
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9783
9971
|
getPoint(shapes, points) {
|
|
9784
|
-
|
|
9785
|
-
|
|
9786
|
-
|
|
9787
|
-
|
|
9972
|
+
if (shapes['type'] === 'MultiLineString') {
|
|
9973
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9974
|
+
shapes.map((current) => {
|
|
9975
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9976
|
+
current.map((shape) => {
|
|
9977
|
+
points.push(new Point(shape['point']['x'], shape['point']['y']));
|
|
9978
|
+
});
|
|
9979
|
+
});
|
|
9980
|
+
}
|
|
9981
|
+
else {
|
|
9982
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9983
|
+
shapes.map((current, index) => {
|
|
9984
|
+
points.push(new Point(current['point']['x'], current['point']['y']));
|
|
9985
|
+
});
|
|
9986
|
+
}
|
|
9788
9987
|
return points;
|
|
9789
9988
|
}
|
|
9790
9989
|
/**
|
|
@@ -9976,6 +10175,10 @@ class Legend {
|
|
|
9976
10175
|
* @private
|
|
9977
10176
|
*/
|
|
9978
10177
|
this.legendBorderRect = new Rect(0, 0, 0, 0);
|
|
10178
|
+
/**
|
|
10179
|
+
* @private
|
|
10180
|
+
*/
|
|
10181
|
+
this.initialMapAreaRect = new Rect(0, 0, 0, 0);
|
|
9979
10182
|
/**
|
|
9980
10183
|
* @private
|
|
9981
10184
|
*/
|
|
@@ -10034,6 +10237,7 @@ class Legend {
|
|
|
10034
10237
|
this.heightIncrement = 0;
|
|
10035
10238
|
this.defsElement = this.maps.renderer.createDefs();
|
|
10036
10239
|
this.maps.svgObject.appendChild(this.defsElement);
|
|
10240
|
+
this.initialMapAreaRect = this.maps.mapAreaRect;
|
|
10037
10241
|
this.calculateLegendBounds();
|
|
10038
10242
|
this.drawLegend();
|
|
10039
10243
|
}
|
|
@@ -10071,9 +10275,9 @@ class Legend {
|
|
|
10071
10275
|
}
|
|
10072
10276
|
}
|
|
10073
10277
|
}
|
|
10074
|
-
|
|
10075
|
-
|
|
10076
|
-
|
|
10278
|
+
}
|
|
10279
|
+
if (legend.type === 'Markers') {
|
|
10280
|
+
this.getMarkersLegendCollections(layerIndex, layer.markerSettings);
|
|
10077
10281
|
}
|
|
10078
10282
|
});
|
|
10079
10283
|
if (this.legendCollection.length > 0) {
|
|
@@ -10264,8 +10468,9 @@ class Legend {
|
|
|
10264
10468
|
}
|
|
10265
10469
|
}
|
|
10266
10470
|
else {
|
|
10471
|
+
let padding = 10;
|
|
10267
10472
|
shapeX = shapeLocation[j - 1].x;
|
|
10268
|
-
shapeY = prevPositionY +
|
|
10473
|
+
shapeY = prevPositionY + padding + (shapeHeight / 2);
|
|
10269
10474
|
}
|
|
10270
10475
|
}
|
|
10271
10476
|
}
|
|
@@ -10368,7 +10573,14 @@ class Legend {
|
|
|
10368
10573
|
const legend = map.legendSettings;
|
|
10369
10574
|
const render = map.renderer;
|
|
10370
10575
|
let textOptions;
|
|
10371
|
-
const textFont =
|
|
10576
|
+
const textFont = {
|
|
10577
|
+
size: legend.textStyle.size,
|
|
10578
|
+
color: legend.textStyle.color,
|
|
10579
|
+
fontFamily: legend.textStyle.fontFamily,
|
|
10580
|
+
fontWeight: legend.textStyle.fontWeight,
|
|
10581
|
+
fontStyle: legend.textStyle.fontStyle,
|
|
10582
|
+
opacity: legend.textStyle.opacity
|
|
10583
|
+
};
|
|
10372
10584
|
this.legendGroup = render.createGroup({ id: map.element.id + '_Legend_Group' });
|
|
10373
10585
|
if (legend.mode === 'Interactive') {
|
|
10374
10586
|
for (let i = 0; i < this.legendRenderingCollections.length; i++) {
|
|
@@ -10384,7 +10596,7 @@ class Legend {
|
|
|
10384
10596
|
textFont.color = (textFont.color !== null) ? textFont.color : this.maps.themeStyle.legendTextColor;
|
|
10385
10597
|
const rectOptions = new RectOption(itemId, item['fill'], item['shapeBorder'], legend.opacity, bounds);
|
|
10386
10598
|
textOptions = new TextOption(textId, textLocation.x, textLocation.y, 'middle', item['text'], '', '');
|
|
10387
|
-
textFont.fontFamily =
|
|
10599
|
+
textFont.fontFamily = !isNullOrUndefined(textFont.fontFamily) ? textFont.fontFamily : this.maps.themeStyle.fontFamily;
|
|
10388
10600
|
textFont.size = map.themeStyle.legendFontSize || textFont.size;
|
|
10389
10601
|
renderTextElement(textOptions, textFont, textFont.color, this.legendGroup);
|
|
10390
10602
|
this.legendGroup.appendChild(render.drawRectangle(rectOptions));
|
|
@@ -10439,7 +10651,7 @@ class Legend {
|
|
|
10439
10651
|
};
|
|
10440
10652
|
legendTextStyle.color = (legendTextStyle.color !== null) ? legendTextStyle.color :
|
|
10441
10653
|
this.maps.themeStyle.legendTextColor;
|
|
10442
|
-
legendTextStyle.fontFamily =
|
|
10654
|
+
legendTextStyle.fontFamily = !isNullOrUndefined(legendTextStyle.fontFamily) ? legendTextStyle.fontFamily : this.maps.themeStyle.fontFamily;
|
|
10443
10655
|
legendTextStyle.size = map.themeStyle.legendFontSize || legendTextStyle.size;
|
|
10444
10656
|
if (i === 0) {
|
|
10445
10657
|
this.renderLegendBorder();
|
|
@@ -10515,7 +10727,9 @@ class Legend {
|
|
|
10515
10727
|
'opacity': 1,
|
|
10516
10728
|
'dominant-baseline': ''
|
|
10517
10729
|
};
|
|
10518
|
-
|
|
10730
|
+
let pagingTextElement = render.createText(pageTextOptions, pagingText);
|
|
10731
|
+
pagingTextElement.setAttribute('style', 'user-select: none;');
|
|
10732
|
+
pagingGroup.appendChild(pagingTextElement);
|
|
10519
10733
|
this.legendGroup.appendChild(pagingGroup);
|
|
10520
10734
|
}
|
|
10521
10735
|
this.legendToggle();
|
|
@@ -10527,6 +10741,7 @@ class Legend {
|
|
|
10527
10741
|
let shapeIndex;
|
|
10528
10742
|
let layerIndex;
|
|
10529
10743
|
let dataIndex;
|
|
10744
|
+
let pointIndex;
|
|
10530
10745
|
const legend = this.maps.legendSettings;
|
|
10531
10746
|
const textEle = legend.mode === 'Default' ? document.getElementById(targetElement.id.replace('Shape', 'Text')) :
|
|
10532
10747
|
document.getElementById(targetElement.id + '_Text');
|
|
@@ -10614,12 +10829,20 @@ class Legend {
|
|
|
10614
10829
|
}
|
|
10615
10830
|
if (enable) {
|
|
10616
10831
|
for (let j = 0; j < data.length; j++) {
|
|
10832
|
+
let shapeElement;
|
|
10617
10833
|
shapeIndex = data[j]['shapeIndex'];
|
|
10618
10834
|
layerIndex = data[j]['layerIndex'];
|
|
10619
10835
|
dataIndex = data[j]['dataIndex'];
|
|
10620
|
-
|
|
10621
|
-
|
|
10622
|
-
|
|
10836
|
+
pointIndex = data[j]['pointIndex'];
|
|
10837
|
+
if (pointIndex === -1) {
|
|
10838
|
+
shapeElement = document.getElementById(this.maps.element.id + '_LayerIndex_' +
|
|
10839
|
+
layerIndex + '_shapeIndex_' + shapeIndex + '_dataIndex_' + dataIndex);
|
|
10840
|
+
}
|
|
10841
|
+
else {
|
|
10842
|
+
shapeElement = document.getElementById(this.maps.element.id + '_LayerIndex_' +
|
|
10843
|
+
layerIndex + '_shapeIndex_' + shapeIndex + '_dataIndex_' + dataIndex + '_multiLine_' + pointIndex);
|
|
10844
|
+
}
|
|
10845
|
+
if (shapeElement !== null) {
|
|
10623
10846
|
let shapeMatch = true;
|
|
10624
10847
|
if (this.maps.legendSelectionCollection !== null) {
|
|
10625
10848
|
for (let i = 0; i < this.maps.legendSelectionCollection.length; i++) {
|
|
@@ -10636,13 +10859,13 @@ class Legend {
|
|
|
10636
10859
|
}
|
|
10637
10860
|
length = this.legendHighlightCollection.length;
|
|
10638
10861
|
const legendHighlightColor = this.legendHighlightCollection[length - 1]['legendOldFill'];
|
|
10639
|
-
this.legendHighlightCollection[length - 1]['MapShapeCollection']['Elements'].push(
|
|
10862
|
+
this.legendHighlightCollection[length - 1]['MapShapeCollection']['Elements'].push(shapeElement);
|
|
10640
10863
|
const shapeItemCount = this.legendHighlightCollection[length - 1]['MapShapeCollection']['Elements'].length - 1;
|
|
10641
|
-
const shapeOldFillColor =
|
|
10864
|
+
const shapeOldFillColor = shapeElement.getAttribute('fill');
|
|
10642
10865
|
this.legendHighlightCollection[length - 1]['shapeOldFillColor'].push(shapeOldFillColor);
|
|
10643
10866
|
const shapeOldColor = this.legendHighlightCollection[length - 1]['shapeOldFillColor'][shapeItemCount];
|
|
10644
10867
|
this.shapePreviousColor = this.legendHighlightCollection[length - 1]['shapeOldFillColor'];
|
|
10645
|
-
this.setColor(
|
|
10868
|
+
this.setColor(shapeElement, !isNullOrUndefined(module.fill) ? module.fill : shapeOldColor, module.opacity.toString(), module.border.color, module.border.width.toString(), 'highlight');
|
|
10646
10869
|
this.setColor(targetElement, !isNullOrUndefined(module.fill) ? module.fill : legendHighlightColor, module.opacity.toString(), module.border.color, module.border.width.toString(), 'highlight');
|
|
10647
10870
|
}
|
|
10648
10871
|
else if (value === 'selection') {
|
|
@@ -10665,12 +10888,12 @@ class Legend {
|
|
|
10665
10888
|
}
|
|
10666
10889
|
selectLength = this.maps.legendSelectionCollection.length;
|
|
10667
10890
|
const legendSelectionColor = this.maps.legendSelectionCollection[selectLength - 1]['legendOldFill'];
|
|
10668
|
-
this.maps.legendSelectionCollection[selectLength - 1]['MapShapeCollection']['Elements'].push(
|
|
10891
|
+
this.maps.legendSelectionCollection[selectLength - 1]['MapShapeCollection']['Elements'].push(shapeElement);
|
|
10669
10892
|
this.maps.legendSelectionCollection[selectLength - 1]['shapeOldFillColor'] = this.shapePreviousColor;
|
|
10670
10893
|
this.setColor(targetElement, !isNullOrUndefined(module.fill) ? module.fill : legendSelectionColor, module.opacity.toString(), module.border.color, module.border.width.toString(), 'selection');
|
|
10671
|
-
this.setColor(
|
|
10672
|
-
if (this.maps.selectedElementId.indexOf(
|
|
10673
|
-
this.maps.selectedElementId.push(
|
|
10894
|
+
this.setColor(shapeElement, !isNullOrUndefined(module.fill) ? module.fill : legendSelectionColor, module.opacity.toString(), module.border.color, module.border.width.toString(), 'selection');
|
|
10895
|
+
if (this.maps.selectedElementId.indexOf(shapeElement.getAttribute('id')) === -1) {
|
|
10896
|
+
this.maps.selectedElementId.push(shapeElement.getAttribute('id'));
|
|
10674
10897
|
}
|
|
10675
10898
|
if (j === data.length - 1) {
|
|
10676
10899
|
this.maps.legendSelection = false;
|
|
@@ -10685,14 +10908,15 @@ class Legend {
|
|
|
10685
10908
|
}
|
|
10686
10909
|
}
|
|
10687
10910
|
setColor(element, fill, opacity, borderColor, borderWidth, type) {
|
|
10911
|
+
const isLineStringShape = (element.parentElement.id.indexOf('LineString') > -1);
|
|
10688
10912
|
if (type === 'selection') {
|
|
10689
|
-
maintainStyleClass('ShapeselectionMap', 'ShapeselectionMapStyle', fill, opacity, borderColor, borderWidth, this.maps);
|
|
10690
|
-
element.setAttribute('class', 'ShapeselectionMapStyle');
|
|
10913
|
+
maintainStyleClass((isLineStringShape ? 'LineselectionMap' : 'ShapeselectionMap'), (isLineStringShape ? 'LineselectionMapStyle' : 'ShapeselectionMapStyle'), (isLineStringShape ? 'transparent' : fill), opacity, (isLineStringShape ? fill : borderColor), borderWidth, this.maps);
|
|
10914
|
+
element.setAttribute('class', isLineStringShape ? 'LineselectionMapStyle' : 'ShapeselectionMapStyle');
|
|
10691
10915
|
}
|
|
10692
10916
|
else {
|
|
10693
|
-
element.setAttribute('fill', fill);
|
|
10917
|
+
element.setAttribute('fill', isLineStringShape ? 'transparent' : fill);
|
|
10694
10918
|
element.setAttribute('fill-opacity', opacity);
|
|
10695
|
-
element.setAttribute('stroke', borderColor);
|
|
10919
|
+
element.setAttribute('stroke', isLineStringShape ? fill : borderColor);
|
|
10696
10920
|
element.setAttribute('stroke-width', (Number(borderWidth) / this.maps.scale).toString());
|
|
10697
10921
|
}
|
|
10698
10922
|
}
|
|
@@ -10735,7 +10959,8 @@ class Legend {
|
|
|
10735
10959
|
const dataCount = shapeElements.length;
|
|
10736
10960
|
for (let j = 0; j < dataCount; j++) {
|
|
10737
10961
|
const shapeElement = getElement(shapeElements[j]);
|
|
10738
|
-
if (shapeElement.getAttribute('class') === 'ShapeselectionMapStyle'
|
|
10962
|
+
if (shapeElement.getAttribute('class') === 'ShapeselectionMapStyle' ||
|
|
10963
|
+
shapeElement.getAttribute('class') === 'LineselectionMapStyle') {
|
|
10739
10964
|
removeClass(shapeElement);
|
|
10740
10965
|
const selectedElementIdIndex = this.maps.selectedElementId.indexOf(shapeElement.id);
|
|
10741
10966
|
if (selectedElementIdIndex !== -1) {
|
|
@@ -10813,12 +11038,14 @@ class Legend {
|
|
|
10813
11038
|
this.maps.legendSelectionClass = module;
|
|
10814
11039
|
}
|
|
10815
11040
|
else {
|
|
10816
|
-
if ((checkSelection <= 1) && targetElement.getAttribute('class') === 'ShapeselectionMapStyle'
|
|
11041
|
+
if ((checkSelection <= 1) && (targetElement.getAttribute('class') === 'ShapeselectionMapStyle'
|
|
11042
|
+
|| targetElement.getAttribute('class') === 'LineselectionMapStyle')) {
|
|
10817
11043
|
if (!this.maps.layers[layerIndex].selectionSettings.enableMultiSelect) {
|
|
10818
11044
|
this.maps.selectedLegendElementId.splice(selectionIndex, 1);
|
|
10819
11045
|
}
|
|
10820
11046
|
else {
|
|
10821
|
-
if (checkSelection <= 1 && targetElement.getAttribute('class') === 'ShapeselectionMapStyle'
|
|
11047
|
+
if (checkSelection <= 1 && (targetElement.getAttribute('class') === 'ShapeselectionMapStyle'
|
|
11048
|
+
|| targetElement.getAttribute('class') === 'LineselectionMapStyle')) {
|
|
10822
11049
|
this.maps.selectedLegendElementId.splice(selectionIndex, 1);
|
|
10823
11050
|
}
|
|
10824
11051
|
}
|
|
@@ -10905,7 +11132,8 @@ class Legend {
|
|
|
10905
11132
|
}
|
|
10906
11133
|
}
|
|
10907
11134
|
}
|
|
10908
|
-
if (selectionEle && (selectionEle['IsSelected'] && targetElement.getAttribute('class') === 'ShapeselectionMapStyle'
|
|
11135
|
+
if (selectionEle && (selectionEle['IsSelected'] && (targetElement.getAttribute('class') === 'ShapeselectionMapStyle'
|
|
11136
|
+
|| targetElement.getAttribute('class') === 'LineselectionMapStyle'))) {
|
|
10909
11137
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10910
11138
|
const element = this.maps.legendSelectionCollection[selectionEle['SelectionIndex']];
|
|
10911
11139
|
let multiSelection = 0;
|
|
@@ -10996,7 +11224,7 @@ class Legend {
|
|
|
10996
11224
|
}
|
|
10997
11225
|
for (let j = 0; j < this.maps.selectedLegendElementId.length; j++) {
|
|
10998
11226
|
const idIndex = this.maps.legendSettings.mode === 'Interactive' ?
|
|
10999
|
-
'
|
|
11227
|
+
this.maps.element.id + '_Legend_Index_' : this.maps.element.id + '_Legend_Shape_Index_';
|
|
11000
11228
|
const selectedElement = idIndex + this.maps.selectedLegendElementId[j];
|
|
11001
11229
|
const legendElement = document.getElementById(selectedElement);
|
|
11002
11230
|
if (!isNullOrUndefined(legendElement)) {
|
|
@@ -11048,6 +11276,7 @@ class Legend {
|
|
|
11048
11276
|
let shapeIndex;
|
|
11049
11277
|
let layerIndex;
|
|
11050
11278
|
let dataIndex;
|
|
11279
|
+
let pointIndex;
|
|
11051
11280
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11052
11281
|
const collection = this.maps.legendModule.legendCollection;
|
|
11053
11282
|
const legend = this.maps.legendSettings;
|
|
@@ -11060,15 +11289,23 @@ class Legend {
|
|
|
11060
11289
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11061
11290
|
const currentElement = { Elements: [] };
|
|
11062
11291
|
for (let j = 0; j < data.length; j++) {
|
|
11292
|
+
let shapeElement;
|
|
11063
11293
|
shapeIndex = data[j]['shapeIndex'];
|
|
11064
11294
|
layerIndex = data[j]['layerIndex'];
|
|
11065
11295
|
dataIndex = data[j]['dataIndex'];
|
|
11066
|
-
|
|
11067
|
-
|
|
11068
|
-
|
|
11296
|
+
pointIndex = data[j]['pointIndex'];
|
|
11297
|
+
if (pointIndex === -1) {
|
|
11298
|
+
shapeElement = document.getElementById(this.maps.element.id + '_LayerIndex_' +
|
|
11299
|
+
layerIndex + '_shapeIndex_' + shapeIndex + '_dataIndex_' + dataIndex);
|
|
11300
|
+
}
|
|
11301
|
+
else {
|
|
11302
|
+
shapeElement = document.getElementById(this.maps.element.id + '_LayerIndex_' +
|
|
11303
|
+
layerIndex + '_shapeIndex_' + shapeIndex + '_dataIndex_' + dataIndex + '_multiLine_' + pointIndex);
|
|
11304
|
+
}
|
|
11305
|
+
if (targetElement === shapeElement) {
|
|
11069
11306
|
process = true;
|
|
11070
11307
|
}
|
|
11071
|
-
elements.push(
|
|
11308
|
+
elements.push(shapeElement);
|
|
11072
11309
|
}
|
|
11073
11310
|
if (process) {
|
|
11074
11311
|
if (isNullOrUndefined(currentElement['LegendEle'])) {
|
|
@@ -11086,16 +11323,25 @@ class Legend {
|
|
|
11086
11323
|
let shapeIndex;
|
|
11087
11324
|
let layerIndex;
|
|
11088
11325
|
let dataIndex;
|
|
11326
|
+
let pointIndex;
|
|
11089
11327
|
const idIndex = parseFloat(targetElement.id.charAt(targetElement.id.length - 1));
|
|
11090
11328
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11091
11329
|
const data = this.maps.legendModule.legendCollection[idIndex]['data'];
|
|
11092
11330
|
const legendShapeElements = [];
|
|
11093
11331
|
for (let i = 0; i < data.length; i++) {
|
|
11332
|
+
let shapeElement;
|
|
11094
11333
|
shapeIndex = data[i]['shapeIndex'];
|
|
11095
11334
|
layerIndex = data[i]['layerIndex'];
|
|
11096
11335
|
dataIndex = data[i]['dataIndex'];
|
|
11097
|
-
|
|
11098
|
-
|
|
11336
|
+
pointIndex = data[i]['pointIndex'];
|
|
11337
|
+
if (pointIndex === -1) {
|
|
11338
|
+
shapeElement = document.getElementById(this.maps.element.id + '_LayerIndex_' +
|
|
11339
|
+
layerIndex + '_shapeIndex_' + shapeIndex + '_dataIndex_' + dataIndex);
|
|
11340
|
+
}
|
|
11341
|
+
else {
|
|
11342
|
+
shapeElement = document.getElementById(this.maps.element.id + '_LayerIndex_' +
|
|
11343
|
+
layerIndex + '_shapeIndex_' + shapeIndex + '_dataIndex_' + dataIndex + '_multiLine_' + pointIndex);
|
|
11344
|
+
}
|
|
11099
11345
|
if (!isNullOrUndefined(shapeElement)) {
|
|
11100
11346
|
legendShapeElements.push(shapeElement.id);
|
|
11101
11347
|
}
|
|
@@ -11163,9 +11409,11 @@ class Legend {
|
|
|
11163
11409
|
const renderOptions = new RectOption(map.element.id + '_Legend_Border', legend.background, legendBorder, 1, this.legendBorderRect, null, null, '', '');
|
|
11164
11410
|
this.legendGroup.appendChild(map.renderer.drawRectangle(renderOptions));
|
|
11165
11411
|
this.getLegendAlignment(map, this.legendBorderRect.width, this.legendBorderRect.height, legend);
|
|
11166
|
-
this.legendGroup.setAttribute('transform', 'translate( ' + (this.translate.x + (-
|
|
11412
|
+
this.legendGroup.setAttribute('transform', 'translate( ' + (this.translate.x + (-this.legendBorderRect.x)) + ' ' +
|
|
11167
11413
|
(this.translate.y + (-(this.legendBorderRect.y))) + ' )');
|
|
11168
|
-
|
|
11414
|
+
if (legend.position !== 'Float') {
|
|
11415
|
+
map.svgObject.appendChild(this.legendGroup);
|
|
11416
|
+
}
|
|
11169
11417
|
if (legendTitle) {
|
|
11170
11418
|
textStyle.color = (textStyle.color !== null) ? textStyle.color : this.maps.themeStyle.legendTitleFontColor;
|
|
11171
11419
|
textStyle.fontFamily = !isNullOrUndefined(textStyle.fontFamily) ? textStyle.fontFamily : this.maps.themeStyle.fontFamily;
|
|
@@ -11177,7 +11425,16 @@ class Legend {
|
|
|
11177
11425
|
this.currentPage = (e.target.id.indexOf('_Left_Page_') > -1) ? (this.currentPage - 1) :
|
|
11178
11426
|
(this.currentPage + 1);
|
|
11179
11427
|
this.legendGroup = this.maps.renderer.createGroup({ id: this.maps.element.id + '_Legend_Group' });
|
|
11428
|
+
this.maps.mapAreaRect = this.initialMapAreaRect;
|
|
11180
11429
|
this.drawLegendItem(this.currentPage);
|
|
11430
|
+
if (!isNullOrUndefined(this.maps.legendModule) && this.maps.legendSettings.position === 'Float') {
|
|
11431
|
+
if (this.maps.isTileMap) {
|
|
11432
|
+
this.maps.mapLayerPanel.layerGroup.appendChild(this.maps.legendModule.legendGroup);
|
|
11433
|
+
}
|
|
11434
|
+
else {
|
|
11435
|
+
this.maps.svgObject.appendChild(this.maps.legendModule.legendGroup);
|
|
11436
|
+
}
|
|
11437
|
+
}
|
|
11181
11438
|
if (querySelector(this.maps.element.id + '_Legend_Border', this.maps.element.id)) {
|
|
11182
11439
|
querySelector(this.maps.element.id + '_Legend_Border', this.maps.element.id).style.pointerEvents = 'none';
|
|
11183
11440
|
}
|
|
@@ -11195,53 +11452,60 @@ class Legend {
|
|
|
11195
11452
|
const areaWidth = totalRect.width;
|
|
11196
11453
|
const totalWidth = map.availableSize.width;
|
|
11197
11454
|
const totalHeight = map.availableSize.height;
|
|
11455
|
+
const locationX = !isNullOrUndefined(legend.location.x) ? legend.location.x : 0;
|
|
11456
|
+
const locationY = !isNullOrUndefined(legend.location.y) ? legend.location.y : 0;
|
|
11198
11457
|
if (legend.position === 'Float') {
|
|
11199
|
-
this.translate =
|
|
11458
|
+
this.translate = map.isTileMap ? new Point(locationX, locationY + (spacing / 4)) : new Point(locationX + map.mapAreaRect.x, locationY + map.mapAreaRect.y);
|
|
11459
|
+
this.legendTotalRect = map.mapAreaRect;
|
|
11200
11460
|
}
|
|
11201
11461
|
else {
|
|
11202
11462
|
switch (legend.position) {
|
|
11203
11463
|
case 'Top':
|
|
11204
11464
|
case 'Bottom':
|
|
11205
|
-
totalRect.height = (areaHeight - height);
|
|
11465
|
+
totalRect.height = (legend.position === 'Top') ? (areaHeight - height) : (areaHeight - height - (spacing * 2));
|
|
11206
11466
|
x = (totalWidth / 2) - (width / 2);
|
|
11207
11467
|
y = (legend.position === 'Top') ? areaY : (areaY + totalRect.height);
|
|
11208
|
-
totalRect.y = (legend.position === 'Top') ? areaY + height + spacing : areaY;
|
|
11468
|
+
totalRect.y = (legend.position === 'Top') ? areaY + height + (map.isTileMap ? (spacing / 2) : spacing) : areaY - (spacing / 2);
|
|
11209
11469
|
break;
|
|
11210
11470
|
case 'Left':
|
|
11211
11471
|
case 'Right':
|
|
11212
|
-
totalRect.width = (areaWidth - width);
|
|
11213
|
-
x = (legend.position === 'Left') ? areaX : (areaX + totalRect.width
|
|
11472
|
+
totalRect.width = (areaWidth - width - map.mapAreaRect.x);
|
|
11473
|
+
x = (legend.position === 'Left') ? areaX + (spacing / 2) : (areaX + totalRect.width + spacing);
|
|
11214
11474
|
y = (totalHeight / 2) - (height / 2);
|
|
11215
|
-
totalRect.x = (legend.position === 'Left') ? areaX + width : areaX;
|
|
11475
|
+
totalRect.x = (legend.position === 'Left') ? areaX + width + spacing : areaX;
|
|
11216
11476
|
break;
|
|
11217
11477
|
}
|
|
11218
11478
|
switch (legend.alignment) {
|
|
11219
11479
|
case 'Near':
|
|
11220
11480
|
if (legend.position === 'Top' || legend.position === 'Bottom') {
|
|
11221
|
-
x = totalRect.x;
|
|
11481
|
+
x = totalRect.x - (legend.mode === 'Interactive' ? spacing : 0);
|
|
11222
11482
|
}
|
|
11223
11483
|
else {
|
|
11224
|
-
y = totalRect.y;
|
|
11484
|
+
y = totalRect.y - (!(legend.height && legend.width) && legend.mode === 'Interactive' ? map.mapAreaRect.x : 0);
|
|
11225
11485
|
}
|
|
11226
11486
|
break;
|
|
11227
11487
|
case 'Far':
|
|
11228
11488
|
if (legend.position === 'Top' || legend.position === 'Bottom') {
|
|
11229
|
-
x = (totalWidth - width) - spacing;
|
|
11489
|
+
x = (totalWidth - width) - (legend.mode === 'Interactive' ? 0 : spacing);
|
|
11230
11490
|
}
|
|
11231
11491
|
else {
|
|
11232
|
-
y = totalHeight - height;
|
|
11492
|
+
y = totalHeight - height - (legend.mode === 'Default' ? spacing : 0);
|
|
11233
11493
|
}
|
|
11234
11494
|
break;
|
|
11235
11495
|
}
|
|
11236
11496
|
if ((legend.height || legend.width) && legend.mode !== 'Interactive') {
|
|
11237
|
-
this.legendTotalRect = map.totalRect = totalRect;
|
|
11497
|
+
this.legendTotalRect = map.mapAreaRect = map.totalRect = totalRect;
|
|
11238
11498
|
}
|
|
11239
11499
|
else {
|
|
11500
|
+
map.totalRect = null;
|
|
11240
11501
|
if ((legend.height || legend.width) && legend.mode === 'Interactive') {
|
|
11241
11502
|
map.totalRect = totalRect;
|
|
11242
11503
|
}
|
|
11243
11504
|
this.legendTotalRect = map.mapAreaRect = totalRect;
|
|
11244
11505
|
}
|
|
11506
|
+
if (legend.position === 'Left') {
|
|
11507
|
+
map.mapAreaRect.width = totalRect.width;
|
|
11508
|
+
}
|
|
11245
11509
|
this.translate = new Point(x, y);
|
|
11246
11510
|
}
|
|
11247
11511
|
}
|
|
@@ -11362,6 +11626,13 @@ class Legend {
|
|
|
11362
11626
|
borderColor: legend.shapeBorder.color, borderWidth: legend.shapeBorder.width
|
|
11363
11627
|
});
|
|
11364
11628
|
}
|
|
11629
|
+
else {
|
|
11630
|
+
for (let i = 0; i < this.legendCollection.length; i++) {
|
|
11631
|
+
if (this.legendCollection[i]['text'] === legendText && this.legendCollection[i]['fill'] === legendFill) {
|
|
11632
|
+
this.legendCollection[i].data.push(newColllection[0]);
|
|
11633
|
+
}
|
|
11634
|
+
}
|
|
11635
|
+
}
|
|
11365
11636
|
}
|
|
11366
11637
|
}
|
|
11367
11638
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -11556,15 +11827,16 @@ class Legend {
|
|
|
11556
11827
|
const width = 10;
|
|
11557
11828
|
const direction = (legend.orientation === 'None') ? (legend.position === 'Top' || legend.position === 'Bottom')
|
|
11558
11829
|
? 'Horizontal' : 'Vertical' : legend.orientation;
|
|
11830
|
+
rect.y = legend.position === 'Float' && this.maps.isTileMap ? rect.y - this.maps.mapAreaRect.y : rect.y;
|
|
11559
11831
|
if (direction === 'Horizontal') {
|
|
11560
11832
|
if (!legend.invertedPointer) {
|
|
11561
|
-
locX = rect.x + (rect.width / 2);
|
|
11833
|
+
locX = rect.x + (rect.width / 2) - (legend.position === 'Float' && this.maps.isTileMap ? this.maps.mapAreaRect.x : 0);
|
|
11562
11834
|
locY = rect.y;
|
|
11563
11835
|
path = ' M ' + locX + ' ' + locY + ' L ' + (locX - width) + ' ' + (locY - height) +
|
|
11564
11836
|
' L ' + (locX + width) + ' ' + (locY - height) + ' Z ';
|
|
11565
11837
|
}
|
|
11566
11838
|
else {
|
|
11567
|
-
locX = rect.x + (rect.width / 2);
|
|
11839
|
+
locX = rect.x + (rect.width / 2) - (legend.position === 'Float' && this.maps.isTileMap ? this.maps.mapAreaRect.x : 0);
|
|
11568
11840
|
locY = rect.y + (rect.height);
|
|
11569
11841
|
path = ' M ' + locX + ' ' + locY + ' L ' + (locX - width) + ' ' + (locY + height) +
|
|
11570
11842
|
' L ' + (locX + width) + ' ' + (locY + height) + ' Z ';
|
|
@@ -11572,20 +11844,25 @@ class Legend {
|
|
|
11572
11844
|
}
|
|
11573
11845
|
else {
|
|
11574
11846
|
if (!legend.invertedPointer) {
|
|
11575
|
-
locX = rect.x +
|
|
11847
|
+
locX = rect.x + rect.width - (legend.position === 'Float' && this.maps.isTileMap ? this.maps.mapAreaRect.x : 0);
|
|
11576
11848
|
locY = rect.y + (rect.height / 2);
|
|
11577
11849
|
path = ' M ' + locX + ' ' + locY + ' L ' + (locX + width) + ' ' + (locY - height) +
|
|
11578
11850
|
' L ' + (locX + width) + ' ' + (locY + height) + ' z ';
|
|
11579
11851
|
}
|
|
11580
11852
|
else {
|
|
11581
|
-
locX = rect.x;
|
|
11853
|
+
locX = rect.x - (legend.position === 'Float' && this.maps.isTileMap ? this.maps.mapAreaRect.x : 0);
|
|
11582
11854
|
locY = rect.y + (rect.height / 2);
|
|
11583
11855
|
path = ' M ' + locX + ' ' + locY + ' L ' + (locX - width) + ' ' + (locY - height) +
|
|
11584
11856
|
' L ' + (locX - width) + ' ' + (locY + height) + ' z ';
|
|
11585
11857
|
}
|
|
11586
11858
|
}
|
|
11587
11859
|
const pathOptions = new PathOption(id, fill, strokeWidth, stroke, 1, 1, '', path);
|
|
11588
|
-
|
|
11860
|
+
if (legend.position === 'Float' && this.maps.isTileMap) {
|
|
11861
|
+
this.maps.mapLayerPanel.layerGroup.appendChild(this.maps.renderer.drawPath(pathOptions));
|
|
11862
|
+
}
|
|
11863
|
+
else {
|
|
11864
|
+
this.maps.svgObject.appendChild(this.maps.renderer.drawPath(pathOptions));
|
|
11865
|
+
}
|
|
11589
11866
|
}
|
|
11590
11867
|
wireEvents(element) {
|
|
11591
11868
|
EventHandler.add(element, Browser.touchStartEvent, this.changeNextPage, this);
|
|
@@ -11946,10 +12223,20 @@ class Legend {
|
|
|
11946
12223
|
const shapeDataValueCase = !isNullOrUndefined(shapeData['properties'][shapePath])
|
|
11947
12224
|
&& isNaN(shapeData['properties'][shapePath]) ? shapeData['properties'][shapePath].toLowerCase() : shapeData['properties'][shapePath];
|
|
11948
12225
|
if (shapeDataValueCase === dataPathValueCase) {
|
|
11949
|
-
|
|
11950
|
-
|
|
11951
|
-
|
|
11952
|
-
|
|
12226
|
+
if (shapeData['geometry']['type'] != 'MultiPoint') {
|
|
12227
|
+
legendData.push({
|
|
12228
|
+
layerIndex: layerIndex, shapeIndex: i, dataIndex: dataIndex,
|
|
12229
|
+
name: data[dataPath], value: value, pointIndex: -1
|
|
12230
|
+
});
|
|
12231
|
+
}
|
|
12232
|
+
else {
|
|
12233
|
+
for (let j = 0; j < shapeData['geometry'].coordinates.length; j++) {
|
|
12234
|
+
legendData.push({
|
|
12235
|
+
layerIndex: layerIndex, shapeIndex: i, dataIndex: dataIndex,
|
|
12236
|
+
name: data[dataPath], value: value, pointIndex: j
|
|
12237
|
+
});
|
|
12238
|
+
}
|
|
12239
|
+
}
|
|
11953
12240
|
}
|
|
11954
12241
|
}
|
|
11955
12242
|
}
|
|
@@ -12060,7 +12347,8 @@ class Highlight {
|
|
|
12060
12347
|
targetEle.getAttribute('class') !== 'ShapeselectionMapStyle' && !isTouch &&
|
|
12061
12348
|
targetEle.getAttribute('class') !== 'MarkerselectionMapStyle' &&
|
|
12062
12349
|
targetEle.getAttribute('class') !== 'BubbleselectionMapStyle' &&
|
|
12063
|
-
targetEle.getAttribute('class') !== 'navigationlineselectionMapStyle'
|
|
12350
|
+
targetEle.getAttribute('class') !== 'navigationlineselectionMapStyle' &&
|
|
12351
|
+
targetEle.getAttribute('class') !== 'LineselectionMapStyle') {
|
|
12064
12352
|
layerIndex = parseInt(targetEle.id.split('_LayerIndex_')[1].split('_')[0], 10);
|
|
12065
12353
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12066
12354
|
let shapeData;
|
|
@@ -12070,8 +12358,9 @@ class Highlight {
|
|
|
12070
12358
|
let dataIndex;
|
|
12071
12359
|
if (targetEle.id.indexOf('shapeIndex') > -1) {
|
|
12072
12360
|
shapeIn = parseInt(targetEle.id.split('_shapeIndex_')[1].split('_')[0], 10);
|
|
12073
|
-
shapeData = this.maps.layers[layerIndex].shapeData['features']
|
|
12074
|
-
this.maps.
|
|
12361
|
+
shapeData = this.maps.layers[layerIndex].shapeData['features'] &&
|
|
12362
|
+
!isNullOrUndefined(this.maps.layersCollection[layerIndex].layerData[shapeIn]) ?
|
|
12363
|
+
this.maps.layersCollection[layerIndex].layerData[shapeIn]['property'] : null;
|
|
12075
12364
|
dataIndex = parseInt(targetEle.id.split('_dataIndex_')[1].split('_')[0], 10);
|
|
12076
12365
|
data = isNullOrUndefined(dataIndex) ? null : this.maps.layers[layerIndex].dataSource[dataIndex];
|
|
12077
12366
|
this.highlightSettings = this.maps.layers[layerIndex].highlightSettings;
|
|
@@ -12143,7 +12432,8 @@ class Highlight {
|
|
|
12143
12432
|
*/
|
|
12144
12433
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12145
12434
|
handleHighlight(targetElement, layerIndex, data, shapeData) {
|
|
12146
|
-
if (this.maps.legendSettings.visible && targetElement.id.indexOf('_MarkerIndex_') === -1 && this.maps.legendModule
|
|
12435
|
+
if (this.maps.legendSettings.visible && targetElement.id.indexOf('_MarkerIndex_') === -1 && this.maps.legendModule
|
|
12436
|
+
&& this.maps.legendSettings.type === 'Layers') {
|
|
12147
12437
|
this.maps.legendModule.shapeHighLightAndSelection(targetElement, data, this.highlightSettings, 'highlight', layerIndex);
|
|
12148
12438
|
}
|
|
12149
12439
|
const selectHighLight = targetElement.id.indexOf('shapeIndex') > -1 && (this.maps.legendSettings.visible && this.maps.legendModule) ?
|
|
@@ -12161,7 +12451,7 @@ class Highlight {
|
|
|
12161
12451
|
isMarkerSelect = this.maps.layers[layerIndex].markerSettings[marker$$1].highlightSettings.enable;
|
|
12162
12452
|
}
|
|
12163
12453
|
const border = {
|
|
12164
|
-
color: (targetEle.parentElement.id.indexOf('LineString') === -1) ? this.highlightSettings.border.color : (this.highlightSettings.
|
|
12454
|
+
color: (targetEle.parentElement.id.indexOf('LineString') === -1) ? this.highlightSettings.border.color : (this.highlightSettings.fill || this.highlightSettings.border.color),
|
|
12165
12455
|
width: (targetEle.parentElement.id.indexOf('LineString') === -1) ? (this.highlightSettings.border.width / (isMarkerSelect ? 1 : this.maps.scale)) : (this.highlightSettings.border.width / this.maps.scale),
|
|
12166
12456
|
opacity: this.highlightSettings.border.opacity
|
|
12167
12457
|
};
|
|
@@ -12245,7 +12535,6 @@ class Selection {
|
|
|
12245
12535
|
addEventListener() {
|
|
12246
12536
|
if (!this.maps.isDestroyed) {
|
|
12247
12537
|
this.maps.on(click, this.mouseClick, this);
|
|
12248
|
-
this.maps.on(Browser.touchEndEvent, this.mouseClick, this);
|
|
12249
12538
|
}
|
|
12250
12539
|
}
|
|
12251
12540
|
/**
|
|
@@ -12258,7 +12547,6 @@ class Selection {
|
|
|
12258
12547
|
return;
|
|
12259
12548
|
}
|
|
12260
12549
|
this.maps.off(click, this.mouseClick);
|
|
12261
|
-
this.maps.off(Browser.touchEndEvent, this.mouseClick);
|
|
12262
12550
|
}
|
|
12263
12551
|
mouseClick(targetElement) {
|
|
12264
12552
|
if (!isNullOrUndefined(targetElement['type']) && targetElement['type'].indexOf('touch') !== -1 &&
|
|
@@ -12276,8 +12564,12 @@ class Selection {
|
|
|
12276
12564
|
const layerIndex = parseInt(targetElement.id.split('_LayerIndex_')[1].split('_')[0], 10);
|
|
12277
12565
|
if (targetElement.id.indexOf('shapeIndex') > -1) {
|
|
12278
12566
|
shapeIndex = parseInt(targetElement.id.split('_shapeIndex_')[1].split('_')[0], 10);
|
|
12279
|
-
shapeData = this.maps.layers[layerIndex].shapeData['features']
|
|
12280
|
-
this.maps.layers[layerIndex].shapeData['features'][
|
|
12567
|
+
shapeData = !isNullOrUndefined(this.maps.layers[layerIndex].shapeData['features'])
|
|
12568
|
+
&& this.maps.layers[layerIndex].shapeData['features']['length'] > shapeIndex ?
|
|
12569
|
+
this.maps.layers[layerIndex].shapeData['features'][shapeIndex]['properties'] :
|
|
12570
|
+
!isNullOrUndefined(this.maps.layers[layerIndex].shapeData['geometries'])
|
|
12571
|
+
&& this.maps.layers[layerIndex].shapeData['geometries']['length'] > shapeIndex ?
|
|
12572
|
+
this.maps.layers[layerIndex].shapeData['geometries'][shapeIndex]['properties'] : null;
|
|
12281
12573
|
dataIndex = parseInt(targetElement.id.split('_dataIndex_')[1].split('_')[0], 10);
|
|
12282
12574
|
data = isNullOrUndefined(dataIndex) ? null : this.maps.layers[layerIndex].dataSource[dataIndex];
|
|
12283
12575
|
this.selectionsettings = this.maps.layers[layerIndex].selectionSettings;
|
|
@@ -12357,15 +12649,17 @@ class Selection {
|
|
|
12357
12649
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12358
12650
|
selectMap(targetElement, shapeData, data) {
|
|
12359
12651
|
const layerIndex = parseInt(targetElement.id.split('_LayerIndex_')[1].split('_')[0], 10);
|
|
12652
|
+
const isLineStringShape = targetElement.parentElement.id.indexOf('LineString') > -1;
|
|
12360
12653
|
const selectionsettings = this.selectionsettings;
|
|
12361
12654
|
const border = {
|
|
12362
|
-
color: (
|
|
12363
|
-
width:
|
|
12655
|
+
color: isLineStringShape ? (this.selectionsettings.fill || this.selectionsettings.border.color) : this.selectionsettings.border.color,
|
|
12656
|
+
width: isLineStringShape ? (this.selectionsettings.border.width / this.maps.scale) :
|
|
12657
|
+
(this.selectionsettings.border.width / (this.selectionType === 'Marker' ? 1 : this.maps.scale)),
|
|
12364
12658
|
opacity: this.selectionsettings.border.opacity
|
|
12365
12659
|
};
|
|
12366
12660
|
const eventArgs = {
|
|
12367
12661
|
opacity: this.selectionsettings.opacity,
|
|
12368
|
-
fill:
|
|
12662
|
+
fill: isLineStringShape ? 'transparent' : (this.selectionType !== 'navigationline' ? this.selectionsettings.fill : 'none'),
|
|
12369
12663
|
border: border,
|
|
12370
12664
|
name: itemSelection,
|
|
12371
12665
|
target: targetElement.id,
|
|
@@ -12377,7 +12671,8 @@ class Selection {
|
|
|
12377
12671
|
this.maps.trigger('itemSelection', eventArgs, (observedArgs) => {
|
|
12378
12672
|
eventArgs.border.opacity = isNullOrUndefined(this.selectionsettings.border.opacity) ? this.selectionsettings.opacity : this.selectionsettings.border.opacity;
|
|
12379
12673
|
if (!eventArgs.cancel) {
|
|
12380
|
-
if (targetElement.getAttribute('class') === this.selectionType + 'selectionMapStyle'
|
|
12674
|
+
if (targetElement.getAttribute('class') === this.selectionType + 'selectionMapStyle'
|
|
12675
|
+
|| targetElement.getAttribute('class') === 'LineselectionMapStyle') {
|
|
12381
12676
|
removeClass(targetElement);
|
|
12382
12677
|
this.removedSelectionList(targetElement);
|
|
12383
12678
|
for (let m = 0; m < this.maps.shapeSelectionItem.length; m++) {
|
|
@@ -12396,14 +12691,23 @@ class Selection {
|
|
|
12396
12691
|
else {
|
|
12397
12692
|
const layetElement = getElementByID(this.maps.element.id + '_Layer_Collections');
|
|
12398
12693
|
if (!this.selectionsettings.enableMultiSelect &&
|
|
12399
|
-
layetElement.getElementsByClassName(this.selectionType + 'selectionMapStyle').length > 0
|
|
12400
|
-
|
|
12694
|
+
(layetElement.getElementsByClassName(this.selectionType + 'selectionMapStyle').length > 0 ||
|
|
12695
|
+
layetElement.getElementsByClassName('LineselectionMapStyle').length > 0)) {
|
|
12696
|
+
let eleCount = layetElement.getElementsByClassName(this.selectionType + 'selectionMapStyle').length;
|
|
12401
12697
|
let ele;
|
|
12402
12698
|
for (let k = 0; k < eleCount; k++) {
|
|
12403
12699
|
ele = layetElement.getElementsByClassName(this.selectionType + 'selectionMapStyle')[0];
|
|
12404
12700
|
removeClass(ele);
|
|
12405
12701
|
this.removedSelectionList(ele);
|
|
12406
12702
|
}
|
|
12703
|
+
if (layetElement.getElementsByClassName('LineselectionMapStyle').length > 0) {
|
|
12704
|
+
eleCount = layetElement.getElementsByClassName('LineselectionMapStyle').length;
|
|
12705
|
+
for (let k = 0; k < eleCount; k++) {
|
|
12706
|
+
ele = layetElement.getElementsByClassName('LineselectionMapStyle')[0];
|
|
12707
|
+
removeClass(ele);
|
|
12708
|
+
this.removedSelectionList(ele);
|
|
12709
|
+
}
|
|
12710
|
+
}
|
|
12407
12711
|
if (this.selectionType === 'Shape') {
|
|
12408
12712
|
this.maps.shapeSelectionItem = [];
|
|
12409
12713
|
const selectionLength = this.maps.selectedElementId.length;
|
|
@@ -12421,13 +12725,24 @@ class Selection {
|
|
|
12421
12725
|
ele.setAttribute('stroke', this.maps.layers[layerIndex].navigationLineSettings[index].color);
|
|
12422
12726
|
}
|
|
12423
12727
|
}
|
|
12424
|
-
if (!
|
|
12425
|
-
|
|
12728
|
+
if (!isLineStringShape) {
|
|
12729
|
+
if (!getElement(this.selectionType + 'selectionMap')) {
|
|
12730
|
+
document.body.appendChild(createStyle(this.selectionType + 'selectionMap', this.selectionType + 'selectionMapStyle', eventArgs));
|
|
12731
|
+
}
|
|
12732
|
+
else {
|
|
12733
|
+
customizeStyle(this.selectionType + 'selectionMap', this.selectionType + 'selectionMapStyle', eventArgs);
|
|
12734
|
+
}
|
|
12735
|
+
targetElement.setAttribute('class', this.selectionType + 'selectionMapStyle');
|
|
12426
12736
|
}
|
|
12427
12737
|
else {
|
|
12428
|
-
|
|
12738
|
+
if (!getElement('LineselectionMap')) {
|
|
12739
|
+
document.body.appendChild(createStyle('LineselectionMap', 'LineselectionMapStyle', eventArgs));
|
|
12740
|
+
}
|
|
12741
|
+
else {
|
|
12742
|
+
customizeStyle('LineselectionMap', 'LineselectionMapStyle', eventArgs);
|
|
12743
|
+
}
|
|
12744
|
+
targetElement.setAttribute('class', 'LineselectionMapStyle');
|
|
12429
12745
|
}
|
|
12430
|
-
targetElement.setAttribute('class', this.selectionType + 'selectionMapStyle');
|
|
12431
12746
|
if (targetElement.getAttribute('class') === 'ShapeselectionMapStyle') {
|
|
12432
12747
|
this.maps.shapeSelectionClass = getElement(this.selectionType + 'selectionMap');
|
|
12433
12748
|
this.maps.selectedElementId.push(targetElement.getAttribute('id'));
|
|
@@ -12687,7 +13002,7 @@ class MapsTooltip {
|
|
|
12687
13002
|
options: tooltipOption,
|
|
12688
13003
|
fill: option.fill,
|
|
12689
13004
|
maps: this.maps,
|
|
12690
|
-
element: target, eventArgs: e
|
|
13005
|
+
element: target, eventArgs: e, content: !isNullOrUndefined(currentData) ? currentData.toString() : ''
|
|
12691
13006
|
};
|
|
12692
13007
|
this.maps.trigger(tooltipRender, tooltipArgs, (args) => {
|
|
12693
13008
|
if (!tooltipArgs.cancel && option.visible && !isNullOrUndefined(currentData) &&
|
|
@@ -12705,7 +13020,7 @@ class MapsTooltip {
|
|
|
12705
13020
|
header: '',
|
|
12706
13021
|
data: option['data'],
|
|
12707
13022
|
template: option['template'],
|
|
12708
|
-
content: [currentData.toString()],
|
|
13023
|
+
content: tooltipArgs.content.toString() != currentData.toString() ? [tooltipArgs.content.toString()] : [currentData.toString()],
|
|
12709
13024
|
shapes: [],
|
|
12710
13025
|
location: option['location'],
|
|
12711
13026
|
palette: [markerFill],
|
|
@@ -12721,7 +13036,7 @@ class MapsTooltip {
|
|
|
12721
13036
|
header: '',
|
|
12722
13037
|
data: tooltipArgs.options['data'],
|
|
12723
13038
|
template: tooltipArgs.options['template'],
|
|
12724
|
-
content: [currentData.toString()],
|
|
13039
|
+
content: tooltipArgs.content.toString() != currentData.toString() ? [tooltipArgs.content.toString()] : [currentData.toString()],
|
|
12725
13040
|
shapes: [],
|
|
12726
13041
|
location: tooltipArgs.options['location'],
|
|
12727
13042
|
palette: [markerFill],
|
|
@@ -12904,8 +13219,6 @@ class Zoom {
|
|
|
12904
13219
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12905
13220
|
this.startTouches = [];
|
|
12906
13221
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12907
|
-
this.shapeZoomLocation = [];
|
|
12908
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12909
13222
|
this.intersect = [];
|
|
12910
13223
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12911
13224
|
this.mouseDownLatLong = { x: 0, y: 0 };
|
|
@@ -12944,25 +13257,38 @@ class Zoom {
|
|
|
12944
13257
|
const minZoom = map.zoomSettings.minZoom;
|
|
12945
13258
|
newZoomFactor = (minZoom > newZoomFactor && type === 'ZoomIn') ? minZoom + 1 : newZoomFactor;
|
|
12946
13259
|
const prevTilePoint = map.tileTranslatePoint;
|
|
12947
|
-
if ((!map.isTileMap) && (type === 'ZoomIn' ? newZoomFactor >= minZoom && newZoomFactor <= maxZoom : newZoomFactor >= minZoom)
|
|
13260
|
+
if ((!map.isTileMap) && ((type === 'ZoomIn' ? newZoomFactor >= minZoom && newZoomFactor <= maxZoom : newZoomFactor >= minZoom)
|
|
13261
|
+
|| map.isReset)) {
|
|
12948
13262
|
const availSize = map.mapAreaRect;
|
|
12949
13263
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12950
13264
|
const minBounds = map.baseMapRectBounds['min'];
|
|
12951
13265
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12952
13266
|
const maxBounds = map.baseMapRectBounds['max'];
|
|
12953
|
-
|
|
12954
|
-
|
|
12955
|
-
|
|
12956
|
-
let
|
|
12957
|
-
|
|
12958
|
-
|
|
12959
|
-
|
|
12960
|
-
|
|
12961
|
-
|
|
13267
|
+
let mapTotalWidth = Math.abs(minBounds['x'] - maxBounds['x']);
|
|
13268
|
+
let mapTotalHeight = Math.abs(minBounds['y'] - maxBounds['y']);
|
|
13269
|
+
let translatePointX;
|
|
13270
|
+
let translatePointY;
|
|
13271
|
+
if (newZoomFactor < 1.2 && map.projectionType !== 'Eckert5') {
|
|
13272
|
+
if (mapTotalWidth === 0 || mapTotalHeight === 0 || mapTotalWidth === mapTotalHeight) {
|
|
13273
|
+
mapTotalWidth = availSize.width / 2;
|
|
13274
|
+
mapTotalHeight = availSize.height;
|
|
13275
|
+
}
|
|
13276
|
+
newZoomFactor = parseFloat(Math.min(availSize.width / mapTotalWidth, availSize.height / mapTotalHeight).toFixed(2));
|
|
13277
|
+
map.translatePoint = this.calculateInitalZoomTranslatePoint(newZoomFactor, mapTotalWidth, mapTotalHeight, availSize, minBounds, map);
|
|
13278
|
+
}
|
|
13279
|
+
else {
|
|
13280
|
+
const point = map.translatePoint;
|
|
13281
|
+
translatePointX = point.x - (((availSize.width / scale) - (availSize.width / newZoomFactor)) / (availSize.width / position.x));
|
|
13282
|
+
translatePointY = point.y - (((availSize.height / scale) - (availSize.height / newZoomFactor)) / (availSize.height / position.y));
|
|
13283
|
+
const currentHeight = Math.abs(map.baseMapRectBounds['max']['y'] - map.baseMapRectBounds['min']['y']) * newZoomFactor;
|
|
13284
|
+
translatePointX = (currentHeight < map.mapAreaRect.height) ? (availSize.x + ((-(minBounds['x'])) + ((availSize.width / 2) - (mapTotalWidth / 2)))) : translatePointX;
|
|
13285
|
+
translatePointY = (currentHeight < map.mapAreaRect.height) ? (availSize.y + ((-(minBounds['y'])) + ((availSize.height / 2) - (mapTotalHeight / 2)))) : translatePointY;
|
|
13286
|
+
map.translatePoint = new Point(translatePointX, translatePointY);
|
|
13287
|
+
}
|
|
12962
13288
|
map.scale = newZoomFactor;
|
|
12963
13289
|
if (this.triggerZoomEvent(prevTilePoint, prevLevel, type)) {
|
|
12964
13290
|
map.translatePoint = map.previousPoint;
|
|
12965
|
-
map.scale = map.previousScale;
|
|
13291
|
+
map.scale = map.mapScaleValue = map.previousScale;
|
|
12966
13292
|
}
|
|
12967
13293
|
else {
|
|
12968
13294
|
this.applyTransform();
|
|
@@ -13018,6 +13344,14 @@ class Zoom {
|
|
|
13018
13344
|
}
|
|
13019
13345
|
this.maps.zoomNotApplied = false;
|
|
13020
13346
|
}
|
|
13347
|
+
calculateInitalZoomTranslatePoint(newZoomFactor, mapTotalWidth, mapTotalHeight, availSize, minBounds, map) {
|
|
13348
|
+
mapTotalWidth *= newZoomFactor;
|
|
13349
|
+
mapTotalHeight *= newZoomFactor;
|
|
13350
|
+
let widthDiff = minBounds['x'] !== 0 && map.translateType === 'layers' ? map.availableSize.width - availSize.width : 0;
|
|
13351
|
+
var translatePointX = availSize.x + ((-(minBounds['x'])) + ((availSize.width / 2) - (mapTotalWidth / 2))) - widthDiff;
|
|
13352
|
+
var translatePointY = availSize.y + ((-(minBounds['y'])) + ((availSize.height / 2) - (mapTotalHeight / 2)));
|
|
13353
|
+
return new Point(translatePointX, translatePointY);
|
|
13354
|
+
}
|
|
13021
13355
|
triggerZoomEvent(prevTilePoint, prevLevel, type) {
|
|
13022
13356
|
const map = this.maps;
|
|
13023
13357
|
let zoomArgs;
|
|
@@ -13134,22 +13468,34 @@ class Zoom {
|
|
|
13134
13468
|
this.lastScale = scale;
|
|
13135
13469
|
this.pinchFactor *= newScale;
|
|
13136
13470
|
this.pinchFactor = Math.min(this.maps.zoomSettings.maxZoom, Math.max(this.pinchFactor, this.maps.zoomSettings.minZoom));
|
|
13137
|
-
|
|
13471
|
+
let zoomCalculationFactor = this.pinchFactor;
|
|
13138
13472
|
let isZoomCancelled;
|
|
13139
13473
|
if (!map.isTileMap) {
|
|
13140
13474
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13141
13475
|
const minBounds = map.baseMapRectBounds['min'];
|
|
13142
13476
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13143
13477
|
const maxBounds = map.baseMapRectBounds['max'];
|
|
13144
|
-
|
|
13145
|
-
|
|
13478
|
+
let mapTotalHeight = Math.abs(minBounds['y'] - maxBounds['y']);
|
|
13479
|
+
let mapTotalWidth = Math.abs(minBounds['x'] - maxBounds['x']);
|
|
13146
13480
|
const translatePoint = map.translatePoint;
|
|
13147
|
-
|
|
13148
|
-
let
|
|
13149
|
-
|
|
13150
|
-
|
|
13151
|
-
|
|
13152
|
-
|
|
13481
|
+
let translatePointX;
|
|
13482
|
+
let translatePointY;
|
|
13483
|
+
if (zoomCalculationFactor < 1.2 && map.projectionType !== 'Eckert5') {
|
|
13484
|
+
if (mapTotalWidth === 0 || mapTotalHeight === 0 || mapTotalWidth === mapTotalHeight) {
|
|
13485
|
+
mapTotalWidth = availSize.width / 2;
|
|
13486
|
+
mapTotalHeight = availSize.height;
|
|
13487
|
+
}
|
|
13488
|
+
zoomCalculationFactor = parseFloat(Math.min(availSize.width / mapTotalWidth, availSize.height / mapTotalHeight).toFixed(2));
|
|
13489
|
+
map.translatePoint = this.calculateInitalZoomTranslatePoint(zoomCalculationFactor, mapTotalWidth, mapTotalHeight, availSize, minBounds, map);
|
|
13490
|
+
}
|
|
13491
|
+
else {
|
|
13492
|
+
const currentHeight = Math.abs(map.baseMapRectBounds['max']['y'] - map.baseMapRectBounds['min']['y']) * zoomCalculationFactor;
|
|
13493
|
+
translatePointX = translatePoint.x - (((availSize.width / map.scale) - (availSize.width / zoomCalculationFactor)) / (availSize.width / touchCenter.x));
|
|
13494
|
+
translatePointY = translatePoint.y - (((availSize.height / map.scale) - (availSize.height / zoomCalculationFactor)) / (availSize.height / touchCenter.y));
|
|
13495
|
+
translatePointX = (currentHeight < map.mapAreaRect.height) ? (availSize.x + ((-(minBounds['x'])) + ((availSize.width / 2) - (mapTotalWidth / 2)))) : translatePointX;
|
|
13496
|
+
translatePointY = (currentHeight < map.mapAreaRect.height) ? (availSize.y + ((-(minBounds['y'])) + ((availSize.height / 2) - (mapTotalHeight / 2)))) : translatePointY;
|
|
13497
|
+
map.translatePoint = new Point(translatePointX, translatePointY);
|
|
13498
|
+
}
|
|
13153
13499
|
map.scale = zoomCalculationFactor;
|
|
13154
13500
|
isZoomCancelled = this.triggerZoomEvent(prevTilePoint, prevLevel, '');
|
|
13155
13501
|
if (isZoomCancelled) {
|
|
@@ -13252,17 +13598,16 @@ class Zoom {
|
|
|
13252
13598
|
if (this.maps.isTileMap && (currentEle.id.indexOf('_line_Group') > -1)) {
|
|
13253
13599
|
currentEle.remove();
|
|
13254
13600
|
if (layerElement.children.length > 0 && layerElement.children[0]) {
|
|
13255
|
-
layerElement.insertBefore(this.maps.navigationLineModule.renderNavigation(this.currentLayer, this.maps.tileZoomLevel, this.index), layerElement.children[
|
|
13601
|
+
layerElement.insertBefore(this.maps.navigationLineModule.renderNavigation(this.currentLayer, this.maps.tileZoomLevel, this.index), layerElement.children[1]);
|
|
13256
13602
|
}
|
|
13257
13603
|
else {
|
|
13258
13604
|
layerElement.appendChild(this.maps.navigationLineModule.renderNavigation(this.currentLayer, this.maps.tileZoomLevel, this.index));
|
|
13259
13605
|
}
|
|
13260
13606
|
}
|
|
13261
|
-
else {
|
|
13607
|
+
else if (currentEle.id.indexOf('Legend') == -1) {
|
|
13262
13608
|
changeBorderWidth(currentEle, this.index, scale, this.maps);
|
|
13263
13609
|
this.maps.zoomTranslatePoint = this.maps.translatePoint;
|
|
13264
13610
|
this.animateTransform(currentEle, animate$$1, x, y, scale);
|
|
13265
|
-
this.shapeZoomLocation = currentEle.childNodes;
|
|
13266
13611
|
}
|
|
13267
13612
|
}
|
|
13268
13613
|
else if (currentEle.id.indexOf('_Markers_Group') > -1) {
|
|
@@ -13362,16 +13707,17 @@ class Zoom {
|
|
|
13362
13707
|
}
|
|
13363
13708
|
}
|
|
13364
13709
|
}
|
|
13365
|
-
else if (currentEle.id.indexOf('_dataLableIndex_Group') > -1) {
|
|
13710
|
+
else if (currentEle.id.indexOf('_dataLableIndex_Group') > -1 && !isNullOrUndefined(this.maps.layers[this.index])) {
|
|
13366
13711
|
this.intersect = [];
|
|
13367
13712
|
this.maps.zoomLabelPositions = [];
|
|
13368
13713
|
this.maps.zoomLabelPositions = this.maps.dataLabelModule.dataLabelCollections;
|
|
13714
|
+
let labelAnimate = !this.maps.isTileMap && animate$$1;
|
|
13369
13715
|
for (let k = 0; k < currentEle.childElementCount; k++) {
|
|
13370
13716
|
if (currentEle.childNodes[k]['id'].indexOf('_LabelIndex_') > -1) {
|
|
13371
13717
|
const labelIndex = parseFloat(currentEle.childNodes[k]['id'].split('_LabelIndex_')[1].split('_')[0]);
|
|
13372
|
-
this.zoomshapewidth =
|
|
13718
|
+
this.zoomshapewidth = currentEle.childNodes[k].getBoundingClientRect();
|
|
13373
13719
|
this.maps.zoomShapeCollection.push(this.zoomshapewidth);
|
|
13374
|
-
this.dataLabelTranslate(currentEle.childNodes[k], factor, x, y, scale, 'DataLabel',
|
|
13720
|
+
this.dataLabelTranslate(currentEle.childNodes[k], factor, x, y, scale, 'DataLabel', labelAnimate);
|
|
13375
13721
|
const dataLabel = this.maps.layers[this.index].dataLabelSettings;
|
|
13376
13722
|
const border = dataLabel.border;
|
|
13377
13723
|
if (k > 0 && border['width'] > 1) {
|
|
@@ -13585,7 +13931,7 @@ class Zoom {
|
|
|
13585
13931
|
}
|
|
13586
13932
|
if (this.maps.layers[this.index].dataLabelSettings.smartLabelMode === 'Hide') {
|
|
13587
13933
|
if (scale > 1) {
|
|
13588
|
-
text = (this.
|
|
13934
|
+
text = ((this.maps.dataLabelShape[l] * scale) >= zoomtextSize['width']) ? zoomtext : '';
|
|
13589
13935
|
element.innerHTML = text;
|
|
13590
13936
|
}
|
|
13591
13937
|
else {
|
|
@@ -13595,7 +13941,7 @@ class Zoom {
|
|
|
13595
13941
|
}
|
|
13596
13942
|
if (this.maps.layers[this.index].dataLabelSettings.smartLabelMode === 'Trim') {
|
|
13597
13943
|
if (scale > 1) {
|
|
13598
|
-
zoomtrimLabel = textTrim(this.
|
|
13944
|
+
zoomtrimLabel = textTrim((this.maps.dataLabelShape[l] * scale), zoomtext, style);
|
|
13599
13945
|
text = zoomtrimLabel;
|
|
13600
13946
|
element.innerHTML = text;
|
|
13601
13947
|
}
|
|
@@ -13633,7 +13979,7 @@ class Zoom {
|
|
|
13633
13979
|
|| textLocations['heightTop'] > this.intersect[j]['heightBottom']) {
|
|
13634
13980
|
trimmedLable = !isNullOrUndefined(text) ? text : zoomtext;
|
|
13635
13981
|
if (scale > 1) {
|
|
13636
|
-
trimmedLable = textTrim(this.
|
|
13982
|
+
trimmedLable = textTrim((this.maps.dataLabelShape[l] * scale), trimmedLable, style);
|
|
13637
13983
|
}
|
|
13638
13984
|
element.innerHTML = trimmedLable;
|
|
13639
13985
|
}
|
|
@@ -13659,11 +14005,11 @@ class Zoom {
|
|
|
13659
14005
|
}
|
|
13660
14006
|
this.intersect.push(textLocations);
|
|
13661
14007
|
if (isNullOrUndefined(trimmedLable)) {
|
|
13662
|
-
trimmedLable = textTrim(this.
|
|
14008
|
+
trimmedLable = textTrim((this.maps.dataLabelShape[l] * scale), zoomtext, style);
|
|
13663
14009
|
element.innerHTML = trimmedLable;
|
|
13664
14010
|
}
|
|
13665
14011
|
}
|
|
13666
|
-
|
|
14012
|
+
if (animate$$1 || duration > 0) {
|
|
13667
14013
|
smoothTranslate(element, 0, duration, new MapLocation(labelX, labelY));
|
|
13668
14014
|
}
|
|
13669
14015
|
}
|
|
@@ -13784,7 +14130,7 @@ class Zoom {
|
|
|
13784
14130
|
const layerRect = getElementByID(map.element.id + '_Layer_Collections').getBoundingClientRect();
|
|
13785
14131
|
const elementRect = getElementByID(map.element.id + '_svg').getBoundingClientRect();
|
|
13786
14132
|
const panningXDirection = ((xDifference < 0 ? layerRect.left <= (elementRect.left + map.mapAreaRect.x) :
|
|
13787
|
-
((layerRect.left + layerRect.width
|
|
14133
|
+
((layerRect.left + layerRect.width + map.mapAreaRect.x) >= (elementRect.width))));
|
|
13788
14134
|
const panningYDirection = ((yDifference < 0 ? layerRect.top <= (elementRect.top + map.mapAreaRect.y) :
|
|
13789
14135
|
((layerRect.top + layerRect.height + legendHeight + map.margin.top) >= (elementRect.top + elementRect.height))));
|
|
13790
14136
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -13873,16 +14219,28 @@ class Zoom {
|
|
|
13873
14219
|
const min = map.baseMapRectBounds['min'];
|
|
13874
14220
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13875
14221
|
const max = map.baseMapRectBounds['max'];
|
|
13876
|
-
|
|
13877
|
-
|
|
13878
|
-
let translatePointX
|
|
13879
|
-
let translatePointY
|
|
13880
|
-
|
|
13881
|
-
|
|
13882
|
-
|
|
13883
|
-
|
|
13884
|
-
|
|
13885
|
-
|
|
14222
|
+
let mapWidth = Math.abs(max['x'] - min['x']);
|
|
14223
|
+
let mapHeight = Math.abs(min['y'] - max['y']);
|
|
14224
|
+
let translatePointX;
|
|
14225
|
+
let translatePointY;
|
|
14226
|
+
if (zoomFactor < 1.2 && map.projectionType !== 'Eckert5') {
|
|
14227
|
+
if (mapHeight === 0 || mapWidth === 0 || mapHeight === mapWidth) {
|
|
14228
|
+
mapWidth = size.width / 2;
|
|
14229
|
+
mapHeight = size.height;
|
|
14230
|
+
}
|
|
14231
|
+
zoomFactor = parseFloat(Math.min(size.width / mapWidth, size.height / mapHeight).toFixed(2));
|
|
14232
|
+
map.translatePoint = this.calculateInitalZoomTranslatePoint(zoomFactor, mapWidth, mapHeight, size, min, map);
|
|
14233
|
+
}
|
|
14234
|
+
else {
|
|
14235
|
+
translatePointX = translatePoint.x - (((size.width / scale) - (size.width / zoomFactor)) / 2);
|
|
14236
|
+
translatePointY = translatePoint.y - (((size.height / scale) - (size.height / zoomFactor)) / 2);
|
|
14237
|
+
const currentHeight = Math.abs(map.baseMapRectBounds['max']['y'] - map.baseMapRectBounds['min']['y']) * zoomFactor;
|
|
14238
|
+
translatePointX = (currentHeight < map.mapAreaRect.height) ? (size.x + ((-(min['x'])) + ((size.width / 2) - (mapWidth / 2))))
|
|
14239
|
+
: translatePointX;
|
|
14240
|
+
translatePointY = (currentHeight < map.mapAreaRect.height) ? (size.y + ((-(min['y'])) + ((size.height / 2) - (mapHeight / 2))))
|
|
14241
|
+
: translatePointY;
|
|
14242
|
+
map.translatePoint = new Point(translatePointX, translatePointY);
|
|
14243
|
+
}
|
|
13886
14244
|
map.zoomTranslatePoint = map.translatePoint;
|
|
13887
14245
|
map.scale = zoomFactor;
|
|
13888
14246
|
if (this.triggerZoomEvent(prevTilePoint, prevLevel, type)) {
|
|
@@ -13932,6 +14290,7 @@ class Zoom {
|
|
|
13932
14290
|
if (document.getElementById(this.maps.element.id + '_LayerIndex_1')) {
|
|
13933
14291
|
document.getElementById(this.maps.element.id + '_LayerIndex_1').style.display = 'block';
|
|
13934
14292
|
}
|
|
14293
|
+
this.maps.isAddLayer = false;
|
|
13935
14294
|
}, animationDuration);
|
|
13936
14295
|
}
|
|
13937
14296
|
}
|
|
@@ -14197,7 +14556,12 @@ class Zoom {
|
|
|
14197
14556
|
x = (size.width / 2) - (toolBarSize.width / 2);
|
|
14198
14557
|
break;
|
|
14199
14558
|
case 'Far':
|
|
14200
|
-
|
|
14559
|
+
if (!isNullOrUndefined(map.legendModule) && map.legendSettings.position === 'Left') {
|
|
14560
|
+
x = size.width + size.x - toolBarSize.width - padding;
|
|
14561
|
+
}
|
|
14562
|
+
else {
|
|
14563
|
+
x = (size.width - toolBarSize.width) - padding;
|
|
14564
|
+
}
|
|
14201
14565
|
break;
|
|
14202
14566
|
}
|
|
14203
14567
|
let extraPosition = map.getExtraPosition();
|
|
@@ -14253,6 +14617,7 @@ class Zoom {
|
|
|
14253
14617
|
}
|
|
14254
14618
|
else {
|
|
14255
14619
|
map.mapScaleValue = value - delta;
|
|
14620
|
+
map.isReset = (map.mapScaleValue < 1) ? true : false;
|
|
14256
14621
|
map.staticMapZoom = map.tileZoomLevel;
|
|
14257
14622
|
if (map.mapScaleValue === 1) {
|
|
14258
14623
|
map.markerCenterLatitude = null;
|
|
@@ -14968,5 +15333,5 @@ class PdfExport {
|
|
|
14968
15333
|
* exporting all modules from maps index
|
|
14969
15334
|
*/
|
|
14970
15335
|
|
|
14971
|
-
export { Maps, load, loaded, click, rightClick, doubleClick, resize, tooltipRender, shapeSelected, shapeHighlight, mousemove, mouseup, mousedown, layerRendering, shapeRendering, markerRendering, markerClusterRendering, markerClick, markerClusterClick, markerMouseMove, markerClusterMouseMove, dataLabelRendering, bubbleRendering, bubbleClick, bubbleMouseMove, animationComplete, legendRendering, annotationRendering, itemSelection, itemHighlight, beforePrint, zoomIn, zoomOut, pan, Annotation, Arrow, Font, 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, 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 };
|
|
15336
|
+
export { Maps, load, loaded, click, onclick, rightClick, doubleClick, resize, tooltipRender, shapeSelected, shapeHighlight, mousemove, mouseup, mousedown, layerRendering, shapeRendering, markerRendering, markerClusterRendering, markerClick, markerClusterClick, markerMouseMove, markerClusterMouseMove, dataLabelRendering, bubbleRendering, bubbleClick, bubbleMouseMove, animationComplete, legendRendering, annotationRendering, itemSelection, itemHighlight, beforePrint, zoomIn, zoomOut, pan, Annotation, Arrow, Font, 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, 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 };
|
|
14972
15337
|
//# sourceMappingURL=ej2-maps.es2015.js.map
|