@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.
Files changed (407) hide show
  1. package/dist/index.cjs10.js +1 -1
  2. package/dist/index.cjs10.js.map +1 -1
  3. package/dist/index.cjs100.js +1 -1
  4. package/dist/index.cjs102.js +1 -1
  5. package/dist/index.cjs103.js +1 -1
  6. package/dist/index.cjs104.js +1 -1
  7. package/dist/index.cjs105.js +1 -1
  8. package/dist/index.cjs110.js +1 -1
  9. package/dist/index.cjs111.js +1 -1
  10. package/dist/index.cjs112.js +1 -1
  11. package/dist/index.cjs113.js +1 -1
  12. package/dist/index.cjs116.js +1 -1
  13. package/dist/index.cjs117.js +1 -1
  14. package/dist/index.cjs118.js +1 -1
  15. package/dist/index.cjs122.js +1 -1
  16. package/dist/index.cjs125.js +1 -1
  17. package/dist/index.cjs129.js +1 -1
  18. package/dist/index.cjs132.js +1 -1
  19. package/dist/index.cjs14.js +1 -1
  20. package/dist/index.cjs140.js +1 -1
  21. package/dist/index.cjs141.js +1 -1
  22. package/dist/index.cjs142.js +1 -1
  23. package/dist/index.cjs143.js +1 -1
  24. package/dist/index.cjs144.js +1 -1
  25. package/dist/index.cjs145.js +1 -1
  26. package/dist/index.cjs146.js +1 -1
  27. package/dist/index.cjs148.js +1 -1
  28. package/dist/index.cjs149.js +1 -1
  29. package/dist/index.cjs150.js +1 -1
  30. package/dist/index.cjs151.js +1 -1
  31. package/dist/index.cjs152.js +1 -1
  32. package/dist/index.cjs153.js +1 -1
  33. package/dist/index.cjs154.js +1 -1
  34. package/dist/index.cjs155.js +1 -1
  35. package/dist/index.cjs156.js +1 -1
  36. package/dist/index.cjs159.js +1 -1
  37. package/dist/index.cjs160.js +1 -1
  38. package/dist/index.cjs162.js +1 -1
  39. package/dist/index.cjs163.js +1 -1
  40. package/dist/index.cjs164.js +1 -1
  41. package/dist/index.cjs165.js +1 -1
  42. package/dist/index.cjs166.js +1 -1
  43. package/dist/index.cjs167.js +1 -1
  44. package/dist/index.cjs168.js +1 -1
  45. package/dist/index.cjs169.js +1 -1
  46. package/dist/index.cjs175.js +1 -1
  47. package/dist/index.cjs176.js +1 -1
  48. package/dist/index.cjs177.js +1 -1
  49. package/dist/index.cjs178.js +1 -1
  50. package/dist/index.cjs179.js +1 -1
  51. package/dist/index.cjs182.js +1 -1
  52. package/dist/index.cjs189.js +1 -1
  53. package/dist/index.cjs189.js.map +1 -1
  54. package/dist/index.cjs190.js +1 -1
  55. package/dist/index.cjs190.js.map +1 -1
  56. package/dist/index.cjs191.js +4 -1
  57. package/dist/index.cjs191.js.map +1 -1
  58. package/dist/index.cjs192.js +1 -4
  59. package/dist/index.cjs192.js.map +1 -1
  60. package/dist/index.cjs193.js +1 -1
  61. package/dist/index.cjs193.js.map +1 -1
  62. package/dist/index.cjs194.js +1 -1
  63. package/dist/index.cjs194.js.map +1 -1
  64. package/dist/index.cjs195.js +1 -1
  65. package/dist/index.cjs195.js.map +1 -1
  66. package/dist/index.cjs196.js +1 -1
  67. package/dist/index.cjs196.js.map +1 -1
  68. package/dist/index.cjs197.js +1 -1
  69. package/dist/index.cjs197.js.map +1 -1
  70. package/dist/index.cjs198.js +1 -1
  71. package/dist/index.cjs198.js.map +1 -1
  72. package/dist/index.cjs199.js +1 -1
  73. package/dist/index.cjs199.js.map +1 -1
  74. package/dist/index.cjs20.js +1 -1
  75. package/dist/index.cjs200.js +1 -1
  76. package/dist/index.cjs200.js.map +1 -1
  77. package/dist/index.cjs201.js +1 -1
  78. package/dist/index.cjs201.js.map +1 -1
  79. package/dist/index.cjs202.js +1 -1
  80. package/dist/index.cjs202.js.map +1 -1
  81. package/dist/index.cjs203.js +1 -1
  82. package/dist/index.cjs203.js.map +1 -1
  83. package/dist/index.cjs204.js +1 -1
  84. package/dist/index.cjs204.js.map +1 -1
  85. package/dist/index.cjs205.js +1 -1
  86. package/dist/index.cjs205.js.map +1 -1
  87. package/dist/index.cjs206.js +1 -1
  88. package/dist/index.cjs206.js.map +1 -1
  89. package/dist/index.cjs207.js +1 -1
  90. package/dist/index.cjs207.js.map +1 -1
  91. package/dist/index.cjs208.js +1 -1
  92. package/dist/index.cjs208.js.map +1 -1
  93. package/dist/index.cjs209.js +1 -1
  94. package/dist/index.cjs209.js.map +1 -1
  95. package/dist/index.cjs21.js +1 -1
  96. package/dist/index.cjs210.js +1 -1
  97. package/dist/index.cjs210.js.map +1 -1
  98. package/dist/index.cjs211.js +1 -1
  99. package/dist/index.cjs211.js.map +1 -1
  100. package/dist/index.cjs212.js +1 -1
  101. package/dist/index.cjs212.js.map +1 -1
  102. package/dist/index.cjs213.js +1 -1
  103. package/dist/index.cjs213.js.map +1 -1
  104. package/dist/index.cjs214.js +1 -1
  105. package/dist/index.cjs214.js.map +1 -1
  106. package/dist/index.cjs215.js +1 -1
  107. package/dist/index.cjs215.js.map +1 -1
  108. package/dist/index.cjs216.js +1 -1
  109. package/dist/index.cjs216.js.map +1 -1
  110. package/dist/index.cjs217.js +1 -1
  111. package/dist/index.cjs217.js.map +1 -1
  112. package/dist/index.cjs218.js +1 -1
  113. package/dist/index.cjs218.js.map +1 -1
  114. package/dist/index.cjs219.js +1 -1
  115. package/dist/index.cjs219.js.map +1 -1
  116. package/dist/index.cjs220.js +1 -1
  117. package/dist/index.cjs220.js.map +1 -1
  118. package/dist/index.cjs221.js +1 -1
  119. package/dist/index.cjs221.js.map +1 -1
  120. package/dist/index.cjs222.js +1 -1
  121. package/dist/index.cjs222.js.map +1 -1
  122. package/dist/index.cjs223.js +1 -1
  123. package/dist/index.cjs223.js.map +1 -1
  124. package/dist/index.cjs224.js +1 -1
  125. package/dist/index.cjs224.js.map +1 -1
  126. package/dist/index.cjs225.js +1 -1
  127. package/dist/index.cjs225.js.map +1 -1
  128. package/dist/index.cjs226.js +1 -1
  129. package/dist/index.cjs226.js.map +1 -1
  130. package/dist/index.cjs227.js +1 -1
  131. package/dist/index.cjs227.js.map +1 -1
  132. package/dist/index.cjs228.js +1 -1
  133. package/dist/index.cjs228.js.map +1 -1
  134. package/dist/index.cjs229.js +1 -1
  135. package/dist/index.cjs229.js.map +1 -1
  136. package/dist/index.cjs230.js +1 -1
  137. package/dist/index.cjs230.js.map +1 -1
  138. package/dist/index.cjs231.js +1 -1
  139. package/dist/index.cjs231.js.map +1 -1
  140. package/dist/index.cjs232.js +1 -1
  141. package/dist/index.cjs232.js.map +1 -1
  142. package/dist/index.cjs233.js +1 -1
  143. package/dist/index.cjs233.js.map +1 -1
  144. package/dist/index.cjs234.js +1 -1
  145. package/dist/index.cjs234.js.map +1 -1
  146. package/dist/index.cjs235.js +1 -1
  147. package/dist/index.cjs235.js.map +1 -1
  148. package/dist/index.cjs236.js +1 -1
  149. package/dist/index.cjs236.js.map +1 -1
  150. package/dist/index.cjs238.js +1 -1
  151. package/dist/index.cjs24.js +1 -1
  152. package/dist/index.cjs241.js +1 -1
  153. package/dist/index.cjs244.js +1 -1
  154. package/dist/index.cjs247.js +1 -1
  155. package/dist/index.cjs249.js +1 -1
  156. package/dist/index.cjs25.js +1 -1
  157. package/dist/index.cjs252.js +1 -1
  158. package/dist/index.cjs253.js +1 -1
  159. package/dist/index.cjs256.js +1 -1
  160. package/dist/index.cjs256.js.map +1 -1
  161. package/dist/index.cjs257.js +1 -1
  162. package/dist/index.cjs257.js.map +1 -1
  163. package/dist/index.cjs258.js +1 -1
  164. package/dist/index.cjs26.js +1 -1
  165. package/dist/index.cjs28.js +1 -1
  166. package/dist/index.cjs29.js +1 -1
  167. package/dist/index.cjs30.js +1 -1
  168. package/dist/index.cjs32.js +1 -1
  169. package/dist/index.cjs33.js +1 -1
  170. package/dist/index.cjs34.js +1 -1
  171. package/dist/index.cjs36.js +1 -1
  172. package/dist/index.cjs37.js +1 -1
  173. package/dist/index.cjs38.js +1 -1
  174. package/dist/index.cjs42.js +1 -1
  175. package/dist/index.cjs43.js +1 -1
  176. package/dist/index.cjs44.js +1 -1
  177. package/dist/index.cjs46.js +1 -1
  178. package/dist/index.cjs47.js +1 -1
  179. package/dist/index.cjs49.js +1 -1
  180. package/dist/index.cjs55.js +1 -1
  181. package/dist/index.cjs57.js +1 -1
  182. package/dist/index.cjs63.js +1 -1
  183. package/dist/index.cjs63.js.map +1 -1
  184. package/dist/index.cjs64.js +1 -1
  185. package/dist/index.cjs64.js.map +1 -1
  186. package/dist/index.cjs65.js +1 -1
  187. package/dist/index.cjs65.js.map +1 -1
  188. package/dist/index.cjs77.js +1 -1
  189. package/dist/index.cjs8.js +1 -1
  190. package/dist/index.cjs8.js.map +1 -1
  191. package/dist/index.cjs81.js +1 -1
  192. package/dist/index.cjs88.js +1 -1
  193. package/dist/index.cjs89.js +1 -1
  194. package/dist/index.cjs90.js +1 -1
  195. package/dist/index.cjs91.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.cjs99.js +1 -1
  202. package/dist/index.es10.js +17 -16
  203. package/dist/index.es10.js.map +1 -1
  204. package/dist/index.es100.js +1 -1
  205. package/dist/index.es102.js +3 -3
  206. package/dist/index.es103.js +1 -1
  207. package/dist/index.es104.js +2 -2
  208. package/dist/index.es105.js +1 -1
  209. package/dist/index.es110.js +1 -1
  210. package/dist/index.es111.js +1 -1
  211. package/dist/index.es112.js +1 -1
  212. package/dist/index.es113.js +1 -1
  213. package/dist/index.es116.js +2 -2
  214. package/dist/index.es117.js +2 -2
  215. package/dist/index.es118.js +1 -1
  216. package/dist/index.es122.js +2 -2
  217. package/dist/index.es125.js +1 -1
  218. package/dist/index.es129.js +1 -1
  219. package/dist/index.es132.js +1 -1
  220. package/dist/index.es14.js +1 -1
  221. package/dist/index.es140.js +1 -1
  222. package/dist/index.es141.js +1 -1
  223. package/dist/index.es142.js +1 -1
  224. package/dist/index.es143.js +2 -2
  225. package/dist/index.es144.js +1 -1
  226. package/dist/index.es145.js +1 -1
  227. package/dist/index.es146.js +1 -1
  228. package/dist/index.es148.js +2 -2
  229. package/dist/index.es149.js +2 -2
  230. package/dist/index.es150.js +1 -1
  231. package/dist/index.es151.js +1 -1
  232. package/dist/index.es152.js +1 -1
  233. package/dist/index.es153.js +1 -1
  234. package/dist/index.es154.js +2 -2
  235. package/dist/index.es155.js +2 -2
  236. package/dist/index.es156.js +1 -1
  237. package/dist/index.es159.js +2 -2
  238. package/dist/index.es160.js +2 -2
  239. package/dist/index.es162.js +2 -2
  240. package/dist/index.es163.js +1 -1
  241. package/dist/index.es164.js +2 -2
  242. package/dist/index.es165.js +1 -1
  243. package/dist/index.es166.js +2 -2
  244. package/dist/index.es167.js +1 -1
  245. package/dist/index.es168.js +1 -1
  246. package/dist/index.es169.js +1 -1
  247. package/dist/index.es175.js +1 -1
  248. package/dist/index.es176.js +2 -2
  249. package/dist/index.es177.js +1 -1
  250. package/dist/index.es178.js +1 -1
  251. package/dist/index.es179.js +1 -1
  252. package/dist/index.es182.js +2 -2
  253. package/dist/index.es189.js +8 -2
  254. package/dist/index.es189.js.map +1 -1
  255. package/dist/index.es190.js +147 -7
  256. package/dist/index.es190.js.map +1 -1
  257. package/dist/index.es191.js +12188 -139
  258. package/dist/index.es191.js.map +1 -1
  259. package/dist/index.es192.js +3 -12199
  260. package/dist/index.es192.js.map +1 -1
  261. package/dist/index.es193.js +1 -1
  262. package/dist/index.es193.js.map +1 -1
  263. package/dist/index.es194.js +38 -3
  264. package/dist/index.es194.js.map +1 -1
  265. package/dist/index.es195.js +3 -38
  266. package/dist/index.es195.js.map +1 -1
  267. package/dist/index.es196.js +25 -3
  268. package/dist/index.es196.js.map +1 -1
  269. package/dist/index.es197.js +2 -25
  270. package/dist/index.es197.js.map +1 -1
  271. package/dist/index.es198.js +1 -0
  272. package/dist/index.es198.js.map +1 -1
  273. package/dist/index.es199.js +0 -1
  274. package/dist/index.es199.js.map +1 -1
  275. package/dist/index.es20.js +2 -2
  276. package/dist/index.es200.js +34 -2
  277. package/dist/index.es200.js.map +1 -1
  278. package/dist/index.es201.js +13 -32
  279. package/dist/index.es201.js.map +1 -1
  280. package/dist/index.es202.js +12 -11
  281. package/dist/index.es202.js.map +1 -1
  282. package/dist/index.es203.js +8 -13
  283. package/dist/index.es203.js.map +1 -1
  284. package/dist/index.es204.js +2 -9
  285. package/dist/index.es204.js.map +1 -1
  286. package/dist/index.es205.js +44 -6
  287. package/dist/index.es205.js.map +1 -1
  288. package/dist/index.es206.js +22 -4
  289. package/dist/index.es206.js.map +1 -1
  290. package/dist/index.es207.js +8 -4
  291. package/dist/index.es207.js.map +1 -1
  292. package/dist/index.es208.js +5 -3
  293. package/dist/index.es208.js.map +1 -1
  294. package/dist/index.es209.js +4 -3
  295. package/dist/index.es209.js.map +1 -1
  296. package/dist/index.es21.js +2 -2
  297. package/dist/index.es210.js +3 -9
  298. package/dist/index.es210.js.map +1 -1
  299. package/dist/index.es211.js +3 -22
  300. package/dist/index.es211.js.map +1 -1
  301. package/dist/index.es212.js +8 -21
  302. package/dist/index.es212.js.map +1 -1
  303. package/dist/index.es213.js +19 -11
  304. package/dist/index.es213.js.map +1 -1
  305. package/dist/index.es214.js +19 -14
  306. package/dist/index.es214.js.map +1 -1
  307. package/dist/index.es215.js +13 -5
  308. package/dist/index.es215.js.map +1 -1
  309. package/dist/index.es216.js +16 -8
  310. package/dist/index.es216.js.map +1 -1
  311. package/dist/index.es217.js +5 -6
  312. package/dist/index.es217.js.map +1 -1
  313. package/dist/index.es218.js +7 -20
  314. package/dist/index.es218.js.map +1 -1
  315. package/dist/index.es219.js +5 -8
  316. package/dist/index.es219.js.map +1 -1
  317. package/dist/index.es220.js +22 -9
  318. package/dist/index.es220.js.map +1 -1
  319. package/dist/index.es221.js +10 -4
  320. package/dist/index.es221.js.map +1 -1
  321. package/dist/index.es222.js +9 -11
  322. package/dist/index.es222.js.map +1 -1
  323. package/dist/index.es223.js +4 -9
  324. package/dist/index.es223.js.map +1 -1
  325. package/dist/index.es224.js +9 -21
  326. package/dist/index.es224.js.map +1 -1
  327. package/dist/index.es225.js +8 -11
  328. package/dist/index.es225.js.map +1 -1
  329. package/dist/index.es226.js +22 -18
  330. package/dist/index.es226.js.map +1 -1
  331. package/dist/index.es227.js +12 -4
  332. package/dist/index.es227.js.map +1 -1
  333. package/dist/index.es228.js +17 -16
  334. package/dist/index.es228.js.map +1 -1
  335. package/dist/index.es229.js +4 -12
  336. package/dist/index.es229.js.map +1 -1
  337. package/dist/index.es230.js +17 -3
  338. package/dist/index.es230.js.map +1 -1
  339. package/dist/index.es231.js +11 -4
  340. package/dist/index.es231.js.map +1 -1
  341. package/dist/index.es232.js +3 -45
  342. package/dist/index.es232.js.map +1 -1
  343. package/dist/index.es233.js +4 -22
  344. package/dist/index.es233.js.map +1 -1
  345. package/dist/index.es234.js +3 -6
  346. package/dist/index.es234.js.map +1 -1
  347. package/dist/index.es235.js +8 -3
  348. package/dist/index.es235.js.map +1 -1
  349. package/dist/index.es236.js +4 -6
  350. package/dist/index.es236.js.map +1 -1
  351. package/dist/index.es238.js +1 -1
  352. package/dist/index.es24.js +1 -1
  353. package/dist/index.es241.js +1 -1
  354. package/dist/index.es244.js +1 -1
  355. package/dist/index.es247.js +2 -2
  356. package/dist/index.es249.js +1 -1
  357. package/dist/index.es25.js +1 -1
  358. package/dist/index.es252.js +1 -1
  359. package/dist/index.es253.js +1 -1
  360. package/dist/index.es256.js +15 -4
  361. package/dist/index.es256.js.map +1 -1
  362. package/dist/index.es257.js +4 -15
  363. package/dist/index.es257.js.map +1 -1
  364. package/dist/index.es258.js +2 -2
  365. package/dist/index.es26.js +2 -2
  366. package/dist/index.es28.js +2 -2
  367. package/dist/index.es29.js +2 -2
  368. package/dist/index.es30.js +2 -2
  369. package/dist/index.es32.js +1 -1
  370. package/dist/index.es33.js +2 -2
  371. package/dist/index.es34.js +2 -2
  372. package/dist/index.es36.js +1 -1
  373. package/dist/index.es37.js +1 -1
  374. package/dist/index.es38.js +1 -1
  375. package/dist/index.es42.js +2 -2
  376. package/dist/index.es43.js +3 -3
  377. package/dist/index.es44.js +1 -1
  378. package/dist/index.es46.js +1 -1
  379. package/dist/index.es47.js +1 -1
  380. package/dist/index.es49.js +1 -1
  381. package/dist/index.es55.js +1 -1
  382. package/dist/index.es57.js +6 -6
  383. package/dist/index.es63.js +2 -107
  384. package/dist/index.es63.js.map +1 -1
  385. package/dist/index.es64.js +107 -10
  386. package/dist/index.es64.js.map +1 -1
  387. package/dist/index.es65.js +10 -2
  388. package/dist/index.es65.js.map +1 -1
  389. package/dist/index.es77.js +1 -1
  390. package/dist/index.es8.js +36 -34
  391. package/dist/index.es8.js.map +1 -1
  392. package/dist/index.es81.js +1 -1
  393. package/dist/index.es88.js +1 -1
  394. package/dist/index.es89.js +1 -1
  395. package/dist/index.es90.js +1 -1
  396. package/dist/index.es91.js +1 -1
  397. package/dist/index.es92.js +1 -1
  398. package/dist/index.es93.js +1 -1
  399. package/dist/index.es94.js +1 -1
  400. package/dist/index.es95.js +1 -1
  401. package/dist/index.es96.js +1 -1
  402. package/dist/index.es99.js +1 -1
  403. package/package.json +1 -1
  404. package/src/components/MapDraw.js +8 -1
  405. package/src/components/WarpedImageLayer.js +8 -1
  406. package/types/components/MapDraw.js.flow +8 -1
  407. package/types/components/WarpedImageLayer.js.flow +8 -1
@@ -1,5 +1,13 @@
1
- var a = { exports: {} };
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
- a as __module
10
+ t as DefaultContext,
11
+ d as IconContext
4
12
  };
5
13
  //# sourceMappingURL=index.es65.js.map
@@ -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]}
@@ -1,4 +1,4 @@
1
- import { __exports as a } from "./index.es189.js";
1
+ import { __exports as a } from "./index.es204.js";
2
2
  function i(r, s) {
3
3
  for (var o = 0; o < s.length; o++) {
4
4
  const e = s[o];
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 h, useRef as u, useCallback as a, useMemo as g, useEffect as x } from "react";
5
- import { Map as R, NavigationControl as D } from "./index.es15.js";
6
- import { FullscreenControl as G } from "./index.es51.js";
7
- import L from "./index.es22.js";
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 O from "./index.es2.js";
36
- import S from "./index.es4.js";
37
- import E from "./index.es12.js";
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 _ } from "./index.es53.js";
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 j = 2, w = 1e3, m = {
43
+ const B = 2, E = 1e3, m = {
44
44
  geometryCollection: "GeometryCollection",
45
45
  point: "Point",
46
46
  polygon: "Polygon"
47
- }, F = (t) => {
48
- const [c, d] = h(!1), e = u(), s = u(), f = a((o) => {
49
- if (!o)
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 } } = o;
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(e.current.getAll()), [t.onChange]), y = a(({ detail: o }) => {
54
- f(o) && (e.current.add(o.geometry), r(), t.onGeocodingSelection(o));
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 x(() => {
57
- if (c && t.data) {
58
- const o = E.getBoundingBox(t.data, t.buffer);
59
- o && s.current.fitBounds(o, { duration: t.zoomDuration }), t.data.type === m.geometryCollection ? L.each(t.data.geometries, (n) => {
60
- e.current.add(_(n));
61
- }) : e.current.add(t.data);
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
- }, [c, t.data]), /* @__PURE__ */ i.jsxs(
64
- R,
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
- ref: s,
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
- O,
76
+ L,
76
77
  {
77
- ref: e,
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
- S,
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(D, {}),
103
- t.fullscreen && /* @__PURE__ */ i.jsx(G, {}),
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
- F.defaultProps = {
110
- buffer: j,
110
+ _.defaultProps = {
111
+ buffer: B,
111
112
  cooperativeGestures: !0,
112
- zoomDuration: w
113
+ preserveDrawingBuffer: !1,
114
+ zoomDuration: E
113
115
  };
114
116
  export {
115
- F as default
117
+ _ as default
116
118
  };
117
119
  //# sourceMappingURL=index.es8.js.map
@@ -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 mapLib={maplibregl}\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 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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsBAA,EAAW,UAAU,QAAQ,eAAe;AAC5CA,EAAW,UAAU,QAAQ,iBAAiB;AAC9CA,EAAW,UAAU,QAAQ,gBAAgB;AAuE7C,MAAMC,IAAiB,GACjBC,IAAqB,KAErBC,IAAgB;AAAA,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import 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","Navigation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,cACNyB,gBAAAA,MAACI,GAAkB,CAAA,CAAA;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;"}
@@ -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.es231.js";
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];
@@ -1,4 +1,4 @@
1
- import t from "./index.es205.js";
1
+ import t from "./index.es207.js";
2
2
  const e = t("String");
3
3
  export {
4
4
  e as default
@@ -1,4 +1,4 @@
1
- import e from "./index.es205.js";
1
+ import e from "./index.es207.js";
2
2
  const t = e("Number");
3
3
  export {
4
4
  t as default
@@ -1,4 +1,4 @@
1
- import t from "./index.es205.js";
1
+ import t from "./index.es207.js";
2
2
  const a = t("Date");
3
3
  export {
4
4
  a as default
@@ -1,4 +1,4 @@
1
- import e from "./index.es205.js";
1
+ import e from "./index.es207.js";
2
2
  const o = e("RegExp");
3
3
  export {
4
4
  o as default
@@ -1,4 +1,4 @@
1
- import r from "./index.es205.js";
1
+ import r from "./index.es207.js";
2
2
  const t = r("Error");
3
3
  export {
4
4
  t as default
@@ -1,4 +1,4 @@
1
- import o from "./index.es205.js";
1
+ import o from "./index.es207.js";
2
2
  const e = o("Symbol");
3
3
  export {
4
4
  e as default
@@ -1,4 +1,4 @@
1
- import r from "./index.es205.js";
1
+ import r from "./index.es207.js";
2
2
  const f = r("ArrayBuffer");
3
3
  export {
4
4
  f as default
@@ -1,4 +1,4 @@
1
- import r from "./index.es205.js";
1
+ import r from "./index.es207.js";
2
2
  import i from "./index.es24.js";
3
3
  import a from "./index.es94.js";
4
4
  import { hasStringTagBug as e } from "./index.es25.js";
@@ -1,5 +1,5 @@
1
1
  import { nativeIsArray as r } from "./index.es23.js";
2
- import t from "./index.es205.js";
2
+ import t from "./index.es207.js";
3
3
  const e = r || t("Array");
4
4
  export {
5
5
  e as default
@@ -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.es207.js";
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@performant-software/geospatial",
3
- "version": "2.2.8-beta.1",
3
+ "version": "2.2.8-beta.3",
4
4
  "description": "A package of components for all things map-related.",
5
5
  "license": "MIT",
6
6
  "main": "./dist/index.cjs.js",
@@ -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
- instance.on('load', () => setLoaded(true));
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
- instance.on('load', () => setLoaded(true));
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
  /**