@syncfusion/ej2-maps 19.4.53 → 19.4.56-105067
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.json +18 -3
- package/.github/PULL_REQUEST_TEMPLATE/Bug.md +72 -72
- package/.github/PULL_REQUEST_TEMPLATE/Feature.md +49 -49
- package/CHANGELOG.md +441 -422
- package/README.md +73 -73
- package/dist/ej2-maps.umd.min.js +1 -10
- package/dist/ej2-maps.umd.min.js.map +1 -1
- package/dist/es6/ej2-maps.es2015.js +1220 -653
- package/dist/es6/ej2-maps.es2015.js.map +1 -1
- package/dist/es6/ej2-maps.es5.js +1258 -692
- package/dist/es6/ej2-maps.es5.js.map +1 -1
- package/dist/global/ej2-maps.min.js +1 -10
- package/dist/global/ej2-maps.min.js.map +1 -1
- package/dist/global/index.d.ts +0 -9
- package/dist/ts/maps/layers/bing-map.ts +50 -0
- package/dist/ts/maps/layers/bubble.ts +290 -0
- package/dist/ts/maps/layers/color-mapping.ts +226 -0
- package/dist/ts/maps/layers/data-label.ts +418 -0
- package/dist/ts/maps/layers/layer-panel.ts +1480 -0
- package/dist/ts/maps/layers/legend.ts +2236 -0
- package/dist/ts/maps/layers/marker.ts +453 -0
- package/dist/ts/maps/layers/navigation-selected-line.ts +167 -0
- package/dist/ts/maps/maps.ts +2886 -0
- package/dist/ts/maps/model/base.ts +1843 -0
- package/dist/ts/maps/model/constants.ts +200 -0
- package/dist/ts/maps/model/export-image.ts +178 -0
- package/dist/ts/maps/model/export-pdf.ts +170 -0
- package/dist/ts/maps/model/interface.ts +823 -0
- package/dist/ts/maps/model/print.ts +104 -0
- package/dist/ts/maps/model/theme.ts +554 -0
- package/dist/ts/maps/user-interaction/annotation.ts +127 -0
- package/dist/ts/maps/user-interaction/highlight.ts +233 -0
- package/dist/ts/maps/user-interaction/selection.ts +321 -0
- package/dist/ts/maps/user-interaction/tooltip.ts +387 -0
- package/dist/ts/maps/user-interaction/zoom.ts +1767 -0
- package/dist/ts/maps/utils/enum.ts +368 -0
- package/dist/ts/maps/utils/helper.ts +3421 -0
- package/helper/e2e/index.js +3 -3
- package/helper/e2e/maps-helper.js +13 -13
- package/license +9 -9
- package/package.json +85 -85
- package/src/maps/layers/bing-map.d.ts +4 -0
- package/src/maps/layers/bing-map.js +16 -3
- package/src/maps/layers/bubble.d.ts +1 -2
- package/src/maps/layers/bubble.js +7 -12
- package/src/maps/layers/data-label.d.ts +1 -4
- package/src/maps/layers/data-label.js +32 -35
- package/src/maps/layers/layer-panel.d.ts +18 -1
- package/src/maps/layers/layer-panel.js +226 -72
- package/src/maps/layers/legend.d.ts +5 -2
- package/src/maps/layers/legend.js +170 -61
- package/src/maps/layers/marker.d.ts +2 -4
- package/src/maps/layers/marker.js +49 -48
- package/src/maps/layers/navigation-selected-line.d.ts +1 -2
- package/src/maps/layers/navigation-selected-line.js +7 -13
- package/src/maps/maps-model.d.ts +259 -251
- package/src/maps/maps.d.ts +25 -3
- package/src/maps/maps.js +179 -106
- package/src/maps/model/base-model.d.ts +1025 -1021
- package/src/maps/model/base.d.ts +5 -1
- package/src/maps/model/base.js +24 -24
- package/src/maps/model/constants.d.ts +6 -0
- package/src/maps/model/constants.js +6 -0
- package/src/maps/model/export-image.d.ts +2 -4
- package/src/maps/model/export-image.js +34 -33
- package/src/maps/model/export-pdf.d.ts +4 -6
- package/src/maps/model/export-pdf.js +31 -32
- package/src/maps/model/interface.d.ts +34 -26
- package/src/maps/model/print.d.ts +2 -5
- package/src/maps/model/print.js +32 -18
- package/src/maps/model/theme.js +7 -4
- package/src/maps/user-interaction/annotation.d.ts +1 -2
- package/src/maps/user-interaction/annotation.js +3 -4
- package/src/maps/user-interaction/highlight.d.ts +1 -2
- package/src/maps/user-interaction/highlight.js +11 -10
- package/src/maps/user-interaction/selection.d.ts +1 -2
- package/src/maps/user-interaction/selection.js +42 -19
- package/src/maps/user-interaction/tooltip.d.ts +3 -5
- package/src/maps/user-interaction/tooltip.js +27 -14
- package/src/maps/user-interaction/zoom.d.ts +3 -8
- package/src/maps/user-interaction/zoom.js +282 -162
- package/src/maps/utils/enum.d.ts +5 -1
- package/src/maps/utils/helper.d.ts +9 -1
- package/src/maps/utils/helper.js +82 -33
package/src/maps/utils/enum.d.ts
CHANGED
|
@@ -40,7 +40,11 @@ export declare type MapsTheme =
|
|
|
40
40
|
/** Renders a map with Bootstrap5 theme. */
|
|
41
41
|
'Bootstrap5' |
|
|
42
42
|
/** Render a map with Bootstrap5 dark theme. */
|
|
43
|
-
'Bootstrap5Dark'
|
|
43
|
+
'Bootstrap5Dark' |
|
|
44
|
+
/** Renders a map with Fluent theme. */
|
|
45
|
+
'Fluent' |
|
|
46
|
+
/** Render a map with Fluent dark theme. */
|
|
47
|
+
'FluentDark';
|
|
44
48
|
/**
|
|
45
49
|
* Defines the position of the legend.
|
|
46
50
|
*/
|
|
@@ -818,6 +818,14 @@ export declare function fixInitialScaleForTile(map: Maps): void;
|
|
|
818
818
|
* @returns {Element} - Returns the element
|
|
819
819
|
*/
|
|
820
820
|
export declare function getElementByID(id: string): Element;
|
|
821
|
+
/**
|
|
822
|
+
* Function to get clientElement from id.
|
|
823
|
+
*
|
|
824
|
+
* @param {string} id - Specifies the id
|
|
825
|
+
* @returns {Element} - Returns the element
|
|
826
|
+
* @private
|
|
827
|
+
*/
|
|
828
|
+
export declare function getClientElement(id: string): ClientRect;
|
|
821
829
|
/**
|
|
822
830
|
* To apply internalization
|
|
823
831
|
*
|
|
@@ -833,7 +841,7 @@ export declare function Internalize(maps: Maps, value: number): string;
|
|
|
833
841
|
* @returns {Function} - Returns the function
|
|
834
842
|
* @private
|
|
835
843
|
*/
|
|
836
|
-
export declare function getTemplateFunction(template: string): any;
|
|
844
|
+
export declare function getTemplateFunction(template: string, maps: Maps): any;
|
|
837
845
|
/**
|
|
838
846
|
* Function to get element from id.
|
|
839
847
|
*
|
package/src/maps/utils/helper.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
var __extends = (this && this.__extends) || (function () {
|
|
2
|
-
var extendStatics = function (d, b) {
|
|
3
|
-
extendStatics = Object.setPrototypeOf ||
|
|
4
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
6
|
-
return extendStatics(d, b);
|
|
7
|
-
};
|
|
8
|
-
return function (d, b) {
|
|
9
|
-
extendStatics(d, b);
|
|
10
|
-
function __() { this.constructor = d; }
|
|
11
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
12
|
-
};
|
|
13
|
-
})();
|
|
1
|
+
var __extends = (this && this.__extends) || (function () {
|
|
2
|
+
var extendStatics = function (d, b) {
|
|
3
|
+
extendStatics = Object.setPrototypeOf ||
|
|
4
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
+
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
6
|
+
return extendStatics(d, b);
|
|
7
|
+
};
|
|
8
|
+
return function (d, b) {
|
|
9
|
+
extendStatics(d, b);
|
|
10
|
+
function __() { this.constructor = d; }
|
|
11
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
12
|
+
};
|
|
13
|
+
})();
|
|
14
14
|
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
|
15
15
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
16
16
|
/* eslint-disable max-len */
|
|
@@ -807,6 +807,8 @@ export function drawSymbols(shape, imageUrl, location, markerID, shapeCustom, ma
|
|
|
807
807
|
var padding = 5;
|
|
808
808
|
var rectOptions;
|
|
809
809
|
var pathOptions = new PathOption(markerID, fill, borderWidth, borderColor, opacity, borderOpacity, dashArray, '');
|
|
810
|
+
size.width = typeof (size.width) === 'string' ? parseInt(size.width, 10) : size.width;
|
|
811
|
+
size.height = typeof (size.height) === 'string' ? parseInt(size.height, 10) : size.height;
|
|
810
812
|
if (shape === 'Circle') {
|
|
811
813
|
var radius = (size.width + size.height) / 4;
|
|
812
814
|
var circleOptions = new CircleOption(markerID, fill, border, opacity, location.x, location.y, radius, dashArray);
|
|
@@ -1024,8 +1026,8 @@ export function clusterTemplate(currentLayer, markerTemplate, maps, layerIndex,
|
|
|
1024
1026
|
shapeCustom['borderWidth'] = eventArg.border.width;
|
|
1025
1027
|
shapeCustom['borderOpacity'] = isNullOrUndefined(eventArg.border.opacity) ? clusters_1.opacity : eventArg.border.opacity;
|
|
1026
1028
|
}
|
|
1027
|
-
tempX = (maps.isTileMap) ? tempX : (markerTemplate.id.indexOf('_Markers_Group') > -1) ? tempX :
|
|
1028
|
-
tempY = (maps.isTileMap) ? tempY : (markerTemplate.id.indexOf('_Markers_Group') > -1) ? tempY :
|
|
1029
|
+
tempX = (maps.isTileMap) ? tempX : (markerTemplate.id.indexOf('_Markers_Group') > -1) ? tempX : tempX + postionY - (eventArg.width / 2);
|
|
1030
|
+
tempY = (maps.isTileMap) ? tempY : (markerTemplate.id.indexOf('_Markers_Group') > -1) ? tempY : tempY - (eventArg.height / 2);
|
|
1029
1031
|
if (maps.isTileMap && !maps.zoomSettings.enable) {
|
|
1030
1032
|
tempX = location_1.x;
|
|
1031
1033
|
tempY = location_1.y;
|
|
@@ -1104,12 +1106,15 @@ export function clusterTemplate(currentLayer, markerTemplate, maps, layerIndex,
|
|
|
1104
1106
|
getElementByID(maps.element.id + '_Secondary_Element').appendChild(markerCollection);
|
|
1105
1107
|
layerElement.appendChild(markerCollection);
|
|
1106
1108
|
}
|
|
1107
|
-
var markerCluster = document.getElementById(maps.element.id + '
|
|
1109
|
+
var markerCluster = document.getElementById(maps.element.id + '_LayerIndex_' + layerIndex + '_markerCluster');
|
|
1108
1110
|
if (!isNullOrUndefined(markerCluster)) {
|
|
1109
1111
|
markerCluster.remove();
|
|
1110
1112
|
}
|
|
1111
1113
|
if (zoomCheck) {
|
|
1112
|
-
document.getElementById(maps.element.id + '_Layer_Collections')
|
|
1114
|
+
var layerGroupElement = document.getElementById(maps.element.id + '_Layer_Collections');
|
|
1115
|
+
if (!isNullOrUndefined(layerGroupElement)) {
|
|
1116
|
+
layerGroupElement.appendChild(layerElement);
|
|
1117
|
+
}
|
|
1113
1118
|
}
|
|
1114
1119
|
});
|
|
1115
1120
|
}
|
|
@@ -1126,15 +1131,16 @@ export function mergeSeparateCluster(sameMarkerData, maps, markerElement) {
|
|
|
1126
1131
|
var markerIndex = sameMarkerData[0].markerIndex;
|
|
1127
1132
|
var dataIndex = sameMarkerData[0].dataIndex;
|
|
1128
1133
|
var markerId = maps.element.id + '_LayerIndex_' + layerIndex + '_MarkerIndex_' + markerIndex;
|
|
1134
|
+
var marker = maps.layers[layerIndex].markerSettings[markerIndex];
|
|
1129
1135
|
var clusterId = markerId + '_dataIndex_' + dataIndex + '_cluster_' + clusterIndex;
|
|
1130
|
-
var clusterEle = getElement(clusterId);
|
|
1136
|
+
var clusterEle = maps.layers[layerIndex].markerClusterSettings.shape === 'Balloon' ? getElement(clusterId + '_Group') : getElement(clusterId);
|
|
1131
1137
|
var clusterEleLabel = getElement(clusterId + '_datalabel_' + clusterIndex);
|
|
1132
1138
|
clusterEle.setAttribute('visibility', 'visible');
|
|
1133
1139
|
clusterEleLabel.setAttribute('visibility', 'visible');
|
|
1134
1140
|
var markerEle;
|
|
1135
1141
|
var markerDataLength = sameMarkerData[0].data.length;
|
|
1136
1142
|
for (var i = 0; i < markerDataLength; i++) {
|
|
1137
|
-
markerEle = getElement(markerId + '_dataIndex_' + sameMarkerData[0].data[i]['index']);
|
|
1143
|
+
markerEle = marker.shape === 'Balloon' ? getElement(markerId + '_dataIndex_' + sameMarkerData[0].data[i]['index'] + '_Group') : getElement(markerId + '_dataIndex_' + sameMarkerData[0].data[i]['index']);
|
|
1138
1144
|
markerEle['style']['visibility'] = 'hidden';
|
|
1139
1145
|
}
|
|
1140
1146
|
removeElement(maps.element.id + '_LayerIndex_' + layerIndex + '_MarkerIndex_' + markerIndex + '_markerClusterConnectorLine');
|
|
@@ -1156,13 +1162,13 @@ export function clusterSeparate(sameMarkerData, maps, markerElement, isDom) {
|
|
|
1156
1162
|
var getElementFunction = isDom ? getElement : markerElement.querySelector.bind(markerElement);
|
|
1157
1163
|
var getQueryConnect = isDom ? '' : '#';
|
|
1158
1164
|
var markerId = maps.element.id + '_LayerIndex_' + layerIndex + '_MarkerIndex_' + markerIndex;
|
|
1165
|
+
var marker = maps.layers[layerIndex].markerSettings[markerIndex];
|
|
1159
1166
|
var clusterId = markerId + '_dataIndex_' + dataIndex + '_cluster_' + clusterIndex;
|
|
1160
|
-
var clusterEle = getElementFunction(getQueryConnect + '' + clusterId);
|
|
1167
|
+
var clusterEle = maps.layers[layerIndex].markerClusterSettings.shape === 'Balloon' ? getElementFunction(getQueryConnect + '' + clusterId + '_Group') : getElementFunction(getQueryConnect + '' + clusterId);
|
|
1161
1168
|
var clusterEleLabel = getElementFunction(getQueryConnect + '' + clusterId + '_datalabel_' + clusterIndex);
|
|
1162
1169
|
clusterEle.setAttribute('visibility', 'hidden');
|
|
1163
1170
|
clusterEleLabel.setAttribute('visibility', 'hidden');
|
|
1164
|
-
var
|
|
1165
|
-
var markerEle = getElementFunction(getQueryConnect + '' + markerId + '_dataIndex_' + dataIndex);
|
|
1171
|
+
var markerEle = marker.shape === 'Balloon' ? getElementFunction(getQueryConnect + '' + markerId + '_dataIndex_' + dataIndex + '_Group') : getElementFunction(getQueryConnect + '' + markerId + '_dataIndex_' + dataIndex);
|
|
1166
1172
|
var height = markerEle.parentElement.id.indexOf('Template_Group') > -1 ? markerEle.getBoundingClientRect().height : marker.height;
|
|
1167
1173
|
var width = markerEle.parentElement.id.indexOf('Template_Group') > -1 ? markerEle.getBoundingClientRect().width : marker.width;
|
|
1168
1174
|
var centerX = +clusterEle.getAttribute('transform').split('translate(')[1].trim().split(' ')[0];
|
|
@@ -1198,7 +1204,7 @@ export function clusterSeparate(sameMarkerData, maps, markerElement, isDom) {
|
|
|
1198
1204
|
var x1 = centerX + radius * Math.sin((Math.PI * 2 * newAngle) / 360);
|
|
1199
1205
|
var y1 = centerY + radius * Math.cos((Math.PI * 2 * newAngle) / 360);
|
|
1200
1206
|
path += start + 'L ' + (x1) + ' ' + y1 + ' ';
|
|
1201
|
-
markerEle = getElementFunction(getQueryConnect + '' + markerId + '_dataIndex_' + sameMarkerData[0].data[i]['index']);
|
|
1207
|
+
markerEle = marker.shape === 'Balloon' ? getElementFunction(getQueryConnect + '' + markerId + '_dataIndex_' + sameMarkerData[0].data[i]['index'] + '_Group') : getElementFunction(getQueryConnect + '' + markerId + '_dataIndex_' + sameMarkerData[0].data[i]['index']);
|
|
1202
1208
|
if (markerEle.parentElement.id.indexOf('Template_Group') > -1) {
|
|
1203
1209
|
markerEle['style']['transform'] = '';
|
|
1204
1210
|
markerEle['style']['left'] = maps.isTileMap ? x1 - (width / 2) + 'px' : (x1 - (width / 2) - 10) + 'px';
|
|
@@ -1219,7 +1225,12 @@ export function clusterSeparate(sameMarkerData, maps, markerElement, isDom) {
|
|
|
1219
1225
|
markerElement = isDom ? getElementFunction(maps.element.id + '_Markers_Group') : markerElement;
|
|
1220
1226
|
var groupEle = maps.renderer.createGroup({ id: maps.element.id + '_LayerIndex_' + layerIndex + '_MarkerIndex_' + markerIndex + '_markerClusterConnectorLine' });
|
|
1221
1227
|
groupEle.appendChild(maps.renderer.drawPath(options));
|
|
1222
|
-
|
|
1228
|
+
if (marker.shape === 'Balloon') {
|
|
1229
|
+
markerElement.insertBefore(groupEle, markerElement.querySelector('#' + markerId + '_dataIndex_0_Group'));
|
|
1230
|
+
}
|
|
1231
|
+
else {
|
|
1232
|
+
markerElement.insertBefore(groupEle, markerElement.querySelector('#' + markerId + '_dataIndex_0'));
|
|
1233
|
+
}
|
|
1223
1234
|
}
|
|
1224
1235
|
/**
|
|
1225
1236
|
*
|
|
@@ -1246,6 +1257,7 @@ export function marker(eventArgs, markerSettings, markerData, dataIndex, locatio
|
|
|
1246
1257
|
dashArray: markerSettings.dashArray, borderOpacity: isNullOrUndefined(eventArgs.border.opacity) ? markerSettings.opacity :
|
|
1247
1258
|
eventArgs.border.opacity
|
|
1248
1259
|
};
|
|
1260
|
+
removeElement(markerID);
|
|
1249
1261
|
var ele = drawSymbols(eventArgs.shape, eventArgs.imageUrl, { x: 0, y: 0 }, markerID, shapeCustom, markerCollection, maps);
|
|
1250
1262
|
var x = (maps.isTileMap ? location.x : (location.x + transPoint.x) * scale) + offset.x;
|
|
1251
1263
|
var y = (maps.isTileMap ? location.y : (location.y + transPoint.y) * scale) + offset.y;
|
|
@@ -1276,7 +1288,7 @@ export function marker(eventArgs, markerSettings, markerData, dataIndex, locatio
|
|
|
1276
1288
|
*/
|
|
1277
1289
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1278
1290
|
export function markerTemplate(eventArgs, templateFn, markerID, data, markerIndex, markerTemplate, location, transPoint, scale, offset, maps) {
|
|
1279
|
-
templateFn = getTemplateFunction(eventArgs.template);
|
|
1291
|
+
templateFn = getTemplateFunction(eventArgs.template, maps);
|
|
1280
1292
|
if (templateFn && (templateFn(data, maps, eventArgs.template, maps.element.id + '_MarkerTemplate' + markerIndex, false).length)) {
|
|
1281
1293
|
var templateElement = templateFn(data, maps, eventArgs.template, maps.element.id + '_MarkerTemplate' + markerIndex, false);
|
|
1282
1294
|
var markerElement = convertElement(templateElement, markerID, data, markerIndex, maps);
|
|
@@ -1312,8 +1324,10 @@ export function maintainSelection(elementId, elementClass, element, className) {
|
|
|
1312
1324
|
if (elementId) {
|
|
1313
1325
|
for (var index = 0; index < elementId.length; index++) {
|
|
1314
1326
|
if (element.getAttribute('id') === elementId[index]) {
|
|
1315
|
-
if (
|
|
1316
|
-
|
|
1327
|
+
if (index === 0 || element.tagName === 'g') {
|
|
1328
|
+
if (!isNullOrUndefined(elementClass) && !isNullOrUndefined(elementClass.id)) {
|
|
1329
|
+
document.body.appendChild(elementClass);
|
|
1330
|
+
}
|
|
1317
1331
|
if (element.id.indexOf('_MarkerIndex_') > -1 && element.childElementCount > 0) {
|
|
1318
1332
|
element.children[0].setAttribute('class', className);
|
|
1319
1333
|
}
|
|
@@ -1621,7 +1635,7 @@ export function drawBalloon(maps, options, size, location, type, element) {
|
|
|
1621
1635
|
var y = size.height / 30;
|
|
1622
1636
|
balloon.setAttribute('transform', 'translate(' + location.x + ', ' + location.y + ') scale(' + x + ', ' + y + ')');
|
|
1623
1637
|
if (type === 'Marker') {
|
|
1624
|
-
var g = maps.renderer.createGroup({ id: options.id });
|
|
1638
|
+
var g = maps.renderer.createGroup({ id: options.id + '_Group' });
|
|
1625
1639
|
appendShape(balloon, g);
|
|
1626
1640
|
pathElement = appendShape(g, element);
|
|
1627
1641
|
}
|
|
@@ -2040,7 +2054,12 @@ export function getTranslate(mapObject, layer, animate) {
|
|
|
2040
2054
|
}
|
|
2041
2055
|
else {
|
|
2042
2056
|
if (isNullOrUndefined(mapObject.previousProjection) || mapObject.previousProjection !== mapObject.projectionType) {
|
|
2057
|
+
if (mapHeight === 0 || mapWidth === 0 || mapHeight === mapWidth) {
|
|
2058
|
+
mapWidth = size.width / 2;
|
|
2059
|
+
mapHeight = size.height;
|
|
2060
|
+
}
|
|
2043
2061
|
scaleFactor = parseFloat(Math.min(size.width / mapWidth, size.height / mapHeight).toFixed(2));
|
|
2062
|
+
scaleFactor = scaleFactor > 1.05 ? 1 : scaleFactor;
|
|
2044
2063
|
mapWidth *= scaleFactor;
|
|
2045
2064
|
mapHeight *= scaleFactor;
|
|
2046
2065
|
var widthDiff = min['x'] !== 0 && mapObject.translateType === 'layers' ? availSize.width - size.width : 0;
|
|
@@ -2089,8 +2108,9 @@ export function getTranslate(mapObject, layer, animate) {
|
|
|
2089
2108
|
mapObject.zoomTranslatePoint.y = y;
|
|
2090
2109
|
}
|
|
2091
2110
|
else {
|
|
2092
|
-
if (!isNullOrUndefined(mapObject.previousProjection) && mapObject.mapScaleValue === 1 && !mapObject.zoomModule.isDragZoom) {
|
|
2111
|
+
if (!isNullOrUndefined(mapObject.previousProjection) && (mapObject.mapScaleValue === 1 || mapObject.mapScaleValue <= 1.05) && !mapObject.zoomModule.isDragZoom) {
|
|
2093
2112
|
scaleFactor = parseFloat(Math.min(size.width / mapWidth, size.height / mapHeight).toFixed(2));
|
|
2113
|
+
scaleFactor = scaleFactor > 1.05 ? 1 : scaleFactor;
|
|
2094
2114
|
mapWidth *= scaleFactor;
|
|
2095
2115
|
x = size.x + ((-(min['x'])) + ((size.width / 2) - (mapWidth / 2)));
|
|
2096
2116
|
mapHeight *= scaleFactor;
|
|
@@ -2247,6 +2267,8 @@ export function getZoomTranslate(mapObject, layer, animate) {
|
|
|
2247
2267
|
}
|
|
2248
2268
|
}
|
|
2249
2269
|
scaleFactor = (mapObject.enablePersistence) ? (mapObject.mapScaleValue === 0 ? 1 : mapObject.mapScaleValue) : scaleFactor;
|
|
2270
|
+
mapObject.widthBeforeRefresh = mapObject.availableSize.width;
|
|
2271
|
+
mapObject.heightBeforeRefresh = mapObject.availableSize.height;
|
|
2250
2272
|
return { scale: animate ? 1 : scaleFactor, location: new Point(x, y) };
|
|
2251
2273
|
}
|
|
2252
2274
|
/**
|
|
@@ -2274,6 +2296,22 @@ export function fixInitialScaleForTile(map) {
|
|
|
2274
2296
|
export function getElementByID(id) {
|
|
2275
2297
|
return document.getElementById(id);
|
|
2276
2298
|
}
|
|
2299
|
+
/**
|
|
2300
|
+
* Function to get clientElement from id.
|
|
2301
|
+
*
|
|
2302
|
+
* @param {string} id - Specifies the id
|
|
2303
|
+
* @returns {Element} - Returns the element
|
|
2304
|
+
* @private
|
|
2305
|
+
*/
|
|
2306
|
+
export function getClientElement(id) {
|
|
2307
|
+
var element = document.getElementById(id);
|
|
2308
|
+
if (!isNullOrUndefined(element)) {
|
|
2309
|
+
return element.getClientRects()[0];
|
|
2310
|
+
}
|
|
2311
|
+
else {
|
|
2312
|
+
return null;
|
|
2313
|
+
}
|
|
2314
|
+
}
|
|
2277
2315
|
/**
|
|
2278
2316
|
* To apply internalization
|
|
2279
2317
|
*
|
|
@@ -2294,7 +2332,7 @@ export function Internalize(maps, value) {
|
|
|
2294
2332
|
* @private
|
|
2295
2333
|
*/
|
|
2296
2334
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2297
|
-
export function getTemplateFunction(template) {
|
|
2335
|
+
export function getTemplateFunction(template, maps) {
|
|
2298
2336
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2299
2337
|
var templateFn = null;
|
|
2300
2338
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -2303,6 +2341,9 @@ export function getTemplateFunction(template) {
|
|
|
2303
2341
|
if (document.querySelectorAll(template).length) {
|
|
2304
2342
|
templateFn = templateComplier(document.querySelector(template).innerHTML.trim());
|
|
2305
2343
|
}
|
|
2344
|
+
else if (maps.isVue || maps.isVue3) {
|
|
2345
|
+
templateFn = templateComplier(template);
|
|
2346
|
+
}
|
|
2306
2347
|
}
|
|
2307
2348
|
catch (e) {
|
|
2308
2349
|
templateFn = templateComplier(template);
|
|
@@ -2707,6 +2748,7 @@ export function createTooltip(id, text, top, left, fontSize) {
|
|
|
2707
2748
|
'left:' + left.toString() + 'px;' +
|
|
2708
2749
|
'color: #000000; ' +
|
|
2709
2750
|
'background:' + '#FFFFFF' + ';' +
|
|
2751
|
+
'z-index: 2;' +
|
|
2710
2752
|
'position:absolute;border:1px solid #707070;font-size:' + fontSize + ';border-radius:2px;';
|
|
2711
2753
|
if (!tooltip) {
|
|
2712
2754
|
tooltip = createElement('div', {
|
|
@@ -2896,6 +2938,7 @@ export function changeBorderWidth(element, index, scale, maps) {
|
|
|
2896
2938
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2897
2939
|
var borderWidthValue = maps.layersCollection[index].shapeSettings.borderWidthValuePath;
|
|
2898
2940
|
var borderWidth = maps.layersCollection[index].shapeSettings.border.width;
|
|
2941
|
+
var circleRadius = maps.layersCollection[index].shapeSettings.circleRadius;
|
|
2899
2942
|
if (maps.layersCollection[index].shapeSettings.borderWidthValuePath) {
|
|
2900
2943
|
value = checkShapeDataFields(
|
|
2901
2944
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -2908,13 +2951,16 @@ export function changeBorderWidth(element, index, scale, maps) {
|
|
|
2908
2951
|
currentStroke = (isNullOrUndefined(borderWidth) ? 0 : borderWidth);
|
|
2909
2952
|
}
|
|
2910
2953
|
}
|
|
2954
|
+
else {
|
|
2955
|
+
currentStroke = (isNullOrUndefined(borderWidth) ? 0 : borderWidth);
|
|
2956
|
+
}
|
|
2911
2957
|
}
|
|
2912
2958
|
else {
|
|
2913
2959
|
currentStroke = (isNullOrUndefined(borderWidth) ? 0 : borderWidth);
|
|
2914
2960
|
}
|
|
2915
2961
|
childNode.setAttribute('stroke-width', (currentStroke / scale).toString());
|
|
2916
|
-
if (element.id.indexOf('
|
|
2917
|
-
childNode.setAttribute('
|
|
2962
|
+
if (element.id.indexOf('_Point') > -1 || element.id.indexOf('_MultiPoint') > -1) {
|
|
2963
|
+
childNode.setAttribute('r', (circleRadius / scale).toString());
|
|
2918
2964
|
}
|
|
2919
2965
|
}
|
|
2920
2966
|
}
|
|
@@ -3108,7 +3154,10 @@ export function animate(element, delay, duration, process, end) {
|
|
|
3108
3154
|
else {
|
|
3109
3155
|
window.cancelAnimationFrame(clearAnimation);
|
|
3110
3156
|
end.call(_this, { element: element });
|
|
3111
|
-
element.
|
|
3157
|
+
if (element.id.indexOf('Marker') > -1) {
|
|
3158
|
+
var markerElement = getElementByID(element.id.split('_Layer')[0] + '_Markers_Group');
|
|
3159
|
+
markerElement.setAttribute('style', markerStyle);
|
|
3160
|
+
}
|
|
3112
3161
|
}
|
|
3113
3162
|
};
|
|
3114
3163
|
clearAnimation = window.requestAnimationFrame(startAnimation);
|