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

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 (727) hide show
  1. package/dist/index.cjs.js +1 -1
  2. package/dist/index.cjs10.js +1 -1
  3. package/dist/index.cjs10.js.map +1 -1
  4. package/dist/index.cjs100.js +1 -1
  5. package/dist/index.cjs100.js.map +1 -1
  6. package/dist/index.cjs101.js +1 -1
  7. package/dist/index.cjs101.js.map +1 -1
  8. package/dist/index.cjs102.js +1 -1
  9. package/dist/index.cjs102.js.map +1 -1
  10. package/dist/index.cjs103.js +1 -1
  11. package/dist/index.cjs103.js.map +1 -1
  12. package/dist/index.cjs104.js +1 -1
  13. package/dist/index.cjs104.js.map +1 -1
  14. package/dist/index.cjs105.js +1 -1
  15. package/dist/index.cjs105.js.map +1 -1
  16. package/dist/index.cjs106.js +1 -1
  17. package/dist/index.cjs106.js.map +1 -1
  18. package/dist/index.cjs107.js +1 -1
  19. package/dist/index.cjs107.js.map +1 -1
  20. package/dist/index.cjs108.js +1 -1
  21. package/dist/index.cjs108.js.map +1 -1
  22. package/dist/index.cjs109.js +1 -1
  23. package/dist/index.cjs109.js.map +1 -1
  24. package/dist/index.cjs11.js +1 -1
  25. package/dist/index.cjs11.js.map +1 -1
  26. package/dist/index.cjs110.js +13 -1
  27. package/dist/index.cjs110.js.map +1 -1
  28. package/dist/index.cjs111.js +1 -1
  29. package/dist/index.cjs111.js.map +1 -1
  30. package/dist/index.cjs112.js +1 -1
  31. package/dist/index.cjs112.js.map +1 -1
  32. package/dist/index.cjs113.js +1 -1
  33. package/dist/index.cjs113.js.map +1 -1
  34. package/dist/index.cjs114.js +1 -1
  35. package/dist/index.cjs114.js.map +1 -1
  36. package/dist/index.cjs115.js +1 -1
  37. package/dist/index.cjs115.js.map +1 -1
  38. package/dist/index.cjs116.js +1 -1
  39. package/dist/index.cjs116.js.map +1 -1
  40. package/dist/index.cjs117.js +1 -1
  41. package/dist/index.cjs117.js.map +1 -1
  42. package/dist/index.cjs118.js +1 -1
  43. package/dist/index.cjs118.js.map +1 -1
  44. package/dist/index.cjs119.js +1 -1
  45. package/dist/index.cjs119.js.map +1 -1
  46. package/dist/index.cjs12.js +1 -1
  47. package/dist/index.cjs12.js.map +1 -1
  48. package/dist/index.cjs120.js +1 -1
  49. package/dist/index.cjs120.js.map +1 -1
  50. package/dist/index.cjs121.js +1 -1
  51. package/dist/index.cjs121.js.map +1 -1
  52. package/dist/index.cjs122.js +1 -13
  53. package/dist/index.cjs122.js.map +1 -1
  54. package/dist/index.cjs123.js +1 -1
  55. package/dist/index.cjs123.js.map +1 -1
  56. package/dist/index.cjs124.js +1 -1
  57. package/dist/index.cjs124.js.map +1 -1
  58. package/dist/index.cjs125.js +1 -1
  59. package/dist/index.cjs125.js.map +1 -1
  60. package/dist/index.cjs126.js +1 -1
  61. package/dist/index.cjs126.js.map +1 -1
  62. package/dist/index.cjs127.js +1 -1
  63. package/dist/index.cjs127.js.map +1 -1
  64. package/dist/index.cjs128.js +1 -1
  65. package/dist/index.cjs128.js.map +1 -1
  66. package/dist/index.cjs129.js +1 -1
  67. package/dist/index.cjs129.js.map +1 -1
  68. package/dist/index.cjs13.js +1 -1
  69. package/dist/index.cjs13.js.map +1 -1
  70. package/dist/index.cjs130.js +1 -1
  71. package/dist/index.cjs130.js.map +1 -1
  72. package/dist/index.cjs131.js +1 -1
  73. package/dist/index.cjs131.js.map +1 -1
  74. package/dist/index.cjs132.js +1 -1
  75. package/dist/index.cjs132.js.map +1 -1
  76. package/dist/index.cjs133.js +1 -1
  77. package/dist/index.cjs133.js.map +1 -1
  78. package/dist/index.cjs134.js +1 -1
  79. package/dist/index.cjs134.js.map +1 -1
  80. package/dist/index.cjs135.js +1 -1
  81. package/dist/index.cjs135.js.map +1 -1
  82. package/dist/index.cjs136.js +1 -1
  83. package/dist/index.cjs136.js.map +1 -1
  84. package/dist/index.cjs137.js +1 -1
  85. package/dist/index.cjs137.js.map +1 -1
  86. package/dist/index.cjs138.js +1 -1
  87. package/dist/index.cjs138.js.map +1 -1
  88. package/dist/index.cjs139.js +1 -1
  89. package/dist/index.cjs139.js.map +1 -1
  90. package/dist/index.cjs14.js +1 -1
  91. package/dist/index.cjs14.js.map +1 -1
  92. package/dist/index.cjs140.js +1 -1
  93. package/dist/index.cjs140.js.map +1 -1
  94. package/dist/index.cjs141.js +1 -1
  95. package/dist/index.cjs141.js.map +1 -1
  96. package/dist/index.cjs142.js +1 -1
  97. package/dist/index.cjs142.js.map +1 -1
  98. package/dist/index.cjs143.js +1 -1
  99. package/dist/index.cjs143.js.map +1 -1
  100. package/dist/index.cjs144.js +1 -1
  101. package/dist/index.cjs144.js.map +1 -1
  102. package/dist/index.cjs145.js +1 -1
  103. package/dist/index.cjs145.js.map +1 -1
  104. package/dist/index.cjs146.js +1 -1
  105. package/dist/index.cjs146.js.map +1 -1
  106. package/dist/index.cjs147.js +1 -1
  107. package/dist/index.cjs147.js.map +1 -1
  108. package/dist/index.cjs148.js +1 -1
  109. package/dist/index.cjs148.js.map +1 -1
  110. package/dist/index.cjs149.js +1 -1
  111. package/dist/index.cjs149.js.map +1 -1
  112. package/dist/index.cjs15.js +1 -1
  113. package/dist/index.cjs15.js.map +1 -1
  114. package/dist/index.cjs150.js +1 -1
  115. package/dist/index.cjs150.js.map +1 -1
  116. package/dist/index.cjs151.js +1 -1
  117. package/dist/index.cjs151.js.map +1 -1
  118. package/dist/index.cjs152.js +1 -1
  119. package/dist/index.cjs152.js.map +1 -1
  120. package/dist/index.cjs153.js +1 -1
  121. package/dist/index.cjs153.js.map +1 -1
  122. package/dist/index.cjs154.js +1 -1
  123. package/dist/index.cjs154.js.map +1 -1
  124. package/dist/index.cjs155.js +1 -1
  125. package/dist/index.cjs155.js.map +1 -1
  126. package/dist/index.cjs156.js +1 -1
  127. package/dist/index.cjs156.js.map +1 -1
  128. package/dist/index.cjs157.js +1 -1
  129. package/dist/index.cjs157.js.map +1 -1
  130. package/dist/index.cjs158.js +1 -1
  131. package/dist/index.cjs158.js.map +1 -1
  132. package/dist/index.cjs159.js +1 -1
  133. package/dist/index.cjs159.js.map +1 -1
  134. package/dist/index.cjs16.js +1 -1
  135. package/dist/index.cjs16.js.map +1 -1
  136. package/dist/index.cjs160.js +1 -1
  137. package/dist/index.cjs160.js.map +1 -1
  138. package/dist/index.cjs161.js +1 -1
  139. package/dist/index.cjs161.js.map +1 -1
  140. package/dist/index.cjs162.js +1 -1
  141. package/dist/index.cjs162.js.map +1 -1
  142. package/dist/index.cjs163.js +1 -1
  143. package/dist/index.cjs163.js.map +1 -1
  144. package/dist/index.cjs164.js +1 -1
  145. package/dist/index.cjs164.js.map +1 -1
  146. package/dist/index.cjs165.js +1 -1
  147. package/dist/index.cjs165.js.map +1 -1
  148. package/dist/index.cjs166.js +1 -1
  149. package/dist/index.cjs166.js.map +1 -1
  150. package/dist/index.cjs167.js +1 -1
  151. package/dist/index.cjs167.js.map +1 -1
  152. package/dist/index.cjs168.js +1 -1
  153. package/dist/index.cjs168.js.map +1 -1
  154. package/dist/index.cjs169.js +1 -1
  155. package/dist/index.cjs169.js.map +1 -1
  156. package/dist/index.cjs17.js +1 -1
  157. package/dist/index.cjs17.js.map +1 -1
  158. package/dist/index.cjs170.js +1 -1
  159. package/dist/index.cjs170.js.map +1 -1
  160. package/dist/index.cjs171.js +1 -1
  161. package/dist/index.cjs171.js.map +1 -1
  162. package/dist/index.cjs172.js +1 -1
  163. package/dist/index.cjs172.js.map +1 -1
  164. package/dist/index.cjs173.js +1 -1
  165. package/dist/index.cjs173.js.map +1 -1
  166. package/dist/index.cjs174.js +1 -1
  167. package/dist/index.cjs174.js.map +1 -1
  168. package/dist/index.cjs175.js +1 -1
  169. package/dist/index.cjs175.js.map +1 -1
  170. package/dist/index.cjs18.js +1 -1
  171. package/dist/index.cjs18.js.map +1 -1
  172. package/dist/index.cjs19.js +1 -1
  173. package/dist/index.cjs19.js.map +1 -1
  174. package/dist/index.cjs199.js +1 -1
  175. package/dist/index.cjs2.js +1 -1
  176. package/dist/index.cjs20.js +1 -1
  177. package/dist/index.cjs20.js.map +1 -1
  178. package/dist/index.cjs200.js +1 -1
  179. package/dist/index.cjs201.js +1 -1
  180. package/dist/index.cjs202.js +1 -1
  181. package/dist/index.cjs203.js +1 -1
  182. package/dist/index.cjs205.js +1 -1
  183. package/dist/index.cjs206.js +1 -1
  184. package/dist/index.cjs208.js +1 -1
  185. package/dist/index.cjs209.js +1 -1
  186. package/dist/index.cjs21.js +1 -1
  187. package/dist/index.cjs21.js.map +1 -1
  188. package/dist/index.cjs211.js +1 -1
  189. package/dist/index.cjs213.js +1 -1
  190. package/dist/index.cjs215.js +1 -1
  191. package/dist/index.cjs215.js.map +1 -1
  192. package/dist/index.cjs216.js +1 -1
  193. package/dist/index.cjs217.js +1 -1
  194. package/dist/index.cjs218.js +1 -1
  195. package/dist/index.cjs22.js +1 -1
  196. package/dist/index.cjs22.js.map +1 -1
  197. package/dist/index.cjs220.js +1 -1
  198. package/dist/index.cjs221.js +1 -1
  199. package/dist/index.cjs222.js +1 -1
  200. package/dist/index.cjs223.js +1 -1
  201. package/dist/index.cjs225.js +1 -1
  202. package/dist/index.cjs228.js +1 -1
  203. package/dist/index.cjs228.js.map +1 -1
  204. package/dist/index.cjs229.js +1 -1
  205. package/dist/index.cjs229.js.map +1 -1
  206. package/dist/index.cjs23.js +1 -1
  207. package/dist/index.cjs23.js.map +1 -1
  208. package/dist/index.cjs230.js +1 -1
  209. package/dist/index.cjs230.js.map +1 -1
  210. package/dist/index.cjs236.js +1 -1
  211. package/dist/index.cjs238.js +1 -1
  212. package/dist/index.cjs24.js +1 -1
  213. package/dist/index.cjs24.js.map +1 -1
  214. package/dist/index.cjs242.js +1 -1
  215. package/dist/index.cjs243.js +1 -1
  216. package/dist/index.cjs246.js +1 -1
  217. package/dist/index.cjs249.js +1 -1
  218. package/dist/index.cjs249.js.map +1 -1
  219. package/dist/index.cjs25.js +1 -1
  220. package/dist/index.cjs25.js.map +1 -1
  221. package/dist/index.cjs250.js +1 -1
  222. package/dist/index.cjs250.js.map +1 -1
  223. package/dist/index.cjs251.js +1 -1
  224. package/dist/index.cjs251.js.map +1 -1
  225. package/dist/index.cjs252.js +1 -1
  226. package/dist/index.cjs252.js.map +1 -1
  227. package/dist/index.cjs26.js +1 -1
  228. package/dist/index.cjs26.js.map +1 -1
  229. package/dist/index.cjs27.js +1 -1
  230. package/dist/index.cjs27.js.map +1 -1
  231. package/dist/index.cjs28.js +1 -1
  232. package/dist/index.cjs28.js.map +1 -1
  233. package/dist/index.cjs29.js +1 -1
  234. package/dist/index.cjs29.js.map +1 -1
  235. package/dist/index.cjs3.js +1 -1
  236. package/dist/index.cjs3.js.map +1 -1
  237. package/dist/index.cjs30.js +1 -1
  238. package/dist/index.cjs30.js.map +1 -1
  239. package/dist/index.cjs31.js +1 -1
  240. package/dist/index.cjs31.js.map +1 -1
  241. package/dist/index.cjs32.js +1 -1
  242. package/dist/index.cjs32.js.map +1 -1
  243. package/dist/index.cjs33.js +1 -1
  244. package/dist/index.cjs33.js.map +1 -1
  245. package/dist/index.cjs34.js +1 -1
  246. package/dist/index.cjs34.js.map +1 -1
  247. package/dist/index.cjs35.js +1 -1
  248. package/dist/index.cjs35.js.map +1 -1
  249. package/dist/index.cjs36.js +1 -1
  250. package/dist/index.cjs36.js.map +1 -1
  251. package/dist/index.cjs37.js +1 -1
  252. package/dist/index.cjs37.js.map +1 -1
  253. package/dist/index.cjs38.js +1 -1
  254. package/dist/index.cjs38.js.map +1 -1
  255. package/dist/index.cjs39.js +1 -1
  256. package/dist/index.cjs39.js.map +1 -1
  257. package/dist/index.cjs4.js +1 -1
  258. package/dist/index.cjs40.js +1 -1
  259. package/dist/index.cjs40.js.map +1 -1
  260. package/dist/index.cjs41.js +1 -1
  261. package/dist/index.cjs41.js.map +1 -1
  262. package/dist/index.cjs42.js +1 -1
  263. package/dist/index.cjs42.js.map +1 -1
  264. package/dist/index.cjs43.js +1 -1
  265. package/dist/index.cjs43.js.map +1 -1
  266. package/dist/index.cjs44.js +1 -1
  267. package/dist/index.cjs44.js.map +1 -1
  268. package/dist/index.cjs45.js +1 -1
  269. package/dist/index.cjs45.js.map +1 -1
  270. package/dist/index.cjs5.js +1 -1
  271. package/dist/index.cjs5.js.map +1 -1
  272. package/dist/index.cjs55.js +1 -1
  273. package/dist/index.cjs56.js +1 -1
  274. package/dist/index.cjs6.js +1 -1
  275. package/dist/index.cjs60.js +1 -1
  276. package/dist/index.cjs60.js.map +1 -1
  277. package/dist/index.cjs61.js +1 -1
  278. package/dist/index.cjs61.js.map +1 -1
  279. package/dist/index.cjs62.js +1 -1
  280. package/dist/index.cjs62.js.map +1 -1
  281. package/dist/index.cjs63.js +1 -1
  282. package/dist/index.cjs63.js.map +1 -1
  283. package/dist/index.cjs64.js +1 -1
  284. package/dist/index.cjs64.js.map +1 -1
  285. package/dist/index.cjs65.js +1 -1
  286. package/dist/index.cjs65.js.map +1 -1
  287. package/dist/index.cjs66.js +1 -1
  288. package/dist/index.cjs66.js.map +1 -1
  289. package/dist/index.cjs67.js +1 -1
  290. package/dist/index.cjs67.js.map +1 -1
  291. package/dist/index.cjs68.js +1 -1
  292. package/dist/index.cjs68.js.map +1 -1
  293. package/dist/index.cjs69.js +1 -1
  294. package/dist/index.cjs69.js.map +1 -1
  295. package/dist/index.cjs7.js +1 -1
  296. package/dist/index.cjs70.js +1 -1
  297. package/dist/index.cjs70.js.map +1 -1
  298. package/dist/index.cjs71.js +1 -1
  299. package/dist/index.cjs71.js.map +1 -1
  300. package/dist/index.cjs72.js +1 -1
  301. package/dist/index.cjs72.js.map +1 -1
  302. package/dist/index.cjs73.js +1 -1
  303. package/dist/index.cjs73.js.map +1 -1
  304. package/dist/index.cjs74.js +1 -1
  305. package/dist/index.cjs74.js.map +1 -1
  306. package/dist/index.cjs75.js +1 -1
  307. package/dist/index.cjs75.js.map +1 -1
  308. package/dist/index.cjs76.js +1 -1
  309. package/dist/index.cjs76.js.map +1 -1
  310. package/dist/index.cjs77.js +1 -1
  311. package/dist/index.cjs77.js.map +1 -1
  312. package/dist/index.cjs78.js +1 -1
  313. package/dist/index.cjs78.js.map +1 -1
  314. package/dist/index.cjs79.js +1 -1
  315. package/dist/index.cjs79.js.map +1 -1
  316. package/dist/index.cjs8.js +1 -1
  317. package/dist/index.cjs80.js +1 -1
  318. package/dist/index.cjs80.js.map +1 -1
  319. package/dist/index.cjs81.js +1 -1
  320. package/dist/index.cjs81.js.map +1 -1
  321. package/dist/index.cjs82.js +1 -1
  322. package/dist/index.cjs82.js.map +1 -1
  323. package/dist/index.cjs83.js +1 -1
  324. package/dist/index.cjs83.js.map +1 -1
  325. package/dist/index.cjs84.js +1 -1
  326. package/dist/index.cjs84.js.map +1 -1
  327. package/dist/index.cjs85.js +1 -1
  328. package/dist/index.cjs85.js.map +1 -1
  329. package/dist/index.cjs86.js +1 -1
  330. package/dist/index.cjs86.js.map +1 -1
  331. package/dist/index.cjs87.js +1 -1
  332. package/dist/index.cjs87.js.map +1 -1
  333. package/dist/index.cjs88.js +1 -1
  334. package/dist/index.cjs88.js.map +1 -1
  335. package/dist/index.cjs89.js +1 -1
  336. package/dist/index.cjs89.js.map +1 -1
  337. package/dist/index.cjs9.js +1 -1
  338. package/dist/index.cjs9.js.map +1 -1
  339. package/dist/index.cjs90.js +1 -1
  340. package/dist/index.cjs90.js.map +1 -1
  341. package/dist/index.cjs91.js +1 -1
  342. package/dist/index.cjs91.js.map +1 -1
  343. package/dist/index.cjs92.js +1 -1
  344. package/dist/index.cjs92.js.map +1 -1
  345. package/dist/index.cjs93.js +1 -1
  346. package/dist/index.cjs93.js.map +1 -1
  347. package/dist/index.cjs94.js +1 -1
  348. package/dist/index.cjs94.js.map +1 -1
  349. package/dist/index.cjs95.js +1 -1
  350. package/dist/index.cjs95.js.map +1 -1
  351. package/dist/index.cjs96.js +1 -1
  352. package/dist/index.cjs96.js.map +1 -1
  353. package/dist/index.cjs97.js +1 -1
  354. package/dist/index.cjs97.js.map +1 -1
  355. package/dist/index.cjs98.js +1 -1
  356. package/dist/index.cjs98.js.map +1 -1
  357. package/dist/index.cjs99.js +1 -1
  358. package/dist/index.cjs99.js.map +1 -1
  359. package/dist/index.es.js +8 -6
  360. package/dist/index.es.js.map +1 -1
  361. package/dist/index.es10.js +39 -2102
  362. package/dist/index.es10.js.map +1 -1
  363. package/dist/index.es100.js +10 -6
  364. package/dist/index.es100.js.map +1 -1
  365. package/dist/index.es101.js +3 -6
  366. package/dist/index.es101.js.map +1 -1
  367. package/dist/index.es102.js +5 -6
  368. package/dist/index.es102.js.map +1 -1
  369. package/dist/index.es103.js +2 -7
  370. package/dist/index.es103.js.map +1 -1
  371. package/dist/index.es104.js +8 -4
  372. package/dist/index.es104.js.map +1 -1
  373. package/dist/index.es105.js +8 -4
  374. package/dist/index.es105.js.map +1 -1
  375. package/dist/index.es106.js +8 -4
  376. package/dist/index.es106.js.map +1 -1
  377. package/dist/index.es107.js +8 -6
  378. package/dist/index.es107.js.map +1 -1
  379. package/dist/index.es108.js +3 -6
  380. package/dist/index.es108.js.map +1 -1
  381. package/dist/index.es109.js +3 -3
  382. package/dist/index.es109.js.map +1 -1
  383. package/dist/index.es11.js +2102 -19
  384. package/dist/index.es11.js.map +1 -1
  385. package/dist/index.es110.js +57 -7
  386. package/dist/index.es110.js.map +1 -1
  387. package/dist/index.es111.js +12 -11
  388. package/dist/index.es111.js.map +1 -1
  389. package/dist/index.es112.js +5 -10
  390. package/dist/index.es112.js.map +1 -1
  391. package/dist/index.es113.js +4 -2
  392. package/dist/index.es113.js.map +1 -1
  393. package/dist/index.es114.js +7 -4
  394. package/dist/index.es114.js.map +1 -1
  395. package/dist/index.es115.js +16 -2
  396. package/dist/index.es115.js.map +1 -1
  397. package/dist/index.es116.js +13 -7
  398. package/dist/index.es116.js.map +1 -1
  399. package/dist/index.es117.js +4 -7
  400. package/dist/index.es117.js.map +1 -1
  401. package/dist/index.es118.js +4 -6
  402. package/dist/index.es118.js.map +1 -1
  403. package/dist/index.es119.js +8 -8
  404. package/dist/index.es119.js.map +1 -1
  405. package/dist/index.es12.js +19 -12
  406. package/dist/index.es12.js.map +1 -1
  407. package/dist/index.es120.js +6 -3
  408. package/dist/index.es120.js.map +1 -1
  409. package/dist/index.es121.js +7 -4
  410. package/dist/index.es121.js.map +1 -1
  411. package/dist/index.es122.js +8 -57
  412. package/dist/index.es122.js.map +1 -1
  413. package/dist/index.es123.js +3 -14
  414. package/dist/index.es123.js.map +1 -1
  415. package/dist/index.es124.js +3 -6
  416. package/dist/index.es124.js.map +1 -1
  417. package/dist/index.es125.js +10 -5
  418. package/dist/index.es125.js.map +1 -1
  419. package/dist/index.es126.js +5 -9
  420. package/dist/index.es126.js.map +1 -1
  421. package/dist/index.es127.js +4 -17
  422. package/dist/index.es127.js.map +1 -1
  423. package/dist/index.es128.js +8 -13
  424. package/dist/index.es128.js.map +1 -1
  425. package/dist/index.es129.js +5 -4
  426. package/dist/index.es129.js.map +1 -1
  427. package/dist/index.es13.js +12 -6
  428. package/dist/index.es13.js.map +1 -1
  429. package/dist/index.es130.js +16 -5
  430. package/dist/index.es130.js.map +1 -1
  431. package/dist/index.es131.js +11 -8
  432. package/dist/index.es131.js.map +1 -1
  433. package/dist/index.es132.js +3 -7
  434. package/dist/index.es132.js.map +1 -1
  435. package/dist/index.es133.js +3 -7
  436. package/dist/index.es133.js.map +1 -1
  437. package/dist/index.es134.js +8 -8
  438. package/dist/index.es134.js.map +1 -1
  439. package/dist/index.es135.js +7 -3
  440. package/dist/index.es135.js.map +1 -1
  441. package/dist/index.es136.js +13 -3
  442. package/dist/index.es136.js.map +1 -1
  443. package/dist/index.es137.js +11 -9
  444. package/dist/index.es137.js.map +1 -1
  445. package/dist/index.es138.js +7 -5
  446. package/dist/index.es138.js.map +1 -1
  447. package/dist/index.es139.js +6 -4
  448. package/dist/index.es139.js.map +1 -1
  449. package/dist/index.es14.js +6 -5
  450. package/dist/index.es14.js.map +1 -1
  451. package/dist/index.es140.js +5 -8
  452. package/dist/index.es140.js.map +1 -1
  453. package/dist/index.es141.js +16 -5
  454. package/dist/index.es141.js.map +1 -1
  455. package/dist/index.es142.js +16 -16
  456. package/dist/index.es142.js.map +1 -1
  457. package/dist/index.es143.js +4 -11
  458. package/dist/index.es143.js.map +1 -1
  459. package/dist/index.es144.js +17 -3
  460. package/dist/index.es144.js.map +1 -1
  461. package/dist/index.es145.js +23 -3
  462. package/dist/index.es145.js.map +1 -1
  463. package/dist/index.es146.js +6 -9
  464. package/dist/index.es146.js.map +1 -1
  465. package/dist/index.es147.js +5 -7
  466. package/dist/index.es147.js.map +1 -1
  467. package/dist/index.es148.js +6 -13
  468. package/dist/index.es148.js.map +1 -1
  469. package/dist/index.es149.js +5 -13
  470. package/dist/index.es149.js.map +1 -1
  471. package/dist/index.es15.js +6 -28
  472. package/dist/index.es15.js.map +1 -1
  473. package/dist/index.es150.js +11 -6
  474. package/dist/index.es150.js.map +1 -1
  475. package/dist/index.es151.js +4 -4
  476. package/dist/index.es151.js.map +1 -1
  477. package/dist/index.es152.js +4 -5
  478. package/dist/index.es152.js.map +1 -1
  479. package/dist/index.es153.js +4 -16
  480. package/dist/index.es153.js.map +1 -1
  481. package/dist/index.es154.js +4 -16
  482. package/dist/index.es154.js.map +1 -1
  483. package/dist/index.es155.js +4 -4
  484. package/dist/index.es155.js.map +1 -1
  485. package/dist/index.es156.js +4 -16
  486. package/dist/index.es156.js.map +1 -1
  487. package/dist/index.es157.js +4 -22
  488. package/dist/index.es157.js.map +1 -1
  489. package/dist/index.es158.js +13 -6
  490. package/dist/index.es158.js.map +1 -1
  491. package/dist/index.es159.js +15 -5
  492. package/dist/index.es159.js.map +1 -1
  493. package/dist/index.es16.js +6 -8
  494. package/dist/index.es16.js.map +1 -1
  495. package/dist/index.es160.js +9 -6
  496. package/dist/index.es160.js.map +1 -1
  497. package/dist/index.es161.js +7 -5
  498. package/dist/index.es161.js.map +1 -1
  499. package/dist/index.es162.js +6 -11
  500. package/dist/index.es162.js.map +1 -1
  501. package/dist/index.es163.js +8 -5
  502. package/dist/index.es163.js.map +1 -1
  503. package/dist/index.es164.js +27 -4
  504. package/dist/index.es164.js.map +1 -1
  505. package/dist/index.es165.js +54 -4
  506. package/dist/index.es165.js.map +1 -1
  507. package/dist/index.es166.js +47 -6
  508. package/dist/index.es166.js.map +1 -1
  509. package/dist/index.es167.js +38 -6
  510. package/dist/index.es167.js.map +1 -1
  511. package/dist/index.es168.js +11 -6
  512. package/dist/index.es168.js.map +1 -1
  513. package/dist/index.es169.js +11 -6
  514. package/dist/index.es169.js.map +1 -1
  515. package/dist/index.es17.js +5 -5
  516. package/dist/index.es17.js.map +1 -1
  517. package/dist/index.es170.js +29 -14
  518. package/dist/index.es170.js.map +1 -1
  519. package/dist/index.es171.js +11 -16
  520. package/dist/index.es171.js.map +1 -1
  521. package/dist/index.es172.js +13 -10
  522. package/dist/index.es172.js.map +1 -1
  523. package/dist/index.es173.js +50 -6
  524. package/dist/index.es173.js.map +1 -1
  525. package/dist/index.es174.js +64 -6
  526. package/dist/index.es174.js.map +1 -1
  527. package/dist/index.es175.js +4 -9
  528. package/dist/index.es175.js.map +1 -1
  529. package/dist/index.es18.js +28 -10
  530. package/dist/index.es18.js.map +1 -1
  531. package/dist/index.es19.js +8 -17
  532. package/dist/index.es19.js.map +1 -1
  533. package/dist/index.es199.js +1 -1
  534. package/dist/index.es2.js +3 -3
  535. package/dist/index.es20.js +5 -5
  536. package/dist/index.es20.js.map +1 -1
  537. package/dist/index.es200.js +1 -1
  538. package/dist/index.es201.js +1 -1
  539. package/dist/index.es202.js +1 -1
  540. package/dist/index.es203.js +1 -1
  541. package/dist/index.es205.js +2 -2
  542. package/dist/index.es206.js +2 -2
  543. package/dist/index.es208.js +2 -2
  544. package/dist/index.es209.js +2 -2
  545. package/dist/index.es21.js +9 -4
  546. package/dist/index.es21.js.map +1 -1
  547. package/dist/index.es211.js +2 -2
  548. package/dist/index.es213.js +1 -1
  549. package/dist/index.es215.js +1 -1
  550. package/dist/index.es216.js +6 -6
  551. package/dist/index.es217.js +1 -1
  552. package/dist/index.es218.js +2 -2
  553. package/dist/index.es22.js +17 -5
  554. package/dist/index.es22.js.map +1 -1
  555. package/dist/index.es220.js +2 -2
  556. package/dist/index.es221.js +1 -1
  557. package/dist/index.es222.js +1 -1
  558. package/dist/index.es223.js +1 -1
  559. package/dist/index.es225.js +1 -1
  560. package/dist/index.es228.js +3 -8
  561. package/dist/index.es228.js.map +1 -1
  562. package/dist/index.es229.js +6 -3
  563. package/dist/index.es229.js.map +1 -1
  564. package/dist/index.es23.js +5 -7
  565. package/dist/index.es23.js.map +1 -1
  566. package/dist/index.es230.js +6 -4
  567. package/dist/index.es230.js.map +1 -1
  568. package/dist/index.es236.js +1 -1
  569. package/dist/index.es238.js +1 -1
  570. package/dist/index.es24.js +5 -7
  571. package/dist/index.es24.js.map +1 -1
  572. package/dist/index.es242.js +1 -1
  573. package/dist/index.es243.js +2 -2
  574. package/dist/index.es246.js +1 -1
  575. package/dist/index.es249.js +2 -15
  576. package/dist/index.es249.js.map +1 -1
  577. package/dist/index.es25.js +5 -4
  578. package/dist/index.es25.js.map +1 -1
  579. package/dist/index.es250.js +4 -2
  580. package/dist/index.es250.js.map +1 -1
  581. package/dist/index.es251.js +15 -70
  582. package/dist/index.es251.js.map +1 -1
  583. package/dist/index.es252.js +70 -4
  584. package/dist/index.es252.js.map +1 -1
  585. package/dist/index.es26.js +7 -4
  586. package/dist/index.es26.js.map +1 -1
  587. package/dist/index.es27.js +6 -6
  588. package/dist/index.es27.js.map +1 -1
  589. package/dist/index.es28.js +4 -15
  590. package/dist/index.es28.js.map +1 -1
  591. package/dist/index.es29.js +4 -12
  592. package/dist/index.es29.js.map +1 -1
  593. package/dist/index.es3.js +22 -63
  594. package/dist/index.es3.js.map +1 -1
  595. package/dist/index.es30.js +7 -15
  596. package/dist/index.es30.js.map +1 -1
  597. package/dist/index.es31.js +14 -6
  598. package/dist/index.es31.js.map +1 -1
  599. package/dist/index.es32.js +12 -5
  600. package/dist/index.es32.js.map +1 -1
  601. package/dist/index.es33.js +15 -4
  602. package/dist/index.es33.js.map +1 -1
  603. package/dist/index.es34.js +6 -17
  604. package/dist/index.es34.js.map +1 -1
  605. package/dist/index.es35.js +5 -18
  606. package/dist/index.es35.js.map +1 -1
  607. package/dist/index.es36.js +4 -14
  608. package/dist/index.es36.js.map +1 -1
  609. package/dist/index.es37.js +17 -5
  610. package/dist/index.es37.js.map +1 -1
  611. package/dist/index.es38.js +17 -6
  612. package/dist/index.es38.js.map +1 -1
  613. package/dist/index.es39.js +13 -9
  614. package/dist/index.es39.js.map +1 -1
  615. package/dist/index.es4.js +8 -8
  616. package/dist/index.es40.js +6 -4
  617. package/dist/index.es40.js.map +1 -1
  618. package/dist/index.es41.js +6 -18
  619. package/dist/index.es41.js.map +1 -1
  620. package/dist/index.es42.js +10 -6
  621. package/dist/index.es42.js.map +1 -1
  622. package/dist/index.es43.js +4 -6
  623. package/dist/index.es43.js.map +1 -1
  624. package/dist/index.es44.js +21 -1
  625. package/dist/index.es44.js.map +1 -1
  626. package/dist/index.es45.js +1 -39
  627. package/dist/index.es45.js.map +1 -1
  628. package/dist/index.es5.js +59 -24
  629. package/dist/index.es5.js.map +1 -1
  630. package/dist/index.es55.js +1 -1
  631. package/dist/index.es56.js +1 -1
  632. package/dist/index.es6.js +6 -6
  633. package/dist/index.es60.js +2 -28
  634. package/dist/index.es60.js.map +1 -1
  635. package/dist/index.es61.js +2 -55
  636. package/dist/index.es61.js.map +1 -1
  637. package/dist/index.es62.js +275 -48
  638. package/dist/index.es62.js.map +1 -1
  639. package/dist/index.es63.js +15 -37
  640. package/dist/index.es63.js.map +1 -1
  641. package/dist/index.es64.js +20 -11
  642. package/dist/index.es64.js.map +1 -1
  643. package/dist/index.es65.js +6 -11
  644. package/dist/index.es65.js.map +1 -1
  645. package/dist/index.es66.js +5 -29
  646. package/dist/index.es66.js.map +1 -1
  647. package/dist/index.es67.js +5 -11
  648. package/dist/index.es67.js.map +1 -1
  649. package/dist/index.es68.js +5 -12
  650. package/dist/index.es68.js.map +1 -1
  651. package/dist/index.es69.js +3 -50
  652. package/dist/index.es69.js.map +1 -1
  653. package/dist/index.es7.js +7 -7
  654. package/dist/index.es70.js +3 -65
  655. package/dist/index.es70.js.map +1 -1
  656. package/dist/index.es71.js +3 -4
  657. package/dist/index.es71.js.map +1 -1
  658. package/dist/index.es72.js +3 -2
  659. package/dist/index.es72.js.map +1 -1
  660. package/dist/index.es73.js +3 -2
  661. package/dist/index.es73.js.map +1 -1
  662. package/dist/index.es74.js +3 -273
  663. package/dist/index.es74.js.map +1 -1
  664. package/dist/index.es75.js +3 -15
  665. package/dist/index.es75.js.map +1 -1
  666. package/dist/index.es76.js +3 -19
  667. package/dist/index.es76.js.map +1 -1
  668. package/dist/index.es77.js +9 -4
  669. package/dist/index.es77.js.map +1 -1
  670. package/dist/index.es78.js +4 -4
  671. package/dist/index.es78.js.map +1 -1
  672. package/dist/index.es79.js +5 -3
  673. package/dist/index.es79.js.map +1 -1
  674. package/dist/index.es8.js +2 -2
  675. package/dist/index.es80.js +5 -4
  676. package/dist/index.es80.js.map +1 -1
  677. package/dist/index.es81.js +9 -3
  678. package/dist/index.es81.js.map +1 -1
  679. package/dist/index.es82.js +12 -3
  680. package/dist/index.es82.js.map +1 -1
  681. package/dist/index.es83.js +13 -3
  682. package/dist/index.es83.js.map +1 -1
  683. package/dist/index.es84.js +86 -3
  684. package/dist/index.es84.js.map +1 -1
  685. package/dist/index.es85.js +2 -2
  686. package/dist/index.es85.js.map +1 -1
  687. package/dist/index.es86.js +15 -3
  688. package/dist/index.es86.js.map +1 -1
  689. package/dist/index.es87.js +12 -3
  690. package/dist/index.es87.js.map +1 -1
  691. package/dist/index.es88.js +7 -3
  692. package/dist/index.es88.js.map +1 -1
  693. package/dist/index.es89.js +6 -9
  694. package/dist/index.es89.js.map +1 -1
  695. package/dist/index.es9.js +18 -10
  696. package/dist/index.es9.js.map +1 -1
  697. package/dist/index.es90.js +7 -4
  698. package/dist/index.es90.js.map +1 -1
  699. package/dist/index.es91.js +7 -5
  700. package/dist/index.es91.js.map +1 -1
  701. package/dist/index.es92.js +4 -6
  702. package/dist/index.es92.js.map +1 -1
  703. package/dist/index.es93.js +4 -10
  704. package/dist/index.es93.js.map +1 -1
  705. package/dist/index.es94.js +4 -12
  706. package/dist/index.es94.js.map +1 -1
  707. package/dist/index.es95.js +5 -11
  708. package/dist/index.es95.js.map +1 -1
  709. package/dist/index.es96.js +6 -85
  710. package/dist/index.es96.js.map +1 -1
  711. package/dist/index.es97.js +4 -3
  712. package/dist/index.es97.js.map +1 -1
  713. package/dist/index.es98.js +7 -14
  714. package/dist/index.es98.js.map +1 -1
  715. package/dist/index.es99.js +11 -10
  716. package/dist/index.es99.js.map +1 -1
  717. package/package.json +2 -2
  718. package/src/components/GeoJsonLayer.js +10 -66
  719. package/src/components/LocationMarkers.js +70 -10
  720. package/src/index.js +1 -0
  721. package/src/utils/Map.js +29 -1
  722. package/src/utils/MapStyles.js +9 -3
  723. package/types/components/GeoJsonLayer.js.flow +10 -66
  724. package/types/components/LocationMarkers.js.flow +70 -10
  725. package/types/index.js.flow +1 -0
  726. package/types/utils/Map.js.flow +29 -1
  727. package/types/utils/MapStyles.js.flow +9 -3
@@ -1,2105 +1,42 @@
1
- import { commonjsGlobal as Je, getDefaultExportFromCjs as oo } from "./index.es52.js";
2
- import { __module as Zn } from "./index.es53.js";
3
- (function(Wn, ao) {
4
- (function(ze, de) {
5
- Wn.exports = de();
6
- })(Je, function() {
7
- var ze = function(e, t) {
8
- var n = { drag: [], click: [], mousemove: [], mousedown: [], mouseup: [], mouseout: [], keydown: [], keyup: [], touchstart: [], touchmove: [], touchend: [], tap: [] }, r = { on: function(i, a, l) {
9
- if (n[i] === void 0)
10
- throw new Error("Invalid event type: " + i);
11
- n[i].push({ selector: a, fn: l });
12
- }, render: function(i) {
13
- t.store.featureChanged(i);
14
- } }, o = function(i, a) {
15
- for (var l = n[i], d = l.length; d--; ) {
16
- var h = l[d];
17
- if (h.selector(a)) {
18
- h.fn.call(r, a) || t.store.render(), t.ui.updateMapClasses();
19
- break;
20
- }
21
- }
22
- };
23
- return e.start.call(r), { render: e.render, stop: function() {
24
- e.stop && e.stop();
25
- }, trash: function() {
26
- e.trash && (e.trash(), t.store.render());
27
- }, combineFeatures: function() {
28
- e.combineFeatures && e.combineFeatures();
29
- }, uncombineFeatures: function() {
30
- e.uncombineFeatures && e.uncombineFeatures();
31
- }, drag: function(i) {
32
- o("drag", i);
33
- }, click: function(i) {
34
- o("click", i);
35
- }, mousemove: function(i) {
36
- o("mousemove", i);
37
- }, mousedown: function(i) {
38
- o("mousedown", i);
39
- }, mouseup: function(i) {
40
- o("mouseup", i);
41
- }, mouseout: function(i) {
42
- o("mouseout", i);
43
- }, keydown: function(i) {
44
- o("keydown", i);
45
- }, keyup: function(i) {
46
- o("keyup", i);
47
- }, touchstart: function(i) {
48
- o("touchstart", i);
49
- }, touchmove: function(i) {
50
- o("touchmove", i);
51
- }, touchend: function(i) {
52
- o("touchend", i);
53
- }, tap: function(i) {
54
- o("tap", i);
55
- } };
56
- };
57
- function de(e) {
58
- return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
59
- }
60
- function Kn(e) {
61
- if (e.__esModule)
62
- return e;
63
- var t = e.default;
64
- if (typeof t == "function") {
65
- var n = function r() {
66
- if (this instanceof r) {
67
- var o = [null];
68
- o.push.apply(o, arguments);
69
- var i = Function.bind.apply(t, o);
70
- return new i();
71
- }
72
- return t.apply(this, arguments);
73
- };
74
- n.prototype = t.prototype;
75
- } else
76
- n = {};
77
- return Object.defineProperty(n, "__esModule", { value: !0 }), Object.keys(e).forEach(function(r) {
78
- var o = Object.getOwnPropertyDescriptor(e, r);
79
- Object.defineProperty(n, r, o.get ? o : { enumerable: !0, get: function() {
80
- return e[r];
81
- } });
82
- }), n;
83
- }
84
- var Et = {}, Qn = { RADIUS: 6378137, FLATTENING: 1 / 298.257223563, POLAR_RADIUS: 63567523142e-4 }, Xt = Qn;
85
- function Zt(e) {
86
- var t = 0;
87
- if (e && e.length > 0) {
88
- t += Math.abs(Tt(e[0]));
89
- for (var n = 1; n < e.length; n++)
90
- t -= Math.abs(Tt(e[n]));
91
- }
92
- return t;
93
- }
94
- function Tt(e) {
95
- var t, n, r, o, i, a, l = 0, d = e.length;
96
- if (d > 2) {
97
- for (a = 0; a < d; a++)
98
- a === d - 2 ? (r = d - 2, o = d - 1, i = 0) : a === d - 1 ? (r = d - 1, o = 0, i = 1) : (r = a, o = a + 1, i = a + 2), t = e[r], n = e[o], l += (Ct(e[i][0]) - Ct(t[0])) * Math.sin(Ct(n[1]));
99
- l = l * Xt.RADIUS * Xt.RADIUS / 2;
100
- }
101
- return l;
102
- }
103
- function Ct(e) {
104
- return e * Math.PI / 180;
105
- }
106
- Et.geometry = function e(t) {
107
- var n, r = 0;
108
- switch (t.type) {
109
- case "Polygon":
110
- return Zt(t.coordinates);
111
- case "MultiPolygon":
112
- for (n = 0; n < t.coordinates.length; n++)
113
- r += Zt(t.coordinates[n]);
114
- return r;
115
- case "Point":
116
- case "MultiPoint":
117
- case "LineString":
118
- case "MultiLineString":
119
- return 0;
120
- case "GeometryCollection":
121
- for (n = 0; n < t.geometries.length; n++)
122
- r += e(t.geometries[n]);
123
- return r;
124
- }
125
- }, Et.ring = Tt;
126
- var q = { CONTROL_BASE: "mapboxgl-ctrl", CONTROL_PREFIX: "mapboxgl-ctrl-", CONTROL_BUTTON: "mapbox-gl-draw_ctrl-draw-btn", CONTROL_BUTTON_LINE: "mapbox-gl-draw_line", CONTROL_BUTTON_POLYGON: "mapbox-gl-draw_polygon", CONTROL_BUTTON_POINT: "mapbox-gl-draw_point", CONTROL_BUTTON_TRASH: "mapbox-gl-draw_trash", CONTROL_BUTTON_COMBINE_FEATURES: "mapbox-gl-draw_combine", CONTROL_BUTTON_UNCOMBINE_FEATURES: "mapbox-gl-draw_uncombine", CONTROL_GROUP: "mapboxgl-ctrl-group", ATTRIBUTION: "mapboxgl-ctrl-attrib", ACTIVE_BUTTON: "active", BOX_SELECT: "mapbox-gl-draw_boxselect" }, X = { HOT: "mapbox-gl-draw-hot", COLD: "mapbox-gl-draw-cold" }, N = { ADD: "add", MOVE: "move", DRAG: "drag", POINTER: "pointer", NONE: "none" }, Y = { POLYGON: "polygon", LINE: "line_string", POINT: "point" }, m = { FEATURE: "Feature", POLYGON: "Polygon", LINE_STRING: "LineString", POINT: "Point", FEATURE_COLLECTION: "FeatureCollection", MULTI_PREFIX: "Multi", MULTI_POINT: "MultiPoint", MULTI_LINE_STRING: "MultiLineString", MULTI_POLYGON: "MultiPolygon" }, T = { DRAW_LINE_STRING: "draw_line_string", DRAW_POLYGON: "draw_polygon", DRAW_POINT: "draw_point", SIMPLE_SELECT: "simple_select", DIRECT_SELECT: "direct_select", STATIC: "static" }, H = { CREATE: "draw.create", DELETE: "draw.delete", UPDATE: "draw.update", SELECTION_CHANGE: "draw.selectionchange", MODE_CHANGE: "draw.modechange", ACTIONABLE: "draw.actionable", RENDER: "draw.render", COMBINE_FEATURES: "draw.combine", UNCOMBINE_FEATURES: "draw.uncombine" }, Ot = { MOVE: "move", CHANGE_COORDINATES: "change_coordinates" }, B = { FEATURE: "feature", MIDPOINT: "midpoint", VERTEX: "vertex" }, j = { ACTIVE: "true", INACTIVE: "false" }, Wt = ["scrollZoom", "boxZoom", "dragRotate", "dragPan", "keyboard", "doubleClickZoom", "touchZoomRotate"], St = -85, er = Object.freeze({ __proto__: null, classes: q, sources: X, cursors: N, types: Y, geojsonTypes: m, modes: T, events: H, updateActions: Ot, meta: B, activeStates: j, interactions: Wt, LAT_MIN: -90, LAT_RENDERED_MIN: St, LAT_MAX: 90, LAT_RENDERED_MAX: 85, LNG_MIN: -270, LNG_MAX: 270 }), Kt = { Point: 0, LineString: 1, MultiLineString: 1, Polygon: 2 };
127
- function tr(e, t) {
128
- var n = Kt[e.geometry.type] - Kt[t.geometry.type];
129
- return n === 0 && e.geometry.type === m.POLYGON ? e.area - t.area : n;
130
- }
131
- function Qt(e) {
132
- return e.map(function(t) {
133
- return t.geometry.type === m.POLYGON && (t.area = Et.geometry({ type: m.FEATURE, property: {}, geometry: t.geometry })), t;
134
- }).sort(tr).map(function(t) {
135
- return delete t.area, t;
136
- });
137
- }
138
- function en(e, t) {
139
- return t === void 0 && (t = 0), [[e.point.x - t, e.point.y - t], [e.point.x + t, e.point.y + t]];
140
- }
141
- function Z(e) {
142
- if (this._items = {}, this._nums = {}, this._length = e ? e.length : 0, e)
143
- for (var t = 0, n = e.length; t < n; t++)
144
- this.add(e[t]), e[t] !== void 0 && (typeof e[t] == "string" ? this._items[e[t]] = t : this._nums[e[t]] = t);
145
- }
146
- Z.prototype.add = function(e) {
147
- return this.has(e) || (this._length++, typeof e == "string" ? this._items[e] = this._length : this._nums[e] = this._length), this;
148
- }, Z.prototype.delete = function(e) {
149
- return this.has(e) === !1 || (this._length--, delete this._items[e], delete this._nums[e]), this;
150
- }, Z.prototype.has = function(e) {
151
- return (typeof e == "string" || typeof e == "number") && (this._items[e] !== void 0 || this._nums[e] !== void 0);
152
- }, Z.prototype.values = function() {
153
- var e = this, t = [];
154
- return Object.keys(this._items).forEach(function(n) {
155
- t.push({ k: n, v: e._items[n] });
156
- }), Object.keys(this._nums).forEach(function(n) {
157
- t.push({ k: JSON.parse(n), v: e._nums[n] });
158
- }), t.sort(function(n, r) {
159
- return n.v - r.v;
160
- }).map(function(n) {
161
- return n.k;
162
- });
163
- }, Z.prototype.clear = function() {
164
- return this._length = 0, this._items = {}, this._nums = {}, this;
165
- };
166
- var nr = [B.FEATURE, B.MIDPOINT, B.VERTEX], xe = { click: function(e, t, n) {
167
- return tn(e, t, n, n.options.clickBuffer);
168
- }, touch: function(e, t, n) {
169
- return tn(e, t, n, n.options.touchBuffer);
170
- } };
171
- function tn(e, t, n, r) {
172
- if (n.map === null)
173
- return [];
174
- var o = e ? en(e, r) : t, i = {};
175
- n.options.styles && (i.layers = n.options.styles.map(function(h) {
176
- return h.id;
177
- }).filter(function(h) {
178
- return n.map.getLayer(h) != null;
179
- }));
180
- var a = n.map.queryRenderedFeatures(o, i).filter(function(h) {
181
- return nr.indexOf(h.properties.meta) !== -1;
182
- }), l = new Z(), d = [];
183
- return a.forEach(function(h) {
184
- var g = h.properties.id;
185
- l.has(g) || (l.add(g), d.push(h));
186
- }), Qt(d);
187
- }
188
- function Ye(e, t) {
189
- var n = xe.click(e, null, t), r = { mouse: N.NONE };
190
- return n[0] && (r.mouse = n[0].properties.active === j.ACTIVE ? N.MOVE : N.POINTER, r.feature = n[0].properties.meta), t.events.currentModeName().indexOf("draw") !== -1 && (r.mouse = N.ADD), t.ui.queueMapClasses(r), t.ui.updateMapClasses(), n[0];
191
- }
192
- function It(e, t) {
193
- var n = e.x - t.x, r = e.y - t.y;
194
- return Math.sqrt(n * n + r * r);
195
- }
196
- function xt(e, t, n) {
197
- n === void 0 && (n = {});
198
- var r = n.fineTolerance != null ? n.fineTolerance : 4, o = n.grossTolerance != null ? n.grossTolerance : 12, i = n.interval != null ? n.interval : 500;
199
- e.point = e.point || t.point, e.time = e.time || t.time;
200
- var a = It(e.point, t.point);
201
- return a < r || a < o && t.time - e.time < i;
202
- }
203
- function Mt(e, t, n) {
204
- n === void 0 && (n = {});
205
- var r = n.tolerance != null ? n.tolerance : 25, o = n.interval != null ? n.interval : 250;
206
- return e.point = e.point || t.point, e.time = e.time || t.time, It(e.point, t.point) < r && t.time - e.time < o;
207
- }
208
- var nn = { exports: {} }, Lt = nn.exports = function(e, t) {
209
- if (t || (t = 16), e === void 0 && (e = 128), e <= 0)
210
- return "0";
211
- for (var n = Math.log(Math.pow(2, e)) / Math.log(t), r = 2; n === 1 / 0; r *= 2)
212
- n = Math.log(Math.pow(2, e / r)) / Math.log(t) * r;
213
- var o = n - Math.floor(n), i = "";
214
- for (r = 0; r < Math.floor(n); r++)
215
- i = Math.floor(Math.random() * t).toString(t) + i;
216
- if (o) {
217
- var a = Math.pow(t, o);
218
- i = Math.floor(Math.random() * a).toString(t) + i;
219
- }
220
- var l = parseInt(i, t);
221
- return l !== 1 / 0 && l >= Math.pow(2, e) ? Lt(e, t) : i;
222
- };
223
- Lt.rack = function(e, t, n) {
224
- var r = function(i) {
225
- var a = 0;
226
- do {
227
- if (a++ > 10) {
228
- if (!n)
229
- throw new Error("too many ID collisions, use more bits");
230
- e += n;
231
- }
232
- var l = Lt(e, t);
233
- } while (Object.hasOwnProperty.call(o, l));
234
- return o[l] = i, l;
235
- }, o = r.hats = {};
236
- return r.get = function(i) {
237
- return r.hats[i];
238
- }, r.set = function(i, a) {
239
- return r.hats[i] = a, r;
240
- }, r.bits = e || 128, r.base = t || 16, r;
241
- };
242
- var Nt = de(nn.exports), G = function(e, t) {
243
- this.ctx = e, this.properties = t.properties || {}, this.coordinates = t.geometry.coordinates, this.id = t.id || Nt(), this.type = t.geometry.type;
244
- };
245
- G.prototype.changed = function() {
246
- this.ctx.store.featureChanged(this.id);
247
- }, G.prototype.incomingCoords = function(e) {
248
- this.setCoordinates(e);
249
- }, G.prototype.setCoordinates = function(e) {
250
- this.coordinates = e, this.changed();
251
- }, G.prototype.getCoordinates = function() {
252
- return JSON.parse(JSON.stringify(this.coordinates));
253
- }, G.prototype.setProperty = function(e, t) {
254
- this.properties[e] = t;
255
- }, G.prototype.toGeoJSON = function() {
256
- return JSON.parse(JSON.stringify({ id: this.id, type: m.FEATURE, properties: this.properties, geometry: { coordinates: this.getCoordinates(), type: this.type } }));
257
- }, G.prototype.internal = function(e) {
258
- var t = { id: this.id, meta: B.FEATURE, "meta:type": this.type, active: j.INACTIVE, mode: e };
259
- if (this.ctx.options.userProperties)
260
- for (var n in this.properties)
261
- t["user_" + n] = this.properties[n];
262
- return { type: m.FEATURE, properties: t, geometry: { coordinates: this.getCoordinates(), type: this.type } };
263
- };
264
- var me = function(e, t) {
265
- G.call(this, e, t);
266
- };
267
- (me.prototype = Object.create(G.prototype)).isValid = function() {
268
- return typeof this.coordinates[0] == "number" && typeof this.coordinates[1] == "number";
269
- }, me.prototype.updateCoordinate = function(e, t, n) {
270
- this.coordinates = arguments.length === 3 ? [t, n] : [e, t], this.changed();
271
- }, me.prototype.getCoordinate = function() {
272
- return this.getCoordinates();
273
- };
274
- var ie = function(e, t) {
275
- G.call(this, e, t);
276
- };
277
- (ie.prototype = Object.create(G.prototype)).isValid = function() {
278
- return this.coordinates.length > 1;
279
- }, ie.prototype.addCoordinate = function(e, t, n) {
280
- this.changed();
281
- var r = parseInt(e, 10);
282
- this.coordinates.splice(r, 0, [t, n]);
283
- }, ie.prototype.getCoordinate = function(e) {
284
- var t = parseInt(e, 10);
285
- return JSON.parse(JSON.stringify(this.coordinates[t]));
286
- }, ie.prototype.removeCoordinate = function(e) {
287
- this.changed(), this.coordinates.splice(parseInt(e, 10), 1);
288
- }, ie.prototype.updateCoordinate = function(e, t, n) {
289
- var r = parseInt(e, 10);
290
- this.coordinates[r] = [t, n], this.changed();
291
- };
292
- var W = function(e, t) {
293
- G.call(this, e, t), this.coordinates = this.coordinates.map(function(n) {
294
- return n.slice(0, -1);
295
- });
296
- };
297
- (W.prototype = Object.create(G.prototype)).isValid = function() {
298
- return this.coordinates.length !== 0 && this.coordinates.every(function(e) {
299
- return e.length > 2;
300
- });
301
- }, W.prototype.incomingCoords = function(e) {
302
- this.coordinates = e.map(function(t) {
303
- return t.slice(0, -1);
304
- }), this.changed();
305
- }, W.prototype.setCoordinates = function(e) {
306
- this.coordinates = e, this.changed();
307
- }, W.prototype.addCoordinate = function(e, t, n) {
308
- this.changed();
309
- var r = e.split(".").map(function(o) {
310
- return parseInt(o, 10);
311
- });
312
- this.coordinates[r[0]].splice(r[1], 0, [t, n]);
313
- }, W.prototype.removeCoordinate = function(e) {
314
- this.changed();
315
- var t = e.split(".").map(function(r) {
316
- return parseInt(r, 10);
317
- }), n = this.coordinates[t[0]];
318
- n && (n.splice(t[1], 1), n.length < 3 && this.coordinates.splice(t[0], 1));
319
- }, W.prototype.getCoordinate = function(e) {
320
- var t = e.split(".").map(function(r) {
321
- return parseInt(r, 10);
322
- }), n = this.coordinates[t[0]];
323
- return JSON.parse(JSON.stringify(n[t[1]]));
324
- }, W.prototype.getCoordinates = function() {
325
- return this.coordinates.map(function(e) {
326
- return e.concat([e[0]]);
327
- });
328
- }, W.prototype.updateCoordinate = function(e, t, n) {
329
- this.changed();
330
- var r = e.split("."), o = parseInt(r[0], 10), i = parseInt(r[1], 10);
331
- this.coordinates[o] === void 0 && (this.coordinates[o] = []), this.coordinates[o][i] = [t, n];
332
- };
333
- var rr = { MultiPoint: me, MultiLineString: ie, MultiPolygon: W }, $e = function(e, t, n, r, o) {
334
- var i = n.split("."), a = parseInt(i[0], 10), l = i[1] ? i.slice(1).join(".") : null;
335
- return e[a][t](l, r, o);
336
- }, $ = function(e, t) {
337
- if (G.call(this, e, t), delete this.coordinates, this.model = rr[t.geometry.type], this.model === void 0)
338
- throw new TypeError(t.geometry.type + " is not a valid type");
339
- this.features = this._coordinatesToFeatures(t.geometry.coordinates);
340
- };
341
- function E(e) {
342
- this.map = e.map, this.drawConfig = JSON.parse(JSON.stringify(e.options || {})), this._ctx = e;
343
- }
344
- ($.prototype = Object.create(G.prototype))._coordinatesToFeatures = function(e) {
345
- var t = this, n = this.model.bind(this);
346
- return e.map(function(r) {
347
- return new n(t.ctx, { id: Nt(), type: m.FEATURE, properties: {}, geometry: { coordinates: r, type: t.type.replace("Multi", "") } });
348
- });
349
- }, $.prototype.isValid = function() {
350
- return this.features.every(function(e) {
351
- return e.isValid();
352
- });
353
- }, $.prototype.setCoordinates = function(e) {
354
- this.features = this._coordinatesToFeatures(e), this.changed();
355
- }, $.prototype.getCoordinate = function(e) {
356
- return $e(this.features, "getCoordinate", e);
357
- }, $.prototype.getCoordinates = function() {
358
- return JSON.parse(JSON.stringify(this.features.map(function(e) {
359
- return e.type === m.POLYGON ? e.getCoordinates() : e.coordinates;
360
- })));
361
- }, $.prototype.updateCoordinate = function(e, t, n) {
362
- $e(this.features, "updateCoordinate", e, t, n), this.changed();
363
- }, $.prototype.addCoordinate = function(e, t, n) {
364
- $e(this.features, "addCoordinate", e, t, n), this.changed();
365
- }, $.prototype.removeCoordinate = function(e) {
366
- $e(this.features, "removeCoordinate", e), this.changed();
367
- }, $.prototype.getFeatures = function() {
368
- return this.features;
369
- }, E.prototype.setSelected = function(e) {
370
- return this._ctx.store.setSelected(e);
371
- }, E.prototype.setSelectedCoordinates = function(e) {
372
- var t = this;
373
- this._ctx.store.setSelectedCoordinates(e), e.reduce(function(n, r) {
374
- return n[r.feature_id] === void 0 && (n[r.feature_id] = !0, t._ctx.store.get(r.feature_id).changed()), n;
375
- }, {});
376
- }, E.prototype.getSelected = function() {
377
- return this._ctx.store.getSelected();
378
- }, E.prototype.getSelectedIds = function() {
379
- return this._ctx.store.getSelectedIds();
380
- }, E.prototype.isSelected = function(e) {
381
- return this._ctx.store.isSelected(e);
382
- }, E.prototype.getFeature = function(e) {
383
- return this._ctx.store.get(e);
384
- }, E.prototype.select = function(e) {
385
- return this._ctx.store.select(e);
386
- }, E.prototype.deselect = function(e) {
387
- return this._ctx.store.deselect(e);
388
- }, E.prototype.deleteFeature = function(e, t) {
389
- return t === void 0 && (t = {}), this._ctx.store.delete(e, t);
390
- }, E.prototype.addFeature = function(e) {
391
- return this._ctx.store.add(e);
392
- }, E.prototype.clearSelectedFeatures = function() {
393
- return this._ctx.store.clearSelected();
394
- }, E.prototype.clearSelectedCoordinates = function() {
395
- return this._ctx.store.clearSelectedCoordinates();
396
- }, E.prototype.setActionableState = function(e) {
397
- e === void 0 && (e = {});
398
- var t = { trash: e.trash || !1, combineFeatures: e.combineFeatures || !1, uncombineFeatures: e.uncombineFeatures || !1 };
399
- return this._ctx.events.actionable(t);
400
- }, E.prototype.changeMode = function(e, t, n) {
401
- return t === void 0 && (t = {}), n === void 0 && (n = {}), this._ctx.events.changeMode(e, t, n);
402
- }, E.prototype.updateUIClasses = function(e) {
403
- return this._ctx.ui.queueMapClasses(e);
404
- }, E.prototype.activateUIButton = function(e) {
405
- return this._ctx.ui.setActiveButton(e);
406
- }, E.prototype.featuresAt = function(e, t, n) {
407
- if (n === void 0 && (n = "click"), n !== "click" && n !== "touch")
408
- throw new Error("invalid buffer type");
409
- return xe[n](e, t, this._ctx);
410
- }, E.prototype.newFeature = function(e) {
411
- var t = e.geometry.type;
412
- return t === m.POINT ? new me(this._ctx, e) : t === m.LINE_STRING ? new ie(this._ctx, e) : t === m.POLYGON ? new W(this._ctx, e) : new $(this._ctx, e);
413
- }, E.prototype.isInstanceOf = function(e, t) {
414
- if (e === m.POINT)
415
- return t instanceof me;
416
- if (e === m.LINE_STRING)
417
- return t instanceof ie;
418
- if (e === m.POLYGON)
419
- return t instanceof W;
420
- if (e === "MultiFeature")
421
- return t instanceof $;
422
- throw new Error("Unknown feature class: " + e);
423
- }, E.prototype.doRender = function(e) {
424
- return this._ctx.store.featureChanged(e);
425
- }, E.prototype.onSetup = function() {
426
- }, E.prototype.onDrag = function() {
427
- }, E.prototype.onClick = function() {
428
- }, E.prototype.onMouseMove = function() {
429
- }, E.prototype.onMouseDown = function() {
430
- }, E.prototype.onMouseUp = function() {
431
- }, E.prototype.onMouseOut = function() {
432
- }, E.prototype.onKeyUp = function() {
433
- }, E.prototype.onKeyDown = function() {
434
- }, E.prototype.onTouchStart = function() {
435
- }, E.prototype.onTouchMove = function() {
436
- }, E.prototype.onTouchEnd = function() {
437
- }, E.prototype.onTap = function() {
438
- }, E.prototype.onStop = function() {
439
- }, E.prototype.onTrash = function() {
440
- }, E.prototype.onCombineFeature = function() {
441
- }, E.prototype.onUncombineFeature = function() {
442
- }, E.prototype.toDisplayFeatures = function() {
443
- throw new Error("You must overwrite toDisplayFeatures");
444
- };
445
- var rn = { drag: "onDrag", click: "onClick", mousemove: "onMouseMove", mousedown: "onMouseDown", mouseup: "onMouseUp", mouseout: "onMouseOut", keyup: "onKeyUp", keydown: "onKeyDown", touchstart: "onTouchStart", touchmove: "onTouchMove", touchend: "onTouchEnd", tap: "onTap" }, or = Object.keys(rn);
446
- function ir(e) {
447
- var t = Object.keys(e);
448
- return function(n, r) {
449
- r === void 0 && (r = {});
450
- var o = {}, i = t.reduce(function(a, l) {
451
- return a[l] = e[l], a;
452
- }, new E(n));
453
- return { start: function() {
454
- var a = this;
455
- o = i.onSetup(r), or.forEach(function(l) {
456
- var d, h = rn[l], g = function() {
457
- return !1;
458
- };
459
- e[h] && (g = function() {
460
- return !0;
461
- }), a.on(l, g, (d = h, function(p) {
462
- return i[d](o, p);
463
- }));
464
- });
465
- }, stop: function() {
466
- i.onStop(o);
467
- }, trash: function() {
468
- i.onTrash(o);
469
- }, combineFeatures: function() {
470
- i.onCombineFeatures(o);
471
- }, uncombineFeatures: function() {
472
- i.onUncombineFeatures(o);
473
- }, render: function(a, l) {
474
- i.toDisplayFeatures(o, a, l);
475
- } };
476
- };
477
- }
478
- function Re(e) {
479
- return [].concat(e).filter(function(t) {
480
- return t !== void 0;
481
- });
482
- }
483
- function ar() {
484
- var e = this;
485
- if (!(e.ctx.map && e.ctx.map.getSource(X.HOT) !== void 0))
486
- return d();
487
- var t = e.ctx.events.currentModeName();
488
- e.ctx.ui.queueMapClasses({ mode: t });
489
- var n = [], r = [];
490
- e.isDirty ? r = e.getAllIds() : (n = e.getChangedIds().filter(function(h) {
491
- return e.get(h) !== void 0;
492
- }), r = e.sources.hot.filter(function(h) {
493
- return h.properties.id && n.indexOf(h.properties.id) === -1 && e.get(h.properties.id) !== void 0;
494
- }).map(function(h) {
495
- return h.properties.id;
496
- })), e.sources.hot = [];
497
- var o = e.sources.cold.length;
498
- e.sources.cold = e.isDirty ? [] : e.sources.cold.filter(function(h) {
499
- var g = h.properties.id || h.properties.parent;
500
- return n.indexOf(g) === -1;
501
- });
502
- var i = o !== e.sources.cold.length || r.length > 0;
503
- function a(h, g) {
504
- var p = e.get(h).internal(t);
505
- e.ctx.events.currentModeRender(p, function(_) {
506
- e.sources[g].push(_);
507
- });
508
- }
509
- if (n.forEach(function(h) {
510
- return a(h, "hot");
511
- }), r.forEach(function(h) {
512
- return a(h, "cold");
513
- }), i && e.ctx.map.getSource(X.COLD).setData({ type: m.FEATURE_COLLECTION, features: e.sources.cold }), e.ctx.map.getSource(X.HOT).setData({ type: m.FEATURE_COLLECTION, features: e.sources.hot }), e._emitSelectionChange && (e.ctx.map.fire(H.SELECTION_CHANGE, { features: e.getSelected().map(function(h) {
514
- return h.toGeoJSON();
515
- }), points: e.getSelectedCoordinates().map(function(h) {
516
- return { type: m.FEATURE, properties: {}, geometry: { type: m.POINT, coordinates: h.coordinates } };
517
- }) }), e._emitSelectionChange = !1), e._deletedFeaturesToEmit.length) {
518
- var l = e._deletedFeaturesToEmit.map(function(h) {
519
- return h.toGeoJSON();
520
- });
521
- e._deletedFeaturesToEmit = [], e.ctx.map.fire(H.DELETE, { features: l });
522
- }
523
- function d() {
524
- e.isDirty = !1, e.clearChangedIds();
525
- }
526
- d(), e.ctx.map.fire(H.RENDER, {});
527
- }
528
- function x(e) {
529
- var t, n = this;
530
- this._features = {}, this._featureIds = new Z(), this._selectedFeatureIds = new Z(), this._selectedCoordinates = [], this._changedFeatureIds = new Z(), this._deletedFeaturesToEmit = [], this._emitSelectionChange = !1, this._mapInitialConfig = {}, this.ctx = e, this.sources = { hot: [], cold: [] }, this.render = function() {
531
- t || (t = requestAnimationFrame(function() {
532
- t = null, ar.call(n);
533
- }));
534
- }, this.isDirty = !1;
535
- }
536
- function on(e, t) {
537
- var n = e._selectedCoordinates.filter(function(r) {
538
- return e._selectedFeatureIds.has(r.feature_id);
539
- });
540
- e._selectedCoordinates.length === n.length || t.silent || (e._emitSelectionChange = !0), e._selectedCoordinates = n;
541
- }
542
- x.prototype.createRenderBatch = function() {
543
- var e = this, t = this.render, n = 0;
544
- return this.render = function() {
545
- n++;
546
- }, function() {
547
- e.render = t, n > 0 && e.render();
548
- };
549
- }, x.prototype.setDirty = function() {
550
- return this.isDirty = !0, this;
551
- }, x.prototype.featureChanged = function(e) {
552
- return this._changedFeatureIds.add(e), this;
553
- }, x.prototype.getChangedIds = function() {
554
- return this._changedFeatureIds.values();
555
- }, x.prototype.clearChangedIds = function() {
556
- return this._changedFeatureIds.clear(), this;
557
- }, x.prototype.getAllIds = function() {
558
- return this._featureIds.values();
559
- }, x.prototype.add = function(e) {
560
- return this.featureChanged(e.id), this._features[e.id] = e, this._featureIds.add(e.id), this;
561
- }, x.prototype.delete = function(e, t) {
562
- var n = this;
563
- return t === void 0 && (t = {}), Re(e).forEach(function(r) {
564
- n._featureIds.has(r) && (n._featureIds.delete(r), n._selectedFeatureIds.delete(r), t.silent || n._deletedFeaturesToEmit.indexOf(n._features[r]) === -1 && n._deletedFeaturesToEmit.push(n._features[r]), delete n._features[r], n.isDirty = !0);
565
- }), on(this, t), this;
566
- }, x.prototype.get = function(e) {
567
- return this._features[e];
568
- }, x.prototype.getAll = function() {
569
- var e = this;
570
- return Object.keys(this._features).map(function(t) {
571
- return e._features[t];
572
- });
573
- }, x.prototype.select = function(e, t) {
574
- var n = this;
575
- return t === void 0 && (t = {}), Re(e).forEach(function(r) {
576
- n._selectedFeatureIds.has(r) || (n._selectedFeatureIds.add(r), n._changedFeatureIds.add(r), t.silent || (n._emitSelectionChange = !0));
577
- }), this;
578
- }, x.prototype.deselect = function(e, t) {
579
- var n = this;
580
- return t === void 0 && (t = {}), Re(e).forEach(function(r) {
581
- n._selectedFeatureIds.has(r) && (n._selectedFeatureIds.delete(r), n._changedFeatureIds.add(r), t.silent || (n._emitSelectionChange = !0));
582
- }), on(this, t), this;
583
- }, x.prototype.clearSelected = function(e) {
584
- return e === void 0 && (e = {}), this.deselect(this._selectedFeatureIds.values(), { silent: e.silent }), this;
585
- }, x.prototype.setSelected = function(e, t) {
586
- var n = this;
587
- return t === void 0 && (t = {}), e = Re(e), this.deselect(this._selectedFeatureIds.values().filter(function(r) {
588
- return e.indexOf(r) === -1;
589
- }), { silent: t.silent }), this.select(e.filter(function(r) {
590
- return !n._selectedFeatureIds.has(r);
591
- }), { silent: t.silent }), this;
592
- }, x.prototype.setSelectedCoordinates = function(e) {
593
- return this._selectedCoordinates = e, this._emitSelectionChange = !0, this;
594
- }, x.prototype.clearSelectedCoordinates = function() {
595
- return this._selectedCoordinates = [], this._emitSelectionChange = !0, this;
596
- }, x.prototype.getSelectedIds = function() {
597
- return this._selectedFeatureIds.values();
598
- }, x.prototype.getSelected = function() {
599
- var e = this;
600
- return this._selectedFeatureIds.values().map(function(t) {
601
- return e.get(t);
602
- });
603
- }, x.prototype.getSelectedCoordinates = function() {
604
- var e = this;
605
- return this._selectedCoordinates.map(function(t) {
606
- return { coordinates: e.get(t.feature_id).getCoordinate(t.coord_path) };
607
- });
608
- }, x.prototype.isSelected = function(e) {
609
- return this._selectedFeatureIds.has(e);
610
- }, x.prototype.setFeatureProperty = function(e, t, n) {
611
- this.get(e).setProperty(t, n), this.featureChanged(e);
612
- }, x.prototype.storeMapConfig = function() {
613
- var e = this;
614
- Wt.forEach(function(t) {
615
- e.ctx.map[t] && (e._mapInitialConfig[t] = e.ctx.map[t].isEnabled());
616
- });
617
- }, x.prototype.restoreMapConfig = function() {
618
- var e = this;
619
- Object.keys(this._mapInitialConfig).forEach(function(t) {
620
- e._mapInitialConfig[t] ? e.ctx.map[t].enable() : e.ctx.map[t].disable();
621
- });
622
- }, x.prototype.getInitialConfigValue = function(e) {
623
- return this._mapInitialConfig[e] === void 0 || this._mapInitialConfig[e];
624
- };
625
- var sr = function() {
626
- for (var e = arguments, t = {}, n = 0; n < arguments.length; n++) {
627
- var r = e[n];
628
- for (var o in r)
629
- ur.call(r, o) && (t[o] = r[o]);
630
- }
631
- return t;
632
- }, ur = Object.prototype.hasOwnProperty, pe = de(sr), cr = ["mode", "feature", "mouse"];
633
- function lr(e) {
634
- var t = null, n = null, r = { onRemove: function() {
635
- return e.map.off("load", r.connect), clearInterval(n), r.removeLayers(), e.store.restoreMapConfig(), e.ui.removeButtons(), e.events.removeEventListeners(), e.ui.clearMapClasses(), e.boxZoomInitial && e.map.boxZoom.enable(), e.map = null, e.container = null, e.store = null, t && t.parentNode && t.parentNode.removeChild(t), t = null, this;
636
- }, connect: function() {
637
- e.map.off("load", r.connect), clearInterval(n), r.addLayers(), e.store.storeMapConfig(), e.events.addEventListeners();
638
- }, onAdd: function(o) {
639
- var i = o.fire;
640
- return o.fire = function(a, l) {
641
- var d = arguments;
642
- return i.length === 1 && arguments.length !== 1 && (d = [pe({}, { type: a }, l)]), i.apply(o, d);
643
- }, e.map = o, e.events = function(a) {
644
- var l = Object.keys(a.options.modes).reduce(function(c, y) {
645
- return c[y] = ir(a.options.modes[y]), c;
646
- }, {}), d = {}, h = {}, g = {}, p = null, _ = null;
647
- g.drag = function(c, y) {
648
- y({ point: c.point, time: (/* @__PURE__ */ new Date()).getTime() }) ? (a.ui.queueMapClasses({ mouse: N.DRAG }), _.drag(c)) : c.originalEvent.stopPropagation();
649
- }, g.mousedrag = function(c) {
650
- g.drag(c, function(y) {
651
- return !xt(d, y);
652
- });
653
- }, g.touchdrag = function(c) {
654
- g.drag(c, function(y) {
655
- return !Mt(h, y);
656
- });
657
- }, g.mousemove = function(c) {
658
- if ((c.originalEvent.buttons !== void 0 ? c.originalEvent.buttons : c.originalEvent.which) === 1)
659
- return g.mousedrag(c);
660
- var y = Ye(c, a);
661
- c.featureTarget = y, _.mousemove(c);
662
- }, g.mousedown = function(c) {
663
- d = { time: (/* @__PURE__ */ new Date()).getTime(), point: c.point };
664
- var y = Ye(c, a);
665
- c.featureTarget = y, _.mousedown(c);
666
- }, g.mouseup = function(c) {
667
- var y = Ye(c, a);
668
- c.featureTarget = y, xt(d, { point: c.point, time: (/* @__PURE__ */ new Date()).getTime() }) ? _.click(c) : _.mouseup(c);
669
- }, g.mouseout = function(c) {
670
- _.mouseout(c);
671
- }, g.touchstart = function(c) {
672
- if (a.options.touchEnabled) {
673
- h = { time: (/* @__PURE__ */ new Date()).getTime(), point: c.point };
674
- var y = xe.touch(c, null, a)[0];
675
- c.featureTarget = y, _.touchstart(c);
676
- }
677
- }, g.touchmove = function(c) {
678
- if (a.options.touchEnabled)
679
- return _.touchmove(c), g.touchdrag(c);
680
- }, g.touchend = function(c) {
681
- if (c.originalEvent.preventDefault(), a.options.touchEnabled) {
682
- var y = xe.touch(c, null, a)[0];
683
- c.featureTarget = y, Mt(h, { time: (/* @__PURE__ */ new Date()).getTime(), point: c.point }) ? _.tap(c) : _.touchend(c);
684
- }
685
- };
686
- var A = function(c) {
687
- return !(c === 8 || c === 46 || c >= 48 && c <= 57);
688
- };
689
- function b(c, y, O) {
690
- O === void 0 && (O = {}), _.stop();
691
- var V = l[c];
692
- if (V === void 0)
693
- throw new Error(c + " is not valid");
694
- p = c;
695
- var w = V(a, y);
696
- _ = ze(w, a), O.silent || a.map.fire(H.MODE_CHANGE, { mode: c }), a.store.setDirty(), a.store.render();
697
- }
698
- g.keydown = function(c) {
699
- (c.srcElement || c.target).classList.contains("mapboxgl-canvas") && (c.keyCode !== 8 && c.keyCode !== 46 || !a.options.controls.trash ? A(c.keyCode) ? _.keydown(c) : c.keyCode === 49 && a.options.controls.point ? b(T.DRAW_POINT) : c.keyCode === 50 && a.options.controls.line_string ? b(T.DRAW_LINE_STRING) : c.keyCode === 51 && a.options.controls.polygon && b(T.DRAW_POLYGON) : (c.preventDefault(), _.trash()));
700
- }, g.keyup = function(c) {
701
- A(c.keyCode) && _.keyup(c);
702
- }, g.zoomend = function() {
703
- a.store.changeZoom();
704
- }, g.data = function(c) {
705
- if (c.dataType === "style") {
706
- var y = a.setup, O = a.map, V = a.options, w = a.store;
707
- V.styles.some(function(Ut) {
708
- return O.getLayer(Ut.id);
709
- }) || (y.addLayers(), w.setDirty(), w.render());
710
- }
711
- };
712
- var F = { trash: !1, combineFeatures: !1, uncombineFeatures: !1 };
713
- return { start: function() {
714
- p = a.options.defaultMode, _ = ze(l[p](a), a);
715
- }, changeMode: b, actionable: function(c) {
716
- var y = !1;
717
- Object.keys(c).forEach(function(O) {
718
- if (F[O] === void 0)
719
- throw new Error("Invalid action type");
720
- F[O] !== c[O] && (y = !0), F[O] = c[O];
721
- }), y && a.map.fire(H.ACTIONABLE, { actions: F });
722
- }, currentModeName: function() {
723
- return p;
724
- }, currentModeRender: function(c, y) {
725
- return _.render(c, y);
726
- }, fire: function(c, y) {
727
- g[c] && g[c](y);
728
- }, addEventListeners: function() {
729
- a.map.on("mousemove", g.mousemove), a.map.on("mousedown", g.mousedown), a.map.on("mouseup", g.mouseup), a.map.on("data", g.data), a.map.on("touchmove", g.touchmove), a.map.on("touchstart", g.touchstart), a.map.on("touchend", g.touchend), a.container.addEventListener("mouseout", g.mouseout), a.options.keybindings && (a.container.addEventListener("keydown", g.keydown), a.container.addEventListener("keyup", g.keyup));
730
- }, removeEventListeners: function() {
731
- a.map.off("mousemove", g.mousemove), a.map.off("mousedown", g.mousedown), a.map.off("mouseup", g.mouseup), a.map.off("data", g.data), a.map.off("touchmove", g.touchmove), a.map.off("touchstart", g.touchstart), a.map.off("touchend", g.touchend), a.container.removeEventListener("mouseout", g.mouseout), a.options.keybindings && (a.container.removeEventListener("keydown", g.keydown), a.container.removeEventListener("keyup", g.keyup));
732
- }, trash: function(c) {
733
- _.trash(c);
734
- }, combineFeatures: function() {
735
- _.combineFeatures();
736
- }, uncombineFeatures: function() {
737
- _.uncombineFeatures();
738
- }, getMode: function() {
739
- return p;
740
- } };
741
- }(e), e.ui = /* @__PURE__ */ function(a) {
742
- var l = {}, d = null, h = { mode: null, feature: null, mouse: null }, g = { mode: null, feature: null, mouse: null };
743
- function p(c) {
744
- g = pe(g, c);
745
- }
746
- function _() {
747
- var c, y;
748
- if (a.container) {
749
- var O = [], V = [];
750
- cr.forEach(function(w) {
751
- g[w] !== h[w] && (O.push(w + "-" + h[w]), g[w] !== null && V.push(w + "-" + g[w]));
752
- }), O.length > 0 && (c = a.container.classList).remove.apply(c, O), V.length > 0 && (y = a.container.classList).add.apply(y, V), h = pe(h, g);
753
- }
754
- }
755
- function A(c, y) {
756
- y === void 0 && (y = {});
757
- var O = document.createElement("button");
758
- return O.className = q.CONTROL_BUTTON + " " + y.className, O.setAttribute("title", y.title), y.container.appendChild(O), O.addEventListener("click", function(V) {
759
- if (V.preventDefault(), V.stopPropagation(), V.target === d)
760
- return b(), void y.onDeactivate();
761
- F(c), y.onActivate();
762
- }, !0), O;
763
- }
764
- function b() {
765
- d && (d.classList.remove(q.ACTIVE_BUTTON), d = null);
766
- }
767
- function F(c) {
768
- b();
769
- var y = l[c];
770
- y && y && c !== "trash" && (y.classList.add(q.ACTIVE_BUTTON), d = y);
771
- }
772
- return { setActiveButton: F, queueMapClasses: p, updateMapClasses: _, clearMapClasses: function() {
773
- p({ mode: null, feature: null, mouse: null }), _();
774
- }, addButtons: function() {
775
- var c = a.options.controls, y = document.createElement("div");
776
- return y.className = q.CONTROL_GROUP + " " + q.CONTROL_BASE, c && (c[Y.LINE] && (l[Y.LINE] = A(Y.LINE, { container: y, className: q.CONTROL_BUTTON_LINE, title: "LineString tool " + (a.options.keybindings ? "(l)" : ""), onActivate: function() {
777
- return a.events.changeMode(T.DRAW_LINE_STRING);
778
- }, onDeactivate: function() {
779
- return a.events.trash();
780
- } })), c[Y.POLYGON] && (l[Y.POLYGON] = A(Y.POLYGON, { container: y, className: q.CONTROL_BUTTON_POLYGON, title: "Polygon tool " + (a.options.keybindings ? "(p)" : ""), onActivate: function() {
781
- return a.events.changeMode(T.DRAW_POLYGON);
782
- }, onDeactivate: function() {
783
- return a.events.trash();
784
- } })), c[Y.POINT] && (l[Y.POINT] = A(Y.POINT, { container: y, className: q.CONTROL_BUTTON_POINT, title: "Marker tool " + (a.options.keybindings ? "(m)" : ""), onActivate: function() {
785
- return a.events.changeMode(T.DRAW_POINT);
786
- }, onDeactivate: function() {
787
- return a.events.trash();
788
- } })), c.trash && (l.trash = A("trash", { container: y, className: q.CONTROL_BUTTON_TRASH, title: "Delete", onActivate: function() {
789
- a.events.trash();
790
- } })), c.combine_features && (l.combine_features = A("combineFeatures", { container: y, className: q.CONTROL_BUTTON_COMBINE_FEATURES, title: "Combine", onActivate: function() {
791
- a.events.combineFeatures();
792
- } })), c.uncombine_features && (l.uncombine_features = A("uncombineFeatures", { container: y, className: q.CONTROL_BUTTON_UNCOMBINE_FEATURES, title: "Uncombine", onActivate: function() {
793
- a.events.uncombineFeatures();
794
- } }))), y;
795
- }, removeButtons: function() {
796
- Object.keys(l).forEach(function(c) {
797
- var y = l[c];
798
- y.parentNode && y.parentNode.removeChild(y), delete l[c];
799
- });
800
- } };
801
- }(e), e.container = o.getContainer(), e.store = new x(e), t = e.ui.addButtons(), e.options.boxSelect && (e.boxZoomInitial = o.boxZoom.isEnabled(), o.boxZoom.disable(), o.dragPan.disable(), o.dragPan.enable()), o.loaded() ? r.connect() : (o.on("load", r.connect), n = setInterval(function() {
802
- o.loaded() && r.connect();
803
- }, 16)), e.events.start(), t;
804
- }, addLayers: function() {
805
- e.map.addSource(X.COLD, { data: { type: m.FEATURE_COLLECTION, features: [] }, type: "geojson" }), e.map.addSource(X.HOT, { data: { type: m.FEATURE_COLLECTION, features: [] }, type: "geojson" }), e.options.styles.forEach(function(o) {
806
- e.map.addLayer(o);
807
- }), e.store.setDirty(!0), e.store.render();
808
- }, removeLayers: function() {
809
- e.options.styles.forEach(function(o) {
810
- e.map.getLayer(o.id) && e.map.removeLayer(o.id);
811
- }), e.map.getSource(X.COLD) && e.map.removeSource(X.COLD), e.map.getSource(X.HOT) && e.map.removeSource(X.HOT);
812
- } };
813
- return e.setup = r, r;
814
- }
815
- var an = [{ id: "gl-draw-polygon-fill-inactive", type: "fill", filter: ["all", ["==", "active", "false"], ["==", "$type", "Polygon"], ["!=", "mode", "static"]], paint: { "fill-color": "#3bb2d0", "fill-outline-color": "#3bb2d0", "fill-opacity": 0.1 } }, { id: "gl-draw-polygon-fill-active", type: "fill", filter: ["all", ["==", "active", "true"], ["==", "$type", "Polygon"]], paint: { "fill-color": "#fbb03b", "fill-outline-color": "#fbb03b", "fill-opacity": 0.1 } }, { id: "gl-draw-polygon-midpoint", type: "circle", filter: ["all", ["==", "$type", "Point"], ["==", "meta", "midpoint"]], paint: { "circle-radius": 3, "circle-color": "#fbb03b" } }, { id: "gl-draw-polygon-stroke-inactive", type: "line", filter: ["all", ["==", "active", "false"], ["==", "$type", "Polygon"], ["!=", "mode", "static"]], layout: { "line-cap": "round", "line-join": "round" }, paint: { "line-color": "#3bb2d0", "line-width": 2 } }, { id: "gl-draw-polygon-stroke-active", type: "line", filter: ["all", ["==", "active", "true"], ["==", "$type", "Polygon"]], layout: { "line-cap": "round", "line-join": "round" }, paint: { "line-color": "#fbb03b", "line-dasharray": [0.2, 2], "line-width": 2 } }, { id: "gl-draw-line-inactive", type: "line", filter: ["all", ["==", "active", "false"], ["==", "$type", "LineString"], ["!=", "mode", "static"]], layout: { "line-cap": "round", "line-join": "round" }, paint: { "line-color": "#3bb2d0", "line-width": 2 } }, { id: "gl-draw-line-active", type: "line", filter: ["all", ["==", "$type", "LineString"], ["==", "active", "true"]], layout: { "line-cap": "round", "line-join": "round" }, paint: { "line-color": "#fbb03b", "line-dasharray": [0.2, 2], "line-width": 2 } }, { id: "gl-draw-polygon-and-line-vertex-stroke-inactive", type: "circle", filter: ["all", ["==", "meta", "vertex"], ["==", "$type", "Point"], ["!=", "mode", "static"]], paint: { "circle-radius": 5, "circle-color": "#fff" } }, { id: "gl-draw-polygon-and-line-vertex-inactive", type: "circle", filter: ["all", ["==", "meta", "vertex"], ["==", "$type", "Point"], ["!=", "mode", "static"]], paint: { "circle-radius": 3, "circle-color": "#fbb03b" } }, { id: "gl-draw-point-point-stroke-inactive", type: "circle", filter: ["all", ["==", "active", "false"], ["==", "$type", "Point"], ["==", "meta", "feature"], ["!=", "mode", "static"]], paint: { "circle-radius": 5, "circle-opacity": 1, "circle-color": "#fff" } }, { id: "gl-draw-point-inactive", type: "circle", filter: ["all", ["==", "active", "false"], ["==", "$type", "Point"], ["==", "meta", "feature"], ["!=", "mode", "static"]], paint: { "circle-radius": 3, "circle-color": "#3bb2d0" } }, { id: "gl-draw-point-stroke-active", type: "circle", filter: ["all", ["==", "$type", "Point"], ["==", "active", "true"], ["!=", "meta", "midpoint"]], paint: { "circle-radius": 7, "circle-color": "#fff" } }, { id: "gl-draw-point-active", type: "circle", filter: ["all", ["==", "$type", "Point"], ["!=", "meta", "midpoint"], ["==", "active", "true"]], paint: { "circle-radius": 5, "circle-color": "#fbb03b" } }, { id: "gl-draw-polygon-fill-static", type: "fill", filter: ["all", ["==", "mode", "static"], ["==", "$type", "Polygon"]], paint: { "fill-color": "#404040", "fill-outline-color": "#404040", "fill-opacity": 0.1 } }, { id: "gl-draw-polygon-stroke-static", type: "line", filter: ["all", ["==", "mode", "static"], ["==", "$type", "Polygon"]], layout: { "line-cap": "round", "line-join": "round" }, paint: { "line-color": "#404040", "line-width": 2 } }, { id: "gl-draw-line-static", type: "line", filter: ["all", ["==", "mode", "static"], ["==", "$type", "LineString"]], layout: { "line-cap": "round", "line-join": "round" }, paint: { "line-color": "#404040", "line-width": 2 } }, { id: "gl-draw-point-static", type: "circle", filter: ["all", ["==", "mode", "static"], ["==", "$type", "Point"]], paint: { "circle-radius": 5, "circle-color": "#404040" } }];
816
- function qe(e) {
817
- return function(t) {
818
- var n = t.featureTarget;
819
- return !!n && !!n.properties && n.properties.meta === e;
820
- };
821
- }
822
- function sn(e) {
823
- return !!e.originalEvent && !!e.originalEvent.shiftKey && e.originalEvent.button === 0;
824
- }
825
- function _e(e) {
826
- return !!e.featureTarget && !!e.featureTarget.properties && e.featureTarget.properties.active === j.ACTIVE && e.featureTarget.properties.meta === B.FEATURE;
827
- }
828
- function At(e) {
829
- return !!e.featureTarget && !!e.featureTarget.properties && e.featureTarget.properties.active === j.INACTIVE && e.featureTarget.properties.meta === B.FEATURE;
830
- }
831
- function He(e) {
832
- return e.featureTarget === void 0;
833
- }
834
- function Pt(e) {
835
- return !!e.featureTarget && !!e.featureTarget.properties && e.featureTarget.properties.meta === B.FEATURE;
836
- }
837
- function De(e) {
838
- var t = e.featureTarget;
839
- return !!t && !!t.properties && t.properties.meta === B.VERTEX;
840
- }
841
- function Xe(e) {
842
- return !!e.originalEvent && e.originalEvent.shiftKey === !0;
843
- }
844
- function Ze(e) {
845
- return e.keyCode === 27;
846
- }
847
- function We(e) {
848
- return e.keyCode === 13;
849
- }
850
- var dr = Object.freeze({ __proto__: null, isOfMetaType: qe, isShiftMousedown: sn, isActiveFeature: _e, isInactiveFeature: At, noTarget: He, isFeature: Pt, isVertex: De, isShiftDown: Xe, isEscapeKey: Ze, isEnterKey: We, isTrue: function() {
851
- return !0;
852
- } }), pr = Me;
853
- function Me(e, t) {
854
- this.x = e, this.y = t;
855
- }
856
- Me.prototype = { clone: function() {
857
- return new Me(this.x, this.y);
858
- }, add: function(e) {
859
- return this.clone()._add(e);
860
- }, sub: function(e) {
861
- return this.clone()._sub(e);
862
- }, multByPoint: function(e) {
863
- return this.clone()._multByPoint(e);
864
- }, divByPoint: function(e) {
865
- return this.clone()._divByPoint(e);
866
- }, mult: function(e) {
867
- return this.clone()._mult(e);
868
- }, div: function(e) {
869
- return this.clone()._div(e);
870
- }, rotate: function(e) {
871
- return this.clone()._rotate(e);
872
- }, rotateAround: function(e, t) {
873
- return this.clone()._rotateAround(e, t);
874
- }, matMult: function(e) {
875
- return this.clone()._matMult(e);
876
- }, unit: function() {
877
- return this.clone()._unit();
878
- }, perp: function() {
879
- return this.clone()._perp();
880
- }, round: function() {
881
- return this.clone()._round();
882
- }, mag: function() {
883
- return Math.sqrt(this.x * this.x + this.y * this.y);
884
- }, equals: function(e) {
885
- return this.x === e.x && this.y === e.y;
886
- }, dist: function(e) {
887
- return Math.sqrt(this.distSqr(e));
888
- }, distSqr: function(e) {
889
- var t = e.x - this.x, n = e.y - this.y;
890
- return t * t + n * n;
891
- }, angle: function() {
892
- return Math.atan2(this.y, this.x);
893
- }, angleTo: function(e) {
894
- return Math.atan2(this.y - e.y, this.x - e.x);
895
- }, angleWith: function(e) {
896
- return this.angleWithSep(e.x, e.y);
897
- }, angleWithSep: function(e, t) {
898
- return Math.atan2(this.x * t - this.y * e, this.x * e + this.y * t);
899
- }, _matMult: function(e) {
900
- var t = e[0] * this.x + e[1] * this.y, n = e[2] * this.x + e[3] * this.y;
901
- return this.x = t, this.y = n, this;
902
- }, _add: function(e) {
903
- return this.x += e.x, this.y += e.y, this;
904
- }, _sub: function(e) {
905
- return this.x -= e.x, this.y -= e.y, this;
906
- }, _mult: function(e) {
907
- return this.x *= e, this.y *= e, this;
908
- }, _div: function(e) {
909
- return this.x /= e, this.y /= e, this;
910
- }, _multByPoint: function(e) {
911
- return this.x *= e.x, this.y *= e.y, this;
912
- }, _divByPoint: function(e) {
913
- return this.x /= e.x, this.y /= e.y, this;
914
- }, _unit: function() {
915
- return this._div(this.mag()), this;
916
- }, _perp: function() {
917
- var e = this.y;
918
- return this.y = this.x, this.x = -e, this;
919
- }, _rotate: function(e) {
920
- var t = Math.cos(e), n = Math.sin(e), r = t * this.x - n * this.y, o = n * this.x + t * this.y;
921
- return this.x = r, this.y = o, this;
922
- }, _rotateAround: function(e, t) {
923
- var n = Math.cos(e), r = Math.sin(e), o = t.x + n * (this.x - t.x) - r * (this.y - t.y), i = t.y + r * (this.x - t.x) + n * (this.y - t.y);
924
- return this.x = o, this.y = i, this;
925
- }, _round: function() {
926
- return this.x = Math.round(this.x), this.y = Math.round(this.y), this;
927
- } }, Me.convert = function(e) {
928
- return e instanceof Me ? e : Array.isArray(e) ? new Me(e[0], e[1]) : e;
929
- };
930
- var fr = de(pr);
931
- function Ft(e, t) {
932
- var n = t.getBoundingClientRect();
933
- return new fr(e.clientX - n.left - (t.clientLeft || 0), e.clientY - n.top - (t.clientTop || 0));
934
- }
935
- function Le(e, t, n, r) {
936
- return { type: m.FEATURE, properties: { meta: B.VERTEX, parent: e, coord_path: n, active: r ? j.ACTIVE : j.INACTIVE }, geometry: { type: m.POINT, coordinates: t } };
937
- }
938
- function un(e, t, n) {
939
- var r = t.geometry.coordinates, o = n.geometry.coordinates;
940
- if (r[1] > 85 || r[1] < St || o[1] > 85 || o[1] < St)
941
- return null;
942
- var i = { lng: (r[0] + o[0]) / 2, lat: (r[1] + o[1]) / 2 };
943
- return { type: m.FEATURE, properties: { meta: B.MIDPOINT, parent: e, lng: i.lng, lat: i.lat, coord_path: n.properties.coord_path }, geometry: { type: m.POINT, coordinates: [i.lng, i.lat] } };
944
- }
945
- function Ke(e, t, n) {
946
- t === void 0 && (t = {}), n === void 0 && (n = null);
947
- var r, o = e.geometry, i = o.type, a = o.coordinates, l = e.properties && e.properties.id, d = [];
948
- function h(p, _) {
949
- var A = "", b = null;
950
- p.forEach(function(F, c) {
951
- var y = _ != null ? _ + "." + c : String(c), O = Le(l, F, y, g(y));
952
- if (t.midpoints && b) {
953
- var V = un(l, b, O);
954
- V && d.push(V);
955
- }
956
- b = O;
957
- var w = JSON.stringify(F);
958
- A !== w && d.push(O), c === 0 && (A = w);
959
- });
960
- }
961
- function g(p) {
962
- return !!t.selectedPaths && t.selectedPaths.indexOf(p) !== -1;
963
- }
964
- return i === m.POINT ? d.push(Le(l, a, n, g(n))) : i === m.POLYGON ? a.forEach(function(p, _) {
965
- h(p, n !== null ? n + "." + _ : String(_));
966
- }) : i === m.LINE_STRING ? h(a, n) : i.indexOf(m.MULTI_PREFIX) === 0 && (r = i.replace(m.MULTI_PREFIX, ""), a.forEach(function(p, _) {
967
- var A = { type: m.FEATURE, properties: e.properties, geometry: { type: r, coordinates: p } };
968
- d = d.concat(Ke(A, t, _));
969
- })), d;
970
- }
971
- var ee = { enable: function(e) {
972
- setTimeout(function() {
973
- e.map && e.map.doubleClickZoom && e._ctx && e._ctx.store && e._ctx.store.getInitialConfigValue && e._ctx.store.getInitialConfigValue("doubleClickZoom") && e.map.doubleClickZoom.enable();
974
- }, 0);
975
- }, disable: function(e) {
976
- setTimeout(function() {
977
- e.map && e.map.doubleClickZoom && e.map.doubleClickZoom.disable();
978
- }, 0);
979
- } }, Qe = { exports: {} }, cn = function(e) {
980
- if (!e || !e.type)
981
- return null;
982
- var t = hr[e.type];
983
- if (!t)
984
- return null;
985
- if (t === "geometry")
986
- return { type: "FeatureCollection", features: [{ type: "Feature", properties: {}, geometry: e }] };
987
- if (t === "feature")
988
- return { type: "FeatureCollection", features: [e] };
989
- if (t === "featurecollection")
990
- return e;
991
- }, hr = { Point: "geometry", MultiPoint: "geometry", LineString: "geometry", MultiLineString: "geometry", Polygon: "geometry", MultiPolygon: "geometry", GeometryCollection: "geometry", Feature: "feature", FeatureCollection: "featurecollection" }, gr = de(cn), yr = Object.freeze({ __proto__: null, default: function e(t) {
992
- switch (t && t.type || null) {
993
- case "FeatureCollection":
994
- return t.features = t.features.reduce(function(n, r) {
995
- return n.concat(e(r));
996
- }, []), t;
997
- case "Feature":
998
- return t.geometry ? e(t.geometry).map(function(n) {
999
- var r = { type: "Feature", properties: JSON.parse(JSON.stringify(t.properties)), geometry: n };
1000
- return t.id !== void 0 && (r.id = t.id), r;
1001
- }) : [t];
1002
- case "MultiPoint":
1003
- return t.coordinates.map(function(n) {
1004
- return { type: "Point", coordinates: n };
1005
- });
1006
- case "MultiPolygon":
1007
- return t.coordinates.map(function(n) {
1008
- return { type: "Polygon", coordinates: n };
1009
- });
1010
- case "MultiLineString":
1011
- return t.coordinates.map(function(n) {
1012
- return { type: "LineString", coordinates: n };
1013
- });
1014
- case "GeometryCollection":
1015
- return t.geometries.map(e).reduce(function(n, r) {
1016
- return n.concat(r);
1017
- }, []);
1018
- case "Point":
1019
- case "Polygon":
1020
- case "LineString":
1021
- return [t];
1022
- }
1023
- } }), vr = cn, et = Kn(yr), mr = function(e) {
1024
- return function t(n) {
1025
- return Array.isArray(n) && n.length && typeof n[0] == "number" ? [n] : n.reduce(function(r, o) {
1026
- return Array.isArray(o) && Array.isArray(o[0]) ? r.concat(t(o)) : (r.push(o), r);
1027
- }, []);
1028
- }(e);
1029
- };
1030
- et instanceof Function || (et = et.default);
1031
- var ln = { exports: {} }, _r = ln.exports = function(e) {
1032
- return new K(e);
1033
- };
1034
- function K(e) {
1035
- this.value = e;
1036
- }
1037
- function dn(e, t, n) {
1038
- var r = [], o = [], i = !0;
1039
- return function a(l) {
1040
- var d = n ? pn(l) : l, h = {}, g = !0, p = { node: d, node_: l, path: [].concat(r), parent: o[o.length - 1], parents: o, key: r.slice(-1)[0], isRoot: r.length === 0, level: r.length, circular: null, update: function(b, F) {
1041
- p.isRoot || (p.parent.node[p.key] = b), p.node = b, F && (g = !1);
1042
- }, delete: function(b) {
1043
- delete p.parent.node[p.key], b && (g = !1);
1044
- }, remove: function(b) {
1045
- fn(p.parent.node) ? p.parent.node.splice(p.key, 1) : delete p.parent.node[p.key], b && (g = !1);
1046
- }, keys: null, before: function(b) {
1047
- h.before = b;
1048
- }, after: function(b) {
1049
- h.after = b;
1050
- }, pre: function(b) {
1051
- h.pre = b;
1052
- }, post: function(b) {
1053
- h.post = b;
1054
- }, stop: function() {
1055
- i = !1;
1056
- }, block: function() {
1057
- g = !1;
1058
- } };
1059
- if (!i)
1060
- return p;
1061
- function _() {
1062
- if (typeof p.node == "object" && p.node !== null) {
1063
- p.keys && p.node_ === p.node || (p.keys = tt(p.node)), p.isLeaf = p.keys.length == 0;
1064
- for (var b = 0; b < o.length; b++)
1065
- if (o[b].node_ === l) {
1066
- p.circular = o[b];
1067
- break;
1068
- }
1069
- } else
1070
- p.isLeaf = !0, p.keys = null;
1071
- p.notLeaf = !p.isLeaf, p.notRoot = !p.isRoot;
1072
- }
1073
- _();
1074
- var A = t.call(p, p.node);
1075
- return A !== void 0 && p.update && p.update(A), h.before && h.before.call(p, p.node), g && (typeof p.node != "object" || p.node === null || p.circular || (o.push(p), _(), nt(p.keys, function(b, F) {
1076
- r.push(b), h.pre && h.pre.call(p, p.node[b], b);
1077
- var c = a(p.node[b]);
1078
- n && rt.call(p.node, b) && (p.node[b] = c.node), c.isLast = F == p.keys.length - 1, c.isFirst = F == 0, h.post && h.post.call(p, c), r.pop();
1079
- }), o.pop()), h.after && h.after.call(p, p.node)), p;
1080
- }(e).node;
1081
- }
1082
- function pn(e) {
1083
- if (typeof e == "object" && e !== null) {
1084
- var t;
1085
- if (fn(e))
1086
- t = [];
1087
- else if (Ne(e) === "[object Date]")
1088
- t = new Date(e.getTime ? e.getTime() : e);
1089
- else if (function(o) {
1090
- return Ne(o) === "[object RegExp]";
1091
- }(e))
1092
- t = new RegExp(e);
1093
- else if (function(o) {
1094
- return Ne(o) === "[object Error]";
1095
- }(e))
1096
- t = { message: e.message };
1097
- else if (function(o) {
1098
- return Ne(o) === "[object Boolean]";
1099
- }(e))
1100
- t = new Boolean(e);
1101
- else if (function(o) {
1102
- return Ne(o) === "[object Number]";
1103
- }(e))
1104
- t = new Number(e);
1105
- else if (function(o) {
1106
- return Ne(o) === "[object String]";
1107
- }(e))
1108
- t = new String(e);
1109
- else if (Object.create && Object.getPrototypeOf)
1110
- t = Object.create(Object.getPrototypeOf(e));
1111
- else if (e.constructor === Object)
1112
- t = {};
1113
- else {
1114
- var n = e.constructor && e.constructor.prototype || e.__proto__ || {}, r = function() {
1115
- };
1116
- r.prototype = n, t = new r();
1117
- }
1118
- return nt(tt(e), function(o) {
1119
- t[o] = e[o];
1120
- }), t;
1121
- }
1122
- return e;
1123
- }
1124
- K.prototype.get = function(e) {
1125
- for (var t = this.value, n = 0; n < e.length; n++) {
1126
- var r = e[n];
1127
- if (!t || !rt.call(t, r)) {
1128
- t = void 0;
1129
- break;
1130
- }
1131
- t = t[r];
1132
- }
1133
- return t;
1134
- }, K.prototype.has = function(e) {
1135
- for (var t = this.value, n = 0; n < e.length; n++) {
1136
- var r = e[n];
1137
- if (!t || !rt.call(t, r))
1138
- return !1;
1139
- t = t[r];
1140
- }
1141
- return !0;
1142
- }, K.prototype.set = function(e, t) {
1143
- for (var n = this.value, r = 0; r < e.length - 1; r++) {
1144
- var o = e[r];
1145
- rt.call(n, o) || (n[o] = {}), n = n[o];
1146
- }
1147
- return n[e[r]] = t, t;
1148
- }, K.prototype.map = function(e) {
1149
- return dn(this.value, e, !0);
1150
- }, K.prototype.forEach = function(e) {
1151
- return this.value = dn(this.value, e, !1), this.value;
1152
- }, K.prototype.reduce = function(e, t) {
1153
- var n = arguments.length === 1, r = n ? this.value : t;
1154
- return this.forEach(function(o) {
1155
- this.isRoot && n || (r = e.call(this, r, o));
1156
- }), r;
1157
- }, K.prototype.paths = function() {
1158
- var e = [];
1159
- return this.forEach(function(t) {
1160
- e.push(this.path);
1161
- }), e;
1162
- }, K.prototype.nodes = function() {
1163
- var e = [];
1164
- return this.forEach(function(t) {
1165
- e.push(this.node);
1166
- }), e;
1167
- }, K.prototype.clone = function() {
1168
- var e = [], t = [];
1169
- return function n(r) {
1170
- for (var o = 0; o < e.length; o++)
1171
- if (e[o] === r)
1172
- return t[o];
1173
- if (typeof r == "object" && r !== null) {
1174
- var i = pn(r);
1175
- return e.push(r), t.push(i), nt(tt(r), function(a) {
1176
- i[a] = n(r[a]);
1177
- }), e.pop(), t.pop(), i;
1178
- }
1179
- return r;
1180
- }(this.value);
1181
- };
1182
- var tt = Object.keys || function(e) {
1183
- var t = [];
1184
- for (var n in e)
1185
- t.push(n);
1186
- return t;
1187
- };
1188
- function Ne(e) {
1189
- return Object.prototype.toString.call(e);
1190
- }
1191
- var fn = Array.isArray || function(e) {
1192
- return Object.prototype.toString.call(e) === "[object Array]";
1193
- }, nt = function(e, t) {
1194
- if (e.forEach)
1195
- return e.forEach(t);
1196
- for (var n = 0; n < e.length; n++)
1197
- t(e[n], n, e);
1198
- };
1199
- nt(tt(K.prototype), function(e) {
1200
- _r[e] = function(t) {
1201
- var n = [].slice.call(arguments, 1), r = new K(t);
1202
- return r[e].apply(r, n);
1203
- };
1204
- });
1205
- var rt = Object.hasOwnProperty || function(e, t) {
1206
- return t in e;
1207
- }, br = ln.exports, Er = J;
1208
- function J(e) {
1209
- if (!(this instanceof J))
1210
- return new J(e);
1211
- this._bbox = e || [1 / 0, 1 / 0, -1 / 0, -1 / 0], this._valid = !!e;
1212
- }
1213
- J.prototype.include = function(e) {
1214
- return this._valid = !0, this._bbox[0] = Math.min(this._bbox[0], e[0]), this._bbox[1] = Math.min(this._bbox[1], e[1]), this._bbox[2] = Math.max(this._bbox[2], e[0]), this._bbox[3] = Math.max(this._bbox[3], e[1]), this;
1215
- }, J.prototype.equals = function(e) {
1216
- var t;
1217
- return t = e instanceof J ? e.bbox() : e, this._bbox[0] == t[0] && this._bbox[1] == t[1] && this._bbox[2] == t[2] && this._bbox[3] == t[3];
1218
- }, J.prototype.center = function(e) {
1219
- return this._valid ? [(this._bbox[0] + this._bbox[2]) / 2, (this._bbox[1] + this._bbox[3]) / 2] : null;
1220
- }, J.prototype.union = function(e) {
1221
- var t;
1222
- return this._valid = !0, t = e instanceof J ? e.bbox() : e, this._bbox[0] = Math.min(this._bbox[0], t[0]), this._bbox[1] = Math.min(this._bbox[1], t[1]), this._bbox[2] = Math.max(this._bbox[2], t[2]), this._bbox[3] = Math.max(this._bbox[3], t[3]), this;
1223
- }, J.prototype.bbox = function() {
1224
- return this._valid ? this._bbox : null;
1225
- }, J.prototype.contains = function(e) {
1226
- if (!e)
1227
- return this._fastContains();
1228
- if (!this._valid)
1229
- return null;
1230
- var t = e[0], n = e[1];
1231
- return this._bbox[0] <= t && this._bbox[1] <= n && this._bbox[2] >= t && this._bbox[3] >= n;
1232
- }, J.prototype.intersect = function(e) {
1233
- return this._valid ? (t = e instanceof J ? e.bbox() : e, !(this._bbox[0] > t[2] || this._bbox[2] < t[0] || this._bbox[3] < t[1] || this._bbox[1] > t[3])) : null;
1234
- var t;
1235
- }, J.prototype._fastContains = function() {
1236
- if (!this._valid)
1237
- return new Function("return null;");
1238
- var e = "return " + this._bbox[0] + "<= ll[0] &&" + this._bbox[1] + "<= ll[1] &&" + this._bbox[2] + ">= ll[0] &&" + this._bbox[3] + ">= ll[1]";
1239
- return new Function("ll", e);
1240
- }, J.prototype.polygon = function() {
1241
- return this._valid ? { type: "Polygon", coordinates: [[[this._bbox[0], this._bbox[1]], [this._bbox[2], this._bbox[1]], [this._bbox[2], this._bbox[3]], [this._bbox[0], this._bbox[3]], [this._bbox[0], this._bbox[1]]]] } : null;
1242
- };
1243
- var Tr = function(e) {
1244
- if (!e)
1245
- return [];
1246
- var t = et(vr(e)), n = [];
1247
- return t.features.forEach(function(r) {
1248
- r.geometry && (n = n.concat(mr(r.geometry.coordinates)));
1249
- }), n;
1250
- }, Cr = br, Or = Er, hn = { features: ["FeatureCollection"], coordinates: ["Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon"], geometry: ["Feature"], geometries: ["GeometryCollection"] }, Sr = Object.keys(hn);
1251
- function wt(e) {
1252
- for (var t = Or(), n = Tr(e), r = 0; r < n.length; r++)
1253
- t.include(n[r]);
1254
- return t;
1255
- }
1256
- Qe.exports = function(e) {
1257
- return wt(e).bbox();
1258
- }, Qe.exports.polygon = function(e) {
1259
- return wt(e).polygon();
1260
- }, Qe.exports.bboxify = function(e) {
1261
- return Cr(e).map(function(t) {
1262
- t && Sr.some(function(n) {
1263
- return !!t[n] && hn[n].indexOf(t.type) !== -1;
1264
- }) && (t.bbox = wt(t).bbox(), this.update(t));
1265
- });
1266
- };
1267
- var Ir = de(Qe.exports), ot = -90;
1268
- function Rt(e, t) {
1269
- var n = ot, r = 90, o = ot, i = 90, a = 270, l = -270;
1270
- e.forEach(function(h) {
1271
- var g = Ir(h), p = g[1], _ = g[3], A = g[0], b = g[2];
1272
- p > n && (n = p), _ < r && (r = _), _ > o && (o = _), p < i && (i = p), A < a && (a = A), b > l && (l = b);
1273
- });
1274
- var d = t;
1275
- return n + d.lat > 85 && (d.lat = 85 - n), o + d.lat > 90 && (d.lat = 90 - o), r + d.lat < -85 && (d.lat = -85 - r), i + d.lat < ot && (d.lat = ot - i), a + d.lng <= -270 && (d.lng += 360 * Math.ceil(Math.abs(d.lng) / 360)), l + d.lng >= 270 && (d.lng -= 360 * Math.ceil(Math.abs(d.lng) / 360)), d;
1276
- }
1277
- function Dt(e, t) {
1278
- var n = Rt(e.map(function(r) {
1279
- return r.toGeoJSON();
1280
- }), t);
1281
- e.forEach(function(r) {
1282
- var o, i = r.getCoordinates(), a = function(d) {
1283
- var h = { lng: d[0] + n.lng, lat: d[1] + n.lat };
1284
- return [h.lng, h.lat];
1285
- }, l = function(d) {
1286
- return d.map(function(h) {
1287
- return a(h);
1288
- });
1289
- };
1290
- r.type === m.POINT ? o = a(i) : r.type === m.LINE_STRING || r.type === m.MULTI_POINT ? o = i.map(a) : r.type === m.POLYGON || r.type === m.MULTI_LINE_STRING ? o = i.map(l) : r.type === m.MULTI_POLYGON && (o = i.map(function(d) {
1291
- return d.map(function(h) {
1292
- return l(h);
1293
- });
1294
- })), r.incomingCoords(o);
1295
- });
1296
- }
1297
- var D = { onSetup: function(e) {
1298
- var t = this, n = { dragMoveLocation: null, boxSelectStartLocation: null, boxSelectElement: void 0, boxSelecting: !1, canBoxSelect: !1, dragMoving: !1, canDragMove: !1, initiallySelectedFeatureIds: e.featureIds || [] };
1299
- return this.setSelected(n.initiallySelectedFeatureIds.filter(function(r) {
1300
- return t.getFeature(r) !== void 0;
1301
- })), this.fireActionable(), this.setActionableState({ combineFeatures: !0, uncombineFeatures: !0, trash: !0 }), n;
1302
- }, fireUpdate: function() {
1303
- this.map.fire(H.UPDATE, { action: Ot.MOVE, features: this.getSelected().map(function(e) {
1304
- return e.toGeoJSON();
1305
- }) });
1306
- }, fireActionable: function() {
1307
- var e = this, t = this.getSelected(), n = t.filter(function(l) {
1308
- return e.isInstanceOf("MultiFeature", l);
1309
- }), r = !1;
1310
- if (t.length > 1) {
1311
- r = !0;
1312
- var o = t[0].type.replace("Multi", "");
1313
- t.forEach(function(l) {
1314
- l.type.replace("Multi", "") !== o && (r = !1);
1315
- });
1316
- }
1317
- var i = n.length > 0, a = t.length > 0;
1318
- this.setActionableState({ combineFeatures: r, uncombineFeatures: i, trash: a });
1319
- }, getUniqueIds: function(e) {
1320
- return e.length ? e.map(function(t) {
1321
- return t.properties.id;
1322
- }).filter(function(t) {
1323
- return t !== void 0;
1324
- }).reduce(function(t, n) {
1325
- return t.add(n), t;
1326
- }, new Z()).values() : [];
1327
- }, stopExtendedInteractions: function(e) {
1328
- e.boxSelectElement && (e.boxSelectElement.parentNode && e.boxSelectElement.parentNode.removeChild(e.boxSelectElement), e.boxSelectElement = null), this.map.dragPan.enable(), e.boxSelecting = !1, e.canBoxSelect = !1, e.dragMoving = !1, e.canDragMove = !1;
1329
- }, onStop: function() {
1330
- ee.enable(this);
1331
- }, onMouseMove: function(e, t) {
1332
- return Pt(t) && e.dragMoving && this.fireUpdate(), this.stopExtendedInteractions(e), !0;
1333
- }, onMouseOut: function(e) {
1334
- return !e.dragMoving || this.fireUpdate();
1335
- } };
1336
- D.onTap = D.onClick = function(e, t) {
1337
- return He(t) ? this.clickAnywhere(e, t) : qe(B.VERTEX)(t) ? this.clickOnVertex(e, t) : Pt(t) ? this.clickOnFeature(e, t) : void 0;
1338
- }, D.clickAnywhere = function(e) {
1339
- var t = this, n = this.getSelectedIds();
1340
- n.length && (this.clearSelectedFeatures(), n.forEach(function(r) {
1341
- return t.doRender(r);
1342
- })), ee.enable(this), this.stopExtendedInteractions(e);
1343
- }, D.clickOnVertex = function(e, t) {
1344
- this.changeMode(T.DIRECT_SELECT, { featureId: t.featureTarget.properties.parent, coordPath: t.featureTarget.properties.coord_path, startPos: t.lngLat }), this.updateUIClasses({ mouse: N.MOVE });
1345
- }, D.startOnActiveFeature = function(e, t) {
1346
- this.stopExtendedInteractions(e), this.map.dragPan.disable(), this.doRender(t.featureTarget.properties.id), e.canDragMove = !0, e.dragMoveLocation = t.lngLat;
1347
- }, D.clickOnFeature = function(e, t) {
1348
- var n = this;
1349
- ee.disable(this), this.stopExtendedInteractions(e);
1350
- var r = Xe(t), o = this.getSelectedIds(), i = t.featureTarget.properties.id, a = this.isSelected(i);
1351
- if (!r && a && this.getFeature(i).type !== m.POINT)
1352
- return this.changeMode(T.DIRECT_SELECT, { featureId: i });
1353
- a && r ? (this.deselect(i), this.updateUIClasses({ mouse: N.POINTER }), o.length === 1 && ee.enable(this)) : !a && r ? (this.select(i), this.updateUIClasses({ mouse: N.MOVE })) : a || r || (o.forEach(function(l) {
1354
- return n.doRender(l);
1355
- }), this.setSelected(i), this.updateUIClasses({ mouse: N.MOVE })), this.doRender(i);
1356
- }, D.onMouseDown = function(e, t) {
1357
- return _e(t) ? this.startOnActiveFeature(e, t) : this.drawConfig.boxSelect && sn(t) ? this.startBoxSelect(e, t) : void 0;
1358
- }, D.startBoxSelect = function(e, t) {
1359
- this.stopExtendedInteractions(e), this.map.dragPan.disable(), e.boxSelectStartLocation = Ft(t.originalEvent, this.map.getContainer()), e.canBoxSelect = !0;
1360
- }, D.onTouchStart = function(e, t) {
1361
- if (_e(t))
1362
- return this.startOnActiveFeature(e, t);
1363
- }, D.onDrag = function(e, t) {
1364
- return e.canDragMove ? this.dragMove(e, t) : this.drawConfig.boxSelect && e.canBoxSelect ? this.whileBoxSelect(e, t) : void 0;
1365
- }, D.whileBoxSelect = function(e, t) {
1366
- e.boxSelecting = !0, this.updateUIClasses({ mouse: N.ADD }), e.boxSelectElement || (e.boxSelectElement = document.createElement("div"), e.boxSelectElement.classList.add(q.BOX_SELECT), this.map.getContainer().appendChild(e.boxSelectElement));
1367
- var n = Ft(t.originalEvent, this.map.getContainer()), r = Math.min(e.boxSelectStartLocation.x, n.x), o = Math.max(e.boxSelectStartLocation.x, n.x), i = Math.min(e.boxSelectStartLocation.y, n.y), a = Math.max(e.boxSelectStartLocation.y, n.y), l = "translate(" + r + "px, " + i + "px)";
1368
- e.boxSelectElement.style.transform = l, e.boxSelectElement.style.WebkitTransform = l, e.boxSelectElement.style.width = o - r + "px", e.boxSelectElement.style.height = a - i + "px";
1369
- }, D.dragMove = function(e, t) {
1370
- e.dragMoving = !0, t.originalEvent.stopPropagation();
1371
- var n = { lng: t.lngLat.lng - e.dragMoveLocation.lng, lat: t.lngLat.lat - e.dragMoveLocation.lat };
1372
- Dt(this.getSelected(), n), e.dragMoveLocation = t.lngLat;
1373
- }, D.onTouchEnd = D.onMouseUp = function(e, t) {
1374
- var n = this;
1375
- if (e.dragMoving)
1376
- this.fireUpdate();
1377
- else if (e.boxSelecting) {
1378
- var r = [e.boxSelectStartLocation, Ft(t.originalEvent, this.map.getContainer())], o = this.featuresAt(null, r, "click"), i = this.getUniqueIds(o).filter(function(a) {
1379
- return !n.isSelected(a);
1380
- });
1381
- i.length && (this.select(i), i.forEach(function(a) {
1382
- return n.doRender(a);
1383
- }), this.updateUIClasses({ mouse: N.MOVE }));
1384
- }
1385
- this.stopExtendedInteractions(e);
1386
- }, D.toDisplayFeatures = function(e, t, n) {
1387
- t.properties.active = this.isSelected(t.properties.id) ? j.ACTIVE : j.INACTIVE, n(t), this.fireActionable(), t.properties.active === j.ACTIVE && t.geometry.type !== m.POINT && Ke(t).forEach(n);
1388
- }, D.onTrash = function() {
1389
- this.deleteFeature(this.getSelectedIds()), this.fireActionable();
1390
- }, D.onCombineFeatures = function() {
1391
- var e = this.getSelected();
1392
- if (!(e.length === 0 || e.length < 2)) {
1393
- for (var t = [], n = [], r = e[0].type.replace("Multi", ""), o = 0; o < e.length; o++) {
1394
- var i = e[o];
1395
- if (i.type.replace("Multi", "") !== r)
1396
- return;
1397
- i.type.includes("Multi") ? i.getCoordinates().forEach(function(l) {
1398
- t.push(l);
1399
- }) : t.push(i.getCoordinates()), n.push(i.toGeoJSON());
1400
- }
1401
- if (n.length > 1) {
1402
- var a = this.newFeature({ type: m.FEATURE, properties: n[0].properties, geometry: { type: "Multi" + r, coordinates: t } });
1403
- this.addFeature(a), this.deleteFeature(this.getSelectedIds(), { silent: !0 }), this.setSelected([a.id]), this.map.fire(H.COMBINE_FEATURES, { createdFeatures: [a.toGeoJSON()], deletedFeatures: n });
1404
- }
1405
- this.fireActionable();
1406
- }
1407
- }, D.onUncombineFeatures = function() {
1408
- var e = this, t = this.getSelected();
1409
- if (t.length !== 0) {
1410
- for (var n = [], r = [], o = function(a) {
1411
- var l = t[a];
1412
- e.isInstanceOf("MultiFeature", l) && (l.getFeatures().forEach(function(d) {
1413
- e.addFeature(d), d.properties = l.properties, n.push(d.toGeoJSON()), e.select([d.id]);
1414
- }), e.deleteFeature(l.id, { silent: !0 }), r.push(l.toGeoJSON()));
1415
- }, i = 0; i < t.length; i++)
1416
- o(i);
1417
- n.length > 1 && this.map.fire(H.UNCOMBINE_FEATURES, { createdFeatures: n, deletedFeatures: r }), this.fireActionable();
1418
- }
1419
- };
1420
- var gn = qe(B.VERTEX), yn = qe(B.MIDPOINT), fe = { fireUpdate: function() {
1421
- this.map.fire(H.UPDATE, { action: Ot.CHANGE_COORDINATES, features: this.getSelected().map(function(e) {
1422
- return e.toGeoJSON();
1423
- }) });
1424
- }, fireActionable: function(e) {
1425
- this.setActionableState({ combineFeatures: !1, uncombineFeatures: !1, trash: e.selectedCoordPaths.length > 0 });
1426
- }, startDragging: function(e, t) {
1427
- this.map.dragPan.disable(), e.canDragMove = !0, e.dragMoveLocation = t.lngLat;
1428
- }, stopDragging: function(e) {
1429
- this.map.dragPan.enable(), e.dragMoving = !1, e.canDragMove = !1, e.dragMoveLocation = null;
1430
- }, onVertex: function(e, t) {
1431
- this.startDragging(e, t);
1432
- var n = t.featureTarget.properties, r = e.selectedCoordPaths.indexOf(n.coord_path);
1433
- Xe(t) || r !== -1 ? Xe(t) && r === -1 && e.selectedCoordPaths.push(n.coord_path) : e.selectedCoordPaths = [n.coord_path];
1434
- var o = this.pathsToCoordinates(e.featureId, e.selectedCoordPaths);
1435
- this.setSelectedCoordinates(o);
1436
- }, onMidpoint: function(e, t) {
1437
- this.startDragging(e, t);
1438
- var n = t.featureTarget.properties;
1439
- e.feature.addCoordinate(n.coord_path, n.lng, n.lat), this.fireUpdate(), e.selectedCoordPaths = [n.coord_path];
1440
- }, pathsToCoordinates: function(e, t) {
1441
- return t.map(function(n) {
1442
- return { feature_id: e, coord_path: n };
1443
- });
1444
- }, onFeature: function(e, t) {
1445
- e.selectedCoordPaths.length === 0 ? this.startDragging(e, t) : this.stopDragging(e);
1446
- }, dragFeature: function(e, t, n) {
1447
- Dt(this.getSelected(), n), e.dragMoveLocation = t.lngLat;
1448
- }, dragVertex: function(e, t, n) {
1449
- for (var r = e.selectedCoordPaths.map(function(l) {
1450
- return e.feature.getCoordinate(l);
1451
- }), o = Rt(r.map(function(l) {
1452
- return { type: m.FEATURE, properties: {}, geometry: { type: m.POINT, coordinates: l } };
1453
- }), n), i = 0; i < r.length; i++) {
1454
- var a = r[i];
1455
- e.feature.updateCoordinate(e.selectedCoordPaths[i], a[0] + o.lng, a[1] + o.lat);
1456
- }
1457
- }, clickNoTarget: function() {
1458
- this.changeMode(T.SIMPLE_SELECT);
1459
- }, clickInactive: function() {
1460
- this.changeMode(T.SIMPLE_SELECT);
1461
- }, clickActiveFeature: function(e) {
1462
- e.selectedCoordPaths = [], this.clearSelectedCoordinates(), e.feature.changed();
1463
- }, onSetup: function(e) {
1464
- var t = e.featureId, n = this.getFeature(t);
1465
- if (!n)
1466
- throw new Error("You must provide a featureId to enter direct_select mode");
1467
- if (n.type === m.POINT)
1468
- throw new TypeError("direct_select mode doesn't handle point features");
1469
- var r = { featureId: t, feature: n, dragMoveLocation: e.startPos || null, dragMoving: !1, canDragMove: !1, selectedCoordPaths: e.coordPath ? [e.coordPath] : [] };
1470
- return this.setSelectedCoordinates(this.pathsToCoordinates(t, r.selectedCoordPaths)), this.setSelected(t), ee.disable(this), this.setActionableState({ trash: !0 }), r;
1471
- }, onStop: function() {
1472
- ee.enable(this), this.clearSelectedCoordinates();
1473
- }, toDisplayFeatures: function(e, t, n) {
1474
- e.featureId === t.properties.id ? (t.properties.active = j.ACTIVE, n(t), Ke(t, { map: this.map, midpoints: !0, selectedPaths: e.selectedCoordPaths }).forEach(n)) : (t.properties.active = j.INACTIVE, n(t)), this.fireActionable(e);
1475
- }, onTrash: function(e) {
1476
- e.selectedCoordPaths.sort(function(t, n) {
1477
- return n.localeCompare(t, "en", { numeric: !0 });
1478
- }).forEach(function(t) {
1479
- return e.feature.removeCoordinate(t);
1480
- }), this.fireUpdate(), e.selectedCoordPaths = [], this.clearSelectedCoordinates(), this.fireActionable(e), e.feature.isValid() === !1 && (this.deleteFeature([e.featureId]), this.changeMode(T.SIMPLE_SELECT, {}));
1481
- }, onMouseMove: function(e, t) {
1482
- var n = _e(t), r = gn(t), o = yn(t), i = e.selectedCoordPaths.length === 0;
1483
- return n && i || r && !i ? this.updateUIClasses({ mouse: N.MOVE }) : this.updateUIClasses({ mouse: N.NONE }), (r || n || o) && e.dragMoving && this.fireUpdate(), this.stopDragging(e), !0;
1484
- }, onMouseOut: function(e) {
1485
- return e.dragMoving && this.fireUpdate(), !0;
1486
- } };
1487
- fe.onTouchStart = fe.onMouseDown = function(e, t) {
1488
- return gn(t) ? this.onVertex(e, t) : _e(t) ? this.onFeature(e, t) : yn(t) ? this.onMidpoint(e, t) : void 0;
1489
- }, fe.onDrag = function(e, t) {
1490
- if (e.canDragMove === !0) {
1491
- e.dragMoving = !0, t.originalEvent.stopPropagation();
1492
- var n = { lng: t.lngLat.lng - e.dragMoveLocation.lng, lat: t.lngLat.lat - e.dragMoveLocation.lat };
1493
- e.selectedCoordPaths.length > 0 ? this.dragVertex(e, t, n) : this.dragFeature(e, t, n), e.dragMoveLocation = t.lngLat;
1494
- }
1495
- }, fe.onClick = function(e, t) {
1496
- return He(t) ? this.clickNoTarget(e, t) : _e(t) ? this.clickActiveFeature(e, t) : At(t) ? this.clickInactive(e, t) : void this.stopDragging(e);
1497
- }, fe.onTap = function(e, t) {
1498
- return He(t) ? this.clickNoTarget(e, t) : _e(t) ? this.clickActiveFeature(e, t) : At(t) ? this.clickInactive(e, t) : void 0;
1499
- }, fe.onTouchEnd = fe.onMouseUp = function(e) {
1500
- e.dragMoving && this.fireUpdate(), this.stopDragging(e);
1501
- };
1502
- var ne = {};
1503
- function it(e, t) {
1504
- return !!e.lngLat && e.lngLat.lng === t[0] && e.lngLat.lat === t[1];
1505
- }
1506
- ne.onSetup = function() {
1507
- var e = this.newFeature({ type: m.FEATURE, properties: {}, geometry: { type: m.POINT, coordinates: [] } });
1508
- return this.addFeature(e), this.clearSelectedFeatures(), this.updateUIClasses({ mouse: N.ADD }), this.activateUIButton(Y.POINT), this.setActionableState({ trash: !0 }), { point: e };
1509
- }, ne.stopDrawingAndRemove = function(e) {
1510
- this.deleteFeature([e.point.id], { silent: !0 }), this.changeMode(T.SIMPLE_SELECT);
1511
- }, ne.onTap = ne.onClick = function(e, t) {
1512
- this.updateUIClasses({ mouse: N.MOVE }), e.point.updateCoordinate("", t.lngLat.lng, t.lngLat.lat), this.map.fire(H.CREATE, { features: [e.point.toGeoJSON()] }), this.changeMode(T.SIMPLE_SELECT, { featureIds: [e.point.id] });
1513
- }, ne.onStop = function(e) {
1514
- this.activateUIButton(), e.point.getCoordinate().length || this.deleteFeature([e.point.id], { silent: !0 });
1515
- }, ne.toDisplayFeatures = function(e, t, n) {
1516
- var r = t.properties.id === e.point.id;
1517
- if (t.properties.active = r ? j.ACTIVE : j.INACTIVE, !r)
1518
- return n(t);
1519
- }, ne.onTrash = ne.stopDrawingAndRemove, ne.onKeyUp = function(e, t) {
1520
- if (Ze(t) || We(t))
1521
- return this.stopDrawingAndRemove(e, t);
1522
- };
1523
- var be = { onSetup: function() {
1524
- var e = this.newFeature({ type: m.FEATURE, properties: {}, geometry: { type: m.POLYGON, coordinates: [[]] } });
1525
- return this.addFeature(e), this.clearSelectedFeatures(), ee.disable(this), this.updateUIClasses({ mouse: N.ADD }), this.activateUIButton(Y.POLYGON), this.setActionableState({ trash: !0 }), { polygon: e, currentVertexPosition: 0 };
1526
- }, clickAnywhere: function(e, t) {
1527
- if (e.currentVertexPosition > 0 && it(t, e.polygon.coordinates[0][e.currentVertexPosition - 1]))
1528
- return this.changeMode(T.SIMPLE_SELECT, { featureIds: [e.polygon.id] });
1529
- this.updateUIClasses({ mouse: N.ADD }), e.polygon.updateCoordinate("0." + e.currentVertexPosition, t.lngLat.lng, t.lngLat.lat), e.currentVertexPosition++, e.polygon.updateCoordinate("0." + e.currentVertexPosition, t.lngLat.lng, t.lngLat.lat);
1530
- }, clickOnVertex: function(e) {
1531
- return this.changeMode(T.SIMPLE_SELECT, { featureIds: [e.polygon.id] });
1532
- }, onMouseMove: function(e, t) {
1533
- e.polygon.updateCoordinate("0." + e.currentVertexPosition, t.lngLat.lng, t.lngLat.lat), De(t) && this.updateUIClasses({ mouse: N.POINTER });
1534
- } };
1535
- be.onTap = be.onClick = function(e, t) {
1536
- return De(t) ? this.clickOnVertex(e, t) : this.clickAnywhere(e, t);
1537
- }, be.onKeyUp = function(e, t) {
1538
- Ze(t) ? (this.deleteFeature([e.polygon.id], { silent: !0 }), this.changeMode(T.SIMPLE_SELECT)) : We(t) && this.changeMode(T.SIMPLE_SELECT, { featureIds: [e.polygon.id] });
1539
- }, be.onStop = function(e) {
1540
- this.updateUIClasses({ mouse: N.NONE }), ee.enable(this), this.activateUIButton(), this.getFeature(e.polygon.id) !== void 0 && (e.polygon.removeCoordinate("0." + e.currentVertexPosition), e.polygon.isValid() ? this.map.fire(H.CREATE, { features: [e.polygon.toGeoJSON()] }) : (this.deleteFeature([e.polygon.id], { silent: !0 }), this.changeMode(T.SIMPLE_SELECT, {}, { silent: !0 })));
1541
- }, be.toDisplayFeatures = function(e, t, n) {
1542
- var r = t.properties.id === e.polygon.id;
1543
- if (t.properties.active = r ? j.ACTIVE : j.INACTIVE, !r)
1544
- return n(t);
1545
- if (t.geometry.coordinates.length !== 0) {
1546
- var o = t.geometry.coordinates[0].length;
1547
- if (!(o < 3)) {
1548
- if (t.properties.meta = B.FEATURE, n(Le(e.polygon.id, t.geometry.coordinates[0][0], "0.0", !1)), o > 3) {
1549
- var i = t.geometry.coordinates[0].length - 3;
1550
- n(Le(e.polygon.id, t.geometry.coordinates[0][i], "0." + i, !1));
1551
- }
1552
- if (o <= 4) {
1553
- var a = [[t.geometry.coordinates[0][0][0], t.geometry.coordinates[0][0][1]], [t.geometry.coordinates[0][1][0], t.geometry.coordinates[0][1][1]]];
1554
- if (n({ type: m.FEATURE, properties: t.properties, geometry: { coordinates: a, type: m.LINE_STRING } }), o === 3)
1555
- return;
1556
- }
1557
- return n(t);
1558
- }
1559
- }
1560
- }, be.onTrash = function(e) {
1561
- this.deleteFeature([e.polygon.id], { silent: !0 }), this.changeMode(T.SIMPLE_SELECT);
1562
- };
1563
- var Ee = { onSetup: function(e) {
1564
- var t, n, r = (e = e || {}).featureId, o = "forward";
1565
- if (r) {
1566
- if (!(t = this.getFeature(r)))
1567
- throw new Error("Could not find a feature with the provided featureId");
1568
- var i = e.from;
1569
- if (i && i.type === "Feature" && i.geometry && i.geometry.type === "Point" && (i = i.geometry), i && i.type === "Point" && i.coordinates && i.coordinates.length === 2 && (i = i.coordinates), !i || !Array.isArray(i))
1570
- throw new Error("Please use the `from` property to indicate which point to continue the line from");
1571
- var a = t.coordinates.length - 1;
1572
- if (t.coordinates[a][0] === i[0] && t.coordinates[a][1] === i[1])
1573
- n = a + 1, t.addCoordinate.apply(t, [n].concat(t.coordinates[a]));
1574
- else {
1575
- if (t.coordinates[0][0] !== i[0] || t.coordinates[0][1] !== i[1])
1576
- throw new Error("`from` should match the point at either the start or the end of the provided LineString");
1577
- o = "backwards", n = 0, t.addCoordinate.apply(t, [n].concat(t.coordinates[0]));
1578
- }
1579
- } else
1580
- t = this.newFeature({ type: m.FEATURE, properties: {}, geometry: { type: m.LINE_STRING, coordinates: [] } }), n = 0, this.addFeature(t);
1581
- return this.clearSelectedFeatures(), ee.disable(this), this.updateUIClasses({ mouse: N.ADD }), this.activateUIButton(Y.LINE), this.setActionableState({ trash: !0 }), { line: t, currentVertexPosition: n, direction: o };
1582
- }, clickAnywhere: function(e, t) {
1583
- if (e.currentVertexPosition > 0 && it(t, e.line.coordinates[e.currentVertexPosition - 1]) || e.direction === "backwards" && it(t, e.line.coordinates[e.currentVertexPosition + 1]))
1584
- return this.changeMode(T.SIMPLE_SELECT, { featureIds: [e.line.id] });
1585
- this.updateUIClasses({ mouse: N.ADD }), e.line.updateCoordinate(e.currentVertexPosition, t.lngLat.lng, t.lngLat.lat), e.direction === "forward" ? (e.currentVertexPosition++, e.line.updateCoordinate(e.currentVertexPosition, t.lngLat.lng, t.lngLat.lat)) : e.line.addCoordinate(0, t.lngLat.lng, t.lngLat.lat);
1586
- }, clickOnVertex: function(e) {
1587
- return this.changeMode(T.SIMPLE_SELECT, { featureIds: [e.line.id] });
1588
- }, onMouseMove: function(e, t) {
1589
- e.line.updateCoordinate(e.currentVertexPosition, t.lngLat.lng, t.lngLat.lat), De(t) && this.updateUIClasses({ mouse: N.POINTER });
1590
- } };
1591
- Ee.onTap = Ee.onClick = function(e, t) {
1592
- if (De(t))
1593
- return this.clickOnVertex(e, t);
1594
- this.clickAnywhere(e, t);
1595
- }, Ee.onKeyUp = function(e, t) {
1596
- We(t) ? this.changeMode(T.SIMPLE_SELECT, { featureIds: [e.line.id] }) : Ze(t) && (this.deleteFeature([e.line.id], { silent: !0 }), this.changeMode(T.SIMPLE_SELECT));
1597
- }, Ee.onStop = function(e) {
1598
- ee.enable(this), this.activateUIButton(), this.getFeature(e.line.id) !== void 0 && (e.line.removeCoordinate("" + e.currentVertexPosition), e.line.isValid() ? this.map.fire(H.CREATE, { features: [e.line.toGeoJSON()] }) : (this.deleteFeature([e.line.id], { silent: !0 }), this.changeMode(T.SIMPLE_SELECT, {}, { silent: !0 })));
1599
- }, Ee.onTrash = function(e) {
1600
- this.deleteFeature([e.line.id], { silent: !0 }), this.changeMode(T.SIMPLE_SELECT);
1601
- }, Ee.toDisplayFeatures = function(e, t, n) {
1602
- var r = t.properties.id === e.line.id;
1603
- if (t.properties.active = r ? j.ACTIVE : j.INACTIVE, !r)
1604
- return n(t);
1605
- t.geometry.coordinates.length < 2 || (t.properties.meta = B.FEATURE, n(Le(e.line.id, t.geometry.coordinates[e.direction === "forward" ? t.geometry.coordinates.length - 2 : 1], "" + (e.direction === "forward" ? t.geometry.coordinates.length - 2 : 1), !1)), n(t));
1606
- };
1607
- var vn = { simple_select: D, direct_select: fe, draw_point: ne, draw_polygon: be, draw_line_string: Ee }, xr = { defaultMode: T.SIMPLE_SELECT, keybindings: !0, touchEnabled: !0, clickBuffer: 2, touchBuffer: 25, boxSelect: !0, displayControlsDefault: !0, styles: an, modes: vn, controls: {}, userProperties: !1 }, Mr = { point: !0, line_string: !0, polygon: !0, trash: !0, combine_features: !0, uncombine_features: !0 }, Lr = { point: !1, line_string: !1, polygon: !1, trash: !1, combine_features: !1, uncombine_features: !1 };
1608
- function mn(e, t) {
1609
- return e.map(function(n) {
1610
- return n.source ? n : pe(n, { id: n.id + "." + t, source: t === "hot" ? X.HOT : X.COLD });
1611
- });
1612
- }
1613
- var kt = { exports: {} };
1614
- (function(e, t) {
1615
- var n = "__lodash_hash_undefined__", r = 9007199254740991, o = "[object Arguments]", i = "[object Array]", a = "[object Boolean]", l = "[object Date]", d = "[object Error]", h = "[object Function]", g = "[object Map]", p = "[object Number]", _ = "[object Object]", A = "[object Promise]", b = "[object RegExp]", F = "[object Set]", c = "[object String]", y = "[object Symbol]", O = "[object WeakMap]", V = "[object ArrayBuffer]", w = "[object DataView]", Ut = /^\[object .+?Constructor\]$/, Fr = /^(?:0|[1-9]\d*)$/, M = {};
1616
- M["[object Float32Array]"] = M["[object Float64Array]"] = M["[object Int8Array]"] = M["[object Int16Array]"] = M["[object Int32Array]"] = M["[object Uint8Array]"] = M["[object Uint8ClampedArray]"] = M["[object Uint16Array]"] = M["[object Uint32Array]"] = !0, M[o] = M[i] = M[V] = M[a] = M[w] = M[l] = M[d] = M[h] = M[g] = M[p] = M[_] = M[b] = M[F] = M[c] = M[O] = !1;
1617
- var En = typeof Je == "object" && Je && Je.Object === Object && Je, wr = typeof self == "object" && self && self.Object === Object && self, ae = En || wr || Function("return this")(), Tn = t && !t.nodeType && t, Cn = Tn && e && !e.nodeType && e, On = Cn && Cn.exports === Tn, jt = On && En.process, Sn = function() {
1618
- try {
1619
- return jt && jt.binding && jt.binding("util");
1620
- } catch {
1621
- }
1622
- }(), In = Sn && Sn.isTypedArray;
1623
- function Rr(s, u) {
1624
- for (var f = -1, v = s == null ? 0 : s.length; ++f < v; )
1625
- if (u(s[f], f, s))
1626
- return !0;
1627
- return !1;
1628
- }
1629
- function Dr(s) {
1630
- var u = -1, f = Array(s.size);
1631
- return s.forEach(function(v, L) {
1632
- f[++u] = [L, v];
1633
- }), f;
1634
- }
1635
- function kr(s) {
1636
- var u = -1, f = Array(s.size);
1637
- return s.forEach(function(v) {
1638
- f[++u] = v;
1639
- }), f;
1640
- }
1641
- var xn, Mn, Ln, Ur = Array.prototype, jr = Function.prototype, st = Object.prototype, Vt = ae["__core-js_shared__"], Nn = jr.toString, re = st.hasOwnProperty, An = (xn = /[^.]+$/.exec(Vt && Vt.keys && Vt.keys.IE_PROTO || "")) ? "Symbol(src)_1." + xn : "", Pn = st.toString, Vr = RegExp("^" + Nn.call(re).replace(/[\\^$.*+?()[\]{}|]/g, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"), Fn = On ? ae.Buffer : void 0, ut = ae.Symbol, wn = ae.Uint8Array, Rn = st.propertyIsEnumerable, Br = Ur.splice, Te = ut ? ut.toStringTag : void 0, Dn = Object.getOwnPropertySymbols, Gr = Fn ? Fn.isBuffer : void 0, Jr = (Mn = Object.keys, Ln = Object, function(s) {
1642
- return Mn(Ln(s));
1643
- }), Bt = Ae(ae, "DataView"), ke = Ae(ae, "Map"), Gt = Ae(ae, "Promise"), Jt = Ae(ae, "Set"), zt = Ae(ae, "WeakMap"), Ue = Ae(Object, "create"), zr = Se(Bt), Yr = Se(ke), $r = Se(Gt), qr = Se(Jt), Hr = Se(zt), kn = ut ? ut.prototype : void 0, Yt = kn ? kn.valueOf : void 0;
1644
- function Ce(s) {
1645
- var u = -1, f = s == null ? 0 : s.length;
1646
- for (this.clear(); ++u < f; ) {
1647
- var v = s[u];
1648
- this.set(v[0], v[1]);
1649
- }
1650
- }
1651
- function se(s) {
1652
- var u = -1, f = s == null ? 0 : s.length;
1653
- for (this.clear(); ++u < f; ) {
1654
- var v = s[u];
1655
- this.set(v[0], v[1]);
1656
- }
1657
- }
1658
- function Oe(s) {
1659
- var u = -1, f = s == null ? 0 : s.length;
1660
- for (this.clear(); ++u < f; ) {
1661
- var v = s[u];
1662
- this.set(v[0], v[1]);
1663
- }
1664
- }
1665
- function ct(s) {
1666
- var u = -1, f = s == null ? 0 : s.length;
1667
- for (this.__data__ = new Oe(); ++u < f; )
1668
- this.add(s[u]);
1669
- }
1670
- function he(s) {
1671
- var u = this.__data__ = new se(s);
1672
- this.size = u.size;
1673
- }
1674
- function Xr(s, u) {
1675
- var f = pt(s), v = !f && eo(s), L = !f && !v && $t(s), C = !f && !v && !L && $n(s), P = f || v || L || C, R = P ? function(U, oe) {
1676
- for (var ue = -1, z = Array(U); ++ue < U; )
1677
- z[ue] = oe(ue);
1678
- return z;
1679
- }(s.length, String) : [], te = R.length;
1680
- for (var k in s)
1681
- !u && !re.call(s, k) || P && (k == "length" || L && (k == "offset" || k == "parent") || C && (k == "buffer" || k == "byteLength" || k == "byteOffset") || Qr(k, te)) || R.push(k);
1682
- return R;
1683
- }
1684
- function lt(s, u) {
1685
- for (var f = s.length; f--; )
1686
- if (Gn(s[f][0], u))
1687
- return f;
1688
- return -1;
1689
- }
1690
- function je(s) {
1691
- return s == null ? s === void 0 ? "[object Undefined]" : "[object Null]" : Te && Te in Object(s) ? function(u) {
1692
- var f = re.call(u, Te), v = u[Te];
1693
- try {
1694
- u[Te] = void 0;
1695
- var L = !0;
1696
- } catch {
1697
- }
1698
- var C = Pn.call(u);
1699
- return L && (f ? u[Te] = v : delete u[Te]), C;
1700
- }(s) : function(u) {
1701
- return Pn.call(u);
1702
- }(s);
1703
- }
1704
- function Un(s) {
1705
- return Ve(s) && je(s) == o;
1706
- }
1707
- function jn(s, u, f, v, L) {
1708
- return s === u || (s == null || u == null || !Ve(s) && !Ve(u) ? s != s && u != u : function(C, P, R, te, k, U) {
1709
- var oe = pt(C), ue = pt(P), z = oe ? i : ge(C), ce = ue ? i : ge(P), Pe = (z = z == o ? _ : z) == _, ft = (ce = ce == o ? _ : ce) == _, Fe = z == ce;
1710
- if (Fe && $t(C)) {
1711
- if (!$t(P))
1712
- return !1;
1713
- oe = !0, Pe = !1;
1714
- }
1715
- if (Fe && !Pe)
1716
- return U || (U = new he()), oe || $n(C) ? Vn(C, P, R, te, k, U) : function(I, S, ht, ye, qt, Q, le) {
1717
- switch (ht) {
1718
- case w:
1719
- if (I.byteLength != S.byteLength || I.byteOffset != S.byteOffset)
1720
- return !1;
1721
- I = I.buffer, S = S.buffer;
1722
- case V:
1723
- return !(I.byteLength != S.byteLength || !Q(new wn(I), new wn(S)));
1724
- case a:
1725
- case l:
1726
- case p:
1727
- return Gn(+I, +S);
1728
- case d:
1729
- return I.name == S.name && I.message == S.message;
1730
- case b:
1731
- case c:
1732
- return I == S + "";
1733
- case g:
1734
- var ve = Dr;
1735
- case F:
1736
- var Ge = 1 & ye;
1737
- if (ve || (ve = kr), I.size != S.size && !Ge)
1738
- return !1;
1739
- var gt = le.get(I);
1740
- if (gt)
1741
- return gt == S;
1742
- ye |= 2, le.set(I, S);
1743
- var we = Vn(ve(I), ve(S), ye, qt, Q, le);
1744
- return le.delete(I), we;
1745
- case y:
1746
- if (Yt)
1747
- return Yt.call(I) == Yt.call(S);
1748
- }
1749
- return !1;
1750
- }(C, P, z, R, te, k, U);
1751
- if (!(1 & R)) {
1752
- var Be = Pe && re.call(C, "__wrapped__"), qn = ft && re.call(P, "__wrapped__");
1753
- if (Be || qn) {
1754
- var no = Be ? C.value() : C, ro = qn ? P.value() : P;
1755
- return U || (U = new he()), k(no, ro, R, te, U);
1756
- }
1757
- }
1758
- return Fe ? (U || (U = new he()), function(I, S, ht, ye, qt, Q) {
1759
- var le = 1 & ht, ve = Bn(I), Ge = ve.length, gt = Bn(S).length;
1760
- if (Ge != gt && !le)
1761
- return !1;
1762
- for (var we = Ge; we--; ) {
1763
- var Ie = ve[we];
1764
- if (!(le ? Ie in S : re.call(S, Ie)))
1765
- return !1;
1766
- }
1767
- var Hn = Q.get(I);
1768
- if (Hn && Q.get(S))
1769
- return Hn == S;
1770
- var yt = !0;
1771
- Q.set(I, S), Q.set(S, I);
1772
- for (var Ht = le; ++we < Ge; ) {
1773
- var vt = I[Ie = ve[we]], mt = S[Ie];
1774
- if (ye)
1775
- var Xn = le ? ye(mt, vt, Ie, S, I, Q) : ye(vt, mt, Ie, I, S, Q);
1776
- if (!(Xn === void 0 ? vt === mt || qt(vt, mt, ht, ye, Q) : Xn)) {
1777
- yt = !1;
1778
- break;
1779
- }
1780
- Ht || (Ht = Ie == "constructor");
1781
- }
1782
- if (yt && !Ht) {
1783
- var _t = I.constructor, bt = S.constructor;
1784
- _t == bt || !("constructor" in I) || !("constructor" in S) || typeof _t == "function" && _t instanceof _t && typeof bt == "function" && bt instanceof bt || (yt = !1);
1785
- }
1786
- return Q.delete(I), Q.delete(S), yt;
1787
- }(C, P, R, te, k, U)) : !1;
1788
- }(s, u, f, v, jn, L));
1789
- }
1790
- function Zr(s) {
1791
- return !(!Yn(s) || function(u) {
1792
- return !!An && An in u;
1793
- }(s)) && (Jn(s) ? Vr : Ut).test(Se(s));
1794
- }
1795
- function Wr(s) {
1796
- if (f = (u = s) && u.constructor, v = typeof f == "function" && f.prototype || st, u !== v)
1797
- return Jr(s);
1798
- var u, f, v, L = [];
1799
- for (var C in Object(s))
1800
- re.call(s, C) && C != "constructor" && L.push(C);
1801
- return L;
1802
- }
1803
- function Vn(s, u, f, v, L, C) {
1804
- var P = 1 & f, R = s.length, te = u.length;
1805
- if (R != te && !(P && te > R))
1806
- return !1;
1807
- var k = C.get(s);
1808
- if (k && C.get(u))
1809
- return k == u;
1810
- var U = -1, oe = !0, ue = 2 & f ? new ct() : void 0;
1811
- for (C.set(s, u), C.set(u, s); ++U < R; ) {
1812
- var z = s[U], ce = u[U];
1813
- if (v)
1814
- var Pe = P ? v(ce, z, U, u, s, C) : v(z, ce, U, s, u, C);
1815
- if (Pe !== void 0) {
1816
- if (Pe)
1817
- continue;
1818
- oe = !1;
1819
- break;
1820
- }
1821
- if (ue) {
1822
- if (!Rr(u, function(ft, Fe) {
1823
- if (Be = Fe, !ue.has(Be) && (z === ft || L(z, ft, f, v, C)))
1824
- return ue.push(Fe);
1825
- var Be;
1826
- })) {
1827
- oe = !1;
1828
- break;
1829
- }
1830
- } else if (z !== ce && !L(z, ce, f, v, C)) {
1831
- oe = !1;
1832
- break;
1833
- }
1834
- }
1835
- return C.delete(s), C.delete(u), oe;
1836
- }
1837
- function Bn(s) {
1838
- return function(u, f, v) {
1839
- var L = f(u);
1840
- return pt(u) ? L : function(C, P) {
1841
- for (var R = -1, te = P.length, k = C.length; ++R < te; )
1842
- C[k + R] = P[R];
1843
- return C;
1844
- }(L, v(u));
1845
- }(s, to, Kr);
1846
- }
1847
- function dt(s, u) {
1848
- var f, v, L = s.__data__;
1849
- return ((v = typeof (f = u)) == "string" || v == "number" || v == "symbol" || v == "boolean" ? f !== "__proto__" : f === null) ? L[typeof u == "string" ? "string" : "hash"] : L.map;
1850
- }
1851
- function Ae(s, u) {
1852
- var f = function(v, L) {
1853
- return v == null ? void 0 : v[L];
1854
- }(s, u);
1855
- return Zr(f) ? f : void 0;
1856
- }
1857
- Ce.prototype.clear = function() {
1858
- this.__data__ = Ue ? Ue(null) : {}, this.size = 0;
1859
- }, Ce.prototype.delete = function(s) {
1860
- var u = this.has(s) && delete this.__data__[s];
1861
- return this.size -= u ? 1 : 0, u;
1862
- }, Ce.prototype.get = function(s) {
1863
- var u = this.__data__;
1864
- if (Ue) {
1865
- var f = u[s];
1866
- return f === n ? void 0 : f;
1867
- }
1868
- return re.call(u, s) ? u[s] : void 0;
1869
- }, Ce.prototype.has = function(s) {
1870
- var u = this.__data__;
1871
- return Ue ? u[s] !== void 0 : re.call(u, s);
1872
- }, Ce.prototype.set = function(s, u) {
1873
- var f = this.__data__;
1874
- return this.size += this.has(s) ? 0 : 1, f[s] = Ue && u === void 0 ? n : u, this;
1875
- }, se.prototype.clear = function() {
1876
- this.__data__ = [], this.size = 0;
1877
- }, se.prototype.delete = function(s) {
1878
- var u = this.__data__, f = lt(u, s);
1879
- return !(f < 0) && (f == u.length - 1 ? u.pop() : Br.call(u, f, 1), --this.size, !0);
1880
- }, se.prototype.get = function(s) {
1881
- var u = this.__data__, f = lt(u, s);
1882
- return f < 0 ? void 0 : u[f][1];
1883
- }, se.prototype.has = function(s) {
1884
- return lt(this.__data__, s) > -1;
1885
- }, se.prototype.set = function(s, u) {
1886
- var f = this.__data__, v = lt(f, s);
1887
- return v < 0 ? (++this.size, f.push([s, u])) : f[v][1] = u, this;
1888
- }, Oe.prototype.clear = function() {
1889
- this.size = 0, this.__data__ = { hash: new Ce(), map: new (ke || se)(), string: new Ce() };
1890
- }, Oe.prototype.delete = function(s) {
1891
- var u = dt(this, s).delete(s);
1892
- return this.size -= u ? 1 : 0, u;
1893
- }, Oe.prototype.get = function(s) {
1894
- return dt(this, s).get(s);
1895
- }, Oe.prototype.has = function(s) {
1896
- return dt(this, s).has(s);
1897
- }, Oe.prototype.set = function(s, u) {
1898
- var f = dt(this, s), v = f.size;
1899
- return f.set(s, u), this.size += f.size == v ? 0 : 1, this;
1900
- }, ct.prototype.add = ct.prototype.push = function(s) {
1901
- return this.__data__.set(s, n), this;
1902
- }, ct.prototype.has = function(s) {
1903
- return this.__data__.has(s);
1904
- }, he.prototype.clear = function() {
1905
- this.__data__ = new se(), this.size = 0;
1906
- }, he.prototype.delete = function(s) {
1907
- var u = this.__data__, f = u.delete(s);
1908
- return this.size = u.size, f;
1909
- }, he.prototype.get = function(s) {
1910
- return this.__data__.get(s);
1911
- }, he.prototype.has = function(s) {
1912
- return this.__data__.has(s);
1913
- }, he.prototype.set = function(s, u) {
1914
- var f = this.__data__;
1915
- if (f instanceof se) {
1916
- var v = f.__data__;
1917
- if (!ke || v.length < 199)
1918
- return v.push([s, u]), this.size = ++f.size, this;
1919
- f = this.__data__ = new Oe(v);
1920
- }
1921
- return f.set(s, u), this.size = f.size, this;
1922
- };
1923
- var Kr = Dn ? function(s) {
1924
- return s == null ? [] : (s = Object(s), function(u, f) {
1925
- for (var v = -1, L = u == null ? 0 : u.length, C = 0, P = []; ++v < L; ) {
1926
- var R = u[v];
1927
- f(R, v, u) && (P[C++] = R);
1928
- }
1929
- return P;
1930
- }(Dn(s), function(u) {
1931
- return Rn.call(s, u);
1932
- }));
1933
- } : function() {
1934
- return [];
1935
- }, ge = je;
1936
- function Qr(s, u) {
1937
- return !!(u = u ?? r) && (typeof s == "number" || Fr.test(s)) && s > -1 && s % 1 == 0 && s < u;
1938
- }
1939
- function Se(s) {
1940
- if (s != null) {
1941
- try {
1942
- return Nn.call(s);
1943
- } catch {
1944
- }
1945
- try {
1946
- return s + "";
1947
- } catch {
1948
- }
1949
- }
1950
- return "";
1951
- }
1952
- function Gn(s, u) {
1953
- return s === u || s != s && u != u;
1954
- }
1955
- (Bt && ge(new Bt(new ArrayBuffer(1))) != w || ke && ge(new ke()) != g || Gt && ge(Gt.resolve()) != A || Jt && ge(new Jt()) != F || zt && ge(new zt()) != O) && (ge = function(s) {
1956
- var u = je(s), f = u == _ ? s.constructor : void 0, v = f ? Se(f) : "";
1957
- if (v)
1958
- switch (v) {
1959
- case zr:
1960
- return w;
1961
- case Yr:
1962
- return g;
1963
- case $r:
1964
- return A;
1965
- case qr:
1966
- return F;
1967
- case Hr:
1968
- return O;
1969
- }
1970
- return u;
1971
- });
1972
- var eo = Un(/* @__PURE__ */ function() {
1973
- return arguments;
1974
- }()) ? Un : function(s) {
1975
- return Ve(s) && re.call(s, "callee") && !Rn.call(s, "callee");
1976
- }, pt = Array.isArray, $t = Gr || function() {
1977
- return !1;
1978
- };
1979
- function Jn(s) {
1980
- if (!Yn(s))
1981
- return !1;
1982
- var u = je(s);
1983
- return u == h || u == "[object GeneratorFunction]" || u == "[object AsyncFunction]" || u == "[object Proxy]";
1984
- }
1985
- function zn(s) {
1986
- return typeof s == "number" && s > -1 && s % 1 == 0 && s <= r;
1987
- }
1988
- function Yn(s) {
1989
- var u = typeof s;
1990
- return s != null && (u == "object" || u == "function");
1991
- }
1992
- function Ve(s) {
1993
- return s != null && typeof s == "object";
1994
- }
1995
- var $n = In ? /* @__PURE__ */ function(s) {
1996
- return function(u) {
1997
- return s(u);
1998
- };
1999
- }(In) : function(s) {
2000
- return Ve(s) && zn(s.length) && !!M[je(s)];
2001
- };
2002
- function to(s) {
2003
- return (u = s) != null && zn(u.length) && !Jn(u) ? Xr(s) : Wr(s);
2004
- var u;
2005
- }
2006
- e.exports = function(s, u) {
2007
- return jn(s, u);
2008
- };
2009
- })(kt, kt.exports);
2010
- var _n = de(kt.exports);
2011
- function bn(e, t) {
2012
- return e.length === t.length && JSON.stringify(e.map(function(n) {
2013
- return n;
2014
- }).sort()) === JSON.stringify(t.map(function(n) {
2015
- return n;
2016
- }).sort());
2017
- }
2018
- var Nr = { Polygon: W, LineString: ie, Point: me, MultiPolygon: $, MultiLineString: $, MultiPoint: $ }, Ar = Object.freeze({ __proto__: null, CommonSelectors: dr, constrainFeatureMovement: Rt, createMidPoint: un, createSupplementaryPoints: Ke, createVertex: Le, doubleClickZoom: ee, euclideanDistance: It, featuresAt: xe, getFeatureAtAndSetCursors: Ye, isClick: xt, isEventAtCoordinates: it, isTap: Mt, mapEventToBoundingBox: en, ModeHandler: ze, moveFeatures: Dt, sortFeatures: Qt, stringSetsAreEqual: bn, StringSet: Z, theme: an, toDenseArray: Re }), Pr = function(e, t) {
2019
- var n = { options: e = function(o) {
2020
- o === void 0 && (o = {});
2021
- var i = pe(o);
2022
- return o.controls || (i.controls = {}), o.displayControlsDefault === !1 ? i.controls = pe(Lr, o.controls) : i.controls = pe(Mr, o.controls), (i = pe(xr, i)).styles = mn(i.styles, "cold").concat(mn(i.styles, "hot")), i;
2023
- }(e) };
2024
- t = function(o, i) {
2025
- return i.modes = T, i.getFeatureIdsAt = function(a) {
2026
- return xe.click({ point: a }, null, o).map(function(l) {
2027
- return l.properties.id;
2028
- });
2029
- }, i.getSelectedIds = function() {
2030
- return o.store.getSelectedIds();
2031
- }, i.getSelected = function() {
2032
- return { type: m.FEATURE_COLLECTION, features: o.store.getSelectedIds().map(function(a) {
2033
- return o.store.get(a);
2034
- }).map(function(a) {
2035
- return a.toGeoJSON();
2036
- }) };
2037
- }, i.getSelectedPoints = function() {
2038
- return { type: m.FEATURE_COLLECTION, features: o.store.getSelectedCoordinates().map(function(a) {
2039
- return { type: m.FEATURE, properties: {}, geometry: { type: m.POINT, coordinates: a.coordinates } };
2040
- }) };
2041
- }, i.set = function(a) {
2042
- if (a.type === void 0 || a.type !== m.FEATURE_COLLECTION || !Array.isArray(a.features))
2043
- throw new Error("Invalid FeatureCollection");
2044
- var l = o.store.createRenderBatch(), d = o.store.getAllIds().slice(), h = i.add(a), g = new Z(h);
2045
- return (d = d.filter(function(p) {
2046
- return !g.has(p);
2047
- })).length && i.delete(d), l(), h;
2048
- }, i.add = function(a) {
2049
- var l = JSON.parse(JSON.stringify(gr(a))).features.map(function(d) {
2050
- if (d.id = d.id || Nt(), d.geometry === null)
2051
- throw new Error("Invalid geometry: null");
2052
- if (o.store.get(d.id) === void 0 || o.store.get(d.id).type !== d.geometry.type) {
2053
- var h = Nr[d.geometry.type];
2054
- if (h === void 0)
2055
- throw new Error("Invalid geometry type: " + d.geometry.type + ".");
2056
- var g = new h(o, d);
2057
- o.store.add(g);
2058
- } else {
2059
- var p = o.store.get(d.id);
2060
- p.properties = d.properties, _n(p.properties, d.properties) || o.store.featureChanged(p.id), _n(p.getCoordinates(), d.geometry.coordinates) || p.incomingCoords(d.geometry.coordinates);
2061
- }
2062
- return d.id;
2063
- });
2064
- return o.store.render(), l;
2065
- }, i.get = function(a) {
2066
- var l = o.store.get(a);
2067
- if (l)
2068
- return l.toGeoJSON();
2069
- }, i.getAll = function() {
2070
- return { type: m.FEATURE_COLLECTION, features: o.store.getAll().map(function(a) {
2071
- return a.toGeoJSON();
2072
- }) };
2073
- }, i.delete = function(a) {
2074
- return o.store.delete(a, { silent: !0 }), i.getMode() !== T.DIRECT_SELECT || o.store.getSelectedIds().length ? o.store.render() : o.events.changeMode(T.SIMPLE_SELECT, void 0, { silent: !0 }), i;
2075
- }, i.deleteAll = function() {
2076
- return o.store.delete(o.store.getAllIds(), { silent: !0 }), i.getMode() === T.DIRECT_SELECT ? o.events.changeMode(T.SIMPLE_SELECT, void 0, { silent: !0 }) : o.store.render(), i;
2077
- }, i.changeMode = function(a, l) {
2078
- return l === void 0 && (l = {}), a === T.SIMPLE_SELECT && i.getMode() === T.SIMPLE_SELECT ? (bn(l.featureIds || [], o.store.getSelectedIds()) || (o.store.setSelected(l.featureIds, { silent: !0 }), o.store.render()), i) : (a === T.DIRECT_SELECT && i.getMode() === T.DIRECT_SELECT && l.featureId === o.store.getSelectedIds()[0] || o.events.changeMode(a, l, { silent: !0 }), i);
2079
- }, i.getMode = function() {
2080
- return o.events.getMode();
2081
- }, i.trash = function() {
2082
- return o.events.trash({ silent: !0 }), i;
2083
- }, i.combineFeatures = function() {
2084
- return o.events.combineFeatures({ silent: !0 }), i;
2085
- }, i.uncombineFeatures = function() {
2086
- return o.events.uncombineFeatures({ silent: !0 }), i;
2087
- }, i.setFeatureProperty = function(a, l, d) {
2088
- return o.store.setFeatureProperty(a, l, d), i;
2089
- }, i;
2090
- }(n, t), n.api = t;
2091
- var r = lr(n);
2092
- return t.onAdd = r.onAdd, t.onRemove = r.onRemove, t.types = Y, t.options = e, t;
2093
- };
2094
- function at(e) {
2095
- Pr(e, this);
2096
- }
2097
- return at.modes = vn, at.constants = er, at.lib = Ar, at;
2098
- });
2099
- })(Zn);
2100
- var io = Zn.exports;
2101
- const co = /* @__PURE__ */ oo(io);
1
+ const e = {
2
+ type: "circle",
3
+ paint: {
4
+ "circle-radius": [
5
+ "interpolate",
6
+ ["linear"],
7
+ ["number", ["get", "point_count"], 1],
8
+ 0,
9
+ 4,
10
+ 10,
11
+ 14
12
+ ],
13
+ "circle-stroke-width": 1,
14
+ "circle-color": [
15
+ "case",
16
+ ["boolean", ["feature-state", "hover"], !1],
17
+ "#3b62ff",
18
+ "#ff623b"
19
+ ],
20
+ "circle-stroke-color": "#8d260c"
21
+ }
22
+ }, t = {
23
+ type: "fill",
24
+ paint: {
25
+ "fill-color": "#ff623b",
26
+ "fill-opacity": 0.2
27
+ }
28
+ }, l = {
29
+ type: "line",
30
+ paint: {
31
+ "line-color": "#ff623b",
32
+ "line-opacity": 0.6
33
+ }
34
+ }, o = {
35
+ point: e,
36
+ fill: t,
37
+ stroke: l
38
+ };
2102
39
  export {
2103
- co as default
40
+ o as default
2104
41
  };
2105
42
  //# sourceMappingURL=index.es10.js.map