@syncfusion/ej2-maps 21.1.38 → 21.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.
@@ -54,6 +54,7 @@ function stringToNumber(value, containerSize) {
54
54
  function calculateSize(maps) {
55
55
  maps.element.style.height = !isNullOrUndefined(maps.height) ? maps.height : 'auto';
56
56
  maps.element.style.width = !isNullOrUndefined(maps.width) ? maps.width : 'auto';
57
+ maps.element.style.setProperty("display", "block");
57
58
  var containerWidth = maps.element.clientWidth;
58
59
  var containerHeight = maps.element.clientHeight;
59
60
  var containerElementWidth = stringToNumber(maps.element.style.width, containerWidth);
@@ -1834,8 +1835,9 @@ function findMidPointOfPolygon(points, type, geometryType) {
1834
1835
  ySum = ySum + Math.abs(((startY + startY1) * (((startX * startY1) - (startX1 * startY)))));
1835
1836
  }
1836
1837
  sum = 0.5 * sum;
1837
- xSum = (1 / (4 * sum)) * xSum;
1838
- ySum = (1 / (4 * sum)) * ySum;
1838
+ var pointValue = points.some(function (point) { return point.x < 5 && point.y < 5; }) && geometryType === 'Normal' ? 6 : 4;
1839
+ xSum = (1 / (pointValue * sum)) * xSum;
1840
+ ySum = (1 / (pointValue * sum)) * ySum;
1839
1841
  /* Code for finding nearest points in polygon related to midPoint*/
1840
1842
  var rightMinPoint = { x: 0, y: 0 };
1841
1843
  var rightMaxPoint = { x: 0, y: 0 };
@@ -8063,15 +8065,8 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
8063
8065
  if (!isNullOrUndefined(this.svgObject)) {
8064
8066
  this.element.appendChild(this.svgObject);
8065
8067
  }
8066
- var position = this.getExtraPosition();
8068
+ this.setSecondaryElementPosition();
8067
8069
  for (var i = 0; i < this.layers.length; i++) {
8068
- if (position.x !== 0 || position.y !== 0) {
8069
- var markerTemplate$$1 = document.getElementById(this.element.id + '_LayerIndex_' + i + '_Markers_Template_Group');
8070
- if (!isNullOrUndefined(markerTemplate$$1)) {
8071
- markerTemplate$$1.style.top = this.mapAreaRect.y + position.y + 'px';
8072
- markerTemplate$$1.style.left = this.mapAreaRect.x + position.x + 'px';
8073
- }
8074
- }
8075
8070
  if (this.layers[i].selectionSettings && this.layers[i].selectionSettings.enable &&
8076
8071
  this.layers[i].initialShapeSelection.length > 0 && this.checkInitialRender) {
8077
8072
  var checkSelection = this.layers[i].selectionSettings.enableMultiSelect;
@@ -8261,15 +8256,13 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
8261
8256
  this.element.setAttribute('role', '');
8262
8257
  this.element.tabIndex = this.tabIndex;
8263
8258
  };
8264
- // private setSecondaryElementPosition(): void {
8265
- // if (!this.isTileMap) {
8266
- // let element: HTMLDivElement = getElementByID(this.element.id + '_Secondary_Element') as HTMLDivElement;
8267
- // let rect: ClientRect = this.element.getBoundingClientRect();
8268
- // let svgRect: ClientRect = getElementByID(this.element.id + '_svg').getBoundingClientRect();
8269
- // element.style.marginLeft = Math.max(svgRect.left - rect.left, 0) + 'px';
8270
- // element.style.marginTop = Math.max(svgRect.top - rect.top, 0) + 'px';
8271
- // }
8272
- // }
8259
+ Maps.prototype.setSecondaryElementPosition = function () {
8260
+ var element = getElementByID(this.element.id + '_Secondary_Element');
8261
+ var rect = this.element.getBoundingClientRect();
8262
+ var svgRect = getElementByID(this.element.id + '_svg').getBoundingClientRect();
8263
+ element.style.marginLeft = Math.max(svgRect.left - rect.left, 0) + 'px';
8264
+ element.style.marginTop = Math.max(svgRect.top - rect.top, 0) + 'px';
8265
+ };
8273
8266
  Maps.prototype.zoomingChange = function () {
8274
8267
  var left;
8275
8268
  var top;
@@ -9880,28 +9873,6 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
9880
9873
  });
9881
9874
  return isVisible;
9882
9875
  };
9883
- /**
9884
- * To find space between the secondary element and svg element.
9885
- *
9886
- * @returns {Point} - Returns the left and top value of the secondary element of Maps.
9887
- * @private
9888
- */
9889
- Maps.prototype.getExtraPosition = function () {
9890
- var top = 0;
9891
- var left = 0;
9892
- var svgElement = getElement(this.element.id + '_svg');
9893
- if (!isNullOrUndefined(svgElement)) {
9894
- var svgClientRects = svgElement.getClientRects();
9895
- var mapsClientRects = (getElement(this.element.id + '_Secondary_Element')).getClientRects();
9896
- if (svgClientRects.length !== 0 && mapsClientRects.length !== 0) {
9897
- var svgClientRect = svgClientRects[0];
9898
- var mapsClientRect = mapsClientRects[0];
9899
- top = svgClientRect.top - mapsClientRect.top;
9900
- left = svgClientRect.left - mapsClientRect.left;
9901
- }
9902
- }
9903
- return new Point(left, top);
9904
- };
9905
9876
  /**
9906
9877
  * To find marker visibility
9907
9878
  */
@@ -15873,9 +15844,8 @@ var Zoom = /** @__PURE__ @class */ (function () {
15873
15844
  }
15874
15845
  break;
15875
15846
  }
15876
- var extraPosition = map.getExtraPosition();
15877
- element.style.left = x + extraPosition.x + 'px';
15878
- element.style.top = y + extraPosition.y + 'px';
15847
+ element.style.left = x + 'px';
15848
+ element.style.top = y + 'px';
15879
15849
  var color = this.maps.toolbarProperties.highlightColor || this.maps.themeStyle.zoomSelectionColor;
15880
15850
  var css = ' .e-maps-toolbar:hover > circle { stroke:' + color + '; } .e-maps-toolbar:hover > path { fill: ' + color + ' ; stroke: ' + color + '; }' +
15881
15851
  '.e-maps-toolbar:hover { cursor: pointer; } .e-maps-cursor-disable:hover { cursor: not-allowed; } .e-maps-panning:hover { cursor: pointer; } ' +