@syncfusion/ej2-maps 19.4.38 → 19.4.42

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.
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 19.4.38
3
+ * version : 19.4.42
4
4
  * Copyright Syncfusion Inc. 2001 - 2020. 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@16.34.3",
3
+ "_id": "@syncfusion/ej2-maps@19.4.38",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-9o+tvn3s5jwKMJdz4hJ07bREhH0HvZvIYHC7pT0z6MT0+fkDn7JW3H/KZdKinOVabqE1K02qzUb4Vrf9q0c3IQ==",
5
+ "_integrity": "sha512-xf9oJZL2/pVspVWQuwHj5TV/3bOONNCrZSWd3Ch8Ytc0STAtZyk14/h7cSjLe6dpL4Zp2JSmHIIxPhS1/q67Wg==",
6
6
  "_location": "/@syncfusion/ej2-maps",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -23,8 +23,8 @@
23
23
  "/@syncfusion/ej2-react-maps",
24
24
  "/@syncfusion/ej2-vue-maps"
25
25
  ],
26
- "_resolved": "http://nexus.syncfusion.com/repository/ej2-release/@syncfusion/ej2-maps/-/ej2-maps-16.34.3.tgz",
27
- "_shasum": "40e2dd046d32774580816d584a69fe8720b62895",
26
+ "_resolved": "http://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-maps/-/ej2-maps-19.4.38.tgz",
27
+ "_shasum": "fc11eb553b86eba1ab721c27f20887f715121469",
28
28
  "_spec": "@syncfusion/ej2-maps@*",
29
29
  "_where": "/jenkins/workspace/automation_release_19.1.0.1-ZPMUBNQ6AUYH6YGEFBPVYMEQLRRW2SLD4XCZ6GATNZJFYJ3RIAOA/packages/included",
30
30
  "author": {
@@ -35,13 +35,13 @@
35
35
  },
36
36
  "bundleDependencies": false,
37
37
  "dependencies": {
38
- "@syncfusion/ej2-base": "~19.4.38",
39
- "@syncfusion/ej2-buttons": "~19.4.38",
38
+ "@syncfusion/ej2-base": "~19.4.42",
39
+ "@syncfusion/ej2-buttons": "~19.4.42",
40
40
  "@syncfusion/ej2-compression": "~19.4.38",
41
- "@syncfusion/ej2-data": "~19.4.38",
41
+ "@syncfusion/ej2-data": "~19.4.42",
42
42
  "@syncfusion/ej2-file-utils": "~19.4.38",
43
- "@syncfusion/ej2-pdf-export": "~19.4.38",
44
- "@syncfusion/ej2-svg-base": "~19.4.38"
43
+ "@syncfusion/ej2-pdf-export": "~19.4.42",
44
+ "@syncfusion/ej2-svg-base": "~19.4.42"
45
45
  },
46
46
  "deprecated": false,
47
47
  "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",
@@ -80,6 +80,6 @@
80
80
  "url": "git+https://github.com/syncfusion/ej2-javascript-ui-controls.git"
81
81
  },
82
82
  "typings": "index.d.ts",
83
- "version": "19.4.38",
83
+ "version": "19.4.42",
84
84
  "sideEffects": false
85
85
  }
@@ -1,5 +1,5 @@
1
1
  import { click, legendRendering } from '../index';
2
- import { Rect, measureText, PathOption, textTrim, removeClass, querySelector, getTemplateFunction, maintainStyleClass, getValueFromObject } from '../utils/helper';
2
+ import { Rect, measureText, PathOption, textTrim, drawBalloon, removeClass, querySelector, getTemplateFunction, maintainStyleClass, getValueFromObject } from '../utils/helper';
3
3
  import { RectOption, Size, TextOption, Point, renderTextElement, drawSymbol, checkPropertyPath, getElement } from '../utils/helper';
4
4
  import { isNullOrUndefined, Browser, EventHandler, remove, extend } from '@syncfusion/ej2-base';
5
5
  /**
@@ -422,6 +422,7 @@ var Legend = /** @class */ (function () {
422
422
  var textOptions;
423
423
  var renderOptions;
424
424
  var render = map.renderer;
425
+ var legendShape = legend.shape;
425
426
  if (page >= 0 && page < this.totalPages.length) {
426
427
  if (querySelector(this.legendGroup.id, this.maps.element.id)) {
427
428
  remove(querySelector(this.legendGroup.id, this.maps.element.id));
@@ -457,7 +458,17 @@ var Legend = /** @class */ (function () {
457
458
  if (i === 0) {
458
459
  this.renderLegendBorder();
459
460
  }
460
- legendElement.appendChild(drawSymbol(shapeLocation, shape, shapeSize, collection['ImageSrc'], renderOptions_1));
461
+ if (legend.type === 'Markers' && legend.useMarkerShape) {
462
+ var legendShapeData = this.legendCollection[collection['idIndex']].data[0];
463
+ var marker = map.layers[legendShapeData['layerIndex']].markerSettings[legendShapeData['markerIndex']];
464
+ legendShape = !isNullOrUndefined(marker.dataSource[legendShapeData['dataIndex']][marker['shapeValuePath']]) && marker.dataSource[legendShapeData['dataIndex']][marker['shapeValuePath']] !== '' ? marker.dataSource[legendShapeData['dataIndex']][marker['shapeValuePath']] : marker.shape;
465
+ }
466
+ if (legendShape === "Balloon") {
467
+ legendElement.appendChild(drawBalloon(map, renderOptions_1, shapeSize, { x: shapeLocation.x, y: (shapeLocation.y + 5) }, 'Legend'));
468
+ }
469
+ else {
470
+ legendElement.appendChild(drawSymbol(shapeLocation, legendShape, shapeSize, collection['ImageSrc'], renderOptions_1));
471
+ }
461
472
  var legendRectSize = collection['Rect']['x'] + collection['Rect']['width'];
462
473
  if (legendRectSize > this.legendBorderRect.width) {
463
474
  var trimmedText = this.legendTextTrim(this.legendBorderRect.width, legendText, legendTextStyle, legendRectSize);
@@ -1276,7 +1287,7 @@ var Legend = /** @class */ (function () {
1276
1287
  }
1277
1288
  else {
1278
1289
  newData.push({ layerIndex: layerIndex, markerIndex: markerIndex, dataIndex: dataIndex, value: legendFill, name: text,
1279
- shape: !isNullOrUndefined(marker.shapeValuePath) ? data[marker.shapeValuePath] : marker.shape });
1290
+ shape: (!isNullOrUndefined(marker.shapeValuePath) && !isNullOrUndefined(data[marker.shapeValuePath]) && data[marker.shapeValuePath] !== '') ? data[marker.shapeValuePath] : (_this.maps.legendSettings.useMarkerShape ? marker.shape : _this.maps.legendSettings.shape) });
1280
1291
  _this.getOverallLegendItemsCollection(text, legendFill, newData, showLegend);
1281
1292
  }
1282
1293
  }
@@ -1662,7 +1673,7 @@ var Legend = /** @class */ (function () {
1662
1673
  shape = this.legendCollection[legendIndex]['data'][i];
1663
1674
  mapElement = this.maps.legendSettings.type === 'Bubbles' ? querySelector(this.maps.element.id + '_LayerIndex_' + shape['layerIndex'] +
1664
1675
  '_BubbleIndex_' + j + '_dataIndex_' + shape['dataIndex'], this.maps.element.id) : querySelector(this.maps.element.id + '_LayerIndex_' + shape['layerIndex'] +
1665
- '_MarkerIndex_' + j + '_dataIndex_' + shape['dataIndex'], this.maps.element.id);
1676
+ '_MarkerIndex_' + shape['markerIndex'] + '_dataIndex_' + shape['dataIndex'], this.maps.element.id);
1666
1677
  if (!isNullOrUndefined(shape['shape']) && shape['shape'] === 'Balloon') {
1667
1678
  mapElement = mapElement.children[0];
1668
1679
  }
@@ -1686,6 +1697,9 @@ var Legend = /** @class */ (function () {
1686
1697
  if (targetEle !== null) {
1687
1698
  legendShapeId = querySelector(this.maps.element.id + '_Legend_Shape_Index_' + legendIndex, this.maps.element.id);
1688
1699
  legendShapeId.setAttribute('fill', '#E5E5E5');
1700
+ if (this.maps.legendSettings.shape === 'HorizontalLine' || this.maps.legendSettings.shape === 'VerticalLine' || this.maps.legendSettings.shape === 'Cross') {
1701
+ legendShapeId.setAttribute('stroke', '#E5E5E5');
1702
+ }
1689
1703
  legendTextId = querySelector(this.maps.element.id + '_Legend_Text_Index_' + legendIndex, this.maps.element.id);
1690
1704
  legendTextId.setAttribute('fill', '#E5E5E5');
1691
1705
  }
@@ -1700,6 +1714,9 @@ var Legend = /** @class */ (function () {
1700
1714
  if (targetEle !== null) {
1701
1715
  legendShapeId = querySelector(this.maps.element.id + '_Legend_Shape_Index_' + legendIndex, this.maps.element.id);
1702
1716
  legendShapeId.setAttribute('fill', this.legendCollection[legendIndex]['fill']);
1717
+ if (this.maps.legendSettings.shape === 'HorizontalLine' || this.maps.legendSettings.shape === 'VerticalLine' || this.maps.legendSettings.shape === 'Cross') {
1718
+ legendShapeId.setAttribute('stroke', this.legendCollection[legendIndex]['fill']);
1719
+ }
1703
1720
  legendTextId = querySelector(this.maps.element.id + '_Legend_Text_Index_' + legendIndex, this.maps.element.id);
1704
1721
  legendTextId.setAttribute('fill', '#757575');
1705
1722
  }
@@ -1784,7 +1801,7 @@ var Legend = /** @class */ (function () {
1784
1801
  targetEle.id.indexOf(this.maps.element.id + '_Legend_Index') !== -1) && this.maps.legendSettings.visible &&
1785
1802
  targetEle.id.indexOf('_Text') === -1) {
1786
1803
  var LegendInteractive = void 0;
1787
- var legendIndex = parseFloat(targetEle.id.substr((this.maps.element.id + '_Legend_Index_').length));
1804
+ var legendIndex = parseFloat(targetEle.id.split(this.maps.element.id + '_Legend_Index_')[1]);
1788
1805
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1789
1806
  var mapdata = void 0;
1790
1807
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -1,4 +1,4 @@
1
- import { Component, NotifyPropertyChanges, INotifyPropertyChanged, Property, Ajax } 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 } from './utils/helper';import { getElement, removeClass, getTranslate, triggerItemSelectionEvent, mergeSeparateCluster, customizeStyle } from './utils/helper';import { createStyle } from './utils/helper';import { ZoomSettings, LegendSettings, Tile } from './model/base';import { LayerSettings, TitleSettings, Border, Margin, MapsAreaSettings, Annotation, CenterPosition } from './model/base';import { ZoomSettingsModel, LegendSettingsModel, LayerSettingsModel, BubbleSettingsModel } 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, rightClick, loaded, doubleClick, resize, shapeSelected, itemSelection, zoomIn } from './model/constants';import { ProjectionType, MapsTheme, PanDirection, TooltipGesture } from './utils/enum';import { getThemeStyle } from './model/theme';import { BingMap } from './layers/bing-map';import { ILoadEventArgs, ILoadedEventArgs, 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 } from '../maps/utils/helper';import { findPosition, textTrim, TextOption, renderTextElement, convertGeoToPoint, calculateZoomLevel } from '../maps/utils/helper';import { Annotations } from '../maps/user-interaction/annotation';import { FontModel, DataLabel, MarkerSettings, IAnnotationRenderingEventArgs } from './index';import { NavigationLineSettingsModel, changeBorderWidth } from './index';import { NavigationLine } from './layers/navigation-selected-line';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, Ajax } 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 } from './utils/helper';import { createStyle } from './utils/helper';import { ZoomSettings, LegendSettings, Tile } from './model/base';import { LayerSettings, TitleSettings, Border, Margin, MapsAreaSettings, Annotation, CenterPosition } from './model/base';import { ZoomSettingsModel, LegendSettingsModel, LayerSettingsModel, BubbleSettingsModel } 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, rightClick, loaded, doubleClick, resize, shapeSelected, itemSelection, zoomIn } from './model/constants';import { ProjectionType, MapsTheme, PanDirection, TooltipGesture } from './utils/enum';import { getThemeStyle } from './model/theme';import { BingMap } from './layers/bing-map';import { ILoadEventArgs, ILoadedEventArgs, 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 } from '../maps/utils/helper';import { findPosition, textTrim, TextOption, renderTextElement, convertGeoToPoint, calculateZoomLevel } from '../maps/utils/helper';import { Annotations } from '../maps/user-interaction/annotation';import { FontModel, DataLabel, MarkerSettings, IAnnotationRenderingEventArgs } from './index';import { NavigationLineSettingsModel, changeBorderWidth } from './index';import { NavigationLine } from './layers/navigation-selected-line';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
  /**
@@ -986,6 +986,10 @@ export declare class Maps extends Component<HTMLElement> implements INotifyPrope
986
986
  * To find navigation line visibility
987
987
  */
988
988
  private isNavigationVisible;
989
+ /**
990
+ * To find space between the secondary element and svg element.
991
+ */
992
+ private getExtraPosition;
989
993
  /**
990
994
  * To find marker visibility
991
995
  */
package/src/maps/maps.js CHANGED
@@ -29,7 +29,7 @@ import { Component, NotifyPropertyChanges, Property, Ajax } from '@syncfusion/ej
29
29
  import { EventHandler, Browser, isNullOrUndefined, createElement, setValue, extend } from '@syncfusion/ej2-base';
30
30
  import { Event, remove, L10n, Collection, Internationalization, Complex } from '@syncfusion/ej2-base';
31
31
  import { SvgRenderer } from '@syncfusion/ej2-svg-base';
32
- import { Size, createSvg, Point, removeElement, triggerShapeEvent, showTooltip, checkShapeDataFields, getMousePosition } from './utils/helper';
32
+ import { Size, createSvg, Point, removeElement, triggerShapeEvent, showTooltip, checkShapeDataFields, getMousePosition, calculateSize } from './utils/helper';
33
33
  import { getElement, removeClass, getTranslate, triggerItemSelectionEvent, mergeSeparateCluster, customizeStyle } from './utils/helper';
34
34
  import { createStyle } from './utils/helper';
35
35
  import { ZoomSettings, LegendSettings } from './model/base';
@@ -395,7 +395,15 @@ var Maps = /** @class */ (function (_super) {
395
395
  }
396
396
  this.mapLayerPanel.measureLayerPanel();
397
397
  this.element.appendChild(this.svgObject);
398
+ var position = this.getExtraPosition();
398
399
  for (var i = 0; i < this.layers.length; i++) {
400
+ if (position.x !== 0 || position.y !== 0) {
401
+ var markerTemplate = document.getElementById(this.element.id + '_LayerIndex_' + i + '_Markers_Template_Group');
402
+ if (!isNullOrUndefined(markerTemplate)) {
403
+ markerTemplate.style.top = this.mapAreaRect.y + position.y + 'px';
404
+ markerTemplate.style.left = this.mapAreaRect.x + position.x + 'px';
405
+ }
406
+ }
399
407
  if (this.layers[i].selectionSettings && this.layers[i].selectionSettings.enable &&
400
408
  this.layers[i].initialShapeSelection.length > 0 && this.checkInitialRender) {
401
409
  var checkSelection = this.layers[i].selectionSettings.enableMultiSelect;
@@ -1235,24 +1243,26 @@ var Maps = /** @class */ (function (_super) {
1235
1243
  var _this = this;
1236
1244
  this.isResize = this.isReset = true;
1237
1245
  var args = {
1246
+ cancel: false,
1238
1247
  name: resize,
1239
1248
  previousSize: this.availableSize,
1240
- currentSize: new Size(0, 0),
1249
+ currentSize: calculateSize(this),
1241
1250
  maps: this
1242
1251
  };
1243
- if (this.resizeTo) {
1244
- clearTimeout(this.resizeTo);
1245
- }
1246
- if (!isNullOrUndefined(this.element) && this.element.classList.contains('e-maps')) {
1247
- this.resizeTo = setTimeout(function () {
1248
- _this.unWireEVents();
1249
- _this.createSVG();
1250
- _this.refreshing = true;
1251
- _this.wireEVents();
1252
- args.currentSize = _this.availableSize;
1253
- _this.trigger(resize, args);
1254
- _this.render();
1255
- }, 500);
1252
+ this.trigger(resize, args);
1253
+ if (!args.cancel) {
1254
+ if (this.resizeTo) {
1255
+ clearTimeout(this.resizeTo);
1256
+ }
1257
+ if (!isNullOrUndefined(this.element) && this.element.classList.contains('e-maps')) {
1258
+ this.resizeTo = setTimeout(function () {
1259
+ _this.unWireEVents();
1260
+ _this.createSVG();
1261
+ _this.refreshing = true;
1262
+ _this.wireEVents();
1263
+ _this.render();
1264
+ }, 500);
1265
+ }
1256
1266
  }
1257
1267
  return false;
1258
1268
  };
@@ -1840,6 +1850,21 @@ var Maps = /** @class */ (function (_super) {
1840
1850
  });
1841
1851
  return isVisible;
1842
1852
  };
1853
+ /**
1854
+ * To find space between the secondary element and svg element.
1855
+ */
1856
+ Maps.prototype.getExtraPosition = function () {
1857
+ var top;
1858
+ var left;
1859
+ var svgElement = getElement(this.element.id + '_svg');
1860
+ if (!isNullOrUndefined(svgElement)) {
1861
+ var svgClientRect = svgElement.getClientRects()[0];
1862
+ var mapsClientRect = (getElement(this.element.id + '_Secondary_Element')).getClientRects()[0];
1863
+ top = svgClientRect.top - mapsClientRect.top;
1864
+ left = svgClientRect.left - mapsClientRect.left;
1865
+ }
1866
+ return new Point(left, top);
1867
+ };
1843
1868
  /**
1844
1869
  * To find marker visibility
1845
1870
  */
@@ -975,6 +975,13 @@ export interface ToggleLegendSettingsModel {
975
975
  */
976
976
  export interface LegendSettingsModel {
977
977
 
978
+ /**
979
+ * Enables or disables to render the legend item based on the shapes from the data source of markers.
980
+ *
981
+ * @default false
982
+ */
983
+ useMarkerShape?: boolean;
984
+
978
985
  /**
979
986
  * Enables or disables the toggle visibility for legend in maps.
980
987
  *
@@ -845,6 +845,12 @@ export declare class ToggleLegendSettings extends ChildProperty<ToggleLegendSett
845
845
  * Sets and gets the options to customize the legend of the maps.
846
846
  */
847
847
  export declare class LegendSettings extends ChildProperty<LegendSettings> {
848
+ /**
849
+ * Enables or disables to render the legend item based on the shapes from the data source of markers.
850
+ *
851
+ * @default false
852
+ */
853
+ useMarkerShape: boolean;
848
854
  /**
849
855
  * Enables or disables the toggle visibility for legend in maps.
850
856
  *
@@ -655,6 +655,9 @@ var LegendSettings = /** @class */ (function (_super) {
655
655
  function LegendSettings() {
656
656
  return _super !== null && _super.apply(this, arguments) || this;
657
657
  }
658
+ __decorate([
659
+ Property(false)
660
+ ], LegendSettings.prototype, "useMarkerShape", void 0);
658
661
  __decorate([
659
662
  Property(false)
660
663
  ], LegendSettings.prototype, "toggleVisibility", void 0);
@@ -109,9 +109,7 @@ export interface ITooltipRenderCompleteEventArgs extends IMapsEventArgs {
109
109
  /**
110
110
  * Specifies the event arguments for the resize event in maps.
111
111
  */
112
- export interface IResizeEventArgs {
113
- /** Defines the name of the event. */
114
- name: string;
112
+ export interface IResizeEventArgs extends IMapsEventArgs {
115
113
  /** Defines the previous size of the maps before the resize event. */
116
114
  previousSize: Size;
117
115
  /** Defines the current size of the maps after the resize event. */
@@ -245,7 +245,9 @@ export declare type LegendShape =
245
245
  /** Specifies the legend shape as a pentagon. */
246
246
  'Pentagon' |
247
247
  /** Specifies the legend shape as a inverted triangle. */
248
- 'InvertedTriangle';
248
+ 'InvertedTriangle' |
249
+ /** Specifies to render the marker shape as balloon on maps. */
250
+ 'Balloon';
249
251
  /**
250
252
  * Defines the legend arrangement in the maps component.
251
253
  */
@@ -31,7 +31,7 @@ export declare function stringToNumber(value: string, containerSize: number): nu
31
31
  * @param {Maps} maps Specifies the maps instance
32
32
  * @returns {void}
33
33
  */
34
- export declare function calculateSize(maps: Maps): void;
34
+ export declare function calculateSize(maps: Maps): Size;
35
35
  /**
36
36
  * Method to create svg for maps.
37
37
  *
@@ -678,7 +678,7 @@ export declare function drawStar(maps: Maps, options: PathOption, size: Size, lo
678
678
  * @returns {Element} - Returns the element
679
679
  * @private
680
680
  */
681
- export declare function drawBalloon(maps: Maps, options: PathOption, size: Size, location: MapLocation, element?: Element): Element;
681
+ export declare function drawBalloon(maps: Maps, options: PathOption, size: Size, location: MapLocation, type: string, element?: Element): Element;
682
682
  /**
683
683
  * Internal rendering of Pattern
684
684
  *
@@ -61,13 +61,15 @@ export function calculateSize(maps) {
61
61
  var containerHeight = maps.element.clientHeight;
62
62
  var containerElementWidth = stringToNumber(maps.element.style.width, containerWidth);
63
63
  var containerElementHeight = stringToNumber(maps.element.style.height, containerHeight);
64
+ var availableSize = new Size(0, 0);
64
65
  if (maps.width === '0px' || maps.width === '0%' || maps.height === '0%' || maps.height === '0px') {
65
- maps.availableSize = new Size(0, 0);
66
+ availableSize = new Size(0, 0);
66
67
  }
67
68
  else {
68
- maps.availableSize = new Size(stringToNumber(maps.width, containerWidth) || containerWidth || containerElementWidth || 600, stringToNumber(maps.height, containerHeight) || containerHeight || containerElementHeight || (maps.isDevice ?
69
+ availableSize = new Size(stringToNumber(maps.width, containerWidth) || containerWidth || containerElementWidth || 600, stringToNumber(maps.height, containerHeight) || containerHeight || containerElementHeight || (maps.isDevice ?
69
70
  Math.min(window.innerWidth, window.innerHeight) : 450));
70
71
  }
72
+ return availableSize;
71
73
  }
72
74
  /**
73
75
  * Method to create svg for maps.
@@ -77,7 +79,7 @@ export function calculateSize(maps) {
77
79
  */
78
80
  export function createSvg(maps) {
79
81
  maps.renderer = new SvgRenderer(maps.element.id);
80
- calculateSize(maps);
82
+ maps.availableSize = calculateSize(maps);
81
83
  maps.svgObject = maps.renderer.createSvg({
82
84
  id: maps.element.id + '_svg',
83
85
  width: maps.availableSize.width,
@@ -876,7 +878,7 @@ export function markerShapeChoose(eventArgs, data) {
876
878
  var shape = ((eventArgs.shapeValuePath.indexOf('.') > -1) ?
877
879
  (getValueFromObject(data, eventArgs.shapeValuePath).toString()) :
878
880
  data[eventArgs.shapeValuePath]);
879
- eventArgs.shape = shape;
881
+ eventArgs.shape = (shape.toString() !== "") ? shape : eventArgs.shape;
880
882
  if (data[eventArgs.shapeValuePath] === 'Image') {
881
883
  eventArgs.imageUrl = (!isNullOrUndefined(eventArgs.imageUrlValuePath)) ?
882
884
  ((eventArgs.imageUrlValuePath.indexOf('.') > -1) ? getValueFromObject(data, eventArgs.imageUrlValuePath).toString() : (!isNullOrUndefined(data[eventArgs.imageUrlValuePath]) ?
@@ -885,7 +887,7 @@ export function markerShapeChoose(eventArgs, data) {
885
887
  }
886
888
  else {
887
889
  var shapes = (!isNullOrUndefined(eventArgs.shapeValuePath)) ? ((eventArgs.shapeValuePath.indexOf('.') > -1) ? getValueFromObject(data, eventArgs.shapeValuePath).toString() : eventArgs.shape) : eventArgs.shape;
888
- eventArgs.shape = shapes;
890
+ eventArgs.shape = (shapes.toString() !== "") ? shapes : eventArgs.shape;
889
891
  var shapeImage = (!isNullOrUndefined(eventArgs.imageUrlValuePath)) ?
890
892
  ((eventArgs.imageUrlValuePath.indexOf('.') > -1) ? getValueFromObject(data, eventArgs.imageUrlValuePath).toString() : (!isNullOrUndefined(data[eventArgs.imageUrlValuePath]) ?
891
893
  data[eventArgs.imageUrlValuePath] : eventArgs.imageUrl)) : eventArgs.imageUrl;
@@ -1448,7 +1450,7 @@ export function calculateShapes(maps, shape, options, size, location, markerEle)
1448
1450
  var tempGroup;
1449
1451
  switch (shape) {
1450
1452
  case 'Balloon':
1451
- tempGroup = drawBalloon(maps, options, size, location, markerEle);
1453
+ tempGroup = drawBalloon(maps, options, size, location, 'Marker', markerEle);
1452
1454
  break;
1453
1455
  case 'Cross':
1454
1456
  options.d = 'M ' + location.x + ' ' + (location.y - size.height / 2) + ' L ' + location.x + ' ' + (location.y + size.height
@@ -1606,9 +1608,10 @@ export function drawStar(maps, options, size, location, element) {
1606
1608
  * @returns {Element} - Returns the element
1607
1609
  * @private
1608
1610
  */
1609
- export function drawBalloon(maps, options, size, location, element) {
1611
+ export function drawBalloon(maps, options, size, location, type, element) {
1610
1612
  var width = size.width;
1611
1613
  var height = size.height;
1614
+ var pathElement;
1612
1615
  location.x -= width / 2;
1613
1616
  location.y -= height;
1614
1617
  options.d = 'M15,0C8.8,0,3.8,5,3.8,11.2C3.8,17.5,9.4,24.4,15,30c5.6-5.6,11.2-12.5,11.2-18.8C26.2,5,21.2,0,15,0z M15,16' +
@@ -1617,9 +1620,15 @@ export function drawBalloon(maps, options, size, location, element) {
1617
1620
  var x = size.width / 30;
1618
1621
  var y = size.height / 30;
1619
1622
  balloon.setAttribute('transform', 'translate(' + location.x + ', ' + location.y + ') scale(' + x + ', ' + y + ')');
1620
- var g = maps.renderer.createGroup({ id: options.id });
1621
- appendShape(balloon, g);
1622
- return appendShape(g, element);
1623
+ if (type === 'Marker') {
1624
+ var g = maps.renderer.createGroup({ id: options.id });
1625
+ appendShape(balloon, g);
1626
+ pathElement = appendShape(g, element);
1627
+ }
1628
+ else {
1629
+ pathElement = balloon;
1630
+ }
1631
+ return pathElement;
1623
1632
  }
1624
1633
  /**
1625
1634
  * Internal rendering of Pattern
@@ -2744,6 +2753,8 @@ export function renderLegendShape(location, size, shape, options, url) {
2744
2753
  var shapeY = location.y;
2745
2754
  var x = location.x + (-shapeWidth / 2);
2746
2755
  var y = location.y + (-shapeHeight / 2);
2756
+ options['stroke'] = (shape === 'HorizontalLine' || shape === 'VerticalLine' || shape === 'Cross') ? options['fill'] : options['stroke'];
2757
+ options['stroke-width'] = (options['stroke-width'] === 0 && (shape === 'HorizontalLine' || shape === 'VerticalLine' || shape === 'Cross')) ? 1 : options['stroke-width'];
2747
2758
  switch (shape) {
2748
2759
  case 'Circle':
2749
2760
  case 'Bubble':
@@ -2755,6 +2766,11 @@ export function renderLegendShape(location, size, shape, options, url) {
2755
2766
  + (shapeY + (-shapeHeight / 2));
2756
2767
  merge(options, { 'd': renderPath });
2757
2768
  break;
2769
+ case 'HorizontalLine':
2770
+ renderPath = 'M' + ' ' + shapeX + ' ' + shapeY + ' ' + 'L' + ' ' + (shapeX + (shapeWidth / 2)) + ' '
2771
+ + shapeY;
2772
+ merge(options, { 'd': renderPath });
2773
+ break;
2758
2774
  case 'Diamond':
2759
2775
  renderPath = 'M' + ' ' + x + ' ' + shapeY + ' ' +
2760
2776
  'L' + ' ' + shapeX + ' ' + (shapeY + (-shapeHeight / 2)) + ' ' +