@syncfusion/ej2-maps 28.1.33 → 28.2.3

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.
@@ -368,6 +368,17 @@ class Point {
368
368
  this.y = y;
369
369
  }
370
370
  }
371
+ /**
372
+ * Specifies the position of the legend on the map, with options to set the
373
+ * position values as percentages. The legend is placed relative to the Maps,
374
+ * ensuring responsiveness.
375
+ */
376
+ class RelativePoint {
377
+ constructor(x, y) {
378
+ this.x = x;
379
+ this.y = y;
380
+ }
381
+ }
371
382
  /**
372
383
  * Defines the latitude and longitude values that define a map location.
373
384
  */
@@ -6319,7 +6330,7 @@ class LayerPanel {
6319
6330
  proxy.renderTileLayer(proxy, layer, layerIndex, bing);
6320
6331
  this.mapObject.arrangeTemplate();
6321
6332
  if (this.mapObject.zoomModule && (this.mapObject.previousScale !== this.mapObject.scale)) {
6322
- this.mapObject.zoomModule.applyTransform(this.mapObject, true);
6333
+ this.mapObject.zoomModule.applyTransform(this.mapObject, false, true);
6323
6334
  }
6324
6335
  }
6325
6336
  bubbleCalculation(bubbleSettings, range) {
@@ -8169,7 +8180,7 @@ let Maps = class Maps extends Component {
8169
8180
  }
8170
8181
  }
8171
8182
  if (this.zoomModule && ((this.previousScale !== this.scale) || this.zoomNotApplied || this.isZoomByPosition)) {
8172
- this.zoomModule.applyTransform(this, true);
8183
+ this.zoomModule.applyTransform(this, false, true);
8173
8184
  }
8174
8185
  }
8175
8186
  }
@@ -12063,7 +12074,7 @@ class Legend {
12063
12074
  else {
12064
12075
  legendText = '';
12065
12076
  }
12066
- if (legend.position === 'Left' || legend.position === 'Right') {
12077
+ if (legend.position === 'Left' || legend.position === 'Right' || legend.position === 'Float') {
12067
12078
  for (let i = 0; i < this.legendCollection.length; i++) {
12068
12079
  const legendItem = this.legendCollection[i];
12069
12080
  const legendTextSize = measureText(legendItem['text'], legend.textStyle);
@@ -13238,8 +13249,12 @@ class Legend {
13238
13249
  const areaWidth = totalRect.width;
13239
13250
  const totalWidth = map.availableSize.width;
13240
13251
  const totalHeight = map.availableSize.height;
13241
- const locationX = !isNullOrUndefined(legend.location.x) ? legend.location.x : 0;
13242
- const locationY = !isNullOrUndefined(legend.location.y) ? legend.location.y : 0;
13252
+ const locationX = !isNullOrUndefined(legend.location.x) ? (typeof (legend.location.x) === 'string' &&
13253
+ legend.location.x.indexOf('%') > -1 ? (map.availableSize.width / 100) * parseFloat(legend.location.x) :
13254
+ typeof (legend.location.x) === 'string' ? parseFloat(legend.location.x) : legend.location.x) : 0;
13255
+ const locationY = !isNullOrUndefined(legend.location.y) ? (typeof (legend.location.y) === 'string' &&
13256
+ legend.location.y.indexOf('%') > -1 ? (map.availableSize.height / 100) * parseFloat(legend.location.y) :
13257
+ typeof (legend.location.y) === 'string' ? parseFloat(legend.location.y) : legend.location.y) : 0;
13243
13258
  if (legend.position === 'Float') {
13244
13259
  this.translate = map.isTileMap ? new Point(locationX, locationY + (spacing / 4)) :
13245
13260
  new Point(locationX + map.mapAreaRect.x, locationY + map.mapAreaRect.y);
@@ -15350,10 +15365,11 @@ class Zoom {
15350
15365
  * @param {Point} position - Specifies the position.
15351
15366
  * @param {number} newZoomFactor - Specifies the zoom factor.
15352
15367
  * @param {string} type - Specifies the type.
15368
+ * @param {boolean} isMouseWheel - Indicates whether the zoom operation was triggered by the mouse wheel.
15353
15369
  * @returns {void}
15354
15370
  * @private
15355
15371
  */
15356
- performZooming(position, newZoomFactor, type) {
15372
+ performZooming(position, newZoomFactor, type, isMouseWheel = false) {
15357
15373
  const map = this.maps;
15358
15374
  map.previousProjection = newZoomFactor <= 1.5 ? undefined : map.projectionType;
15359
15375
  map.defaultState = false;
@@ -15412,7 +15428,7 @@ class Zoom {
15412
15428
  map.scale = map.mapScaleValue = map.previousScale;
15413
15429
  }
15414
15430
  else {
15415
- this.applyTransform(map);
15431
+ this.applyTransform(map, isMouseWheel);
15416
15432
  }
15417
15433
  }
15418
15434
  else if ((map.isTileMap) && (newZoomFactor >= minZoom && newZoomFactor <= maxZoom)) {
@@ -15456,7 +15472,7 @@ class Zoom {
15456
15472
  // element1 = element1;
15457
15473
  // }
15458
15474
  // }
15459
- this.applyTransform(this.maps);
15475
+ this.applyTransform(this.maps, isMouseWheel);
15460
15476
  if (document.getElementById(this.maps.element.id + '_LayerIndex_1')) {
15461
15477
  document.getElementById(this.maps.element.id + '_LayerIndex_1').style.display = 'block';
15462
15478
  }
@@ -15582,7 +15598,7 @@ class Zoom {
15582
15598
  }
15583
15599
  if (!isZoomCancelled) {
15584
15600
  map.mapScaleValue = zoomCalculationFactor;
15585
- this.applyTransform(map, true);
15601
+ this.applyTransform(map, false, true);
15586
15602
  this.maps.zoomNotApplied = false;
15587
15603
  this.zoomingRect = null;
15588
15604
  }
@@ -15796,12 +15812,13 @@ class Zoom {
15796
15812
  }
15797
15813
  /**
15798
15814
  * @param {Maps} maps - Specifies the Map control
15815
+ * @param {boolean} isMouseWheel - Indicates whether the zoom operation was triggered by the mouse wheel.
15799
15816
  * @param {boolean} animate - Specifies the animation is available or not
15800
15817
  * @param {boolean} isPanning - Specifies that it is panning or not
15801
15818
  * @returns {void}
15802
15819
  * @private
15803
15820
  */
15804
- applyTransform(maps, animate, isPanning) {
15821
+ applyTransform(maps, isMouseWheel, animate, isPanning) {
15805
15822
  let layerIndex;
15806
15823
  this.templateCount = 0;
15807
15824
  let markerStyle;
@@ -15892,8 +15909,10 @@ class Zoom {
15892
15909
  }
15893
15910
  if (((this.currentLayer.animationDuration > 0 || animationMode === 'Enable') || ((maps.layersCollection[0].animationDuration > 0 || animationMode === 'Enable') && this.currentLayer.type === 'SubLayer')) && !this.isPanModeEnabled) {
15894
15911
  if (!maps.isTileMap) {
15895
- markerStyle = 'visibility:hidden';
15896
- currentEle.style.cssText = markerStyle;
15912
+ markerStyle = isMouseWheel ? markerStyle : 'visibility:hidden';
15913
+ if (!isNullOrUndefined(markerStyle)) {
15914
+ currentEle.style.cssText = markerStyle;
15915
+ }
15897
15916
  }
15898
15917
  }
15899
15918
  });
@@ -16470,15 +16489,15 @@ class Zoom {
16470
16489
  if (!panArgs.cancel) {
16471
16490
  if (panningXDirection && panningYDirection) {
16472
16491
  map.translatePoint = new Point(x, y);
16473
- this.applyTransform(map, false, true);
16492
+ this.applyTransform(map, false, false, true);
16474
16493
  }
16475
16494
  else if (panningXDirection) {
16476
16495
  map.translatePoint = new Point(x, map.translatePoint.y);
16477
- this.applyTransform(map, false, true);
16496
+ this.applyTransform(map, false, false, true);
16478
16497
  }
16479
16498
  else if (panningYDirection) {
16480
16499
  map.translatePoint = new Point(map.translatePoint.x, y);
16481
- this.applyTransform(map, false, true);
16500
+ this.applyTransform(map, false, false, true);
16482
16501
  }
16483
16502
  }
16484
16503
  this.maps.zoomNotApplied = false;
@@ -16507,7 +16526,7 @@ class Zoom {
16507
16526
  };
16508
16527
  map.trigger(pan, panArgs);
16509
16528
  map.mapLayerPanel.generateTiles(map.tileZoomLevel, map.tileTranslatePoint, 'Pan');
16510
- this.applyTransform(map, false, true);
16529
+ this.applyTransform(map, false, false, true);
16511
16530
  map.translatePoint.x = (map.tileTranslatePoint.x - xDifference) / map.scale;
16512
16531
  map.translatePoint.y = (map.tileTranslatePoint.y - yDifference) / map.scale;
16513
16532
  }
@@ -16577,7 +16596,7 @@ class Zoom {
16577
16596
  map.scale = map.previousScale;
16578
16597
  }
16579
16598
  else {
16580
- this.applyTransform(map, true);
16599
+ this.applyTransform(map, false, true);
16581
16600
  }
16582
16601
  }
16583
16602
  else if ((map.isTileMap) && ((zoomFactor >= minZoom && zoomFactor <= maxZoom) || map.isReset)) {
@@ -16614,7 +16633,7 @@ class Zoom {
16614
16633
  map.mapLayerPanel.generateTiles(tileZoomFactor, map.tileTranslatePoint, type);
16615
16634
  const animationDuration = this.maps.layersCollection[0].animationDuration === 0 && animationMode === 'Enable' ? 1000 : this.maps.layersCollection[0].animationDuration;
16616
16635
  setTimeout(() => {
16617
- this.applyTransform(this.maps, true);
16636
+ this.applyTransform(this.maps, false, true);
16618
16637
  if (document.getElementById(this.maps.element.id + '_LayerIndex_1')) {
16619
16638
  document.getElementById(this.maps.element.id + '_LayerIndex_1').style.display = 'block';
16620
16639
  }
@@ -17227,11 +17246,11 @@ class Zoom {
17227
17246
  map.staticMapZoom = map.tileZoomLevel;
17228
17247
  if (map.staticMapZoom > 0 && map.staticMapZoom < staticMaxZoomLevel) {
17229
17248
  map.staticMapZoom += 1;
17230
- this.performZooming(position, (value + delta), direction);
17249
+ this.performZooming(position, (value + delta), direction, true);
17231
17250
  }
17232
17251
  }
17233
17252
  else {
17234
- this.performZooming(position, (value + delta), direction);
17253
+ this.performZooming(position, (value + delta), direction, true);
17235
17254
  }
17236
17255
  }
17237
17256
  else {
@@ -17245,7 +17264,7 @@ class Zoom {
17245
17264
  if (map.staticMapZoom > 1 && map.staticMapZoom < staticMaxZoomLevel) {
17246
17265
  map.staticMapZoom -= 1;
17247
17266
  }
17248
- this.performZooming(position, (value - delta), direction);
17267
+ this.performZooming(position, (value - delta), direction, true);
17249
17268
  }
17250
17269
  }
17251
17270
  this.removeToolbarOpacity(map.mapScaleValue, (!this.maps.isDevice ? (!isNullOrUndefined(e.target) ? e.target['id'] :
@@ -18087,5 +18106,5 @@ class PdfExport {
18087
18106
  destroy() { }
18088
18107
  }
18089
18108
 
18090
- export { Annotation, Annotations, Arrow, BingMap, Border, Bubble, BubbleSettings, CenterPosition, CircleOption, ColorMapping, ColorMappingSettings, ColorValue, CommonTitleSettings, ConnectorLineSettings, Coordinate, DataLabel, DataLabelSettings, Font, GeoLocation, Highlight, HighlightSettings, ImageExport, InitialMarkerSelectionSettings, InitialShapeSelectionSettings, Internalize, LayerPanel, LayerSettings, Legend, LegendSettings, Line, LineOption, MapAjax, MapLocation, Maps, MapsAreaSettings, MapsTooltip, Margin, Marker, MarkerBase, MarkerClusterData, MarkerClusterSettings, MarkerSettings, MinMax, NavigationLine, NavigationLineSettings, PathOption, PatternOptions, PdfExport, Point, Polygon, PolygonOption, PolygonSetting, PolygonSettings, PolygonTooltipSettings, PolylineOption, Print, Rect, RectOption, Selection, SelectionSettings, ShapeSettings, Size, SubTitleSettings, TextOption, Tile, TitleSettings, ToggleLegendSettings, TooltipSettings, Zoom, ZoomSettings, ZoomToolbarButtonSettings, ZoomToolbarSettings, ZoomToolbarTooltipSettings, acos, aitoff, animate, animationComplete, annotationRendering, appendShape, beforePrint, bubbleClick, bubbleMouseMove, bubbleRendering, calculateBound, calculateCenterFromPixel, calculatePolygonPath, calculateScale, calculateShapes, calculateSize, calculateZoomLevel, changeBorderWidth, changeNavaigationLineWidth, checkPropertyPath, checkShapeDataFields, click, clusterSeparate, clusterTemplate, compareZoomFactor, convertElement, convertElementFromLabel, convertGeoToPoint, convertStringToValue, convertTileLatLongToPoint, createStyle, createSvg, createTooltip, customizeStyle, dataLabelRendering, degreesToRadians, doubleClick, drawBalloon, drawCircle, drawCross, drawDiamond, drawHorizontalLine, drawLine, drawPath, drawPattern, drawPolygon, drawPolyline, drawRectangle, drawStar, drawSymbol, drawSymbols, drawTriangle, drawVerticalLine, elementAnimate, filter, findMidPointOfPolygon, findPosition, fixInitialScaleForTile, formatValue, getDistance, getElement, getElementByID, getElementOffset, getElementsByClassName, getFieldData, getHexColor, getMousePosition, getProcessedMarginValue, getRatioOfBubble, getShapeData, getTargetElement, getTemplateFunction, getTouchCenter, getTouches, getTranslate, getValueFromObject, getZoomTranslate, isCustomPath, itemHighlight, itemSelection, layerRendering, legendRendering, load, loaded, maintainSelection, maintainStyleClass, maintainToggleSelection, marker, markerBoundsComparer, markerClick, markerClusterClick, markerClusterListHandler, markerClusterMouseMove, markerClusterRendering, markerColorChoose, markerDragEnd, markerDragStart, markerMouseMove, markerRendering, markerShapeChoose, markerTemplate, measureText, measureTextElement, mergeSeparateCluster, mouseMove, mousedown, mousemove, mouseup, onclick, pan, panComplete, processResult, querySelector, radiansToDegrees, removeClass, removeElement, renderLegendShape, renderTextElement, resize, rightClick, roundTo, shapeHighlight, shapeRendering, shapeSelected, showTooltip, sinci, smoothTranslate, stringToNumber, sum, targetTouches, textTrim, timeout, tooltipRender, triggerDownload, triggerItemSelectionEvent, triggerShapeEvent, wordWrap, xToCoordinate, yToCoordinate, zoomAnimate, zoomComplete, zoomIn, zoomOut };
18109
+ export { Annotation, Annotations, Arrow, BingMap, Border, Bubble, BubbleSettings, CenterPosition, CircleOption, ColorMapping, ColorMappingSettings, ColorValue, CommonTitleSettings, ConnectorLineSettings, Coordinate, DataLabel, DataLabelSettings, Font, GeoLocation, Highlight, HighlightSettings, ImageExport, InitialMarkerSelectionSettings, InitialShapeSelectionSettings, Internalize, LayerPanel, LayerSettings, Legend, LegendSettings, Line, LineOption, MapAjax, MapLocation, Maps, MapsAreaSettings, MapsTooltip, Margin, Marker, MarkerBase, MarkerClusterData, MarkerClusterSettings, MarkerSettings, MinMax, NavigationLine, NavigationLineSettings, PathOption, PatternOptions, PdfExport, Point, Polygon, PolygonOption, PolygonSetting, PolygonSettings, PolygonTooltipSettings, PolylineOption, Print, Rect, RectOption, RelativePoint, Selection, SelectionSettings, ShapeSettings, Size, SubTitleSettings, TextOption, Tile, TitleSettings, ToggleLegendSettings, TooltipSettings, Zoom, ZoomSettings, ZoomToolbarButtonSettings, ZoomToolbarSettings, ZoomToolbarTooltipSettings, acos, aitoff, animate, animationComplete, annotationRendering, appendShape, beforePrint, bubbleClick, bubbleMouseMove, bubbleRendering, calculateBound, calculateCenterFromPixel, calculatePolygonPath, calculateScale, calculateShapes, calculateSize, calculateZoomLevel, changeBorderWidth, changeNavaigationLineWidth, checkPropertyPath, checkShapeDataFields, click, clusterSeparate, clusterTemplate, compareZoomFactor, convertElement, convertElementFromLabel, convertGeoToPoint, convertStringToValue, convertTileLatLongToPoint, createStyle, createSvg, createTooltip, customizeStyle, dataLabelRendering, degreesToRadians, doubleClick, drawBalloon, drawCircle, drawCross, drawDiamond, drawHorizontalLine, drawLine, drawPath, drawPattern, drawPolygon, drawPolyline, drawRectangle, drawStar, drawSymbol, drawSymbols, drawTriangle, drawVerticalLine, elementAnimate, filter, findMidPointOfPolygon, findPosition, fixInitialScaleForTile, formatValue, getDistance, getElement, getElementByID, getElementOffset, getElementsByClassName, getFieldData, getHexColor, getMousePosition, getProcessedMarginValue, getRatioOfBubble, getShapeData, getTargetElement, getTemplateFunction, getTouchCenter, getTouches, getTranslate, getValueFromObject, getZoomTranslate, isCustomPath, itemHighlight, itemSelection, layerRendering, legendRendering, load, loaded, maintainSelection, maintainStyleClass, maintainToggleSelection, marker, markerBoundsComparer, markerClick, markerClusterClick, markerClusterListHandler, markerClusterMouseMove, markerClusterRendering, markerColorChoose, markerDragEnd, markerDragStart, markerMouseMove, markerRendering, markerShapeChoose, markerTemplate, measureText, measureTextElement, mergeSeparateCluster, mouseMove, mousedown, mousemove, mouseup, onclick, pan, panComplete, processResult, querySelector, radiansToDegrees, removeClass, removeElement, renderLegendShape, renderTextElement, resize, rightClick, roundTo, shapeHighlight, shapeRendering, shapeSelected, showTooltip, sinci, smoothTranslate, stringToNumber, sum, targetTouches, textTrim, timeout, tooltipRender, triggerDownload, triggerItemSelectionEvent, triggerShapeEvent, wordWrap, xToCoordinate, yToCoordinate, zoomAnimate, zoomComplete, zoomIn, zoomOut };
18091
18110
  //# sourceMappingURL=ej2-maps.es2015.js.map