@syncfusion/ej2-maps 23.2.4 → 24.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 +20 -1
- 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 +1059 -765
- package/dist/es6/ej2-maps.es2015.js.map +1 -1
- package/dist/es6/ej2-maps.es5.js +1084 -775
- 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 +13 -13
- package/src/global.js +1 -1
- package/src/maps/index.d.ts +1 -0
- package/src/maps/index.js +1 -0
- package/src/maps/layers/layer-panel.js +14 -3
- package/src/maps/layers/legend.js +1 -1
- package/src/maps/layers/marker.js +21 -19
- package/src/maps/layers/navigation-selected-line.js +16 -16
- package/src/maps/layers/polygon.d.ts +31 -0
- package/src/maps/layers/polygon.js +58 -0
- package/src/maps/maps-model.d.ts +1 -1
- package/src/maps/maps.d.ts +25 -1
- package/src/maps/maps.js +81 -17
- package/src/maps/model/base-model.d.ts +103 -25
- package/src/maps/model/base.d.ts +72 -7
- package/src/maps/model/base.js +53 -0
- package/src/maps/model/interface.d.ts +24 -3
- package/src/maps/user-interaction/highlight.js +6 -0
- package/src/maps/user-interaction/selection.js +13 -0
- package/src/maps/user-interaction/tooltip.js +13 -21
- package/src/maps/user-interaction/zoom.js +78 -16
- package/src/maps/utils/helper.d.ts +18 -0
- package/src/maps/utils/helper.js +54 -4
package/src/maps/utils/helper.js
CHANGED
|
@@ -215,6 +215,25 @@ export function convertGeoToPoint(latitude, longitude, factor, layer, mapModel)
|
|
|
215
215
|
}
|
|
216
216
|
return new Point(x, y);
|
|
217
217
|
}
|
|
218
|
+
/**
|
|
219
|
+
* @private
|
|
220
|
+
*/
|
|
221
|
+
export function calculatePolygonPath(maps, factor, currentLayer, markerData) {
|
|
222
|
+
var path = '';
|
|
223
|
+
Array.prototype.forEach.call(markerData, function (data, dataIndex) {
|
|
224
|
+
var lat = data.latitude;
|
|
225
|
+
var lng = data.longitude;
|
|
226
|
+
var location = (maps.isTileMap) ? convertTileLatLongToPoint(new MapLocation(lng, lat), factor, maps.tileTranslatePoint, true) : convertGeoToPoint(lat, lng, factor, currentLayer, maps);
|
|
227
|
+
if (dataIndex === 0) {
|
|
228
|
+
path += 'M ' + location.x + ' ' + location.y;
|
|
229
|
+
}
|
|
230
|
+
else {
|
|
231
|
+
path += ' L ' + location.x + ' ' + location.y;
|
|
232
|
+
}
|
|
233
|
+
});
|
|
234
|
+
path += ' z ';
|
|
235
|
+
return path;
|
|
236
|
+
}
|
|
218
237
|
/**
|
|
219
238
|
* Converting tile latitude and longitude to point
|
|
220
239
|
*
|
|
@@ -358,6 +377,17 @@ var Point = /** @class */ (function () {
|
|
|
358
377
|
return Point;
|
|
359
378
|
}());
|
|
360
379
|
export { Point };
|
|
380
|
+
/**
|
|
381
|
+
* Defines the latitude and longitude values that define a map location.
|
|
382
|
+
*/
|
|
383
|
+
var Coordinate = /** @class */ (function () {
|
|
384
|
+
function Coordinate(latitude, longitude) {
|
|
385
|
+
this.latitude = latitude;
|
|
386
|
+
this.longitude = longitude;
|
|
387
|
+
}
|
|
388
|
+
return Coordinate;
|
|
389
|
+
}());
|
|
390
|
+
export { Coordinate };
|
|
361
391
|
/**
|
|
362
392
|
* Map internal class for min and max
|
|
363
393
|
*
|
|
@@ -1130,12 +1160,24 @@ export function clusterTemplate(currentLayer, markerTemplate, maps, layerIndex,
|
|
|
1130
1160
|
getElementByID(maps.element.id + '_Secondary_Element').appendChild(markerCollection);
|
|
1131
1161
|
}
|
|
1132
1162
|
var element = document.getElementById(maps.element.id + '_LayerIndex_' + layerIndex + '_Polygon_Group');
|
|
1133
|
-
|
|
1163
|
+
var polygonElement = document.getElementById(maps.element.id + '_LayerIndex_' + layerIndex + '_Polygons_Group');
|
|
1164
|
+
if (isNullOrUndefined(element) && !maps.isTileMap) {
|
|
1134
1165
|
layerElement.insertBefore(markerCollection, layerElement.firstChild);
|
|
1135
1166
|
}
|
|
1136
|
-
else {
|
|
1167
|
+
else if (!maps.isTileMap) {
|
|
1137
1168
|
layerElement.appendChild(markerCollection);
|
|
1138
1169
|
}
|
|
1170
|
+
else {
|
|
1171
|
+
if (!isNullOrUndefined(polygonElement)) {
|
|
1172
|
+
polygonElement.insertAdjacentElement('afterend', markerCollection);
|
|
1173
|
+
}
|
|
1174
|
+
else if (!isNullOrUndefined(element)) {
|
|
1175
|
+
element.insertAdjacentElement('afterend', markerCollection);
|
|
1176
|
+
}
|
|
1177
|
+
else {
|
|
1178
|
+
layerElement.insertBefore(markerCollection, layerElement.firstChild);
|
|
1179
|
+
}
|
|
1180
|
+
}
|
|
1139
1181
|
var markerCluster = document.getElementById(maps.element.id + '_LayerIndex_' + layerIndex + '_markerCluster');
|
|
1140
1182
|
if (!isNullOrUndefined(markerCluster)) {
|
|
1141
1183
|
markerCluster.remove();
|
|
@@ -1667,7 +1709,7 @@ export function drawBalloon(maps, options, size, location, type, element) {
|
|
|
1667
1709
|
var height = size.height;
|
|
1668
1710
|
var pathElement;
|
|
1669
1711
|
location.x -= width / 2;
|
|
1670
|
-
location.y -= height / 2;
|
|
1712
|
+
location.y -= ((options.id.indexOf('cluster') > -1) ? (height / 2) : options.id.indexOf('Legend') > -1 ? height / 1.25 : height);
|
|
1671
1713
|
options.d = 'M15,0C8.8,0,3.8,5,3.8,11.2C3.8,17.5,9.4,24.4,15,30c5.6-5.6,11.2-12.5,11.2-18.8C26.2,5,21.2,0,15,0z M15,16' +
|
|
1672
1714
|
'c-2.8,0-5-2.2-5-5s2.2-5,5-5s5,2.2,5,5S17.8,16,15,16z';
|
|
1673
1715
|
var balloon = maps.renderer.drawPath(options);
|
|
@@ -2076,7 +2118,8 @@ export function getTranslate(mapObject, layer, animate) {
|
|
|
2076
2118
|
var topPosition = (((mapHeight + Math.abs(mapObject.mapAreaRect.height - mapHeight)) / 2) + mapObject.mapAreaRect.y) / factor;
|
|
2077
2119
|
var point = checkMethodeZoom ? calculateCenterFromPixel(mapObject, layer) :
|
|
2078
2120
|
convertGeoToPoint(centerLatitude, centerLongitude, mapObject.mapLayerPanel.calculateFactor(layer), layer, mapObject);
|
|
2079
|
-
if (isNullOrUndefined(mapObject.previousProjection) || mapObject.previousProjection !== mapObject.projectionType
|
|
2121
|
+
if (isNullOrUndefined(mapObject.previousProjection) || mapObject.previousProjection !== mapObject.projectionType
|
|
2122
|
+
|| mapObject.isMarkerZoomCompleted) {
|
|
2080
2123
|
x = -point.x + leftPosition;
|
|
2081
2124
|
y = -point.y + topPosition;
|
|
2082
2125
|
scaleFactor = zoomFactor;
|
|
@@ -3045,6 +3088,13 @@ export function changeBorderWidth(element, index, scale, maps) {
|
|
|
3045
3088
|
if (childNode.id.indexOf('_NavigationGroup') > -1) {
|
|
3046
3089
|
changeNavaigationLineWidth(childNode, index, scale, maps);
|
|
3047
3090
|
}
|
|
3091
|
+
else if (childNode.id.indexOf('_Polygons_Group') > -1) {
|
|
3092
|
+
for (var i = 0; i < childNode.childElementCount; i++) {
|
|
3093
|
+
// eslint-disable-next-line
|
|
3094
|
+
var width = maps.layersCollection[index].polygonSettings.polygons[parseInt(childNode.children[i].id.split('_PolygonIndex_')[1])].borderWidth;
|
|
3095
|
+
childNode.children[i].setAttribute('stroke-width', (width / scale).toString());
|
|
3096
|
+
}
|
|
3097
|
+
}
|
|
3048
3098
|
else {
|
|
3049
3099
|
var currentStroke = void 0;
|
|
3050
3100
|
var value = 0;
|