@mapcomponents/ra-geospatial 1.6.2 → 1.6.4-2

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.
@@ -40793,7 +40793,7 @@ endobj\r
40793
40793
  var v = y.getContext("2d");
40794
40794
  v.fillStyle = "#fff", v.fillRect(0, 0, y.width, y.height);
40795
40795
  var S = { ignoreMouse: !0, ignoreAnimation: !0, ignoreDimensions: !0 }, P = this;
40796
- return (jn.canvg ? Promise.resolve(jn.canvg) : import("./index.es-6e0FVhHF.js")).catch(function(M) {
40796
+ return (jn.canvg ? Promise.resolve(jn.canvg) : import("./index.es-ButfBttq.js")).catch(function(M) {
40797
40797
  return Promise.reject(new Error("Could not load canvg: " + M));
40798
40798
  }).then(function(M) {
40799
40799
  return M.default ? M.default : M;
@@ -43928,15 +43928,15 @@ const kz = (e) => {
43928
43928
  n.componentId
43929
43929
  ), h(!0));
43930
43930
  }, [n.map, e, a, v]), ki(() => {
43931
- if (!n.map || !c) return;
43931
+ if (!n.map || !c || !t.current) return;
43932
43932
  const S = (P) => {
43933
- let M = [];
43934
- P && typeof P == "object" && "features" in P && P.features && (M = P.features), o(M), e.onChange && e.onChange(M);
43933
+ const M = P?.features || [];
43934
+ o(M), e.onChange && e.onChange(M);
43935
43935
  };
43936
- return n.map.on("mouseup", S), n.map.on("touchend", S), () => {
43937
- n.map && (n.map.map.off("mouseup", S), n.map.map.off("touchend", S));
43936
+ return n.map.on("draw.create", S, n.componentId), n.map.on("draw.update", S, n.componentId), n.map.on("draw.delete", S, n.componentId), () => {
43937
+ n.map && (n.map.map.off("draw.create", S), n.map.map.off("draw.update", S), n.map.map.off("draw.delete", S));
43938
43938
  };
43939
- }, [c, n.map]), ki(() => {
43939
+ }, [c, n.map, e.onChange]), ki(() => {
43940
43940
  t.current && e.geojson?.geometry && t.current.set({ type: "FeatureCollection", features: [e.geojson] });
43941
43941
  }, [e.geojson, c]), ki(() => {
43942
43942
  e.mode && t.current && t.current?.getMode?.() !== e.mode && (t.current?.changeMode?.(e.mode), e.mode !== "simple_select" && e.mode !== "direct_select" && t.current.set({ type: "FeatureCollection", features: [] }));
@@ -61524,4 +61524,4 @@ export {
61524
61524
  Xc as c,
61525
61525
  Yh as g
61526
61526
  };
61527
- //# sourceMappingURL=index-Ch2LED6r.js.map
61527
+ //# sourceMappingURL=index-D55kERfu.js.map