@performant-software/geospatial 2.2.8-beta.1 → 2.2.8-beta.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.
- package/dist/index.cjs10.js +1 -1
- package/dist/index.cjs10.js.map +1 -1
- package/dist/index.cjs100.js +1 -1
- package/dist/index.cjs102.js +1 -1
- package/dist/index.cjs103.js +1 -1
- package/dist/index.cjs104.js +1 -1
- package/dist/index.cjs105.js +1 -1
- package/dist/index.cjs110.js +1 -1
- package/dist/index.cjs111.js +1 -1
- package/dist/index.cjs112.js +1 -1
- package/dist/index.cjs113.js +1 -1
- package/dist/index.cjs116.js +1 -1
- package/dist/index.cjs117.js +1 -1
- package/dist/index.cjs118.js +1 -1
- package/dist/index.cjs122.js +1 -1
- package/dist/index.cjs125.js +1 -1
- package/dist/index.cjs129.js +1 -1
- package/dist/index.cjs132.js +1 -1
- package/dist/index.cjs14.js +1 -1
- package/dist/index.cjs140.js +1 -1
- package/dist/index.cjs141.js +1 -1
- package/dist/index.cjs142.js +1 -1
- package/dist/index.cjs143.js +1 -1
- package/dist/index.cjs144.js +1 -1
- package/dist/index.cjs145.js +1 -1
- package/dist/index.cjs146.js +1 -1
- package/dist/index.cjs148.js +1 -1
- package/dist/index.cjs149.js +1 -1
- package/dist/index.cjs150.js +1 -1
- package/dist/index.cjs151.js +1 -1
- package/dist/index.cjs152.js +1 -1
- package/dist/index.cjs153.js +1 -1
- package/dist/index.cjs154.js +1 -1
- package/dist/index.cjs155.js +1 -1
- package/dist/index.cjs156.js +1 -1
- package/dist/index.cjs159.js +1 -1
- package/dist/index.cjs160.js +1 -1
- package/dist/index.cjs162.js +1 -1
- package/dist/index.cjs163.js +1 -1
- package/dist/index.cjs164.js +1 -1
- package/dist/index.cjs165.js +1 -1
- package/dist/index.cjs166.js +1 -1
- package/dist/index.cjs167.js +1 -1
- package/dist/index.cjs168.js +1 -1
- package/dist/index.cjs169.js +1 -1
- package/dist/index.cjs175.js +1 -1
- package/dist/index.cjs176.js +1 -1
- package/dist/index.cjs177.js +1 -1
- package/dist/index.cjs178.js +1 -1
- package/dist/index.cjs179.js +1 -1
- package/dist/index.cjs182.js +1 -1
- package/dist/index.cjs189.js +1 -1
- package/dist/index.cjs189.js.map +1 -1
- package/dist/index.cjs190.js +1 -1
- package/dist/index.cjs190.js.map +1 -1
- package/dist/index.cjs191.js +4 -1
- package/dist/index.cjs191.js.map +1 -1
- package/dist/index.cjs192.js +1 -4
- package/dist/index.cjs192.js.map +1 -1
- package/dist/index.cjs193.js +1 -1
- package/dist/index.cjs193.js.map +1 -1
- package/dist/index.cjs194.js +1 -1
- package/dist/index.cjs194.js.map +1 -1
- package/dist/index.cjs195.js +1 -1
- package/dist/index.cjs195.js.map +1 -1
- package/dist/index.cjs196.js +1 -1
- package/dist/index.cjs196.js.map +1 -1
- package/dist/index.cjs197.js +1 -1
- package/dist/index.cjs197.js.map +1 -1
- package/dist/index.cjs198.js +1 -1
- package/dist/index.cjs198.js.map +1 -1
- package/dist/index.cjs199.js +1 -1
- package/dist/index.cjs199.js.map +1 -1
- package/dist/index.cjs20.js +1 -1
- package/dist/index.cjs200.js +1 -1
- package/dist/index.cjs200.js.map +1 -1
- package/dist/index.cjs201.js +1 -1
- package/dist/index.cjs201.js.map +1 -1
- package/dist/index.cjs202.js +1 -1
- package/dist/index.cjs202.js.map +1 -1
- package/dist/index.cjs203.js +1 -1
- package/dist/index.cjs203.js.map +1 -1
- package/dist/index.cjs204.js +1 -1
- package/dist/index.cjs204.js.map +1 -1
- package/dist/index.cjs205.js +1 -1
- package/dist/index.cjs205.js.map +1 -1
- package/dist/index.cjs206.js +1 -1
- package/dist/index.cjs206.js.map +1 -1
- package/dist/index.cjs207.js +1 -1
- package/dist/index.cjs207.js.map +1 -1
- package/dist/index.cjs208.js +1 -1
- package/dist/index.cjs208.js.map +1 -1
- package/dist/index.cjs209.js +1 -1
- package/dist/index.cjs209.js.map +1 -1
- package/dist/index.cjs21.js +1 -1
- package/dist/index.cjs210.js +1 -1
- package/dist/index.cjs210.js.map +1 -1
- package/dist/index.cjs211.js +1 -1
- package/dist/index.cjs211.js.map +1 -1
- package/dist/index.cjs212.js +1 -1
- package/dist/index.cjs212.js.map +1 -1
- package/dist/index.cjs213.js +1 -1
- package/dist/index.cjs213.js.map +1 -1
- package/dist/index.cjs214.js +1 -1
- package/dist/index.cjs214.js.map +1 -1
- package/dist/index.cjs215.js +1 -1
- package/dist/index.cjs215.js.map +1 -1
- package/dist/index.cjs216.js +1 -1
- package/dist/index.cjs216.js.map +1 -1
- package/dist/index.cjs217.js +1 -1
- package/dist/index.cjs217.js.map +1 -1
- package/dist/index.cjs218.js +1 -1
- package/dist/index.cjs218.js.map +1 -1
- package/dist/index.cjs219.js +1 -1
- package/dist/index.cjs219.js.map +1 -1
- package/dist/index.cjs220.js +1 -1
- package/dist/index.cjs220.js.map +1 -1
- package/dist/index.cjs221.js +1 -1
- package/dist/index.cjs221.js.map +1 -1
- package/dist/index.cjs222.js +1 -1
- package/dist/index.cjs222.js.map +1 -1
- package/dist/index.cjs223.js +1 -1
- package/dist/index.cjs223.js.map +1 -1
- package/dist/index.cjs224.js +1 -1
- package/dist/index.cjs224.js.map +1 -1
- package/dist/index.cjs225.js +1 -1
- package/dist/index.cjs225.js.map +1 -1
- package/dist/index.cjs226.js +1 -1
- package/dist/index.cjs226.js.map +1 -1
- package/dist/index.cjs227.js +1 -1
- package/dist/index.cjs227.js.map +1 -1
- package/dist/index.cjs228.js +1 -1
- package/dist/index.cjs228.js.map +1 -1
- package/dist/index.cjs229.js +1 -1
- package/dist/index.cjs229.js.map +1 -1
- package/dist/index.cjs230.js +1 -1
- package/dist/index.cjs230.js.map +1 -1
- package/dist/index.cjs231.js +1 -1
- package/dist/index.cjs231.js.map +1 -1
- package/dist/index.cjs232.js +1 -1
- package/dist/index.cjs232.js.map +1 -1
- package/dist/index.cjs233.js +1 -1
- package/dist/index.cjs233.js.map +1 -1
- package/dist/index.cjs234.js +1 -1
- package/dist/index.cjs234.js.map +1 -1
- package/dist/index.cjs235.js +1 -1
- package/dist/index.cjs235.js.map +1 -1
- package/dist/index.cjs236.js +1 -1
- package/dist/index.cjs236.js.map +1 -1
- package/dist/index.cjs238.js +1 -1
- package/dist/index.cjs24.js +1 -1
- package/dist/index.cjs241.js +1 -1
- package/dist/index.cjs244.js +1 -1
- package/dist/index.cjs247.js +1 -1
- package/dist/index.cjs249.js +1 -1
- package/dist/index.cjs25.js +1 -1
- package/dist/index.cjs252.js +1 -1
- package/dist/index.cjs253.js +1 -1
- package/dist/index.cjs256.js +1 -1
- package/dist/index.cjs256.js.map +1 -1
- package/dist/index.cjs257.js +1 -1
- package/dist/index.cjs257.js.map +1 -1
- package/dist/index.cjs258.js +1 -1
- package/dist/index.cjs26.js +1 -1
- package/dist/index.cjs28.js +1 -1
- package/dist/index.cjs29.js +1 -1
- package/dist/index.cjs30.js +1 -1
- package/dist/index.cjs32.js +1 -1
- package/dist/index.cjs33.js +1 -1
- package/dist/index.cjs34.js +1 -1
- package/dist/index.cjs36.js +1 -1
- package/dist/index.cjs37.js +1 -1
- package/dist/index.cjs38.js +1 -1
- package/dist/index.cjs42.js +1 -1
- package/dist/index.cjs43.js +1 -1
- package/dist/index.cjs44.js +1 -1
- package/dist/index.cjs46.js +1 -1
- package/dist/index.cjs47.js +1 -1
- package/dist/index.cjs49.js +1 -1
- package/dist/index.cjs55.js +1 -1
- package/dist/index.cjs57.js +1 -1
- package/dist/index.cjs63.js +1 -1
- package/dist/index.cjs63.js.map +1 -1
- package/dist/index.cjs64.js +1 -1
- package/dist/index.cjs64.js.map +1 -1
- package/dist/index.cjs65.js +1 -1
- package/dist/index.cjs65.js.map +1 -1
- package/dist/index.cjs77.js +1 -1
- package/dist/index.cjs8.js +1 -1
- package/dist/index.cjs8.js.map +1 -1
- package/dist/index.cjs81.js +1 -1
- package/dist/index.cjs88.js +1 -1
- package/dist/index.cjs89.js +1 -1
- package/dist/index.cjs90.js +1 -1
- package/dist/index.cjs91.js +1 -1
- package/dist/index.cjs92.js +1 -1
- package/dist/index.cjs93.js +1 -1
- package/dist/index.cjs94.js +1 -1
- package/dist/index.cjs95.js +1 -1
- package/dist/index.cjs96.js +1 -1
- package/dist/index.cjs99.js +1 -1
- package/dist/index.es10.js +17 -16
- package/dist/index.es10.js.map +1 -1
- package/dist/index.es100.js +1 -1
- package/dist/index.es102.js +3 -3
- package/dist/index.es103.js +1 -1
- package/dist/index.es104.js +2 -2
- package/dist/index.es105.js +1 -1
- package/dist/index.es110.js +1 -1
- package/dist/index.es111.js +1 -1
- package/dist/index.es112.js +1 -1
- package/dist/index.es113.js +1 -1
- package/dist/index.es116.js +2 -2
- package/dist/index.es117.js +2 -2
- package/dist/index.es118.js +1 -1
- package/dist/index.es122.js +2 -2
- package/dist/index.es125.js +1 -1
- package/dist/index.es129.js +1 -1
- package/dist/index.es132.js +1 -1
- package/dist/index.es14.js +1 -1
- package/dist/index.es140.js +1 -1
- package/dist/index.es141.js +1 -1
- package/dist/index.es142.js +1 -1
- package/dist/index.es143.js +2 -2
- package/dist/index.es144.js +1 -1
- package/dist/index.es145.js +1 -1
- package/dist/index.es146.js +1 -1
- package/dist/index.es148.js +2 -2
- package/dist/index.es149.js +2 -2
- package/dist/index.es150.js +1 -1
- package/dist/index.es151.js +1 -1
- package/dist/index.es152.js +1 -1
- package/dist/index.es153.js +1 -1
- package/dist/index.es154.js +2 -2
- package/dist/index.es155.js +2 -2
- package/dist/index.es156.js +1 -1
- package/dist/index.es159.js +2 -2
- package/dist/index.es160.js +2 -2
- package/dist/index.es162.js +2 -2
- package/dist/index.es163.js +1 -1
- package/dist/index.es164.js +2 -2
- package/dist/index.es165.js +1 -1
- package/dist/index.es166.js +2 -2
- package/dist/index.es167.js +1 -1
- package/dist/index.es168.js +1 -1
- package/dist/index.es169.js +1 -1
- package/dist/index.es175.js +1 -1
- package/dist/index.es176.js +2 -2
- package/dist/index.es177.js +1 -1
- package/dist/index.es178.js +1 -1
- package/dist/index.es179.js +1 -1
- package/dist/index.es182.js +2 -2
- package/dist/index.es189.js +8 -2
- package/dist/index.es189.js.map +1 -1
- package/dist/index.es190.js +147 -7
- package/dist/index.es190.js.map +1 -1
- package/dist/index.es191.js +12188 -139
- package/dist/index.es191.js.map +1 -1
- package/dist/index.es192.js +3 -12199
- package/dist/index.es192.js.map +1 -1
- package/dist/index.es193.js +1 -1
- package/dist/index.es193.js.map +1 -1
- package/dist/index.es194.js +38 -3
- package/dist/index.es194.js.map +1 -1
- package/dist/index.es195.js +3 -38
- package/dist/index.es195.js.map +1 -1
- package/dist/index.es196.js +25 -3
- package/dist/index.es196.js.map +1 -1
- package/dist/index.es197.js +2 -25
- package/dist/index.es197.js.map +1 -1
- package/dist/index.es198.js +1 -0
- package/dist/index.es198.js.map +1 -1
- package/dist/index.es199.js +0 -1
- package/dist/index.es199.js.map +1 -1
- package/dist/index.es20.js +2 -2
- package/dist/index.es200.js +34 -2
- package/dist/index.es200.js.map +1 -1
- package/dist/index.es201.js +13 -32
- package/dist/index.es201.js.map +1 -1
- package/dist/index.es202.js +12 -11
- package/dist/index.es202.js.map +1 -1
- package/dist/index.es203.js +8 -13
- package/dist/index.es203.js.map +1 -1
- package/dist/index.es204.js +2 -9
- package/dist/index.es204.js.map +1 -1
- package/dist/index.es205.js +44 -6
- package/dist/index.es205.js.map +1 -1
- package/dist/index.es206.js +22 -4
- package/dist/index.es206.js.map +1 -1
- package/dist/index.es207.js +8 -4
- package/dist/index.es207.js.map +1 -1
- package/dist/index.es208.js +5 -3
- package/dist/index.es208.js.map +1 -1
- package/dist/index.es209.js +4 -3
- package/dist/index.es209.js.map +1 -1
- package/dist/index.es21.js +2 -2
- package/dist/index.es210.js +3 -9
- package/dist/index.es210.js.map +1 -1
- package/dist/index.es211.js +3 -22
- package/dist/index.es211.js.map +1 -1
- package/dist/index.es212.js +8 -21
- package/dist/index.es212.js.map +1 -1
- package/dist/index.es213.js +19 -11
- package/dist/index.es213.js.map +1 -1
- package/dist/index.es214.js +19 -14
- package/dist/index.es214.js.map +1 -1
- package/dist/index.es215.js +13 -5
- package/dist/index.es215.js.map +1 -1
- package/dist/index.es216.js +16 -8
- package/dist/index.es216.js.map +1 -1
- package/dist/index.es217.js +5 -6
- package/dist/index.es217.js.map +1 -1
- package/dist/index.es218.js +7 -20
- package/dist/index.es218.js.map +1 -1
- package/dist/index.es219.js +5 -8
- package/dist/index.es219.js.map +1 -1
- package/dist/index.es220.js +22 -9
- package/dist/index.es220.js.map +1 -1
- package/dist/index.es221.js +10 -4
- package/dist/index.es221.js.map +1 -1
- package/dist/index.es222.js +9 -11
- package/dist/index.es222.js.map +1 -1
- package/dist/index.es223.js +4 -9
- package/dist/index.es223.js.map +1 -1
- package/dist/index.es224.js +9 -21
- package/dist/index.es224.js.map +1 -1
- package/dist/index.es225.js +8 -11
- package/dist/index.es225.js.map +1 -1
- package/dist/index.es226.js +22 -18
- package/dist/index.es226.js.map +1 -1
- package/dist/index.es227.js +12 -4
- package/dist/index.es227.js.map +1 -1
- package/dist/index.es228.js +17 -16
- package/dist/index.es228.js.map +1 -1
- package/dist/index.es229.js +4 -12
- package/dist/index.es229.js.map +1 -1
- package/dist/index.es230.js +17 -3
- package/dist/index.es230.js.map +1 -1
- package/dist/index.es231.js +11 -4
- package/dist/index.es231.js.map +1 -1
- package/dist/index.es232.js +3 -45
- package/dist/index.es232.js.map +1 -1
- package/dist/index.es233.js +4 -22
- package/dist/index.es233.js.map +1 -1
- package/dist/index.es234.js +3 -6
- package/dist/index.es234.js.map +1 -1
- package/dist/index.es235.js +8 -3
- package/dist/index.es235.js.map +1 -1
- package/dist/index.es236.js +4 -6
- package/dist/index.es236.js.map +1 -1
- package/dist/index.es238.js +1 -1
- package/dist/index.es24.js +1 -1
- package/dist/index.es241.js +1 -1
- package/dist/index.es244.js +1 -1
- package/dist/index.es247.js +2 -2
- package/dist/index.es249.js +1 -1
- package/dist/index.es25.js +1 -1
- package/dist/index.es252.js +1 -1
- package/dist/index.es253.js +1 -1
- package/dist/index.es256.js +15 -4
- package/dist/index.es256.js.map +1 -1
- package/dist/index.es257.js +4 -15
- package/dist/index.es257.js.map +1 -1
- package/dist/index.es258.js +2 -2
- package/dist/index.es26.js +2 -2
- package/dist/index.es28.js +2 -2
- package/dist/index.es29.js +2 -2
- package/dist/index.es30.js +2 -2
- package/dist/index.es32.js +1 -1
- package/dist/index.es33.js +2 -2
- package/dist/index.es34.js +2 -2
- package/dist/index.es36.js +1 -1
- package/dist/index.es37.js +1 -1
- package/dist/index.es38.js +1 -1
- package/dist/index.es42.js +2 -2
- package/dist/index.es43.js +3 -3
- package/dist/index.es44.js +1 -1
- package/dist/index.es46.js +1 -1
- package/dist/index.es47.js +1 -1
- package/dist/index.es49.js +1 -1
- package/dist/index.es55.js +1 -1
- package/dist/index.es57.js +6 -6
- package/dist/index.es63.js +2 -107
- package/dist/index.es63.js.map +1 -1
- package/dist/index.es64.js +107 -10
- package/dist/index.es64.js.map +1 -1
- package/dist/index.es65.js +10 -2
- package/dist/index.es65.js.map +1 -1
- package/dist/index.es77.js +1 -1
- package/dist/index.es8.js +36 -34
- package/dist/index.es8.js.map +1 -1
- package/dist/index.es81.js +1 -1
- package/dist/index.es88.js +1 -1
- package/dist/index.es89.js +1 -1
- package/dist/index.es90.js +1 -1
- package/dist/index.es91.js +1 -1
- package/dist/index.es92.js +1 -1
- package/dist/index.es93.js +1 -1
- package/dist/index.es94.js +1 -1
- package/dist/index.es95.js +1 -1
- package/dist/index.es96.js +1 -1
- package/dist/index.es99.js +1 -1
- package/package.json +1 -1
- package/src/components/MapDraw.js +8 -1
- package/src/components/WarpedImageLayer.js +8 -1
- package/types/components/MapDraw.js.flow +8 -1
- package/types/components/WarpedImageLayer.js.flow +8 -1
package/dist/index.es65.js
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
import e from "react";
|
|
2
|
+
var t = {
|
|
3
|
+
color: void 0,
|
|
4
|
+
size: void 0,
|
|
5
|
+
className: void 0,
|
|
6
|
+
style: void 0,
|
|
7
|
+
attr: void 0
|
|
8
|
+
}, d = e.createContext && /* @__PURE__ */ e.createContext(t);
|
|
2
9
|
export {
|
|
3
|
-
|
|
10
|
+
t as DefaultContext,
|
|
11
|
+
d as IconContext
|
|
4
12
|
};
|
|
5
13
|
//# sourceMappingURL=index.es65.js.map
|
package/dist/index.es65.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es65.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
1
|
+
{"version":3,"file":"index.es65.js","sources":["../../../node_modules/react-icons/lib/iconContext.mjs"],"sourcesContent":["import React from \"react\";\nexport var DefaultContext = {\n color: undefined,\n size: undefined,\n className: undefined,\n style: undefined,\n attr: undefined\n};\nexport var IconContext = React.createContext && /*#__PURE__*/React.createContext(DefaultContext);"],"names":["DefaultContext","IconContext","React"],"mappings":";AACU,IAACA,IAAiB;AAAA,EAC1B,OAAO;AAAA,EACP,MAAM;AAAA,EACN,WAAW;AAAA,EACX,OAAO;AAAA,EACP,MAAM;AACR,GACWC,IAAcC,EAAM,iBAA8BA,gBAAAA,EAAM,cAAcF,CAAc;","x_google_ignoreList":[0]}
|
package/dist/index.es77.js
CHANGED
package/dist/index.es8.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { j as i } from "./index.es17.js";
|
|
2
2
|
import l from "./index.es14.js";
|
|
3
3
|
import b from "./index.es19.js";
|
|
4
|
-
import { useState as
|
|
5
|
-
import { Map as
|
|
6
|
-
import { FullscreenControl as
|
|
7
|
-
import
|
|
4
|
+
import { useState as D, useRef as u, useCallback as a, useMemo as g, useEffect as h } from "react";
|
|
5
|
+
import { Map as x, NavigationControl as R } from "./index.es15.js";
|
|
6
|
+
import { FullscreenControl as w } from "./index.es51.js";
|
|
7
|
+
import G from "./index.es22.js";
|
|
8
8
|
import "./index.es23.js";
|
|
9
9
|
import "./index.es24.js";
|
|
10
10
|
import "./index.es25.js";
|
|
@@ -32,49 +32,50 @@ import "./index.es46.js";
|
|
|
32
32
|
import "./index.es47.js";
|
|
33
33
|
import "./index.es48.js";
|
|
34
34
|
import "./index.es49.js";
|
|
35
|
-
import
|
|
36
|
-
import
|
|
37
|
-
import
|
|
35
|
+
import L from "./index.es2.js";
|
|
36
|
+
import O from "./index.es4.js";
|
|
37
|
+
import S from "./index.es12.js";
|
|
38
38
|
import "./index.es52.js";
|
|
39
|
-
import { feature as
|
|
39
|
+
import { feature as v } from "./index.es53.js";
|
|
40
40
|
l.constants.classes.CONTROL_BASE = "maplibregl-ctrl";
|
|
41
41
|
l.constants.classes.CONTROL_PREFIX = "maplibregl-ctrl-";
|
|
42
42
|
l.constants.classes.CONTROL_GROUP = "maplibregl-ctrl-group";
|
|
43
|
-
const
|
|
43
|
+
const B = 2, E = 1e3, m = {
|
|
44
44
|
geometryCollection: "GeometryCollection",
|
|
45
45
|
point: "Point",
|
|
46
46
|
polygon: "Polygon"
|
|
47
|
-
},
|
|
48
|
-
const [
|
|
49
|
-
if (!
|
|
47
|
+
}, _ = (t) => {
|
|
48
|
+
const [s, d] = D(!1), o = u(), c = u(), f = a((e) => {
|
|
49
|
+
if (!e)
|
|
50
50
|
return !1;
|
|
51
|
-
const { geometry: { type: n } } =
|
|
51
|
+
const { geometry: { type: n } } = e;
|
|
52
52
|
return t.geocoding === "point" && n === m.point || t.geocoding === "polygon" && n === m.polygon;
|
|
53
|
-
}, [t.geocoding]), r = a(() => t.onChange(
|
|
54
|
-
f(
|
|
53
|
+
}, [t.geocoding]), r = a(() => t.onChange(o.current.getAll()), [t.onChange]), y = a(({ detail: e }) => {
|
|
54
|
+
f(e) && (o.current.add(e.geometry), r(), t.onGeocodingSelection(e));
|
|
55
55
|
}, [f, r, t.onGeocodingSelection]), p = g(() => `${t.mapStyle}?key=${t.apiKey}`, [t.apiKey, t.mapStyle]), C = g(() => ({ height: 500, width: "100%", ...t.style || {} }), [t.style]);
|
|
56
|
-
return
|
|
57
|
-
if (
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}) :
|
|
56
|
+
return h(() => {
|
|
57
|
+
if (s && t.data) {
|
|
58
|
+
const e = S.getBoundingBox(t.data, t.buffer);
|
|
59
|
+
e && c.current.fitBounds(e, { duration: t.zoomDuration }), t.data.type === m.geometryCollection ? G.each(t.data.geometries, (n) => {
|
|
60
|
+
o.current.add(v(n));
|
|
61
|
+
}) : o.current.add(t.data);
|
|
62
62
|
}
|
|
63
|
-
}, [
|
|
64
|
-
|
|
63
|
+
}, [s, t.data]), /* @__PURE__ */ i.jsxs(
|
|
64
|
+
x,
|
|
65
65
|
{
|
|
66
66
|
attributionControl: !1,
|
|
67
67
|
cooperativeGestures: t.cooperativeGestures,
|
|
68
|
-
onLoad: () => d(!0),
|
|
69
68
|
mapLib: b,
|
|
70
|
-
|
|
69
|
+
onLoad: () => d(!0),
|
|
70
|
+
preserveDrawingBuffer: t.preserveDrawingBuffer,
|
|
71
|
+
ref: c,
|
|
71
72
|
style: C,
|
|
72
73
|
mapStyle: p,
|
|
73
74
|
children: [
|
|
74
75
|
/* @__PURE__ */ i.jsx(
|
|
75
|
-
|
|
76
|
+
L,
|
|
76
77
|
{
|
|
77
|
-
ref:
|
|
78
|
+
ref: o,
|
|
78
79
|
controls: {
|
|
79
80
|
line_string: !0,
|
|
80
81
|
point: !0,
|
|
@@ -89,7 +90,7 @@ const j = 2, w = 1e3, m = {
|
|
|
89
90
|
}
|
|
90
91
|
),
|
|
91
92
|
t.geocoding && /* @__PURE__ */ i.jsx(
|
|
92
|
-
|
|
93
|
+
O,
|
|
93
94
|
{
|
|
94
95
|
apiKey: t.apiKey,
|
|
95
96
|
marker: !1,
|
|
@@ -99,19 +100,20 @@ const j = 2, w = 1e3, m = {
|
|
|
99
100
|
showResultMarkers: !1
|
|
100
101
|
}
|
|
101
102
|
),
|
|
102
|
-
t.navigation && /* @__PURE__ */ i.jsx(
|
|
103
|
-
t.fullscreen && /* @__PURE__ */ i.jsx(
|
|
103
|
+
t.navigation && /* @__PURE__ */ i.jsx(R, {}),
|
|
104
|
+
t.fullscreen && /* @__PURE__ */ i.jsx(w, {}),
|
|
104
105
|
t.children
|
|
105
106
|
]
|
|
106
107
|
}
|
|
107
108
|
);
|
|
108
109
|
};
|
|
109
|
-
|
|
110
|
-
buffer:
|
|
110
|
+
_.defaultProps = {
|
|
111
|
+
buffer: B,
|
|
111
112
|
cooperativeGestures: !0,
|
|
112
|
-
|
|
113
|
+
preserveDrawingBuffer: !1,
|
|
114
|
+
zoomDuration: E
|
|
113
115
|
};
|
|
114
116
|
export {
|
|
115
|
-
|
|
117
|
+
_ as default
|
|
116
118
|
};
|
|
117
119
|
//# sourceMappingURL=index.es8.js.map
|
package/dist/index.es8.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es8.js","sources":["../src/components/MapDraw.js"],"sourcesContent":["// @flow\n\nimport MapboxDraw from '@mapbox/mapbox-gl-draw';\nimport { feature, type FeatureCollection, type GeometryCollection } from '@turf/turf';\nimport maplibregl from 'maplibre-gl';\nimport React, {\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n type Node\n} from 'react';\nimport Map, { type MapboxMap, NavigationControl } from 'react-map-gl';\nimport { FullscreenControl } from 'react-map-gl/maplibre';\nimport _ from 'underscore';\nimport DrawControl from './DrawControl';\nimport GeocodingControl from './GeocodingControl';\nimport MapUtils from '../utils/Map';\nimport './MapDraw.css';\n\n// Override the MapboxDraw components to use MapLibre styles\nMapboxDraw.constants.classes.CONTROL_BASE = 'maplibregl-ctrl';\nMapboxDraw.constants.classes.CONTROL_PREFIX = 'maplibregl-ctrl-';\nMapboxDraw.constants.classes.CONTROL_GROUP = 'maplibregl-ctrl-group';\n\ntype Props = {\n /**\n * MapTiler API key.\n */\n apiKey?: string,\n\n /**\n * The number of miles to buffer the GeoJSON data.\n */\n buffer?: number,\n\n /**\n * Additional child nodes to render.\n */\n children?: Node,\n\n /**\n * If `true`, the map will require CTRL + scroll to zoom.\n */\n cooperativeGestures?: boolean,\n\n /**\n * GeoJSON structured data to be displayed on the map.\n */\n data: GeometryCollection | FeatureCollection,\n\n /**\n * If `true`, a control will be rendered to put the map in full screen mode.\n */\n fullscreen?: boolean,\n\n /**\n * Controls the type of GeoJSON data returned from the MapTiler Geocoding API.\n */\n geocoding?: undefined | 'point' | 'polygon',\n\n /**\n * URL of the map style to render. This URL should contain any necessary API keys.\n */\n mapStyle: string,\n\n /**\n * If `true`, the navigation controls will display.\n */\n navigation?: boolean,\n\n /**\n * Callback fired when the map geometries are changed.\n *\n * @param features\n */\n onChange: (features: Array<any>) => void,\n\n /**\n * Callback fired when an item is selected from the geocoding dropdown.\n */\n onGeocodingSelection?: (data: any) => void,\n\n /**\n * Map style object.\n */\n style?: any,\n\n /**\n * The time in milliseconds to zoom into the location.\n */\n zoomDuration?: number\n};\n\nconst DEFAULT_BUFFER = 2;\nconst DEFAULT_ZOOM_DELAY = 1000;\n\nconst GeometryTypes = {\n geometryCollection: 'GeometryCollection',\n point: 'Point',\n polygon: 'Polygon'\n};\n\n/**\n * This component renders a map with controls for drawing one or more geometries. Geometries can be a point (lat/long),\n * a line, or a polygon.\n */\nconst MapDraw = (props: Props) => {\n const [loaded, setLoaded] = useState(false);\n\n const drawRef = useRef<MapboxDraw>();\n const mapRef = useRef<MapboxMap>();\n\n /**\n * Returns true if the passed geometry type is valid. MapTiler fires the onSelection callback twice: Once after\n * selecting the record from the list (with a point geometry), and once after making a call to the server for the\n * full record (polygon geometry). We should on fire the onGeocodingSelection callback and add the geometry to the\n * map once.\n *\n * @type {function({geometry: {type: *}}): *}\n */\n const isValid = useCallback((detail) => {\n if (!detail) {\n return false;\n }\n\n const { geometry: { type } } = detail;\n\n return (props.geocoding === 'point' && type === GeometryTypes.point)\n || (props.geocoding === 'polygon' && type === GeometryTypes.polygon);\n }, [props.geocoding]);\n\n /**\n * Calls the onChange prop with all of the geometries in the current drawer.\n *\n * @type {(function(): void)|*}\n */\n const onChange = useCallback(() => props.onChange(drawRef.current.getAll()), [props.onChange]);\n\n /**\n * Adds the selected geometry to the map.\n *\n * @type {(function({detail: *}): void)|*}\n */\n const onSelection = useCallback(({ detail }) => {\n if (isValid(detail)) {\n // Add the geometry to the map\n drawRef.current.add(detail.geometry);\n\n // Trigger the onChange prop\n onChange();\n\n // Call the onGeocoding selection callback\n props.onGeocodingSelection(detail);\n }\n }, [isValid, onChange, props.onGeocodingSelection]);\n\n /**\n * Sets the map style URL.\n *\n * @type {string}\n */\n const mapStyleUrl = useMemo(() => `${props.mapStyle}?key=${props.apiKey}`, [props.apiKey, props.mapStyle]);\n\n /**\n * Sets the element map style.\n *\n * @type {{width: string, height: number}}\n */\n const style = useMemo(() => ({ height: 500, width: '100%', ...(props.style || {}) }), [props.style]);\n\n /**\n * Updates the map bounding box and drawer when the geometry is changed.\n */\n useEffect(() => {\n if (loaded && props.data) {\n // Sets the bounding box for the current geometry\n const bbox = MapUtils.getBoundingBox(props.data, props.buffer);\n\n if (bbox) {\n mapRef.current.fitBounds(bbox, { duration: props.zoomDuration });\n }\n\n // Handle special cases for geometry collection (not supported by mabox-gl-draw) and point\n if (props.data.type === GeometryTypes.geometryCollection) {\n _.each(props.data.geometries, (geometry) => {\n drawRef.current.add(feature(geometry));\n });\n } else {\n drawRef.current.add(props.data);\n }\n }\n }, [loaded, props.data]);\n\n return (\n <Map\n attributionControl={false}\n cooperativeGestures={props.cooperativeGestures}\n onLoad={() => setLoaded(true)}\n
|
|
1
|
+
{"version":3,"file":"index.es8.js","sources":["../src/components/MapDraw.js"],"sourcesContent":["// @flow\n\nimport MapboxDraw from '@mapbox/mapbox-gl-draw';\nimport { feature, type FeatureCollection, type GeometryCollection } from '@turf/turf';\nimport maplibregl from 'maplibre-gl';\nimport React, {\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n type Node\n} from 'react';\nimport Map, { type MapboxMap, NavigationControl } from 'react-map-gl';\nimport { FullscreenControl } from 'react-map-gl/maplibre';\nimport _ from 'underscore';\nimport DrawControl from './DrawControl';\nimport GeocodingControl from './GeocodingControl';\nimport MapUtils from '../utils/Map';\nimport './MapDraw.css';\n\n// Override the MapboxDraw components to use MapLibre styles\nMapboxDraw.constants.classes.CONTROL_BASE = 'maplibregl-ctrl';\nMapboxDraw.constants.classes.CONTROL_PREFIX = 'maplibregl-ctrl-';\nMapboxDraw.constants.classes.CONTROL_GROUP = 'maplibregl-ctrl-group';\n\ntype Props = {\n /**\n * MapTiler API key.\n */\n apiKey?: string,\n\n /**\n * The number of miles to buffer the GeoJSON data.\n */\n buffer?: number,\n\n /**\n * Additional child nodes to render.\n */\n children?: Node,\n\n /**\n * If `true`, the map will require CTRL + scroll to zoom.\n */\n cooperativeGestures?: boolean,\n\n /**\n * GeoJSON structured data to be displayed on the map.\n */\n data: GeometryCollection | FeatureCollection,\n\n /**\n * If `true`, a control will be rendered to put the map in full screen mode.\n */\n fullscreen?: boolean,\n\n /**\n * Controls the type of GeoJSON data returned from the MapTiler Geocoding API.\n */\n geocoding?: undefined | 'point' | 'polygon',\n\n /**\n * URL of the map style to render. This URL should contain any necessary API keys.\n */\n mapStyle: string,\n\n /**\n * If `true`, the navigation controls will display.\n */\n navigation?: boolean,\n\n /**\n * Callback fired when the map geometries are changed.\n *\n * @param features\n */\n onChange: (features: Array<any>) => void,\n\n /**\n * Callback fired when an item is selected from the geocoding dropdown.\n */\n onGeocodingSelection?: (data: any) => void,\n\n /**\n * If `true`, the map's canvas can be exported to a PNG using `map.getCanvas().toDataURL()`.\n */\n preserveDrawingBuffer?: boolean,\n\n /**\n * Map style object.\n */\n style?: any,\n\n /**\n * The time in milliseconds to zoom into the location.\n */\n zoomDuration?: number\n};\n\nconst DEFAULT_BUFFER = 2;\nconst DEFAULT_ZOOM_DELAY = 1000;\n\nconst GeometryTypes = {\n geometryCollection: 'GeometryCollection',\n point: 'Point',\n polygon: 'Polygon'\n};\n\n/**\n * This component renders a map with controls for drawing one or more geometries. Geometries can be a point (lat/long),\n * a line, or a polygon.\n */\nconst MapDraw = (props: Props) => {\n const [loaded, setLoaded] = useState(false);\n\n const drawRef = useRef<MapboxDraw>();\n const mapRef = useRef<MapboxMap>();\n\n /**\n * Returns true if the passed geometry type is valid. MapTiler fires the onSelection callback twice: Once after\n * selecting the record from the list (with a point geometry), and once after making a call to the server for the\n * full record (polygon geometry). We should on fire the onGeocodingSelection callback and add the geometry to the\n * map once.\n *\n * @type {function({geometry: {type: *}}): *}\n */\n const isValid = useCallback((detail) => {\n if (!detail) {\n return false;\n }\n\n const { geometry: { type } } = detail;\n\n return (props.geocoding === 'point' && type === GeometryTypes.point)\n || (props.geocoding === 'polygon' && type === GeometryTypes.polygon);\n }, [props.geocoding]);\n\n /**\n * Calls the onChange prop with all of the geometries in the current drawer.\n *\n * @type {(function(): void)|*}\n */\n const onChange = useCallback(() => props.onChange(drawRef.current.getAll()), [props.onChange]);\n\n /**\n * Adds the selected geometry to the map.\n *\n * @type {(function({detail: *}): void)|*}\n */\n const onSelection = useCallback(({ detail }) => {\n if (isValid(detail)) {\n // Add the geometry to the map\n drawRef.current.add(detail.geometry);\n\n // Trigger the onChange prop\n onChange();\n\n // Call the onGeocoding selection callback\n props.onGeocodingSelection(detail);\n }\n }, [isValid, onChange, props.onGeocodingSelection]);\n\n /**\n * Sets the map style URL.\n *\n * @type {string}\n */\n const mapStyleUrl = useMemo(() => `${props.mapStyle}?key=${props.apiKey}`, [props.apiKey, props.mapStyle]);\n\n /**\n * Sets the element map style.\n *\n * @type {{width: string, height: number}}\n */\n const style = useMemo(() => ({ height: 500, width: '100%', ...(props.style || {}) }), [props.style]);\n\n /**\n * Updates the map bounding box and drawer when the geometry is changed.\n */\n useEffect(() => {\n if (loaded && props.data) {\n // Sets the bounding box for the current geometry\n const bbox = MapUtils.getBoundingBox(props.data, props.buffer);\n\n if (bbox) {\n mapRef.current.fitBounds(bbox, { duration: props.zoomDuration });\n }\n\n // Handle special cases for geometry collection (not supported by mabox-gl-draw) and point\n if (props.data.type === GeometryTypes.geometryCollection) {\n _.each(props.data.geometries, (geometry) => {\n drawRef.current.add(feature(geometry));\n });\n } else {\n drawRef.current.add(props.data);\n }\n }\n }, [loaded, props.data]);\n\n return (\n <Map\n attributionControl={false}\n cooperativeGestures={props.cooperativeGestures}\n mapLib={maplibregl}\n onLoad={() => setLoaded(true)}\n preserveDrawingBuffer={props.preserveDrawingBuffer}\n ref={mapRef}\n style={style}\n mapStyle={mapStyleUrl}\n >\n <DrawControl\n ref={drawRef}\n controls={{\n line_string: true,\n point: true,\n polygon: true,\n trash: true\n }}\n displayControlsDefault={false}\n onCreate={onChange}\n onUpdate={onChange}\n onDelete={onChange}\n position='bottom-left'\n />\n { props.geocoding && (\n <GeocodingControl\n apiKey={props.apiKey}\n marker={false}\n position='top-left'\n onSelection={onSelection}\n showFullGeometry={props.geocoding === 'polygon'}\n showResultMarkers={false}\n />\n )}\n { props.navigation && (\n <NavigationControl />\n )}\n { props.fullscreen && (\n <FullscreenControl />\n )}\n { props.children }\n </Map>\n );\n};\n\nMapDraw.defaultProps = {\n buffer: DEFAULT_BUFFER,\n cooperativeGestures: true,\n preserveDrawingBuffer: false,\n zoomDuration: DEFAULT_ZOOM_DELAY\n};\n\nexport default MapDraw;\n"],"names":["MapboxDraw","DEFAULT_BUFFER","DEFAULT_ZOOM_DELAY","GeometryTypes","MapDraw","props","loaded","setLoaded","useState","drawRef","useRef","mapRef","isValid","useCallback","detail","type","onChange","onSelection","mapStyleUrl","useMemo","style","useEffect","bbox","MapUtils","_","geometry","feature","jsxs","Map","maplibregl","jsx","DrawControl","GeocodingControl","NavigationControl","FullscreenControl"],"mappings":"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"}
|
package/dist/index.es81.js
CHANGED
|
@@ -2,7 +2,7 @@ import r from "./index.es27.js";
|
|
|
2
2
|
import n from "./index.es148.js";
|
|
3
3
|
import f from "./index.es109.js";
|
|
4
4
|
import { push as u } from "./index.es23.js";
|
|
5
|
-
import m from "./index.
|
|
5
|
+
import m from "./index.es233.js";
|
|
6
6
|
function l(o) {
|
|
7
7
|
return n(f(o), function(t) {
|
|
8
8
|
var i = r[t] = o[t];
|
package/dist/index.es88.js
CHANGED
package/dist/index.es89.js
CHANGED
package/dist/index.es90.js
CHANGED
package/dist/index.es91.js
CHANGED
package/dist/index.es92.js
CHANGED
package/dist/index.es93.js
CHANGED
package/dist/index.es94.js
CHANGED
package/dist/index.es95.js
CHANGED
package/dist/index.es96.js
CHANGED
package/dist/index.es99.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { supportsArrayBuffer as i, nativeIsView as t, toString as a } from "./index.es23.js";
|
|
2
2
|
import e from "./index.es95.js";
|
|
3
3
|
import o from "./index.es120.js";
|
|
4
|
-
import n from "./index.
|
|
4
|
+
import n from "./index.es209.js";
|
|
5
5
|
var s = /\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;
|
|
6
6
|
function f(r) {
|
|
7
7
|
return t ? t(r) && !e(r) : n(r) && s.test(a.call(r));
|
package/package.json
CHANGED
|
@@ -82,6 +82,11 @@ type Props = {
|
|
|
82
82
|
*/
|
|
83
83
|
onGeocodingSelection?: (data: any) => void,
|
|
84
84
|
|
|
85
|
+
/**
|
|
86
|
+
* If `true`, the map's canvas can be exported to a PNG using `map.getCanvas().toDataURL()`.
|
|
87
|
+
*/
|
|
88
|
+
preserveDrawingBuffer?: boolean,
|
|
89
|
+
|
|
85
90
|
/**
|
|
86
91
|
* Map style object.
|
|
87
92
|
*/
|
|
@@ -197,8 +202,9 @@ const MapDraw = (props: Props) => {
|
|
|
197
202
|
<Map
|
|
198
203
|
attributionControl={false}
|
|
199
204
|
cooperativeGestures={props.cooperativeGestures}
|
|
200
|
-
onLoad={() => setLoaded(true)}
|
|
201
205
|
mapLib={maplibregl}
|
|
206
|
+
onLoad={() => setLoaded(true)}
|
|
207
|
+
preserveDrawingBuffer={props.preserveDrawingBuffer}
|
|
202
208
|
ref={mapRef}
|
|
203
209
|
style={style}
|
|
204
210
|
mapStyle={mapStyleUrl}
|
|
@@ -241,6 +247,7 @@ const MapDraw = (props: Props) => {
|
|
|
241
247
|
MapDraw.defaultProps = {
|
|
242
248
|
buffer: DEFAULT_BUFFER,
|
|
243
249
|
cooperativeGestures: true,
|
|
250
|
+
preserveDrawingBuffer: false,
|
|
244
251
|
zoomDuration: DEFAULT_ZOOM_DELAY
|
|
245
252
|
};
|
|
246
253
|
|
|
@@ -31,9 +31,16 @@ const WarpedImageLayer = (props: Props) => {
|
|
|
31
31
|
|
|
32
32
|
const mapRef = useMap();
|
|
33
33
|
|
|
34
|
+
/**
|
|
35
|
+
* Sets the "loaded" attribute on the state based on the current map state.
|
|
36
|
+
*/
|
|
34
37
|
useEffect(() => {
|
|
35
38
|
const instance = mapRef?.current?.getMap();
|
|
36
|
-
|
|
39
|
+
if (instance && instance.loaded()) {
|
|
40
|
+
setLoaded(true);
|
|
41
|
+
} else if (instance) {
|
|
42
|
+
instance.on('load', () => setLoaded(true));
|
|
43
|
+
}
|
|
37
44
|
}, []);
|
|
38
45
|
|
|
39
46
|
/**
|
|
@@ -82,6 +82,11 @@ type Props = {
|
|
|
82
82
|
*/
|
|
83
83
|
onGeocodingSelection?: (data: any) => void,
|
|
84
84
|
|
|
85
|
+
/**
|
|
86
|
+
* If `true`, the map's canvas can be exported to a PNG using `map.getCanvas().toDataURL()`.
|
|
87
|
+
*/
|
|
88
|
+
preserveDrawingBuffer?: boolean,
|
|
89
|
+
|
|
85
90
|
/**
|
|
86
91
|
* Map style object.
|
|
87
92
|
*/
|
|
@@ -197,8 +202,9 @@ const MapDraw = (props: Props) => {
|
|
|
197
202
|
<Map
|
|
198
203
|
attributionControl={false}
|
|
199
204
|
cooperativeGestures={props.cooperativeGestures}
|
|
200
|
-
onLoad={() => setLoaded(true)}
|
|
201
205
|
mapLib={maplibregl}
|
|
206
|
+
onLoad={() => setLoaded(true)}
|
|
207
|
+
preserveDrawingBuffer={props.preserveDrawingBuffer}
|
|
202
208
|
ref={mapRef}
|
|
203
209
|
style={style}
|
|
204
210
|
mapStyle={mapStyleUrl}
|
|
@@ -241,6 +247,7 @@ const MapDraw = (props: Props) => {
|
|
|
241
247
|
MapDraw.defaultProps = {
|
|
242
248
|
buffer: DEFAULT_BUFFER,
|
|
243
249
|
cooperativeGestures: true,
|
|
250
|
+
preserveDrawingBuffer: false,
|
|
244
251
|
zoomDuration: DEFAULT_ZOOM_DELAY
|
|
245
252
|
};
|
|
246
253
|
|
|
@@ -31,9 +31,16 @@ const WarpedImageLayer = (props: Props) => {
|
|
|
31
31
|
|
|
32
32
|
const mapRef = useMap();
|
|
33
33
|
|
|
34
|
+
/**
|
|
35
|
+
* Sets the "loaded" attribute on the state based on the current map state.
|
|
36
|
+
*/
|
|
34
37
|
useEffect(() => {
|
|
35
38
|
const instance = mapRef?.current?.getMap();
|
|
36
|
-
|
|
39
|
+
if (instance && instance.loaded()) {
|
|
40
|
+
setLoaded(true);
|
|
41
|
+
} else if (instance) {
|
|
42
|
+
instance.on('load', () => setLoaded(true));
|
|
43
|
+
}
|
|
37
44
|
}, []);
|
|
38
45
|
|
|
39
46
|
/**
|