@performant-software/geospatial 3.0.6-beta.9 → 3.0.6

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 (370) hide show
  1. package/dist/index.cjs101.js +1 -1
  2. package/dist/index.cjs102.js +1 -1
  3. package/dist/index.cjs103.js +1 -1
  4. package/dist/index.cjs104.js +1 -1
  5. package/dist/index.cjs109.js +1 -1
  6. package/dist/index.cjs110.js +1 -1
  7. package/dist/index.cjs111.js +1 -1
  8. package/dist/index.cjs112.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.cjs121.js +1 -1
  13. package/dist/index.cjs124.js +1 -1
  14. package/dist/index.cjs128.js +1 -1
  15. package/dist/index.cjs131.js +1 -1
  16. package/dist/index.cjs139.js +1 -1
  17. package/dist/index.cjs14.js +1 -1
  18. package/dist/index.cjs140.js +1 -1
  19. package/dist/index.cjs141.js +1 -1
  20. package/dist/index.cjs142.js +1 -1
  21. package/dist/index.cjs143.js +1 -1
  22. package/dist/index.cjs144.js +1 -1
  23. package/dist/index.cjs145.js +1 -1
  24. package/dist/index.cjs147.js +1 -1
  25. package/dist/index.cjs148.js +1 -1
  26. package/dist/index.cjs149.js +1 -1
  27. package/dist/index.cjs15.js +1 -1
  28. package/dist/index.cjs150.js +1 -1
  29. package/dist/index.cjs151.js +1 -1
  30. package/dist/index.cjs152.js +1 -1
  31. package/dist/index.cjs153.js +1 -1
  32. package/dist/index.cjs154.js +1 -1
  33. package/dist/index.cjs155.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.cjs161.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.cjs174.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.cjs181.js +1 -1
  51. package/dist/index.cjs182.js +1 -1
  52. package/dist/index.cjs183.js +1 -1
  53. package/dist/index.cjs184.js +1 -1
  54. package/dist/index.cjs19.js +1 -1
  55. package/dist/index.cjs206.js +1 -1
  56. package/dist/index.cjs206.js.map +1 -1
  57. package/dist/index.cjs207.js +1 -1
  58. package/dist/index.cjs207.js.map +1 -1
  59. package/dist/index.cjs208.js +1 -1
  60. package/dist/index.cjs208.js.map +1 -1
  61. package/dist/index.cjs209.js +1 -1
  62. package/dist/index.cjs209.js.map +1 -1
  63. package/dist/index.cjs210.js +1 -1
  64. package/dist/index.cjs210.js.map +1 -1
  65. package/dist/index.cjs211.js +1 -1
  66. package/dist/index.cjs211.js.map +1 -1
  67. package/dist/index.cjs212.js +1 -1
  68. package/dist/index.cjs212.js.map +1 -1
  69. package/dist/index.cjs213.js +1 -1
  70. package/dist/index.cjs213.js.map +1 -1
  71. package/dist/index.cjs214.js +1 -1
  72. package/dist/index.cjs214.js.map +1 -1
  73. package/dist/index.cjs215.js +1 -1
  74. package/dist/index.cjs215.js.map +1 -1
  75. package/dist/index.cjs216.js +1 -1
  76. package/dist/index.cjs216.js.map +1 -1
  77. package/dist/index.cjs217.js +1 -1
  78. package/dist/index.cjs217.js.map +1 -1
  79. package/dist/index.cjs218.js +1 -1
  80. package/dist/index.cjs218.js.map +1 -1
  81. package/dist/index.cjs219.js +1 -1
  82. package/dist/index.cjs219.js.map +1 -1
  83. package/dist/index.cjs220.js +1 -1
  84. package/dist/index.cjs220.js.map +1 -1
  85. package/dist/index.cjs221.js +1 -1
  86. package/dist/index.cjs221.js.map +1 -1
  87. package/dist/index.cjs222.js +1 -1
  88. package/dist/index.cjs222.js.map +1 -1
  89. package/dist/index.cjs223.js +1 -1
  90. package/dist/index.cjs223.js.map +1 -1
  91. package/dist/index.cjs224.js +1 -1
  92. package/dist/index.cjs224.js.map +1 -1
  93. package/dist/index.cjs225.js +1 -1
  94. package/dist/index.cjs225.js.map +1 -1
  95. package/dist/index.cjs226.js +1 -1
  96. package/dist/index.cjs226.js.map +1 -1
  97. package/dist/index.cjs227.js +1 -1
  98. package/dist/index.cjs227.js.map +1 -1
  99. package/dist/index.cjs228.js +1 -1
  100. package/dist/index.cjs228.js.map +1 -1
  101. package/dist/index.cjs229.js +1 -1
  102. package/dist/index.cjs229.js.map +1 -1
  103. package/dist/index.cjs230.js +1 -1
  104. package/dist/index.cjs230.js.map +1 -1
  105. package/dist/index.cjs231.js +1 -1
  106. package/dist/index.cjs231.js.map +1 -1
  107. package/dist/index.cjs232.js +1 -1
  108. package/dist/index.cjs232.js.map +1 -1
  109. package/dist/index.cjs233.js +1 -1
  110. package/dist/index.cjs233.js.map +1 -1
  111. package/dist/index.cjs234.js +1 -1
  112. package/dist/index.cjs234.js.map +1 -1
  113. package/dist/index.cjs235.js +1 -1
  114. package/dist/index.cjs235.js.map +1 -1
  115. package/dist/index.cjs236.js +1 -1
  116. package/dist/index.cjs236.js.map +1 -1
  117. package/dist/index.cjs237.js +1 -1
  118. package/dist/index.cjs237.js.map +1 -1
  119. package/dist/index.cjs25.js +1 -1
  120. package/dist/index.cjs250.js +1 -1
  121. package/dist/index.cjs251.js +1 -1
  122. package/dist/index.cjs254.js +1 -1
  123. package/dist/index.cjs258.js +1 -1
  124. package/dist/index.cjs258.js.map +1 -1
  125. package/dist/index.cjs26.js +1 -1
  126. package/dist/index.cjs260.js +1 -1
  127. package/dist/index.cjs260.js.map +1 -1
  128. package/dist/index.cjs27.js +1 -1
  129. package/dist/index.cjs29.js +1 -1
  130. package/dist/index.cjs30.js +1 -1
  131. package/dist/index.cjs31.js +1 -1
  132. package/dist/index.cjs33.js +1 -1
  133. package/dist/index.cjs34.js +1 -1
  134. package/dist/index.cjs35.js +1 -1
  135. package/dist/index.cjs37.js +1 -1
  136. package/dist/index.cjs38.js +1 -1
  137. package/dist/index.cjs39.js +1 -1
  138. package/dist/index.cjs43.js +1 -1
  139. package/dist/index.cjs44.js +1 -1
  140. package/dist/index.cjs45.js +1 -1
  141. package/dist/index.cjs47.js +1 -1
  142. package/dist/index.cjs48.js +1 -1
  143. package/dist/index.cjs5.js +1 -1
  144. package/dist/index.cjs5.js.map +1 -1
  145. package/dist/index.cjs50.js +1 -1
  146. package/dist/index.cjs52.js +1 -1
  147. package/dist/index.cjs61.js +1 -1
  148. package/dist/index.cjs62.js +1 -1
  149. package/dist/index.cjs68.js +1 -1
  150. package/dist/index.cjs68.js.map +1 -1
  151. package/dist/index.cjs69.js +1 -1
  152. package/dist/index.cjs69.js.map +1 -1
  153. package/dist/index.cjs70.js +1 -1
  154. package/dist/index.cjs70.js.map +1 -1
  155. package/dist/index.cjs71.js +1 -1
  156. package/dist/index.cjs71.js.map +1 -1
  157. package/dist/index.cjs72.js +1 -1
  158. package/dist/index.cjs72.js.map +1 -1
  159. package/dist/index.cjs73.js +1 -1
  160. package/dist/index.cjs73.js.map +1 -1
  161. package/dist/index.cjs74.js +1 -1
  162. package/dist/index.cjs74.js.map +1 -1
  163. package/dist/index.cjs75.js +1 -1
  164. package/dist/index.cjs75.js.map +1 -1
  165. package/dist/index.cjs76.js +1 -1
  166. package/dist/index.cjs76.js.map +1 -1
  167. package/dist/index.cjs77.js +1 -1
  168. package/dist/index.cjs77.js.map +1 -1
  169. package/dist/index.cjs78.js +1 -1
  170. package/dist/index.cjs78.js.map +1 -1
  171. package/dist/index.cjs80.js +1 -1
  172. package/dist/index.cjs87.js +1 -1
  173. package/dist/index.cjs88.js +1 -1
  174. package/dist/index.cjs89.js +1 -1
  175. package/dist/index.cjs90.js +1 -1
  176. package/dist/index.cjs91.js +1 -1
  177. package/dist/index.cjs92.js +1 -1
  178. package/dist/index.cjs93.js +1 -1
  179. package/dist/index.cjs94.js +1 -1
  180. package/dist/index.cjs95.js +1 -1
  181. package/dist/index.cjs98.js +1 -1
  182. package/dist/index.cjs99.js +1 -1
  183. package/dist/index.es101.js +3 -3
  184. package/dist/index.es102.js +1 -1
  185. package/dist/index.es103.js +2 -2
  186. package/dist/index.es104.js +1 -1
  187. package/dist/index.es109.js +1 -1
  188. package/dist/index.es110.js +1 -1
  189. package/dist/index.es111.js +1 -1
  190. package/dist/index.es112.js +1 -1
  191. package/dist/index.es115.js +2 -2
  192. package/dist/index.es116.js +2 -2
  193. package/dist/index.es117.js +1 -1
  194. package/dist/index.es121.js +2 -2
  195. package/dist/index.es124.js +1 -1
  196. package/dist/index.es128.js +1 -1
  197. package/dist/index.es131.js +1 -1
  198. package/dist/index.es139.js +1 -1
  199. package/dist/index.es14.js +1 -1
  200. package/dist/index.es140.js +1 -1
  201. package/dist/index.es141.js +1 -1
  202. package/dist/index.es142.js +2 -2
  203. package/dist/index.es143.js +1 -1
  204. package/dist/index.es144.js +1 -1
  205. package/dist/index.es145.js +1 -1
  206. package/dist/index.es147.js +2 -2
  207. package/dist/index.es148.js +2 -2
  208. package/dist/index.es149.js +1 -1
  209. package/dist/index.es15.js +5 -5
  210. package/dist/index.es150.js +1 -1
  211. package/dist/index.es151.js +1 -1
  212. package/dist/index.es152.js +1 -1
  213. package/dist/index.es153.js +2 -2
  214. package/dist/index.es154.js +2 -2
  215. package/dist/index.es155.js +1 -1
  216. package/dist/index.es158.js +2 -2
  217. package/dist/index.es159.js +2 -2
  218. package/dist/index.es16.js +1 -1
  219. package/dist/index.es161.js +2 -2
  220. package/dist/index.es162.js +1 -1
  221. package/dist/index.es163.js +2 -2
  222. package/dist/index.es164.js +1 -1
  223. package/dist/index.es165.js +2 -2
  224. package/dist/index.es166.js +1 -1
  225. package/dist/index.es167.js +1 -1
  226. package/dist/index.es168.js +1 -1
  227. package/dist/index.es174.js +1 -1
  228. package/dist/index.es175.js +2 -2
  229. package/dist/index.es176.js +1 -1
  230. package/dist/index.es177.js +1 -1
  231. package/dist/index.es178.js +1 -1
  232. package/dist/index.es181.js +1 -1
  233. package/dist/index.es182.js +1 -1
  234. package/dist/index.es183.js +1 -1
  235. package/dist/index.es184.js +2 -2
  236. package/dist/index.es19.js +1 -1
  237. package/dist/index.es206.js +2 -46
  238. package/dist/index.es206.js.map +1 -1
  239. package/dist/index.es207.js +7 -22
  240. package/dist/index.es207.js.map +1 -1
  241. package/dist/index.es208.js +4 -7
  242. package/dist/index.es208.js.map +1 -1
  243. package/dist/index.es209.js +4 -5
  244. package/dist/index.es209.js.map +1 -1
  245. package/dist/index.es210.js +3 -4
  246. package/dist/index.es210.js.map +1 -1
  247. package/dist/index.es211.js +2 -2
  248. package/dist/index.es211.js.map +1 -1
  249. package/dist/index.es212.js +9 -3
  250. package/dist/index.es212.js.map +1 -1
  251. package/dist/index.es213.js +21 -8
  252. package/dist/index.es213.js.map +1 -1
  253. package/dist/index.es214.js +20 -20
  254. package/dist/index.es214.js.map +1 -1
  255. package/dist/index.es215.js +12 -20
  256. package/dist/index.es215.js.map +1 -1
  257. package/dist/index.es216.js +15 -12
  258. package/dist/index.es216.js.map +1 -1
  259. package/dist/index.es217.js +5 -16
  260. package/dist/index.es217.js.map +1 -1
  261. package/dist/index.es218.js +8 -5
  262. package/dist/index.es218.js.map +1 -1
  263. package/dist/index.es219.js +6 -8
  264. package/dist/index.es219.js.map +1 -1
  265. package/dist/index.es220.js +21 -6
  266. package/dist/index.es220.js.map +1 -1
  267. package/dist/index.es221.js +8 -20
  268. package/dist/index.es221.js.map +1 -1
  269. package/dist/index.es222.js +9 -10
  270. package/dist/index.es222.js.map +1 -1
  271. package/dist/index.es223.js +4 -9
  272. package/dist/index.es223.js.map +1 -1
  273. package/dist/index.es224.js +11 -4
  274. package/dist/index.es224.js.map +1 -1
  275. package/dist/index.es225.js +8 -10
  276. package/dist/index.es225.js.map +1 -1
  277. package/dist/index.es226.js +22 -8
  278. package/dist/index.es226.js.map +1 -1
  279. package/dist/index.es227.js +11 -22
  280. package/dist/index.es227.js.map +1 -1
  281. package/dist/index.es228.js +16 -9
  282. package/dist/index.es228.js.map +1 -1
  283. package/dist/index.es229.js +4 -19
  284. package/dist/index.es229.js.map +1 -1
  285. package/dist/index.es230.js +18 -4
  286. package/dist/index.es230.js.map +1 -1
  287. package/dist/index.es231.js +10 -16
  288. package/dist/index.es231.js.map +1 -1
  289. package/dist/index.es232.js +3 -11
  290. package/dist/index.es232.js.map +1 -1
  291. package/dist/index.es233.js +4 -3
  292. package/dist/index.es233.js.map +1 -1
  293. package/dist/index.es234.js +45 -4
  294. package/dist/index.es234.js.map +1 -1
  295. package/dist/index.es235.js +23 -2
  296. package/dist/index.es235.js.map +1 -1
  297. package/dist/index.es236.js +6 -3
  298. package/dist/index.es236.js.map +1 -1
  299. package/dist/index.es237.js +3 -6
  300. package/dist/index.es237.js.map +1 -1
  301. package/dist/index.es25.js +1 -1
  302. package/dist/index.es250.js +1 -1
  303. package/dist/index.es251.js +1 -1
  304. package/dist/index.es254.js +1 -1
  305. package/dist/index.es258.js +15 -70
  306. package/dist/index.es258.js.map +1 -1
  307. package/dist/index.es26.js +1 -1
  308. package/dist/index.es260.js +70 -15
  309. package/dist/index.es260.js.map +1 -1
  310. package/dist/index.es27.js +2 -2
  311. package/dist/index.es29.js +2 -2
  312. package/dist/index.es30.js +2 -2
  313. package/dist/index.es31.js +2 -2
  314. package/dist/index.es33.js +1 -1
  315. package/dist/index.es34.js +2 -2
  316. package/dist/index.es35.js +2 -2
  317. package/dist/index.es37.js +1 -1
  318. package/dist/index.es38.js +1 -1
  319. package/dist/index.es39.js +1 -1
  320. package/dist/index.es43.js +2 -2
  321. package/dist/index.es44.js +3 -3
  322. package/dist/index.es45.js +1 -1
  323. package/dist/index.es47.js +1 -1
  324. package/dist/index.es48.js +1 -1
  325. package/dist/index.es5.js +6 -7
  326. package/dist/index.es5.js.map +1 -1
  327. package/dist/index.es50.js +1 -1
  328. package/dist/index.es52.js +5 -5
  329. package/dist/index.es61.js +1 -1
  330. package/dist/index.es62.js +1 -1
  331. package/dist/index.es64.js +2 -2
  332. package/dist/index.es65.js +2 -2
  333. package/dist/index.es68.js +55 -2
  334. package/dist/index.es68.js.map +1 -1
  335. package/dist/index.es69.js +48 -4
  336. package/dist/index.es69.js.map +1 -1
  337. package/dist/index.es70.js +37 -55
  338. package/dist/index.es70.js.map +1 -1
  339. package/dist/index.es71.js +11 -47
  340. package/dist/index.es71.js.map +1 -1
  341. package/dist/index.es72.js +14 -38
  342. package/dist/index.es72.js.map +1 -1
  343. package/dist/index.es73.js +29 -11
  344. package/dist/index.es73.js.map +1 -1
  345. package/dist/index.es74.js +10 -10
  346. package/dist/index.es74.js.map +1 -1
  347. package/dist/index.es75.js +13 -29
  348. package/dist/index.es75.js.map +1 -1
  349. package/dist/index.es76.js +10 -12
  350. package/dist/index.es76.js.map +1 -1
  351. package/dist/index.es77.js +4 -14
  352. package/dist/index.es77.js.map +1 -1
  353. package/dist/index.es78.js +2 -11
  354. package/dist/index.es78.js.map +1 -1
  355. package/dist/index.es80.js +1 -1
  356. package/dist/index.es87.js +1 -1
  357. package/dist/index.es88.js +1 -1
  358. package/dist/index.es89.js +1 -1
  359. package/dist/index.es90.js +1 -1
  360. package/dist/index.es91.js +1 -1
  361. package/dist/index.es92.js +1 -1
  362. package/dist/index.es93.js +1 -1
  363. package/dist/index.es94.js +1 -1
  364. package/dist/index.es95.js +1 -1
  365. package/dist/index.es98.js +1 -1
  366. package/dist/index.es99.js +1 -1
  367. package/dist/style.css +1 -1
  368. package/package.json +1 -1
  369. package/src/components/LayerMenu.js +1 -2
  370. package/types/components/LayerMenu.js.flow +1 -2
package/dist/index.es5.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { j as i } from "./index.es17.js";
2
- import { useState as l, useRef as N, useCallback as c, useMemo as h, Children as k, useEffect as f } from "react";
3
- import { BsStack as x } from "./index.es21.js";
2
+ import { useState as l, useRef as x, useCallback as c, useMemo as h, Children as N, useEffect as f } from "react";
3
+ import { BsStack as k } from "./index.es21.js";
4
4
  import { IoCheckmarkOutline as C } from "./index.es22.js";
5
5
  import s from "./index.es23.js";
6
6
  import "./index.es24.js";
@@ -33,7 +33,7 @@ import "./index.es50.js";
33
33
  import M from "./index.es7.js";
34
34
  import "./index.es51.js";
35
35
  const _ = 30, w = (o) => {
36
- const [d, b] = l(0), [m, p] = l(), [g, j] = l(!1), a = N(), v = c((t) => o.names && o.names.length > t && o.names[t], [o.names]), r = c((t) => s.includes(m, t), [m]), n = h(() => k.toArray(o.children), [o.children]), y = h(() => s.filter(n, (t, e) => r(e)), [n, r]), u = c((t) => {
36
+ const [d, b] = l(0), [m, p] = l(), [g, j] = l(!1), a = x(), v = c((t) => o.names && o.names.length > t && o.names[t], [o.names]), r = c((t) => s.includes(m, t), [m]), n = h(() => N.toArray(o.children), [o.children]), y = h(() => s.filter(n, (t, e) => r(e)), [n, r]), u = c((t) => {
37
37
  let e;
38
38
  r(t) ? e = s.without(m, t) : e = [...m, t], p(e);
39
39
  }, [r, m]);
@@ -60,7 +60,7 @@ const _ = 30, w = (o) => {
60
60
  onClick: () => j((t) => !t),
61
61
  type: "button",
62
62
  children: /* @__PURE__ */ i.jsx(
63
- x,
63
+ k,
64
64
  {
65
65
  size: "1.25em"
66
66
  }
@@ -83,9 +83,9 @@ const _ = 30, w = (o) => {
83
83
  {
84
84
  "aria-selected": r(e),
85
85
  className: "option",
86
+ role: "option",
86
87
  onClick: () => u(e),
87
88
  onKeyDown: () => u(e),
88
- role: "option",
89
89
  tabIndex: e,
90
90
  children: [
91
91
  /* @__PURE__ */ i.jsx(
@@ -102,8 +102,7 @@ const _ = 30, w = (o) => {
102
102
  ),
103
103
  v(e)
104
104
  ]
105
- },
106
- e
105
+ }
107
106
  ))
108
107
  }
109
108
  )
@@ -1 +1 @@
1
- {"version":3,"file":"index.es5.js","sources":["../src/components/LayerMenu.js"],"sourcesContent":["// @flow\n\nimport React, {\n Children,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState\n} from 'react';\nimport { BsStack } from 'react-icons/bs';\nimport { IoCheckmarkOutline } from 'react-icons/io5';\nimport _ from 'underscore';\nimport MapControl from './MapControl';\nimport './LayerMenu.css';\n\ntype Props = {\n children: Node,\n className?: string,\n names: Array<string>,\n position: 'top-left' | 'bottom-left' | 'top-right' | 'bottom-right'\n};\n\nconst MENU_PADDING = 30;\n\nconst LayerMenu = (props: Props) => {\n const [canvasHeight, setCanvasHeight] = useState(0);\n const [visible, setVisible] = useState();\n const [menuOpen, setMenuOpen] = useState(false);\n\n const mapRef = useRef();\n\n /**\n * Returns the name of the layer at the passed index.\n *\n * @type {unknown}\n */\n const getLayerName = useCallback((index) => (\n props.names && props.names.length > index && props.names[index]\n ), [props.names]);\n\n /**\n * Returns true if the child element at the passed index is visible.\n *\n * @type {function(*): *}\n */\n const isVisible = useCallback((index) => _.includes(visible, index), [visible]);\n\n /**\n * Returns a memoized array of the child elements.\n *\n * @type {Array<$NonMaybeType<unknown>>}\n */\n const children = useMemo(() => Children.toArray(props.children), [props.children]);\n\n /**\n * Returns a memoized array of visible child elements.\n */\n const visibleChildren = useMemo(() => _.filter(children, (child, index) => isVisible(index)), [children, isVisible]);\n\n /**\n * Toggles the visibility for the child element at the passed index.\n *\n * @type {(function(*): void)|*}\n */\n const toggleVisibility = useCallback((index) => {\n let value;\n\n if (isVisible(index)) {\n value = _.without(visible, index);\n } else {\n value = [...visible, index];\n }\n\n setVisible(value);\n }, [isVisible, visible]);\n\n /**\n * Sets all of the child elements to be visible when the component mounts.\n */\n useEffect(() => {\n setVisible(_.times(children.length, (index) => index));\n }, []);\n\n /**\n * Sets the map canvas height.\n */\n useEffect(() => {\n const { current: instance } = mapRef;\n\n if (instance && instance._canvas) {\n const { offsetHeight = 0 } = mapRef.current._canvas;\n setCanvasHeight(offsetHeight);\n }\n }, [mapRef.current]);\n\n if (_.isEmpty(children)) {\n return null;\n }\n\n return (\n <>\n <MapControl\n mapRef={mapRef}\n position={props.position}\n >\n <button\n aria-label='Toggle Menu'\n className={props.className || 'mapbox-gl-draw_ctrl-draw-btn layer-button'}\n onClick={() => setMenuOpen((prevMenuOpen) => !prevMenuOpen)}\n type='button'\n >\n <BsStack\n size='1.25em'\n />\n </button>\n { menuOpen && (\n <div\n className='layer-menu'\n style={{\n maxHeight: `calc(${canvasHeight}px - ${MENU_PADDING}px)`\n }}\n >\n <div\n className='menu'\n >\n { _.map(children, (child, index) => (\n <div\n aria-selected={isVisible(index)}\n className='option'\n key={index}\n onClick={() => toggleVisibility(index)}\n onKeyDown={() => toggleVisibility(index)}\n role='option'\n tabIndex={index}\n >\n <div\n className='checkmark-container'\n >\n { isVisible(index) && (\n <IoCheckmarkOutline\n size='1em'\n />\n )}\n </div>\n { getLayerName(index) }\n </div>\n ))}\n </div>\n </div>\n )}\n </MapControl>\n { visibleChildren }\n </>\n );\n};\n\nLayerMenu.defaultProps = {\n position: 'top-left'\n};\n\nexport default LayerMenu;\n"],"names":["MENU_PADDING","LayerMenu","props","canvasHeight","setCanvasHeight","useState","visible","setVisible","menuOpen","setMenuOpen","mapRef","useRef","getLayerName","useCallback","index","isVisible","_","children","useMemo","Children","visibleChildren","child","toggleVisibility","value","useEffect","instance","offsetHeight","jsxs","Fragment","MapControl","jsx","prevMenuOpen","BsStack","IoCheckmarkOutline"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuBA,MAAMA,IAAe,IAEfC,IAAY,CAACC,MAAiB;AAClC,QAAM,CAACC,GAAcC,CAAe,IAAIC,EAAS,CAAC,GAC5C,CAACC,GAASC,CAAU,IAAIF,EAAS,GACjC,CAACG,GAAUC,CAAW,IAAIJ,EAAS,EAAK,GAExCK,IAASC,KAOTC,IAAeC,EAAY,CAACC,MAChCZ,EAAM,SAASA,EAAM,MAAM,SAASY,KAASZ,EAAM,MAAMY,CAAK,GAC7D,CAACZ,EAAM,KAAK,CAAC,GAOVa,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n Children,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState\n} from 'react';\nimport { BsStack } from 'react-icons/bs';\nimport { IoCheckmarkOutline } from 'react-icons/io5';\nimport _ from 'underscore';\nimport MapControl from './MapControl';\nimport './LayerMenu.css';\n\ntype Props = {\n children: Node,\n className?: string,\n names: Array<string>,\n position: 'top-left' | 'bottom-left' | 'top-right' | 'bottom-right'\n};\n\nconst MENU_PADDING = 30;\n\nconst LayerMenu = (props: Props) => {\n const [canvasHeight, setCanvasHeight] = useState(0);\n const [visible, setVisible] = useState();\n const [menuOpen, setMenuOpen] = useState(false);\n\n const mapRef = useRef();\n\n /**\n * Returns the name of the layer at the passed index.\n *\n * @type {unknown}\n */\n const getLayerName = useCallback((index) => (\n props.names && props.names.length > index && props.names[index]\n ), [props.names]);\n\n /**\n * Returns true if the child element at the passed index is visible.\n *\n * @type {function(*): *}\n */\n const isVisible = useCallback((index) => _.includes(visible, index), [visible]);\n\n /**\n * Returns a memoized array of the child elements.\n *\n * @type {Array<$NonMaybeType<unknown>>}\n */\n const children = useMemo(() => Children.toArray(props.children), [props.children]);\n\n /**\n * Returns a memoized array of visible child elements.\n */\n const visibleChildren = useMemo(() => _.filter(children, (child, index) => isVisible(index)), [children, isVisible]);\n\n /**\n * Toggles the visibility for the child element at the passed index.\n *\n * @type {(function(*): void)|*}\n */\n const toggleVisibility = useCallback((index) => {\n let value;\n\n if (isVisible(index)) {\n value = _.without(visible, index);\n } else {\n value = [...visible, index];\n }\n\n setVisible(value);\n }, [isVisible, visible]);\n\n /**\n * Sets all of the child elements to be visible when the component mounts.\n */\n useEffect(() => {\n setVisible(_.times(children.length, (index) => index));\n }, []);\n\n /**\n * Sets the map canvas height.\n */\n useEffect(() => {\n const { current: instance } = mapRef;\n\n if (instance && instance._canvas) {\n const { offsetHeight = 0 } = mapRef.current._canvas;\n setCanvasHeight(offsetHeight);\n }\n }, [mapRef.current]);\n\n if (_.isEmpty(children)) {\n return null;\n }\n\n return (\n <>\n <MapControl\n mapRef={mapRef}\n position={props.position}\n >\n <button\n aria-label='Toggle Menu'\n className={props.className || 'mapbox-gl-draw_ctrl-draw-btn layer-button'}\n onClick={() => setMenuOpen((prevMenuOpen) => !prevMenuOpen)}\n type='button'\n >\n <BsStack\n size='1.25em'\n />\n </button>\n { menuOpen && (\n <div\n className='layer-menu'\n style={{\n maxHeight: `calc(${canvasHeight}px - ${MENU_PADDING}px)`\n }}\n >\n <div\n className='menu'\n >\n { _.map(children, (child, index) => (\n <div\n aria-selected={isVisible(index)}\n className='option'\n role='option'\n onClick={() => toggleVisibility(index)}\n onKeyDown={() => toggleVisibility(index)}\n tabIndex={index}\n >\n <div\n className='checkmark-container'\n >\n { isVisible(index) && (\n <IoCheckmarkOutline\n size='1em'\n />\n )}\n </div>\n { getLayerName(index) }\n </div>\n ))}\n </div>\n </div>\n )}\n </MapControl>\n { visibleChildren }\n </>\n );\n};\n\nLayerMenu.defaultProps = {\n position: 'top-left'\n};\n\nexport default LayerMenu;\n"],"names":["MENU_PADDING","LayerMenu","props","canvasHeight","setCanvasHeight","useState","visible","setVisible","menuOpen","setMenuOpen","mapRef","useRef","getLayerName","useCallback","index","isVisible","_","children","useMemo","Children","visibleChildren","child","toggleVisibility","value","useEffect","instance","offsetHeight","jsxs","Fragment","MapControl","jsx","prevMenuOpen","BsStack","IoCheckmarkOutline"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuBA,MAAMA,IAAe,IAEfC,IAAY,CAACC,MAAiB;AAClC,QAAM,CAACC,GAAcC,CAAe,IAAIC,EAAS,CAAC,GAC5C,CAACC,GAASC,CAAU,IAAIF,EAAS,GACjC,CAACG,GAAUC,CAAW,IAAIJ,EAAS,EAAK,GAExCK,IAASC,KAOTC,IAAeC,EAAY,CAACC,MAChCZ,EAAM,SAASA,EAAM,MAAM,SAASY,KAASZ,EAAM,MAAMY,CAAK,GAC7D,CAACZ,EAAM,KAAK,CAAC,GAOVa,IAAYF,EAAY,CAACC,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A,cAEL,UAAAD,gBAAAA,EAAA;AAAA,gBAACE;AAAA,gBAAA;AAAA,kBACC,MAAK;AAAA,gBAAA;AAAA,cACP;AAAA,YAAA;AAAA,UACF;AAAA,UACExB,KACAsB,gBAAAA,EAAA;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,WAAU;AAAA,cACV,OAAO;AAAA,gBACL,WAAW,QAAQ3B,CAAY,QAAQH,CAAY;AAAA,cACrD;AAAA,cAEA,UAAA8B,gBAAAA,EAAA;AAAA,gBAAC;AAAA,gBAAA;AAAA,kBACC,WAAU;AAAA,kBAER,UAAEd,EAAA,IAAIC,GAAU,CAACI,GAAOP,MACxBa,gBAAAA,EAAA;AAAA,oBAAC;AAAA,oBAAA;AAAA,sBACC,iBAAeZ,EAAUD,CAAK;AAAA,sBAC9B,WAAU;AAAA,sBACV,MAAK;AAAA,sBACL,SAAS,MAAMQ,EAAiBR,CAAK;AAAA,sBACrC,WAAW,MAAMQ,EAAiBR,CAAK;AAAA,sBACvC,UAAUA;AAAA,sBAEV,UAAA;AAAA,wBAAAgB,gBAAAA,EAAA;AAAA,0BAAC;AAAA,0BAAA;AAAA,4BACC,WAAU;AAAA,4BAER,UAAAf,EAAUD,CAAK,KACfgB,gBAAAA,EAAA;AAAA,8BAACG;AAAA,8BAAA;AAAA,gCACC,MAAK;AAAA,8BAAA;AAAA,4BACP;AAAA,0BAAA;AAAA,wBAEJ;AAAA,wBACErB,EAAaE,CAAK;AAAA,sBAAA;AAAA,oBAAA;AAAA,kBAAA,CAEvB;AAAA,gBAAA;AAAA,cACH;AAAA,YAAA;AAAA,UACF;AAAA,QAAA;AAAA,MAAA;AAAA,IAEJ;AAAA,IACEM;AAAA,EACJ,EAAA,CAAA;AAEJ;AAEAnB,EAAU,eAAe;AAAA,EACvB,UAAU;AACZ;"}
@@ -1,7 +1,7 @@
1
1
  import i from "./index.es28.js";
2
2
  import p from "./index.es147.js";
3
3
  import { ArrayProto as e } from "./index.es24.js";
4
- import s from "./index.es234.js";
4
+ import s from "./index.es233.js";
5
5
  p(["pop", "push", "reverse", "shift", "sort", "splice", "unshift"], function(r) {
6
6
  var o = e[r];
7
7
  i.prototype[r] = function() {
@@ -1,13 +1,13 @@
1
1
  import * as m from "react";
2
- import p from "./index.es70.js";
2
+ import p from "./index.es68.js";
3
+ import "./index.es69.js";
4
+ import "./index.es70.js";
3
5
  import "./index.es71.js";
4
- import "./index.es72.js";
6
+ import i from "./index.es72.js";
5
7
  import "./index.es73.js";
6
- import i from "./index.es74.js";
8
+ import "./index.es74.js";
7
9
  import "./index.es75.js";
8
10
  import "./index.es76.js";
9
- import "./index.es77.js";
10
- import "./index.es78.js";
11
11
  const n = import("./index.es19.js").then((r) => r.o);
12
12
  m.forwardRef(function(o, t) {
13
13
  return p(o, t, n);
@@ -1,4 +1,4 @@
1
- import { __exports as t } from "./index.es68.js";
1
+ import { __exports as t } from "./index.es77.js";
2
2
  import R from "react";
3
3
  var p;
4
4
  function v() {
@@ -1,4 +1,4 @@
1
- import { __exports as y } from "./index.es69.js";
1
+ import { __exports as y } from "./index.es78.js";
2
2
  import te from "react";
3
3
  var hr;
4
4
  function oe() {
@@ -1,5 +1,5 @@
1
- var a = { exports: {} };
1
+ var e = { exports: {} };
2
2
  export {
3
- a as __module
3
+ e as __module
4
4
  };
5
5
  //# sourceMappingURL=index.es64.js.map
@@ -1,5 +1,5 @@
1
- var e = { exports: {} };
1
+ var a = { exports: {} };
2
2
  export {
3
- e as __module
3
+ a as __module
4
4
  };
5
5
  //# sourceMappingURL=index.es65.js.map
@@ -1,5 +1,58 @@
1
- var r = {};
1
+ import * as l from "react";
2
+ import { useContext as b, useState as E, useRef as c, useEffect as x, useImperativeHandle as w, useMemo as y } from "react";
3
+ import { MountedMapsContext as L } from "./index.es76.js";
4
+ import m from "./index.es184.js";
5
+ import I from "./index.es185.js";
6
+ import C from "./index.es186.js";
7
+ import g from "./index.es187.js";
8
+ const R = l.createContext(null);
9
+ function A(e, f, d) {
10
+ const o = b(L), [i, p] = E(null), s = c(), { current: a } = c({ mapLib: null, map: null });
11
+ x(() => {
12
+ const v = e.mapLib;
13
+ let u = !0, n;
14
+ return Promise.resolve(v || d).then((r) => {
15
+ if (!u)
16
+ return;
17
+ if (!r)
18
+ throw new Error("Invalid mapLib");
19
+ const t = "Map" in r ? r : r.default;
20
+ if (!t.Map)
21
+ throw new Error("Invalid mapLib");
22
+ if (g(t, e), !t.supported || t.supported(e))
23
+ e.reuseMaps && (n = m.reuse(e, s.current)), n || (n = new m(t.Map, e, s.current)), a.map = I(n), a.mapLib = t, p(n), o == null || o.onMapMount(a.map, e.id);
24
+ else
25
+ throw new Error("Map is not supported by this browser");
26
+ }).catch((r) => {
27
+ const { onError: t } = e;
28
+ t ? t({
29
+ type: "error",
30
+ target: null,
31
+ originalEvent: null,
32
+ error: r
33
+ }) : console.error(r);
34
+ }), () => {
35
+ u = !1, n && (o == null || o.onMapUnmount(e.id), e.reuseMaps ? n.recycle() : n.destroy());
36
+ };
37
+ }, []), C(() => {
38
+ i && i.setProps(e);
39
+ }), w(f, () => a.map, [i]);
40
+ const M = y(() => ({
41
+ position: "relative",
42
+ width: "100%",
43
+ height: "100%",
44
+ ...e.style
45
+ }), [e.style]), h = {
46
+ height: "100%"
47
+ };
48
+ return l.createElement("div", { id: e.id, ref: s, style: M }, i && l.createElement(
49
+ R.Provider,
50
+ { value: a },
51
+ l.createElement("div", { "mapboxgl-children": "", style: h }, e.children)
52
+ ));
53
+ }
2
54
  export {
3
- r as __exports
55
+ R as MapContext,
56
+ A as default
4
57
  };
5
58
  //# sourceMappingURL=index.es68.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.es68.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
1
+ {"version":3,"file":"index.es68.js","sources":["../../../node_modules/react-map-gl/dist/esm/components/map.js"],"sourcesContent":["import * as React from 'react';\nimport { useState, useRef, useEffect, useContext, useMemo, useImperativeHandle } from 'react';\nimport { MountedMapsContext } from './use-map';\nimport Mapbox from '../mapbox/mapbox';\nimport createRef from '../mapbox/create-ref';\nimport useIsomorphicLayoutEffect from '../utils/use-isomorphic-layout-effect';\nimport setGlobals from '../utils/set-globals';\nexport const MapContext = React.createContext(null);\nexport default function Map(props, ref, defaultLib) {\n const mountedMapsContext = useContext(MountedMapsContext);\n const [mapInstance, setMapInstance] = useState(null);\n const containerRef = useRef();\n const { current: contextValue } = useRef({ mapLib: null, map: null });\n useEffect(() => {\n const mapLib = props.mapLib;\n let isMounted = true;\n let mapbox;\n Promise.resolve(mapLib || defaultLib)\n .then((module) => {\n if (!isMounted) {\n return;\n }\n if (!module) {\n throw new Error('Invalid mapLib');\n }\n const mapboxgl = 'Map' in module ? module : module.default;\n if (!mapboxgl.Map) {\n throw new Error('Invalid mapLib');\n }\n // workerUrl & workerClass may change the result of supported()\n // https://github.com/visgl/react-map-gl/discussions/2027\n setGlobals(mapboxgl, props);\n if (!mapboxgl.supported || mapboxgl.supported(props)) {\n if (props.reuseMaps) {\n mapbox = Mapbox.reuse(props, containerRef.current);\n }\n if (!mapbox) {\n mapbox = new Mapbox(mapboxgl.Map, props, containerRef.current);\n }\n contextValue.map = createRef(mapbox);\n contextValue.mapLib = mapboxgl;\n setMapInstance(mapbox);\n mountedMapsContext === null || mountedMapsContext === void 0 ? void 0 : mountedMapsContext.onMapMount(contextValue.map, props.id);\n }\n else {\n throw new Error('Map is not supported by this browser');\n }\n })\n .catch(error => {\n const { onError } = props;\n if (onError) {\n onError({\n type: 'error',\n target: null,\n originalEvent: null,\n error\n });\n }\n else {\n console.error(error); // eslint-disable-line\n }\n });\n return () => {\n isMounted = false;\n if (mapbox) {\n mountedMapsContext === null || mountedMapsContext === void 0 ? void 0 : mountedMapsContext.onMapUnmount(props.id);\n if (props.reuseMaps) {\n mapbox.recycle();\n }\n else {\n mapbox.destroy();\n }\n }\n };\n }, []);\n useIsomorphicLayoutEffect(() => {\n if (mapInstance) {\n mapInstance.setProps(props);\n }\n });\n useImperativeHandle(ref, () => contextValue.map, [mapInstance]);\n const style = useMemo(() => ({\n position: 'relative',\n width: '100%',\n height: '100%',\n ...props.style\n }), [props.style]);\n const CHILD_CONTAINER_STYLE = {\n height: '100%'\n };\n return (React.createElement(\"div\", { id: props.id, ref: containerRef, style: style }, mapInstance && (React.createElement(MapContext.Provider, { value: contextValue },\n React.createElement(\"div\", { \"mapboxgl-children\": \"\", style: CHILD_CONTAINER_STYLE }, props.children)))));\n}\n//# sourceMappingURL=map.js.map"],"names":["MapContext","React","Map","props","ref","defaultLib","mountedMapsContext","useContext","MountedMapsContext","mapInstance","setMapInstance","useState","containerRef","useRef","contextValue","useEffect","mapLib","isMounted","mapbox","module","mapboxgl","setGlobals","Mapbox","createRef","error","onError","useIsomorphicLayoutEffect","useImperativeHandle","style","useMemo","CHILD_CONTAINER_STYLE"],"mappings":";;;;;;;AAOa,MAAAA,IAAaC,EAAM,cAAc,IAAI;AAC1B,SAAAC,EAAIC,GAAOC,GAAKC,GAAY;AAC1C,QAAAC,IAAqBC,EAAWC,CAAkB,GAClD,CAACC,GAAaC,CAAc,IAAIC,EAAS,IAAI,GAC7CC,IAAeC,KACf,EAAE,SAASC,EAAA,IAAiBD,EAAO,EAAE,QAAQ,MAAM,KAAK,KAAA,CAAM;AACpE,EAAAE,EAAU,MAAM;AACZ,UAAMC,IAASb,EAAM;AACrB,QAAIc,IAAY,IACZC;AACJ,mBAAQ,QAAQF,KAAUX,CAAU,EAC/B,KAAK,CAACc,MAAW;AAClB,UAAI,CAACF;AACD;AAEJ,UAAI,CAACE;AACK,cAAA,IAAI,MAAM,gBAAgB;AAEpC,YAAMC,IAAW,SAASD,IAASA,IAASA,EAAO;AAC/C,UAAA,CAACC,EAAS;AACJ,cAAA,IAAI,MAAM,gBAAgB;AAKpC,UADAC,EAAWD,GAAUjB,CAAK,GACtB,CAACiB,EAAS,aAAaA,EAAS,UAAUjB,CAAK;AAC/C,QAAIA,EAAM,cACNe,IAASI,EAAO,MAAMnB,GAAOS,EAAa,OAAO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A,GAAyB3B,EAAM,QAAQ;AAAA,EAAA,CAAG;AAC/G;","x_google_ignoreList":[0]}
@@ -1,5 +1,49 @@
1
- var e = {};
2
- export {
3
- e as __exports
4
- };
1
+ import * as k from "react";
2
+ import { memo as A, forwardRef as P, useContext as C, useRef as D, useMemo as M, useEffect as h, useImperativeHandle as y } from "react";
3
+ import { createPortal as w } from "react-dom";
4
+ import { applyReactStyle as x } from "./index.es188.js";
5
+ import { MapContext as O } from "./index.es68.js";
6
+ import { arePointsEqual as S } from "./index.es189.js";
7
+ function q(o, E) {
8
+ const { map: R, mapLib: b } = C(O), i = D({ props: o });
9
+ i.current.props = o;
10
+ const t = M(() => {
11
+ let L = !1;
12
+ k.Children.forEach(o.children, (a) => {
13
+ a && (L = !0);
14
+ });
15
+ const _ = {
16
+ ...o,
17
+ element: L ? document.createElement("div") : null
18
+ }, l = new b.Marker(_);
19
+ return l.setLngLat([o.longitude, o.latitude]), l.getElement().addEventListener("click", (a) => {
20
+ var n, e;
21
+ (e = (n = i.current.props).onClick) === null || e === void 0 || e.call(n, {
22
+ type: "click",
23
+ target: l,
24
+ originalEvent: a
25
+ });
26
+ }), l.on("dragstart", (a) => {
27
+ var n, e;
28
+ const r = a;
29
+ r.lngLat = t.getLngLat(), (e = (n = i.current.props).onDragStart) === null || e === void 0 || e.call(n, r);
30
+ }), l.on("drag", (a) => {
31
+ var n, e;
32
+ const r = a;
33
+ r.lngLat = t.getLngLat(), (e = (n = i.current.props).onDrag) === null || e === void 0 || e.call(n, r);
34
+ }), l.on("dragend", (a) => {
35
+ var n, e;
36
+ const r = a;
37
+ r.lngLat = t.getLngLat(), (e = (n = i.current.props).onDragEnd) === null || e === void 0 || e.call(n, r);
38
+ }), l;
39
+ }, []);
40
+ h(() => (t.addTo(R.getMap()), () => {
41
+ t.remove();
42
+ }), []);
43
+ const { longitude: c, latitude: s, offset: g, style: m, draggable: u = !1, popup: d = null, rotation: f = 0, rotationAlignment: v = "auto", pitchAlignment: p = "auto" } = o;
44
+ return h(() => {
45
+ x(t.getElement(), m);
46
+ }, [m]), y(E, () => t, []), (t.getLngLat().lng !== c || t.getLngLat().lat !== s) && t.setLngLat([c, s]), g && !S(t.getOffset(), g) && t.setOffset(g), t.isDraggable() !== u && t.setDraggable(u), t.getRotation() !== f && t.setRotation(f), t.getRotationAlignment() !== v && t.setRotationAlignment(v), t.getPitchAlignment() !== p && t.setPitchAlignment(p), t.getPopup() !== d && t.setPopup(d), w(o.children, t.getElement());
47
+ }
48
+ A(P(q));
5
49
  //# sourceMappingURL=index.es69.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.es69.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
1
+ {"version":3,"file":"index.es69.js","sources":["../../../node_modules/react-map-gl/dist/esm/components/marker.js"],"sourcesContent":["/* global document */\nimport * as React from 'react';\nimport { createPortal } from 'react-dom';\nimport { useImperativeHandle, useEffect, useMemo, useRef, useContext, forwardRef, memo } from 'react';\nimport { applyReactStyle } from '../utils/apply-react-style';\nimport { MapContext } from './map';\nimport { arePointsEqual } from '../utils/deep-equal';\n/* eslint-disable complexity,max-statements */\nfunction Marker(props, ref) {\n const { map, mapLib } = useContext(MapContext);\n const thisRef = useRef({ props });\n thisRef.current.props = props;\n const marker = useMemo(() => {\n let hasChildren = false;\n React.Children.forEach(props.children, el => {\n if (el) {\n hasChildren = true;\n }\n });\n const options = {\n ...props,\n element: hasChildren ? document.createElement('div') : null\n };\n const mk = new mapLib.Marker(options);\n mk.setLngLat([props.longitude, props.latitude]);\n mk.getElement().addEventListener('click', (e) => {\n var _a, _b;\n (_b = (_a = thisRef.current.props).onClick) === null || _b === void 0 ? void 0 : _b.call(_a, {\n type: 'click',\n target: mk,\n originalEvent: e\n });\n });\n mk.on('dragstart', e => {\n var _a, _b;\n const evt = e;\n evt.lngLat = marker.getLngLat();\n (_b = (_a = thisRef.current.props).onDragStart) === null || _b === void 0 ? void 0 : _b.call(_a, evt);\n });\n mk.on('drag', e => {\n var _a, _b;\n const evt = e;\n evt.lngLat = marker.getLngLat();\n (_b = (_a = thisRef.current.props).onDrag) === null || _b === void 0 ? void 0 : _b.call(_a, evt);\n });\n mk.on('dragend', e => {\n var _a, _b;\n const evt = e;\n evt.lngLat = marker.getLngLat();\n (_b = (_a = thisRef.current.props).onDragEnd) === null || _b === void 0 ? void 0 : _b.call(_a, evt);\n });\n return mk;\n }, []);\n useEffect(() => {\n marker.addTo(map.getMap());\n return () => {\n marker.remove();\n };\n }, []);\n const { longitude, latitude, offset, style, draggable = false, popup = null, rotation = 0, rotationAlignment = 'auto', pitchAlignment = 'auto' } = props;\n useEffect(() => {\n applyReactStyle(marker.getElement(), style);\n }, [style]);\n useImperativeHandle(ref, () => marker, []);\n if (marker.getLngLat().lng !== longitude || marker.getLngLat().lat !== latitude) {\n marker.setLngLat([longitude, latitude]);\n }\n if (offset && !arePointsEqual(marker.getOffset(), offset)) {\n marker.setOffset(offset);\n }\n if (marker.isDraggable() !== draggable) {\n marker.setDraggable(draggable);\n }\n if (marker.getRotation() !== rotation) {\n marker.setRotation(rotation);\n }\n if (marker.getRotationAlignment() !== rotationAlignment) {\n marker.setRotationAlignment(rotationAlignment);\n }\n if (marker.getPitchAlignment() !== pitchAlignment) {\n marker.setPitchAlignment(pitchAlignment);\n }\n if (marker.getPopup() !== popup) {\n marker.setPopup(popup);\n }\n return createPortal(props.children, marker.getElement());\n}\nexport default memo(forwardRef(Marker));\n//# sourceMappingURL=marker.js.map"],"names":["Marker","props","ref","map","mapLib","useContext","MapContext","thisRef","useRef","marker","useMemo","hasChildren","React","el","options","mk","e","_a","_b","evt","useEffect","longitude","latitude","offset","style","draggable","popup","rotation","rotationAlignment","pitchAlignment","applyReactStyle","useImperativeHandle","arePointsEqual","createPortal","memo","forwardRef"],"mappings":";;;;;;AAQA,SAASA,EAAOC,GAAOC,GAAK;AACxB,QAAM,EAAE,KAAAC,GAAK,QAAAC,EAAO,IAAIC,EAAWC,CAAU,GACvCC,IAAUC,EAAO,E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- import * as l from "react";
2
- import { useContext as b, useState as E, useRef as c, useEffect as x, useImperativeHandle as w, useMemo as y } from "react";
3
- import { MountedMapsContext as L } from "./index.es78.js";
4
- import m from "./index.es184.js";
5
- import I from "./index.es185.js";
6
- import C from "./index.es186.js";
7
- import g from "./index.es187.js";
8
- const R = l.createContext(null);
9
- function A(e, f, d) {
10
- const o = b(L), [i, p] = E(null), s = c(), { current: a } = c({ mapLib: null, map: null });
11
- x(() => {
12
- const v = e.mapLib;
13
- let u = !0, n;
14
- return Promise.resolve(v || d).then((r) => {
15
- if (!u)
16
- return;
17
- if (!r)
18
- throw new Error("Invalid mapLib");
19
- const t = "Map" in r ? r : r.default;
20
- if (!t.Map)
21
- throw new Error("Invalid mapLib");
22
- if (g(t, e), !t.supported || t.supported(e))
23
- e.reuseMaps && (n = m.reuse(e, s.current)), n || (n = new m(t.Map, e, s.current)), a.map = I(n), a.mapLib = t, p(n), o == null || o.onMapMount(a.map, e.id);
24
- else
25
- throw new Error("Map is not supported by this browser");
26
- }).catch((r) => {
27
- const { onError: t } = e;
28
- t ? t({
29
- type: "error",
30
- target: null,
31
- originalEvent: null,
32
- error: r
33
- }) : console.error(r);
34
- }), () => {
35
- u = !1, n && (o == null || o.onMapUnmount(e.id), e.reuseMaps ? n.recycle() : n.destroy());
1
+ import { createPortal as h } from "react-dom";
2
+ import { memo as L, forwardRef as v, useContext as C, useMemo as f, useRef as x, useEffect as m, useImperativeHandle as N } from "react";
3
+ import { applyReactStyle as M } from "./index.es188.js";
4
+ import { MapContext as O } from "./index.es68.js";
5
+ import { deepEqual as y } from "./index.es189.js";
6
+ function r(t) {
7
+ return new Set(t ? t.trim().split(/\s+/) : []);
8
+ }
9
+ function E(t, u) {
10
+ const { map: d, mapLib: g } = C(O), c = f(() => document.createElement("div"), []), i = x({ props: t });
11
+ i.current.props = t;
12
+ const e = f(() => {
13
+ const a = { ...t }, o = new g.Popup(a);
14
+ return o.setLngLat([t.longitude, t.latitude]), o.once("open", (n) => {
15
+ var s, l;
16
+ (l = (s = i.current.props).onOpen) === null || l === void 0 || l.call(s, n);
17
+ }), o;
18
+ }, []);
19
+ if (m(() => {
20
+ const a = (o) => {
21
+ var n, s;
22
+ (s = (n = i.current.props).onClose) === null || s === void 0 || s.call(n, o);
23
+ };
24
+ return e.on("close", a), e.setDOMContent(c).addTo(d.getMap()), () => {
25
+ e.off("close", a), e.isOpen() && e.remove();
36
26
  };
37
- }, []), C(() => {
38
- i && i.setProps(e);
39
- }), w(f, () => a.map, [i]);
40
- const M = y(() => ({
41
- position: "relative",
42
- width: "100%",
43
- height: "100%",
44
- ...e.style
45
- }), [e.style]), h = {
46
- height: "100%"
47
- };
48
- return l.createElement("div", { id: e.id, ref: s, style: M }, i && l.createElement(
49
- R.Provider,
50
- { value: a },
51
- l.createElement("div", { "mapboxgl-children": "", style: h }, e.children)
52
- ));
27
+ }, []), m(() => {
28
+ M(e.getElement(), t.style);
29
+ }, [t.style]), N(u, () => e, []), e.isOpen() && ((e.getLngLat().lng !== t.longitude || e.getLngLat().lat !== t.latitude) && e.setLngLat([t.longitude, t.latitude]), t.offset && !y(e.options.offset, t.offset) && e.setOffset(t.offset), (e.options.anchor !== t.anchor || e.options.maxWidth !== t.maxWidth) && (e.options.anchor = t.anchor, e.setMaxWidth(t.maxWidth)), e.options.className !== t.className)) {
30
+ const a = r(e.options.className), o = r(t.className);
31
+ for (const n of a)
32
+ o.has(n) || e.removeClassName(n);
33
+ for (const n of o)
34
+ a.has(n) || e.addClassName(n);
35
+ e.options.className = t.className;
36
+ }
37
+ return h(t.children, c);
53
38
  }
54
- export {
55
- R as MapContext,
56
- A as default
57
- };
39
+ L(v(E));
58
40
  //# sourceMappingURL=index.es70.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.es70.js","sources":["../../../node_modules/react-map-gl/dist/esm/components/map.js"],"sourcesContent":["import * as React from 'react';\nimport { useState, useRef, useEffect, useContext, useMemo, useImperativeHandle } from 'react';\nimport { MountedMapsContext } from './use-map';\nimport Mapbox from '../mapbox/mapbox';\nimport createRef from '../mapbox/create-ref';\nimport useIsomorphicLayoutEffect from '../utils/use-isomorphic-layout-effect';\nimport setGlobals from '../utils/set-globals';\nexport const MapContext = React.createContext(null);\nexport default function Map(props, ref, defaultLib) {\n const mountedMapsContext = useContext(MountedMapsContext);\n const [mapInstance, setMapInstance] = useState(null);\n const containerRef = useRef();\n const { current: contextValue } = useRef({ mapLib: null, map: null });\n useEffect(() => {\n const mapLib = props.mapLib;\n let isMounted = true;\n let mapbox;\n Promise.resolve(mapLib || defaultLib)\n .then((module) => {\n if (!isMounted) {\n return;\n }\n if (!module) {\n throw new Error('Invalid mapLib');\n }\n const mapboxgl = 'Map' in module ? module : module.default;\n if (!mapboxgl.Map) {\n throw new Error('Invalid mapLib');\n }\n // workerUrl & workerClass may change the result of supported()\n // https://github.com/visgl/react-map-gl/discussions/2027\n setGlobals(mapboxgl, props);\n if (!mapboxgl.supported || mapboxgl.supported(props)) {\n if (props.reuseMaps) {\n mapbox = Mapbox.reuse(props, containerRef.current);\n }\n if (!mapbox) {\n mapbox = new Mapbox(mapboxgl.Map, props, containerRef.current);\n }\n contextValue.map = createRef(mapbox);\n contextValue.mapLib = mapboxgl;\n setMapInstance(mapbox);\n mountedMapsContext === null || mountedMapsContext === void 0 ? void 0 : mountedMapsContext.onMapMount(contextValue.map, props.id);\n }\n else {\n throw new Error('Map is not supported by this browser');\n }\n })\n .catch(error => {\n const { onError } = props;\n if (onError) {\n onError({\n type: 'error',\n target: null,\n originalEvent: null,\n error\n });\n }\n else {\n console.error(error); // eslint-disable-line\n }\n });\n return () => {\n isMounted = false;\n if (mapbox) {\n mountedMapsContext === null || mountedMapsContext === void 0 ? void 0 : mountedMapsContext.onMapUnmount(props.id);\n if (props.reuseMaps) {\n mapbox.recycle();\n }\n else {\n mapbox.destroy();\n }\n }\n };\n }, []);\n useIsomorphicLayoutEffect(() => {\n if (mapInstance) {\n mapInstance.setProps(props);\n }\n });\n useImperativeHandle(ref, () => contextValue.map, [mapInstance]);\n const style = useMemo(() => ({\n position: 'relative',\n width: '100%',\n height: '100%',\n ...props.style\n }), [props.style]);\n const CHILD_CONTAINER_STYLE = {\n height: '100%'\n };\n return (React.createElement(\"div\", { id: props.id, ref: containerRef, style: style }, mapInstance && (React.createElement(MapContext.Provider, { value: contextValue },\n React.createElement(\"div\", { \"mapboxgl-children\": \"\", style: CHILD_CONTAINER_STYLE }, props.children)))));\n}\n//# sourceMappingURL=map.js.map"],"names":["MapContext","React","Map","props","ref","defaultLib","mountedMapsContext","useContext","MountedMapsContext","mapInstance","setMapInstance","useState","containerRef","useRef","contextValue","useEffect","mapLib","isMounted","mapbox","module","mapboxgl","setGlobals","Mapbox","createRef","error","onError","useIsomorphicLayoutEffect","useImperativeHandle","style","useMemo","CHILD_CONTAINER_STYLE"],"mappings":";;;;;;;AAOa,MAAAA,IAAaC,EAAM,cAAc,IAAI;AAC1B,SAAAC,EAAIC,GAAOC,GAAKC,GAAY;AAC1C,QAAAC,IAAqBC,EAAWC,CAAkB,GAClD,CAACC,GAAaC,CAAc,IAAIC,EAAS,IAAI,GAC7CC,IAAeC,KACf,EAAE,SAASC,EAAA,IAAiBD,EAAO,EAAE,QAAQ,MAAM,KAAK,KAAA,CAAM;AACpE,EAAAE,EAAU,MAAM;AACZ,UAAMC,IAASb,EAAM;AACrB,QAAIc,IAAY,IACZC;AACJ,mBAAQ,QAAQF,KAAUX,CAAU,EAC/B,KAAK,CAACc,MAAW;AAClB,UAAI,CAACF;AACD;AAEJ,UAAI,CAACE;AACK,cAAA,IAAI,MAAM,gBAAgB;AAEpC,YAAMC,IAAW,SAASD,IAASA,IAASA,EAAO;AAC/C,UAAA,CAACC,EAAS;AACJ,cAAA,IAAI,MAAM,gBAAgB;AAKpC,UADAC,EAAWD,GAAUjB,CAAK,GACtB,CAACiB,EAAS,aAAaA,EAAS,UAAUjB,CAAK;AAC/C,QAAIA,EAAM,cACNe,IAASI,EAAO,MAAMnB,GAAOS,EA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O6B,EAAA,GAAyB3B,EAAM,QAAQ;AAAA,EAAA,CAAG;AAC/G;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index.es70.js","sources":["../../../node_modules/react-map-gl/dist/esm/components/popup.js"],"sourcesContent":["import { createPortal } from 'react-dom';\nimport { useImperativeHandle, useEffect, useMemo, useRef, useContext, forwardRef, memo } from 'react';\nimport { applyReactStyle } from '../utils/apply-react-style';\nimport { MapContext } from './map';\nimport { deepEqual } from '../utils/deep-equal';\n// Adapted from https://github.com/mapbox/mapbox-gl-js/blob/v1.13.0/src/ui/popup.js\nfunction getClassList(className) {\n return new Set(className ? className.trim().split(/\\s+/) : []);\n}\n/* eslint-disable complexity,max-statements */\nfunction Popup(props, ref) {\n const { map, mapLib } = useContext(MapContext);\n const container = useMemo(() => {\n return document.createElement('div');\n }, []);\n const thisRef = useRef({ props });\n thisRef.current.props = props;\n const popup = useMemo(() => {\n const options = { ...props };\n const pp = new mapLib.Popup(options);\n pp.setLngLat([props.longitude, props.latitude]);\n pp.once('open', e => {\n var _a, _b;\n (_b = (_a = thisRef.current.props).onOpen) === null || _b === void 0 ? void 0 : _b.call(_a, e);\n });\n return pp;\n }, []);\n useEffect(() => {\n const onClose = e => {\n var _a, _b;\n (_b = (_a = thisRef.current.props).onClose) === null || _b === void 0 ? void 0 : _b.call(_a, e);\n };\n popup.on('close', onClose);\n popup.setDOMContent(container).addTo(map.getMap());\n return () => {\n // https://github.com/visgl/react-map-gl/issues/1825\n // onClose should not be fired if the popup is removed by unmounting\n // When using React strict mode, the component is mounted twice.\n // Firing the onClose callback here would be a false signal to remove the component.\n popup.off('close', onClose);\n if (popup.isOpen()) {\n popup.remove();\n }\n };\n }, []);\n useEffect(() => {\n applyReactStyle(popup.getElement(), props.style);\n }, [props.style]);\n useImperativeHandle(ref, () => popup, []);\n if (popup.isOpen()) {\n if (popup.getLngLat().lng !== props.longitude || popup.getLngLat().lat !== props.latitude) {\n popup.setLngLat([props.longitude, props.latitude]);\n }\n if (props.offset && !deepEqual(popup.options.offset, props.offset)) {\n popup.setOffset(props.offset);\n }\n if (popup.options.anchor !== props.anchor || popup.options.maxWidth !== props.maxWidth) {\n popup.options.anchor = props.anchor;\n popup.setMaxWidth(props.maxWidth);\n }\n if (popup.options.className !== props.className) {\n const prevClassList = getClassList(popup.options.className);\n const nextClassList = getClassList(props.className);\n for (const c of prevClassList) {\n if (!nextClassList.has(c)) {\n popup.removeClassName(c);\n }\n }\n for (const c of nextClassList) {\n if (!prevClassList.has(c)) {\n popup.addClassName(c);\n }\n }\n popup.options.className = props.className;\n }\n }\n return createPortal(props.children, container);\n}\nexport default memo(forwardRef(Popup));\n//# sourceMappingURL=popup.js.map"],"names":["getClassList","className","Popup","props","ref","map","mapLib","useContext","MapContext","container","useMemo","thisRef","useRef","popup","options","pp","e","_a","_b","useEffect","onClose","applyReactStyle","useImperativeHandle","deepEqual","prevClassList","nextClassList","c","createPortal","memo","forwardRef"],"mappings":";;;;;AAMA,SAASA,EAAaC,GAAW;AACtB,SAAA,IAAI,IAAIA,IAAYA,EAAU,OAAO,MAAM,KAAK,IAAI,CAAA,CAAE;AACjE;AAEA,SAASC,EAAMC,GAAOC,GAAK;AACvB,QAAM,EAAE,KAAAC,GAAK,QAAAC,EAAO,IAAIC,EAAWC,CAAU,GACvCC,IAAYC,EAAQ,MACf,SAAS,cAAc,KAAK,GACpC,CAAE,CAAA,GACCC,IAAUC,EAAO,EAAE,OAAAT,EAAO,CAAA;AAChC,EAAAQ,EAAQ,QAAQ,QAAQR;AAClB,QAAAU,IAAQH,EAAQ,MAAM;AAClB,UAAAI,IAAU,EAAE,GAAGX,KACfY,IAAK,IAAIT,EAAO,MAAMQ,CAAO;AACnC,WAAAC,EAAG,UAAU,CAACZ,EAAM,WAAWA,EAAM,QAAQ,CAAC,GAC3CY,EAAA,KAAK,QAAQ,CAAKC,MAAA;AACjB,UAAIC,GAAIC;AACR,OAACA,KAAMD,IAAKN,EAAQ,QAAQ,OAAO,YAAY,QAA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Bb,EAAM,gBAAgBa,CAAC;AAG/B,eAAWA,KAAKD;AACZ,MAAKD,EAAc,IAAIE,CAAC,KACpBb,EAAM,aAAaa,CAAC;AAGtB,IAAAb,EAAA,QAAQ,YAAYV,EAAM;AAAA,EACpC;AAEG,SAAAwB,EAAaxB,EAAM,UAAUM,CAAS;AACjD;AACemB,EAAKC,EAAW3B,CAAK,CAAC;","x_google_ignoreList":[0]}
@@ -1,49 +1,13 @@
1
- import * as k from "react";
2
- import { memo as A, forwardRef as P, useContext as C, useRef as D, useMemo as M, useEffect as h, useImperativeHandle as y } from "react";
3
- import { createPortal as w } from "react-dom";
4
- import { applyReactStyle as x } from "./index.es188.js";
5
- import { MapContext as O } from "./index.es70.js";
6
- import { arePointsEqual as S } from "./index.es189.js";
7
- function q(o, E) {
8
- const { map: R, mapLib: b } = C(O), i = D({ props: o });
9
- i.current.props = o;
10
- const t = M(() => {
11
- let L = !1;
12
- k.Children.forEach(o.children, (a) => {
13
- a && (L = !0);
14
- });
15
- const _ = {
16
- ...o,
17
- element: L ? document.createElement("div") : null
18
- }, l = new b.Marker(_);
19
- return l.setLngLat([o.longitude, o.latitude]), l.getElement().addEventListener("click", (a) => {
20
- var n, e;
21
- (e = (n = i.current.props).onClick) === null || e === void 0 || e.call(n, {
22
- type: "click",
23
- target: l,
24
- originalEvent: a
25
- });
26
- }), l.on("dragstart", (a) => {
27
- var n, e;
28
- const r = a;
29
- r.lngLat = t.getLngLat(), (e = (n = i.current.props).onDragStart) === null || e === void 0 || e.call(n, r);
30
- }), l.on("drag", (a) => {
31
- var n, e;
32
- const r = a;
33
- r.lngLat = t.getLngLat(), (e = (n = i.current.props).onDrag) === null || e === void 0 || e.call(n, r);
34
- }), l.on("dragend", (a) => {
35
- var n, e;
36
- const r = a;
37
- r.lngLat = t.getLngLat(), (e = (n = i.current.props).onDragEnd) === null || e === void 0 || e.call(n, r);
38
- }), l;
39
- }, []);
40
- h(() => (t.addTo(R.getMap()), () => {
41
- t.remove();
42
- }), []);
43
- const { longitude: c, latitude: s, offset: g, style: m, draggable: u = !1, popup: d = null, rotation: f = 0, rotationAlignment: v = "auto", pitchAlignment: p = "auto" } = o;
44
- return h(() => {
45
- x(t.getElement(), m);
46
- }, [m]), y(E, () => t, []), (t.getLngLat().lng !== c || t.getLngLat().lat !== s) && t.setLngLat([c, s]), g && !S(t.getOffset(), g) && t.setOffset(g), t.isDraggable() !== u && t.setDraggable(u), t.getRotation() !== f && t.setRotation(f), t.getRotationAlignment() !== v && t.setRotationAlignment(v), t.getPitchAlignment() !== p && t.setPitchAlignment(p), t.getPopup() !== d && t.setPopup(d), w(o.children, t.getElement());
1
+ import { memo as i, useEffect as r } from "react";
2
+ import { applyReactStyle as e } from "./index.es188.js";
3
+ import l from "./index.es16.js";
4
+ function m(t) {
5
+ const o = l(({ mapLib: n }) => new n.AttributionControl(t), {
6
+ position: t.position
7
+ });
8
+ return r(() => {
9
+ e(o._container, t.style);
10
+ }, [t.style]), null;
47
11
  }
48
- A(P(q));
12
+ i(m);
49
13
  //# sourceMappingURL=index.es71.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.es71.js","sources":["../../../node_modules/react-map-gl/dist/esm/components/marker.js"],"sourcesContent":["/* global document */\nimport * as React from 'react';\nimport { createPortal } from 'react-dom';\nimport { useImperativeHandle, useEffect, useMemo, useRef, useContext, forwardRef, memo } from 'react';\nimport { applyReactStyle } from '../utils/apply-react-style';\nimport { MapContext } from './map';\nimport { arePointsEqual } from '../utils/deep-equal';\n/* eslint-disable complexity,max-statements */\nfunction Marker(props, ref) {\n const { map, mapLib } = useContext(MapContext);\n const thisRef = useRef({ props });\n thisRef.current.props = props;\n const marker = useMemo(() => {\n let hasChildren = false;\n React.Children.forEach(props.children, el => {\n if (el) {\n hasChildren = true;\n }\n });\n const options = {\n ...props,\n element: hasChildren ? document.createElement('div') : null\n };\n const mk = new mapLib.Marker(options);\n mk.setLngLat([props.longitude, props.latitude]);\n mk.getElement().addEventListener('click', (e) => {\n var _a, _b;\n (_b = (_a = thisRef.current.props).onClick) === null || _b === void 0 ? void 0 : _b.call(_a, {\n type: 'click',\n target: mk,\n originalEvent: e\n });\n });\n mk.on('dragstart', e => {\n var _a, _b;\n const evt = e;\n evt.lngLat = marker.getLngLat();\n (_b = (_a = thisRef.current.props).onDragStart) === null || _b === void 0 ? void 0 : _b.call(_a, evt);\n });\n mk.on('drag', e => {\n var _a, _b;\n const evt = e;\n evt.lngLat = marker.getLngLat();\n (_b = (_a = thisRef.current.props).onDrag) === null || _b === void 0 ? void 0 : _b.call(_a, evt);\n });\n mk.on('dragend', e => {\n var _a, _b;\n const evt = e;\n evt.lngLat = marker.getLngLat();\n (_b = (_a = thisRef.current.props).onDragEnd) === null || _b === void 0 ? void 0 : _b.call(_a, evt);\n });\n return mk;\n }, []);\n useEffect(() => {\n marker.addTo(map.getMap());\n return () => {\n marker.remove();\n };\n }, []);\n const { longitude, latitude, offset, style, draggable = false, popup = null, rotation = 0, rotationAlignment = 'auto', pitchAlignment = 'auto' } = props;\n useEffect(() => {\n applyReactStyle(marker.getElement(), style);\n }, [style]);\n useImperativeHandle(ref, () => marker, []);\n if (marker.getLngLat().lng !== longitude || marker.getLngLat().lat !== latitude) {\n marker.setLngLat([longitude, latitude]);\n }\n if (offset && !arePointsEqual(marker.getOffset(), offset)) {\n marker.setOffset(offset);\n }\n if (marker.isDraggable() !== draggable) {\n marker.setDraggable(draggable);\n }\n if (marker.getRotation() !== rotation) {\n marker.setRotation(rotation);\n }\n if (marker.getRotationAlignment() !== rotationAlignment) {\n marker.setRotationAlignment(rotationAlignment);\n }\n if (marker.getPitchAlignment() !== pitchAlignment) {\n marker.setPitchAlignment(pitchAlignment);\n }\n if (marker.getPopup() !== popup) {\n marker.setPopup(popup);\n }\n return createPortal(props.children, marker.getElement());\n}\nexport default memo(forwardRef(Marker));\n//# sourceMappingURL=marker.js.map"],"names":["Marker","props","ref","map","mapLib","useContext","MapContext","thisRef","useRef","marker","useMemo","hasChildren","React","el","options","mk","e","_a","_b","evt","useEffect","longitude","latitude","offset","style","draggable","popup","rotation","rotationAlignment","pitchAlignment","applyReactStyle","useImperativeHandle","arePointsEqual","createPortal","memo","forwardRef"],"mappings":";;;;;;AAQA,SAASA,EAAOC,GAAOC,GAAK;AACxB,QAAM,EAAE,KAAAC,GAAK,QAAAC,EAAO,IAAIC,EAAWC,CAAU,GACvCC,IAAUC,EAAO,EAAE,OAAAP,EAAO,CAAA;AAChC,EAAAM,EAAQ,QAAQ,QAAQN;AAClB,QAAAQ,IAASC,EAAQ,MAAM;AACzB,QAAIC,IAAc;AAClB,IAAAC,EAAM,SAAS,QAAQX,EAAM,UAAU,CAAMY,MAAA;AACzC,MAAIA,MACcF,IAAA;AAAA,IAClB,CACH;AACD,UAAMG,IAAU;AAAA,MACZ,GAAGb;AAAA,MACH,SAASU,IAAc,SAAS,cAAc,KAAK,IAAI;AAAA,IAAA,GAErDI,IAAK,IAAIX,EAAO,OAAOU,CAAO;AACpC,WAAAC,EAAG,UAAU,CAACd,EAAM,WAAWA,EAAM,QAAQ,CAAC,GAC9Cc,EAAG,WAAW,EAAE,iBAAiB,SAAS,CAACC,MAAM;AAC7C,UAAIC,GAAIC;AACR,OAACA,KAAMD,IAAKV,EAAQ,QAAQ,OAAO,aAAa,QAAQW,MAAO,UAAkBA,EAAG,KAAKD,GAAI;AAAA,QACzF,MAAM;AAAA,QACN,QAAQF;AAAA,QACR,eAAeC;AAAA,MAAA,CAClB;AAAA,IAAA,CACJ,GACED,EAAA,GAAG,aAAa,CAAKC,MAAA;AACpB,UAAIC,GAAIC;AACR,YAAMC,IAAMH;AACR,MAAAG,EAAA,SAASV,EAAO,cACnBS,KAAMD,IAAKV,EAAQ,QAAQ,OAAO,iBAAiB,QAAQW,MAAO,UAAkBA,EAAG,KAAKD,GAAIE,CAAG;AAAA,IAAA,CACvG,GACEJ,EAAA,GAAG,QAAQ,CAAKC,MAAA;AACf,UAAIC,GAAIC;AACR,YAAMC,IAAMH;AACR,MA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,GAE7CnB,EAAO,kBAAkB,MAAMoB,KAC/BpB,EAAO,kBAAkBoB,CAAc,GAEvCpB,EAAO,SAAS,MAAMiB,KACtBjB,EAAO,SAASiB,CAAK,GAElBO,EAAahC,EAAM,UAAUQ,EAAO,WAAY,CAAA;AAC3D;AACeyB,EAAKC,EAAWnC,CAAM,CAAC;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index.es71.js","sources":["../../../node_modules/react-map-gl/dist/esm/components/attribution-control.js"],"sourcesContent":["import { useEffect, memo } from 'react';\nimport { applyReactStyle } from '../utils/apply-react-style';\nimport useControl from './use-control';\nfunction AttributionControl(props) {\n const ctrl = useControl(({ mapLib }) => new mapLib.AttributionControl(props), {\n position: props.position\n });\n useEffect(() => {\n applyReactStyle(ctrl._container, props.style);\n }, [props.style]);\n return null;\n}\nexport default memo(AttributionControl);\n//# sourceMappingURL=attribution-control.js.map"],"names":["AttributionControl","props","ctrl","useControl","mapLib","useEffect","applyReactStyle","memo"],"mappings":";;;AAGA,SAASA,EAAmBC,GAAO;AACzB,QAAAC,IAAOC,EAAW,CAAC,EAAE,QAAAC,QAAa,IAAIA,EAAO,mBAAmBH,CAAK,GAAG;AAAA,IAC1E,UAAUA,EAAM;AAAA,EAAA,CACnB;AACD,SAAAI,EAAU,MAAM;AACI,IAAAC,EAAAJ,EAAK,YAAYD,EAAM,KAAK;AAAA,EAAA,GAC7C,CAACA,EAAM,KAAK,CAAC,GACT;AACX;AACeM,EAAKP,CAAkB;","x_google_ignoreList":[0]}
@@ -1,40 +1,16 @@
1
- import { createPortal as h } from "react-dom";
2
- import { memo as L, forwardRef as v, useContext as C, useMemo as f, useRef as x, useEffect as m, useImperativeHandle as N } from "react";
3
- import { applyReactStyle as M } from "./index.es188.js";
4
- import { MapContext as O } from "./index.es70.js";
5
- import { deepEqual as y } from "./index.es189.js";
6
- function r(t) {
7
- return new Set(t ? t.trim().split(/\s+/) : []);
1
+ import { memo as o, useEffect as l } from "react";
2
+ import { applyReactStyle as r } from "./index.es188.js";
3
+ import c from "./index.es16.js";
4
+ function i(t) {
5
+ const n = c(({ mapLib: e }) => new e.FullscreenControl({
6
+ container: t.containerId && document.getElementById(t.containerId)
7
+ }), { position: t.position });
8
+ return l(() => {
9
+ r(n._controlContainer, t.style);
10
+ }, [t.style]), null;
8
11
  }
9
- function E(t, u) {
10
- const { map: d, mapLib: g } = C(O), c = f(() => document.createElement("div"), []), i = x({ props: t });
11
- i.current.props = t;
12
- const e = f(() => {
13
- const a = { ...t }, o = new g.Popup(a);
14
- return o.setLngLat([t.longitude, t.latitude]), o.once("open", (n) => {
15
- var s, l;
16
- (l = (s = i.current.props).onOpen) === null || l === void 0 || l.call(s, n);
17
- }), o;
18
- }, []);
19
- if (m(() => {
20
- const a = (o) => {
21
- var n, s;
22
- (s = (n = i.current.props).onClose) === null || s === void 0 || s.call(n, o);
23
- };
24
- return e.on("close", a), e.setDOMContent(c).addTo(d.getMap()), () => {
25
- e.off("close", a), e.isOpen() && e.remove();
26
- };
27
- }, []), m(() => {
28
- M(e.getElement(), t.style);
29
- }, [t.style]), N(u, () => e, []), e.isOpen() && ((e.getLngLat().lng !== t.longitude || e.getLngLat().lat !== t.latitude) && e.setLngLat([t.longitude, t.latitude]), t.offset && !y(e.options.offset, t.offset) && e.setOffset(t.offset), (e.options.anchor !== t.anchor || e.options.maxWidth !== t.maxWidth) && (e.options.anchor = t.anchor, e.setMaxWidth(t.maxWidth)), e.options.className !== t.className)) {
30
- const a = r(e.options.className), o = r(t.className);
31
- for (const n of a)
32
- o.has(n) || e.removeClassName(n);
33
- for (const n of o)
34
- a.has(n) || e.addClassName(n);
35
- e.options.className = t.className;
36
- }
37
- return h(t.children, c);
38
- }
39
- L(v(E));
12
+ const s = o(i);
13
+ export {
14
+ s as default
15
+ };
40
16
  //# sourceMappingURL=index.es72.js.map