@performant-software/geospatial 3.1.7-beta.3 → 3.1.7-beta.5

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.
Files changed (409) hide show
  1. package/dist/index.cjs100.js +1 -1
  2. package/dist/index.cjs103.js +1 -1
  3. package/dist/index.cjs104.js +1 -1
  4. package/dist/index.cjs106.js +1 -1
  5. package/dist/index.cjs107.js +1 -1
  6. package/dist/index.cjs108.js +1 -1
  7. package/dist/index.cjs109.js +1 -1
  8. package/dist/index.cjs114.js +1 -1
  9. package/dist/index.cjs115.js +1 -1
  10. package/dist/index.cjs116.js +1 -1
  11. package/dist/index.cjs117.js +1 -1
  12. package/dist/index.cjs120.js +1 -1
  13. package/dist/index.cjs121.js +1 -1
  14. package/dist/index.cjs122.js +1 -1
  15. package/dist/index.cjs126.js +1 -1
  16. package/dist/index.cjs129.js +1 -1
  17. package/dist/index.cjs133.js +1 -1
  18. package/dist/index.cjs136.js +1 -1
  19. package/dist/index.cjs14.js +1 -1
  20. package/dist/index.cjs144.js +1 -1
  21. package/dist/index.cjs145.js +1 -1
  22. package/dist/index.cjs146.js +1 -1
  23. package/dist/index.cjs147.js +1 -1
  24. package/dist/index.cjs148.js +1 -1
  25. package/dist/index.cjs149.js +1 -1
  26. package/dist/index.cjs15.js +1 -1
  27. package/dist/index.cjs150.js +1 -1
  28. package/dist/index.cjs152.js +1 -1
  29. package/dist/index.cjs153.js +1 -1
  30. package/dist/index.cjs154.js +1 -1
  31. package/dist/index.cjs155.js +1 -1
  32. package/dist/index.cjs156.js +1 -1
  33. package/dist/index.cjs157.js +1 -1
  34. package/dist/index.cjs158.js +1 -1
  35. package/dist/index.cjs159.js +1 -1
  36. package/dist/index.cjs16.js +1 -1
  37. package/dist/index.cjs160.js +1 -1
  38. package/dist/index.cjs163.js +1 -1
  39. package/dist/index.cjs164.js +1 -1
  40. package/dist/index.cjs166.js +1 -1
  41. package/dist/index.cjs167.js +1 -1
  42. package/dist/index.cjs168.js +1 -1
  43. package/dist/index.cjs169.js +1 -1
  44. package/dist/index.cjs17.js +1 -1
  45. package/dist/index.cjs170.js +1 -1
  46. package/dist/index.cjs171.js +1 -1
  47. package/dist/index.cjs172.js +1 -1
  48. package/dist/index.cjs173.js +1 -1
  49. package/dist/index.cjs179.js +1 -1
  50. package/dist/index.cjs18.js +1 -1
  51. package/dist/index.cjs180.js +1 -1
  52. package/dist/index.cjs181.js +1 -1
  53. package/dist/index.cjs182.js +1 -1
  54. package/dist/index.cjs183.js +1 -1
  55. package/dist/index.cjs188.js +1 -1
  56. package/dist/index.cjs19.js +1 -1
  57. package/dist/index.cjs20.js +1 -1
  58. package/dist/index.cjs201.js +1 -1
  59. package/dist/index.cjs201.js.map +1 -1
  60. package/dist/index.cjs202.js +1 -1
  61. package/dist/index.cjs202.js.map +1 -1
  62. package/dist/index.cjs203.js +1 -1
  63. package/dist/index.cjs203.js.map +1 -1
  64. package/dist/index.cjs204.js +1 -1
  65. package/dist/index.cjs204.js.map +1 -1
  66. package/dist/index.cjs205.js +1 -1
  67. package/dist/index.cjs205.js.map +1 -1
  68. package/dist/index.cjs206.js +1 -1
  69. package/dist/index.cjs206.js.map +1 -1
  70. package/dist/index.cjs207.js +1 -1
  71. package/dist/index.cjs207.js.map +1 -1
  72. package/dist/index.cjs208.js +1 -1
  73. package/dist/index.cjs208.js.map +1 -1
  74. package/dist/index.cjs209.js +1 -1
  75. package/dist/index.cjs209.js.map +1 -1
  76. package/dist/index.cjs21.js +1 -1
  77. package/dist/index.cjs210.js +1 -1
  78. package/dist/index.cjs210.js.map +1 -1
  79. package/dist/index.cjs211.js +1 -1
  80. package/dist/index.cjs211.js.map +1 -1
  81. package/dist/index.cjs212.js +1 -1
  82. package/dist/index.cjs212.js.map +1 -1
  83. package/dist/index.cjs213.js +1 -1
  84. package/dist/index.cjs213.js.map +1 -1
  85. package/dist/index.cjs214.js +1 -1
  86. package/dist/index.cjs214.js.map +1 -1
  87. package/dist/index.cjs215.js +1 -1
  88. package/dist/index.cjs215.js.map +1 -1
  89. package/dist/index.cjs216.js +1 -1
  90. package/dist/index.cjs216.js.map +1 -1
  91. package/dist/index.cjs217.js +1 -1
  92. package/dist/index.cjs217.js.map +1 -1
  93. package/dist/index.cjs218.js +1 -1
  94. package/dist/index.cjs218.js.map +1 -1
  95. package/dist/index.cjs219.js +1 -1
  96. package/dist/index.cjs219.js.map +1 -1
  97. package/dist/index.cjs22.js +1 -1
  98. package/dist/index.cjs220.js +1 -1
  99. package/dist/index.cjs220.js.map +1 -1
  100. package/dist/index.cjs221.js +1 -1
  101. package/dist/index.cjs221.js.map +1 -1
  102. package/dist/index.cjs222.js +1 -1
  103. package/dist/index.cjs222.js.map +1 -1
  104. package/dist/index.cjs223.js +1 -1
  105. package/dist/index.cjs223.js.map +1 -1
  106. package/dist/index.cjs224.js +1 -1
  107. package/dist/index.cjs224.js.map +1 -1
  108. package/dist/index.cjs225.js +1 -1
  109. package/dist/index.cjs225.js.map +1 -1
  110. package/dist/index.cjs226.js +1 -1
  111. package/dist/index.cjs226.js.map +1 -1
  112. package/dist/index.cjs227.js +1 -1
  113. package/dist/index.cjs227.js.map +1 -1
  114. package/dist/index.cjs228.js +1 -1
  115. package/dist/index.cjs228.js.map +1 -1
  116. package/dist/index.cjs229.js +1 -1
  117. package/dist/index.cjs229.js.map +1 -1
  118. package/dist/index.cjs23.js +1 -1
  119. package/dist/index.cjs230.js +1 -1
  120. package/dist/index.cjs230.js.map +1 -1
  121. package/dist/index.cjs231.js +1 -1
  122. package/dist/index.cjs231.js.map +1 -1
  123. package/dist/index.cjs232.js +1 -1
  124. package/dist/index.cjs232.js.map +1 -1
  125. package/dist/index.cjs233.js +1 -1
  126. package/dist/index.cjs233.js.map +1 -1
  127. package/dist/index.cjs234.js +1 -1
  128. package/dist/index.cjs234.js.map +1 -1
  129. package/dist/index.cjs235.js +1 -1
  130. package/dist/index.cjs235.js.map +1 -1
  131. package/dist/index.cjs238.js +1 -1
  132. package/dist/index.cjs238.js.map +1 -1
  133. package/dist/index.cjs239.js +1 -1
  134. package/dist/index.cjs239.js.map +1 -1
  135. package/dist/index.cjs24.js +1 -1
  136. package/dist/index.cjs240.js +1 -1
  137. package/dist/index.cjs240.js.map +1 -1
  138. package/dist/index.cjs241.js +1 -1
  139. package/dist/index.cjs241.js.map +1 -1
  140. package/dist/index.cjs242.js +1 -1
  141. package/dist/index.cjs242.js.map +1 -1
  142. package/dist/index.cjs250.js +1 -1
  143. package/dist/index.cjs255.js +1 -1
  144. package/dist/index.cjs258.js +1 -1
  145. package/dist/index.cjs262.js +1 -1
  146. package/dist/index.cjs262.js.map +1 -1
  147. package/dist/index.cjs263.js +1 -1
  148. package/dist/index.cjs263.js.map +1 -1
  149. package/dist/index.cjs27.js +1 -1
  150. package/dist/index.cjs28.js +1 -1
  151. package/dist/index.cjs29.js +1 -1
  152. package/dist/index.cjs31.js +1 -1
  153. package/dist/index.cjs33.js +1 -1
  154. package/dist/index.cjs34.js +1 -1
  155. package/dist/index.cjs37.js +1 -1
  156. package/dist/index.cjs38.js +1 -1
  157. package/dist/index.cjs39.js +1 -1
  158. package/dist/index.cjs41.js +1 -1
  159. package/dist/index.cjs42.js +1 -1
  160. package/dist/index.cjs43.js +1 -1
  161. package/dist/index.cjs45.js +1 -1
  162. package/dist/index.cjs46.js +1 -1
  163. package/dist/index.cjs47.js +1 -1
  164. package/dist/index.cjs49.js +1 -1
  165. package/dist/index.cjs50.js +1 -1
  166. package/dist/index.cjs51.js +1 -1
  167. package/dist/index.cjs55.js +1 -1
  168. package/dist/index.cjs56.js +1 -1
  169. package/dist/index.cjs57.js +1 -1
  170. package/dist/index.cjs59.js +1 -1
  171. package/dist/index.cjs60.js +1 -1
  172. package/dist/index.cjs62.js +1 -1
  173. package/dist/index.cjs71.js +743 -1
  174. package/dist/index.cjs71.js.map +1 -1
  175. package/dist/index.cjs73.js +1 -9
  176. package/dist/index.cjs73.js.map +1 -1
  177. package/dist/index.cjs74.js +1 -17
  178. package/dist/index.cjs74.js.map +1 -1
  179. package/dist/index.cjs75.js +9 -743
  180. package/dist/index.cjs75.js.map +1 -1
  181. package/dist/index.cjs76.js +17 -1
  182. package/dist/index.cjs76.js.map +1 -1
  183. package/dist/index.cjs77.js +1 -1
  184. package/dist/index.cjs77.js.map +1 -1
  185. package/dist/index.cjs78.js +1 -1
  186. package/dist/index.cjs78.js.map +1 -1
  187. package/dist/index.cjs79.js +1 -1
  188. package/dist/index.cjs79.js.map +1 -1
  189. package/dist/index.cjs8.js +1 -1
  190. package/dist/index.cjs8.js.map +1 -1
  191. package/dist/index.cjs80.js +1 -1
  192. package/dist/index.cjs80.js.map +1 -1
  193. package/dist/index.cjs81.js +1 -1
  194. package/dist/index.cjs81.js.map +1 -1
  195. package/dist/index.cjs85.js +1 -1
  196. package/dist/index.cjs92.js +1 -1
  197. package/dist/index.cjs93.js +1 -1
  198. package/dist/index.cjs94.js +1 -1
  199. package/dist/index.cjs95.js +1 -1
  200. package/dist/index.cjs96.js +1 -1
  201. package/dist/index.cjs97.js +1 -1
  202. package/dist/index.cjs98.js +1 -1
  203. package/dist/index.cjs99.js +1 -1
  204. package/dist/index.es100.js +1 -1
  205. package/dist/index.es103.js +1 -1
  206. package/dist/index.es104.js +1 -1
  207. package/dist/index.es106.js +3 -3
  208. package/dist/index.es107.js +1 -1
  209. package/dist/index.es108.js +2 -2
  210. package/dist/index.es109.js +1 -1
  211. package/dist/index.es114.js +1 -1
  212. package/dist/index.es115.js +1 -1
  213. package/dist/index.es116.js +1 -1
  214. package/dist/index.es117.js +1 -1
  215. package/dist/index.es120.js +2 -2
  216. package/dist/index.es121.js +2 -2
  217. package/dist/index.es122.js +1 -1
  218. package/dist/index.es126.js +2 -2
  219. package/dist/index.es129.js +1 -1
  220. package/dist/index.es133.js +1 -1
  221. package/dist/index.es136.js +1 -1
  222. package/dist/index.es14.js +2 -2
  223. package/dist/index.es144.js +1 -1
  224. package/dist/index.es145.js +1 -1
  225. package/dist/index.es146.js +1 -1
  226. package/dist/index.es147.js +2 -2
  227. package/dist/index.es148.js +1 -1
  228. package/dist/index.es149.js +1 -1
  229. package/dist/index.es15.js +4 -4
  230. package/dist/index.es150.js +1 -1
  231. package/dist/index.es152.js +2 -2
  232. package/dist/index.es153.js +2 -2
  233. package/dist/index.es154.js +1 -1
  234. package/dist/index.es155.js +1 -1
  235. package/dist/index.es156.js +1 -1
  236. package/dist/index.es157.js +1 -1
  237. package/dist/index.es158.js +2 -2
  238. package/dist/index.es159.js +2 -2
  239. package/dist/index.es16.js +3 -3
  240. package/dist/index.es160.js +1 -1
  241. package/dist/index.es163.js +2 -2
  242. package/dist/index.es164.js +2 -2
  243. package/dist/index.es166.js +2 -2
  244. package/dist/index.es167.js +1 -1
  245. package/dist/index.es168.js +2 -2
  246. package/dist/index.es169.js +1 -1
  247. package/dist/index.es17.js +3 -3
  248. package/dist/index.es170.js +2 -2
  249. package/dist/index.es171.js +1 -1
  250. package/dist/index.es172.js +1 -1
  251. package/dist/index.es173.js +1 -1
  252. package/dist/index.es179.js +1 -1
  253. package/dist/index.es18.js +1 -1
  254. package/dist/index.es180.js +2 -2
  255. package/dist/index.es181.js +1 -1
  256. package/dist/index.es182.js +1 -1
  257. package/dist/index.es183.js +1 -1
  258. package/dist/index.es188.js +1 -1
  259. package/dist/index.es19.js +1 -1
  260. package/dist/index.es20.js +1 -1
  261. package/dist/index.es201.js +242 -7
  262. package/dist/index.es201.js.map +1 -1
  263. package/dist/index.es202.js +42 -4
  264. package/dist/index.es202.js.map +1 -1
  265. package/dist/index.es203.js +3 -4
  266. package/dist/index.es203.js.map +1 -1
  267. package/dist/index.es204.js +11 -3
  268. package/dist/index.es204.js.map +1 -1
  269. package/dist/index.es205.js +11 -3
  270. package/dist/index.es205.js.map +1 -1
  271. package/dist/index.es206.js +30 -8
  272. package/dist/index.es206.js.map +1 -1
  273. package/dist/index.es207.js +13 -18
  274. package/dist/index.es207.js.map +1 -1
  275. package/dist/index.es208.js +4 -20
  276. package/dist/index.es208.js.map +1 -1
  277. package/dist/index.es209.js +6 -11
  278. package/dist/index.es209.js.map +1 -1
  279. package/dist/index.es21.js +1 -1
  280. package/dist/index.es210.js +4 -14
  281. package/dist/index.es210.js.map +1 -1
  282. package/dist/index.es211.js +4 -6
  283. package/dist/index.es211.js.map +1 -1
  284. package/dist/index.es212.js +3 -8
  285. package/dist/index.es212.js.map +1 -1
  286. package/dist/index.es213.js +3 -7
  287. package/dist/index.es213.js.map +1 -1
  288. package/dist/index.es214.js +8 -21
  289. package/dist/index.es214.js.map +1 -1
  290. package/dist/index.es215.js +17 -8
  291. package/dist/index.es215.js.map +1 -1
  292. package/dist/index.es216.js +21 -9
  293. package/dist/index.es216.js.map +1 -1
  294. package/dist/index.es217.js +13 -4
  295. package/dist/index.es217.js.map +1 -1
  296. package/dist/index.es218.js +14 -10
  297. package/dist/index.es218.js.map +1 -1
  298. package/dist/index.es219.js +5 -7
  299. package/dist/index.es219.js.map +1 -1
  300. package/dist/index.es22.js +1 -1
  301. package/dist/index.es220.js +6 -19
  302. package/dist/index.es220.js.map +1 -1
  303. package/dist/index.es221.js +6 -10
  304. package/dist/index.es221.js.map +1 -1
  305. package/dist/index.es222.js +20 -16
  306. package/dist/index.es222.js.map +1 -1
  307. package/dist/index.es223.js +10 -4
  308. package/dist/index.es223.js.map +1 -1
  309. package/dist/index.es224.js +9 -18
  310. package/dist/index.es224.js.map +1 -1
  311. package/dist/index.es225.js +4 -12
  312. package/dist/index.es225.js.map +1 -1
  313. package/dist/index.es226.js +10 -3
  314. package/dist/index.es226.js.map +1 -1
  315. package/dist/index.es227.js +7 -4
  316. package/dist/index.es227.js.map +1 -1
  317. package/dist/index.es228.js +20 -242
  318. package/dist/index.es228.js.map +1 -1
  319. package/dist/index.es229.js +9 -41
  320. package/dist/index.es229.js.map +1 -1
  321. package/dist/index.es23.js +1 -1
  322. package/dist/index.es230.js +18 -3
  323. package/dist/index.es230.js.map +1 -1
  324. package/dist/index.es231.js +3 -10
  325. package/dist/index.es231.js.map +1 -1
  326. package/dist/index.es232.js +17 -10
  327. package/dist/index.es232.js.map +1 -1
  328. package/dist/index.es233.js +11 -30
  329. package/dist/index.es233.js.map +1 -1
  330. package/dist/index.es234.js +3 -13
  331. package/dist/index.es234.js.map +1 -1
  332. package/dist/index.es235.js +4 -4
  333. package/dist/index.es235.js.map +1 -1
  334. package/dist/index.es238.js +3 -8
  335. package/dist/index.es238.js.map +1 -1
  336. package/dist/index.es239.js +6 -4
  337. package/dist/index.es239.js.map +1 -1
  338. package/dist/index.es24.js +1 -1
  339. package/dist/index.es240.js +21 -3
  340. package/dist/index.es240.js.map +1 -1
  341. package/dist/index.es241.js +22 -20
  342. package/dist/index.es241.js.map +1 -1
  343. package/dist/index.es242.js +5 -22
  344. package/dist/index.es242.js.map +1 -1
  345. package/dist/index.es250.js +1 -1
  346. package/dist/index.es255.js +1 -1
  347. package/dist/index.es258.js +1 -1
  348. package/dist/index.es262.js +15 -4
  349. package/dist/index.es262.js.map +1 -1
  350. package/dist/index.es263.js +4 -15
  351. package/dist/index.es263.js.map +1 -1
  352. package/dist/index.es27.js +1 -1
  353. package/dist/index.es28.js +2 -2
  354. package/dist/index.es29.js +2 -2
  355. package/dist/index.es31.js +2 -2
  356. package/dist/index.es33.js +2 -2
  357. package/dist/index.es34.js +2 -2
  358. package/dist/index.es37.js +1 -1
  359. package/dist/index.es38.js +1 -1
  360. package/dist/index.es39.js +2 -2
  361. package/dist/index.es41.js +2 -2
  362. package/dist/index.es42.js +2 -2
  363. package/dist/index.es43.js +2 -2
  364. package/dist/index.es45.js +1 -1
  365. package/dist/index.es46.js +2 -2
  366. package/dist/index.es47.js +2 -2
  367. package/dist/index.es49.js +1 -1
  368. package/dist/index.es50.js +1 -1
  369. package/dist/index.es51.js +1 -1
  370. package/dist/index.es55.js +2 -2
  371. package/dist/index.es56.js +3 -3
  372. package/dist/index.es57.js +1 -1
  373. package/dist/index.es59.js +1 -1
  374. package/dist/index.es60.js +1 -1
  375. package/dist/index.es62.js +1 -1
  376. package/dist/index.es71.js +21351 -7
  377. package/dist/index.es71.js.map +1 -1
  378. package/dist/index.es73.js +7 -25
  379. package/dist/index.es73.js.map +1 -1
  380. package/dist/index.es74.js +2 -589
  381. package/dist/index.es74.js.map +1 -1
  382. package/dist/index.es75.js +25 -21351
  383. package/dist/index.es75.js.map +1 -1
  384. package/dist/index.es76.js +589 -2
  385. package/dist/index.es76.js.map +1 -1
  386. package/dist/index.es77.js +104 -1991
  387. package/dist/index.es77.js.map +1 -1
  388. package/dist/index.es78.js +10 -6
  389. package/dist/index.es78.js.map +1 -1
  390. package/dist/index.es79.js +1993 -2
  391. package/dist/index.es79.js.map +1 -1
  392. package/dist/index.es8.js +43 -47
  393. package/dist/index.es8.js.map +1 -1
  394. package/dist/index.es80.js +5 -105
  395. package/dist/index.es80.js.map +1 -1
  396. package/dist/index.es81.js +2 -10
  397. package/dist/index.es81.js.map +1 -1
  398. package/dist/index.es85.js +1 -1
  399. package/dist/index.es92.js +1 -1
  400. package/dist/index.es93.js +1 -1
  401. package/dist/index.es94.js +1 -1
  402. package/dist/index.es95.js +1 -1
  403. package/dist/index.es96.js +1 -1
  404. package/dist/index.es97.js +1 -1
  405. package/dist/index.es98.js +1 -1
  406. package/dist/index.es99.js +1 -1
  407. package/package.json +1 -1
  408. package/src/components/MapDraw.js +6 -21
  409. package/types/components/MapDraw.js.flow +6 -21
@@ -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, {\n FullscreenControl,\n type MapboxMap,\n NavigationControl\n} from 'react-map-gl/maplibre';\nimport _ from 'underscore';\nimport DrawControl from './DrawControl';\nimport GeocodingControl from './GeocodingControl';\nimport MapUtils from '../utils/Map';\n\nimport '@maptiler/geocoding-control/style.css';\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 * The maximum pitch of the map (0-85).\n */\n maxPitch?: number,\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', 'MultiPolygon']\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' && GeometryTypes.polygon.includes(type));\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(() => {\n console.log(\"fired callback\");\n console.log(drawRef.current.getAll());\n props.onChange(drawRef.current.getAll());\n }, [props.onChange]);\n\n /**\n * Adds the selected geometry to the map.\n *\n * @type {(function(evt: *): void)|*}\n */\n const onSelection = useCallback((evt) => {\n console.log(evt);\n const { detail } = evt;\n if (isValid(detail)) {\n console.log(\"valid\");\n console.log(detail);\n // Add the geometry to the map\n console.log(\"before add\");\n console.log(drawRef.current.getAll());\n drawRef.current.add(detail.geometry);\n console.log(\"after add\");\n console.log(drawRef.current.getAll());\n\n // Trigger the onChange prop\n onChange();\n\n // Call the onGeocoding selection callback\n if (props.onGeocodingSelection) {\n props.onGeocodingSelection(detail);\n }\n } else {\n console.log(\"invalid\");\n console.log(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 maxPitch={props.maxPitch}\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 key={props.geocoding}\n marker={false}\n pickedResultStyle={props.geocoding === 'polygon' ? 'full-geometry' : 'marker-only'}\n position='top-left'\n onSelection={onSelection}\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","evt","mapStyleUrl","useMemo","style","useEffect","bbox","MapUtils","_","geometry","feature","jsxs","Map","maplibregl","jsx","DrawControl","GeocodingControl","NavigationControl","FullscreenControl"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BAA,EAAW,UAAU,QAAQ,eAAe;AAC5CA,EAAW,UAAU,QAAQ,iBAAiB;AAC9CA,EAAW,UAAU,QAAQ,gBAAgB;AAiF7C,MAAMC,IAAiB,GACjBC,IAAqB,KAErBC,IAAgB;AAAA,EACpB,oBAAoB;AAAA,EACpB,OAAO;AAAA,EACP,SAAS,CAAC,WAAW,cAAc;AACrC,GAMMC,IAAU,CAACC,MAAiB;AAChC,QAAM,CAACC,GAAQC,CAAS,IAAIC,EAAS,EAAK,GAEpCC,IAAUC,EAAA,GACVC,IAASD,EAAA,GAUTE,IAAUC,EAAY,CAACC,MAAW;AACtC,QAAI,CAACA;AACH,aAAO;AAGT,UAAM,EAAE,UAAU,EAAE,MAAAC,EAAA,MAAWD;AAE/B,WAAQT,EAAM,cAAc,WAAWU,MAASZ,EAAc,SACxDE,EAAM,cAAc,aAAaF,EAAc,QAAQ,SAASY,CAAI;AAAA,EAC5E,GAAG,CAACV,EAAM,SAAS,CAAC,GAOdW,IAAWH,EAAY,MAAM;AACjC,YAAQ,IAAI,gBAAgB,GAC5B,QAAQ,IAAIJ,EAAQ,QAAQ,OAAA,CAAQ,GACpCJ,EAAM,SAASI,EAAQ,QAAQ,OAAA,CAAQ;AAAA,EACzC,GAAG,CAACJ,EAAM,QAAQ,CAAC,GAObY,IAAcJ,EAAY,CAACK,MAAQ;AACvC,YAAQ,IAAIA,CAAG;AACf,UAAM,EAAE,QAAAJ,MAAWI;AACnB,IAAIN,EAAQE,CAAM,KAChB,QAAQ,IAAI,OAAO,GACnB,QAAQ,IAAIA,CAAM,GAElB,QAAQ,IAAI,YAAY,GACxB,QAAQ,IAAIL,EAAQ,QAAQ,OAAA,CAAQ,GACpCA,EAAQ,QAAQ,IAA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AA,MAEV,UAAA;AAAA,QAAAY,gBAAAA,EAAAA;AAAAA,UAACC;AAAA,UAAA;AAAA,YACC,KAAKvB;AAAA,YACL,UAAU;AAAA,cACR,aAAa;AAAA,cACb,OAAO;AAAA,cACP,SAAS;AAAA,cACT,OAAO;AAAA,YAAA;AAAA,YAET,wBAAwB;AAAA,YACxB,UAAUO;AAAA,YACV,UAAUA;AAAA,YACV,UAAUA;AAAA,YACV,UAAS;AAAA,UAAA;AAAA,QAAA;AAAA,QAETX,EAAM,aACN0B,gBAAAA,EAAAA;AAAAA,UAACE;AAAA,UAAA;AAAA,YACC,QAAQ5B,EAAM;AAAA,YAEd,QAAQ;AAAA,YACR,mBAAmBA,EAAM,cAAc,YAAY,kBAAkB;AAAA,YACrE,UAAS;AAAA,YACT,aAAAY;AAAA,YACA,mBAAmB;AAAA,UAAA;AAAA,UALdZ,EAAM;AAAA,QAAA;AAAA,QAQbA,EAAM,cACN0B,gBAAAA,MAACG,GAAA,CAAA,CAAkB;AAAA,QAEnB7B,EAAM,cACN0B,gBAAAA,MAACI,GAAA,CAAA,CAAkB;AAAA,QAEnB9B,EAAM;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGd;AAEAD,EAAQ,eAAe;AAAA,EACrB,QAAQH;AAAA,EACR,qBAAqB;AAAA,EACrB,uBAAuB;AAAA,EACvB,cAAcC;AAChB;"}
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, {\n FullscreenControl,\n type MapboxMap,\n NavigationControl\n} from 'react-map-gl/maplibre';\nimport _ from 'underscore';\nimport DrawControl from './DrawControl';\nimport GeocodingControl from './GeocodingControl';\nimport MapUtils from '../utils/Map';\n\nimport '@maptiler/geocoding-control/style.css';\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 * The maximum pitch of the map (0-85).\n */\n maxPitch?: number,\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', 'MultiPolygon']\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' && GeometryTypes.polygon.includes(type));\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({feature: *}): void)|*}\n */\n const onSelection = useCallback(({ feature }) => {\n if (isValid(feature)) {\n // Add the geometry to the map\n drawRef.current.add(feature.geometry);\n\n // Trigger the onChange prop\n onChange();\n\n // Call the onGeocoding selection callback\n if (props.onGeocodingSelection) {\n props.onGeocodingSelection(feature);\n }\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 maxPitch={props.maxPitch}\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 key={props.geocoding}\n marker={false}\n pickedResultStyle={props.geocoding === 'polygon' ? 'full-geometry' : 'marker-only'}\n position='top-left'\n onSelection={onSelection}\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","feature","mapStyleUrl","useMemo","style","useEffect","bbox","MapUtils","_","geometry","jsxs","Map","maplibregl","jsx","DrawControl","GeocodingControl","NavigationControl","FullscreenControl"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BAA,EAAW,UAAU,QAAQ,eAAe;AAC5CA,EAAW,UAAU,QAAQ,iBAAiB;A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AAAA,QAEnB5B,EAAM,cACNyB,gBAAAA,MAACI,GAAA,CAAA,CAAkB;AAAA,QAEnB7B,EAAM;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGd;AAEAD,EAAQ,eAAe;AAAA,EACrB,QAAQH;AAAA,EACR,qBAAqB;AAAA,EACrB,uBAAuB;AAAA,EACvB,cAAcC;AAChB;"}
@@ -1,109 +1,9 @@
1
- import l from "react";
2
- import { IconContext as s, DefaultContext as O } from "./index.es81.js";
3
- var g = ["attr", "size", "title"];
4
- function v(t, e) {
5
- if (t == null) return {};
6
- var r = y(t, e), n, i;
7
- if (Object.getOwnPropertySymbols) {
8
- var o = Object.getOwnPropertySymbols(t);
9
- for (i = 0; i < o.length; i++)
10
- n = o[i], !(e.indexOf(n) >= 0) && Object.prototype.propertyIsEnumerable.call(t, n) && (r[n] = t[n]);
11
- }
12
- return r;
13
- }
14
- function y(t, e) {
15
- if (t == null) return {};
16
- var r = {};
17
- for (var n in t)
18
- if (Object.prototype.hasOwnProperty.call(t, n)) {
19
- if (e.indexOf(n) >= 0) continue;
20
- r[n] = t[n];
21
- }
22
- return r;
23
- }
24
- function c() {
25
- return c = Object.assign ? Object.assign.bind() : function(t) {
26
- for (var e = 1; e < arguments.length; e++) {
27
- var r = arguments[e];
28
- for (var n in r)
29
- Object.prototype.hasOwnProperty.call(r, n) && (t[n] = r[n]);
30
- }
31
- return t;
32
- }, c.apply(this, arguments);
33
- }
34
- function m(t, e) {
35
- var r = Object.keys(t);
36
- if (Object.getOwnPropertySymbols) {
37
- var n = Object.getOwnPropertySymbols(t);
38
- e && (n = n.filter(function(i) {
39
- return Object.getOwnPropertyDescriptor(t, i).enumerable;
40
- })), r.push.apply(r, n);
41
- }
42
- return r;
43
- }
44
- function u(t) {
45
- for (var e = 1; e < arguments.length; e++) {
46
- var r = arguments[e] != null ? arguments[e] : {};
47
- e % 2 ? m(Object(r), !0).forEach(function(n) {
48
- j(t, n, r[n]);
49
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(r)) : m(Object(r)).forEach(function(n) {
50
- Object.defineProperty(t, n, Object.getOwnPropertyDescriptor(r, n));
51
- });
52
- }
53
- return t;
54
- }
55
- function j(t, e, r) {
56
- return e = P(e), e in t ? Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = r, t;
57
- }
58
- function P(t) {
59
- var e = h(t, "string");
60
- return typeof e == "symbol" ? e : e + "";
61
- }
62
- function h(t, e) {
63
- if (typeof t != "object" || !t) return t;
64
- var r = t[Symbol.toPrimitive];
65
- if (r !== void 0) {
66
- var n = r.call(t, e);
67
- if (typeof n != "object") return n;
68
- throw new TypeError("@@toPrimitive must return a primitive value.");
69
- }
70
- return (e === "string" ? String : Number)(t);
71
- }
72
- function p(t) {
73
- return t && t.map((e, r) => /* @__PURE__ */ l.createElement(e.tag, u({
74
- key: r
75
- }, e.attr), p(e.child)));
76
- }
77
- function _(t) {
78
- return (e) => /* @__PURE__ */ l.createElement(w, c({
79
- attr: u({}, t.attr)
80
- }, e), p(t.child));
81
- }
82
- function w(t) {
83
- var e = (r) => {
84
- var {
85
- attr: n,
86
- size: i,
87
- title: o
88
- } = t, b = v(t, g), f = i || r.size || "1em", a;
89
- return r.className && (a = r.className), t.className && (a = (a ? a + " " : "") + t.className), /* @__PURE__ */ l.createElement("svg", c({
90
- stroke: "currentColor",
91
- fill: "currentColor",
92
- strokeWidth: "0"
93
- }, r.attr, n, b, {
94
- className: a,
95
- style: u(u({
96
- color: t.color || r.color
97
- }, r.style), t.style),
98
- height: f,
99
- width: f,
100
- xmlns: "http://www.w3.org/2000/svg"
101
- }), o && /* @__PURE__ */ l.createElement("title", null, o), t.children);
102
- };
103
- return s !== void 0 ? /* @__PURE__ */ l.createElement(s.Consumer, null, (r) => e(r)) : e(O);
1
+ var o = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
2
+ function l(e) {
3
+ return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
104
4
  }
105
5
  export {
106
- _ as GenIcon,
107
- w as IconBase
6
+ o as commonjsGlobal,
7
+ l as getDefaultExportFromCjs
108
8
  };
109
9
  //# sourceMappingURL=index.es80.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.es80.js","sources":["../../../node_modules/react-icons/lib/iconBase.mjs"],"sourcesContent":["var _excluded = [\"attr\", \"size\", \"title\"];\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } } return target; }\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == typeof i ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != typeof i) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport React from \"react\";\nimport { IconContext, DefaultContext } from \"./iconContext.mjs\";\nfunction Tree2Element(tree) {\n return tree && tree.map((node, i) => /*#__PURE__*/React.createElement(node.tag, _objectSpread({\n key: i\n }, node.attr), Tree2Element(node.child)));\n}\nexport function GenIcon(data) {\n return props => /*#__PURE__*/React.createElement(IconBase, _extends({\n attr: _objectSpread({}, data.attr)\n }, props), Tree2Element(data.child));\n}\nexport function IconBase(props) {\n var elem = conf => {\n var {\n attr,\n size,\n title\n } = props,\n svgProps = _objectWithoutProperties(props, _excluded);\n var computedSize = size || conf.size || \"1em\";\n var className;\n if (conf.className) className = conf.className;\n if (props.className) className = (className ? className + \" \" : \"\") + props.className;\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n stroke: \"currentColor\",\n fill: \"currentColor\",\n strokeWidth: \"0\"\n }, conf.attr, attr, svgProps, {\n className: className,\n style: _objectSpread(_objectSpread({\n color: props.color || conf.color\n }, conf.style), props.style),\n height: computedSize,\n width: computedSize,\n xmlns: \"http://www.w3.org/2000/svg\"\n }), title && /*#__PURE__*/React.createElement(\"title\", null, title), props.children);\n };\n return IconContext !== undefined ? /*#__PURE__*/React.createElement(IconContext.Consumer, null, conf => elem(conf)) : elem(DefaultContext);\n}"],"names":["_excluded","_objectWithoutProperties","source","excluded","target","_objectWithoutPropertiesLoose","key","sourceSymbolKeys","_extends","i","ownKeys","e","r","t","o","_objectSpread","_defineProperty","obj","value","_toPropertyKey","_toPrimitive","Tree2Element","tree","node","React","GenIcon","data","props","IconBase","elem","conf","attr","size","title","svgProps","computedSize","className","IconContext","DefaultContext"],"mappings":";;AAAA,IAAIA,IAAY,CAAC,QAAQ,QAAQ,OAAO;AACxC,SAASC,EAAyBC,GAAQC,GAAU;AAAE,MAAID,KAAU,KAAM,QAAO,CAAA;AAAI,MAAIE,IAASC,EAA8BH,GAAQC,CAAQ,GAAOG,GAAK;AAAG,MAAI,OAAO,uBAAuB;AAAE,QAAIC,IAAmB,OAAO,sBAAsBL,CAAM;AAAG,SAAK,IAAI,GAAG,IAAIK,EAAiB,QAAQ;AAAkC,MAA3BD,IAAMC,EAAiB,CAAC,GAAO,EAAAJ,EAAS,QAAQG,CAAG,KAAK,MAAkB,OAAO,UAAU,qBAAqB,KAAKJ,GAAQI,CAAG,MAAaF,EAAOE,CAAG,IAAIJ,EAAOI,CAAG;AAAA,EAAK;AAAE,SAAOF;AAAQ;AAC3e,SAASC,EAA8BH,GAAQC,GAAU;AAAE,MAAID,KAAU,KAAM,QAAO,CAAA;AAAI,MAAIE,IAAS;AAAI,WAASE,KAAOJ;AAAU,QAAI,OAAO,UAAU,eAAe,KAAKA,GAAQI,CAAG,GAAG;AAAE,UAAIH,EAAS,QAAQG,CAAG,KAAK,EAAG;AAAU,MAAAF,EAAOE,CAAG,IAAIJ,EAAOI,CAAG;AAAA,IAAG;AAAI,SAAOF;AAAQ;AACtR,SAASI,IAAW;AAAE,SAAAA,IAAW,OAAO,SAAS,OAAO,OAAO,SAAS,SAAUJ,GAAQ;AAAE,aAASK,IAAI,GAAGA,IAAI,UAAU,QAAQA,KAAK;AAAE,UAAIP,IAAS,UAAUO,CAAC;AAAG,eAASH,KAAOJ;AAAU,QAAI,OAAO,UAAU,eAAe,KAAKA,GAAQI,CAAG,MAAKF,EAAOE,CAAG,IAAIJ,EAAOI,CAA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,aAAa;AAAA,IACnB,GAAOsB,EAAK,MAAMC,GAAMG,GAAU;AAAA,MAC5B,WAAWE;AAAA,MACX,OAAOrB,EAAcA,EAAc;AAAA,QACjC,OAAOY,EAAM,SAASG,EAAK;AAAA,MACnC,GAASA,EAAK,KAAK,GAAGH,EAAM,KAAK;AAAA,MAC3B,QAAQQ;AAAA,MACR,OAAOA;AAAA,MACP,OAAO;AAAA,IACb,CAAK,GAAGF,KAAsBT,gBAAAA,EAAM,cAAc,SAAS,MAAMS,CAAK,GAAGN,EAAM,QAAQ;AAAA,EACrF;AACA,SAAOU,MAAgB,SAAyBb,gBAAAA,EAAM,cAAca,EAAY,UAAU,MAAM,CAAAP,MAAQD,EAAKC,CAAI,CAAC,IAAID,EAAKS,CAAc;AAC3I;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index.es80.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
@@ -1,13 +1,5 @@
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);
1
+ var a = { exports: {} };
9
2
  export {
10
- t as DefaultContext,
11
- d as IconContext
3
+ a as __module
12
4
  };
13
5
  //# sourceMappingURL=index.es81.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.es81.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]}
1
+ {"version":3,"file":"index.es81.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -2,7 +2,7 @@ import r from "./index.es40.js";
2
2
  import n from "./index.es152.js";
3
3
  import f from "./index.es113.js";
4
4
  import { push as u } from "./index.es36.js";
5
- import m from "./index.es227.js";
5
+ import m from "./index.es235.js";
6
6
  function l(o) {
7
7
  return n(f(o), function(t) {
8
8
  var i = r[t] = o[t];
@@ -1,4 +1,4 @@
1
- import t from "./index.es201.js";
1
+ import t from "./index.es209.js";
2
2
  const e = t("String");
3
3
  export {
4
4
  e as default
@@ -1,4 +1,4 @@
1
- import e from "./index.es201.js";
1
+ import e from "./index.es209.js";
2
2
  const t = e("Number");
3
3
  export {
4
4
  t as default
@@ -1,4 +1,4 @@
1
- import t from "./index.es201.js";
1
+ import t from "./index.es209.js";
2
2
  const a = t("Date");
3
3
  export {
4
4
  a as default
@@ -1,4 +1,4 @@
1
- import e from "./index.es201.js";
1
+ import e from "./index.es209.js";
2
2
  const o = e("RegExp");
3
3
  export {
4
4
  o as default
@@ -1,4 +1,4 @@
1
- import r from "./index.es201.js";
1
+ import r from "./index.es209.js";
2
2
  const t = r("Error");
3
3
  export {
4
4
  t as default
@@ -1,4 +1,4 @@
1
- import o from "./index.es201.js";
1
+ import o from "./index.es209.js";
2
2
  const e = o("Symbol");
3
3
  export {
4
4
  e as default
@@ -1,4 +1,4 @@
1
- import r from "./index.es201.js";
1
+ import r from "./index.es209.js";
2
2
  const f = r("ArrayBuffer");
3
3
  export {
4
4
  f as default
@@ -1,4 +1,4 @@
1
- import a from "./index.es201.js";
1
+ import a from "./index.es209.js";
2
2
  import r from "./index.es37.js";
3
3
  import e from "./index.es98.js";
4
4
  import { hasDataViewBug as i } from "./index.es38.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@performant-software/geospatial",
3
- "version": "3.1.7-beta.3",
3
+ "version": "3.1.7-beta.5",
4
4
  "description": "A package of components for all things map-related.",
5
5
  "license": "MIT",
6
6
  "main": "./dist/index.cjs.js",
@@ -151,40 +151,25 @@ const MapDraw = (props: Props) => {
151
151
  *
152
152
  * @type {(function(): void)|*}
153
153
  */
154
- const onChange = useCallback(() => {
155
- console.log("fired callback");
156
- console.log(drawRef.current.getAll());
157
- props.onChange(drawRef.current.getAll());
158
- }, [props.onChange]);
154
+ const onChange = useCallback(() => props.onChange(drawRef.current.getAll()), [props.onChange]);
159
155
 
160
156
  /**
161
157
  * Adds the selected geometry to the map.
162
158
  *
163
- * @type {(function(evt: *): void)|*}
159
+ * @type {(function({feature: *}): void)|*}
164
160
  */
165
- const onSelection = useCallback((evt) => {
166
- console.log(evt);
167
- const { detail } = evt;
168
- if (isValid(detail)) {
169
- console.log("valid");
170
- console.log(detail);
161
+ const onSelection = useCallback(({ feature }) => {
162
+ if (isValid(feature)) {
171
163
  // Add the geometry to the map
172
- console.log("before add");
173
- console.log(drawRef.current.getAll());
174
- drawRef.current.add(detail.geometry);
175
- console.log("after add");
176
- console.log(drawRef.current.getAll());
164
+ drawRef.current.add(feature.geometry);
177
165
 
178
166
  // Trigger the onChange prop
179
167
  onChange();
180
168
 
181
169
  // Call the onGeocoding selection callback
182
170
  if (props.onGeocodingSelection) {
183
- props.onGeocodingSelection(detail);
171
+ props.onGeocodingSelection(feature);
184
172
  }
185
- } else {
186
- console.log("invalid");
187
- console.log(detail);
188
173
  }
189
174
  }, [isValid, onChange, props.onGeocodingSelection]);
190
175
 
@@ -151,40 +151,25 @@ const MapDraw = (props: Props) => {
151
151
  *
152
152
  * @type {(function(): void)|*}
153
153
  */
154
- const onChange = useCallback(() => {
155
- console.log("fired callback");
156
- console.log(drawRef.current.getAll());
157
- props.onChange(drawRef.current.getAll());
158
- }, [props.onChange]);
154
+ const onChange = useCallback(() => props.onChange(drawRef.current.getAll()), [props.onChange]);
159
155
 
160
156
  /**
161
157
  * Adds the selected geometry to the map.
162
158
  *
163
- * @type {(function(evt: *): void)|*}
159
+ * @type {(function({feature: *}): void)|*}
164
160
  */
165
- const onSelection = useCallback((evt) => {
166
- console.log(evt);
167
- const { detail } = evt;
168
- if (isValid(detail)) {
169
- console.log("valid");
170
- console.log(detail);
161
+ const onSelection = useCallback(({ feature }) => {
162
+ if (isValid(feature)) {
171
163
  // Add the geometry to the map
172
- console.log("before add");
173
- console.log(drawRef.current.getAll());
174
- drawRef.current.add(detail.geometry);
175
- console.log("after add");
176
- console.log(drawRef.current.getAll());
164
+ drawRef.current.add(feature.geometry);
177
165
 
178
166
  // Trigger the onChange prop
179
167
  onChange();
180
168
 
181
169
  // Call the onGeocoding selection callback
182
170
  if (props.onGeocodingSelection) {
183
- props.onGeocodingSelection(detail);
171
+ props.onGeocodingSelection(feature);
184
172
  }
185
- } else {
186
- console.log("invalid");
187
- console.log(detail);
188
173
  }
189
174
  }, [isValid, onChange, props.onGeocodingSelection]);
190
175