gis-leaflet-helper 3.3.12 → 3.3.14

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.
@@ -27028,7 +27028,7 @@ const PlotDraw = leafletSrcExports.Handler.extend({
27028
27028
  this.type = void 0;
27029
27029
  this._map._container.style.cursor = "default";
27030
27030
  this.latlngs = [];
27031
- this._map.closeTooltip(this.tooltip);
27031
+ this.tooltip && this._map.closeTooltip(this.tooltip);
27032
27032
  L.Handler.prototype.disable.call(this);
27033
27033
  }
27034
27034
  });
@@ -31964,6 +31964,14 @@ function injectCss(cls) {
31964
31964
  container.style.cursor = `url(${cursor}), auto`;
31965
31965
  }
31966
31966
  },
31967
+ setBackground: function(background) {
31968
+ const container = this.getContainer();
31969
+ if (Color.isColor(background)) {
31970
+ container.style.background = background;
31971
+ } else {
31972
+ container.style.background = background ? `url(${background}), no-repeat center center / cover` : "inherit";
31973
+ }
31974
+ },
31967
31975
  flyTo(target, zoom = 0, options = { animate: false }) {
31968
31976
  if (target instanceof L.Marker) {
31969
31977
  target = target._latlng;
@@ -31987,6 +31995,17 @@ function injectCss(cls) {
31987
31995
  visible ? layer.addTo(this) : layer.remove();
31988
31996
  }
31989
31997
  },
31998
+ getScaleDistance() {
31999
+ var centerX = this.getSize().x / 2;
32000
+ var centerY = this.getSize().y / 2;
32001
+ var pixelsPerCm = 96 / 2.54;
32002
+ var point1 = L.point(centerX - pixelsPerCm / 2, centerY);
32003
+ var point2 = L.point(centerX + pixelsPerCm / 2, centerY);
32004
+ var latLng1 = this.containerPointToLatLng(point1);
32005
+ var latLng2 = this.containerPointToLatLng(point2);
32006
+ var realDistanceMeters = this.distance(latLng1, latLng2);
32007
+ return realDistanceMeters;
32008
+ },
31990
32009
  openWidget(name, options = {}, events = {}, config = {}) {
31991
32010
  this.fire("widget-mount", {
31992
32011
  name,