@syncfusion/ej2-maps 19.2.60 → 19.3.53
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 +1 -1
- package/CHANGELOG.md +10 -4
- package/README.md +3 -3
- 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 +182 -393
- package/dist/es6/ej2-maps.es2015.js.map +1 -1
- package/dist/es6/ej2-maps.es5.js +182 -394
- 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 +12 -12
- package/src/maps/layers/bubble.js +3 -24
- package/src/maps/layers/data-label.js +5 -17
- package/src/maps/layers/layer-panel.js +0 -22
- package/src/maps/layers/legend.js +1 -1
- package/src/maps/layers/marker.js +0 -16
- package/src/maps/maps-model.d.ts +1 -28
- package/src/maps/maps.d.ts +1 -38
- package/src/maps/maps.js +39 -86
- package/src/maps/model/base-model.d.ts +0 -5
- package/src/maps/model/base.d.ts +0 -5
- package/src/maps/model/export-pdf.js +1 -1
- package/src/maps/model/theme.js +54 -1
- package/src/maps/user-interaction/annotation.js +3 -7
- package/src/maps/user-interaction/highlight.js +0 -13
- package/src/maps/user-interaction/selection.js +0 -13
- package/src/maps/user-interaction/tooltip.js +52 -122
- package/src/maps/user-interaction/zoom.js +19 -68
- package/src/maps/utils/enum.d.ts +5 -1
- package/src/maps/utils/helper.d.ts +1 -1
- package/src/maps/utils/helper.js +6 -6
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
2
2
|
/* eslint-disable jsdoc/require-param */
|
|
3
3
|
import { annotationRendering } from '../index';
|
|
4
|
-
import { createElement, isNullOrUndefined
|
|
4
|
+
import { createElement, isNullOrUndefined } from '@syncfusion/ej2-base';
|
|
5
5
|
import { getTemplateFunction, getElementOffset, getElementByID } from '../utils/helper';
|
|
6
6
|
/**
|
|
7
7
|
* Represents the annotation elements for map.
|
|
@@ -24,9 +24,6 @@ var Annotations = /** @class */ (function () {
|
|
|
24
24
|
});
|
|
25
25
|
if (annotationGroup.childElementCount > 0 && !(isNullOrUndefined(getElementByID(secondaryID)))) {
|
|
26
26
|
getElementByID(secondaryID).appendChild(annotationGroup);
|
|
27
|
-
for (var i = 0; i < this.map.annotations.length; i++) {
|
|
28
|
-
updateBlazorTemplate(this.map.element.id + '_ContentTemplate_' + i, 'ContentTemplate', this.map.annotations[i]);
|
|
29
|
-
}
|
|
30
27
|
}
|
|
31
28
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
32
29
|
this.map.renderReactTemplates();
|
|
@@ -56,10 +53,9 @@ var Annotations = /** @class */ (function () {
|
|
|
56
53
|
if (argsData.cancel) {
|
|
57
54
|
return;
|
|
58
55
|
}
|
|
59
|
-
var blazor = 'Blazor';
|
|
60
56
|
templateFn = getTemplateFunction(argsData.content);
|
|
61
|
-
if (templateFn &&
|
|
62
|
-
templateElement = Array.prototype.slice.call(templateFn(
|
|
57
|
+
if (templateFn && templateFn(_this.map, _this.map, argsData.content, _this.map.element.id + '_ContentTemplate_' + annotationIndex).length) {
|
|
58
|
+
templateElement = Array.prototype.slice.call(templateFn(_this.map, _this.map, argsData.content, _this.map.element.id + '_ContentTemplate_' + annotationIndex));
|
|
63
59
|
var length_1 = templateElement.length;
|
|
64
60
|
for (var i = 0; i < length_1; i++) {
|
|
65
61
|
childElement.appendChild(templateElement[i]);
|
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
|
|
7
|
-
t[p[i]] = s[p[i]];
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
1
|
import { itemHighlight } from '../index';
|
|
11
2
|
import { Browser, isNullOrUndefined } from '@syncfusion/ej2-base';
|
|
12
3
|
import { getElementsByClassName, getElement, removeClass, createStyle, customizeStyle, getTargetElement } from '../utils/helper';
|
|
@@ -174,10 +165,6 @@ var Highlight = /** @class */ (function () {
|
|
|
174
165
|
data: data,
|
|
175
166
|
maps: this.maps
|
|
176
167
|
};
|
|
177
|
-
if (this.maps.isBlazor) {
|
|
178
|
-
var shapeData_1 = eventArgs.shapeData, maps = eventArgs.maps, blazorEventArgs = __rest(eventArgs, ["shapeData", "maps"]);
|
|
179
|
-
eventArgs = blazorEventArgs;
|
|
180
|
-
}
|
|
181
168
|
this.maps.trigger(itemHighlight, eventArgs, function () {
|
|
182
169
|
eventArgs.border.opacity = isNullOrUndefined(_this.highlightSettings.border.opacity) ? _this.highlightSettings.opacity : _this.highlightSettings.border.opacity;
|
|
183
170
|
_this.highlightMap(targetEle, eventArgs);
|
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
|
|
7
|
-
t[p[i]] = s[p[i]];
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
1
|
import { click, itemSelection } from '../index';
|
|
11
2
|
import { getElement, createStyle, customizeStyle, removeClass, getTargetElement, getElementByID } from '../utils/helper';
|
|
12
3
|
import { isNullOrUndefined, Browser } from '@syncfusion/ej2-base';
|
|
@@ -151,10 +142,6 @@ var Selection = /** @class */ (function () {
|
|
|
151
142
|
data: data,
|
|
152
143
|
maps: this.maps
|
|
153
144
|
};
|
|
154
|
-
if (this.maps.isBlazor) {
|
|
155
|
-
var shapeData_1 = eventArgs.shapeData, maps = eventArgs.maps, blazorEventArgs = __rest(eventArgs, ["shapeData", "maps"]);
|
|
156
|
-
eventArgs = blazorEventArgs;
|
|
157
|
-
}
|
|
158
145
|
this.maps.trigger('itemSelection', eventArgs, function (observedArgs) {
|
|
159
146
|
eventArgs.border.opacity = isNullOrUndefined(_this.selectionsettings.border.opacity) ? _this.selectionsettings.opacity : _this.selectionsettings.border.opacity;
|
|
160
147
|
if (!eventArgs.cancel) {
|
|
@@ -184,132 +184,62 @@ var MapsTooltip = /** @class */ (function () {
|
|
|
184
184
|
maps: this.maps,
|
|
185
185
|
element: target, eventArgs: e
|
|
186
186
|
};
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
cancel
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
blazTooltipName = 'BubbleTooltipTemplate';
|
|
209
|
-
}
|
|
210
|
-
else {
|
|
211
|
-
blazTooltipName = 'LayerTooltipTemplate';
|
|
212
|
-
}
|
|
213
|
-
_this.maps['isProtectedOnChange'] = true;
|
|
214
|
-
if (blazorArgs_1.cancel) {
|
|
215
|
-
_this.svgTooltip = new Tooltip({
|
|
216
|
-
enable: true,
|
|
217
|
-
header: '',
|
|
218
|
-
content: [currentData.toString()],
|
|
219
|
-
shapes: [],
|
|
220
|
-
location: tootipOption_1.location,
|
|
221
|
-
palette: [markerFill],
|
|
222
|
-
areaBounds: _this.maps.mapAreaRect,
|
|
223
|
-
textStyle: tooltipArgs.options['textStyle'],
|
|
224
|
-
availableSize: _this.maps.availableSize,
|
|
225
|
-
fill: tooltipArgs.fill
|
|
226
|
-
});
|
|
227
|
-
}
|
|
228
|
-
else {
|
|
229
|
-
_this.svgTooltip = new Tooltip({
|
|
230
|
-
enable: true,
|
|
231
|
-
header: '',
|
|
232
|
-
content: [currentData.toString()],
|
|
233
|
-
shapes: [],
|
|
234
|
-
location: tootipOption_1.location,
|
|
235
|
-
palette: [markerFill],
|
|
236
|
-
areaBounds: _this.maps.mapAreaRect,
|
|
237
|
-
textStyle: blazorArgs_1.textStyle,
|
|
238
|
-
availableSize: _this.maps.availableSize,
|
|
239
|
-
fill: blazorArgs_1.fill
|
|
240
|
-
});
|
|
241
|
-
}
|
|
242
|
-
var tooltipElement = tooltipEle;
|
|
243
|
-
_this.svgTooltip.opacity = _this.maps.themeStyle.tooltipFillOpacity || _this.svgTooltip.opacity;
|
|
244
|
-
_this.svgTooltip.appendTo(tooltipElement);
|
|
245
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
246
|
-
_this.maps.renderReactTemplates();
|
|
187
|
+
this.maps.trigger(tooltipRender, tooltipArgs, function (args) {
|
|
188
|
+
if (!tooltipArgs.cancel && option.visible && !isNullOrUndefined(currentData) &&
|
|
189
|
+
(targetId.indexOf('_cluster_') === -1 && targetId.indexOf('_dataLabel_') === -1)) {
|
|
190
|
+
_this.maps['isProtectedOnChange'] = true;
|
|
191
|
+
tooltipArgs.options['textStyle']['color'] = tooltipArgs.options['textStyle']['color']
|
|
192
|
+
|| _this.maps.themeStyle.tooltipFontColor;
|
|
193
|
+
if (tooltipArgs.cancel) {
|
|
194
|
+
_this.svgTooltip = new Tooltip({
|
|
195
|
+
enable: true,
|
|
196
|
+
header: '',
|
|
197
|
+
data: option['data'],
|
|
198
|
+
template: option['template'],
|
|
199
|
+
content: [currentData.toString()],
|
|
200
|
+
shapes: [],
|
|
201
|
+
location: option['location'],
|
|
202
|
+
palette: [markerFill],
|
|
203
|
+
areaBounds: _this.maps.mapAreaRect,
|
|
204
|
+
textStyle: option['textStyle'],
|
|
205
|
+
availableSize: _this.maps.availableSize,
|
|
206
|
+
fill: option.fill || _this.maps.themeStyle.tooltipFillColor
|
|
207
|
+
});
|
|
247
208
|
}
|
|
248
209
|
else {
|
|
249
|
-
_this.
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|| _this.maps.themeStyle.
|
|
262
|
-
|
|
263
|
-
_this.svgTooltip = new Tooltip({
|
|
264
|
-
enable: true,
|
|
265
|
-
header: '',
|
|
266
|
-
data: option['data'],
|
|
267
|
-
template: option['template'],
|
|
268
|
-
content: [currentData.toString()],
|
|
269
|
-
shapes: [],
|
|
270
|
-
location: option['location'],
|
|
271
|
-
palette: [markerFill],
|
|
272
|
-
areaBounds: _this.maps.mapAreaRect,
|
|
273
|
-
textStyle: option['textStyle'],
|
|
274
|
-
availableSize: _this.maps.availableSize,
|
|
275
|
-
fill: option.fill || _this.maps.themeStyle.tooltipFillColor
|
|
276
|
-
});
|
|
277
|
-
}
|
|
278
|
-
else {
|
|
279
|
-
_this.svgTooltip = new Tooltip({
|
|
280
|
-
enable: true,
|
|
281
|
-
header: '',
|
|
282
|
-
data: tooltipArgs.options['data'],
|
|
283
|
-
template: tooltipArgs.options['template'],
|
|
284
|
-
content: [currentData.toString()],
|
|
285
|
-
shapes: [],
|
|
286
|
-
location: tooltipArgs.options['location'],
|
|
287
|
-
palette: [markerFill],
|
|
288
|
-
areaBounds: _this.maps.mapAreaRect,
|
|
289
|
-
textStyle: tooltipArgs.options['textStyle'],
|
|
290
|
-
availableSize: _this.maps.availableSize,
|
|
291
|
-
fill: tooltipArgs.fill || _this.maps.themeStyle.tooltipFillColor
|
|
292
|
-
});
|
|
293
|
-
}
|
|
294
|
-
_this.svgTooltip.opacity = _this.maps.themeStyle.tooltipFillOpacity || _this.svgTooltip.opacity;
|
|
295
|
-
_this.svgTooltip.appendTo(tooltipEle);
|
|
296
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
297
|
-
_this.maps.renderReactTemplates();
|
|
298
|
-
tooltipTemplateElement = document.getElementById(_this.maps.element.id + '_mapsTooltip');
|
|
299
|
-
if (tooltipTemplateElement !== null && tooltipTemplateElement.innerHTML.indexOf('href') !== -1
|
|
300
|
-
&& tooltipTemplateElement.innerHTML.indexOf('</a>') !== -1) {
|
|
301
|
-
var templateStyle = tooltipTemplateElement.getAttribute('style');
|
|
302
|
-
templateStyle = templateStyle.replace('pointer-events: none;', 'position-events:all;');
|
|
303
|
-
tooltipTemplateElement.setAttribute('style', templateStyle);
|
|
304
|
-
}
|
|
210
|
+
_this.svgTooltip = new Tooltip({
|
|
211
|
+
enable: true,
|
|
212
|
+
header: '',
|
|
213
|
+
data: tooltipArgs.options['data'],
|
|
214
|
+
template: tooltipArgs.options['template'],
|
|
215
|
+
content: [currentData.toString()],
|
|
216
|
+
shapes: [],
|
|
217
|
+
location: tooltipArgs.options['location'],
|
|
218
|
+
palette: [markerFill],
|
|
219
|
+
areaBounds: _this.maps.mapAreaRect,
|
|
220
|
+
textStyle: tooltipArgs.options['textStyle'],
|
|
221
|
+
availableSize: _this.maps.availableSize,
|
|
222
|
+
fill: tooltipArgs.fill || _this.maps.themeStyle.tooltipFillColor
|
|
223
|
+
});
|
|
305
224
|
}
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
225
|
+
_this.svgTooltip.opacity = _this.maps.themeStyle.tooltipFillOpacity || _this.svgTooltip.opacity;
|
|
226
|
+
_this.svgTooltip.appendTo(tooltipEle);
|
|
227
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
228
|
+
_this.maps.renderReactTemplates();
|
|
229
|
+
tooltipTemplateElement = document.getElementById(_this.maps.element.id + '_mapsTooltip');
|
|
230
|
+
if (tooltipTemplateElement !== null && tooltipTemplateElement.innerHTML.indexOf('href') !== -1
|
|
231
|
+
&& tooltipTemplateElement.innerHTML.indexOf('</a>') !== -1) {
|
|
232
|
+
var templateStyle = tooltipTemplateElement.getAttribute('style');
|
|
233
|
+
templateStyle = templateStyle.replace('pointer-events: none;', 'position-events:all;');
|
|
234
|
+
tooltipTemplateElement.setAttribute('style', templateStyle);
|
|
310
235
|
}
|
|
311
|
-
}
|
|
312
|
-
|
|
236
|
+
}
|
|
237
|
+
else {
|
|
238
|
+
_this.removeTooltip();
|
|
239
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
240
|
+
_this.maps.clearTemplate();
|
|
241
|
+
}
|
|
242
|
+
});
|
|
313
243
|
if (this.svgTooltip) {
|
|
314
244
|
this.maps.trigger('tooltipRenderComplete', {
|
|
315
245
|
cancel: false, name: 'tooltipRenderComplete', maps: this.maps, options: tooltipOption,
|
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
|
|
7
|
-
t[p[i]] = s[p[i]];
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
1
|
import { Point, getElementByID, PathOption, Rect, convertGeoToPoint, CircleOption, convertTileLatLongToPoint } from '../utils/helper';
|
|
11
2
|
import { RectOption, createTooltip, calculateScale, getTouchCenter, getTouches, targetTouches } from '../utils/helper';
|
|
12
3
|
import { MapLocation, zoomAnimate, smoothTranslate, measureText, textTrim, clusterTemplate, marker } from '../utils/helper';
|
|
@@ -140,14 +131,14 @@ var Zoom = /** @class */ (function () {
|
|
|
140
131
|
var zoomArgs;
|
|
141
132
|
if (!map.isTileMap) {
|
|
142
133
|
zoomArgs = {
|
|
143
|
-
cancel: false, name: 'zoom', type: type, maps:
|
|
134
|
+
cancel: false, name: 'zoom', type: type, maps: map,
|
|
144
135
|
tileTranslatePoint: {}, translatePoint: { previous: map.previousPoint, current: map.translatePoint },
|
|
145
136
|
tileZoomLevel: {}, scale: { previous: map.previousScale, current: map.scale }
|
|
146
137
|
};
|
|
147
138
|
}
|
|
148
139
|
else {
|
|
149
140
|
zoomArgs = {
|
|
150
|
-
cancel: false, name: 'zoom', type: type, maps:
|
|
141
|
+
cancel: false, name: 'zoom', type: type, maps: map,
|
|
151
142
|
tileTranslatePoint: { previous: prevTilePoint, current: map.tileTranslatePoint }, translatePoint: { previous: map.previousPoint, current: map.translatePoint },
|
|
152
143
|
tileZoomLevel: { previous: prevLevel, current: map.tileZoomLevel }, scale: { previous: map.previousScale, current: map.scale }
|
|
153
144
|
};
|
|
@@ -358,7 +349,7 @@ var Zoom = /** @class */ (function () {
|
|
|
358
349
|
}
|
|
359
350
|
}
|
|
360
351
|
else if (currentEle.id.indexOf('_Markers_Group') > -1) {
|
|
361
|
-
if (!this.isPanning
|
|
352
|
+
if (!this.isPanning) {
|
|
362
353
|
this.markerTranslates(currentEle.childNodes[0], factor, x, y, scale, 'Marker', layerElement, animate);
|
|
363
354
|
}
|
|
364
355
|
currentEle = layerElement.childNodes[j];
|
|
@@ -477,7 +468,6 @@ var Zoom = /** @class */ (function () {
|
|
|
477
468
|
}
|
|
478
469
|
}
|
|
479
470
|
this.maps.arrangeTemplate();
|
|
480
|
-
var blazor = this.maps.isBlazor ? this.maps.blazorTemplates() : null;
|
|
481
471
|
}
|
|
482
472
|
if (!isNullOrUndefined(this.currentLayer)) {
|
|
483
473
|
if (!animate || this.currentLayer.animationDuration === 0) {
|
|
@@ -532,18 +522,6 @@ var Zoom = /** @class */ (function () {
|
|
|
532
522
|
};
|
|
533
523
|
eventArgs = markerShapeChoose(eventArgs, data);
|
|
534
524
|
eventArgs = markerColorChoose(eventArgs, data);
|
|
535
|
-
if (_this.maps.isBlazor) {
|
|
536
|
-
var maps = eventArgs.maps, marker_1 = eventArgs.marker, blazorEventArgs = __rest(eventArgs, ["maps", "marker"]);
|
|
537
|
-
eventArgs = blazorEventArgs;
|
|
538
|
-
var latitudeValue = 'Latitude';
|
|
539
|
-
var longitudeValue = 'Longitude';
|
|
540
|
-
markerSettings.longitudeValuePath = !isNullOrUndefined(markerSettings.longitudeValuePath) ?
|
|
541
|
-
markerSettings.longitudeValuePath : !isNullOrUndefined(data['Longitude']) ? longitudeValue :
|
|
542
|
-
!isNullOrUndefined(data['longitude']) ? 'longitude' : null;
|
|
543
|
-
markerSettings.latitudeValuePath = !isNullOrUndefined(markerSettings.latitudeValuePath) ?
|
|
544
|
-
markerSettings.latitudeValuePath : !isNullOrUndefined(data['Latitude']) ? latitudeValue :
|
|
545
|
-
!isNullOrUndefined(data['latitude']) ? 'latitude' : null;
|
|
546
|
-
}
|
|
547
525
|
_this.maps.trigger('markerRendering', eventArgs, function (MarkerArgs) {
|
|
548
526
|
if (markerSettings.shapeValuePath !== eventArgs.shapeValuePath) {
|
|
549
527
|
eventArgs = markerShapeChoose(eventArgs, data);
|
|
@@ -557,22 +535,6 @@ var Zoom = /** @class */ (function () {
|
|
|
557
535
|
var long = (!isNullOrUndefined(markerSettings.longitudeValuePath)) ?
|
|
558
536
|
Number(getValueFromObject(data, markerSettings.longitudeValuePath)) : !isNullOrUndefined(data['longitude']) ?
|
|
559
537
|
parseFloat(data['longitude']) : !isNullOrUndefined(data['Longitude']) ? data['Longitude'] : 0;
|
|
560
|
-
if (_this.maps.isBlazor) {
|
|
561
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
562
|
-
var data1 = {};
|
|
563
|
-
var j = 0;
|
|
564
|
-
var text = [];
|
|
565
|
-
for (var i = 0; i < Object.keys(data).length; i++) {
|
|
566
|
-
if (Object.keys(data)[i].toLowerCase() !== 'text' && Object.keys(data)[i].toLowerCase() !== 'latitude'
|
|
567
|
-
&& Object.keys(data)[i].toLowerCase() !== 'blazortemplateid' && Object.keys(data)[i].toLowerCase() !== 'longitude'
|
|
568
|
-
&& Object.keys(data)[i].toLowerCase() !== 'name') {
|
|
569
|
-
data1['text'] = text;
|
|
570
|
-
text[j] = data[Object.keys(data)[i].toLowerCase()];
|
|
571
|
-
j++;
|
|
572
|
-
}
|
|
573
|
-
}
|
|
574
|
-
data['text'] = data1['text'];
|
|
575
|
-
}
|
|
576
538
|
var offset = markerSettings.offset;
|
|
577
539
|
if (!eventArgs.cancel && markerSettings.visible && !isNullOrUndefined(long) && !isNullOrUndefined(lati)) {
|
|
578
540
|
var markerID = _this.maps.element.id + '_LayerIndex_' + layerIndex + '_MarkerIndex_'
|
|
@@ -793,28 +755,6 @@ var Zoom = /** @class */ (function () {
|
|
|
793
755
|
var layer = this.maps.layersCollection[layerIndex];
|
|
794
756
|
var marker = layer.markerSettings[markerIndex];
|
|
795
757
|
if (!isNullOrUndefined(marker) && !isNullOrUndefined(marker.dataSource) && !isNullOrUndefined(marker.dataSource[dataIndex])) {
|
|
796
|
-
if (this.maps.isBlazor) {
|
|
797
|
-
marker.longitudeValuePath = !isNullOrUndefined(marker.longitudeValuePath) ?
|
|
798
|
-
marker.longitudeValuePath : !isNullOrUndefined(marker.dataSource[dataIndex]['Longitude']) ? 'Longitude' :
|
|
799
|
-
!isNullOrUndefined(marker.dataSource[dataIndex]['longitude']) ? 'longitude' : null;
|
|
800
|
-
marker.latitudeValuePath = !isNullOrUndefined(marker.latitudeValuePath) ?
|
|
801
|
-
marker.latitudeValuePath : !isNullOrUndefined(marker.dataSource[dataIndex]['Latitude']) ? 'Latitude' :
|
|
802
|
-
!isNullOrUndefined(marker.dataSource[dataIndex]['latitude']) ? 'latitude' : null;
|
|
803
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
804
|
-
var data1 = {};
|
|
805
|
-
var j = 0;
|
|
806
|
-
var text = [];
|
|
807
|
-
for (var i = 0; i < Object.keys(marker.dataSource[dataIndex]).length; i++) {
|
|
808
|
-
if (Object.keys(marker.dataSource[dataIndex])[i].toLowerCase() !== 'text' && Object.keys(marker.dataSource[dataIndex])[i].toLowerCase() !== 'longitude'
|
|
809
|
-
&& Object.keys(marker.dataSource[dataIndex])[i].toLowerCase() !== 'latitude' && Object.keys(marker.dataSource[dataIndex])[i].toLowerCase() !== 'blazortemplateid'
|
|
810
|
-
&& Object.keys(marker.dataSource[dataIndex])[i].toLowerCase() !== 'name') {
|
|
811
|
-
data1['text'] = text;
|
|
812
|
-
text[j] = marker.dataSource[dataIndex][Object.keys(marker.dataSource[dataIndex])[i].toLowerCase()];
|
|
813
|
-
j++;
|
|
814
|
-
}
|
|
815
|
-
}
|
|
816
|
-
marker.dataSource[dataIndex]['text'] = data1['text'];
|
|
817
|
-
}
|
|
818
758
|
var lng = (!isNullOrUndefined(marker.longitudeValuePath)) ?
|
|
819
759
|
Number(getValueFromObject(marker.dataSource[dataIndex], marker.longitudeValuePath)) :
|
|
820
760
|
!isNullOrUndefined(marker.dataSource[dataIndex]['longitude']) ? parseFloat(marker.dataSource[dataIndex]['longitude']) :
|
|
@@ -852,9 +792,20 @@ var Zoom = /** @class */ (function () {
|
|
|
852
792
|
}
|
|
853
793
|
else {
|
|
854
794
|
if (type === 'Template') {
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
795
|
+
if (duration > 0) {
|
|
796
|
+
location_2.x = ((Math.abs(this.maps.baseMapRectBounds['min']['x'] - location_2.x)) * scale);
|
|
797
|
+
location_2.y = ((Math.abs(this.maps.baseMapRectBounds['min']['y'] - location_2.y)) * scale);
|
|
798
|
+
var layerOffset = getElementByID(this.maps.element.id + '_Layer_Collections').getBoundingClientRect();
|
|
799
|
+
var elementOffset = element.parentElement.getBoundingClientRect();
|
|
800
|
+
element.style.left = (((location_2.x) + (layerOffset.left - elementOffset.left)) + marker.offset.x) + 'px';
|
|
801
|
+
element.style.top = (((location_2.y) + (layerOffset.top - elementOffset.top)) + marker.offset.y) + 'px';
|
|
802
|
+
element.style.transform = 'translate(-50%, -50%)';
|
|
803
|
+
}
|
|
804
|
+
else {
|
|
805
|
+
var elementOffset = element.getBoundingClientRect();
|
|
806
|
+
element.style.left = ((location_2.x + x) * scale) + marker.offset.x - this.maps.mapAreaRect.x - (elementOffset.width / 2) + 'px';
|
|
807
|
+
element.style.top = ((location_2.y + y) * scale) + marker.offset.y - this.maps.mapAreaRect.y - (elementOffset.height / 2) + 'px';
|
|
808
|
+
}
|
|
858
809
|
}
|
|
859
810
|
else {
|
|
860
811
|
location_2.x = (((location_2.x + x) * scale) + marker.offset.x);
|
|
@@ -898,7 +849,7 @@ var Zoom = /** @class */ (function () {
|
|
|
898
849
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
899
850
|
var location_3 = this.maps.getGeoLocation(this.maps.layersCollection.length - 1, mouseLocation['layerX'], mouseLocation['layerY']);
|
|
900
851
|
panArgs = {
|
|
901
|
-
cancel: false, name: pan, maps:
|
|
852
|
+
cancel: false, name: pan, maps: map,
|
|
902
853
|
tileTranslatePoint: {}, translatePoint: { previous: translatePoint, current: new Point(x, y) },
|
|
903
854
|
scale: map.scale, tileZoomLevel: map.tileZoomLevel, latitude: location_3['latitude'], longitude: location_3['longitude']
|
|
904
855
|
};
|
|
@@ -935,7 +886,7 @@ var Zoom = /** @class */ (function () {
|
|
|
935
886
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
936
887
|
var location_4 = this.maps.getTileGeoLocation(mouseLocation['layerX'], mouseLocation['layerY']);
|
|
937
888
|
panArgs = {
|
|
938
|
-
cancel: false, name: pan, maps:
|
|
889
|
+
cancel: false, name: pan, maps: map,
|
|
939
890
|
tileTranslatePoint: { previous: prevTilePoint, current: map.tileTranslatePoint },
|
|
940
891
|
translatePoint: { previous: translatePoint, current: map.translatePoint }, scale: map.scale,
|
|
941
892
|
tileZoomLevel: map.tileZoomLevel, latitude: location_4['latitude'], longitude: location_4['longitude']
|
package/src/maps/utils/enum.d.ts
CHANGED
|
@@ -36,7 +36,11 @@ export declare type MapsTheme =
|
|
|
36
36
|
/** Renders a map with Tailwind theme. */
|
|
37
37
|
'Tailwind' |
|
|
38
38
|
/** Renders a map with TailwindDark theme. */
|
|
39
|
-
'TailwindDark'
|
|
39
|
+
'TailwindDark' |
|
|
40
|
+
/** Renders a map with Bootstrap5 theme. */
|
|
41
|
+
'Bootstrap5' |
|
|
42
|
+
/** Render a map with Bootstrap5 dark theme. */
|
|
43
|
+
'Bootstrap5Dark';
|
|
40
44
|
/**
|
|
41
45
|
* Defines the position of the legend.
|
|
42
46
|
*/
|
|
@@ -742,7 +742,7 @@ export declare function getRatioOfBubble(min: number, max: number, value: number
|
|
|
742
742
|
* @param {string} type - Specifies the type
|
|
743
743
|
* @returns {any} - Specifies the object
|
|
744
744
|
*/
|
|
745
|
-
export declare function findMidPointOfPolygon(points: MapLocation[], type: string): any;
|
|
745
|
+
export declare function findMidPointOfPolygon(points: MapLocation[], type: string, geometryType?: string): any;
|
|
746
746
|
/**
|
|
747
747
|
* Check custom path
|
|
748
748
|
*
|
package/src/maps/utils/helper.js
CHANGED
|
@@ -641,7 +641,7 @@ export function renderTextElement(option, style, color, parent, isMinus) {
|
|
|
641
641
|
'opacity': style.opacity,
|
|
642
642
|
'dominant-baseline': option.baseLine
|
|
643
643
|
};
|
|
644
|
-
var text = typeof option.text === 'string' ? option.text : isMinus ? option.text[option.text.length - 1] : option.text[0];
|
|
644
|
+
var text = typeof option.text === 'string' || typeof option.text === 'number' ? option.text : isMinus ? option.text[option.text.length - 1] : option.text[0];
|
|
645
645
|
var tspanElement;
|
|
646
646
|
var renderer = new SvgRenderer('');
|
|
647
647
|
var height;
|
|
@@ -1762,7 +1762,7 @@ export function getRatioOfBubble(min, max, value, minValue, maxValue) {
|
|
|
1762
1762
|
* @returns {any} - Specifies the object
|
|
1763
1763
|
*/
|
|
1764
1764
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1765
|
-
export function findMidPointOfPolygon(points, type) {
|
|
1765
|
+
export function findMidPointOfPolygon(points, type, geometryType) {
|
|
1766
1766
|
if (!points.length) {
|
|
1767
1767
|
return null;
|
|
1768
1768
|
}
|
|
@@ -1777,14 +1777,14 @@ export function findMidPointOfPolygon(points, type) {
|
|
|
1777
1777
|
var ySum = 0;
|
|
1778
1778
|
for (var i = min; i <= max - 1; i++) {
|
|
1779
1779
|
startX = points[i].x;
|
|
1780
|
-
startY = type === 'Mercator' ? points[i].y : -(points[i].y);
|
|
1780
|
+
startY = type === 'Mercator' || geometryType === 'Normal' ? points[i].y : -(points[i].y);
|
|
1781
1781
|
if (i === max - 1) {
|
|
1782
1782
|
startX1 = points[0].x;
|
|
1783
|
-
startY1 = type === 'Mercator' ? points[0].y : -(points[0].y);
|
|
1783
|
+
startY1 = type === 'Mercator' || geometryType === 'Normal' ? points[0].y : -(points[0].y);
|
|
1784
1784
|
}
|
|
1785
1785
|
else {
|
|
1786
1786
|
startX1 = points[i + 1].x;
|
|
1787
|
-
startY1 = type === 'Mercator' ? points[i + 1].y : -(points[i + 1].y);
|
|
1787
|
+
startY1 = type === 'Mercator' || geometryType === 'Normal' ? points[i + 1].y : -(points[i + 1].y);
|
|
1788
1788
|
}
|
|
1789
1789
|
sum = sum + Math.abs(((startX * startY1)) - (startX1 * startY));
|
|
1790
1790
|
xSum = xSum + Math.abs(((startX + startX1) * (((startX * startY1) - (startX1 * startY)))));
|
|
@@ -1805,7 +1805,7 @@ export function findMidPointOfPolygon(points, type) {
|
|
|
1805
1805
|
var height = 0;
|
|
1806
1806
|
for (var i = min; i <= max - 1; i++) {
|
|
1807
1807
|
var point = points[i];
|
|
1808
|
-
point.y = type === 'Mercator' ? point.y : -(point.y);
|
|
1808
|
+
point.y = type === 'Mercator' || geometryType === 'Normal' ? point.y : -(point.y);
|
|
1809
1809
|
if (point.y > ySum) {
|
|
1810
1810
|
if (point.x < xSum && xSum - point.x < xSum - bottomMinPoint.x) {
|
|
1811
1811
|
bottomMinPoint = { x: point.x, y: point.y };
|