@syncfusion/ej2-maps 21.1.38 → 21.1.41

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.
@@ -40,6 +40,7 @@ function stringToNumber(value, containerSize) {
40
40
  function calculateSize(maps) {
41
41
  maps.element.style.height = !isNullOrUndefined(maps.height) ? maps.height : 'auto';
42
42
  maps.element.style.width = !isNullOrUndefined(maps.width) ? maps.width : 'auto';
43
+ maps.element.style.setProperty("display", "block");
43
44
  const containerWidth = maps.element.clientWidth;
44
45
  const containerHeight = maps.element.clientHeight;
45
46
  const containerElementWidth = stringToNumber(maps.element.style.width, containerWidth);
@@ -1778,8 +1779,9 @@ function findMidPointOfPolygon(points, type, geometryType) {
1778
1779
  ySum = ySum + Math.abs(((startY + startY1) * (((startX * startY1) - (startX1 * startY)))));
1779
1780
  }
1780
1781
  sum = 0.5 * sum;
1781
- xSum = (1 / (4 * sum)) * xSum;
1782
- ySum = (1 / (4 * sum)) * ySum;
1782
+ const pointValue = points.some(point => point.x < 5 && point.y < 5) && geometryType === 'Normal' ? 6 : 4;
1783
+ xSum = (1 / (pointValue * sum)) * xSum;
1784
+ ySum = (1 / (pointValue * sum)) * ySum;
1783
1785
  /* Code for finding nearest points in polygon related to midPoint*/
1784
1786
  let rightMinPoint = { x: 0, y: 0 };
1785
1787
  let rightMaxPoint = { x: 0, y: 0 };
@@ -7773,15 +7775,8 @@ let Maps = class Maps extends Component {
7773
7775
  if (!isNullOrUndefined(this.svgObject)) {
7774
7776
  this.element.appendChild(this.svgObject);
7775
7777
  }
7776
- const position = this.getExtraPosition();
7778
+ this.setSecondaryElementPosition();
7777
7779
  for (let i = 0; i < this.layers.length; i++) {
7778
- if (position.x !== 0 || position.y !== 0) {
7779
- const markerTemplate$$1 = document.getElementById(this.element.id + '_LayerIndex_' + i + '_Markers_Template_Group');
7780
- if (!isNullOrUndefined(markerTemplate$$1)) {
7781
- markerTemplate$$1.style.top = this.mapAreaRect.y + position.y + 'px';
7782
- markerTemplate$$1.style.left = this.mapAreaRect.x + position.x + 'px';
7783
- }
7784
- }
7785
7780
  if (this.layers[i].selectionSettings && this.layers[i].selectionSettings.enable &&
7786
7781
  this.layers[i].initialShapeSelection.length > 0 && this.checkInitialRender) {
7787
7782
  const checkSelection = this.layers[i].selectionSettings.enableMultiSelect;
@@ -7971,15 +7966,13 @@ let Maps = class Maps extends Component {
7971
7966
  this.element.setAttribute('role', '');
7972
7967
  this.element.tabIndex = this.tabIndex;
7973
7968
  }
7974
- // private setSecondaryElementPosition(): void {
7975
- // if (!this.isTileMap) {
7976
- // let element: HTMLDivElement = getElementByID(this.element.id + '_Secondary_Element') as HTMLDivElement;
7977
- // let rect: ClientRect = this.element.getBoundingClientRect();
7978
- // let svgRect: ClientRect = getElementByID(this.element.id + '_svg').getBoundingClientRect();
7979
- // element.style.marginLeft = Math.max(svgRect.left - rect.left, 0) + 'px';
7980
- // element.style.marginTop = Math.max(svgRect.top - rect.top, 0) + 'px';
7981
- // }
7982
- // }
7969
+ setSecondaryElementPosition() {
7970
+ let element = getElementByID(this.element.id + '_Secondary_Element');
7971
+ let rect = this.element.getBoundingClientRect();
7972
+ let svgRect = getElementByID(this.element.id + '_svg').getBoundingClientRect();
7973
+ element.style.marginLeft = Math.max(svgRect.left - rect.left, 0) + 'px';
7974
+ element.style.marginTop = Math.max(svgRect.top - rect.top, 0) + 'px';
7975
+ }
7983
7976
  zoomingChange() {
7984
7977
  let left;
7985
7978
  let top;
@@ -9583,28 +9576,6 @@ let Maps = class Maps extends Component {
9583
9576
  });
9584
9577
  return isVisible;
9585
9578
  }
9586
- /**
9587
- * To find space between the secondary element and svg element.
9588
- *
9589
- * @returns {Point} - Returns the left and top value of the secondary element of Maps.
9590
- * @private
9591
- */
9592
- getExtraPosition() {
9593
- let top = 0;
9594
- let left = 0;
9595
- const svgElement = getElement(this.element.id + '_svg');
9596
- if (!isNullOrUndefined(svgElement)) {
9597
- const svgClientRects = svgElement.getClientRects();
9598
- const mapsClientRects = (getElement(this.element.id + '_Secondary_Element')).getClientRects();
9599
- if (svgClientRects.length !== 0 && mapsClientRects.length !== 0) {
9600
- const svgClientRect = svgClientRects[0];
9601
- const mapsClientRect = mapsClientRects[0];
9602
- top = svgClientRect.top - mapsClientRect.top;
9603
- left = svgClientRect.left - mapsClientRect.left;
9604
- }
9605
- }
9606
- return new Point(left, top);
9607
- }
9608
9579
  /**
9609
9580
  * To find marker visibility
9610
9581
  */
@@ -15526,9 +15497,8 @@ class Zoom {
15526
15497
  }
15527
15498
  break;
15528
15499
  }
15529
- const extraPosition = map.getExtraPosition();
15530
- element.style.left = x + extraPosition.x + 'px';
15531
- element.style.top = y + extraPosition.y + 'px';
15500
+ element.style.left = x + 'px';
15501
+ element.style.top = y + 'px';
15532
15502
  const color = this.maps.toolbarProperties.highlightColor || this.maps.themeStyle.zoomSelectionColor;
15533
15503
  const css = ' .e-maps-toolbar:hover > circle { stroke:' + color + '; } .e-maps-toolbar:hover > path { fill: ' + color + ' ; stroke: ' + color + '; }' +
15534
15504
  '.e-maps-toolbar:hover { cursor: pointer; } .e-maps-cursor-disable:hover { cursor: not-allowed; } .e-maps-panning:hover { cursor: pointer; } ' +