@syncfusion/ej2-maps 19.4.56 → 19.4.57-105067
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 +18 -3
- package/.github/PULL_REQUEST_TEMPLATE/Bug.md +72 -72
- package/.github/PULL_REQUEST_TEMPLATE/Feature.md +49 -49
- package/CHANGELOG.md +441 -439
- package/README.md +73 -73
- package/dist/ej2-maps.umd.min.js +1 -10
- package/dist/ej2-maps.umd.min.js.map +1 -1
- package/dist/es6/ej2-maps.es2015.js +1161 -638
- package/dist/es6/ej2-maps.es2015.js.map +1 -1
- package/dist/es6/ej2-maps.es5.js +1200 -678
- package/dist/es6/ej2-maps.es5.js.map +1 -1
- package/dist/global/ej2-maps.min.js +1 -10
- package/dist/global/ej2-maps.min.js.map +1 -1
- package/dist/global/index.d.ts +0 -9
- package/dist/ts/maps/layers/bing-map.ts +50 -0
- package/dist/ts/maps/layers/bubble.ts +290 -0
- package/dist/ts/maps/layers/color-mapping.ts +226 -0
- package/dist/ts/maps/layers/data-label.ts +418 -0
- package/dist/ts/maps/layers/layer-panel.ts +1480 -0
- package/dist/ts/maps/layers/legend.ts +2236 -0
- package/dist/ts/maps/layers/marker.ts +453 -0
- package/dist/ts/maps/layers/navigation-selected-line.ts +167 -0
- package/dist/ts/maps/maps.ts +2886 -0
- package/dist/ts/maps/model/base.ts +1843 -0
- package/dist/ts/maps/model/constants.ts +200 -0
- package/dist/ts/maps/model/export-image.ts +178 -0
- package/dist/ts/maps/model/export-pdf.ts +170 -0
- package/dist/ts/maps/model/interface.ts +823 -0
- package/dist/ts/maps/model/print.ts +104 -0
- package/dist/ts/maps/model/theme.ts +554 -0
- package/dist/ts/maps/user-interaction/annotation.ts +127 -0
- package/dist/ts/maps/user-interaction/highlight.ts +233 -0
- package/dist/ts/maps/user-interaction/selection.ts +321 -0
- package/dist/ts/maps/user-interaction/tooltip.ts +387 -0
- package/dist/ts/maps/user-interaction/zoom.ts +1767 -0
- package/dist/ts/maps/utils/enum.ts +368 -0
- package/dist/ts/maps/utils/helper.ts +3421 -0
- package/helper/e2e/index.js +3 -3
- package/helper/e2e/maps-helper.js +13 -13
- package/license +9 -9
- package/package.json +85 -85
- package/src/maps/layers/bing-map.d.ts +4 -0
- package/src/maps/layers/bing-map.js +16 -3
- package/src/maps/layers/bubble.d.ts +1 -2
- package/src/maps/layers/bubble.js +7 -12
- package/src/maps/layers/data-label.d.ts +1 -4
- package/src/maps/layers/data-label.js +32 -35
- package/src/maps/layers/layer-panel.d.ts +18 -1
- package/src/maps/layers/layer-panel.js +226 -72
- package/src/maps/layers/legend.d.ts +5 -2
- package/src/maps/layers/legend.js +170 -61
- package/src/maps/layers/marker.d.ts +2 -4
- package/src/maps/layers/marker.js +49 -48
- package/src/maps/layers/navigation-selected-line.d.ts +1 -2
- package/src/maps/layers/navigation-selected-line.js +7 -13
- package/src/maps/maps-model.d.ts +259 -251
- package/src/maps/maps.d.ts +24 -3
- package/src/maps/maps.js +152 -90
- package/src/maps/model/base-model.d.ts +1025 -1021
- package/src/maps/model/base.d.ts +5 -1
- package/src/maps/model/base.js +24 -24
- package/src/maps/model/constants.d.ts +6 -0
- package/src/maps/model/constants.js +6 -0
- package/src/maps/model/export-image.d.ts +2 -4
- package/src/maps/model/export-image.js +26 -32
- package/src/maps/model/export-pdf.d.ts +4 -6
- package/src/maps/model/export-pdf.js +27 -35
- package/src/maps/model/interface.d.ts +34 -26
- package/src/maps/model/print.d.ts +2 -5
- package/src/maps/model/print.js +33 -21
- package/src/maps/model/theme.js +7 -4
- package/src/maps/user-interaction/annotation.d.ts +1 -2
- package/src/maps/user-interaction/annotation.js +3 -4
- package/src/maps/user-interaction/highlight.d.ts +1 -2
- package/src/maps/user-interaction/highlight.js +11 -10
- package/src/maps/user-interaction/selection.d.ts +1 -2
- package/src/maps/user-interaction/selection.js +42 -19
- package/src/maps/user-interaction/tooltip.d.ts +3 -5
- package/src/maps/user-interaction/tooltip.js +27 -14
- package/src/maps/user-interaction/zoom.d.ts +3 -8
- package/src/maps/user-interaction/zoom.js +282 -162
- package/src/maps/utils/enum.d.ts +5 -1
- package/src/maps/utils/helper.d.ts +1 -1
- package/src/maps/utils/helper.js +62 -31
package/src/maps/maps.d.ts
CHANGED
|
@@ -248,11 +248,18 @@ export declare class Maps extends Component<HTMLElement> implements INotifyPrope
|
|
|
248
248
|
*/
|
|
249
249
|
loaded: EmitType<ILoadedEventArgs>;
|
|
250
250
|
/**
|
|
251
|
-
* Triggers when
|
|
251
|
+
* Triggers when a user clicks on an element in Maps.
|
|
252
252
|
*
|
|
253
253
|
* @event click
|
|
254
|
+
* @deprecated
|
|
254
255
|
*/
|
|
255
256
|
click: EmitType<IMouseEventArgs>;
|
|
257
|
+
/**
|
|
258
|
+
* Triggers when a user clicks on an element in Maps.
|
|
259
|
+
*
|
|
260
|
+
* @event onclick
|
|
261
|
+
*/
|
|
262
|
+
onclick: EmitType<IMouseEventArgs>;
|
|
256
263
|
/**
|
|
257
264
|
* Triggers when performing the double click operation on an element in maps.
|
|
258
265
|
*
|
|
@@ -281,13 +288,13 @@ export declare class Maps extends Component<HTMLElement> implements INotifyPrope
|
|
|
281
288
|
* Triggers before the legend gets rendered.
|
|
282
289
|
*
|
|
283
290
|
* @event legendRendering
|
|
284
|
-
|
|
291
|
+
* @deprecated
|
|
285
292
|
*/
|
|
286
293
|
legendRendering: EmitType<ILegendRenderingEventArgs>;
|
|
287
294
|
/**
|
|
288
295
|
* Triggers after the maps tooltip gets rendered.
|
|
289
296
|
*
|
|
290
|
-
|
|
297
|
+
* @deprecated
|
|
291
298
|
* @event tooltipRenderComplete
|
|
292
299
|
*/
|
|
293
300
|
tooltipRenderComplete: EmitType<ITooltipRenderCompleteEventArgs>;
|
|
@@ -437,6 +444,12 @@ export declare class Maps extends Component<HTMLElement> implements INotifyPrope
|
|
|
437
444
|
* @private
|
|
438
445
|
*/
|
|
439
446
|
availableSize: Size;
|
|
447
|
+
/**
|
|
448
|
+
* whether it is layer add or not.
|
|
449
|
+
*
|
|
450
|
+
* @private
|
|
451
|
+
*/
|
|
452
|
+
isAddLayer: boolean;
|
|
440
453
|
/**
|
|
441
454
|
* Specifies the localization object.
|
|
442
455
|
*
|
|
@@ -818,6 +831,7 @@ export declare class Maps extends Component<HTMLElement> implements INotifyPrope
|
|
|
818
831
|
* @param {PointerEvent} e - Specifies the pointer event on maps.
|
|
819
832
|
*/
|
|
820
833
|
mapsOnClick(e: PointerEvent): void;
|
|
834
|
+
private clickHandler;
|
|
821
835
|
private triggerShapeSelection;
|
|
822
836
|
private getClickLocation;
|
|
823
837
|
/**
|
|
@@ -1024,6 +1038,13 @@ export declare class Maps extends Component<HTMLElement> implements INotifyPrope
|
|
|
1024
1038
|
* @returns {Promise<string>} - Returns the string value.
|
|
1025
1039
|
*/
|
|
1026
1040
|
export(type: ExportType, fileName: string, orientation?: PdfPageOrientation, allowDownload?: boolean): Promise<string>;
|
|
1041
|
+
/**
|
|
1042
|
+
* This method is used to get the Bing maps URL.
|
|
1043
|
+
*
|
|
1044
|
+
* @param {string} url - Specifies the URL of the maps.
|
|
1045
|
+
* @returns {Promise<string>} - Returns the processed Bing URL as Promise.
|
|
1046
|
+
*/
|
|
1047
|
+
getBingUrlTemplate(url: string): Promise<string>;
|
|
1027
1048
|
/**
|
|
1028
1049
|
* To find visibility of layers and markers for required modules load.
|
|
1029
1050
|
*
|
package/src/maps/maps.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
var __extends = (this && this.__extends) || (function () {
|
|
2
|
-
var extendStatics = function (d, b) {
|
|
3
|
-
extendStatics = Object.setPrototypeOf ||
|
|
4
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
6
|
-
return extendStatics(d, b);
|
|
7
|
-
};
|
|
8
|
-
return function (d, b) {
|
|
9
|
-
extendStatics(d, b);
|
|
10
|
-
function __() { this.constructor = d; }
|
|
11
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
12
|
-
};
|
|
13
|
-
})();
|
|
14
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
15
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
16
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
17
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
18
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
19
|
-
};
|
|
1
|
+
var __extends = (this && this.__extends) || (function () {
|
|
2
|
+
var extendStatics = function (d, b) {
|
|
3
|
+
extendStatics = Object.setPrototypeOf ||
|
|
4
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
+
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
6
|
+
return extendStatics(d, b);
|
|
7
|
+
};
|
|
8
|
+
return function (d, b) {
|
|
9
|
+
extendStatics(d, b);
|
|
10
|
+
function __() { this.constructor = d; }
|
|
11
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
12
|
+
};
|
|
13
|
+
})();
|
|
14
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
15
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
16
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
17
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
18
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
19
|
+
};
|
|
20
20
|
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
|
21
21
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
22
22
|
/* eslint-disable radix */
|
|
@@ -35,8 +35,8 @@ import { createStyle } from './utils/helper';
|
|
|
35
35
|
import { ZoomSettings, LegendSettings } from './model/base';
|
|
36
36
|
import { LayerSettings, TitleSettings, Border, Margin, MapsAreaSettings, Annotation, CenterPosition } from './model/base';
|
|
37
37
|
import { Marker } from './layers/marker';
|
|
38
|
-
import { load, click, loaded, doubleClick, resize, shapeSelected, zoomIn } from './model/constants';
|
|
39
|
-
import { getThemeStyle } from './model/theme';
|
|
38
|
+
import { load, click, onclick, loaded, doubleClick, resize, shapeSelected, zoomIn } from './model/constants';
|
|
39
|
+
import { getThemeStyle, Theme } from './model/theme';
|
|
40
40
|
import { BingMap } from './layers/bing-map';
|
|
41
41
|
import { LayerPanel } from './layers/layer-panel';
|
|
42
42
|
import { Rect, RectOption, measureText, getElementByID, MapAjax, processResult, getElementsByClassName } from '../maps/utils/helper';
|
|
@@ -75,6 +75,10 @@ var Maps = /** @class */ (function (_super) {
|
|
|
75
75
|
* Resize the map
|
|
76
76
|
*/
|
|
77
77
|
_this.isResize = false;
|
|
78
|
+
/**
|
|
79
|
+
* @private
|
|
80
|
+
*/
|
|
81
|
+
_this.isReset = false;
|
|
78
82
|
/** @private */
|
|
79
83
|
_this.baseSize = new Size(0, 0);
|
|
80
84
|
/** @public */
|
|
@@ -232,6 +236,7 @@ var Maps = /** @class */ (function (_super) {
|
|
|
232
236
|
this.renderArea();
|
|
233
237
|
this.processRequestJsonData();
|
|
234
238
|
this.renderComplete();
|
|
239
|
+
this.isAddLayer = !this.isTileMap ? false : this.isAddLayer;
|
|
235
240
|
};
|
|
236
241
|
/**
|
|
237
242
|
* To Initialize the control rendering.
|
|
@@ -374,16 +379,7 @@ var Maps = /** @class */ (function (_super) {
|
|
|
374
379
|
};
|
|
375
380
|
Maps.prototype.renderMap = function () {
|
|
376
381
|
if (this.legendModule && this.legendSettings.visible) {
|
|
377
|
-
|
|
378
|
-
this.legendModule.renderLegend();
|
|
379
|
-
}
|
|
380
|
-
else {
|
|
381
|
-
var layerCount = this.layersCollection.length - 1;
|
|
382
|
-
if (!this.layersCollection[layerCount].isBaseLayer) {
|
|
383
|
-
this.isTileMapSubLayer = true;
|
|
384
|
-
this.legendModule.renderLegend();
|
|
385
|
-
}
|
|
386
|
-
}
|
|
382
|
+
this.legendModule.renderLegend();
|
|
387
383
|
}
|
|
388
384
|
this.createTile();
|
|
389
385
|
if (this.zoomSettings.enable && this.zoomModule) {
|
|
@@ -394,7 +390,9 @@ var Maps = /** @class */ (function (_super) {
|
|
|
394
390
|
this.dataLabelShape = [];
|
|
395
391
|
}
|
|
396
392
|
this.mapLayerPanel.measureLayerPanel();
|
|
397
|
-
|
|
393
|
+
if (!isNullOrUndefined(this.svgObject)) {
|
|
394
|
+
this.element.appendChild(this.svgObject);
|
|
395
|
+
}
|
|
398
396
|
var position = this.getExtraPosition();
|
|
399
397
|
for (var i = 0; i < this.layers.length; i++) {
|
|
400
398
|
if (position.x !== 0 || position.y !== 0) {
|
|
@@ -466,12 +464,16 @@ var Maps = /** @class */ (function (_super) {
|
|
|
466
464
|
bottom = svg.bottom - tile.bottom - element.offsetTop;
|
|
467
465
|
top_1 = parseFloat(tileElement.style.top) + element.offsetTop;
|
|
468
466
|
}
|
|
469
|
-
top_1 = (bottom <= 11) ? top_1 : (top_1 * 2);
|
|
470
|
-
left = (bottom <= 11) ? left : (left * 2);
|
|
467
|
+
top_1 = (bottom <= 11) ? top_1 : (!isNullOrUndefined(this.legendModule) && this.legendSettings.position === 'Bottom') ? this.mapAreaRect.y : (top_1 * 2);
|
|
468
|
+
left = (bottom <= 11) ? left : !isNullOrUndefined(this.legendModule) ? left : (left * 2);
|
|
471
469
|
tileElement.style.top = top_1 + 'px';
|
|
472
470
|
tileElement.style.left = left + 'px';
|
|
473
471
|
tileElement1.style.top = top_1 + 'px';
|
|
474
472
|
tileElement1.style.left = left + 'px';
|
|
473
|
+
if (!isNullOrUndefined(this.legendModule) && this.legendModule.totalPages.length > 0) {
|
|
474
|
+
tileElement.style.height = tileElement1.style.height = this.legendModule.legendTotalRect.height + 'px';
|
|
475
|
+
tileElement.style.width = tileElement1.style.width = this.legendModule.legendTotalRect.width + 'px';
|
|
476
|
+
}
|
|
475
477
|
}
|
|
476
478
|
this.arrangeTemplate();
|
|
477
479
|
if (this.annotationsModule) {
|
|
@@ -579,6 +581,7 @@ var Maps = /** @class */ (function (_super) {
|
|
|
579
581
|
*/
|
|
580
582
|
Maps.prototype.addTabIndex = function () {
|
|
581
583
|
this.element.setAttribute('aria-label', this.description || 'Maps Element');
|
|
584
|
+
this.element.setAttribute('role', '');
|
|
582
585
|
this.element.setAttribute('tabindex', this.tabIndex.toString());
|
|
583
586
|
};
|
|
584
587
|
// private setSecondaryElementPosition(): void {
|
|
@@ -597,12 +600,21 @@ var Maps = /** @class */ (function (_super) {
|
|
|
597
600
|
this.zoomModule.layerCollectionEle = getElementByID(this.element.id + '_Layer_Collections');
|
|
598
601
|
}
|
|
599
602
|
if (this.isTileMap && getElementByID(this.element.id + '_Tile_SVG') && getElementByID(this.element.id + '_tile_parent')) {
|
|
600
|
-
var
|
|
601
|
-
var
|
|
603
|
+
var tileElement = getElementByID(this.element.id + '_tile_parent');
|
|
604
|
+
var tileSvgElement = getElementByID(this.element.id + '_Tile_SVG');
|
|
605
|
+
var tileSvgParentElement = getElementByID(this.element.id + '_Tile_SVG_Parent');
|
|
606
|
+
var tileRect = tileElement.getBoundingClientRect();
|
|
607
|
+
var tileSvgRect = tileSvgElement.getBoundingClientRect();
|
|
602
608
|
left = (tileRect.left - tileSvgRect.left);
|
|
603
609
|
top = (tileRect.top - tileSvgRect.top);
|
|
604
|
-
|
|
605
|
-
|
|
610
|
+
tileSvgParentElement.style.left = left + 'px';
|
|
611
|
+
tileSvgParentElement.style.top = top + 'px';
|
|
612
|
+
if (!isNullOrUndefined(this.legendModule) && this.legendModule.totalPages.length > 0) {
|
|
613
|
+
tileElement.style.width = tileSvgElement.style.width = this.legendModule.legendTotalRect.width.toString();
|
|
614
|
+
tileElement.style.height = tileSvgElement.style.height = this.legendModule.legendTotalRect.height.toString();
|
|
615
|
+
tileSvgParentElement.style.width = this.legendModule.legendTotalRect.width + 'px';
|
|
616
|
+
tileSvgParentElement.style.height = this.legendModule.legendTotalRect.height + 'px';
|
|
617
|
+
}
|
|
606
618
|
var markerTemplateElements = document.getElementsByClassName('template');
|
|
607
619
|
if (!isNullOrUndefined(markerTemplateElements) && markerTemplateElements.length > 0) {
|
|
608
620
|
for (var i = 0; i < markerTemplateElements.length; i++) {
|
|
@@ -620,7 +632,7 @@ var Maps = /** @class */ (function (_super) {
|
|
|
620
632
|
if (!isNullOrUndefined(elements) && elements.childElementCount > 0) {
|
|
621
633
|
for (var i = 0; i < elements.childNodes.length; i++) {
|
|
622
634
|
var childElement = elements.childNodes[i];
|
|
623
|
-
if (childElement.tagName === 'g') {
|
|
635
|
+
if (childElement.tagName === 'g' && childElement.id.indexOf('_Legend_Group') == -1) {
|
|
624
636
|
var layerIndex = parseFloat(childElement.id.split('_LayerIndex_')[1].split('_')[0]);
|
|
625
637
|
for (var j = 0; j < childElement.childNodes.length; j++) {
|
|
626
638
|
var childNode = childElement.childNodes[j];
|
|
@@ -634,7 +646,7 @@ var Maps = /** @class */ (function (_super) {
|
|
|
634
646
|
}
|
|
635
647
|
}
|
|
636
648
|
if (this.zoomModule && (this.previousScale !== this.scale)) {
|
|
637
|
-
this.zoomModule.applyTransform(true);
|
|
649
|
+
this.zoomModule.applyTransform(this, true);
|
|
638
650
|
}
|
|
639
651
|
}
|
|
640
652
|
};
|
|
@@ -657,7 +669,7 @@ var Maps = /** @class */ (function (_super) {
|
|
|
657
669
|
}
|
|
658
670
|
var templateElements = document.getElementsByClassName(this.element.id + '_template');
|
|
659
671
|
if (!isNullOrUndefined(templateElements) && templateElements.length > 0 &&
|
|
660
|
-
getElementByID(this.element.id + '_Layer_Collections') && this.
|
|
672
|
+
getElementByID(this.element.id + '_Layer_Collections') && !this.isTileMap) {
|
|
661
673
|
for (var i = 0; i < templateElements.length; i++) {
|
|
662
674
|
var offSetLetValue = 0;
|
|
663
675
|
var offSetTopValue = 0;
|
|
@@ -692,10 +704,7 @@ var Maps = /** @class */ (function (_super) {
|
|
|
692
704
|
var mainLayer = this.layersCollection[0];
|
|
693
705
|
var padding = 0;
|
|
694
706
|
if (mainLayer.isBaseLayer && (mainLayer.layerType === 'OSM' || mainLayer.layerType === 'Bing' ||
|
|
695
|
-
mainLayer.layerType === 'GoogleStaticMap' || mainLayer.layerType === 'Google')) {
|
|
696
|
-
if (mainLayer.layerType === 'Google') {
|
|
697
|
-
mainLayer.urlTemplate = 'https://mt1.google.com/vt/lyrs=m@129&hl=en&x=tileX&y=tileY&z=level';
|
|
698
|
-
}
|
|
707
|
+
mainLayer.layerType === 'GoogleStaticMap' || mainLayer.layerType === 'Google' || (!isNullOrUndefined(mainLayer.urlTemplate) && mainLayer.urlTemplate !== ''))) {
|
|
699
708
|
removeElement(this.element.id + '_tile_parent');
|
|
700
709
|
removeElement(this.element.id + '_tiles');
|
|
701
710
|
removeElement('animated_tiles');
|
|
@@ -743,7 +752,7 @@ var Maps = /** @class */ (function (_super) {
|
|
|
743
752
|
var baseLayer = mainLayers[i];
|
|
744
753
|
if (baseLayer.visible && baseIndex === i) {
|
|
745
754
|
baseLayer.isBaseLayer = true;
|
|
746
|
-
this.isTileMap = (baseLayer.layerType === 'Geometry') ? false : true;
|
|
755
|
+
this.isTileMap = (baseLayer.layerType === 'Geometry' && !isNullOrUndefined(baseLayer.shapeData)) ? false : true;
|
|
747
756
|
this.layersCollection.push(baseLayer);
|
|
748
757
|
break;
|
|
749
758
|
}
|
|
@@ -790,12 +799,19 @@ var Maps = /** @class */ (function (_super) {
|
|
|
790
799
|
* @private
|
|
791
800
|
*/
|
|
792
801
|
Maps.prototype.renderTitle = function (title, type, bounds, groupEle) {
|
|
793
|
-
var style =
|
|
802
|
+
var style = {
|
|
803
|
+
size: title.textStyle.size,
|
|
804
|
+
color: title.textStyle.color,
|
|
805
|
+
fontFamily: title.textStyle.fontFamily,
|
|
806
|
+
fontWeight: title.textStyle.fontWeight,
|
|
807
|
+
fontStyle: title.textStyle.fontStyle,
|
|
808
|
+
opacity: title.textStyle.opacity
|
|
809
|
+
};
|
|
794
810
|
var height;
|
|
795
811
|
var width = Math.abs((this.margin.left + this.margin.right) - this.availableSize.width);
|
|
796
|
-
style.fontFamily =
|
|
812
|
+
style.fontFamily = !isNullOrUndefined(style.fontFamily) ? style.fontFamily : this.themeStyle.fontFamily;
|
|
797
813
|
style.fontWeight = style.fontWeight || this.themeStyle.titleFontWeight;
|
|
798
|
-
style.size = this.themeStyle.titleFontSize
|
|
814
|
+
style.size = type === 'title' ? (style.size || this.themeStyle.titleFontSize) : (style.size || Theme.mapsSubTitleFont.size);
|
|
799
815
|
if (title.text) {
|
|
800
816
|
if (isNullOrUndefined(groupEle)) {
|
|
801
817
|
groupEle = this.renderer.createGroup({ id: this.element.id + '_Title_Group' });
|
|
@@ -808,6 +824,7 @@ var Maps = /** @class */ (function (_super) {
|
|
|
808
824
|
var titleBounds = new Rect(location_1.x, location_1.y, elementSize.width, elementSize.height);
|
|
809
825
|
var element = renderTextElement(options, style, style.color || (type === 'title' ? this.themeStyle.titleFontColor : this.themeStyle.subTitleFontColor), groupEle);
|
|
810
826
|
element.setAttribute('aria-label', this.description || title.text);
|
|
827
|
+
element.setAttribute('role', '');
|
|
811
828
|
if ((type === 'title' && !title.subtitleSettings.text) || (type === 'subtitle')) {
|
|
812
829
|
height = Math.abs((titleBounds.y + this.margin.bottom) - this.availableSize.height);
|
|
813
830
|
this.mapAreaRect = new Rect(this.margin.left, titleBounds.y + 10, width, height - 10);
|
|
@@ -965,6 +982,7 @@ var Maps = /** @class */ (function (_super) {
|
|
|
965
982
|
var id = event.target['id'];
|
|
966
983
|
event.preventDefault();
|
|
967
984
|
if (this.legendModule && (id.indexOf('_Left_Page_Rect') > -1 || id.indexOf('_Right_Page_Rect') > -1)) {
|
|
985
|
+
this.mapAreaRect = this.legendModule.initialMapAreaRect;
|
|
968
986
|
this.legendModule.currentPage = (id.indexOf('_Left_Page_') > -1) ? (this.legendModule.currentPage - 1) :
|
|
969
987
|
(this.legendModule.currentPage + 1);
|
|
970
988
|
this.legendModule.legendGroup = this.renderer.createGroup({ id: this.element.id + '_Legend_Group' });
|
|
@@ -1029,24 +1047,35 @@ var Maps = /** @class */ (function (_super) {
|
|
|
1029
1047
|
latitude: latitude, longitude: longitude,
|
|
1030
1048
|
isShapeSelected: this.SelectedElement(targetEle)
|
|
1031
1049
|
};
|
|
1032
|
-
this.
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
+
if (this.onclick) {
|
|
1051
|
+
eventArgs_1.name = onclick;
|
|
1052
|
+
this.trigger('onclick', eventArgs_1, function (mouseArgs) {
|
|
1053
|
+
_this.clickHandler(e, eventArgs_1, targetEle);
|
|
1054
|
+
});
|
|
1055
|
+
}
|
|
1056
|
+
else {
|
|
1057
|
+
this.trigger('click', eventArgs_1, function (mouseArgs) {
|
|
1058
|
+
_this.clickHandler(e, eventArgs_1, targetEle);
|
|
1059
|
+
});
|
|
1060
|
+
}
|
|
1061
|
+
}
|
|
1062
|
+
};
|
|
1063
|
+
Maps.prototype.clickHandler = function (e, eventArgs, targetEle) {
|
|
1064
|
+
if (targetEle.id.indexOf('shapeIndex') > -1) {
|
|
1065
|
+
this.mergeCluster();
|
|
1066
|
+
if (getElement(this.element.id + '_mapsTooltip') &&
|
|
1067
|
+
this.mapsTooltipModule.tooltipTargetID.indexOf('_MarkerIndex_') > -1) {
|
|
1068
|
+
removeElement(this.element.id + '_mapsTooltip');
|
|
1069
|
+
}
|
|
1070
|
+
}
|
|
1071
|
+
if (this.markerModule) {
|
|
1072
|
+
this.markerModule.markerClusterClick(e);
|
|
1073
|
+
}
|
|
1074
|
+
if (!eventArgs.cancel) {
|
|
1075
|
+
this.notify(click, targetEle);
|
|
1076
|
+
}
|
|
1077
|
+
if (!eventArgs.cancel && targetEle.id.indexOf('shapeIndex') !== -1) {
|
|
1078
|
+
this.triggerShapeSelection(targetEle);
|
|
1050
1079
|
}
|
|
1051
1080
|
};
|
|
1052
1081
|
Maps.prototype.triggerShapeSelection = function (targetEle) {
|
|
@@ -1146,13 +1175,6 @@ var Maps = /** @class */ (function (_super) {
|
|
|
1146
1175
|
latitude = latLongValue.latitude;
|
|
1147
1176
|
longitude = latLongValue.longitude;
|
|
1148
1177
|
}
|
|
1149
|
-
var eventArgs = {
|
|
1150
|
-
cancel: false, name: click, target: targetId, x: e.clientX, y: e.clientY,
|
|
1151
|
-
latitude: latitude, longitude: longitude, isShapeSelected: this.SelectedElement(targetEle)
|
|
1152
|
-
};
|
|
1153
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
1154
|
-
this.trigger('click', eventArgs, function (mouseArgs) {
|
|
1155
|
-
});
|
|
1156
1178
|
}
|
|
1157
1179
|
this.titleTooltip(e, pageX, pageY, true);
|
|
1158
1180
|
if (!isNullOrUndefined(this.legendModule)) {
|
|
@@ -1160,7 +1182,7 @@ var Maps = /** @class */ (function (_super) {
|
|
|
1160
1182
|
}
|
|
1161
1183
|
}
|
|
1162
1184
|
this.notify(Browser.touchEndEvent, e);
|
|
1163
|
-
if (e.cancelable) {
|
|
1185
|
+
if (e.cancelable && !this.isTouch) {
|
|
1164
1186
|
e.preventDefault();
|
|
1165
1187
|
}
|
|
1166
1188
|
return false;
|
|
@@ -1326,14 +1348,14 @@ var Maps = /** @class */ (function (_super) {
|
|
|
1326
1348
|
removeElement(this.element.id + '_EJ2_LegendTitle_Tooltip');
|
|
1327
1349
|
}
|
|
1328
1350
|
if ((targetId === (this.element.id + '_Map_title')) && (event.target.textContent.indexOf('...') > -1)) {
|
|
1329
|
-
showTooltip(this.titleSettings.text, this.titleSettings.textStyle.size, x, y, this.element.offsetWidth, this.element.offsetHeight, this.element.id + '_EJ2_Title_Tooltip', getElement(this.element.id + '_Secondary_Element'), isTouch);
|
|
1351
|
+
showTooltip(this.titleSettings.text, this.titleSettings.textStyle.size || this.themeStyle.titleFontSize, x, y, this.element.offsetWidth, this.element.offsetHeight, this.element.id + '_EJ2_Title_Tooltip', getElement(this.element.id + '_Secondary_Element'), isTouch);
|
|
1330
1352
|
}
|
|
1331
1353
|
else {
|
|
1332
1354
|
removeElement(this.element.id + '_EJ2_Title_Tooltip');
|
|
1333
1355
|
}
|
|
1334
1356
|
};
|
|
1335
1357
|
/*
|
|
1336
|
-
|
|
1358
|
+
|
|
1337
1359
|
/**
|
|
1338
1360
|
* This method is used to perform operations while resizing the window.
|
|
1339
1361
|
*
|
|
@@ -1361,6 +1383,7 @@ var Maps = /** @class */ (function (_super) {
|
|
|
1361
1383
|
_this.refreshing = true;
|
|
1362
1384
|
_this.wireEVents();
|
|
1363
1385
|
_this.render();
|
|
1386
|
+
_this.refreshing = false;
|
|
1364
1387
|
}, 500);
|
|
1365
1388
|
}
|
|
1366
1389
|
}
|
|
@@ -1391,7 +1414,7 @@ var Maps = /** @class */ (function (_super) {
|
|
|
1391
1414
|
this.scale = zoomFactor;
|
|
1392
1415
|
this.translatePoint.x = ((mapRect.left < svgRect.left ? x : 0) + (size.width / 2) - (position.x * zoomFactor)) / zoomFactor;
|
|
1393
1416
|
this.translatePoint.y = ((mapRect.top < svgRect.top ? y : 0) + (size.height / 2) - (position.y * zoomFactor)) / zoomFactor;
|
|
1394
|
-
this.zoomModule.applyTransform();
|
|
1417
|
+
this.zoomModule.applyTransform(this);
|
|
1395
1418
|
}
|
|
1396
1419
|
else {
|
|
1397
1420
|
position = { x: size.width / 2, y: size.height / 2 };
|
|
@@ -1437,8 +1460,10 @@ var Maps = /** @class */ (function (_super) {
|
|
|
1437
1460
|
* @param {Object} layer - Specifies the layer for the maps.
|
|
1438
1461
|
*/
|
|
1439
1462
|
Maps.prototype.addLayer = function (layer) {
|
|
1440
|
-
|
|
1441
|
-
|
|
1463
|
+
var mapsLayer = this.layers;
|
|
1464
|
+
mapsLayer.push(layer);
|
|
1465
|
+
this.isAddLayer = true;
|
|
1466
|
+
this.layers = mapsLayer;
|
|
1442
1467
|
};
|
|
1443
1468
|
/**
|
|
1444
1469
|
* This method is used to remove a layer from map.
|
|
@@ -1447,8 +1472,9 @@ var Maps = /** @class */ (function (_super) {
|
|
|
1447
1472
|
* @returns {void}
|
|
1448
1473
|
*/
|
|
1449
1474
|
Maps.prototype.removeLayer = function (index) {
|
|
1450
|
-
this.layers
|
|
1451
|
-
|
|
1475
|
+
var mapsLayer = this.layers;
|
|
1476
|
+
mapsLayer.splice(index, 1);
|
|
1477
|
+
this.layers = mapsLayer;
|
|
1452
1478
|
};
|
|
1453
1479
|
/**
|
|
1454
1480
|
* This method is used to add markers dynamically in the maps.
|
|
@@ -1467,7 +1493,7 @@ var Maps = /** @class */ (function (_super) {
|
|
|
1467
1493
|
this.layersCollection[layerIndex].markerSettings.push(new MarkerSettings(this, 'markerSettings', newMarker));
|
|
1468
1494
|
}
|
|
1469
1495
|
var markerModule = new Marker(this);
|
|
1470
|
-
markerModule.markerRender(layerEle, layerIndex, this.mapLayerPanel['currentFactor'], 'AddMarker');
|
|
1496
|
+
markerModule.markerRender(this, layerEle, layerIndex, this.mapLayerPanel['currentFactor'], 'AddMarker');
|
|
1471
1497
|
this.arrangeTemplate();
|
|
1472
1498
|
}
|
|
1473
1499
|
};
|
|
@@ -1674,7 +1700,8 @@ var Maps = /** @class */ (function (_super) {
|
|
|
1674
1700
|
Zoom: 'Zoom',
|
|
1675
1701
|
ZoomOut: 'Zoom out',
|
|
1676
1702
|
Pan: 'Pan',
|
|
1677
|
-
Reset: 'Reset'
|
|
1703
|
+
Reset: 'Reset',
|
|
1704
|
+
ImageNotFound: 'Image Not Found'
|
|
1678
1705
|
};
|
|
1679
1706
|
};
|
|
1680
1707
|
/**
|
|
@@ -1682,6 +1709,7 @@ var Maps = /** @class */ (function (_super) {
|
|
|
1682
1709
|
*/
|
|
1683
1710
|
Maps.prototype.destroy = function () {
|
|
1684
1711
|
this.unWireEVents();
|
|
1712
|
+
_super.prototype.destroy.call(this);
|
|
1685
1713
|
this.shapeSelectionItem = [];
|
|
1686
1714
|
this.toggledShapeElementId = [];
|
|
1687
1715
|
this.toggledLegendId = [];
|
|
@@ -1696,11 +1724,14 @@ var Maps = /** @class */ (function (_super) {
|
|
|
1696
1724
|
this.zoomLabelPositions = [];
|
|
1697
1725
|
this.mouseDownEvent = { x: null, y: null };
|
|
1698
1726
|
this.mouseClickEvent = { x: null, y: null };
|
|
1727
|
+
this.formatFunction = null;
|
|
1728
|
+
//TODO: Calling the below code throws spec issue.
|
|
1729
|
+
//this.renderer = null;
|
|
1730
|
+
this.availableSize = new Size(0, 0);
|
|
1699
1731
|
if (document.getElementById('mapsmeasuretext')) {
|
|
1700
1732
|
document.getElementById('mapsmeasuretext').remove();
|
|
1701
1733
|
}
|
|
1702
1734
|
this.removeSvg();
|
|
1703
|
-
_super.prototype.destroy.call(this);
|
|
1704
1735
|
};
|
|
1705
1736
|
/**
|
|
1706
1737
|
* Gets component name
|
|
@@ -1733,6 +1764,7 @@ var Maps = /** @class */ (function (_super) {
|
|
|
1733
1764
|
Maps.prototype.onPropertyChanged = function (newProp, oldProp) {
|
|
1734
1765
|
var render = false;
|
|
1735
1766
|
var isMarker = false;
|
|
1767
|
+
var isLayer = false;
|
|
1736
1768
|
var isStaticMapType = false;
|
|
1737
1769
|
var layerEle;
|
|
1738
1770
|
if (newProp['layers']) {
|
|
@@ -1753,13 +1785,18 @@ var Maps = /** @class */ (function (_super) {
|
|
|
1753
1785
|
case 'legendSettings':
|
|
1754
1786
|
case 'baseLayerIndex':
|
|
1755
1787
|
if (prop === 'layers') {
|
|
1788
|
+
isLayer = true;
|
|
1756
1789
|
var layerPropLength = Object.keys(newProp.layers).length;
|
|
1757
1790
|
for (var x = 0; x < layerPropLength; x++) {
|
|
1758
1791
|
if (!isNullOrUndefined(newProp.layers[x])) {
|
|
1759
1792
|
var collection = Object.keys(newProp.layers[x]);
|
|
1760
1793
|
for (var _b = 0, collection_1 = collection; _b < collection_1.length; _b++) {
|
|
1761
1794
|
var collectionProp = collection_1[_b];
|
|
1762
|
-
if (collectionProp === '
|
|
1795
|
+
if ((collectionProp === 'layerType' && newProp.layers[x].layerType !== 'Geometry') || (isNullOrUndefined(this.layers[x].shapeData)
|
|
1796
|
+
&& !isNullOrUndefined(this.layers[x].urlTemplate) && this.layers[x].urlTemplate !== '')) {
|
|
1797
|
+
this.isReset = true;
|
|
1798
|
+
}
|
|
1799
|
+
else if (collectionProp === 'markerSettings') {
|
|
1763
1800
|
isMarker = true;
|
|
1764
1801
|
}
|
|
1765
1802
|
else if (collectionProp === 'staticMapType') {
|
|
@@ -1773,7 +1810,7 @@ var Maps = /** @class */ (function (_super) {
|
|
|
1773
1810
|
break;
|
|
1774
1811
|
case 'zoomSettings':
|
|
1775
1812
|
if (!isNullOrUndefined(oldProp.zoomSettings)) {
|
|
1776
|
-
if (newProp.zoomSettings.zoomFactor !== oldProp.zoomSettings.zoomFactor) {
|
|
1813
|
+
if (newProp.zoomSettings.zoomFactor !== oldProp.zoomSettings.zoomFactor && !isLayer) {
|
|
1777
1814
|
render = false;
|
|
1778
1815
|
}
|
|
1779
1816
|
else if (newProp.zoomSettings.shouldZoomInitially !== oldProp.zoomSettings.shouldZoomInitially) {
|
|
@@ -2010,7 +2047,7 @@ var Maps = /** @class */ (function (_super) {
|
|
|
2010
2047
|
*/
|
|
2011
2048
|
Maps.prototype.print = function (id) {
|
|
2012
2049
|
if ((this.allowPrint) && (this.printModule)) {
|
|
2013
|
-
this.printModule.print(id);
|
|
2050
|
+
this.printModule.print(this, id);
|
|
2014
2051
|
}
|
|
2015
2052
|
};
|
|
2016
2053
|
/**
|
|
@@ -2029,16 +2066,38 @@ var Maps = /** @class */ (function (_super) {
|
|
|
2029
2066
|
}
|
|
2030
2067
|
if ((type !== 'PDF') && (this.allowImageExport) && (this.imageExportModule)) {
|
|
2031
2068
|
return new Promise(function (resolve, reject) {
|
|
2032
|
-
resolve(_this.imageExportModule.export(type, fileName, allowDownload));
|
|
2069
|
+
resolve(_this.imageExportModule.export(_this, type, fileName, allowDownload));
|
|
2033
2070
|
});
|
|
2034
2071
|
}
|
|
2035
2072
|
else if ((this.allowPdfExport) && (this.pdfExportModule)) {
|
|
2036
2073
|
return new Promise(function (resolve, reject) {
|
|
2037
|
-
resolve(_this.pdfExportModule.export(type, fileName, allowDownload, orientation));
|
|
2074
|
+
resolve(_this.pdfExportModule.export(_this, type, fileName, allowDownload, orientation));
|
|
2038
2075
|
});
|
|
2039
2076
|
}
|
|
2040
2077
|
return null;
|
|
2041
2078
|
};
|
|
2079
|
+
/**
|
|
2080
|
+
* This method is used to get the Bing maps URL.
|
|
2081
|
+
*
|
|
2082
|
+
* @param {string} url - Specifies the URL of the maps.
|
|
2083
|
+
* @returns {Promise<string>} - Returns the processed Bing URL as Promise.
|
|
2084
|
+
*/
|
|
2085
|
+
Maps.prototype.getBingUrlTemplate = function (url) {
|
|
2086
|
+
var promise = new Promise(function (resolve, reject) {
|
|
2087
|
+
var ajax = new Ajax({
|
|
2088
|
+
url: url
|
|
2089
|
+
});
|
|
2090
|
+
ajax.onSuccess = function (json) {
|
|
2091
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2092
|
+
var jsonObject = JSON.parse(json);
|
|
2093
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2094
|
+
var resource = jsonObject['resourceSets'][0]['resources'][0];
|
|
2095
|
+
resolve(resource['imageUrl']);
|
|
2096
|
+
};
|
|
2097
|
+
ajax.send();
|
|
2098
|
+
});
|
|
2099
|
+
return promise;
|
|
2100
|
+
};
|
|
2042
2101
|
/**
|
|
2043
2102
|
* To find visibility of layers and markers for required modules load.
|
|
2044
2103
|
*
|
|
@@ -2247,6 +2306,9 @@ var Maps = /** @class */ (function (_super) {
|
|
|
2247
2306
|
__decorate([
|
|
2248
2307
|
Event()
|
|
2249
2308
|
], Maps.prototype, "click", void 0);
|
|
2309
|
+
__decorate([
|
|
2310
|
+
Event()
|
|
2311
|
+
], Maps.prototype, "onclick", void 0);
|
|
2250
2312
|
__decorate([
|
|
2251
2313
|
Event()
|
|
2252
2314
|
], Maps.prototype, "doubleClick", void 0);
|