@syncfusion/ej2-maps 25.1.40 → 25.1.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/dist/ej2-maps.min.js +2 -2
- package/dist/ej2-maps.umd.min.js +2 -2
- package/dist/ej2-maps.umd.min.js.map +1 -1
- package/dist/es6/ej2-maps.es2015.js +101 -106
- package/dist/es6/ej2-maps.es2015.js.map +1 -1
- package/dist/es6/ej2-maps.es5.js +101 -106
- 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 +5 -5
- package/src/maps/layers/data-label.js +1 -1
- package/src/maps/layers/layer-panel.d.ts +0 -1
- package/src/maps/layers/layer-panel.js +98 -103
- package/src/maps/utils/helper.js +2 -2
|
@@ -1878,8 +1878,8 @@ function findMidPointOfPolygon(points, type, geometryType) {
|
|
|
1878
1878
|
sum = 0.5 * sum;
|
|
1879
1879
|
// eslint-disable-next-line @typescript-eslint/tslint/config
|
|
1880
1880
|
const pointValue = points.some(point => point.x < 5 && point.y < 5) && geometryType === 'Normal' ? 6 : 4;
|
|
1881
|
-
xSum = (1 / (pointValue * sum)) * xSum;
|
|
1882
|
-
ySum = (1 / (pointValue * sum)) * ySum;
|
|
1881
|
+
xSum = sum !== 0 ? (1 / (pointValue * sum)) * xSum : 0;
|
|
1882
|
+
ySum = sum !== 0 ? (1 / (pointValue * sum)) * ySum : 0;
|
|
1883
1883
|
/* Code for finding nearest points in polygon related to midPoint*/
|
|
1884
1884
|
let rightMinPoint = { x: 0, y: 0 };
|
|
1885
1885
|
let rightMaxPoint = { x: 0, y: 0 };
|
|
@@ -6909,126 +6909,121 @@ class LayerPanel {
|
|
|
6909
6909
|
}
|
|
6910
6910
|
}
|
|
6911
6911
|
arrangeTiles(type, x, y) {
|
|
6912
|
+
const element = document.getElementById(this.mapObject.element.id + '_tile_parent');
|
|
6913
|
+
const element1 = document.getElementById(this.mapObject.element.id + '_tiles');
|
|
6912
6914
|
let timeOut;
|
|
6913
6915
|
if (!isNullOrUndefined(type) && type !== 'Pan') {
|
|
6914
6916
|
this.tileAnimation(type, x, y);
|
|
6915
6917
|
timeOut = animationMode === 'Disable' ? 0 : (this.mapObject.layersCollection[0].animationDuration === 0 &&
|
|
6916
6918
|
animationMode === 'Enable') ? 1000 : this.mapObject.layersCollection[0].animationDuration;
|
|
6917
6919
|
}
|
|
6918
|
-
if (this.mapObject.layers[this.mapObject.baseLayerIndex].layerType === 'GoogleStaticMap') {
|
|
6919
|
-
this.renderGoogleMap(this.mapObject.layers[0].key, this.mapObject.staticMapZoom);
|
|
6920
|
-
}
|
|
6921
6920
|
else {
|
|
6922
|
-
|
|
6923
|
-
this.arrangeTilesLayer(type);
|
|
6924
|
-
}
|
|
6925
|
-
else {
|
|
6926
|
-
setTimeout(() => {
|
|
6927
|
-
this.arrangeTilesLayer(type);
|
|
6928
|
-
}, timeOut);
|
|
6929
|
-
}
|
|
6930
|
-
}
|
|
6931
|
-
}
|
|
6932
|
-
arrangeTilesLayer(type) {
|
|
6933
|
-
const element = document.getElementById(this.mapObject.element.id + '_tile_parent');
|
|
6934
|
-
const element1 = document.getElementById(this.mapObject.element.id + '_tiles');
|
|
6935
|
-
if (element) {
|
|
6936
|
-
element.style.zIndex = '1';
|
|
6937
|
-
}
|
|
6938
|
-
if (element1) {
|
|
6939
|
-
element1.style.zIndex = '0';
|
|
6921
|
+
timeOut = 0;
|
|
6940
6922
|
}
|
|
6941
|
-
|
|
6942
|
-
|
|
6943
|
-
animateElement = createElement('div', { id: this.mapObject.element.id + '_animated_tiles' });
|
|
6944
|
-
element.appendChild(animateElement);
|
|
6923
|
+
if (this.mapObject.layers[this.mapObject.baseLayerIndex].layerType === 'GoogleStaticMap') {
|
|
6924
|
+
this.renderGoogleMap(this.mapObject.layers[0].key, this.mapObject.staticMapZoom);
|
|
6945
6925
|
}
|
|
6946
6926
|
else {
|
|
6947
|
-
|
|
6948
|
-
|
|
6949
|
-
|
|
6950
|
-
document.getElementById(this.mapObject.element.id + '_animated_tiles').id =
|
|
6951
|
-
this.mapObject.element.id + '_animated_tiles_old';
|
|
6927
|
+
setTimeout(() => {
|
|
6928
|
+
if (element) {
|
|
6929
|
+
element.style.zIndex = '1';
|
|
6952
6930
|
}
|
|
6953
|
-
|
|
6954
|
-
|
|
6955
|
-
}
|
|
6956
|
-
else {
|
|
6957
|
-
animateElement = element ? element.children[0] : null;
|
|
6958
|
-
}
|
|
6959
|
-
}
|
|
6960
|
-
for (let id = 0; id < this.tiles.length; id++) {
|
|
6961
|
-
const tile = this.tiles[id];
|
|
6962
|
-
let imgElement = null;
|
|
6963
|
-
const mapId = this.mapObject.element.id;
|
|
6964
|
-
if (type === 'Pan') {
|
|
6965
|
-
let child = document.getElementById(mapId + '_tile_' + id);
|
|
6966
|
-
let isNewTile = false;
|
|
6967
|
-
if (isNullOrUndefined(child)) {
|
|
6968
|
-
isNewTile = true;
|
|
6969
|
-
child = createElement('div', { id: mapId + '_tile_' + id });
|
|
6970
|
-
imgElement = createElement('img');
|
|
6931
|
+
if (element1) {
|
|
6932
|
+
element1.style.zIndex = '0';
|
|
6971
6933
|
}
|
|
6972
|
-
|
|
6973
|
-
|
|
6974
|
-
|
|
6975
|
-
|
|
6976
|
-
if (!isNewTile && imgElement && imgElement.src !== tile.src) {
|
|
6977
|
-
imgElement.src = tile.src;
|
|
6978
|
-
}
|
|
6979
|
-
child.style.position = 'absolute';
|
|
6980
|
-
child.style.left = tile.left + 'px';
|
|
6981
|
-
child.style.top = tile.top + 'px';
|
|
6982
|
-
child.style.height = tile.height + 'px';
|
|
6983
|
-
child.style.width = tile.width + 'px';
|
|
6984
|
-
if (isNewTile) {
|
|
6985
|
-
imgElement.setAttribute('height', '256px');
|
|
6986
|
-
imgElement.setAttribute('width', '256px');
|
|
6987
|
-
imgElement.setAttribute('src', tile.src);
|
|
6988
|
-
imgElement.setAttribute('alt', this.mapObject.getLocalizedLabel('ImageNotFound'));
|
|
6989
|
-
imgElement.style.setProperty('user-select', 'none');
|
|
6990
|
-
child.appendChild(imgElement);
|
|
6991
|
-
animateElement.appendChild(child);
|
|
6934
|
+
let animateElement;
|
|
6935
|
+
if (!document.getElementById(this.mapObject.element.id + '_animated_tiles') && element) {
|
|
6936
|
+
animateElement = createElement('div', { id: this.mapObject.element.id + '_animated_tiles' });
|
|
6937
|
+
element.appendChild(animateElement);
|
|
6992
6938
|
}
|
|
6993
|
-
|
|
6994
|
-
|
|
6995
|
-
|
|
6996
|
-
|
|
6997
|
-
|
|
6998
|
-
|
|
6999
|
-
|
|
7000
|
-
|
|
7001
|
-
|
|
7002
|
-
|
|
7003
|
-
|
|
7004
|
-
|
|
7005
|
-
child.style.height = tile.height + 'px';
|
|
7006
|
-
child.style.width = tile.width + 'px';
|
|
7007
|
-
child.appendChild(imgElement);
|
|
7008
|
-
if (animateElement) {
|
|
7009
|
-
animateElement.appendChild(child);
|
|
7010
|
-
}
|
|
7011
|
-
}
|
|
7012
|
-
if (id === (this.tiles.length - 1) && document.getElementById(this.mapObject.element.id + '_animated_tiles_old')) {
|
|
7013
|
-
removeElement(this.mapObject.element.id + '_animated_tiles_old');
|
|
7014
|
-
}
|
|
7015
|
-
}
|
|
7016
|
-
if (!isNullOrUndefined(this.mapObject.currentTiles)) {
|
|
7017
|
-
for (let l = this.tiles.length; l < animateElement.childElementCount; l++) {
|
|
7018
|
-
let isExistingElement = false;
|
|
7019
|
-
for (let a = 0; a < this.mapObject.currentTiles.childElementCount; a++) {
|
|
7020
|
-
if (!isExistingElement &&
|
|
7021
|
-
this.mapObject.currentTiles.children[a].id === animateElement.children[l].id) {
|
|
7022
|
-
isExistingElement = true;
|
|
6939
|
+
else {
|
|
6940
|
+
if (type !== 'Pan' && element1 && element) {
|
|
6941
|
+
element1.appendChild(element.children[0]);
|
|
6942
|
+
if (!this.mapObject.isAddLayer && !isNullOrUndefined(document.getElementById(this.mapObject.element.id + '_animated_tiles'))) {
|
|
6943
|
+
document.getElementById(this.mapObject.element.id + '_animated_tiles').id =
|
|
6944
|
+
this.mapObject.element.id + '_animated_tiles_old';
|
|
6945
|
+
}
|
|
6946
|
+
animateElement = createElement('div', { id: this.mapObject.element.id + '_animated_tiles' });
|
|
6947
|
+
element.appendChild(animateElement);
|
|
6948
|
+
}
|
|
6949
|
+
else {
|
|
6950
|
+
animateElement = element ? element.children[0] : null;
|
|
7023
6951
|
}
|
|
7024
6952
|
}
|
|
7025
|
-
|
|
7026
|
-
|
|
6953
|
+
for (let id = 0; id < this.tiles.length; id++) {
|
|
6954
|
+
const tile = this.tiles[id];
|
|
6955
|
+
let imgElement = null;
|
|
6956
|
+
const mapId = this.mapObject.element.id;
|
|
6957
|
+
if (type === 'Pan') {
|
|
6958
|
+
let child = document.getElementById(mapId + '_tile_' + id);
|
|
6959
|
+
let isNewTile = false;
|
|
6960
|
+
if (isNullOrUndefined(child)) {
|
|
6961
|
+
isNewTile = true;
|
|
6962
|
+
child = createElement('div', { id: mapId + '_tile_' + id });
|
|
6963
|
+
imgElement = createElement('img');
|
|
6964
|
+
}
|
|
6965
|
+
else {
|
|
6966
|
+
child.style.removeProperty('display');
|
|
6967
|
+
imgElement = child.children[0];
|
|
6968
|
+
}
|
|
6969
|
+
if (!isNewTile && imgElement && imgElement.src !== tile.src) {
|
|
6970
|
+
imgElement.src = tile.src;
|
|
6971
|
+
}
|
|
6972
|
+
child.style.position = 'absolute';
|
|
6973
|
+
child.style.left = tile.left + 'px';
|
|
6974
|
+
child.style.top = tile.top + 'px';
|
|
6975
|
+
child.style.height = tile.height + 'px';
|
|
6976
|
+
child.style.width = tile.width + 'px';
|
|
6977
|
+
if (isNewTile) {
|
|
6978
|
+
imgElement.setAttribute('height', '256px');
|
|
6979
|
+
imgElement.setAttribute('width', '256px');
|
|
6980
|
+
imgElement.setAttribute('src', tile.src);
|
|
6981
|
+
imgElement.setAttribute('alt', this.mapObject.getLocalizedLabel('ImageNotFound'));
|
|
6982
|
+
imgElement.style.setProperty('user-select', 'none');
|
|
6983
|
+
child.appendChild(imgElement);
|
|
6984
|
+
animateElement.appendChild(child);
|
|
6985
|
+
}
|
|
6986
|
+
}
|
|
6987
|
+
else {
|
|
6988
|
+
imgElement = createElement('img');
|
|
6989
|
+
imgElement.setAttribute('height', '256px');
|
|
6990
|
+
imgElement.setAttribute('width', '256px');
|
|
6991
|
+
imgElement.setAttribute('src', tile.src);
|
|
6992
|
+
imgElement.style.setProperty('user-select', 'none');
|
|
6993
|
+
imgElement.setAttribute('alt', this.mapObject.getLocalizedLabel('ImageNotFound'));
|
|
6994
|
+
const child = createElement('div', { id: mapId + '_tile_' + id });
|
|
6995
|
+
child.style.position = 'absolute';
|
|
6996
|
+
child.style.left = tile.left + 'px';
|
|
6997
|
+
child.style.top = tile.top + 'px';
|
|
6998
|
+
child.style.height = tile.height + 'px';
|
|
6999
|
+
child.style.width = tile.width + 'px';
|
|
7000
|
+
child.appendChild(imgElement);
|
|
7001
|
+
if (animateElement) {
|
|
7002
|
+
animateElement.appendChild(child);
|
|
7003
|
+
}
|
|
7004
|
+
}
|
|
7005
|
+
if (id === (this.tiles.length - 1) && document.getElementById(this.mapObject.element.id + '_animated_tiles_old')) {
|
|
7006
|
+
removeElement(this.mapObject.element.id + '_animated_tiles_old');
|
|
7007
|
+
}
|
|
7027
7008
|
}
|
|
7028
|
-
|
|
7029
|
-
|
|
7009
|
+
if (!isNullOrUndefined(this.mapObject.currentTiles)) {
|
|
7010
|
+
for (let l = this.tiles.length; l < animateElement.childElementCount; l++) {
|
|
7011
|
+
let isExistingElement = false;
|
|
7012
|
+
for (let a = 0; a < this.mapObject.currentTiles.childElementCount; a++) {
|
|
7013
|
+
if (!isExistingElement &&
|
|
7014
|
+
this.mapObject.currentTiles.children[a].id === animateElement.children[l].id) {
|
|
7015
|
+
isExistingElement = true;
|
|
7016
|
+
}
|
|
7017
|
+
}
|
|
7018
|
+
if (isExistingElement) {
|
|
7019
|
+
animateElement.children[l].style.display = 'none';
|
|
7020
|
+
}
|
|
7021
|
+
else {
|
|
7022
|
+
animateElement.removeChild(animateElement.children[l]);
|
|
7023
|
+
}
|
|
7024
|
+
}
|
|
7030
7025
|
}
|
|
7031
|
-
}
|
|
7026
|
+
}, timeOut);
|
|
7032
7027
|
}
|
|
7033
7028
|
}
|
|
7034
7029
|
/**
|
|
@@ -11114,7 +11109,7 @@ class DataLabel {
|
|
|
11114
11109
|
location['y'] = ((location['y'] + zoomTransPoint['y']) * scale);
|
|
11115
11110
|
}
|
|
11116
11111
|
location['y'] = (this.maps.projectionType === 'Mercator') || layer.geometryType === 'Normal' ? location['y'] : (-location['y']);
|
|
11117
|
-
if (!isNullOrUndefined(this.maps.format) && !isNaN(parseFloat(text))) {
|
|
11112
|
+
if (!isNullOrUndefined(this.maps.format) && !isNaN(Number(text)) && !isNaN(parseFloat(text))) {
|
|
11118
11113
|
if (this.maps.useGroupingSeparator) {
|
|
11119
11114
|
text = Internalize(this.maps, parseFloat(text));
|
|
11120
11115
|
if (!isNullOrUndefined(datasrcObj)) {
|