@syncfusion/ej2-maps 20.4.49 → 20.4.54
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 +8 -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 +41 -14
- package/dist/es6/ej2-maps.es2015.js.map +1 -1
- package/dist/es6/ej2-maps.es5.js +41 -14
- 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 +8 -8
- package/src/maps/layers/data-label.js +8 -4
- package/src/maps/layers/marker.js +1 -1
- package/src/maps/maps.d.ts +6 -0
- package/src/maps/maps.js +29 -5
- package/src/maps/utils/helper.d.ts +1 -1
- package/src/maps/utils/helper.js +4 -5
package/dist/es6/ej2-maps.es5.js
CHANGED
|
@@ -3241,7 +3241,7 @@ function compareZoomFactor(scaleFactor, maps) {
|
|
|
3241
3241
|
* @param {Maps} maps - Specifies the instance of the maps
|
|
3242
3242
|
* @returns {number} - Returns the scale factor
|
|
3243
3243
|
*/
|
|
3244
|
-
function calculateZoomLevel(minLat, maxLat, minLong, maxLong, mapWidth, mapHeight, maps) {
|
|
3244
|
+
function calculateZoomLevel(minLat, maxLat, minLong, maxLong, mapWidth, mapHeight, maps, isZoomToCoordinates) {
|
|
3245
3245
|
var scaleFactor;
|
|
3246
3246
|
var maxZoomFact = maps.zoomSettings.maxZoom;
|
|
3247
3247
|
var applyMethodeZoom;
|
|
@@ -3254,9 +3254,7 @@ function calculateZoomLevel(minLat, maxLat, minLong, maxLong, mapWidth, mapHeigh
|
|
|
3254
3254
|
if (maps.zoomNotApplied && !maps.isTileMap) {
|
|
3255
3255
|
var latiRatio = Math.abs((maps.baseMapBounds.latitude.max - maps.baseMapBounds.latitude.min) / (maxLat - minLat));
|
|
3256
3256
|
var longiRatio = Math.abs((maps.baseMapBounds.longitude.max - maps.baseMapBounds.longitude.min) / (maxLong - minLong));
|
|
3257
|
-
applyMethodeZoom = Math.min(latiRatio, longiRatio);
|
|
3258
|
-
var minLocation = convertGeoToPoint(minLat, minLong, 1, maps.layersCollection[0], maps);
|
|
3259
|
-
var maxLocation = convertGeoToPoint(maxLat, maxLong, 1, maps.layersCollection[0], maps);
|
|
3257
|
+
applyMethodeZoom = isZoomToCoordinates ? (latiRatio + longiRatio) / 2 : Math.min(latiRatio, longiRatio);
|
|
3260
3258
|
}
|
|
3261
3259
|
var latRatio = (maxLatValue - minLatValue) / Math.PI;
|
|
3262
3260
|
var lngDiff = maxLong - minLong;
|
|
@@ -3265,7 +3263,8 @@ function calculateZoomLevel(minLat, maxLat, minLong, maxLong, mapWidth, mapHeigh
|
|
|
3265
3263
|
var WORLD_PX_WIDTH = 256;
|
|
3266
3264
|
var latZoom = (Math.log(mapHeight / WORLD_PX_HEIGHT / latRatio) / Math.LN2);
|
|
3267
3265
|
var lngZoom = (Math.log(mapWidth / WORLD_PX_WIDTH / lngRatio) / Math.LN2);
|
|
3268
|
-
var result = (maps.zoomNotApplied && !maps.isTileMap) ? applyMethodeZoom :
|
|
3266
|
+
var result = (maps.zoomNotApplied && !maps.isTileMap) ? applyMethodeZoom :
|
|
3267
|
+
isZoomToCoordinates && !maps.isTileMap ? (latZoom + lngZoom) / 2 : Math.min(latZoom, lngZoom);
|
|
3269
3268
|
scaleFactor = Math.min(result, maxZoomFact);
|
|
3270
3269
|
scaleFactor = maps.isTileMap || !maps.zoomNotApplied ? Math.floor(scaleFactor) : scaleFactor;
|
|
3271
3270
|
if (!maps.isTileMap) {
|
|
@@ -5091,7 +5090,7 @@ var Marker = /** @__PURE__ @class */ (function () {
|
|
|
5091
5090
|
}
|
|
5092
5091
|
var markerFactor = void 0;
|
|
5093
5092
|
if (this.maps.isTileMap || this.maps.baseMapRectBounds['min']['x'] === 0) {
|
|
5094
|
-
zoomLevel = calculateZoomLevel(minLat_1, maxLat_1, minLong_1, maxLong_1, mapWidth, mapHeight, this.maps);
|
|
5093
|
+
zoomLevel = calculateZoomLevel(minLat_1, maxLat_1, minLong_1, maxLong_1, mapWidth, mapHeight, this.maps, false);
|
|
5095
5094
|
if (this.maps.isTileMap) {
|
|
5096
5095
|
markerFactor = isNullOrUndefined(this.maps.markerZoomFactor) ?
|
|
5097
5096
|
zoomLevel : isNullOrUndefined(this.maps.mapScaleValue) ?
|
|
@@ -7770,7 +7769,6 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
|
|
|
7770
7769
|
}
|
|
7771
7770
|
if (!isNullOrUndefined(this.dataLabelModule)) {
|
|
7772
7771
|
this.dataLabelModule.dataLabelCollections = [];
|
|
7773
|
-
this.dataLabelShape = [];
|
|
7774
7772
|
}
|
|
7775
7773
|
this.mapLayerPanel.measureLayerPanel();
|
|
7776
7774
|
if (!isNullOrUndefined(this.svgObject)) {
|
|
@@ -8268,7 +8266,7 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
|
|
|
8268
8266
|
Maps.prototype.wireEVents = function () {
|
|
8269
8267
|
//let cancelEvent: string = Browser.isPointer ? 'pointerleave' : 'mouseleave';
|
|
8270
8268
|
EventHandler.add(this.element, 'click', this.mapsOnClick, this);
|
|
8271
|
-
|
|
8269
|
+
EventHandler.add(this.element, 'contextmenu', this.mapsOnRightClick, this);
|
|
8272
8270
|
EventHandler.add(this.element, 'dblclick', this.mapsOnDoubleClick, this);
|
|
8273
8271
|
EventHandler.add(this.element, Browser.touchStartEvent, this.mouseDownOnMap, this);
|
|
8274
8272
|
EventHandler.add(this.element, Browser.touchMoveEvent, this.mouseMoveOnMap, this);
|
|
@@ -8288,7 +8286,7 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
|
|
|
8288
8286
|
Maps.prototype.unWireEVents = function () {
|
|
8289
8287
|
//let cancelEvent: string = Browser.isPointer ? 'pointerleave' : 'mouseleave';
|
|
8290
8288
|
EventHandler.remove(this.element, 'click', this.mapsOnClick);
|
|
8291
|
-
|
|
8289
|
+
EventHandler.remove(this.element, 'contextmenu', this.mapsOnRightClick);
|
|
8292
8290
|
EventHandler.remove(this.element, 'dblclick', this.mapsOnDoubleClick);
|
|
8293
8291
|
EventHandler.remove(this.element, Browser.touchStartEvent, this.mouseDownOnMap);
|
|
8294
8292
|
EventHandler.remove(this.element, Browser.touchMoveEvent, this.mouseMoveOnMap);
|
|
@@ -8648,6 +8646,31 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
|
|
|
8648
8646
|
this.markerModule.sameMarkerData = [];
|
|
8649
8647
|
}
|
|
8650
8648
|
};
|
|
8649
|
+
/**
|
|
8650
|
+
* @param {PointerEvent} e - Specifies the pointer event.
|
|
8651
|
+
* @returns {void}
|
|
8652
|
+
* @private
|
|
8653
|
+
*/
|
|
8654
|
+
Maps.prototype.mapsOnRightClick = function (e) {
|
|
8655
|
+
var targetEle = e.target;
|
|
8656
|
+
var targetId = targetEle.id;
|
|
8657
|
+
var latitude = null;
|
|
8658
|
+
var longitude = null;
|
|
8659
|
+
this.mouseClickEvent = this.mouseDownEvent = { x: e.x, y: e.y };
|
|
8660
|
+
if (targetEle.id.indexOf('_ToolBar') === -1) {
|
|
8661
|
+
var latLongValue = this.getClickLocation(targetId, e.pageX, e.pageY, targetEle, e['layerX'], e['layerY']);
|
|
8662
|
+
if (!isNullOrUndefined(latLongValue)) {
|
|
8663
|
+
latitude = latLongValue.latitude;
|
|
8664
|
+
longitude = latLongValue.longitude;
|
|
8665
|
+
}
|
|
8666
|
+
var eventArgs = {
|
|
8667
|
+
cancel: false, name: rightClick, target: targetId, x: e.clientX, y: e.clientY,
|
|
8668
|
+
latitude: latitude, longitude: longitude,
|
|
8669
|
+
isShapeSelected: false
|
|
8670
|
+
};
|
|
8671
|
+
this.trigger('rightClick', eventArgs);
|
|
8672
|
+
}
|
|
8673
|
+
};
|
|
8651
8674
|
/**
|
|
8652
8675
|
* This method is used to perform operations when performing the double click operation on maps.
|
|
8653
8676
|
*
|
|
@@ -9077,7 +9100,7 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
|
|
|
9077
9100
|
this.maxLatOfGivenLocation = maxLatitude;
|
|
9078
9101
|
this.maxLongOfGivenLocation = maxLongitude;
|
|
9079
9102
|
this.zoomNotApplied = true;
|
|
9080
|
-
this.scaleOfGivenLocation = calculateZoomLevel(minLatitude, maxLatitude, minLongitude, maxLongitude, this.mapAreaRect.width, this.mapAreaRect.height, this);
|
|
9103
|
+
this.scaleOfGivenLocation = calculateZoomLevel(minLatitude, maxLatitude, minLongitude, maxLongitude, this.mapAreaRect.width, this.mapAreaRect.height, this, true);
|
|
9081
9104
|
var zoomArgs = {
|
|
9082
9105
|
cancel: false, name: 'zoom', type: zoomIn, maps: this,
|
|
9083
9106
|
tileTranslatePoint: {}, translatePoint: {},
|
|
@@ -10288,6 +10311,9 @@ var DataLabel = /** @__PURE__ @class */ (function () {
|
|
|
10288
10311
|
if (isNullOrUndefined(text) && (layer.dataLabelSettings.template !== '' && layer.dataSource['length'] === 0)) {
|
|
10289
10312
|
text = shapeData['properties'][layer.shapePropertyPath];
|
|
10290
10313
|
}
|
|
10314
|
+
if (isNullOrUndefined(text) && layer.dataSource['length'] > 0) {
|
|
10315
|
+
text = '';
|
|
10316
|
+
}
|
|
10291
10317
|
var dataLabelText = text;
|
|
10292
10318
|
var projectionType = this.maps.projectionType;
|
|
10293
10319
|
if (isPoint) {
|
|
@@ -10340,9 +10366,9 @@ var DataLabel = /** @__PURE__ @class */ (function () {
|
|
|
10340
10366
|
}
|
|
10341
10367
|
var position = [];
|
|
10342
10368
|
var width = zoomLabelsPosition && scaleZoomValue > 1 && !_this.maps.zoomNotApplied
|
|
10343
|
-
&& _this.maps.zoomShapeCollection.length > index ? _this.maps.
|
|
10369
|
+
&& _this.maps.zoomShapeCollection.length > index ? (_this.maps.dataLabelShape[index]) * scale :
|
|
10344
10370
|
(location['rightMax']['x'] - location['leftMax']['x']) * scale;
|
|
10345
|
-
if (!isNullOrUndefined(_this.maps.dataLabelShape)) {
|
|
10371
|
+
if (!isNullOrUndefined(_this.maps.dataLabelShape) && !_this.maps.isReset) {
|
|
10346
10372
|
shapeWidth = firstLevelMapLocation['rightMax']['x'] - firstLevelMapLocation['leftMax']['x'];
|
|
10347
10373
|
_this.maps.dataLabelShape.push(shapeWidth);
|
|
10348
10374
|
}
|
|
@@ -10368,8 +10394,9 @@ var DataLabel = /** @__PURE__ @class */ (function () {
|
|
|
10368
10394
|
locationX = location1['x'];
|
|
10369
10395
|
location['x'] = location1['x'];
|
|
10370
10396
|
width = zoomLabelsPosition && scaleZoomValue > 1 && !_this.maps.zoomNotApplied
|
|
10371
|
-
&& _this.maps.zoomShapeCollection.length > index ? _this.maps.
|
|
10372
|
-
(location1['rightMax']['x'] - location1['leftMax']['x']) * scale
|
|
10397
|
+
&& _this.maps.zoomShapeCollection.length > index ? (_this.maps.dataLabelShape[index]) * scale :
|
|
10398
|
+
((location1['rightMax']['x'] - location1['leftMax']['x']) * scale) > 0 ?
|
|
10399
|
+
((location1['rightMax']['x'] - location1['leftMax']['x']) * scale) : width;
|
|
10373
10400
|
}
|
|
10374
10401
|
var xpositionEnds = ((location['x'] + transPoint['x']) * scale) + textSize['width'] / 2;
|
|
10375
10402
|
var xpositionStart = ((location['x'] + transPoint['x']) * scale) - textSize['width'] / 2;
|