@syncfusion/ej2-maps 26.2.10 → 27.1.48
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/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 +276 -256
- package/dist/es6/ej2-maps.es2015.js.map +1 -1
- package/dist/es6/ej2-maps.es5.js +276 -256
- 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 +14 -13
- package/src/maps/layers/data-label.js +11 -7
- package/src/maps/layers/layer-panel.d.ts +0 -9
- package/src/maps/layers/layer-panel.js +16 -69
- package/src/maps/layers/legend.js +27 -11
- package/src/maps/layers/marker.js +2 -1
- package/src/maps/layers/navigation-selected-line.js +1 -1
- package/src/maps/maps-model.d.ts +1 -1
- package/src/maps/maps.d.ts +23 -5
- package/src/maps/maps.js +58 -64
- package/src/maps/model/export-pdf.js +2 -1
- package/src/maps/model/print.js +2 -1
- package/src/maps/model/theme.js +54 -53
- package/src/maps/user-interaction/annotation.js +6 -4
- package/src/maps/user-interaction/tooltip.js +16 -11
- package/src/maps/user-interaction/zoom.js +7 -3
- package/src/maps/utils/helper.d.ts +8 -0
- package/src/maps/utils/helper.js +75 -31
- package/hotfix/26.1.35_Vol2.txt +0 -1
package/dist/global/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: index.d.ts
|
|
3
|
-
* version :
|
|
3
|
+
* version : 27.1.48
|
|
4
4
|
* Copyright Syncfusion Inc. 2001 - 2023. All rights reserved.
|
|
5
5
|
* Use of this code is subject to the terms of our license.
|
|
6
6
|
* A copy of the current license can be obtained at any time by e-mailing
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_from": "@syncfusion/ej2-maps@*",
|
|
3
|
-
"_id": "@syncfusion/ej2-maps@
|
|
3
|
+
"_id": "@syncfusion/ej2-maps@16.42.7",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512-
|
|
5
|
+
"_integrity": "sha512-WErWjt8C7bpoS4cAk8lBArnJR8k3C5LghGb4SC8/VjzaYWfGrEHCy8MYSfsx/SN7riueG+tK/5PkPOiO07esYQ==",
|
|
6
6
|
"_location": "/@syncfusion/ej2-maps",
|
|
7
7
|
"_phantomChildren": {},
|
|
8
8
|
"_requested": {
|
|
@@ -23,10 +23,10 @@
|
|
|
23
23
|
"/@syncfusion/ej2-react-maps",
|
|
24
24
|
"/@syncfusion/ej2-vue-maps"
|
|
25
25
|
],
|
|
26
|
-
"_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-
|
|
27
|
-
"_shasum": "
|
|
26
|
+
"_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-release/@syncfusion/ej2-maps/-/ej2-maps-16.42.7.tgz",
|
|
27
|
+
"_shasum": "57821f53cfc78caf44acf6dfb24146bb57d3b9f8",
|
|
28
28
|
"_spec": "@syncfusion/ej2-maps@*",
|
|
29
|
-
"_where": "/jenkins/workspace/elease-
|
|
29
|
+
"_where": "/jenkins/workspace/elease-automation_release_27.1.1/packages/included",
|
|
30
30
|
"author": {
|
|
31
31
|
"name": "Syncfusion Inc."
|
|
32
32
|
},
|
|
@@ -35,13 +35,14 @@
|
|
|
35
35
|
},
|
|
36
36
|
"bundleDependencies": false,
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@syncfusion/ej2-base": "~
|
|
39
|
-
"@syncfusion/ej2-buttons": "~
|
|
40
|
-
"@syncfusion/ej2-compression": "~
|
|
41
|
-
"@syncfusion/ej2-data": "~
|
|
42
|
-
"@syncfusion/ej2-file-utils": "~
|
|
43
|
-
"@syncfusion/ej2-pdf-export": "~
|
|
44
|
-
"@syncfusion/ej2-svg-base": "~
|
|
38
|
+
"@syncfusion/ej2-base": "~27.1.48",
|
|
39
|
+
"@syncfusion/ej2-buttons": "~27.1.48",
|
|
40
|
+
"@syncfusion/ej2-compression": "~27.1.48",
|
|
41
|
+
"@syncfusion/ej2-data": "~27.1.48",
|
|
42
|
+
"@syncfusion/ej2-file-utils": "~27.1.48",
|
|
43
|
+
"@syncfusion/ej2-pdf-export": "~27.1.48",
|
|
44
|
+
"@syncfusion/ej2-svg-base": "~27.1.48",
|
|
45
|
+
"markdown-spellcheck": "^1.3.1"
|
|
45
46
|
},
|
|
46
47
|
"deprecated": false,
|
|
47
48
|
"description": "The Maps component is used to visualize the geographical data and represent the statistical data of a particular geographical area on earth with user interactivity, and provides various customizing options",
|
|
@@ -93,6 +94,6 @@
|
|
|
93
94
|
"url": "git+https://github.com/syncfusion/ej2-javascript-ui-controls.git"
|
|
94
95
|
},
|
|
95
96
|
"typings": "index.d.ts",
|
|
96
|
-
"version": "
|
|
97
|
+
"version": "27.1.48",
|
|
97
98
|
"sideEffects": false
|
|
98
99
|
}
|
|
@@ -260,22 +260,26 @@ var DataLabel = /** @class */ (function () {
|
|
|
260
260
|
labelTemplateElement.appendChild(labelElement);
|
|
261
261
|
}
|
|
262
262
|
else {
|
|
263
|
-
|
|
263
|
+
var smartLabelMode = !isNullOrUndefined(dataLabelSettings.smartLabelMode) ? dataLabelSettings.smartLabelMode.toString() : 'None';
|
|
264
|
+
if (smartLabelMode === 'Trim') {
|
|
264
265
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
265
266
|
var textType = typeof text === 'number' ? text.toString() : text;
|
|
266
267
|
trimmedLable = textTrim(width, textType, style, null, true);
|
|
267
268
|
elementSize = measureTextElement(trimmedLable, style);
|
|
268
269
|
options = new TextOption(labelId, textLocation.x, textLocation.y, 'middle', trimmedLable, '', '');
|
|
269
270
|
}
|
|
270
|
-
if (
|
|
271
|
+
if (smartLabelMode === 'None') {
|
|
271
272
|
options = new TextOption(labelId, (textLocation.x), textLocation.y, 'middle', text, '', '');
|
|
272
273
|
}
|
|
273
|
-
if (
|
|
274
|
+
if (smartLabelMode === 'Hide') {
|
|
274
275
|
text = (width >= textSize['width']) ? text : '';
|
|
275
276
|
options = new TextOption(labelId, (textLocation.x), (textLocation.y), 'middle', text, '', '');
|
|
276
277
|
}
|
|
277
|
-
|
|
278
|
-
|
|
278
|
+
if (!isNullOrUndefined(options)) {
|
|
279
|
+
text = options['text'];
|
|
280
|
+
}
|
|
281
|
+
var intersectionAction = !isNullOrUndefined(dataLabelSettings.intersectionAction) ? dataLabelSettings.intersectionAction.toString() : 'None';
|
|
282
|
+
if (intersectionAction === 'Hide') {
|
|
279
283
|
for (var i = 0; i < intersect.length; i++) {
|
|
280
284
|
if (!isNullOrUndefined(intersect[i])) {
|
|
281
285
|
if (!(_this.value[index]['leftWidth'] > intersect[i]['rightWidth']
|
|
@@ -291,7 +295,7 @@ var DataLabel = /** @class */ (function () {
|
|
|
291
295
|
options = new TextOption(labelId, textLocation.x, textLocation.y, 'middle', text, '', '');
|
|
292
296
|
}
|
|
293
297
|
var difference = void 0;
|
|
294
|
-
if (
|
|
298
|
+
if (intersectionAction === 'Trim') {
|
|
295
299
|
for (var j = 0; j < intersect.length; j++) {
|
|
296
300
|
if (!isNullOrUndefined(intersect[j])) {
|
|
297
301
|
if (intersect[j]['rightWidth'] < _this.value[index]['leftWidth']
|
|
@@ -321,7 +325,7 @@ var DataLabel = /** @class */ (function () {
|
|
|
321
325
|
intersect.push(_this.value[index]);
|
|
322
326
|
options = new TextOption(labelId, textLocation.x, (textLocation.y), 'middle', trimmedLable, '', '');
|
|
323
327
|
}
|
|
324
|
-
if (
|
|
328
|
+
if (intersectionAction === 'None') {
|
|
325
329
|
options = new TextOption(labelId, (textLocation.x), (textLocation.y), 'middle', text, '', '');
|
|
326
330
|
}
|
|
327
331
|
if (trimmedLable.length > 1) {
|
|
@@ -126,15 +126,6 @@ export declare class LayerPanel {
|
|
|
126
126
|
* @returns {void}
|
|
127
127
|
*/
|
|
128
128
|
private tileAnimation;
|
|
129
|
-
/**
|
|
130
|
-
* Static map rendering.
|
|
131
|
-
*
|
|
132
|
-
* @param {string} apikey - Specifies the api key
|
|
133
|
-
* @param {number} zoom - Specifies the zoom value
|
|
134
|
-
* @returns {void}
|
|
135
|
-
* @private
|
|
136
|
-
*/
|
|
137
|
-
renderGoogleMap(apikey: string, zoom: number): void;
|
|
138
129
|
/**
|
|
139
130
|
* To find the tile translate point.
|
|
140
131
|
*
|
|
@@ -281,7 +281,7 @@ var LayerPanel = /** @class */ (function () {
|
|
|
281
281
|
bing.imageUrl = layer.urlTemplate;
|
|
282
282
|
bing.subDomains = ['t0', 't1', 't2', 't3'];
|
|
283
283
|
bing.maxZoom = '21';
|
|
284
|
-
proxy.mapObject
|
|
284
|
+
proxy.mapObject.bingMap = bing;
|
|
285
285
|
proxy.renderTileLayer(proxy, layer, layerIndex, bing);
|
|
286
286
|
this.mapObject.arrangeTemplate();
|
|
287
287
|
if (this.mapObject.zoomModule && (this.mapObject.previousScale !== this.mapObject.scale)) {
|
|
@@ -297,17 +297,19 @@ var LayerPanel = /** @class */ (function () {
|
|
|
297
297
|
Number(getValueFromObject(bubbleSettings.dataSource[i], bubbleSettings.valuePath)) :
|
|
298
298
|
parseFloat(bubbleSettings.dataSource[i][bubbleSettings.valuePath])) :
|
|
299
299
|
parseFloat(bubbleSettings.dataSource[i][bubbleSettings.valuePath]);
|
|
300
|
-
if (
|
|
301
|
-
if (
|
|
302
|
-
range.max
|
|
300
|
+
if (!isNaN(bubbledata)) {
|
|
301
|
+
if (i !== 0) {
|
|
302
|
+
if (bubbledata > range.max) {
|
|
303
|
+
range.max = bubbledata;
|
|
304
|
+
}
|
|
305
|
+
else if (bubbledata < range.min) {
|
|
306
|
+
range.min = bubbledata;
|
|
307
|
+
}
|
|
303
308
|
}
|
|
304
|
-
else
|
|
305
|
-
range.min = bubbledata;
|
|
309
|
+
else {
|
|
310
|
+
range.max = range.min = bubbledata;
|
|
306
311
|
}
|
|
307
312
|
}
|
|
308
|
-
else {
|
|
309
|
-
range.max = range.min = bubbledata;
|
|
310
|
-
}
|
|
311
313
|
}
|
|
312
314
|
}
|
|
313
315
|
};
|
|
@@ -338,7 +340,8 @@ var LayerPanel = /** @class */ (function () {
|
|
|
338
340
|
if (isNullOrUndefined(this.mapObject.baseMapRectBounds) && this.currentLayer.isBaseLayer) {
|
|
339
341
|
this.mapObject.baseMapRectBounds = this.rectBounds;
|
|
340
342
|
}
|
|
341
|
-
var colors = shapeSettings.palette.length > 1 ?
|
|
343
|
+
var colors = (!isNullOrUndefined(shapeSettings.palette) && shapeSettings.palette.length > 1) ?
|
|
344
|
+
shapeSettings.palette : getShapeColor(this.mapObject.theme);
|
|
342
345
|
var labelTemplateEle = createElement('div', {
|
|
343
346
|
id: this.mapObject.element.id + '_LayerIndex_' + layerIndex + '_Label_Template_Group',
|
|
344
347
|
className: this.mapObject.element.id + '_template'
|
|
@@ -1122,7 +1125,7 @@ var LayerPanel = /** @class */ (function () {
|
|
|
1122
1125
|
var endX = Math.min(xcount, ((-tileTranslatePoint.x + size.width + (xRight * 256)) / 256) + 1);
|
|
1123
1126
|
var startX = (-((tileTranslatePoint.x + (xLeft * 256)) + 256) / 256);
|
|
1124
1127
|
var startY = (-(tileTranslatePoint.y + 256) / 256);
|
|
1125
|
-
bing = bing || this.bing || this.mapObject
|
|
1128
|
+
bing = bing || this.bing || this.mapObject.bingMap;
|
|
1126
1129
|
for (var i = Math.round(startX); i < Math.round(endX); i++) {
|
|
1127
1130
|
for (var j = Math.round(startY); j < Math.round(endY); j++) {
|
|
1128
1131
|
var x = 256 * i + tileTranslatePoint.x;
|
|
@@ -1136,10 +1139,11 @@ var LayerPanel = /** @class */ (function () {
|
|
|
1136
1139
|
var tile = new Tile(tileI % ycount, j);
|
|
1137
1140
|
tile.left = Math.round(x);
|
|
1138
1141
|
tile.top = Math.round(y);
|
|
1139
|
-
if ((bing && !isNullOrUndefined(baseLayer.urlTemplate) && baseLayer.urlTemplate !== '')) {
|
|
1142
|
+
if ((bing && !isNullOrUndefined(baseLayer.urlTemplate) && baseLayer.urlTemplate !== '' && baseLayer.urlTemplate.indexOf('quadkey') > -1)) {
|
|
1140
1143
|
tile.src = bing.getBingMap(tile, '', '', userLang, bing.imageUrl, bing.subDomains);
|
|
1141
1144
|
}
|
|
1142
1145
|
else {
|
|
1146
|
+
bing = null;
|
|
1143
1147
|
tile.src = this.urlTemplate.replace('level', zoomLevel.toString()).replace('tileX', tile.x.toString())
|
|
1144
1148
|
.replace('tileY', tile.y.toString());
|
|
1145
1149
|
}
|
|
@@ -1328,63 +1332,6 @@ var LayerPanel = /** @class */ (function () {
|
|
|
1328
1332
|
animatedTiles.style.transform = 'translate(' + translateX + 'px, ' + translateY + 'px) scale(' + scaleValue + ')';
|
|
1329
1333
|
}
|
|
1330
1334
|
};
|
|
1331
|
-
/**
|
|
1332
|
-
* Static map rendering.
|
|
1333
|
-
*
|
|
1334
|
-
* @param {string} apikey - Specifies the api key
|
|
1335
|
-
* @param {number} zoom - Specifies the zoom value
|
|
1336
|
-
* @returns {void}
|
|
1337
|
-
* @private
|
|
1338
|
-
*/
|
|
1339
|
-
LayerPanel.prototype.renderGoogleMap = function (apikey, zoom) {
|
|
1340
|
-
var map = this.mapObject;
|
|
1341
|
-
// zoom = this.mapObject.zoomSettings.shouldZoomInitially ? this.mapObject.markerZoomFactor : zoom;
|
|
1342
|
-
zoom = this.mapObject.tileZoomLevel;
|
|
1343
|
-
var totalSize = Math.pow(2, zoom) * 256;
|
|
1344
|
-
var x = (map.mapAreaRect.width / 2) - (totalSize / 2);
|
|
1345
|
-
var y = (map.mapAreaRect.height / 2) - (totalSize / 2);
|
|
1346
|
-
var centerPoint = new Point(null, null);
|
|
1347
|
-
var diffX = 0;
|
|
1348
|
-
var diffY = 0;
|
|
1349
|
-
var position = convertTileLatLongToPoint(centerPoint, zoom, { x: x, y: y }, this.isMapCoordinates);
|
|
1350
|
-
if (map.zoomModule && map.zoomSettings.enable) {
|
|
1351
|
-
diffX = map.zoomModule.mouseDownLatLong['x'] - map.zoomModule.mouseMoveLatLong['x'];
|
|
1352
|
-
diffY = map.zoomModule.mouseDownLatLong['y'] - map.zoomModule.mouseMoveLatLong['y'];
|
|
1353
|
-
}
|
|
1354
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1355
|
-
var panLatLng = map.pointToLatLong(position.x - diffX, position.y - diffY);
|
|
1356
|
-
map.centerPosition.latitude = panLatLng['latitude'];
|
|
1357
|
-
map.centerPosition.longitude = panLatLng['longitude'];
|
|
1358
|
-
var mapWidth;
|
|
1359
|
-
var mapHeight;
|
|
1360
|
-
if (isNullOrUndefined(parseInt(map.width, 10))) {
|
|
1361
|
-
mapWidth = parseInt(map.width, 10) - 22;
|
|
1362
|
-
}
|
|
1363
|
-
else {
|
|
1364
|
-
mapWidth = Math.round(map.mapAreaRect.width);
|
|
1365
|
-
}
|
|
1366
|
-
if (isNullOrUndefined(parseInt(map.height, 10))) {
|
|
1367
|
-
mapHeight = parseInt(map.height, 10) - 22;
|
|
1368
|
-
}
|
|
1369
|
-
else {
|
|
1370
|
-
mapHeight = Math.round(map.mapAreaRect.height);
|
|
1371
|
-
}
|
|
1372
|
-
var eleWidth = mapWidth > 640 ? (mapWidth - 640) / 2 : 0;
|
|
1373
|
-
var eleHeight = mapHeight > 640 ? (mapHeight - 640) / 2 : 0;
|
|
1374
|
-
var center;
|
|
1375
|
-
var mapType = 'roadmap';
|
|
1376
|
-
if (map.centerPosition.latitude && map.centerPosition.longitude) {
|
|
1377
|
-
center = map.centerPosition.latitude.toString() + ',' + map.centerPosition.longitude.toString();
|
|
1378
|
-
}
|
|
1379
|
-
else {
|
|
1380
|
-
center = '0,0';
|
|
1381
|
-
}
|
|
1382
|
-
var staticMapString = 'https://maps.googleapis.com/maps/api/staticmap?size=' + mapWidth + 'x' + mapHeight +
|
|
1383
|
-
'&zoom=' + zoom + '¢er=' + center + '&maptype=' + mapType + '&key=' + apikey;
|
|
1384
|
-
document.getElementById(this.mapObject.element.id + '_tile_parent').innerHTML
|
|
1385
|
-
= '<div id="' + this.mapObject.element.id + '_StaticGoogleMap"' + 'style="position:absolute; left:' + eleWidth + 'px; top:'
|
|
1386
|
-
+ eleHeight + 'px"><img src="' + staticMapString + '"' + 'alt="' + this.mapObject.getLocalizedLabel('ImageNotFound') + '"></div>';
|
|
1387
|
-
};
|
|
1388
1335
|
/**
|
|
1389
1336
|
* To find the tile translate point.
|
|
1390
1337
|
*
|
|
@@ -240,7 +240,7 @@ var Legend = /** @class */ (function () {
|
|
|
240
240
|
shapeBorder: this.legendCollection[i]['shapeBorder']
|
|
241
241
|
});
|
|
242
242
|
}
|
|
243
|
-
if (this.legendCollection.length === 1) {
|
|
243
|
+
if (this.legendCollection.length === 1 && !(map.theme === 'Fluent2HighContrast' && legend.position === 'Bottom')) {
|
|
244
244
|
legendHeight = rectHeight;
|
|
245
245
|
legendWidth = rectWidth;
|
|
246
246
|
}
|
|
@@ -439,7 +439,7 @@ var Legend = /** @class */ (function () {
|
|
|
439
439
|
var rectOptions = new RectOption(itemId, item['fill'], item['shapeBorder'], legend.opacity, bounds);
|
|
440
440
|
textOptions = new TextOption(textId, textLocation.x, textLocation.y, 'middle', item['text'], '', '');
|
|
441
441
|
textFont.fontFamily = !isNullOrUndefined(textFont.fontFamily) ? textFont.fontFamily : this.maps.themeStyle.fontFamily;
|
|
442
|
-
textFont.size = map.themeStyle.legendFontSize
|
|
442
|
+
textFont.size = textFont.size || map.themeStyle.legendFontSize;
|
|
443
443
|
var textElement = renderTextElement(textOptions, textFont, textFont.color, this.legendGroup);
|
|
444
444
|
textElement.setAttribute('aria-label', item['text']);
|
|
445
445
|
textElement.setAttribute('role', 'region');
|
|
@@ -499,7 +499,7 @@ var Legend = /** @class */ (function () {
|
|
|
499
499
|
this.maps.themeStyle.legendTextColor;
|
|
500
500
|
legendTextStyle.fontFamily = !isNullOrUndefined(legendTextStyle.fontFamily) ? legendTextStyle.fontFamily :
|
|
501
501
|
this.maps.themeStyle.fontFamily;
|
|
502
|
-
legendTextStyle.size = map.themeStyle.legendFontSize
|
|
502
|
+
legendTextStyle.size = legendTextStyle.size || map.themeStyle.legendFontSize;
|
|
503
503
|
legendTextStyle.fontWeight = legendTextStyle.fontWeight || map.themeStyle.fontWeight;
|
|
504
504
|
if (i === 0) {
|
|
505
505
|
this.renderLegendBorder();
|
|
@@ -1016,7 +1016,7 @@ var Legend = /** @class */ (function () {
|
|
|
1016
1016
|
}
|
|
1017
1017
|
else {
|
|
1018
1018
|
this.removeShapeHighlightCollection();
|
|
1019
|
-
this.setColor(legendShape, !isNullOrUndefined(module.fill) ? module.fill : legendShape.getAttribute('fill'), module.opacity.toString(), module.border.color, module.border.width.toString(), 'highlight');
|
|
1019
|
+
this.setColor(legendShape, !isNullOrUndefined(module.fill) ? module.fill : legendShape.getAttribute('fill'), !isNullOrUndefined(module.opacity) ? module.opacity.toString() : '1', module.border.color, module.border.width.toString(), 'highlight');
|
|
1020
1020
|
}
|
|
1021
1021
|
}
|
|
1022
1022
|
else if (getValue === 'selection') {
|
|
@@ -1081,7 +1081,7 @@ var Legend = /** @class */ (function () {
|
|
|
1081
1081
|
this.maps.legendSelectionClass = module;
|
|
1082
1082
|
this.removeLegend(this.shapeHighlightCollection);
|
|
1083
1083
|
if (!isNullOrUndefined(legendShape)) {
|
|
1084
|
-
this.setColor(legendShape, !isNullOrUndefined(module.fill) ? module.fill : legendShape.getAttribute('fill'), module.opacity.toString(), module.border.color, module.border.width.toString(), 'selection');
|
|
1084
|
+
this.setColor(legendShape, !isNullOrUndefined(module.fill) ? module.fill : legendShape.getAttribute('fill'), !isNullOrUndefined(module.opacity) ? module.opacity.toString() : '1', module.border.color, module.border.width.toString(), 'selection');
|
|
1085
1085
|
var legendSelectionIndex = this.getIndexofLegend(this.maps.legendSelectionCollection, legendShape);
|
|
1086
1086
|
this.maps.legendSelectionCollection[legendSelectionIndex]['MapShapeCollection']['Elements'].push(targetElement);
|
|
1087
1087
|
}
|
|
@@ -1154,10 +1154,10 @@ var Legend = /** @class */ (function () {
|
|
|
1154
1154
|
var collection = this.maps.legendModule.legendCollection;
|
|
1155
1155
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1156
1156
|
var currentCollection;
|
|
1157
|
-
if (legendType === 'Default' && !isNullOrUndefined(this.maps.legendModule.totalPages)) {
|
|
1157
|
+
if (legendType === 'Default' && !isNullOrUndefined(this.maps.legendModule.totalPages) && (this.maps.legendModule.totalPages.length > 0)) {
|
|
1158
1158
|
currentCollection = this.maps.legendModule.totalPages[this.maps.legendModule.currentPage]['Collection'];
|
|
1159
1159
|
}
|
|
1160
|
-
var currentCollectionLength = legendType === 'Default' ? currentCollection['length'] : 1;
|
|
1160
|
+
var currentCollectionLength = (legendType === 'Default' && !isNullOrUndefined(currentCollection)) ? currentCollection['length'] : 1;
|
|
1161
1161
|
for (var i = 0; i < collection.length; i++) {
|
|
1162
1162
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1163
1163
|
var dataValue = collection[i]['data'];
|
|
@@ -1308,7 +1308,18 @@ var Legend = /** @class */ (function () {
|
|
|
1308
1308
|
var spacing = 10;
|
|
1309
1309
|
var trimTitle = textTrim((this.legendItemRect.width + (spacing * 2)), legendTitle, textStyle);
|
|
1310
1310
|
var textSize = measureText(trimTitle, textStyle);
|
|
1311
|
-
|
|
1311
|
+
var sameTextWidth = false;
|
|
1312
|
+
for (var i = 0; i < this.legendRenderingCollections.length; i++) {
|
|
1313
|
+
if (this.legendRenderingCollections[i].textWidth !== this.legendRenderingCollections[0].textWidth) {
|
|
1314
|
+
sameTextWidth = false;
|
|
1315
|
+
break;
|
|
1316
|
+
}
|
|
1317
|
+
else {
|
|
1318
|
+
sameTextWidth = true;
|
|
1319
|
+
}
|
|
1320
|
+
}
|
|
1321
|
+
this.legendBorderRect = new Rect((map.theme === 'Fluent2HighContrast' && !sameTextWidth && (legend.position === 'Left' || legend.position === 'Right') && legend.mode === 'Interactive')
|
|
1322
|
+
? (this.legendItemRect.x - (spacing * 3)) : (this.legendItemRect.x - spacing), (this.legendItemRect.y - spacing - textSize.height), (this.legendItemRect.width) + (spacing * 2), (this.legendItemRect.height) + (spacing * 2) + textSize.height +
|
|
1312
1323
|
(legend.mode === 'Interactive' ? 0 : (this.page !== 0) ? spacing : 0));
|
|
1313
1324
|
var legendBorder = {
|
|
1314
1325
|
color: legend.border.color || this.maps.themeStyle.legendBorderColor, opacity: legend.border.opacity,
|
|
@@ -1600,7 +1611,7 @@ var Legend = /** @class */ (function () {
|
|
|
1600
1611
|
if (!isNullOrUndefined(dataSource) && dataSource.length > 0) {
|
|
1601
1612
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1602
1613
|
Array.prototype.forEach.call(dataSource, function (data, dataIndex) {
|
|
1603
|
-
var equalValue = ((colorValuePath.indexOf('.') > -1) ? (getValueFromObject(data, colorValuePath)) :
|
|
1614
|
+
var equalValue = ((colorValuePath && colorValuePath.indexOf('.') > -1) ? (getValueFromObject(data, colorValuePath)) :
|
|
1604
1615
|
(data[colorValuePath]));
|
|
1605
1616
|
if (equalValue === colorMap.value) {
|
|
1606
1617
|
eqaulColorProcess_1 = true;
|
|
@@ -1698,7 +1709,8 @@ var Legend = /** @class */ (function () {
|
|
|
1698
1709
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1699
1710
|
var newData = [];
|
|
1700
1711
|
var legendFill = (isNullOrUndefined(fill)) ? dataValue : fill;
|
|
1701
|
-
if (!isNullOrUndefined(dataValue) && colorMapping.length === 0
|
|
1712
|
+
if (!isNullOrUndefined(dataValue) && colorMapping.length === 0 &&
|
|
1713
|
+
(!isNullOrUndefined(valuePath) || !isNullOrUndefined(dataPath))) {
|
|
1702
1714
|
legendText = !isNullOrUndefined(data[valuePath]) ? ((valuePath.indexOf('.') > -1) ?
|
|
1703
1715
|
getValueFromObject(data, valuePath) : data[valuePath]) : ((dataPath.indexOf('.') > -1) ?
|
|
1704
1716
|
getValueFromObject(data, dataPath) : data[dataPath]);
|
|
@@ -1748,7 +1760,11 @@ var Legend = /** @class */ (function () {
|
|
|
1748
1760
|
var arrowElement_1 = querySelector(id, this_3.maps.element.id);
|
|
1749
1761
|
if (this_3.maps.isDevice && !(isNullOrUndefined(arrowElement_1))) {
|
|
1750
1762
|
clearTimeout(this_3.arrowTimer);
|
|
1751
|
-
this_3.arrowTimer = setTimeout(function () {
|
|
1763
|
+
this_3.arrowTimer = setTimeout(function () {
|
|
1764
|
+
if (!isNullOrUndefined(arrowElement_1.parentNode)) {
|
|
1765
|
+
remove(arrowElement_1);
|
|
1766
|
+
}
|
|
1767
|
+
}, 2000);
|
|
1752
1768
|
}
|
|
1753
1769
|
return "break";
|
|
1754
1770
|
}
|
|
@@ -283,7 +283,8 @@ var Marker = /** @class */ (function () {
|
|
|
283
283
|
&& this.maps.mapScaleValue <= 1) {
|
|
284
284
|
this.maps.tileZoomLevel = this.maps.mapScaleValue === 0 ? (this.maps.isZoomByPosition ? this.maps.tileZoomLevel : 1)
|
|
285
285
|
: this.maps.mapScaleValue;
|
|
286
|
-
if (this.maps.mapScaleValue === 1 && this.maps.markerZoomFactor === 1
|
|
286
|
+
if (this.maps.mapScaleValue === 1 && this.maps.markerZoomFactor === 1 &&
|
|
287
|
+
!isNullOrUndefined(this.maps.tileTranslatePoint)) {
|
|
287
288
|
this.maps.tileTranslatePoint.x = 0;
|
|
288
289
|
this.maps.tileTranslatePoint.y = 0;
|
|
289
290
|
}
|
|
@@ -89,7 +89,7 @@ var NavigationLine = /** @class */ (function () {
|
|
|
89
89
|
}
|
|
90
90
|
if (showArrow) {
|
|
91
91
|
arrowColor = arrowSettings.color;
|
|
92
|
-
arrowSize = arrowSettings.size;
|
|
92
|
+
arrowSize = !isNullOrUndefined(arrowSettings.size) ? arrowSettings.size : 0;
|
|
93
93
|
offSetValue = !isNullOrUndefined(arrowSettings.offSet) ? arrowSettings.offSet : 0;
|
|
94
94
|
var divide = (Math.round(arrowSize / 2));
|
|
95
95
|
arrowPosition = arrowSettings.position;
|
package/src/maps/maps-model.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, NotifyPropertyChanges, INotifyPropertyChanged, Property, Fetch } from '@syncfusion/ej2-base';import { EventHandler, Browser, EmitType, isNullOrUndefined, createElement, setValue, extend } from '@syncfusion/ej2-base';import { Event, remove, L10n, Collection, Internationalization, Complex } from '@syncfusion/ej2-base';import { ModuleDeclaration } from '@syncfusion/ej2-base';import { SvgRenderer } from '@syncfusion/ej2-svg-base';import { Size, createSvg, Point, removeElement, triggerShapeEvent, showTooltip, checkShapeDataFields, MapLocation, getMousePosition, calculateSize } from './utils/helper';import { getElement, removeClass, getTranslate, triggerItemSelectionEvent, mergeSeparateCluster, customizeStyle, querySelector } from './utils/helper';import { createStyle } from './utils/helper';import { ZoomSettings, LegendSettings } from './model/base';import { LayerSettings, TitleSettings, Border, Margin, MapsAreaSettings, Annotation, CenterPosition } from './model/base';import { ZoomSettingsModel, LegendSettingsModel, LayerSettingsModel, BubbleSettingsModel, PolygonSettingsModel } from './model/base-model';import { MarkerSettingsModel, SelectionSettingsModel, InitialMarkerSelectionSettingsModel } from './model/base-model';import { TitleSettingsModel, BorderModel, MarginModel, CenterPositionModel, InitialShapeSelectionSettingsModel } from './model/base-model';import { MapsAreaSettingsModel, AnnotationModel } from './model/base-model';import { Bubble } from './layers/bubble';import { Legend } from './layers/legend';import { Marker } from './layers/marker';import { Highlight } from './user-interaction/highlight';import { Selection } from './user-interaction/selection';import { MapsTooltip } from './user-interaction/tooltip';import { Zoom } from './user-interaction/zoom';import { load, click, onclick, rightClick, doubleClick, resize, shapeSelected, zoomIn } from './model/constants';import { ProjectionType, MapsTheme, PanDirection, TooltipGesture } from './utils/enum';import { getThemeStyle, Theme } from './model/theme';import { ILoadEventArgs, ILoadedEventArgs, IMinMaxLatitudeLongitude, IMouseEventArgs, IResizeEventArgs, ITooltipRenderEventArgs } from './model/interface';import { GeoPosition, ITooltipRenderCompleteEventArgs, ILegendRenderingEventArgs } from './model/interface';import { ILayerRenderingEventArgs, IShapeRenderingEventArgs, IMarkerRenderingEventArgs, IMarkerClickEventArgs } from './model/interface';import { IMarkerMoveEventArgs, ILabelRenderingEventArgs, IBubbleMoveEventArgs, IBubbleClickEventArgs } from './model/interface';import { IMarkerClusterClickEventArgs, IMarkerClusterMoveEventArgs, IMarkerClusterRenderingEventArgs } from './model/interface';import { ISelectionEventArgs, IShapeSelectedEventArgs, IMapPanEventArgs, IMapZoomEventArgs } from './model/interface';import { IBubbleRenderingEventArgs, IAnimationCompleteEventArgs, IPrintEventArgs, IThemeStyle } from './model/interface';import { LayerPanel } from './layers/layer-panel';import { GeoLocation, Rect, RectOption, measureText, getElementByID, MapAjax, processResult, getElementsByClassName } from '../maps/utils/helper';import { findPosition, textTrim, TextOption, renderTextElement, calculateZoomLevel, convertTileLatLongToPoint, convertGeoToPoint} from '../maps/utils/helper';import { Annotations } from '../maps/user-interaction/annotation';import { FontModel, DataLabel, MarkerSettings, IAnnotationRenderingEventArgs, IMarkerDragEventArgs } from './index';import { NavigationLineSettingsModel, changeBorderWidth } from './index';import { NavigationLine } from './layers/navigation-selected-line';import { Polygon } from './layers/polygon';import { DataManager, Query } from '@syncfusion/ej2-data';import { ExportType } from '../maps/utils/enum';import { PdfPageOrientation } from '@syncfusion/ej2-pdf-export';import { Print } from './model/print';import { PdfExport } from './model/export-pdf';import { ImageExport } from './model/export-image';
|
|
1
|
+
import { Component, NotifyPropertyChanges, INotifyPropertyChanged, Property, Fetch } from '@syncfusion/ej2-base';import { EventHandler, Browser, EmitType, isNullOrUndefined, createElement, setValue, extend } from '@syncfusion/ej2-base';import { Event, remove, L10n, Collection, Internationalization, Complex } from '@syncfusion/ej2-base';import { ModuleDeclaration } from '@syncfusion/ej2-base';import { SvgRenderer } from '@syncfusion/ej2-svg-base';import { Size, createSvg, Point, removeElement, triggerShapeEvent, showTooltip, checkShapeDataFields, MapLocation, getMousePosition, calculateSize } from './utils/helper';import { getElement, removeClass, getTranslate, triggerItemSelectionEvent, mergeSeparateCluster, customizeStyle, querySelector } from './utils/helper';import { createStyle, getProcessedMarginValue } from './utils/helper';import { ZoomSettings, LegendSettings } from './model/base';import { LayerSettings, TitleSettings, Border, Margin, MapsAreaSettings, Annotation, CenterPosition } from './model/base';import { ZoomSettingsModel, LegendSettingsModel, LayerSettingsModel, BubbleSettingsModel, PolygonSettingsModel } from './model/base-model';import { MarkerSettingsModel, SelectionSettingsModel, InitialMarkerSelectionSettingsModel } from './model/base-model';import { TitleSettingsModel, BorderModel, MarginModel, CenterPositionModel, InitialShapeSelectionSettingsModel } from './model/base-model';import { MapsAreaSettingsModel, AnnotationModel } from './model/base-model';import { Bubble } from './layers/bubble';import { Legend } from './layers/legend';import { Marker } from './layers/marker';import { Highlight } from './user-interaction/highlight';import { Selection } from './user-interaction/selection';import { MapsTooltip } from './user-interaction/tooltip';import { Zoom } from './user-interaction/zoom';import { load, click, onclick, rightClick, doubleClick, resize, shapeSelected, zoomIn } from './model/constants';import { ProjectionType, MapsTheme, PanDirection, TooltipGesture } from './utils/enum';import { getThemeStyle, Theme } from './model/theme';import { ILoadEventArgs, ILoadedEventArgs, IMinMaxLatitudeLongitude, IMouseEventArgs, IResizeEventArgs, ITooltipRenderEventArgs } from './model/interface';import { GeoPosition, ITooltipRenderCompleteEventArgs, ILegendRenderingEventArgs } from './model/interface';import { ILayerRenderingEventArgs, IShapeRenderingEventArgs, IMarkerRenderingEventArgs, IMarkerClickEventArgs } from './model/interface';import { IMarkerMoveEventArgs, ILabelRenderingEventArgs, IBubbleMoveEventArgs, IBubbleClickEventArgs } from './model/interface';import { IMarkerClusterClickEventArgs, IMarkerClusterMoveEventArgs, IMarkerClusterRenderingEventArgs } from './model/interface';import { ISelectionEventArgs, IShapeSelectedEventArgs, IMapPanEventArgs, IMapZoomEventArgs } from './model/interface';import { IBubbleRenderingEventArgs, IAnimationCompleteEventArgs, IPrintEventArgs, IThemeStyle } from './model/interface';import { LayerPanel } from './layers/layer-panel';import { GeoLocation, Rect, RectOption, measureText, getElementByID, MapAjax, processResult, getElementsByClassName } from '../maps/utils/helper';import { findPosition, textTrim, TextOption, renderTextElement, calculateZoomLevel, convertTileLatLongToPoint, convertGeoToPoint} from '../maps/utils/helper';import { Annotations } from '../maps/user-interaction/annotation';import { FontModel, DataLabel, MarkerSettings, IAnnotationRenderingEventArgs, IMarkerDragEventArgs, BingMap } from './index';import { NavigationLineSettingsModel, changeBorderWidth } from './index';import { NavigationLine } from './layers/navigation-selected-line';import { Polygon } from './layers/polygon';import { DataManager, Query } from '@syncfusion/ej2-data';import { ExportType } from '../maps/utils/enum';import { PdfPageOrientation } from '@syncfusion/ej2-pdf-export';import { Print } from './model/print';import { PdfExport } from './model/export-pdf';import { ImageExport } from './model/export-image';
|
|
2
2
|
import {ComponentModel} from '@syncfusion/ej2-base';
|
|
3
3
|
|
|
4
4
|
/**
|
package/src/maps/maps.d.ts
CHANGED
|
@@ -31,7 +31,7 @@ import { IBubbleRenderingEventArgs, IAnimationCompleteEventArgs, IPrintEventArgs
|
|
|
31
31
|
import { LayerPanel } from './layers/layer-panel';
|
|
32
32
|
import { GeoLocation, Rect } from '../maps/utils/helper';
|
|
33
33
|
import { Annotations } from '../maps/user-interaction/annotation';
|
|
34
|
-
import { DataLabel, IAnnotationRenderingEventArgs, IMarkerDragEventArgs } from './index';
|
|
34
|
+
import { DataLabel, IAnnotationRenderingEventArgs, IMarkerDragEventArgs, BingMap } from './index';
|
|
35
35
|
import { NavigationLine } from './layers/navigation-selected-line';
|
|
36
36
|
import { Polygon } from './layers/polygon';
|
|
37
37
|
import { ExportType } from '../maps/utils/enum';
|
|
@@ -135,6 +135,12 @@ export declare class Maps extends Component<HTMLElement> implements INotifyPrope
|
|
|
135
135
|
* @private
|
|
136
136
|
*/
|
|
137
137
|
imageExportModule: ImageExport;
|
|
138
|
+
/**
|
|
139
|
+
* This module enables the bing map functionality in maps.
|
|
140
|
+
*
|
|
141
|
+
* @private
|
|
142
|
+
*/
|
|
143
|
+
bingMap: BingMap;
|
|
138
144
|
/**
|
|
139
145
|
* Gets or sets the background color of the maps container.
|
|
140
146
|
*
|
|
@@ -619,8 +625,6 @@ export declare class Maps extends Component<HTMLElement> implements INotifyPrope
|
|
|
619
625
|
/** @private */
|
|
620
626
|
previousZoomFactor: number;
|
|
621
627
|
/** @private */
|
|
622
|
-
isTileMapSubLayer: boolean;
|
|
623
|
-
/** @private */
|
|
624
628
|
shouldZoomCurrentFactor: number;
|
|
625
629
|
/** @private */
|
|
626
630
|
shouldZoomPreviousFactor: number;
|
|
@@ -898,9 +902,23 @@ export declare class Maps extends Component<HTMLElement> implements INotifyPrope
|
|
|
898
902
|
* @private
|
|
899
903
|
*/
|
|
900
904
|
mouseLeaveOnMap(e: PointerEvent): void;
|
|
901
|
-
|
|
905
|
+
/**
|
|
906
|
+
* This method is used to perform operations when keyboard key from maps.
|
|
907
|
+
*
|
|
908
|
+
* @param {KeyboardEvent} event - Specifies the keyboard event on maps.
|
|
909
|
+
* @returns {void}
|
|
910
|
+
* @private
|
|
911
|
+
*/
|
|
912
|
+
keyUpHandler(event: KeyboardEvent): void;
|
|
902
913
|
private keyboardHighlightSelection;
|
|
903
|
-
|
|
914
|
+
/**
|
|
915
|
+
* This method is used to perform operations when keyboard down from maps.
|
|
916
|
+
*
|
|
917
|
+
* @param {KeyboardEvent} event - Specifies the keyboard event on maps.
|
|
918
|
+
* @returns {void}
|
|
919
|
+
* @private
|
|
920
|
+
*/
|
|
921
|
+
keyDownHandler(event: KeyboardEvent): void;
|
|
904
922
|
/**
|
|
905
923
|
* Gets the selected element to be maintained or not.
|
|
906
924
|
*
|