@watergis/maplibre-gl-terradraw 0.5.0 → 0.5.1

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.
@@ -2893,9 +2893,18 @@ class Ze {
2893
2893
  B(this, "defaultMode", "render");
2894
2894
  this.modeButtons = {}, t && (this.options = Object.assign(this.options, t));
2895
2895
  }
2896
+ /**
2897
+ * Get the default control position
2898
+ * @returns default control position. Default is 'top-right'
2899
+ */
2896
2900
  getDefaultPosition() {
2897
2901
  return "top-right";
2898
2902
  }
2903
+ /**
2904
+ * add the plugin control to maplibre
2905
+ * @param map Maplibre Map object
2906
+ * @returns HTML Element
2907
+ */
2899
2908
  onAdd(t) {
2900
2909
  var o, s, r, a;
2901
2910
  if (this.options && this.options.modes && this.options.modes.length === 0)
@@ -2933,6 +2942,10 @@ class Ze {
2933
2942
  (h = this.controlContainer) == null || h.appendChild(l);
2934
2943
  }), this.controlContainer;
2935
2944
  }
2945
+ /**
2946
+ * Remove the plugin control from maplibre
2947
+ * @returns void
2948
+ */
2936
2949
  onRemove() {
2937
2950
  !this.controlContainer || !this.controlContainer.parentNode || !this.map || (this.deactivate(), this.modeButtons = {}, this.terradraw = void 0, this.map = void 0, this.controlContainer.parentNode.removeChild(this.controlContainer));
2938
2951
  }
@@ -3039,6 +3052,9 @@ class Ze {
3039
3052
  this.activate(), this.resetActiveMode(), i || (this.terradraw.setMode(t), e.classList.add("active")), this.toggleDeleteSelectionButton();
3040
3053
  })));
3041
3054
  }
3055
+ /**
3056
+ * Toggle the state of delete-select button
3057
+ */
3042
3058
  toggleDeleteSelectionButton() {
3043
3059
  var s, r;
3044
3060
  const t = ((s = this.terradraw) == null ? void 0 : s.enabled) || !1, e = (r = this.terradraw) == null ? void 0 : r.getMode(), i = t && e === "select", o = document.getElementsByClassName("maplibregl-terradraw-delete-selection-button");
@@ -3047,6 +3063,11 @@ class Ze {
3047
3063
  l && (i ? l.classList.remove("hidden-delete-selection") : l.classList.add("hidden-delete-selection"));
3048
3064
  }
3049
3065
  }
3066
+ /**
3067
+ * Capitalzie string value
3068
+ * @param value string value
3069
+ * @returns string
3070
+ */
3050
3071
  capitalize(t) {
3051
3072
  return t.charAt(0).toUpperCase() + t.slice(1);
3052
3073
  }