@syncfusion/ej2-maps 20.1.59 → 20.2.36
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 +11 -54
- 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 +580 -240
- package/dist/es6/ej2-maps.es2015.js.map +1 -1
- package/dist/es6/ej2-maps.es5.js +574 -234
- 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 +2 -6
- package/src/maps/layers/data-label.js +17 -18
- package/src/maps/layers/layer-panel.d.ts +13 -1
- package/src/maps/layers/layer-panel.js +198 -67
- 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 +1 -1
- package/src/maps/maps.d.ts +7 -0
- package/src/maps/maps.js +61 -29
- 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/theme.js +3 -0
- package/src/maps/user-interaction/highlight.js +8 -5
- package/src/maps/user-interaction/selection.js +38 -11
- package/src/maps/user-interaction/zoom.d.ts +1 -1
- package/src/maps/user-interaction/zoom.js +78 -30
- package/src/maps/utils/helper.js +10 -3
package/dist/es6/ej2-maps.es5.js
CHANGED
|
@@ -788,6 +788,8 @@ function drawSymbols(shape, imageUrl, location, markerID, shapeCustom, markerCol
|
|
|
788
788
|
var opacity = shapeCustom['opacity'];
|
|
789
789
|
var rectOptions;
|
|
790
790
|
var pathOptions = new PathOption(markerID, fill, borderWidth, borderColor, opacity, borderOpacity, dashArray, '');
|
|
791
|
+
size.width = typeof (size.width) === 'string' ? parseInt(size.width, 10) : size.width;
|
|
792
|
+
size.height = typeof (size.height) === 'string' ? parseInt(size.height, 10) : size.height;
|
|
791
793
|
if (shape === 'Circle') {
|
|
792
794
|
var radius = (size.width + size.height) / 4;
|
|
793
795
|
var circleOptions = new CircleOption(markerID, fill, border, opacity, location.x, location.y, radius, dashArray);
|
|
@@ -2022,6 +2024,10 @@ function getTranslate(mapObject, layer, animate) {
|
|
|
2022
2024
|
}
|
|
2023
2025
|
else {
|
|
2024
2026
|
if (isNullOrUndefined(mapObject.previousProjection) || mapObject.previousProjection !== mapObject.projectionType) {
|
|
2027
|
+
if (mapHeight === 0 || mapWidth === 0 || mapHeight === mapWidth) {
|
|
2028
|
+
mapWidth = size.width / 2;
|
|
2029
|
+
mapHeight = size.height;
|
|
2030
|
+
}
|
|
2025
2031
|
scaleFactor = parseFloat(Math.min(size.width / mapWidth, size.height / mapHeight).toFixed(2));
|
|
2026
2032
|
mapWidth *= scaleFactor;
|
|
2027
2033
|
mapHeight *= scaleFactor;
|
|
@@ -2071,7 +2077,7 @@ function getTranslate(mapObject, layer, animate) {
|
|
|
2071
2077
|
mapObject.zoomTranslatePoint.y = y;
|
|
2072
2078
|
}
|
|
2073
2079
|
else {
|
|
2074
|
-
if (!isNullOrUndefined(mapObject.previousProjection) && mapObject.mapScaleValue === 1 && !mapObject.zoomModule.isDragZoom) {
|
|
2080
|
+
if (!isNullOrUndefined(mapObject.previousProjection) && (mapObject.mapScaleValue === 1 || mapObject.mapScaleValue <= 1.05) && !mapObject.zoomModule.isDragZoom) {
|
|
2075
2081
|
scaleFactor = parseFloat(Math.min(size.width / mapWidth, size.height / mapHeight).toFixed(2));
|
|
2076
2082
|
mapWidth *= scaleFactor;
|
|
2077
2083
|
x = size.x + ((-(min['x'])) + ((size.width / 2) - (mapWidth / 2)));
|
|
@@ -2895,6 +2901,7 @@ function changeBorderWidth(element, index, scale, maps) {
|
|
|
2895
2901
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2896
2902
|
var borderWidthValue = maps.layersCollection[index].shapeSettings.borderWidthValuePath;
|
|
2897
2903
|
var borderWidth = maps.layersCollection[index].shapeSettings.border.width;
|
|
2904
|
+
var circleRadius = maps.layersCollection[index].shapeSettings.circleRadius;
|
|
2898
2905
|
if (maps.layersCollection[index].shapeSettings.borderWidthValuePath) {
|
|
2899
2906
|
value = checkShapeDataFields(
|
|
2900
2907
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -2915,8 +2922,8 @@ function changeBorderWidth(element, index, scale, maps) {
|
|
|
2915
2922
|
currentStroke = (isNullOrUndefined(borderWidth) ? 0 : borderWidth);
|
|
2916
2923
|
}
|
|
2917
2924
|
childNode.setAttribute('stroke-width', (currentStroke / scale).toString());
|
|
2918
|
-
if (element.id.indexOf('
|
|
2919
|
-
childNode.setAttribute('
|
|
2925
|
+
if (element.id.indexOf('_Point') > -1 || element.id.indexOf('_MultiPoint') > -1) {
|
|
2926
|
+
childNode.setAttribute('r', (circleRadius / scale).toString());
|
|
2920
2927
|
}
|
|
2921
2928
|
}
|
|
2922
2929
|
}
|
|
@@ -3583,6 +3590,7 @@ function getThemeStyle(theme) {
|
|
|
3583
3590
|
backgroundColor: color,
|
|
3584
3591
|
areaBackgroundColor: color,
|
|
3585
3592
|
titleFontColor: '#FFFFFF',
|
|
3593
|
+
titleFontSize: '14px',
|
|
3586
3594
|
subTitleFontColor: '#FFFFFF',
|
|
3587
3595
|
legendTitleFontColor: '#DADADA',
|
|
3588
3596
|
legendTextColor: '#DADADA',
|
|
@@ -3602,6 +3610,7 @@ function getThemeStyle(theme) {
|
|
|
3602
3610
|
backgroundColor: '#000000',
|
|
3603
3611
|
areaBackgroundColor: '#000000',
|
|
3604
3612
|
titleFontColor: '#FFFFFF',
|
|
3613
|
+
titleFontSize: '14px',
|
|
3605
3614
|
subTitleFontColor: '#FFFFFF',
|
|
3606
3615
|
legendTitleFontColor: '#FFFFFF',
|
|
3607
3616
|
legendTextColor: '#FFFFFF',
|
|
@@ -3782,6 +3791,7 @@ function getThemeStyle(theme) {
|
|
|
3782
3791
|
backgroundColor: '#FFFFFF',
|
|
3783
3792
|
areaBackgroundColor: '#FFFFFF',
|
|
3784
3793
|
titleFontColor: '#424242',
|
|
3794
|
+
titleFontSize: '14px',
|
|
3785
3795
|
subTitleFontColor: '#424242',
|
|
3786
3796
|
legendTitleFontColor: '#757575',
|
|
3787
3797
|
legendTextColor: '#757575',
|
|
@@ -4306,7 +4316,7 @@ var SubTitleSettings = /** @__PURE__ @class */ (function (_super) {
|
|
|
4306
4316
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
4307
4317
|
}
|
|
4308
4318
|
__decorate$1([
|
|
4309
|
-
Complex({ size:
|
|
4319
|
+
Complex({ size: null, fontWeight: null, fontFamily: null }, Font)
|
|
4310
4320
|
], SubTitleSettings.prototype, "textStyle", void 0);
|
|
4311
4321
|
__decorate$1([
|
|
4312
4322
|
Property('Center')
|
|
@@ -4322,7 +4332,7 @@ var TitleSettings = /** @__PURE__ @class */ (function (_super) {
|
|
|
4322
4332
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
4323
4333
|
}
|
|
4324
4334
|
__decorate$1([
|
|
4325
|
-
Complex({ size:
|
|
4335
|
+
Complex({ size: null, fontWeight: null, fontFamily: null }, Font)
|
|
4326
4336
|
], TitleSettings.prototype, "textStyle", void 0);
|
|
4327
4337
|
__decorate$1([
|
|
4328
4338
|
Property('Center')
|
|
@@ -4466,7 +4476,7 @@ var LegendSettings = /** @__PURE__ @class */ (function (_super) {
|
|
|
4466
4476
|
Property('')
|
|
4467
4477
|
], LegendSettings.prototype, "height", void 0);
|
|
4468
4478
|
__decorate$1([
|
|
4469
|
-
Complex({}, Font)
|
|
4479
|
+
Complex({ fontFamily: null }, Font)
|
|
4470
4480
|
], LegendSettings.prototype, "textStyle", void 0);
|
|
4471
4481
|
__decorate$1([
|
|
4472
4482
|
Property(15)
|
|
@@ -4487,7 +4497,7 @@ var LegendSettings = /** @__PURE__ @class */ (function (_super) {
|
|
|
4487
4497
|
Complex({}, CommonTitleSettings)
|
|
4488
4498
|
], LegendSettings.prototype, "title", void 0);
|
|
4489
4499
|
__decorate$1([
|
|
4490
|
-
Complex(Theme.legendTitleFont, Font)
|
|
4500
|
+
Complex({ size: Theme.legendTitleFont.size, color: Theme.legendTitleFont.color, fontStyle: Theme.legendTitleFont.fontStyle, fontWeight: Theme.legendTitleFont.fontWeight, fontFamily: null }, Font)
|
|
4491
4501
|
], LegendSettings.prototype, "titleStyle", void 0);
|
|
4492
4502
|
__decorate$1([
|
|
4493
4503
|
Property('Bottom')
|
|
@@ -4750,7 +4760,7 @@ var LayerSettings = /** @__PURE__ @class */ (function (_super) {
|
|
|
4750
4760
|
Property('Geometry')
|
|
4751
4761
|
], LayerSettings.prototype, "layerType", void 0);
|
|
4752
4762
|
__decorate$1([
|
|
4753
|
-
Property('
|
|
4763
|
+
Property('')
|
|
4754
4764
|
], LayerSettings.prototype, "urlTemplate", void 0);
|
|
4755
4765
|
__decorate$1([
|
|
4756
4766
|
Property(true)
|
|
@@ -4921,11 +4931,12 @@ var Marker = /** @__PURE__ @class */ (function () {
|
|
|
4921
4931
|
if (currentLayer.markerClusterSettings.allowClustering) {
|
|
4922
4932
|
_this.maps.svgObject.appendChild(_this.markerSVGObject);
|
|
4923
4933
|
_this.maps.element.appendChild(_this.maps.svgObject);
|
|
4924
|
-
if (currentLayer.layerType
|
|
4925
|
-
|
|
4934
|
+
if ((currentLayer.layerType === 'OSM' || (currentLayer.urlTemplate.indexOf('openstreetmap') !== -1 && isNullOrUndefined(currentLayer.shapeData)))
|
|
4935
|
+
&& _this.maps.zoomSettings.enable) {
|
|
4936
|
+
layerElement.appendChild(_this.markerSVGObject);
|
|
4926
4937
|
}
|
|
4927
4938
|
else {
|
|
4928
|
-
|
|
4939
|
+
clusterTemplate(currentLayer, _this.markerSVGObject, _this.maps, layerIndex, _this.markerSVGObject, layerElement, true, false);
|
|
4929
4940
|
}
|
|
4930
4941
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4931
4942
|
_this.maps.renderReactTemplates();
|
|
@@ -5477,9 +5488,14 @@ var BingMap = /** @__PURE__ @class */ (function () {
|
|
|
5477
5488
|
}
|
|
5478
5489
|
quadKey = quadKey + '' + digit;
|
|
5479
5490
|
}
|
|
5480
|
-
|
|
5481
|
-
|
|
5482
|
-
|
|
5491
|
+
if (!isNullOrUndefined(subDomains)) {
|
|
5492
|
+
var subDomain = subDomains[Math.min(parseInt(quadKey.substr(quadKey.length - 1, 1), 10), subDomains.length)];
|
|
5493
|
+
imageUrl = imageUrl.replace('{quadkey}', quadKey).replace('{subdomain}', subDomain);
|
|
5494
|
+
return imageUrl += '&mkt=' + language + '&ur=IN&Key=' + key;
|
|
5495
|
+
}
|
|
5496
|
+
else {
|
|
5497
|
+
return '';
|
|
5498
|
+
}
|
|
5483
5499
|
};
|
|
5484
5500
|
return BingMap;
|
|
5485
5501
|
}());
|
|
@@ -5752,8 +5768,7 @@ var LayerPanel = /** @__PURE__ @class */ (function () {
|
|
|
5752
5768
|
else {
|
|
5753
5769
|
this.clipRectElement = this.mapObject.renderer.drawClipPath(new RectOption(this.mapObject.element.id + '_MapArea_ClipRect', 'transparent', { width: 1, color: 'Gray' }, 1, {
|
|
5754
5770
|
x: this.mapObject.isTileMap ? 0 : areaRect.x, y: this.mapObject.isTileMap ? 0 : areaRect.y,
|
|
5755
|
-
width: areaRect.width, height:
|
|
5756
|
-
this.mapObject.legendModule.totalPages.length > 0 ? this.mapObject.legendModule.legendTotalRect.height : areaRect.height
|
|
5771
|
+
width: areaRect.width, height: areaRect.height
|
|
5757
5772
|
}));
|
|
5758
5773
|
}
|
|
5759
5774
|
this.layerGroup.appendChild(this.clipRectElement);
|
|
@@ -5764,6 +5779,14 @@ var LayerPanel = /** @__PURE__ @class */ (function () {
|
|
|
5764
5779
|
_this.currentLayer = layer;
|
|
5765
5780
|
_this.processLayers(layer, index);
|
|
5766
5781
|
});
|
|
5782
|
+
if (!isNullOrUndefined(this.mapObject.legendModule) && this.mapObject.legendSettings.position === 'Float') {
|
|
5783
|
+
if (this.mapObject.isTileMap) {
|
|
5784
|
+
this.layerGroup.appendChild(this.mapObject.legendModule.legendGroup);
|
|
5785
|
+
}
|
|
5786
|
+
else {
|
|
5787
|
+
this.mapObject.svgObject.appendChild(this.mapObject.legendModule.legendGroup);
|
|
5788
|
+
}
|
|
5789
|
+
}
|
|
5767
5790
|
};
|
|
5768
5791
|
/**
|
|
5769
5792
|
* Tile rendering
|
|
@@ -5923,9 +5946,21 @@ var LayerPanel = /** @__PURE__ @class */ (function () {
|
|
|
5923
5946
|
};
|
|
5924
5947
|
this.mapObject.trigger('layerRendering', eventArgs, function (observedArgs) {
|
|
5925
5948
|
if (!eventArgs.cancel && eventArgs.visible) {
|
|
5926
|
-
if (layer.layerType
|
|
5949
|
+
if (layer.layerType === 'OSM') {
|
|
5950
|
+
layer.urlTemplate = 'https://a.tile.openstreetmap.org/level/tileX/tileY.png';
|
|
5951
|
+
}
|
|
5952
|
+
if (layer.layerType === 'Google') {
|
|
5953
|
+
layer.urlTemplate = 'https://mt1.google.com/vt/lyrs=m@129&hl=en&x=tileX&y=tileY&z=level';
|
|
5954
|
+
}
|
|
5955
|
+
if (layer.layerType !== 'Geometry' || (isNullOrUndefined(layer.shapeData) && !isNullOrUndefined(layer.urlTemplate) && layer.urlTemplate !== '')) {
|
|
5927
5956
|
if (layer.layerType !== 'Bing' || _this.bing) {
|
|
5928
|
-
|
|
5957
|
+
if (!isNullOrUndefined(layer.urlTemplate) && layer.urlTemplate.indexOf('quadkey') > -1) {
|
|
5958
|
+
var bing = new BingMap(_this.mapObject);
|
|
5959
|
+
_this.bingMapCalculation(layer, layerIndex, _this, bing);
|
|
5960
|
+
}
|
|
5961
|
+
else {
|
|
5962
|
+
_this.renderTileLayer(_this, layer, layerIndex);
|
|
5963
|
+
}
|
|
5929
5964
|
}
|
|
5930
5965
|
else if (layer.key && layer.key.length > 1) {
|
|
5931
5966
|
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
@@ -5994,6 +6029,17 @@ var LayerPanel = /** @__PURE__ @class */ (function () {
|
|
|
5994
6029
|
this.mapObject.baseMapBounds = null;
|
|
5995
6030
|
}
|
|
5996
6031
|
};
|
|
6032
|
+
LayerPanel.prototype.bingMapCalculation = function (layer, layerIndex, proxy, bing) {
|
|
6033
|
+
bing.imageUrl = layer.urlTemplate;
|
|
6034
|
+
bing.subDomains = ['t0', 't1', 't2', 't3'];
|
|
6035
|
+
bing.maxZoom = '21';
|
|
6036
|
+
proxy.mapObject['bingMap'] = bing;
|
|
6037
|
+
proxy.renderTileLayer(proxy, layer, layerIndex, bing);
|
|
6038
|
+
this.mapObject.arrangeTemplate();
|
|
6039
|
+
if (this.mapObject.zoomModule && (this.mapObject.previousScale !== this.mapObject.scale)) {
|
|
6040
|
+
this.mapObject.zoomModule.applyTransform(true);
|
|
6041
|
+
}
|
|
6042
|
+
};
|
|
5997
6043
|
LayerPanel.prototype.bubbleCalculation = function (bubbleSettings, range) {
|
|
5998
6044
|
if (bubbleSettings.dataSource != null && bubbleSettings != null) {
|
|
5999
6045
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -6186,60 +6232,66 @@ var LayerPanel = /** @__PURE__ @class */ (function () {
|
|
|
6186
6232
|
}
|
|
6187
6233
|
break;
|
|
6188
6234
|
case 'LineString':
|
|
6189
|
-
path += 'M ' + (currentShapeData[0]['point']['x']) + ' ' + (currentShapeData[0]['point']['y']);
|
|
6190
6235
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6191
|
-
currentShapeData.map(function (lineData) {
|
|
6192
|
-
|
|
6236
|
+
currentShapeData.map(function (lineData, index) {
|
|
6237
|
+
if (index === 0) {
|
|
6238
|
+
path += 'M ' + (lineData['point']['x']) + ' ' + (lineData['point']['y']);
|
|
6239
|
+
}
|
|
6240
|
+
else {
|
|
6241
|
+
path += 'L' + (lineData['point']['x']) + ' , ' + (lineData['point']['y']) + ' ';
|
|
6242
|
+
}
|
|
6193
6243
|
});
|
|
6194
6244
|
if (path.length > 3) {
|
|
6195
|
-
pathOptions = new PathOption(shapeID, 'transparent', !isNullOrUndefined(eventArgs.border.width) ? eventArgs.border.width : 1, eventArgs.
|
|
6245
|
+
pathOptions = new PathOption(shapeID, 'transparent', !isNullOrUndefined(eventArgs.border.width) ? eventArgs.border.width : 1, !isNullOrUndefined(eventArgs.fill) ? eventArgs.fill :
|
|
6246
|
+
eventArgs.border.color, opacity, eventArgs.border.opacity, shapeSettings.dashArray, path);
|
|
6247
|
+
pathEle = _this.mapObject.renderer.drawPath(pathOptions);
|
|
6248
|
+
}
|
|
6249
|
+
break;
|
|
6250
|
+
case 'MultiLineString':
|
|
6251
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6252
|
+
currentShapeData.map(function (multilineData) {
|
|
6253
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6254
|
+
multilineData.map(function (lineData, index) {
|
|
6255
|
+
if (index === 0) {
|
|
6256
|
+
path += 'M ' + (lineData['point']['x']) + ' ' + (lineData['point']['y']);
|
|
6257
|
+
}
|
|
6258
|
+
else {
|
|
6259
|
+
path += 'L' + (lineData['point']['x']) + ' , ' + (lineData['point']['y']) + ' ';
|
|
6260
|
+
}
|
|
6261
|
+
});
|
|
6262
|
+
});
|
|
6263
|
+
if (path.length > 3) {
|
|
6264
|
+
pathOptions = new PathOption(shapeID, 'transparent', !isNullOrUndefined(eventArgs.border.width) ? eventArgs.border.width : 1, !isNullOrUndefined(eventArgs.fill) ? eventArgs.fill :
|
|
6265
|
+
eventArgs.border.color, opacity, eventArgs.border.opacity, shapeSettings.dashArray, path);
|
|
6196
6266
|
pathEle = _this.mapObject.renderer.drawPath(pathOptions);
|
|
6197
6267
|
}
|
|
6198
6268
|
break;
|
|
6199
6269
|
case 'Point':
|
|
6200
6270
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6201
6271
|
var pointData = currentShapeData['point'];
|
|
6202
|
-
var circleRadius = (_this.mapObject.layers[layerIndex].type !== 'SubLayer') ? shapeSettings.circleRadius : shapeSettings.circleRadius / _this.currentFactor;
|
|
6203
|
-
circleOptions = new CircleOption(shapeID, eventArgs.fill, eventArgs.border, opacity, pointData['x'], pointData['y'], circleRadius,
|
|
6272
|
+
var circleRadius = (_this.mapObject.layers[layerIndex].type !== 'SubLayer') ? shapeSettings.circleRadius : shapeSettings.circleRadius / (_this.mapObject.isTileMap ? _this.mapObject.scale : _this.currentFactor);
|
|
6273
|
+
circleOptions = new CircleOption(shapeID, eventArgs.fill, eventArgs.border, opacity, pointData['x'], pointData['y'], circleRadius, shapeSettings.dashArray);
|
|
6204
6274
|
pathEle = _this.mapObject.renderer.drawCircle(circleOptions);
|
|
6205
6275
|
break;
|
|
6276
|
+
case 'MultiPoint':
|
|
6277
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6278
|
+
currentShapeData.map(function (multiPointData, index) {
|
|
6279
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6280
|
+
var pointData = multiPointData['point'];
|
|
6281
|
+
var circleRadius = (_this.mapObject.layers[layerIndex].type !== 'SubLayer') ? shapeSettings.circleRadius : shapeSettings.circleRadius / (_this.mapObject.isTileMap ? _this.mapObject.scale : _this.currentFactor);
|
|
6282
|
+
circleOptions = new CircleOption((shapeID + "_multiLine_" + index), eventArgs.fill, eventArgs.border, opacity, pointData['x'], pointData['y'], circleRadius, shapeSettings.dashArray);
|
|
6283
|
+
pathEle = _this.mapObject.renderer.drawCircle(circleOptions);
|
|
6284
|
+
_this.pathAttributeCalculate(groupElement, pathEle, drawingType, currentShapeData, i);
|
|
6285
|
+
});
|
|
6286
|
+
break;
|
|
6206
6287
|
case 'Path':
|
|
6207
6288
|
path = currentShapeData['point'];
|
|
6208
6289
|
pathOptions = new PathOption(shapeID, eventArgs.fill, eventArgs.border.width, eventArgs.border.color, opacity, eventArgs.border.opacity, shapeSettings.dashArray, path);
|
|
6209
6290
|
pathEle = _this.mapObject.renderer.drawPath(pathOptions);
|
|
6210
6291
|
break;
|
|
6211
6292
|
}
|
|
6212
|
-
if (!isNullOrUndefined(pathEle)) {
|
|
6213
|
-
|
|
6214
|
-
_this.currentLayer.shapePropertyPath : [_this.currentLayer.shapePropertyPath]);
|
|
6215
|
-
var properties = void 0;
|
|
6216
|
-
for (var j = 0; j < property.length; j++) {
|
|
6217
|
-
if (!isNullOrUndefined(currentShapeData['property'])) {
|
|
6218
|
-
properties = property[j];
|
|
6219
|
-
break;
|
|
6220
|
-
}
|
|
6221
|
-
}
|
|
6222
|
-
pathEle.setAttribute('aria-label', ((!isNullOrUndefined(currentShapeData['property'])) ?
|
|
6223
|
-
(currentShapeData['property'][properties]) : ''));
|
|
6224
|
-
pathEle.setAttribute('tabindex', (_this.mapObject.tabIndex + i + 3).toString());
|
|
6225
|
-
if (drawingType === 'LineString') {
|
|
6226
|
-
pathEle.setAttribute('style', 'outline:none');
|
|
6227
|
-
}
|
|
6228
|
-
maintainSelection(_this.mapObject.selectedElementId, _this.mapObject.shapeSelectionClass, pathEle, 'ShapeselectionMapStyle');
|
|
6229
|
-
if (_this.mapObject.toggledShapeElementId) {
|
|
6230
|
-
for (var j = 0; j < _this.mapObject.toggledShapeElementId.length; j++) {
|
|
6231
|
-
var styleProperty = _this.mapObject.legendSettings.toggleLegendSettings.applyShapeSettings ?
|
|
6232
|
-
_this.currentLayer.shapeSettings : _this.mapObject.legendSettings.toggleLegendSettings;
|
|
6233
|
-
if (_this.mapObject.toggledShapeElementId[j] === pathEle.id) {
|
|
6234
|
-
pathEle.setAttribute('fill', styleProperty.fill);
|
|
6235
|
-
pathEle.setAttribute('stroke', styleProperty.border.color);
|
|
6236
|
-
pathEle.setAttribute('fill-opacity', (styleProperty.opacity).toString());
|
|
6237
|
-
pathEle.setAttribute('stroke-opacity', (isNullOrUndefined(styleProperty.border.opacity) ? styleProperty.opacity : styleProperty.border.opacity).toString());
|
|
6238
|
-
pathEle.setAttribute('stroke-width', (styleProperty.border.width).toString());
|
|
6239
|
-
}
|
|
6240
|
-
}
|
|
6241
|
-
}
|
|
6242
|
-
groupElement.appendChild(pathEle);
|
|
6293
|
+
if (!isNullOrUndefined(pathEle) && drawingType !== 'MultiPoint') {
|
|
6294
|
+
_this.pathAttributeCalculate(groupElement, pathEle, drawingType, currentShapeData, i);
|
|
6243
6295
|
}
|
|
6244
6296
|
if (i === _this.currentLayer.layerData.length - 1) {
|
|
6245
6297
|
_this.layerFeatures(layerIndex, colors, renderData, labelTemplateEle);
|
|
@@ -6257,6 +6309,49 @@ var LayerPanel = /** @__PURE__ @class */ (function () {
|
|
|
6257
6309
|
this.layerFeatures(layerIndex, colors, renderData, labelTemplateEle);
|
|
6258
6310
|
}
|
|
6259
6311
|
};
|
|
6312
|
+
/**
|
|
6313
|
+
* layer features as bubble, marker, datalabel, navigation line.
|
|
6314
|
+
*
|
|
6315
|
+
* @param {groupElement} Element - Specifies the element to append the group
|
|
6316
|
+
* @param {pathEle} Element - Specifies the svg element
|
|
6317
|
+
* @param {drawingType} string - Specifies the data type
|
|
6318
|
+
* @param {currentShapeData} any - Specifies the layer of shapedata.
|
|
6319
|
+
* @param {index} number - Specifies the tab index.
|
|
6320
|
+
* @returns {void}
|
|
6321
|
+
*/
|
|
6322
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6323
|
+
LayerPanel.prototype.pathAttributeCalculate = function (groupElement, pathEle, drawingType, currentShapeData, index) {
|
|
6324
|
+
var property = (Object.prototype.toString.call(this.currentLayer.shapePropertyPath) === '[object Array]' ?
|
|
6325
|
+
this.currentLayer.shapePropertyPath : [this.currentLayer.shapePropertyPath]);
|
|
6326
|
+
var properties;
|
|
6327
|
+
for (var j = 0; j < property.length; j++) {
|
|
6328
|
+
if (!isNullOrUndefined(currentShapeData['property'])) {
|
|
6329
|
+
properties = property[j];
|
|
6330
|
+
break;
|
|
6331
|
+
}
|
|
6332
|
+
}
|
|
6333
|
+
pathEle.setAttribute('aria-label', ((!isNullOrUndefined(currentShapeData['property'])) ?
|
|
6334
|
+
(currentShapeData['property'][properties]) : ''));
|
|
6335
|
+
pathEle.setAttribute('tabindex', (this.mapObject.tabIndex + index + 3).toString());
|
|
6336
|
+
if (drawingType === 'LineString' || drawingType === 'MultiLineString') {
|
|
6337
|
+
pathEle.setAttribute('style', 'outline:none');
|
|
6338
|
+
}
|
|
6339
|
+
maintainSelection(this.mapObject.selectedElementId, this.mapObject.shapeSelectionClass, pathEle, 'ShapeselectionMapStyle');
|
|
6340
|
+
if (this.mapObject.toggledShapeElementId) {
|
|
6341
|
+
for (var j = 0; j < this.mapObject.toggledShapeElementId.length; j++) {
|
|
6342
|
+
var styleProperty = this.mapObject.legendSettings.toggleLegendSettings.applyShapeSettings ?
|
|
6343
|
+
this.currentLayer.shapeSettings : this.mapObject.legendSettings.toggleLegendSettings;
|
|
6344
|
+
if (this.mapObject.toggledShapeElementId[j] === pathEle.id) {
|
|
6345
|
+
pathEle.setAttribute('fill', styleProperty.fill);
|
|
6346
|
+
pathEle.setAttribute('stroke', styleProperty.border.color);
|
|
6347
|
+
pathEle.setAttribute('fill-opacity', (styleProperty.opacity).toString());
|
|
6348
|
+
pathEle.setAttribute('stroke-opacity', (isNullOrUndefined(styleProperty.border.opacity) ? styleProperty.opacity : styleProperty.border.opacity).toString());
|
|
6349
|
+
pathEle.setAttribute('stroke-width', (styleProperty.border.width).toString());
|
|
6350
|
+
}
|
|
6351
|
+
}
|
|
6352
|
+
}
|
|
6353
|
+
groupElement.appendChild(pathEle);
|
|
6354
|
+
};
|
|
6260
6355
|
/**
|
|
6261
6356
|
* layer features as bubble, marker, datalabel, navigation line.
|
|
6262
6357
|
*
|
|
@@ -6444,7 +6539,8 @@ var LayerPanel = /** @__PURE__ @class */ (function () {
|
|
|
6444
6539
|
break;
|
|
6445
6540
|
case 'linestring':
|
|
6446
6541
|
var extraSpace_1 = !isNullOrUndefined(this.currentLayer.shapeSettings.border.width) ?
|
|
6447
|
-
this.currentLayer.shapeSettings.border.width
|
|
6542
|
+
(typeof (this.currentLayer.shapeSettings.border.width) === 'string' ?
|
|
6543
|
+
parseInt(this.currentLayer.shapeSettings.border.width, 10) : this.currentLayer.shapeSettings.border.width) : 1;
|
|
6448
6544
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6449
6545
|
coordinates.map(function (points, index) {
|
|
6450
6546
|
latitude = points[1];
|
|
@@ -6459,31 +6555,61 @@ var LayerPanel = /** @__PURE__ @class */ (function () {
|
|
|
6459
6555
|
newData['type'] = type;
|
|
6460
6556
|
this.currentLayer.layerData.push(newData);
|
|
6461
6557
|
break;
|
|
6462
|
-
case '
|
|
6463
|
-
var
|
|
6464
|
-
|
|
6465
|
-
|
|
6558
|
+
case 'multilinestring':
|
|
6559
|
+
var extraSpaces_1 = !isNullOrUndefined(this.currentLayer.shapeSettings.border.width) ?
|
|
6560
|
+
(typeof (this.currentLayer.shapeSettings.border.width) === 'string' ?
|
|
6561
|
+
parseInt(this.currentLayer.shapeSettings.border.width, 10) : this.currentLayer.shapeSettings.border.width) : 1;
|
|
6562
|
+
var multiLineData_1 = [];
|
|
6466
6563
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6467
|
-
coordinates.map(function (
|
|
6468
|
-
|
|
6564
|
+
coordinates.map(function (multiPoints) {
|
|
6565
|
+
newData = [];
|
|
6566
|
+
multiPoints.map(function (points) {
|
|
6469
6567
|
latitude = points[1];
|
|
6470
6568
|
longitude = points[0];
|
|
6471
|
-
arrayCollections_1 = true;
|
|
6472
6569
|
var point = convertGeoToPoint(latitude, longitude, _this.currentFactor, _this.currentLayer, _this.mapObject);
|
|
6473
|
-
_this.
|
|
6474
|
-
|
|
6570
|
+
_this.calculateBox(point, extraSpaces_1);
|
|
6571
|
+
newData.push({
|
|
6572
|
+
point: point, lat: latitude, lng: longitude
|
|
6475
6573
|
});
|
|
6476
|
-
}
|
|
6574
|
+
});
|
|
6575
|
+
multiLineData_1.push(newData);
|
|
6576
|
+
});
|
|
6577
|
+
multiLineData_1['property'] = properties;
|
|
6578
|
+
multiLineData_1['type'] = type;
|
|
6579
|
+
this.currentLayer.layerData.push(multiLineData_1);
|
|
6580
|
+
break;
|
|
6581
|
+
case 'point':
|
|
6582
|
+
var pointExtraSpace = (!isNullOrUndefined(this.currentLayer.shapeSettings.border.width) ?
|
|
6583
|
+
(typeof (this.currentLayer.shapeSettings.border.width) === 'string' ?
|
|
6584
|
+
parseInt(this.currentLayer.shapeSettings.border.width, 10) : this.currentLayer.shapeSettings.border.width) : 1) +
|
|
6585
|
+
(this.currentLayer.shapeSettings.circleRadius * 2);
|
|
6586
|
+
latitude = coordinates[1];
|
|
6587
|
+
longitude = coordinates[0];
|
|
6588
|
+
var point = convertGeoToPoint(latitude, longitude, this.currentFactor, this.currentLayer, this.mapObject);
|
|
6589
|
+
this.calculateBox(point, pointExtraSpace);
|
|
6590
|
+
this.currentLayer.layerData.push({
|
|
6591
|
+
point: point, type: type, lat: latitude, lng: longitude, property: properties
|
|
6477
6592
|
});
|
|
6478
|
-
|
|
6479
|
-
|
|
6480
|
-
|
|
6481
|
-
|
|
6482
|
-
|
|
6483
|
-
this.currentLayer.
|
|
6484
|
-
|
|
6593
|
+
break;
|
|
6594
|
+
case 'multipoint': {
|
|
6595
|
+
var extraSpace_2 = (!isNullOrUndefined(this.currentLayer.shapeSettings.border.width) ?
|
|
6596
|
+
(typeof (this.currentLayer.shapeSettings.border.width) === 'string' ?
|
|
6597
|
+
parseInt(this.currentLayer.shapeSettings.border.width, 10) : this.currentLayer.shapeSettings.border.width) : 1) +
|
|
6598
|
+
(this.currentLayer.shapeSettings.circleRadius * 2);
|
|
6599
|
+
newData = [];
|
|
6600
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6601
|
+
coordinates.map(function (points) {
|
|
6602
|
+
latitude = points[1];
|
|
6603
|
+
longitude = points[0];
|
|
6604
|
+
var point = convertGeoToPoint(latitude, longitude, _this.currentFactor, _this.currentLayer, _this.mapObject);
|
|
6605
|
+
_this.calculateBox(point, extraSpace_2);
|
|
6606
|
+
newData.push({
|
|
6607
|
+
point: point, lat: latitude, lng: longitude
|
|
6485
6608
|
});
|
|
6486
|
-
}
|
|
6609
|
+
});
|
|
6610
|
+
newData['property'] = properties;
|
|
6611
|
+
newData['type'] = type;
|
|
6612
|
+
this.currentLayer.layerData.push(newData);
|
|
6487
6613
|
break;
|
|
6488
6614
|
}
|
|
6489
6615
|
case 'path':
|
|
@@ -6495,12 +6621,12 @@ var LayerPanel = /** @__PURE__ @class */ (function () {
|
|
|
6495
6621
|
};
|
|
6496
6622
|
LayerPanel.prototype.calculateBox = function (point, extraSpace) {
|
|
6497
6623
|
if (isNullOrUndefined(this.rectBounds)) {
|
|
6498
|
-
this.rectBounds = { min: { x: point.x, y: point.y - extraSpace }, max: { x: point.x, y: point.y + extraSpace } };
|
|
6624
|
+
this.rectBounds = { min: { x: point.x - extraSpace, y: point.y - extraSpace }, max: { x: point.x + extraSpace, y: point.y + extraSpace } };
|
|
6499
6625
|
}
|
|
6500
6626
|
else {
|
|
6501
|
-
this.rectBounds['min']['x'] = Math.min(this.rectBounds['min']['x'], point.x);
|
|
6627
|
+
this.rectBounds['min']['x'] = Math.min(this.rectBounds['min']['x'], point.x - extraSpace);
|
|
6502
6628
|
this.rectBounds['min']['y'] = Math.min(this.rectBounds['min']['y'], point.y - extraSpace);
|
|
6503
|
-
this.rectBounds['max']['x'] = Math.max(this.rectBounds['max']['x'], point.x);
|
|
6629
|
+
this.rectBounds['max']['x'] = Math.max(this.rectBounds['max']['x'], point.x + extraSpace);
|
|
6504
6630
|
this.rectBounds['max']['y'] = Math.max(this.rectBounds['max']['y'], point.y + extraSpace);
|
|
6505
6631
|
}
|
|
6506
6632
|
};
|
|
@@ -6518,6 +6644,10 @@ var LayerPanel = /** @__PURE__ @class */ (function () {
|
|
|
6518
6644
|
var end = convertGeoToPoint(bounds.latitude.max, bounds.longitude.max, null, layer, this.mapObject);
|
|
6519
6645
|
mapHeight = end.y - start.y;
|
|
6520
6646
|
mapWidth = end.x - start.x;
|
|
6647
|
+
if (mapHeight === 0 || mapWidth === 0) {
|
|
6648
|
+
mapWidth = mapSize.width / 2;
|
|
6649
|
+
mapHeight = mapSize.height;
|
|
6650
|
+
}
|
|
6521
6651
|
}
|
|
6522
6652
|
else {
|
|
6523
6653
|
mapHeight = mapWidth = 500;
|
|
@@ -6612,15 +6742,28 @@ var LayerPanel = /** @__PURE__ @class */ (function () {
|
|
|
6612
6742
|
_this.calculateRectBox(point[0]);
|
|
6613
6743
|
});
|
|
6614
6744
|
break;
|
|
6745
|
+
case 'multilinestring':
|
|
6746
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6747
|
+
coordinates.map(function (multiPoint, index) {
|
|
6748
|
+
multiPoint.map(function (point, index) {
|
|
6749
|
+
_this.calculateRectBox(point, 'multilinestring', index === 0 ? true : false);
|
|
6750
|
+
});
|
|
6751
|
+
});
|
|
6752
|
+
break;
|
|
6615
6753
|
case 'linestring':
|
|
6616
6754
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6617
6755
|
coordinates.map(function (point, index) {
|
|
6618
|
-
_this.calculateRectBox(point, '
|
|
6756
|
+
_this.calculateRectBox(point, 'linestring', index === 0 ? true : false);
|
|
6619
6757
|
});
|
|
6620
6758
|
break;
|
|
6621
6759
|
case 'point':
|
|
6622
6760
|
_this.calculateRectBox(coordinates, 'point');
|
|
6623
6761
|
break;
|
|
6762
|
+
case 'multipoint':
|
|
6763
|
+
coordinates.map(function (point, index) {
|
|
6764
|
+
_this.calculateRectBox(point, 'multipoint', index === 0 ? true : false);
|
|
6765
|
+
});
|
|
6766
|
+
break;
|
|
6624
6767
|
}
|
|
6625
6768
|
}
|
|
6626
6769
|
});
|
|
@@ -6659,7 +6802,7 @@ var LayerPanel = /** @__PURE__ @class */ (function () {
|
|
|
6659
6802
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6660
6803
|
LayerPanel.prototype.calculateRectBox = function (coordinates, type, isFirstItem) {
|
|
6661
6804
|
var _this = this;
|
|
6662
|
-
if (type !== '
|
|
6805
|
+
if ((type !== 'linestring' && type !== 'multilinestring') && (type !== 'point' && type !== 'multipoint')) {
|
|
6663
6806
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6664
6807
|
Array.prototype.forEach.call(coordinates, function (currentCoords) {
|
|
6665
6808
|
if (isNullOrUndefined(_this.mapObject.baseMapBounds)) {
|
|
@@ -6728,7 +6871,7 @@ var LayerPanel = /** @__PURE__ @class */ (function () {
|
|
|
6728
6871
|
var tile = new Tile(tileI % ycount, j);
|
|
6729
6872
|
tile.left = x;
|
|
6730
6873
|
tile.top = y;
|
|
6731
|
-
if (baseLayer.layerType === 'Bing') {
|
|
6874
|
+
if (baseLayer.layerType === 'Bing' || (bing && !isNullOrUndefined(baseLayer.urlTemplate) && baseLayer.urlTemplate !== '')) {
|
|
6732
6875
|
var key = baseLayer.key;
|
|
6733
6876
|
tile.src = bing.getBingMap(tile, key, baseLayer.bingMapType, userLang, bing.imageUrl, bing.subDomains);
|
|
6734
6877
|
}
|
|
@@ -6757,11 +6900,13 @@ var LayerPanel = /** @__PURE__ @class */ (function () {
|
|
|
6757
6900
|
if (!(layer.type === 'SubLayer' && layer.visible)) {
|
|
6758
6901
|
continue;
|
|
6759
6902
|
}
|
|
6760
|
-
if (layer.layerType
|
|
6903
|
+
if ((layer.layerType !== 'Geometry' && layer.layerType !== 'GoogleStaticMap') || (layer.layerType === 'Geometry' &&
|
|
6904
|
+
isNullOrUndefined(layer.shapeData) && !isNullOrUndefined(layer.urlTemplate) && layer.urlTemplate !== '')) {
|
|
6761
6905
|
for (var _b = 0, proxTiles_1 = proxTiles; _b < proxTiles_1.length; _b++) {
|
|
6762
6906
|
var baseTile = proxTiles_1[_b];
|
|
6763
6907
|
var subtile = extend({}, baseTile, {}, true);
|
|
6764
6908
|
if (layer.layerType === 'Bing') {
|
|
6909
|
+
bing = new BingMap(this.mapObject);
|
|
6765
6910
|
subtile.src = bing.getBingMap(subtile, layer.key, layer.bingMapType, userLang, bing.imageUrl, bing.subDomains);
|
|
6766
6911
|
}
|
|
6767
6912
|
else {
|
|
@@ -6821,6 +6966,8 @@ var LayerPanel = /** @__PURE__ @class */ (function () {
|
|
|
6821
6966
|
var id = 0;
|
|
6822
6967
|
var _loop_3 = function (tile) {
|
|
6823
6968
|
var imgElement = createElement('img');
|
|
6969
|
+
imgElement.setAttribute('height', '256px');
|
|
6970
|
+
imgElement.setAttribute('width', '256px');
|
|
6824
6971
|
imgElement.setAttribute('src', tile.src);
|
|
6825
6972
|
var mapId = _this.mapObject.element.id;
|
|
6826
6973
|
imgElement.onload = function () {
|
|
@@ -7474,16 +7621,7 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
|
|
|
7474
7621
|
};
|
|
7475
7622
|
Maps.prototype.renderMap = function () {
|
|
7476
7623
|
if (this.legendModule && this.legendSettings.visible) {
|
|
7477
|
-
|
|
7478
|
-
this.legendModule.renderLegend();
|
|
7479
|
-
}
|
|
7480
|
-
else {
|
|
7481
|
-
var layerCount = this.layersCollection.length - 1;
|
|
7482
|
-
if (!this.layersCollection[layerCount].isBaseLayer) {
|
|
7483
|
-
this.isTileMapSubLayer = true;
|
|
7484
|
-
this.legendModule.renderLegend();
|
|
7485
|
-
}
|
|
7486
|
-
}
|
|
7624
|
+
this.legendModule.renderLegend();
|
|
7487
7625
|
}
|
|
7488
7626
|
this.createTile();
|
|
7489
7627
|
if (this.zoomSettings.enable && this.zoomModule) {
|
|
@@ -7566,12 +7704,16 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
|
|
|
7566
7704
|
bottom = svg.bottom - tile.bottom - element.offsetTop;
|
|
7567
7705
|
top_1 = parseFloat(tileElement.style.top) + element.offsetTop;
|
|
7568
7706
|
}
|
|
7569
|
-
top_1 = (bottom <= 11) ? top_1 : (top_1 * 2);
|
|
7570
|
-
left = (bottom <= 11) ? left : (left * 2);
|
|
7707
|
+
top_1 = (bottom <= 11) ? top_1 : (!isNullOrUndefined(this.legendModule) && this.legendSettings.position === 'Bottom') ? this.mapAreaRect.y : (top_1 * 2);
|
|
7708
|
+
left = (bottom <= 11) ? left : !isNullOrUndefined(this.legendModule) ? left : (left * 2);
|
|
7571
7709
|
tileElement.style.top = top_1 + 'px';
|
|
7572
7710
|
tileElement.style.left = left + 'px';
|
|
7573
7711
|
tileElement1.style.top = top_1 + 'px';
|
|
7574
7712
|
tileElement1.style.left = left + 'px';
|
|
7713
|
+
if (!isNullOrUndefined(this.legendModule) && this.legendModule.totalPages.length > 0) {
|
|
7714
|
+
tileElement.style.height = tileElement1.style.height = this.legendModule.legendTotalRect.height + 'px';
|
|
7715
|
+
tileElement.style.width = tileElement1.style.width = this.legendModule.legendTotalRect.width + 'px';
|
|
7716
|
+
}
|
|
7575
7717
|
}
|
|
7576
7718
|
this.arrangeTemplate();
|
|
7577
7719
|
if (this.annotationsModule) {
|
|
@@ -7697,12 +7839,21 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
|
|
|
7697
7839
|
this.zoomModule.layerCollectionEle = getElementByID(this.element.id + '_Layer_Collections');
|
|
7698
7840
|
}
|
|
7699
7841
|
if (this.isTileMap && getElementByID(this.element.id + '_Tile_SVG') && getElementByID(this.element.id + '_tile_parent')) {
|
|
7700
|
-
var
|
|
7701
|
-
var
|
|
7842
|
+
var tileElement = getElementByID(this.element.id + '_tile_parent');
|
|
7843
|
+
var tileSvgElement = getElementByID(this.element.id + '_Tile_SVG');
|
|
7844
|
+
var tileSvgParentElement = getElementByID(this.element.id + '_Tile_SVG_Parent');
|
|
7845
|
+
var tileRect = tileElement.getBoundingClientRect();
|
|
7846
|
+
var tileSvgRect = tileSvgElement.getBoundingClientRect();
|
|
7702
7847
|
left = (tileRect.left - tileSvgRect.left);
|
|
7703
7848
|
top = (tileRect.top - tileSvgRect.top);
|
|
7704
|
-
|
|
7705
|
-
|
|
7849
|
+
tileSvgParentElement.style.left = left + 'px';
|
|
7850
|
+
tileSvgParentElement.style.top = top + 'px';
|
|
7851
|
+
if (!isNullOrUndefined(this.legendModule) && this.legendModule.totalPages.length > 0) {
|
|
7852
|
+
tileElement.style.width = tileSvgElement.style.width = this.legendModule.legendTotalRect.width.toString();
|
|
7853
|
+
tileElement.style.height = tileSvgElement.style.height = this.legendModule.legendTotalRect.height.toString();
|
|
7854
|
+
tileSvgParentElement.style.width = this.legendModule.legendTotalRect.width + 'px';
|
|
7855
|
+
tileSvgParentElement.style.height = this.legendModule.legendTotalRect.height + 'px';
|
|
7856
|
+
}
|
|
7706
7857
|
var markerTemplateElements = document.getElementsByClassName('template');
|
|
7707
7858
|
if (!isNullOrUndefined(markerTemplateElements) && markerTemplateElements.length > 0) {
|
|
7708
7859
|
for (var i = 0; i < markerTemplateElements.length; i++) {
|
|
@@ -7720,7 +7871,7 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
|
|
|
7720
7871
|
if (!isNullOrUndefined(elements) && elements.childElementCount > 0) {
|
|
7721
7872
|
for (var i = 0; i < elements.childNodes.length; i++) {
|
|
7722
7873
|
var childElement = elements.childNodes[i];
|
|
7723
|
-
if (childElement.tagName === 'g') {
|
|
7874
|
+
if (childElement.tagName === 'g' && childElement.id.indexOf('_Legend_Group') == -1) {
|
|
7724
7875
|
var layerIndex = parseFloat(childElement.id.split('_LayerIndex_')[1].split('_')[0]);
|
|
7725
7876
|
for (var j = 0; j < childElement.childNodes.length; j++) {
|
|
7726
7877
|
var childNode = childElement.childNodes[j];
|
|
@@ -7757,7 +7908,7 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
|
|
|
7757
7908
|
}
|
|
7758
7909
|
var templateElements = document.getElementsByClassName(this.element.id + '_template');
|
|
7759
7910
|
if (!isNullOrUndefined(templateElements) && templateElements.length > 0 &&
|
|
7760
|
-
getElementByID(this.element.id + '_Layer_Collections') && this.
|
|
7911
|
+
getElementByID(this.element.id + '_Layer_Collections') && !this.isTileMap) {
|
|
7761
7912
|
for (var i = 0; i < templateElements.length; i++) {
|
|
7762
7913
|
var offSetLetValue = 0;
|
|
7763
7914
|
var offSetTopValue = 0;
|
|
@@ -7792,10 +7943,7 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
|
|
|
7792
7943
|
var mainLayer = this.layersCollection[0];
|
|
7793
7944
|
var padding = 0;
|
|
7794
7945
|
if (mainLayer.isBaseLayer && (mainLayer.layerType === 'OSM' || mainLayer.layerType === 'Bing' ||
|
|
7795
|
-
mainLayer.layerType === 'GoogleStaticMap' || mainLayer.layerType === 'Google')) {
|
|
7796
|
-
if (mainLayer.layerType === 'Google') {
|
|
7797
|
-
mainLayer.urlTemplate = 'https://mt1.google.com/vt/lyrs=m@129&hl=en&x=tileX&y=tileY&z=level';
|
|
7798
|
-
}
|
|
7946
|
+
mainLayer.layerType === 'GoogleStaticMap' || mainLayer.layerType === 'Google' || (!isNullOrUndefined(mainLayer.urlTemplate) && mainLayer.urlTemplate !== ''))) {
|
|
7799
7947
|
removeElement(this.element.id + '_tile_parent');
|
|
7800
7948
|
removeElement(this.element.id + '_tiles');
|
|
7801
7949
|
removeElement('animated_tiles');
|
|
@@ -7843,7 +7991,7 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
|
|
|
7843
7991
|
var baseLayer = mainLayers[i];
|
|
7844
7992
|
if (baseLayer.visible && baseIndex === i) {
|
|
7845
7993
|
baseLayer.isBaseLayer = true;
|
|
7846
|
-
this.isTileMap = (baseLayer.layerType === 'Geometry') ? false : true;
|
|
7994
|
+
this.isTileMap = (baseLayer.layerType === 'Geometry' && !isNullOrUndefined(baseLayer.shapeData)) ? false : true;
|
|
7847
7995
|
this.layersCollection.push(baseLayer);
|
|
7848
7996
|
break;
|
|
7849
7997
|
}
|
|
@@ -7890,12 +8038,19 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
|
|
|
7890
8038
|
* @private
|
|
7891
8039
|
*/
|
|
7892
8040
|
Maps.prototype.renderTitle = function (title, type, bounds, groupEle) {
|
|
7893
|
-
var style =
|
|
8041
|
+
var style = {
|
|
8042
|
+
size: title.textStyle.size,
|
|
8043
|
+
color: title.textStyle.color,
|
|
8044
|
+
fontFamily: title.textStyle.fontFamily,
|
|
8045
|
+
fontWeight: title.textStyle.fontWeight,
|
|
8046
|
+
fontStyle: title.textStyle.fontStyle,
|
|
8047
|
+
opacity: title.textStyle.opacity
|
|
8048
|
+
};
|
|
7894
8049
|
var height;
|
|
7895
8050
|
var width = Math.abs((this.margin.left + this.margin.right) - this.availableSize.width);
|
|
7896
|
-
style.fontFamily =
|
|
8051
|
+
style.fontFamily = !isNullOrUndefined(style.fontFamily) ? style.fontFamily : this.themeStyle.fontFamily;
|
|
7897
8052
|
style.fontWeight = style.fontWeight || this.themeStyle.titleFontWeight;
|
|
7898
|
-
style.size = this.themeStyle.titleFontSize
|
|
8053
|
+
style.size = type === 'title' ? (style.size || this.themeStyle.titleFontSize) : (style.size || Theme.mapsSubTitleFont.size);
|
|
7899
8054
|
if (title.text) {
|
|
7900
8055
|
if (isNullOrUndefined(groupEle)) {
|
|
7901
8056
|
groupEle = this.renderer.createGroup({ id: this.element.id + '_Title_Group' });
|
|
@@ -8065,6 +8220,7 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
|
|
|
8065
8220
|
var id = event.target['id'];
|
|
8066
8221
|
event.preventDefault();
|
|
8067
8222
|
if (this.legendModule && (id.indexOf('_Left_Page_Rect') > -1 || id.indexOf('_Right_Page_Rect') > -1)) {
|
|
8223
|
+
this.mapAreaRect = this.legendModule.initialMapAreaRect;
|
|
8068
8224
|
this.legendModule.currentPage = (id.indexOf('_Left_Page_') > -1) ? (this.legendModule.currentPage - 1) :
|
|
8069
8225
|
(this.legendModule.currentPage + 1);
|
|
8070
8226
|
this.legendModule.legendGroup = this.renderer.createGroup({ id: this.element.id + '_Legend_Group' });
|
|
@@ -8414,7 +8570,7 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
|
|
|
8414
8570
|
removeElement(this.element.id + '_EJ2_LegendTitle_Tooltip');
|
|
8415
8571
|
}
|
|
8416
8572
|
if ((targetId === (this.element.id + '_Map_title')) && (event.target.textContent.indexOf('...') > -1)) {
|
|
8417
|
-
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);
|
|
8573
|
+
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);
|
|
8418
8574
|
}
|
|
8419
8575
|
else {
|
|
8420
8576
|
removeElement(this.element.id + '_EJ2_Title_Tooltip');
|
|
@@ -8848,7 +9004,8 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
|
|
|
8848
9004
|
var collection = Object.keys(newProp.layers[x]);
|
|
8849
9005
|
for (var _b = 0, collection_1 = collection; _b < collection_1.length; _b++) {
|
|
8850
9006
|
var collectionProp = collection_1[_b];
|
|
8851
|
-
if (collectionProp === 'layerType' && newProp.layers[x].layerType
|
|
9007
|
+
if ((collectionProp === 'layerType' && newProp.layers[x].layerType !== 'Geometry') || (isNullOrUndefined(this.layers[x].shapeData)
|
|
9008
|
+
&& !isNullOrUndefined(this.layers[x].urlTemplate) && this.layers[x].urlTemplate !== '')) {
|
|
8852
9009
|
this.isReset = true;
|
|
8853
9010
|
}
|
|
8854
9011
|
else if (collectionProp === 'markerSettings') {
|
|
@@ -9131,6 +9288,28 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
|
|
|
9131
9288
|
}
|
|
9132
9289
|
return null;
|
|
9133
9290
|
};
|
|
9291
|
+
/**
|
|
9292
|
+
* This method is used to get the Bing maps URL.
|
|
9293
|
+
*
|
|
9294
|
+
* @param {string} url - Specifies the URL of the maps.
|
|
9295
|
+
* @returns {Promise<string>} - Returns the processed Bing URL as Promise.
|
|
9296
|
+
*/
|
|
9297
|
+
Maps.prototype.getBingUrlTemplate = function (url) {
|
|
9298
|
+
var promise = new Promise(function (resolve, reject) {
|
|
9299
|
+
var ajax = new Ajax({
|
|
9300
|
+
url: url
|
|
9301
|
+
});
|
|
9302
|
+
ajax.onSuccess = function (json) {
|
|
9303
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9304
|
+
var jsonObject = JSON.parse(json);
|
|
9305
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9306
|
+
var resource = jsonObject['resourceSets'][0]['resources'][0];
|
|
9307
|
+
resolve(resource['imageUrl']);
|
|
9308
|
+
};
|
|
9309
|
+
ajax.send();
|
|
9310
|
+
});
|
|
9311
|
+
return promise;
|
|
9312
|
+
};
|
|
9134
9313
|
/**
|
|
9135
9314
|
* To find visibility of layers and markers for required modules load.
|
|
9136
9315
|
*
|
|
@@ -9485,12 +9664,8 @@ var Bubble = /** @__PURE__ @class */ (function () {
|
|
|
9485
9664
|
isNaN(shapeData[layer.shapeDataPath]) ? shapeData[layer.shapeDataPath].toLowerCase() : shapeData[layer.shapeDataPath];
|
|
9486
9665
|
var shapePathValue = !isNullOrUndefined(shape[shapePath]) && isNaN(shape[shapePath])
|
|
9487
9666
|
? shape[shapePath].toLowerCase() : shape[shapePath];
|
|
9488
|
-
if (shapeDataLayerPathValue === shapePathValue && layerData[i].type !== 'LineString') {
|
|
9489
|
-
if (layerData[i]['
|
|
9490
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9491
|
-
shapePoints.push(this.getPoints(layerData[i], []));
|
|
9492
|
-
}
|
|
9493
|
-
else if (!layerData[i]['_isMultiPolygon']) {
|
|
9667
|
+
if (shapeDataLayerPathValue === shapePathValue && (layerData[i].type !== 'LineString' && layerData[i].type !== 'MultiLineString' && layerData[i]['type'] !== 'Point' && layerData[i]['type'] !== 'MultiPoint')) {
|
|
9668
|
+
if (!layerData[i]['_isMultiPolygon']) {
|
|
9494
9669
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9495
9670
|
shapePoints.push(this.getPoints(layerData[i], []));
|
|
9496
9671
|
currentLength = shapePoints[shapePoints.length - 1].length;
|
|
@@ -9815,7 +9990,7 @@ var DataLabel = /** @__PURE__ @class */ (function () {
|
|
|
9815
9990
|
layer.dataSource, layer.shapeDataPath, shapeData['properties'][propertyPath], layer.shapeDataPath);
|
|
9816
9991
|
if (!isNullOrUndefined(shapes['property'])) {
|
|
9817
9992
|
shapePoint = [[]];
|
|
9818
|
-
if (!layerData[index]['_isMultiPolygon'] && layerData[index]['type'] !== 'Point') {
|
|
9993
|
+
if (!layerData[index]['_isMultiPolygon'] && layerData[index]['type'] !== 'Point' && layerData[index]['type'] !== 'MultiPoint') {
|
|
9819
9994
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9820
9995
|
shapePoint.push(this.getPoint(layerData[index], []));
|
|
9821
9996
|
currentLength = shapePoint[shapePoint.length - 1].length;
|
|
@@ -9824,21 +9999,9 @@ var DataLabel = /** @__PURE__ @class */ (function () {
|
|
|
9824
9999
|
midIndex = shapePoint.length - 1;
|
|
9825
10000
|
}
|
|
9826
10001
|
}
|
|
9827
|
-
else {
|
|
10002
|
+
else if (layerData[index]['type'] !== 'Point' && layerData[index]['type'] !== 'MultiPoint') {
|
|
9828
10003
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9829
10004
|
var layer_1 = layerData[index];
|
|
9830
|
-
if (layer_1['type'] === 'Point') {
|
|
9831
|
-
isPoint = true;
|
|
9832
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9833
|
-
var layerPoints = [];
|
|
9834
|
-
layerPoints.push(this.getPoint(layerData, []));
|
|
9835
|
-
shapePoint = layerPoints;
|
|
9836
|
-
currentLength = shapePoint[shapePoint.length - 1].length;
|
|
9837
|
-
if (pointsLength < currentLength) {
|
|
9838
|
-
pointsLength = currentLength;
|
|
9839
|
-
midIndex = shapePoint.length - 1;
|
|
9840
|
-
}
|
|
9841
|
-
}
|
|
9842
10005
|
for (var j = 0; j < layer_1.length; j++) {
|
|
9843
10006
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9844
10007
|
shapePoint.push(this.getPoint(layer_1[j], []));
|
|
@@ -10083,10 +10246,21 @@ var DataLabel = /** @__PURE__ @class */ (function () {
|
|
|
10083
10246
|
};
|
|
10084
10247
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10085
10248
|
DataLabel.prototype.getPoint = function (shapes, points) {
|
|
10086
|
-
|
|
10087
|
-
|
|
10088
|
-
|
|
10089
|
-
|
|
10249
|
+
if (shapes['type'] === 'MultiLineString') {
|
|
10250
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10251
|
+
shapes.map(function (current) {
|
|
10252
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10253
|
+
current.map(function (shape) {
|
|
10254
|
+
points.push(new Point(shape['point']['x'], shape['point']['y']));
|
|
10255
|
+
});
|
|
10256
|
+
});
|
|
10257
|
+
}
|
|
10258
|
+
else {
|
|
10259
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10260
|
+
shapes.map(function (current, index) {
|
|
10261
|
+
points.push(new Point(current['point']['x'], current['point']['y']));
|
|
10262
|
+
});
|
|
10263
|
+
}
|
|
10090
10264
|
return points;
|
|
10091
10265
|
};
|
|
10092
10266
|
/**
|
|
@@ -10280,6 +10454,10 @@ var Legend = /** @__PURE__ @class */ (function () {
|
|
|
10280
10454
|
* @private
|
|
10281
10455
|
*/
|
|
10282
10456
|
this.legendBorderRect = new Rect(0, 0, 0, 0);
|
|
10457
|
+
/**
|
|
10458
|
+
* @private
|
|
10459
|
+
*/
|
|
10460
|
+
this.initialMapAreaRect = new Rect(0, 0, 0, 0);
|
|
10283
10461
|
/**
|
|
10284
10462
|
* @private
|
|
10285
10463
|
*/
|
|
@@ -10338,6 +10516,7 @@ var Legend = /** @__PURE__ @class */ (function () {
|
|
|
10338
10516
|
this.heightIncrement = 0;
|
|
10339
10517
|
this.defsElement = this.maps.renderer.createDefs();
|
|
10340
10518
|
this.maps.svgObject.appendChild(this.defsElement);
|
|
10519
|
+
this.initialMapAreaRect = this.maps.mapAreaRect;
|
|
10341
10520
|
this.calculateLegendBounds();
|
|
10342
10521
|
this.drawLegend();
|
|
10343
10522
|
};
|
|
@@ -10377,9 +10556,9 @@ var Legend = /** @__PURE__ @class */ (function () {
|
|
|
10377
10556
|
}
|
|
10378
10557
|
}
|
|
10379
10558
|
}
|
|
10380
|
-
|
|
10381
|
-
|
|
10382
|
-
|
|
10559
|
+
}
|
|
10560
|
+
if (legend.type === 'Markers') {
|
|
10561
|
+
_this.getMarkersLegendCollections(layerIndex, layer.markerSettings);
|
|
10383
10562
|
}
|
|
10384
10563
|
});
|
|
10385
10564
|
if (this.legendCollection.length > 0) {
|
|
@@ -10570,8 +10749,9 @@ var Legend = /** @__PURE__ @class */ (function () {
|
|
|
10570
10749
|
}
|
|
10571
10750
|
}
|
|
10572
10751
|
else {
|
|
10752
|
+
var padding = 10;
|
|
10573
10753
|
shapeX = shapeLocation[j - 1].x;
|
|
10574
|
-
shapeY = prevPositionY +
|
|
10754
|
+
shapeY = prevPositionY + padding + (shapeHeight / 2);
|
|
10575
10755
|
}
|
|
10576
10756
|
}
|
|
10577
10757
|
}
|
|
@@ -10674,7 +10854,14 @@ var Legend = /** @__PURE__ @class */ (function () {
|
|
|
10674
10854
|
var legend = map.legendSettings;
|
|
10675
10855
|
var render = map.renderer;
|
|
10676
10856
|
var textOptions;
|
|
10677
|
-
var textFont =
|
|
10857
|
+
var textFont = {
|
|
10858
|
+
size: legend.textStyle.size,
|
|
10859
|
+
color: legend.textStyle.color,
|
|
10860
|
+
fontFamily: legend.textStyle.fontFamily,
|
|
10861
|
+
fontWeight: legend.textStyle.fontWeight,
|
|
10862
|
+
fontStyle: legend.textStyle.fontStyle,
|
|
10863
|
+
opacity: legend.textStyle.opacity
|
|
10864
|
+
};
|
|
10678
10865
|
this.legendGroup = render.createGroup({ id: map.element.id + '_Legend_Group' });
|
|
10679
10866
|
if (legend.mode === 'Interactive') {
|
|
10680
10867
|
for (var i = 0; i < this.legendRenderingCollections.length; i++) {
|
|
@@ -10690,7 +10877,7 @@ var Legend = /** @__PURE__ @class */ (function () {
|
|
|
10690
10877
|
textFont.color = (textFont.color !== null) ? textFont.color : this.maps.themeStyle.legendTextColor;
|
|
10691
10878
|
var rectOptions = new RectOption(itemId, item['fill'], item['shapeBorder'], legend.opacity, bounds);
|
|
10692
10879
|
textOptions = new TextOption(textId, textLocation.x, textLocation.y, 'middle', item['text'], '', '');
|
|
10693
|
-
textFont.fontFamily =
|
|
10880
|
+
textFont.fontFamily = !isNullOrUndefined(textFont.fontFamily) ? textFont.fontFamily : this.maps.themeStyle.fontFamily;
|
|
10694
10881
|
textFont.size = map.themeStyle.legendFontSize || textFont.size;
|
|
10695
10882
|
renderTextElement(textOptions, textFont, textFont.color, this.legendGroup);
|
|
10696
10883
|
this.legendGroup.appendChild(render.drawRectangle(rectOptions));
|
|
@@ -10745,7 +10932,7 @@ var Legend = /** @__PURE__ @class */ (function () {
|
|
|
10745
10932
|
};
|
|
10746
10933
|
legendTextStyle.color = (legendTextStyle.color !== null) ? legendTextStyle.color :
|
|
10747
10934
|
this.maps.themeStyle.legendTextColor;
|
|
10748
|
-
legendTextStyle.fontFamily =
|
|
10935
|
+
legendTextStyle.fontFamily = !isNullOrUndefined(legendTextStyle.fontFamily) ? legendTextStyle.fontFamily : this.maps.themeStyle.fontFamily;
|
|
10749
10936
|
legendTextStyle.size = map.themeStyle.legendFontSize || legendTextStyle.size;
|
|
10750
10937
|
if (i === 0) {
|
|
10751
10938
|
this.renderLegendBorder();
|
|
@@ -10821,7 +11008,9 @@ var Legend = /** @__PURE__ @class */ (function () {
|
|
|
10821
11008
|
'opacity': 1,
|
|
10822
11009
|
'dominant-baseline': ''
|
|
10823
11010
|
};
|
|
10824
|
-
|
|
11011
|
+
var pagingTextElement = render.createText(pageTextOptions, pagingText);
|
|
11012
|
+
pagingTextElement.setAttribute('style', 'user-select: none;');
|
|
11013
|
+
pagingGroup.appendChild(pagingTextElement);
|
|
10825
11014
|
this.legendGroup.appendChild(pagingGroup);
|
|
10826
11015
|
}
|
|
10827
11016
|
this.legendToggle();
|
|
@@ -10833,6 +11022,7 @@ var Legend = /** @__PURE__ @class */ (function () {
|
|
|
10833
11022
|
var shapeIndex;
|
|
10834
11023
|
var layerIndex;
|
|
10835
11024
|
var dataIndex;
|
|
11025
|
+
var pointIndex;
|
|
10836
11026
|
var legend = this.maps.legendSettings;
|
|
10837
11027
|
var textEle = legend.mode === 'Default' ? document.getElementById(targetElement.id.replace('Shape', 'Text')) :
|
|
10838
11028
|
document.getElementById(targetElement.id + '_Text');
|
|
@@ -10920,12 +11110,20 @@ var Legend = /** @__PURE__ @class */ (function () {
|
|
|
10920
11110
|
}
|
|
10921
11111
|
if (enable) {
|
|
10922
11112
|
for (var j = 0; j < data.length; j++) {
|
|
11113
|
+
var shapeElement = void 0;
|
|
10923
11114
|
shapeIndex = data[j]['shapeIndex'];
|
|
10924
11115
|
layerIndex = data[j]['layerIndex'];
|
|
10925
11116
|
dataIndex = data[j]['dataIndex'];
|
|
10926
|
-
|
|
10927
|
-
|
|
10928
|
-
|
|
11117
|
+
pointIndex = data[j]['pointIndex'];
|
|
11118
|
+
if (pointIndex === -1) {
|
|
11119
|
+
shapeElement = document.getElementById(this.maps.element.id + '_LayerIndex_' +
|
|
11120
|
+
layerIndex + '_shapeIndex_' + shapeIndex + '_dataIndex_' + dataIndex);
|
|
11121
|
+
}
|
|
11122
|
+
else {
|
|
11123
|
+
shapeElement = document.getElementById(this.maps.element.id + '_LayerIndex_' +
|
|
11124
|
+
layerIndex + '_shapeIndex_' + shapeIndex + '_dataIndex_' + dataIndex + '_multiLine_' + pointIndex);
|
|
11125
|
+
}
|
|
11126
|
+
if (shapeElement !== null) {
|
|
10929
11127
|
var shapeMatch = true;
|
|
10930
11128
|
if (this.maps.legendSelectionCollection !== null) {
|
|
10931
11129
|
for (var i_1 = 0; i_1 < this.maps.legendSelectionCollection.length; i_1++) {
|
|
@@ -10942,13 +11140,13 @@ var Legend = /** @__PURE__ @class */ (function () {
|
|
|
10942
11140
|
}
|
|
10943
11141
|
length = this.legendHighlightCollection.length;
|
|
10944
11142
|
var legendHighlightColor = this.legendHighlightCollection[length - 1]['legendOldFill'];
|
|
10945
|
-
this.legendHighlightCollection[length - 1]['MapShapeCollection']['Elements'].push(
|
|
11143
|
+
this.legendHighlightCollection[length - 1]['MapShapeCollection']['Elements'].push(shapeElement);
|
|
10946
11144
|
var shapeItemCount = this.legendHighlightCollection[length - 1]['MapShapeCollection']['Elements'].length - 1;
|
|
10947
|
-
var shapeOldFillColor =
|
|
11145
|
+
var shapeOldFillColor = shapeElement.getAttribute('fill');
|
|
10948
11146
|
this.legendHighlightCollection[length - 1]['shapeOldFillColor'].push(shapeOldFillColor);
|
|
10949
11147
|
var shapeOldColor = this.legendHighlightCollection[length - 1]['shapeOldFillColor'][shapeItemCount];
|
|
10950
11148
|
this.shapePreviousColor = this.legendHighlightCollection[length - 1]['shapeOldFillColor'];
|
|
10951
|
-
this.setColor(
|
|
11149
|
+
this.setColor(shapeElement, !isNullOrUndefined(module.fill) ? module.fill : shapeOldColor, module.opacity.toString(), module.border.color, module.border.width.toString(), 'highlight');
|
|
10952
11150
|
this.setColor(targetElement, !isNullOrUndefined(module.fill) ? module.fill : legendHighlightColor, module.opacity.toString(), module.border.color, module.border.width.toString(), 'highlight');
|
|
10953
11151
|
}
|
|
10954
11152
|
else if (value === 'selection') {
|
|
@@ -10971,12 +11169,12 @@ var Legend = /** @__PURE__ @class */ (function () {
|
|
|
10971
11169
|
}
|
|
10972
11170
|
selectLength = this.maps.legendSelectionCollection.length;
|
|
10973
11171
|
var legendSelectionColor = this.maps.legendSelectionCollection[selectLength - 1]['legendOldFill'];
|
|
10974
|
-
this.maps.legendSelectionCollection[selectLength - 1]['MapShapeCollection']['Elements'].push(
|
|
11172
|
+
this.maps.legendSelectionCollection[selectLength - 1]['MapShapeCollection']['Elements'].push(shapeElement);
|
|
10975
11173
|
this.maps.legendSelectionCollection[selectLength - 1]['shapeOldFillColor'] = this.shapePreviousColor;
|
|
10976
11174
|
this.setColor(targetElement, !isNullOrUndefined(module.fill) ? module.fill : legendSelectionColor, module.opacity.toString(), module.border.color, module.border.width.toString(), 'selection');
|
|
10977
|
-
this.setColor(
|
|
10978
|
-
if (this.maps.selectedElementId.indexOf(
|
|
10979
|
-
this.maps.selectedElementId.push(
|
|
11175
|
+
this.setColor(shapeElement, !isNullOrUndefined(module.fill) ? module.fill : legendSelectionColor, module.opacity.toString(), module.border.color, module.border.width.toString(), 'selection');
|
|
11176
|
+
if (this.maps.selectedElementId.indexOf(shapeElement.getAttribute('id')) === -1) {
|
|
11177
|
+
this.maps.selectedElementId.push(shapeElement.getAttribute('id'));
|
|
10980
11178
|
}
|
|
10981
11179
|
if (j === data.length - 1) {
|
|
10982
11180
|
this.maps.legendSelection = false;
|
|
@@ -10991,14 +11189,15 @@ var Legend = /** @__PURE__ @class */ (function () {
|
|
|
10991
11189
|
}
|
|
10992
11190
|
};
|
|
10993
11191
|
Legend.prototype.setColor = function (element, fill, opacity, borderColor, borderWidth, type) {
|
|
11192
|
+
var isLineStringShape = (element.parentElement.id.indexOf('LineString') > -1);
|
|
10994
11193
|
if (type === 'selection') {
|
|
10995
|
-
maintainStyleClass('ShapeselectionMap', 'ShapeselectionMapStyle', fill, opacity, borderColor, borderWidth, this.maps);
|
|
10996
|
-
element.setAttribute('class', 'ShapeselectionMapStyle');
|
|
11194
|
+
maintainStyleClass((isLineStringShape ? 'LineselectionMap' : 'ShapeselectionMap'), (isLineStringShape ? 'LineselectionMapStyle' : 'ShapeselectionMapStyle'), (isLineStringShape ? 'transparent' : fill), opacity, (isLineStringShape ? fill : borderColor), borderWidth, this.maps);
|
|
11195
|
+
element.setAttribute('class', isLineStringShape ? 'LineselectionMapStyle' : 'ShapeselectionMapStyle');
|
|
10997
11196
|
}
|
|
10998
11197
|
else {
|
|
10999
|
-
element.setAttribute('fill', fill);
|
|
11198
|
+
element.setAttribute('fill', isLineStringShape ? 'transparent' : fill);
|
|
11000
11199
|
element.setAttribute('fill-opacity', opacity);
|
|
11001
|
-
element.setAttribute('stroke', borderColor);
|
|
11200
|
+
element.setAttribute('stroke', isLineStringShape ? fill : borderColor);
|
|
11002
11201
|
element.setAttribute('stroke-width', (Number(borderWidth) / this.maps.scale).toString());
|
|
11003
11202
|
}
|
|
11004
11203
|
};
|
|
@@ -11041,7 +11240,8 @@ var Legend = /** @__PURE__ @class */ (function () {
|
|
|
11041
11240
|
var dataCount = shapeElements.length;
|
|
11042
11241
|
for (var j = 0; j < dataCount; j++) {
|
|
11043
11242
|
var shapeElement = getElement(shapeElements[j]);
|
|
11044
|
-
if (shapeElement.getAttribute('class') === 'ShapeselectionMapStyle'
|
|
11243
|
+
if (shapeElement.getAttribute('class') === 'ShapeselectionMapStyle' ||
|
|
11244
|
+
shapeElement.getAttribute('class') === 'LineselectionMapStyle') {
|
|
11045
11245
|
removeClass(shapeElement);
|
|
11046
11246
|
var selectedElementIdIndex = this.maps.selectedElementId.indexOf(shapeElement.id);
|
|
11047
11247
|
if (selectedElementIdIndex !== -1) {
|
|
@@ -11119,12 +11319,14 @@ var Legend = /** @__PURE__ @class */ (function () {
|
|
|
11119
11319
|
this.maps.legendSelectionClass = module;
|
|
11120
11320
|
}
|
|
11121
11321
|
else {
|
|
11122
|
-
if ((checkSelection <= 1) && targetElement.getAttribute('class') === 'ShapeselectionMapStyle'
|
|
11322
|
+
if ((checkSelection <= 1) && (targetElement.getAttribute('class') === 'ShapeselectionMapStyle'
|
|
11323
|
+
|| targetElement.getAttribute('class') === 'LineselectionMapStyle')) {
|
|
11123
11324
|
if (!this.maps.layers[layerIndex].selectionSettings.enableMultiSelect) {
|
|
11124
11325
|
this.maps.selectedLegendElementId.splice(selectionIndex, 1);
|
|
11125
11326
|
}
|
|
11126
11327
|
else {
|
|
11127
|
-
if (checkSelection <= 1 && targetElement.getAttribute('class') === 'ShapeselectionMapStyle'
|
|
11328
|
+
if (checkSelection <= 1 && (targetElement.getAttribute('class') === 'ShapeselectionMapStyle'
|
|
11329
|
+
|| targetElement.getAttribute('class') === 'LineselectionMapStyle')) {
|
|
11128
11330
|
this.maps.selectedLegendElementId.splice(selectionIndex, 1);
|
|
11129
11331
|
}
|
|
11130
11332
|
}
|
|
@@ -11211,7 +11413,8 @@ var Legend = /** @__PURE__ @class */ (function () {
|
|
|
11211
11413
|
}
|
|
11212
11414
|
}
|
|
11213
11415
|
}
|
|
11214
|
-
if (selectionEle && (selectionEle['IsSelected'] && targetElement.getAttribute('class') === 'ShapeselectionMapStyle'
|
|
11416
|
+
if (selectionEle && (selectionEle['IsSelected'] && (targetElement.getAttribute('class') === 'ShapeselectionMapStyle'
|
|
11417
|
+
|| targetElement.getAttribute('class') === 'LineselectionMapStyle'))) {
|
|
11215
11418
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11216
11419
|
var element = this.maps.legendSelectionCollection[selectionEle['SelectionIndex']];
|
|
11217
11420
|
var multiSelection = 0;
|
|
@@ -11302,7 +11505,7 @@ var Legend = /** @__PURE__ @class */ (function () {
|
|
|
11302
11505
|
}
|
|
11303
11506
|
for (var j = 0; j < this.maps.selectedLegendElementId.length; j++) {
|
|
11304
11507
|
var idIndex = this.maps.legendSettings.mode === 'Interactive' ?
|
|
11305
|
-
'
|
|
11508
|
+
this.maps.element.id + '_Legend_Index_' : this.maps.element.id + '_Legend_Shape_Index_';
|
|
11306
11509
|
var selectedElement = idIndex + this.maps.selectedLegendElementId[j];
|
|
11307
11510
|
var legendElement = document.getElementById(selectedElement);
|
|
11308
11511
|
if (!isNullOrUndefined(legendElement)) {
|
|
@@ -11354,6 +11557,7 @@ var Legend = /** @__PURE__ @class */ (function () {
|
|
|
11354
11557
|
var shapeIndex;
|
|
11355
11558
|
var layerIndex;
|
|
11356
11559
|
var dataIndex;
|
|
11560
|
+
var pointIndex;
|
|
11357
11561
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11358
11562
|
var collection = this.maps.legendModule.legendCollection;
|
|
11359
11563
|
var legend = this.maps.legendSettings;
|
|
@@ -11366,15 +11570,23 @@ var Legend = /** @__PURE__ @class */ (function () {
|
|
|
11366
11570
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11367
11571
|
var currentElement = { Elements: [] };
|
|
11368
11572
|
for (var j = 0; j < data.length; j++) {
|
|
11573
|
+
var shapeElement = void 0;
|
|
11369
11574
|
shapeIndex = data[j]['shapeIndex'];
|
|
11370
11575
|
layerIndex = data[j]['layerIndex'];
|
|
11371
11576
|
dataIndex = data[j]['dataIndex'];
|
|
11372
|
-
|
|
11373
|
-
|
|
11374
|
-
|
|
11577
|
+
pointIndex = data[j]['pointIndex'];
|
|
11578
|
+
if (pointIndex === -1) {
|
|
11579
|
+
shapeElement = document.getElementById(this.maps.element.id + '_LayerIndex_' +
|
|
11580
|
+
layerIndex + '_shapeIndex_' + shapeIndex + '_dataIndex_' + dataIndex);
|
|
11581
|
+
}
|
|
11582
|
+
else {
|
|
11583
|
+
shapeElement = document.getElementById(this.maps.element.id + '_LayerIndex_' +
|
|
11584
|
+
layerIndex + '_shapeIndex_' + shapeIndex + '_dataIndex_' + dataIndex + '_multiLine_' + pointIndex);
|
|
11585
|
+
}
|
|
11586
|
+
if (targetElement === shapeElement) {
|
|
11375
11587
|
process = true;
|
|
11376
11588
|
}
|
|
11377
|
-
elements.push(
|
|
11589
|
+
elements.push(shapeElement);
|
|
11378
11590
|
}
|
|
11379
11591
|
if (process) {
|
|
11380
11592
|
if (isNullOrUndefined(currentElement['LegendEle'])) {
|
|
@@ -11392,16 +11604,25 @@ var Legend = /** @__PURE__ @class */ (function () {
|
|
|
11392
11604
|
var shapeIndex;
|
|
11393
11605
|
var layerIndex;
|
|
11394
11606
|
var dataIndex;
|
|
11607
|
+
var pointIndex;
|
|
11395
11608
|
var idIndex = parseFloat(targetElement.id.charAt(targetElement.id.length - 1));
|
|
11396
11609
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11397
11610
|
var data = this.maps.legendModule.legendCollection[idIndex]['data'];
|
|
11398
11611
|
var legendShapeElements = [];
|
|
11399
11612
|
for (var i = 0; i < data.length; i++) {
|
|
11613
|
+
var shapeElement = void 0;
|
|
11400
11614
|
shapeIndex = data[i]['shapeIndex'];
|
|
11401
11615
|
layerIndex = data[i]['layerIndex'];
|
|
11402
11616
|
dataIndex = data[i]['dataIndex'];
|
|
11403
|
-
|
|
11404
|
-
|
|
11617
|
+
pointIndex = data[i]['pointIndex'];
|
|
11618
|
+
if (pointIndex === -1) {
|
|
11619
|
+
shapeElement = document.getElementById(this.maps.element.id + '_LayerIndex_' +
|
|
11620
|
+
layerIndex + '_shapeIndex_' + shapeIndex + '_dataIndex_' + dataIndex);
|
|
11621
|
+
}
|
|
11622
|
+
else {
|
|
11623
|
+
shapeElement = document.getElementById(this.maps.element.id + '_LayerIndex_' +
|
|
11624
|
+
layerIndex + '_shapeIndex_' + shapeIndex + '_dataIndex_' + dataIndex + '_multiLine_' + pointIndex);
|
|
11625
|
+
}
|
|
11405
11626
|
if (!isNullOrUndefined(shapeElement)) {
|
|
11406
11627
|
legendShapeElements.push(shapeElement.id);
|
|
11407
11628
|
}
|
|
@@ -11469,9 +11690,11 @@ var Legend = /** @__PURE__ @class */ (function () {
|
|
|
11469
11690
|
var renderOptions = new RectOption(map.element.id + '_Legend_Border', legend.background, legendBorder, 1, this.legendBorderRect, null, null, '', '');
|
|
11470
11691
|
this.legendGroup.appendChild(map.renderer.drawRectangle(renderOptions));
|
|
11471
11692
|
this.getLegendAlignment(map, this.legendBorderRect.width, this.legendBorderRect.height, legend);
|
|
11472
|
-
this.legendGroup.setAttribute('transform', 'translate( ' + (this.translate.x + (-
|
|
11693
|
+
this.legendGroup.setAttribute('transform', 'translate( ' + (this.translate.x + (-this.legendBorderRect.x)) + ' ' +
|
|
11473
11694
|
(this.translate.y + (-(this.legendBorderRect.y))) + ' )');
|
|
11474
|
-
|
|
11695
|
+
if (legend.position !== 'Float') {
|
|
11696
|
+
map.svgObject.appendChild(this.legendGroup);
|
|
11697
|
+
}
|
|
11475
11698
|
if (legendTitle) {
|
|
11476
11699
|
textStyle.color = (textStyle.color !== null) ? textStyle.color : this.maps.themeStyle.legendTitleFontColor;
|
|
11477
11700
|
textStyle.fontFamily = !isNullOrUndefined(textStyle.fontFamily) ? textStyle.fontFamily : this.maps.themeStyle.fontFamily;
|
|
@@ -11483,7 +11706,16 @@ var Legend = /** @__PURE__ @class */ (function () {
|
|
|
11483
11706
|
this.currentPage = (e.target.id.indexOf('_Left_Page_') > -1) ? (this.currentPage - 1) :
|
|
11484
11707
|
(this.currentPage + 1);
|
|
11485
11708
|
this.legendGroup = this.maps.renderer.createGroup({ id: this.maps.element.id + '_Legend_Group' });
|
|
11709
|
+
this.maps.mapAreaRect = this.initialMapAreaRect;
|
|
11486
11710
|
this.drawLegendItem(this.currentPage);
|
|
11711
|
+
if (!isNullOrUndefined(this.maps.legendModule) && this.maps.legendSettings.position === 'Float') {
|
|
11712
|
+
if (this.maps.isTileMap) {
|
|
11713
|
+
this.maps.mapLayerPanel.layerGroup.appendChild(this.maps.legendModule.legendGroup);
|
|
11714
|
+
}
|
|
11715
|
+
else {
|
|
11716
|
+
this.maps.svgObject.appendChild(this.maps.legendModule.legendGroup);
|
|
11717
|
+
}
|
|
11718
|
+
}
|
|
11487
11719
|
if (querySelector(this.maps.element.id + '_Legend_Border', this.maps.element.id)) {
|
|
11488
11720
|
querySelector(this.maps.element.id + '_Legend_Border', this.maps.element.id).style.pointerEvents = 'none';
|
|
11489
11721
|
}
|
|
@@ -11501,53 +11733,60 @@ var Legend = /** @__PURE__ @class */ (function () {
|
|
|
11501
11733
|
var areaWidth = totalRect.width;
|
|
11502
11734
|
var totalWidth = map.availableSize.width;
|
|
11503
11735
|
var totalHeight = map.availableSize.height;
|
|
11736
|
+
var locationX = !isNullOrUndefined(legend.location.x) ? legend.location.x : 0;
|
|
11737
|
+
var locationY = !isNullOrUndefined(legend.location.y) ? legend.location.y : 0;
|
|
11504
11738
|
if (legend.position === 'Float') {
|
|
11505
|
-
this.translate =
|
|
11739
|
+
this.translate = map.isTileMap ? new Point(locationX, locationY + (spacing / 4)) : new Point(locationX + map.mapAreaRect.x, locationY + map.mapAreaRect.y);
|
|
11740
|
+
this.legendTotalRect = map.mapAreaRect;
|
|
11506
11741
|
}
|
|
11507
11742
|
else {
|
|
11508
11743
|
switch (legend.position) {
|
|
11509
11744
|
case 'Top':
|
|
11510
11745
|
case 'Bottom':
|
|
11511
|
-
totalRect.height = (areaHeight - height);
|
|
11746
|
+
totalRect.height = (legend.position === 'Top') ? (areaHeight - height) : (areaHeight - height - (spacing * 2));
|
|
11512
11747
|
x = (totalWidth / 2) - (width / 2);
|
|
11513
11748
|
y = (legend.position === 'Top') ? areaY : (areaY + totalRect.height);
|
|
11514
|
-
totalRect.y = (legend.position === 'Top') ? areaY + height + spacing : areaY;
|
|
11749
|
+
totalRect.y = (legend.position === 'Top') ? areaY + height + (map.isTileMap ? (spacing / 2) : spacing) : areaY - (spacing / 2);
|
|
11515
11750
|
break;
|
|
11516
11751
|
case 'Left':
|
|
11517
11752
|
case 'Right':
|
|
11518
|
-
totalRect.width = (areaWidth - width);
|
|
11519
|
-
x = (legend.position === 'Left') ? areaX : (areaX + totalRect.width
|
|
11753
|
+
totalRect.width = (areaWidth - width - map.mapAreaRect.x);
|
|
11754
|
+
x = (legend.position === 'Left') ? areaX + (spacing / 2) : (areaX + totalRect.width + spacing);
|
|
11520
11755
|
y = (totalHeight / 2) - (height / 2);
|
|
11521
|
-
totalRect.x = (legend.position === 'Left') ? areaX + width : areaX;
|
|
11756
|
+
totalRect.x = (legend.position === 'Left') ? areaX + width + spacing : areaX;
|
|
11522
11757
|
break;
|
|
11523
11758
|
}
|
|
11524
11759
|
switch (legend.alignment) {
|
|
11525
11760
|
case 'Near':
|
|
11526
11761
|
if (legend.position === 'Top' || legend.position === 'Bottom') {
|
|
11527
|
-
x = totalRect.x;
|
|
11762
|
+
x = totalRect.x - (legend.mode === 'Interactive' ? spacing : 0);
|
|
11528
11763
|
}
|
|
11529
11764
|
else {
|
|
11530
|
-
y = totalRect.y;
|
|
11765
|
+
y = totalRect.y - (!(legend.height && legend.width) && legend.mode === 'Interactive' ? map.mapAreaRect.x : 0);
|
|
11531
11766
|
}
|
|
11532
11767
|
break;
|
|
11533
11768
|
case 'Far':
|
|
11534
11769
|
if (legend.position === 'Top' || legend.position === 'Bottom') {
|
|
11535
|
-
x = (totalWidth - width) - spacing;
|
|
11770
|
+
x = (totalWidth - width) - (legend.mode === 'Interactive' ? 0 : spacing);
|
|
11536
11771
|
}
|
|
11537
11772
|
else {
|
|
11538
|
-
y = totalHeight - height;
|
|
11773
|
+
y = totalHeight - height - (legend.mode === 'Default' ? spacing : 0);
|
|
11539
11774
|
}
|
|
11540
11775
|
break;
|
|
11541
11776
|
}
|
|
11542
11777
|
if ((legend.height || legend.width) && legend.mode !== 'Interactive') {
|
|
11543
|
-
this.legendTotalRect = map.totalRect = totalRect;
|
|
11778
|
+
this.legendTotalRect = map.mapAreaRect = map.totalRect = totalRect;
|
|
11544
11779
|
}
|
|
11545
11780
|
else {
|
|
11781
|
+
map.totalRect = null;
|
|
11546
11782
|
if ((legend.height || legend.width) && legend.mode === 'Interactive') {
|
|
11547
11783
|
map.totalRect = totalRect;
|
|
11548
11784
|
}
|
|
11549
11785
|
this.legendTotalRect = map.mapAreaRect = totalRect;
|
|
11550
11786
|
}
|
|
11787
|
+
if (legend.position === 'Left') {
|
|
11788
|
+
map.mapAreaRect.width = totalRect.width;
|
|
11789
|
+
}
|
|
11551
11790
|
this.translate = new Point(x, y);
|
|
11552
11791
|
}
|
|
11553
11792
|
};
|
|
@@ -11676,6 +11915,13 @@ var Legend = /** @__PURE__ @class */ (function () {
|
|
|
11676
11915
|
borderColor: legend.shapeBorder.color, borderWidth: legend.shapeBorder.width
|
|
11677
11916
|
});
|
|
11678
11917
|
}
|
|
11918
|
+
else {
|
|
11919
|
+
for (var i = 0; i < this.legendCollection.length; i++) {
|
|
11920
|
+
if (this.legendCollection[i]['text'] === legendText && this.legendCollection[i]['fill'] === legendFill) {
|
|
11921
|
+
this.legendCollection[i].data.push(newColllection[0]);
|
|
11922
|
+
}
|
|
11923
|
+
}
|
|
11924
|
+
}
|
|
11679
11925
|
}
|
|
11680
11926
|
};
|
|
11681
11927
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -11877,15 +12123,16 @@ var Legend = /** @__PURE__ @class */ (function () {
|
|
|
11877
12123
|
var width = 10;
|
|
11878
12124
|
var direction = (legend.orientation === 'None') ? (legend.position === 'Top' || legend.position === 'Bottom')
|
|
11879
12125
|
? 'Horizontal' : 'Vertical' : legend.orientation;
|
|
12126
|
+
rect.y = legend.position === 'Float' && this.maps.isTileMap ? rect.y - this.maps.mapAreaRect.y : rect.y;
|
|
11880
12127
|
if (direction === 'Horizontal') {
|
|
11881
12128
|
if (!legend.invertedPointer) {
|
|
11882
|
-
locX = rect.x + (rect.width / 2);
|
|
12129
|
+
locX = rect.x + (rect.width / 2) - (legend.position === 'Float' && this.maps.isTileMap ? this.maps.mapAreaRect.x : 0);
|
|
11883
12130
|
locY = rect.y;
|
|
11884
12131
|
path = ' M ' + locX + ' ' + locY + ' L ' + (locX - width) + ' ' + (locY - height) +
|
|
11885
12132
|
' L ' + (locX + width) + ' ' + (locY - height) + ' Z ';
|
|
11886
12133
|
}
|
|
11887
12134
|
else {
|
|
11888
|
-
locX = rect.x + (rect.width / 2);
|
|
12135
|
+
locX = rect.x + (rect.width / 2) - (legend.position === 'Float' && this.maps.isTileMap ? this.maps.mapAreaRect.x : 0);
|
|
11889
12136
|
locY = rect.y + (rect.height);
|
|
11890
12137
|
path = ' M ' + locX + ' ' + locY + ' L ' + (locX - width) + ' ' + (locY + height) +
|
|
11891
12138
|
' L ' + (locX + width) + ' ' + (locY + height) + ' Z ';
|
|
@@ -11893,20 +12140,25 @@ var Legend = /** @__PURE__ @class */ (function () {
|
|
|
11893
12140
|
}
|
|
11894
12141
|
else {
|
|
11895
12142
|
if (!legend.invertedPointer) {
|
|
11896
|
-
locX = rect.x +
|
|
12143
|
+
locX = rect.x + rect.width - (legend.position === 'Float' && this.maps.isTileMap ? this.maps.mapAreaRect.x : 0);
|
|
11897
12144
|
locY = rect.y + (rect.height / 2);
|
|
11898
12145
|
path = ' M ' + locX + ' ' + locY + ' L ' + (locX + width) + ' ' + (locY - height) +
|
|
11899
12146
|
' L ' + (locX + width) + ' ' + (locY + height) + ' z ';
|
|
11900
12147
|
}
|
|
11901
12148
|
else {
|
|
11902
|
-
locX = rect.x;
|
|
12149
|
+
locX = rect.x - (legend.position === 'Float' && this.maps.isTileMap ? this.maps.mapAreaRect.x : 0);
|
|
11903
12150
|
locY = rect.y + (rect.height / 2);
|
|
11904
12151
|
path = ' M ' + locX + ' ' + locY + ' L ' + (locX - width) + ' ' + (locY - height) +
|
|
11905
12152
|
' L ' + (locX - width) + ' ' + (locY + height) + ' z ';
|
|
11906
12153
|
}
|
|
11907
12154
|
}
|
|
11908
12155
|
var pathOptions = new PathOption(id, fill, strokeWidth, stroke, 1, 1, '', path);
|
|
11909
|
-
|
|
12156
|
+
if (legend.position === 'Float' && this.maps.isTileMap) {
|
|
12157
|
+
this.maps.mapLayerPanel.layerGroup.appendChild(this.maps.renderer.drawPath(pathOptions));
|
|
12158
|
+
}
|
|
12159
|
+
else {
|
|
12160
|
+
this.maps.svgObject.appendChild(this.maps.renderer.drawPath(pathOptions));
|
|
12161
|
+
}
|
|
11910
12162
|
};
|
|
11911
12163
|
Legend.prototype.wireEvents = function (element) {
|
|
11912
12164
|
EventHandler.add(element, Browser.touchStartEvent, this.changeNextPage, this);
|
|
@@ -12267,10 +12519,20 @@ var Legend = /** @__PURE__ @class */ (function () {
|
|
|
12267
12519
|
var shapeDataValueCase = !isNullOrUndefined(shapeData['properties'][shapePath])
|
|
12268
12520
|
&& isNaN(shapeData['properties'][shapePath]) ? shapeData['properties'][shapePath].toLowerCase() : shapeData['properties'][shapePath];
|
|
12269
12521
|
if (shapeDataValueCase === dataPathValueCase) {
|
|
12270
|
-
|
|
12271
|
-
|
|
12272
|
-
|
|
12273
|
-
|
|
12522
|
+
if (shapeData['geometry']['type'] != 'MultiPoint') {
|
|
12523
|
+
legendData.push({
|
|
12524
|
+
layerIndex: layerIndex, shapeIndex: i, dataIndex: dataIndex,
|
|
12525
|
+
name: data[dataPath], value: value, pointIndex: -1
|
|
12526
|
+
});
|
|
12527
|
+
}
|
|
12528
|
+
else {
|
|
12529
|
+
for (var j = 0; j < shapeData['geometry'].coordinates.length; j++) {
|
|
12530
|
+
legendData.push({
|
|
12531
|
+
layerIndex: layerIndex, shapeIndex: i, dataIndex: dataIndex,
|
|
12532
|
+
name: data[dataPath], value: value, pointIndex: j
|
|
12533
|
+
});
|
|
12534
|
+
}
|
|
12535
|
+
}
|
|
12274
12536
|
}
|
|
12275
12537
|
}
|
|
12276
12538
|
}
|
|
@@ -12382,7 +12644,8 @@ var Highlight = /** @__PURE__ @class */ (function () {
|
|
|
12382
12644
|
targetEle.getAttribute('class') !== 'ShapeselectionMapStyle' && !isTouch &&
|
|
12383
12645
|
targetEle.getAttribute('class') !== 'MarkerselectionMapStyle' &&
|
|
12384
12646
|
targetEle.getAttribute('class') !== 'BubbleselectionMapStyle' &&
|
|
12385
|
-
targetEle.getAttribute('class') !== 'navigationlineselectionMapStyle'
|
|
12647
|
+
targetEle.getAttribute('class') !== 'navigationlineselectionMapStyle' &&
|
|
12648
|
+
targetEle.getAttribute('class') !== 'LineselectionMapStyle') {
|
|
12386
12649
|
layerIndex = parseInt(targetEle.id.split('_LayerIndex_')[1].split('_')[0], 10);
|
|
12387
12650
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12388
12651
|
var shapeData = void 0;
|
|
@@ -12392,8 +12655,9 @@ var Highlight = /** @__PURE__ @class */ (function () {
|
|
|
12392
12655
|
var dataIndex = void 0;
|
|
12393
12656
|
if (targetEle.id.indexOf('shapeIndex') > -1) {
|
|
12394
12657
|
shapeIn = parseInt(targetEle.id.split('_shapeIndex_')[1].split('_')[0], 10);
|
|
12395
|
-
shapeData = this.maps.layers[layerIndex].shapeData['features']
|
|
12396
|
-
this.maps.
|
|
12658
|
+
shapeData = this.maps.layers[layerIndex].shapeData['features'] &&
|
|
12659
|
+
!isNullOrUndefined(this.maps.layersCollection[layerIndex].layerData[shapeIn]) ?
|
|
12660
|
+
this.maps.layersCollection[layerIndex].layerData[shapeIn]['property'] : null;
|
|
12397
12661
|
dataIndex = parseInt(targetEle.id.split('_dataIndex_')[1].split('_')[0], 10);
|
|
12398
12662
|
data = isNullOrUndefined(dataIndex) ? null : this.maps.layers[layerIndex].dataSource[dataIndex];
|
|
12399
12663
|
this.highlightSettings = this.maps.layers[layerIndex].highlightSettings;
|
|
@@ -12465,7 +12729,8 @@ var Highlight = /** @__PURE__ @class */ (function () {
|
|
|
12465
12729
|
*/
|
|
12466
12730
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12467
12731
|
Highlight.prototype.handleHighlight = function (targetElement, layerIndex, data, shapeData) {
|
|
12468
|
-
if (this.maps.legendSettings.visible && targetElement.id.indexOf('_MarkerIndex_') === -1 && this.maps.legendModule
|
|
12732
|
+
if (this.maps.legendSettings.visible && targetElement.id.indexOf('_MarkerIndex_') === -1 && this.maps.legendModule
|
|
12733
|
+
&& this.maps.legendSettings.type === 'Layers') {
|
|
12469
12734
|
this.maps.legendModule.shapeHighLightAndSelection(targetElement, data, this.highlightSettings, 'highlight', layerIndex);
|
|
12470
12735
|
}
|
|
12471
12736
|
var selectHighLight = targetElement.id.indexOf('shapeIndex') > -1 && (this.maps.legendSettings.visible && this.maps.legendModule) ?
|
|
@@ -12484,7 +12749,7 @@ var Highlight = /** @__PURE__ @class */ (function () {
|
|
|
12484
12749
|
isMarkerSelect = this.maps.layers[layerIndex].markerSettings[marker$$1].highlightSettings.enable;
|
|
12485
12750
|
}
|
|
12486
12751
|
var border = {
|
|
12487
|
-
color: (targetEle.parentElement.id.indexOf('LineString') === -1) ? this.highlightSettings.border.color : (this.highlightSettings.
|
|
12752
|
+
color: (targetEle.parentElement.id.indexOf('LineString') === -1) ? this.highlightSettings.border.color : (this.highlightSettings.fill || this.highlightSettings.border.color),
|
|
12488
12753
|
width: (targetEle.parentElement.id.indexOf('LineString') === -1) ? (this.highlightSettings.border.width / (isMarkerSelect ? 1 : this.maps.scale)) : (this.highlightSettings.border.width / this.maps.scale),
|
|
12489
12754
|
opacity: this.highlightSettings.border.opacity
|
|
12490
12755
|
};
|
|
@@ -12600,8 +12865,12 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
12600
12865
|
var layerIndex = parseInt(targetElement.id.split('_LayerIndex_')[1].split('_')[0], 10);
|
|
12601
12866
|
if (targetElement.id.indexOf('shapeIndex') > -1) {
|
|
12602
12867
|
shapeIndex = parseInt(targetElement.id.split('_shapeIndex_')[1].split('_')[0], 10);
|
|
12603
|
-
shapeData = this.maps.layers[layerIndex].shapeData['features']
|
|
12604
|
-
this.maps.layers[layerIndex].shapeData['features'][
|
|
12868
|
+
shapeData = !isNullOrUndefined(this.maps.layers[layerIndex].shapeData['features'])
|
|
12869
|
+
&& this.maps.layers[layerIndex].shapeData['features']['length'] > shapeIndex ?
|
|
12870
|
+
this.maps.layers[layerIndex].shapeData['features'][shapeIndex]['properties'] :
|
|
12871
|
+
!isNullOrUndefined(this.maps.layers[layerIndex].shapeData['geometries'])
|
|
12872
|
+
&& this.maps.layers[layerIndex].shapeData['geometries']['length'] > shapeIndex ?
|
|
12873
|
+
this.maps.layers[layerIndex].shapeData['geometries'][shapeIndex]['properties'] : null;
|
|
12605
12874
|
dataIndex = parseInt(targetElement.id.split('_dataIndex_')[1].split('_')[0], 10);
|
|
12606
12875
|
data = isNullOrUndefined(dataIndex) ? null : this.maps.layers[layerIndex].dataSource[dataIndex];
|
|
12607
12876
|
this.selectionsettings = this.maps.layers[layerIndex].selectionSettings;
|
|
@@ -12682,15 +12951,17 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
12682
12951
|
Selection.prototype.selectMap = function (targetElement, shapeData, data) {
|
|
12683
12952
|
var _this = this;
|
|
12684
12953
|
var layerIndex = parseInt(targetElement.id.split('_LayerIndex_')[1].split('_')[0], 10);
|
|
12954
|
+
var isLineStringShape = targetElement.parentElement.id.indexOf('LineString') > -1;
|
|
12685
12955
|
var selectionsettings = this.selectionsettings;
|
|
12686
12956
|
var border = {
|
|
12687
|
-
color: (
|
|
12688
|
-
width:
|
|
12957
|
+
color: isLineStringShape ? (this.selectionsettings.fill || this.selectionsettings.border.color) : this.selectionsettings.border.color,
|
|
12958
|
+
width: isLineStringShape ? (this.selectionsettings.border.width / this.maps.scale) :
|
|
12959
|
+
(this.selectionsettings.border.width / (this.selectionType === 'Marker' ? 1 : this.maps.scale)),
|
|
12689
12960
|
opacity: this.selectionsettings.border.opacity
|
|
12690
12961
|
};
|
|
12691
12962
|
var eventArgs = {
|
|
12692
12963
|
opacity: this.selectionsettings.opacity,
|
|
12693
|
-
fill:
|
|
12964
|
+
fill: isLineStringShape ? 'transparent' : (this.selectionType !== 'navigationline' ? this.selectionsettings.fill : 'none'),
|
|
12694
12965
|
border: border,
|
|
12695
12966
|
name: itemSelection,
|
|
12696
12967
|
target: targetElement.id,
|
|
@@ -12702,7 +12973,8 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
12702
12973
|
this.maps.trigger('itemSelection', eventArgs, function (observedArgs) {
|
|
12703
12974
|
eventArgs.border.opacity = isNullOrUndefined(_this.selectionsettings.border.opacity) ? _this.selectionsettings.opacity : _this.selectionsettings.border.opacity;
|
|
12704
12975
|
if (!eventArgs.cancel) {
|
|
12705
|
-
if (targetElement.getAttribute('class') === _this.selectionType + 'selectionMapStyle'
|
|
12976
|
+
if (targetElement.getAttribute('class') === _this.selectionType + 'selectionMapStyle'
|
|
12977
|
+
|| targetElement.getAttribute('class') === 'LineselectionMapStyle') {
|
|
12706
12978
|
removeClass(targetElement);
|
|
12707
12979
|
_this.removedSelectionList(targetElement);
|
|
12708
12980
|
for (var m = 0; m < _this.maps.shapeSelectionItem.length; m++) {
|
|
@@ -12721,7 +12993,8 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
12721
12993
|
else {
|
|
12722
12994
|
var layetElement = getElementByID(_this.maps.element.id + '_Layer_Collections');
|
|
12723
12995
|
if (!_this.selectionsettings.enableMultiSelect &&
|
|
12724
|
-
layetElement.getElementsByClassName(_this.selectionType + 'selectionMapStyle').length > 0
|
|
12996
|
+
(layetElement.getElementsByClassName(_this.selectionType + 'selectionMapStyle').length > 0 ||
|
|
12997
|
+
layetElement.getElementsByClassName('LineselectionMapStyle').length > 0)) {
|
|
12725
12998
|
var eleCount = layetElement.getElementsByClassName(_this.selectionType + 'selectionMapStyle').length;
|
|
12726
12999
|
var ele = void 0;
|
|
12727
13000
|
for (var k = 0; k < eleCount; k++) {
|
|
@@ -12729,6 +13002,14 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
12729
13002
|
removeClass(ele);
|
|
12730
13003
|
_this.removedSelectionList(ele);
|
|
12731
13004
|
}
|
|
13005
|
+
if (layetElement.getElementsByClassName('LineselectionMapStyle').length > 0) {
|
|
13006
|
+
eleCount = layetElement.getElementsByClassName('LineselectionMapStyle').length;
|
|
13007
|
+
for (var k = 0; k < eleCount; k++) {
|
|
13008
|
+
ele = layetElement.getElementsByClassName('LineselectionMapStyle')[0];
|
|
13009
|
+
removeClass(ele);
|
|
13010
|
+
_this.removedSelectionList(ele);
|
|
13011
|
+
}
|
|
13012
|
+
}
|
|
12732
13013
|
if (_this.selectionType === 'Shape') {
|
|
12733
13014
|
_this.maps.shapeSelectionItem = [];
|
|
12734
13015
|
var selectionLength = _this.maps.selectedElementId.length;
|
|
@@ -12746,13 +13027,24 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
12746
13027
|
ele.setAttribute('stroke', _this.maps.layers[layerIndex_2].navigationLineSettings[index].color);
|
|
12747
13028
|
}
|
|
12748
13029
|
}
|
|
12749
|
-
if (!
|
|
12750
|
-
|
|
13030
|
+
if (!isLineStringShape) {
|
|
13031
|
+
if (!getElement(_this.selectionType + 'selectionMap')) {
|
|
13032
|
+
document.body.appendChild(createStyle(_this.selectionType + 'selectionMap', _this.selectionType + 'selectionMapStyle', eventArgs));
|
|
13033
|
+
}
|
|
13034
|
+
else {
|
|
13035
|
+
customizeStyle(_this.selectionType + 'selectionMap', _this.selectionType + 'selectionMapStyle', eventArgs);
|
|
13036
|
+
}
|
|
13037
|
+
targetElement.setAttribute('class', _this.selectionType + 'selectionMapStyle');
|
|
12751
13038
|
}
|
|
12752
13039
|
else {
|
|
12753
|
-
|
|
13040
|
+
if (!getElement('LineselectionMap')) {
|
|
13041
|
+
document.body.appendChild(createStyle('LineselectionMap', 'LineselectionMapStyle', eventArgs));
|
|
13042
|
+
}
|
|
13043
|
+
else {
|
|
13044
|
+
customizeStyle('LineselectionMap', 'LineselectionMapStyle', eventArgs);
|
|
13045
|
+
}
|
|
13046
|
+
targetElement.setAttribute('class', 'LineselectionMapStyle');
|
|
12754
13047
|
}
|
|
12755
|
-
targetElement.setAttribute('class', _this.selectionType + 'selectionMapStyle');
|
|
12756
13048
|
if (targetElement.getAttribute('class') === 'ShapeselectionMapStyle') {
|
|
12757
13049
|
_this.maps.shapeSelectionClass = getElement(_this.selectionType + 'selectionMap');
|
|
12758
13050
|
_this.maps.selectedElementId.push(targetElement.getAttribute('id'));
|
|
@@ -13234,8 +13526,6 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
13234
13526
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13235
13527
|
this.startTouches = [];
|
|
13236
13528
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13237
|
-
this.shapeZoomLocation = [];
|
|
13238
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13239
13529
|
this.intersect = [];
|
|
13240
13530
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13241
13531
|
this.mouseDownLatLong = { x: 0, y: 0 };
|
|
@@ -13275,7 +13565,8 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
13275
13565
|
var minZoom = map.zoomSettings.minZoom;
|
|
13276
13566
|
newZoomFactor = (minZoom > newZoomFactor && type === 'ZoomIn') ? minZoom + 1 : newZoomFactor;
|
|
13277
13567
|
var prevTilePoint = map.tileTranslatePoint;
|
|
13278
|
-
if ((!map.isTileMap) && (type === 'ZoomIn' ? newZoomFactor >= minZoom && newZoomFactor <= maxZoom : newZoomFactor >= minZoom)
|
|
13568
|
+
if ((!map.isTileMap) && ((type === 'ZoomIn' ? newZoomFactor >= minZoom && newZoomFactor <= maxZoom : newZoomFactor >= minZoom)
|
|
13569
|
+
|| map.isReset)) {
|
|
13279
13570
|
var availSize = map.mapAreaRect;
|
|
13280
13571
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13281
13572
|
var minBounds = map.baseMapRectBounds['min'];
|
|
@@ -13283,17 +13574,29 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
13283
13574
|
var maxBounds = map.baseMapRectBounds['max'];
|
|
13284
13575
|
var mapTotalWidth = Math.abs(minBounds['x'] - maxBounds['x']);
|
|
13285
13576
|
var mapTotalHeight = Math.abs(minBounds['y'] - maxBounds['y']);
|
|
13286
|
-
var
|
|
13287
|
-
var
|
|
13288
|
-
|
|
13289
|
-
|
|
13290
|
-
|
|
13291
|
-
|
|
13292
|
-
|
|
13577
|
+
var translatePointX = void 0;
|
|
13578
|
+
var translatePointY = void 0;
|
|
13579
|
+
if (newZoomFactor < 1.2 && map.projectionType !== 'Eckert5') {
|
|
13580
|
+
if (mapTotalWidth === 0 || mapTotalHeight === 0 || mapTotalWidth === mapTotalHeight) {
|
|
13581
|
+
mapTotalWidth = availSize.width / 2;
|
|
13582
|
+
mapTotalHeight = availSize.height;
|
|
13583
|
+
}
|
|
13584
|
+
newZoomFactor = parseFloat(Math.min(availSize.width / mapTotalWidth, availSize.height / mapTotalHeight).toFixed(2));
|
|
13585
|
+
map.translatePoint = this.calculateInitalZoomTranslatePoint(newZoomFactor, mapTotalWidth, mapTotalHeight, availSize, minBounds, map);
|
|
13586
|
+
}
|
|
13587
|
+
else {
|
|
13588
|
+
var point = map.translatePoint;
|
|
13589
|
+
translatePointX = point.x - (((availSize.width / scale) - (availSize.width / newZoomFactor)) / (availSize.width / position.x));
|
|
13590
|
+
translatePointY = point.y - (((availSize.height / scale) - (availSize.height / newZoomFactor)) / (availSize.height / position.y));
|
|
13591
|
+
var currentHeight = Math.abs(map.baseMapRectBounds['max']['y'] - map.baseMapRectBounds['min']['y']) * newZoomFactor;
|
|
13592
|
+
translatePointX = (currentHeight < map.mapAreaRect.height) ? (availSize.x + ((-(minBounds['x'])) + ((availSize.width / 2) - (mapTotalWidth / 2)))) : translatePointX;
|
|
13593
|
+
translatePointY = (currentHeight < map.mapAreaRect.height) ? (availSize.y + ((-(minBounds['y'])) + ((availSize.height / 2) - (mapTotalHeight / 2)))) : translatePointY;
|
|
13594
|
+
map.translatePoint = new Point(translatePointX, translatePointY);
|
|
13595
|
+
}
|
|
13293
13596
|
map.scale = newZoomFactor;
|
|
13294
13597
|
if (this.triggerZoomEvent(prevTilePoint, prevLevel, type)) {
|
|
13295
13598
|
map.translatePoint = map.previousPoint;
|
|
13296
|
-
map.scale = map.previousScale;
|
|
13599
|
+
map.scale = map.mapScaleValue = map.previousScale;
|
|
13297
13600
|
}
|
|
13298
13601
|
else {
|
|
13299
13602
|
this.applyTransform();
|
|
@@ -13349,6 +13652,14 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
13349
13652
|
}
|
|
13350
13653
|
this.maps.zoomNotApplied = false;
|
|
13351
13654
|
};
|
|
13655
|
+
Zoom.prototype.calculateInitalZoomTranslatePoint = function (newZoomFactor, mapTotalWidth, mapTotalHeight, availSize, minBounds, map) {
|
|
13656
|
+
mapTotalWidth *= newZoomFactor;
|
|
13657
|
+
mapTotalHeight *= newZoomFactor;
|
|
13658
|
+
var widthDiff = minBounds['x'] !== 0 && map.translateType === 'layers' ? map.availableSize.width - availSize.width : 0;
|
|
13659
|
+
var translatePointX = availSize.x + ((-(minBounds['x'])) + ((availSize.width / 2) - (mapTotalWidth / 2))) - widthDiff;
|
|
13660
|
+
var translatePointY = availSize.y + ((-(minBounds['y'])) + ((availSize.height / 2) - (mapTotalHeight / 2)));
|
|
13661
|
+
return new Point(translatePointX, translatePointY);
|
|
13662
|
+
};
|
|
13352
13663
|
Zoom.prototype.triggerZoomEvent = function (prevTilePoint, prevLevel, type) {
|
|
13353
13664
|
var map = this.maps;
|
|
13354
13665
|
var zoomArgs;
|
|
@@ -13475,12 +13786,24 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
13475
13786
|
var mapTotalHeight = Math.abs(minBounds['y'] - maxBounds['y']);
|
|
13476
13787
|
var mapTotalWidth = Math.abs(minBounds['x'] - maxBounds['x']);
|
|
13477
13788
|
var translatePoint = map.translatePoint;
|
|
13478
|
-
var
|
|
13479
|
-
var
|
|
13480
|
-
|
|
13481
|
-
|
|
13482
|
-
|
|
13483
|
-
|
|
13789
|
+
var translatePointX = void 0;
|
|
13790
|
+
var translatePointY = void 0;
|
|
13791
|
+
if (zoomCalculationFactor < 1.2 && map.projectionType !== 'Eckert5') {
|
|
13792
|
+
if (mapTotalWidth === 0 || mapTotalHeight === 0 || mapTotalWidth === mapTotalHeight) {
|
|
13793
|
+
mapTotalWidth = availSize.width / 2;
|
|
13794
|
+
mapTotalHeight = availSize.height;
|
|
13795
|
+
}
|
|
13796
|
+
zoomCalculationFactor = parseFloat(Math.min(availSize.width / mapTotalWidth, availSize.height / mapTotalHeight).toFixed(2));
|
|
13797
|
+
map.translatePoint = this.calculateInitalZoomTranslatePoint(zoomCalculationFactor, mapTotalWidth, mapTotalHeight, availSize, minBounds, map);
|
|
13798
|
+
}
|
|
13799
|
+
else {
|
|
13800
|
+
var currentHeight = Math.abs(map.baseMapRectBounds['max']['y'] - map.baseMapRectBounds['min']['y']) * zoomCalculationFactor;
|
|
13801
|
+
translatePointX = translatePoint.x - (((availSize.width / map.scale) - (availSize.width / zoomCalculationFactor)) / (availSize.width / touchCenter.x));
|
|
13802
|
+
translatePointY = translatePoint.y - (((availSize.height / map.scale) - (availSize.height / zoomCalculationFactor)) / (availSize.height / touchCenter.y));
|
|
13803
|
+
translatePointX = (currentHeight < map.mapAreaRect.height) ? (availSize.x + ((-(minBounds['x'])) + ((availSize.width / 2) - (mapTotalWidth / 2)))) : translatePointX;
|
|
13804
|
+
translatePointY = (currentHeight < map.mapAreaRect.height) ? (availSize.y + ((-(minBounds['y'])) + ((availSize.height / 2) - (mapTotalHeight / 2)))) : translatePointY;
|
|
13805
|
+
map.translatePoint = new Point(translatePointX, translatePointY);
|
|
13806
|
+
}
|
|
13484
13807
|
map.scale = zoomCalculationFactor;
|
|
13485
13808
|
isZoomCancelled = this.triggerZoomEvent(prevTilePoint, prevLevel, '');
|
|
13486
13809
|
if (isZoomCancelled) {
|
|
@@ -13589,11 +13912,10 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
13589
13912
|
layerElement.appendChild(this.maps.navigationLineModule.renderNavigation(this.currentLayer, this.maps.tileZoomLevel, this.index));
|
|
13590
13913
|
}
|
|
13591
13914
|
}
|
|
13592
|
-
else {
|
|
13915
|
+
else if (currentEle.id.indexOf('Legend') == -1) {
|
|
13593
13916
|
changeBorderWidth(currentEle, this.index, scale, this.maps);
|
|
13594
13917
|
this.maps.zoomTranslatePoint = this.maps.translatePoint;
|
|
13595
13918
|
this.animateTransform(currentEle, animate$$1, x, y, scale);
|
|
13596
|
-
this.shapeZoomLocation = currentEle.childNodes;
|
|
13597
13919
|
}
|
|
13598
13920
|
}
|
|
13599
13921
|
else if (currentEle.id.indexOf('_Markers_Group') > -1) {
|
|
@@ -13700,7 +14022,7 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
13700
14022
|
for (var k = 0; k < currentEle.childElementCount; k++) {
|
|
13701
14023
|
if (currentEle.childNodes[k]['id'].indexOf('_LabelIndex_') > -1) {
|
|
13702
14024
|
var labelIndex = parseFloat(currentEle.childNodes[k]['id'].split('_LabelIndex_')[1].split('_')[0]);
|
|
13703
|
-
this.zoomshapewidth =
|
|
14025
|
+
this.zoomshapewidth = currentEle.childNodes[k].getBoundingClientRect();
|
|
13704
14026
|
this.maps.zoomShapeCollection.push(this.zoomshapewidth);
|
|
13705
14027
|
this.dataLabelTranslate(currentEle.childNodes[k], factor, x, y, scale, 'DataLabel', animate$$1);
|
|
13706
14028
|
var dataLabel = this.maps.layers[this.index].dataLabelSettings;
|
|
@@ -14119,7 +14441,7 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
14119
14441
|
var layerRect = getElementByID(map.element.id + '_Layer_Collections').getBoundingClientRect();
|
|
14120
14442
|
var elementRect = getElementByID(map.element.id + '_svg').getBoundingClientRect();
|
|
14121
14443
|
var panningXDirection = ((xDifference < 0 ? layerRect.left <= (elementRect.left + map.mapAreaRect.x) :
|
|
14122
|
-
((layerRect.left + layerRect.width
|
|
14444
|
+
((layerRect.left + layerRect.width + map.mapAreaRect.x) >= (elementRect.width))));
|
|
14123
14445
|
var panningYDirection = ((yDifference < 0 ? layerRect.top <= (elementRect.top + map.mapAreaRect.y) :
|
|
14124
14446
|
((layerRect.top + layerRect.height + legendHeight + map.margin.top) >= (elementRect.top + elementRect.height))));
|
|
14125
14447
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -14211,14 +14533,26 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
14211
14533
|
var max = map.baseMapRectBounds['max'];
|
|
14212
14534
|
var mapWidth = Math.abs(max['x'] - min['x']);
|
|
14213
14535
|
var mapHeight = Math.abs(min['y'] - max['y']);
|
|
14214
|
-
var translatePointX =
|
|
14215
|
-
var translatePointY =
|
|
14216
|
-
|
|
14217
|
-
|
|
14218
|
-
|
|
14219
|
-
|
|
14220
|
-
|
|
14221
|
-
|
|
14536
|
+
var translatePointX = void 0;
|
|
14537
|
+
var translatePointY = void 0;
|
|
14538
|
+
if (zoomFactor < 1.2 && map.projectionType !== 'Eckert5') {
|
|
14539
|
+
if (mapHeight === 0 || mapWidth === 0 || mapHeight === mapWidth) {
|
|
14540
|
+
mapWidth = size.width / 2;
|
|
14541
|
+
mapHeight = size.height;
|
|
14542
|
+
}
|
|
14543
|
+
zoomFactor = parseFloat(Math.min(size.width / mapWidth, size.height / mapHeight).toFixed(2));
|
|
14544
|
+
map.translatePoint = this.calculateInitalZoomTranslatePoint(zoomFactor, mapWidth, mapHeight, size, min, map);
|
|
14545
|
+
}
|
|
14546
|
+
else {
|
|
14547
|
+
translatePointX = translatePoint.x - (((size.width / scale) - (size.width / zoomFactor)) / 2);
|
|
14548
|
+
translatePointY = translatePoint.y - (((size.height / scale) - (size.height / zoomFactor)) / 2);
|
|
14549
|
+
var currentHeight = Math.abs(map.baseMapRectBounds['max']['y'] - map.baseMapRectBounds['min']['y']) * zoomFactor;
|
|
14550
|
+
translatePointX = (currentHeight < map.mapAreaRect.height) ? (size.x + ((-(min['x'])) + ((size.width / 2) - (mapWidth / 2))))
|
|
14551
|
+
: translatePointX;
|
|
14552
|
+
translatePointY = (currentHeight < map.mapAreaRect.height) ? (size.y + ((-(min['y'])) + ((size.height / 2) - (mapHeight / 2))))
|
|
14553
|
+
: translatePointY;
|
|
14554
|
+
map.translatePoint = new Point(translatePointX, translatePointY);
|
|
14555
|
+
}
|
|
14222
14556
|
map.zoomTranslatePoint = map.translatePoint;
|
|
14223
14557
|
map.scale = zoomFactor;
|
|
14224
14558
|
if (this.triggerZoomEvent(prevTilePoint, prevLevel, type)) {
|
|
@@ -14533,7 +14867,12 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
14533
14867
|
x = (size.width / 2) - (toolBarSize.width / 2);
|
|
14534
14868
|
break;
|
|
14535
14869
|
case 'Far':
|
|
14536
|
-
|
|
14870
|
+
if (!isNullOrUndefined(map.legendModule) && map.legendSettings.position === 'Left') {
|
|
14871
|
+
x = size.width + size.x - toolBarSize.width - padding;
|
|
14872
|
+
}
|
|
14873
|
+
else {
|
|
14874
|
+
x = (size.width - toolBarSize.width) - padding;
|
|
14875
|
+
}
|
|
14537
14876
|
break;
|
|
14538
14877
|
}
|
|
14539
14878
|
var extraPosition = map.getExtraPosition();
|
|
@@ -14589,6 +14928,7 @@ var Zoom = /** @__PURE__ @class */ (function () {
|
|
|
14589
14928
|
}
|
|
14590
14929
|
else {
|
|
14591
14930
|
map.mapScaleValue = value - delta;
|
|
14931
|
+
map.isReset = (map.mapScaleValue < 1) ? true : false;
|
|
14592
14932
|
map.staticMapZoom = map.tileZoomLevel;
|
|
14593
14933
|
if (map.mapScaleValue === 1) {
|
|
14594
14934
|
map.markerCenterLatitude = null;
|