@trailstash/ultra 3.0.0-dev

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 (415) hide show
  1. package/.gitlab-ci.yml +15 -0
  2. package/Examples/alt-bbox-format.ultra +9 -0
  3. package/Examples/atp-usps-dropboxes.ultra +68 -0
  4. package/Examples/bike-infra.ultra +111 -0
  5. package/Examples/contribution-heatmap.ultra +17 -0
  6. package/Examples/custom-style.ultra +114 -0
  7. package/Examples/glow-effect.ultra +27 -0
  8. package/Examples/index.md +7 -0
  9. package/Examples/landmarks-prototype.ultra +68 -0
  10. package/Examples/minimalist-ski-map.ultra +55 -0
  11. package/Examples/opentrailstash-3d.ultra +40 -0
  12. package/Examples/overture-landcover-plus-hillshade.ultra +45 -0
  13. package/Examples/overture-places-and-osm.ultra +29 -0
  14. package/Examples/trees.ultra +60 -0
  15. package/Examples/wikidata-photo.ultra +28 -0
  16. package/Examples/within-bounds.ultra +12 -0
  17. package/LICENSE +23 -0
  18. package/MapLibre-Examples/3d-buildings.ultra +43 -0
  19. package/MapLibre-Examples/3d-extrusion-floorplan.ultra +28 -0
  20. package/MapLibre-Examples/3d-terrain.ultra +39 -0
  21. package/MapLibre-Examples/add-image.ultra +26 -0
  22. package/MapLibre-Examples/attribution-position.ultra +12 -0
  23. package/MapLibre-Examples/change-case-of-labels.ultra +26 -0
  24. package/MapLibre-Examples/cluster.ultra +59 -0
  25. package/MapLibre-Examples/cooperative-gestures.ultra +11 -0
  26. package/MapLibre-Examples/custom-marker-icons.ultra +65 -0
  27. package/MapLibre-Examples/data-driven-lines.ultra +169 -0
  28. package/MapLibre-Examples/disable-rotation.ultra +11 -0
  29. package/MapLibre-Examples/disable-scroll-zoom.ultra +9 -0
  30. package/MapLibre-Examples/display-and-style-rich-text-labels.ultra +22 -0
  31. package/MapLibre-Examples/fill-pattern.ultra +43 -0
  32. package/MapLibre-Examples/fullscreen.ultra +10 -0
  33. package/MapLibre-Examples/geojson-layer-in-stack.ultra +23 -0
  34. package/MapLibre-Examples/geojson-line.ultra +114 -0
  35. package/MapLibre-Examples/geojson-markers.ultra +217 -0
  36. package/MapLibre-Examples/geojson-polygon.ultra +104 -0
  37. package/MapLibre-Examples/heatmap-layer.ultra +111 -0
  38. package/MapLibre-Examples/index.md +4 -0
  39. package/MapLibre-Examples/locate-user.ultra +14 -0
  40. package/MapLibre-Examples/map-tiles.ultra +9 -0
  41. package/MapLibre-Examples/pmtiles.ultra +25 -0
  42. package/MapLibre-Examples/wms.ultra +14 -0
  43. package/README.md +46 -0
  44. package/bin/dev.cmd +3 -0
  45. package/bin/dev.js +6 -0
  46. package/bin/run.cmd +3 -0
  47. package/bin/run.js +5 -0
  48. package/build-examples-docs.js +104 -0
  49. package/build-examples-images.js +87 -0
  50. package/build-sprites.sh +30 -0
  51. package/cli/build.js +53 -0
  52. package/cli/serve.js +34 -0
  53. package/components/button-modal.js +111 -0
  54. package/components/button.css +22 -0
  55. package/components/button.js +6 -0
  56. package/components/code-editor.js +87 -0
  57. package/components/download-button.js +69 -0
  58. package/components/fontawesome-icon.js +80 -0
  59. package/components/fs-button.js +52 -0
  60. package/components/help-modal.js +98 -0
  61. package/components/map-popup.js +57 -0
  62. package/components/nav-bar.js +76 -0
  63. package/components/run-button.js +78 -0
  64. package/components/share-button.js +35 -0
  65. package/components/share-modal.js +139 -0
  66. package/components/style-picker.js +47 -0
  67. package/components/ultra-ide.js +298 -0
  68. package/components/ultra-loader.js +60 -0
  69. package/components/ultra-map.js +312 -0
  70. package/configs/minimal.js +9 -0
  71. package/configs/overpass-ultra.js +185 -0
  72. package/docs/assets/Examples/alt-bbox-format.png +0 -0
  73. package/docs/assets/Examples/atp-usps-dropboxes.png +0 -0
  74. package/docs/assets/Examples/bike-infra.png +0 -0
  75. package/docs/assets/Examples/contribution-heatmap.png +0 -0
  76. package/docs/assets/Examples/custom-style.png +0 -0
  77. package/docs/assets/Examples/glow-effect.png +0 -0
  78. package/docs/assets/Examples/landmarks-prototype.png +0 -0
  79. package/docs/assets/Examples/minimalist-ski-map.png +0 -0
  80. package/docs/assets/Examples/opentrailstash-3d.png +0 -0
  81. package/docs/assets/Examples/overture-landcover-plus-hillshade.png +0 -0
  82. package/docs/assets/Examples/overture-places-and-osm.png +0 -0
  83. package/docs/assets/Examples/trees.png +0 -0
  84. package/docs/assets/Examples/wikidata-photo.png +0 -0
  85. package/docs/assets/Examples/within-bounds.png +0 -0
  86. package/docs/assets/MapLibre-Examples/3d-buildings.png +0 -0
  87. package/docs/assets/MapLibre-Examples/3d-extrusion-floorplan.png +0 -0
  88. package/docs/assets/MapLibre-Examples/3d-terrain.png +0 -0
  89. package/docs/assets/MapLibre-Examples/add-image.png +0 -0
  90. package/docs/assets/MapLibre-Examples/attribution-position.png +0 -0
  91. package/docs/assets/MapLibre-Examples/change-case-of-labels.png +0 -0
  92. package/docs/assets/MapLibre-Examples/cluster.png +0 -0
  93. package/docs/assets/MapLibre-Examples/cooperative-gestures.png +0 -0
  94. package/docs/assets/MapLibre-Examples/custom-marker-icons.png +0 -0
  95. package/docs/assets/MapLibre-Examples/data-driven-lines.png +0 -0
  96. package/docs/assets/MapLibre-Examples/disable-rotation.png +0 -0
  97. package/docs/assets/MapLibre-Examples/disable-scroll-zoom.png +0 -0
  98. package/docs/assets/MapLibre-Examples/display-and-style-rich-text-labels.png +0 -0
  99. package/docs/assets/MapLibre-Examples/fill-pattern.png +0 -0
  100. package/docs/assets/MapLibre-Examples/fullscreen.png +0 -0
  101. package/docs/assets/MapLibre-Examples/geojson-layer-in-stack.png +0 -0
  102. package/docs/assets/MapLibre-Examples/geojson-line.png +0 -0
  103. package/docs/assets/MapLibre-Examples/geojson-markers.png +0 -0
  104. package/docs/assets/MapLibre-Examples/geojson-polygon.png +0 -0
  105. package/docs/assets/MapLibre-Examples/heatmap-layer.png +0 -0
  106. package/docs/assets/MapLibre-Examples/locate-user.png +0 -0
  107. package/docs/assets/MapLibre-Examples/map-tiles.png +0 -0
  108. package/docs/assets/MapLibre-Examples/pmtiles.png +0 -0
  109. package/docs/assets/MapLibre-Examples/wms.png +0 -0
  110. package/docs/assets/data/Examples/atp_usps_collection_boxes.geojson +1 -0
  111. package/docs/further-reading.md +15 -0
  112. package/docs/index.md +55 -0
  113. package/docs/overrides/partials/integrations/analytics/custom.html +11 -0
  114. package/docs/query-shortcuts.md +21 -0
  115. package/docs/style.md +120 -0
  116. package/docs/url-parameters.md +45 -0
  117. package/docs/yaml.md +117 -0
  118. package/index.js +53 -0
  119. package/lib/base.css +12 -0
  120. package/lib/bounds.js +8 -0
  121. package/lib/dom.js +21 -0
  122. package/lib/glyphFallback.js +31 -0
  123. package/lib/localStorage.js +34 -0
  124. package/lib/normalize.js +5 -0
  125. package/lib/queryMap.js +50 -0
  126. package/lib/queryParams.js +142 -0
  127. package/lib/queryProviders/auto.js +47 -0
  128. package/lib/queryProviders/geojson.js +134 -0
  129. package/lib/queryProviders/gpx.js +101 -0
  130. package/lib/queryProviders/index.js +22 -0
  131. package/lib/queryProviders/kml.js +132 -0
  132. package/lib/queryProviders/osm.js +199 -0
  133. package/lib/queryProviders/overpass.js +162 -0
  134. package/lib/queryProviders/raster.js +23 -0
  135. package/lib/queryProviders/tcx.js +105 -0
  136. package/lib/queryProviders/vector.js +13 -0
  137. package/lib/settings.js +72 -0
  138. package/lib/sprites.js +18 -0
  139. package/lib/style.js +222 -0
  140. package/mkdocs.yml +26 -0
  141. package/package.json +80 -0
  142. package/screenshot.png +0 -0
  143. package/static/embed.js +18 -0
  144. package/static/font/0-255.pbf +0 -0
  145. package/static/font/1024-1279.pbf +0 -0
  146. package/static/font/10240-10495.pbf +3 -0
  147. package/static/font/10496-10751.pbf +0 -0
  148. package/static/font/10752-11007.pbf +3 -0
  149. package/static/font/11008-11263.pbf +0 -0
  150. package/static/font/11264-11519.pbf +0 -0
  151. package/static/font/11520-11775.pbf +0 -0
  152. package/static/font/11776-12031.pbf +0 -0
  153. package/static/font/12032-12287.pbf +0 -0
  154. package/static/font/12288-12543.pbf +0 -0
  155. package/static/font/12544-12799.pbf +0 -0
  156. package/static/font/1280-1535.pbf +0 -0
  157. package/static/font/12800-13055.pbf +0 -0
  158. package/static/font/13056-13311.pbf +0 -0
  159. package/static/font/13312-13567.pbf +0 -0
  160. package/static/font/13568-13823.pbf +0 -0
  161. package/static/font/13824-14079.pbf +0 -0
  162. package/static/font/14080-14335.pbf +0 -0
  163. package/static/font/14336-14591.pbf +0 -0
  164. package/static/font/14592-14847.pbf +0 -0
  165. package/static/font/14848-15103.pbf +0 -0
  166. package/static/font/15104-15359.pbf +0 -0
  167. package/static/font/1536-1791.pbf +0 -0
  168. package/static/font/15360-15615.pbf +0 -0
  169. package/static/font/15616-15871.pbf +0 -0
  170. package/static/font/15872-16127.pbf +0 -0
  171. package/static/font/16128-16383.pbf +0 -0
  172. package/static/font/16384-16639.pbf +0 -0
  173. package/static/font/16640-16895.pbf +0 -0
  174. package/static/font/16896-17151.pbf +0 -0
  175. package/static/font/17152-17407.pbf +0 -0
  176. package/static/font/17408-17663.pbf +0 -0
  177. package/static/font/17664-17919.pbf +0 -0
  178. package/static/font/1792-2047.pbf +0 -0
  179. package/static/font/17920-18175.pbf +0 -0
  180. package/static/font/18176-18431.pbf +0 -0
  181. package/static/font/18432-18687.pbf +0 -0
  182. package/static/font/18688-18943.pbf +0 -0
  183. package/static/font/18944-19199.pbf +0 -0
  184. package/static/font/19200-19455.pbf +0 -0
  185. package/static/font/19456-19711.pbf +0 -0
  186. package/static/font/19712-19967.pbf +0 -0
  187. package/static/font/19968-20223.pbf +0 -0
  188. package/static/font/20224-20479.pbf +0 -0
  189. package/static/font/2048-2303.pbf +0 -0
  190. package/static/font/20480-20735.pbf +0 -0
  191. package/static/font/20736-20991.pbf +0 -0
  192. package/static/font/20992-21247.pbf +0 -0
  193. package/static/font/21248-21503.pbf +0 -0
  194. package/static/font/21504-21759.pbf +0 -0
  195. package/static/font/21760-22015.pbf +0 -0
  196. package/static/font/22016-22271.pbf +0 -0
  197. package/static/font/22272-22527.pbf +192 -26
  198. package/static/font/22528-22783.pbf +0 -0
  199. package/static/font/22784-23039.pbf +0 -0
  200. package/static/font/2304-2559.pbf +0 -0
  201. package/static/font/23040-23295.pbf +0 -0
  202. package/static/font/23296-23551.pbf +0 -0
  203. package/static/font/23552-23807.pbf +0 -0
  204. package/static/font/23808-24063.pbf +0 -0
  205. package/static/font/24064-24319.pbf +0 -0
  206. package/static/font/24320-24575.pbf +0 -0
  207. package/static/font/24576-24831.pbf +0 -0
  208. package/static/font/24832-25087.pbf +0 -0
  209. package/static/font/25088-25343.pbf +0 -0
  210. package/static/font/25344-25599.pbf +0 -0
  211. package/static/font/256-511.pbf +0 -0
  212. package/static/font/2560-2815.pbf +0 -0
  213. package/static/font/25600-25855.pbf +0 -0
  214. package/static/font/25856-26111.pbf +0 -0
  215. package/static/font/26112-26367.pbf +0 -0
  216. package/static/font/26368-26623.pbf +0 -0
  217. package/static/font/26624-26879.pbf +0 -0
  218. package/static/font/26880-27135.pbf +0 -0
  219. package/static/font/27136-27391.pbf +0 -0
  220. package/static/font/27392-27647.pbf +0 -0
  221. package/static/font/27648-27903.pbf +0 -0
  222. package/static/font/27904-28159.pbf +0 -0
  223. package/static/font/2816-3071.pbf +0 -0
  224. package/static/font/28160-28415.pbf +0 -0
  225. package/static/font/28416-28671.pbf +0 -0
  226. package/static/font/28672-28927.pbf +0 -0
  227. package/static/font/28928-29183.pbf +0 -0
  228. package/static/font/29184-29439.pbf +0 -0
  229. package/static/font/29440-29695.pbf +0 -0
  230. package/static/font/29696-29951.pbf +0 -0
  231. package/static/font/29952-30207.pbf +0 -0
  232. package/static/font/30208-30463.pbf +0 -0
  233. package/static/font/30464-30719.pbf +0 -0
  234. package/static/font/3072-3327.pbf +0 -0
  235. package/static/font/30720-30975.pbf +0 -0
  236. package/static/font/30976-31231.pbf +0 -0
  237. package/static/font/31232-31487.pbf +0 -0
  238. package/static/font/31488-31743.pbf +0 -0
  239. package/static/font/31744-31999.pbf +0 -0
  240. package/static/font/32000-32255.pbf +0 -0
  241. package/static/font/32256-32511.pbf +0 -0
  242. package/static/font/32512-32767.pbf +0 -0
  243. package/static/font/32768-33023.pbf +0 -0
  244. package/static/font/33024-33279.pbf +0 -0
  245. package/static/font/3328-3583.pbf +0 -0
  246. package/static/font/33280-33535.pbf +0 -0
  247. package/static/font/33536-33791.pbf +0 -0
  248. package/static/font/33792-34047.pbf +0 -0
  249. package/static/font/34048-34303.pbf +0 -0
  250. package/static/font/34304-34559.pbf +0 -0
  251. package/static/font/34560-34815.pbf +0 -0
  252. package/static/font/34816-35071.pbf +0 -0
  253. package/static/font/35072-35327.pbf +0 -0
  254. package/static/font/35328-35583.pbf +0 -0
  255. package/static/font/35584-35839.pbf +0 -0
  256. package/static/font/3584-3839.pbf +0 -0
  257. package/static/font/35840-36095.pbf +0 -0
  258. package/static/font/36096-36351.pbf +0 -0
  259. package/static/font/36352-36607.pbf +0 -0
  260. package/static/font/36608-36863.pbf +0 -0
  261. package/static/font/36864-37119.pbf +0 -0
  262. package/static/font/37120-37375.pbf +0 -0
  263. package/static/font/37376-37631.pbf +0 -0
  264. package/static/font/37632-37887.pbf +0 -0
  265. package/static/font/37888-38143.pbf +0 -0
  266. package/static/font/38144-38399.pbf +0 -0
  267. package/static/font/3840-4095.pbf +0 -0
  268. package/static/font/38400-38655.pbf +45 -4
  269. package/static/font/38656-38911.pbf +0 -0
  270. package/static/font/38912-39167.pbf +0 -0
  271. package/static/font/39168-39423.pbf +0 -0
  272. package/static/font/39424-39679.pbf +0 -0
  273. package/static/font/39680-39935.pbf +0 -0
  274. package/static/font/39936-40191.pbf +0 -0
  275. package/static/font/40192-40447.pbf +0 -0
  276. package/static/font/40448-40703.pbf +0 -0
  277. package/static/font/40704-40959.pbf +0 -0
  278. package/static/font/4096-4351.pbf +0 -0
  279. package/static/font/40960-41215.pbf +3 -0
  280. package/static/font/41216-41471.pbf +3 -0
  281. package/static/font/41472-41727.pbf +3 -0
  282. package/static/font/41728-41983.pbf +3 -0
  283. package/static/font/41984-42239.pbf +3 -0
  284. package/static/font/42240-42495.pbf +3 -0
  285. package/static/font/42496-42751.pbf +3 -0
  286. package/static/font/42752-43007.pbf +0 -0
  287. package/static/font/43008-43263.pbf +0 -0
  288. package/static/font/43264-43519.pbf +0 -0
  289. package/static/font/4352-4607.pbf +0 -0
  290. package/static/font/43520-43775.pbf +0 -0
  291. package/static/font/43776-44031.pbf +0 -0
  292. package/static/font/44032-44287.pbf +0 -0
  293. package/static/font/44288-44543.pbf +0 -0
  294. package/static/font/44544-44799.pbf +0 -0
  295. package/static/font/44800-45055.pbf +0 -0
  296. package/static/font/45056-45311.pbf +0 -0
  297. package/static/font/45312-45567.pbf +0 -0
  298. package/static/font/45568-45823.pbf +0 -0
  299. package/static/font/45824-46079.pbf +0 -0
  300. package/static/font/4608-4863.pbf +0 -0
  301. package/static/font/46080-46335.pbf +0 -0
  302. package/static/font/46336-46591.pbf +0 -0
  303. package/static/font/46592-46847.pbf +0 -0
  304. package/static/font/46848-47103.pbf +0 -0
  305. package/static/font/47104-47359.pbf +0 -0
  306. package/static/font/47360-47615.pbf +0 -0
  307. package/static/font/47616-47871.pbf +0 -0
  308. package/static/font/47872-48127.pbf +0 -0
  309. package/static/font/48128-48383.pbf +0 -0
  310. package/static/font/48384-48639.pbf +0 -0
  311. package/static/font/4864-5119.pbf +0 -0
  312. package/static/font/48640-48895.pbf +0 -0
  313. package/static/font/48896-49151.pbf +0 -0
  314. package/static/font/49152-49407.pbf +0 -0
  315. package/static/font/49408-49663.pbf +0 -0
  316. package/static/font/49664-49919.pbf +0 -0
  317. package/static/font/49920-50175.pbf +0 -0
  318. package/static/font/50176-50431.pbf +0 -0
  319. package/static/font/50432-50687.pbf +0 -0
  320. package/static/font/50688-50943.pbf +0 -0
  321. package/static/font/50944-51199.pbf +0 -0
  322. package/static/font/512-767.pbf +0 -0
  323. package/static/font/5120-5375.pbf +3 -0
  324. package/static/font/51200-51455.pbf +0 -0
  325. package/static/font/51456-51711.pbf +0 -0
  326. package/static/font/51712-51967.pbf +0 -0
  327. package/static/font/51968-52223.pbf +0 -0
  328. package/static/font/52224-52479.pbf +0 -0
  329. package/static/font/52480-52735.pbf +0 -0
  330. package/static/font/52736-52991.pbf +0 -0
  331. package/static/font/52992-53247.pbf +0 -0
  332. package/static/font/53248-53503.pbf +0 -0
  333. package/static/font/53504-53759.pbf +0 -0
  334. package/static/font/5376-5631.pbf +3 -0
  335. package/static/font/53760-54015.pbf +0 -0
  336. package/static/font/54016-54271.pbf +0 -0
  337. package/static/font/54272-54527.pbf +0 -0
  338. package/static/font/54528-54783.pbf +0 -0
  339. package/static/font/54784-55039.pbf +0 -0
  340. package/static/font/55040-55295.pbf +0 -0
  341. package/static/font/55296-55551.pbf +3 -0
  342. package/static/font/55552-55807.pbf +3 -0
  343. package/static/font/55808-56063.pbf +3 -0
  344. package/static/font/56064-56319.pbf +3 -0
  345. package/static/font/5632-5887.pbf +3 -0
  346. package/static/font/56320-56575.pbf +3 -0
  347. package/static/font/56576-56831.pbf +3 -0
  348. package/static/font/56832-57087.pbf +3 -0
  349. package/static/font/57088-57343.pbf +3 -0
  350. package/static/font/57344-57599.pbf +3 -0
  351. package/static/font/57600-57855.pbf +3 -0
  352. package/static/font/57856-58111.pbf +3 -0
  353. package/static/font/58112-58367.pbf +3 -0
  354. package/static/font/58368-58623.pbf +3 -0
  355. package/static/font/58624-58879.pbf +3 -0
  356. package/static/font/5888-6143.pbf +0 -0
  357. package/static/font/58880-59135.pbf +3 -0
  358. package/static/font/59136-59391.pbf +3 -0
  359. package/static/font/59392-59647.pbf +3 -0
  360. package/static/font/59648-59903.pbf +3 -0
  361. package/static/font/59904-60159.pbf +3 -0
  362. package/static/font/60160-60415.pbf +3 -0
  363. package/static/font/60416-60671.pbf +3 -0
  364. package/static/font/60672-60927.pbf +3 -0
  365. package/static/font/60928-61183.pbf +3 -0
  366. package/static/font/61184-61439.pbf +3 -0
  367. package/static/font/6144-6399.pbf +0 -0
  368. package/static/font/61440-61695.pbf +3 -0
  369. package/static/font/61696-61951.pbf +3 -0
  370. package/static/font/61952-62207.pbf +3 -0
  371. package/static/font/62208-62463.pbf +3 -0
  372. package/static/font/62464-62719.pbf +3 -0
  373. package/static/font/62720-62975.pbf +3 -0
  374. package/static/font/62976-63231.pbf +3 -0
  375. package/static/font/63232-63487.pbf +3 -0
  376. package/static/font/63488-63743.pbf +3 -0
  377. package/static/font/63744-63999.pbf +0 -0
  378. package/static/font/6400-6655.pbf +0 -0
  379. package/static/font/64000-64255.pbf +0 -0
  380. package/static/font/64256-64511.pbf +0 -0
  381. package/static/font/64512-64767.pbf +0 -0
  382. package/static/font/64768-65023.pbf +0 -0
  383. package/static/font/65024-65279.pbf +0 -0
  384. package/static/font/65280-65535.pbf +0 -0
  385. package/static/font/6656-6911.pbf +3 -0
  386. package/static/font/6912-7167.pbf +0 -0
  387. package/static/font/7168-7423.pbf +0 -0
  388. package/static/font/7424-7679.pbf +0 -0
  389. package/static/font/768-1023.pbf +0 -0
  390. package/static/font/7680-7935.pbf +0 -0
  391. package/static/font/7936-8191.pbf +0 -0
  392. package/static/font/8192-8447.pbf +0 -0
  393. package/static/font/8448-8703.pbf +0 -0
  394. package/static/font/8704-8959.pbf +0 -0
  395. package/static/font/8960-9215.pbf +0 -0
  396. package/static/font/9216-9471.pbf +0 -0
  397. package/static/font/9472-9727.pbf +0 -0
  398. package/static/font/9728-9983.pbf +0 -0
  399. package/static/font/9984-10239.pbf +0 -0
  400. package/static/index.html +59 -0
  401. package/static/logo.png +0 -0
  402. package/static/logo.svg +78 -0
  403. package/static/mapbox-gl-rtl-text@0.2.3.js +9851 -0
  404. package/static/minimal.js +9 -0
  405. package/static/minimal.json +7 -0
  406. package/static/sprites/maki.json +1706 -0
  407. package/static/sprites/maki.license +116 -0
  408. package/static/sprites/maki.png +0 -0
  409. package/static/sprites/maki@2x.json +1706 -0
  410. package/static/sprites/maki@2x.png +0 -0
  411. package/static/sprites/temaki.json +4306 -0
  412. package/static/sprites/temaki.license +118 -0
  413. package/static/sprites/temaki.png +0 -0
  414. package/static/sprites/temaki@2x.json +4306 -0
  415. package/static/sprites/temaki@2x.png +0 -0
@@ -0,0 +1,15 @@
1
+ Here are some more resources on Overpass Ultra:
2
+
3
+ ## OSM Wiki
4
+
5
+ [Overpass Ultra on the OpenStreetMap Wiki](https://wiki.openstreetmap.org/wiki/Overpass_Ultra)
6
+
7
+ ## Diary Entries
8
+
9
+ - [Introducing Overpass Ultra v2](https://www.openstreetmap.org/user/dpschep/diary/403263)
10
+ - [Some Overpass Ultra Updates](https://www.openstreetmap.org/user/dpschep/diary/404330)
11
+
12
+ ## Third party blog posts
13
+
14
+ - [Ultraschnell: Overpass Ultra](https://geoobserver.wordpress.com/2024/01/25/ultraschnell-overpass-ultra/) 🇩🇪
15
+ - [Overpass Ultra & MapLibre: Heatmaps](https://geoobserver.wordpress.com/2024/02/23/overpass-ultra-maplibre-heatmaps/) 🇩🇪
package/docs/index.md ADDED
@@ -0,0 +1,55 @@
1
+ # Introduction
2
+
3
+ <img alt="powered by Overpass API" style="float: right" src="https://wiki.openstreetmap.org/w/images/b/b3/Powered_by_Overpass_API.png">
4
+
5
+ [Overpass Ultra](https://overpass-ultra.us) is a web-application made to simplify making maps with [MapLibre GL
6
+ JS](https://maplibre.org) and [OpenStreetMap](https://openstreetmap.org) data, powered by the
7
+ [Overpass API](https://overpass-api.de/) and
8
+ [`osmtogeojson`](https://github.com/tyrasd/osmtogeojson)
9
+
10
+ The customization of the map comply with an [extended](https://overpass-ultra.us/docs/style#ultra-maplibre-styles) version
11
+ of the the [MapLibre Style Spec](https://maplibre.org/maplibre-style-spec/).
12
+
13
+ ## Documentation
14
+
15
+ The documentation for Overpass Ultra is available at <a target="_blank" href="https://overpass-ultra.us/docs/">overpass-ultra.us/docs</a>
16
+
17
+ ## Overpass Queries
18
+
19
+ Overpass API allows to query for OSM data by your own search criteria. For this purpose, it has a
20
+ specifically crafted query language: [Overpass
21
+ QL](https://wiki.openstreetmap.org/wiki/Overpass_API/Overpass_QL)
22
+
23
+ In addition to regular Overpass API queries one can use `{{bbox}}` to specify the bounding box
24
+ coordinates of the current map view.
25
+
26
+ ## Configuration
27
+
28
+ Various aspects of Overpass Ultra, such as styling and the Overpass API server to use, can be
29
+ configured via [YAML front-matter](https://overpass-ultra.us/docs/yaml).
30
+
31
+ ## Styling
32
+
33
+ Overpass Ultra supports styling using the [MapLibre Style
34
+ Specification](https://maplibre.org/maplibre-style-spec/).
35
+
36
+ See the [Styling](https://overpass-ultra.us/docs/style) section for more information.
37
+
38
+ ## About
39
+
40
+ Overpass Ultra is built by Daniel Schep.
41
+
42
+ You can contact me on [Mastodon](https://mapstodon.space/@trailstash).
43
+
44
+ ## Feedback, Bug Reports, Feature Requests
45
+
46
+ While Overpass Ultra has been in development for a while, it should still be considered
47
+ experimental.
48
+
49
+ If you would like to report a bug or provide other feedback, please do so in the project's
50
+ [Issue Tracker](https://gitlab.com/trailstash/overpass-ultra/-/issues).
51
+
52
+ ## Source Code</h4>
53
+
54
+ The [source code](https://gitlab.com/trailstash/overpass-ultra) of this application is released under the
55
+ [MIT license](https://gitlab.com/trailstash/overpass-ultra/-/blob/master/LICENSE).
@@ -0,0 +1,11 @@
1
+ <script
2
+ async
3
+ defer
4
+ src="https://sa.trailsta.sh/latest.js"
5
+ ></script>
6
+ <noscript
7
+ ><img
8
+ src="https://sa.trailsta.sh/noscript.gif"
9
+ alt=""
10
+ referrerpolicy="no-referrer-when-downgrade"
11
+ /></noscript>
@@ -0,0 +1,21 @@
1
+ In order to allow for querying Overpass with the extents of the MapLibre viewport, Overpass Ultra
2
+ replaces any occurences of `{{bbox}}` in the query with the bounding box in the format expected by
3
+ the Overpass API.
4
+
5
+ For example:
6
+ ```
7
+ [bbox:{{bbox}}];
8
+ nwr[shop];
9
+ out center;
10
+ ```
11
+
12
+ ### Other formats
13
+ If you need to specify the coordinates in a different order, you can use the following shortcuts
14
+ for the min and max of both lattitude and longitude:
15
+
16
+ * `{{south}}`
17
+ * `{{north}}`
18
+ * `{{east}}`
19
+ * `{{west}}`
20
+
21
+ [Example](./Examples/alt-bbox-format.md)
package/docs/style.md ADDED
@@ -0,0 +1,120 @@
1
+ # Styling
2
+
3
+ The MapLibre styling can be attached to a query written in the Overpass-QL query language via the
4
+ `style:` key of the [YAML front-matter](./yaml.md).
5
+
6
+ ```
7
+ ---
8
+ style: ... your MapLibre style here ...
9
+ ---
10
+ ... your overpass query here ...
11
+ ```
12
+
13
+ The value of the style: key can contain:
14
+
15
+ * a URL to a MapLibre style
16
+ * a full MapLibre style object
17
+ * a Ultra MapLibre style
18
+
19
+ ## Ultra MapLibre styles
20
+
21
+ In order to simplify the use of MapLibre styles, Overpass Ultra implements a number of features.
22
+
23
+ ### Query result styling
24
+
25
+ In order to allow for easy styling of the query results, Overpass Ultra allows you to specify a
26
+ style with only the layer for your query results.
27
+
28
+ For example, to render query results with a purple MapLibre
29
+ [circle](https://maplibre.org/maplibre-style-spec/layers/#circle) layer:
30
+
31
+ ```
32
+ ---
33
+ style:
34
+ layers:
35
+ - type: circle
36
+ paint:
37
+ circle-color: purple
38
+ ---
39
+ nwr[shop]({{bbox}}); out center;
40
+ ```
41
+
42
+ #### Extending a specific basemap style
43
+
44
+ To specify what style to add result styling to, use the `extends` key.
45
+
46
+ For example, to render the purple circles on the [Protomaps]() light basemap:
47
+
48
+ ```
49
+ ---
50
+ style:
51
+ extends: https://styles.trailsta.sh/protomaps-light.json
52
+ layers:
53
+ - type: circle
54
+ paint:
55
+ circle-color: purple
56
+ ---
57
+ nwr[shop]({{bbox}}); out center;
58
+ ```
59
+
60
+ ### Layer `source` & `id`
61
+ In the above examples, the layer definitions are lacking both source and layers keys.
62
+
63
+ Layers don't need to specify an ID, and if the source is not specified, it will be set to to the
64
+ source containting the query results.
65
+
66
+ ### Automatic `paint` and `layer` keys
67
+ In order to reduce the mental overhead of remember what keys are
68
+ [`paint`](https://maplibre.org/maplibre-style-spec/layers/#paint) options and which are
69
+ [`layout`](https://maplibre.org/maplibre-style-spec/layers/#layout) options, Overpass Ultra will
70
+ automatically move them from the layer object into the appropriate options object.
71
+
72
+ For example, the above purple circle layer can be implemented as:
73
+
74
+ ```
75
+ ---
76
+ style:
77
+ layers:
78
+ - type: circle
79
+ circle-color: purple
80
+ ---
81
+ nwr[shop]({{bbox}}); out center;
82
+ ```
83
+
84
+ ### Sandwiching layers
85
+ In order to place your layers below existing style layers, you can use the `beforeLayerId:` key.
86
+
87
+ [Example](./Examples/bike-infra.md)
88
+
89
+ ## PNG sprites via HTTPS
90
+ In order to facilitate adding icons to the map that don't exist in the basemap's
91
+ [sprites](),
92
+ if `icon-image` is set to an HTTPS URL to a PNG image, Overpass Ultra will automatically download
93
+ it and add it to the Map's images.
94
+
95
+ [Example](./MapLibre-Examples/add-image.md)
96
+
97
+ ## Bundled Sprites
98
+ In order to simplify the creation of POI maps, Overpass Ultra bundles the
99
+ [Maki](https://github.com/mapbox/maki) and [Temaki](https://github.com/rapideditor/temaki) sprites
100
+ and adds them to your style as [SDFs](https://docs.mapbox.com/help/troubleshooting/using-recolorable-images-in-mapbox-maps/)
101
+ allowing for easy styling of icons.
102
+
103
+ Example:
104
+
105
+ ```
106
+ ---
107
+ style:
108
+ layers:
109
+ - type: symbol
110
+ icon-image: maki:bus
111
+ icon-color: white
112
+ icon-halo-color: '#6486f5'
113
+ icon-halo-width: 5
114
+ ---
115
+ ```
116
+
117
+ ## Fallback fontstack
118
+ Since not all MapLibre styles have the same
119
+ [glyphs](https://maplibre.org/maplibre-style-spec/glyphs/), Overpass Ultra will default to using
120
+ Noto Sans Regular if the speficied(or default) fontstack is not available.
@@ -0,0 +1,45 @@
1
+ # URL Hash Parameters
2
+
3
+ You use the following query string parameters as a hash to instruct Overpass Ultra to set certain properties on startup (such as the query or the map location).
4
+
5
+ ## `query` <small>(URL-encoded string)</small>
6
+
7
+ This sets the query to the given string.
8
+
9
+ Example: [http://overpass-ultra.us/#query=node%5B%22amenity%22%3D%22drinking_water%22%5D(%7B%7Bbbox%7D%7D)%3B%0Aout%3B](http://overpass-ultra.us/#query=node%5B%22amenity%22%3D%22drinking_water%22%5D(%7B%7Bbbox%7D%7D)%3B%0Aout%3B)
10
+
11
+ ### Loading Gists
12
+
13
+ You can load a query from a Gist by using a string prefixed with `gist:`
14
+
15
+ Example: [http://overpass-ultra.us/#query=gist:8ecb8ba0a0136f4f0dbc36de82061de4](http://overpass-ultra.us/#query=gist:8ecb8ba0a0136f4f0dbc36de82061de4)
16
+
17
+ ### Loading URLs
18
+
19
+ You can load a query from any url by using a string prefixed with `url:`
20
+
21
+ Example: [http://overpass-ultra.us/#query=url:https%3A%2F%2Fgist.githubusercontent.com%2Fdschep%2F8ecb8ba0a0136f4f0dbc36de82061de4%2Fraw%2F40ce5053cc664984d677bca20a2a2d3371ce09b0%2Fgistfile1.txt](http://overpass-ultra.us/#query=url:https%3A%2F%2Fgist.githubusercontent.com%2Fdschep%2F8ecb8ba0a0136f4f0dbc36de82061de4%2Fraw%2F40ce5053cc664984d677bca20a2a2d3371ce09b0%2Fgistfile1.txt)
22
+
23
+ ## `q` <small>(lz-string-compressed string)</small>
24
+
25
+ This sets the query to the given Base64-encoded lz-string string.
26
+
27
+ Example: [http://overpass-ultra.us/#q=NoIxHsA8C4G9bFAvkgugbgFAHcCGBPYACwEsBzIvfAXgAdcAXIjTcAVwYAIyBTcAW3RA](http://overpass-ultra.us/#q=NoIxHsA8C4G9bFAvkgugbgFAHcCGBPYACwEsBzIvfAXgAdcAXIjTcAVwYAIyBTcAW3RA)
28
+
29
+ ## `m` <small>(z/x/y viewport)</small>
30
+
31
+ Sets the map center coordinates and zoom level.
32
+
33
+ Example: [http://overpass-ultra.us/#m=14.64/-33.8842/151.2077](http://overpass-ultra.us/#m=14.64/-33.8842/151.2077)
34
+
35
+ ## `run`
36
+
37
+ Runs the query immediately after startup.
38
+
39
+ Example: [http://overpass-ultra.us/#run&query=node%5B%22amenity%22%3D%22drinking_water%22%5D(%7B%7Bbbox%7D%7D)%3B%0Aout%3B&m=14.64/-33.8842/151.2077](http://overpass-ultra.us/#run&query=node%5B%22amenity%22%3D%22drinking_water%22%5D(%7B%7Bbbox%7D%7D)%3B%0Aout%3B&m=14.64/-33.8842/151.2077)
40
+
41
+ ## `map`
42
+
43
+ Runs the query as a customizable interactive map.
44
+
45
+ Example: [http://overpass-ultra.us/#map&query=node%5B%22amenity%22%3D%22drinking_water%22%5D(%7B%7Bbbox%7D%7D)%3B%0Aout%3B&m=14.64/-33.8842/151.2077 ](http://overpass-ultra.us/#map&query=node%5B%22amenity%22%3D%22drinking_water%22%5D(%7B%7Bbbox%7D%7D)%3B%0Aout%3B&m=14.64/-33.8842/151.2077 )
package/docs/yaml.md ADDED
@@ -0,0 +1,117 @@
1
+ # YAML front-matter config
2
+
3
+ The real power of Overpass Ultra lies in it's easy configuration of MapLibre with the a query's
4
+ [YAML front-matter](https://jekyllrb.com/docs/front-matter/).
5
+
6
+ ## `style`
7
+
8
+ Customize the MapLibre style. See [Styling](./Style.md) for more information.
9
+
10
+ Example:
11
+ ```
12
+ ---
13
+ style: https://example.com/style.json
14
+ ---
15
+ ```
16
+
17
+ ## `server`
18
+
19
+ Use a different Overpass API server.
20
+
21
+ Example:
22
+ ```
23
+ ---
24
+ server: https://overpass.private.coffee/api/
25
+ ---
26
+ ```
27
+
28
+ <small>Only applies to Overpass queries.</small>
29
+
30
+ ## `popupTemplate`
31
+
32
+ Customize the interactive popup with a [LiquidJS]() template. Or set it to `false` to disable the
33
+ interactive popup.
34
+
35
+ ```
36
+ ---
37
+ popupTemplate: "{{type}} {{id}} - {{tags.name}}"
38
+ ---
39
+ ```
40
+
41
+ ## `type`
42
+
43
+ Specify the type of source in the query.
44
+
45
+ **Default:** `overpass`
46
+
47
+ ### `overpass`
48
+ An [Overpass QL](https://wiki.openstreetmap.org/wiki/Overpass_API/Overpass_QL) query. Results
49
+ converted into a [GeoJSON source](https://maplibre.org/maplibre-style-spec/sources/#geojson) with
50
+ [`osmtogeojson`](https://github.com/tyrasd/osmtogeojson).
51
+
52
+ ### `osmxml`
53
+ An [OSM XML](https://wiki.openstreetmap.org/wiki/OSM_XML) document or a URL to one. Converted into
54
+ a [GeoJSON source](https://maplibre.org/maplibre-style-spec/sources/#geojson) with
55
+ [`osmtogeojson`](https://github.com/tyrasd/osmtogeojson).
56
+
57
+ ### `osmjson`
58
+ An [OSM JSON](https://wiki.openstreetmap.org/wiki/OSM_JSON) document or a URL to one. Converted
59
+ into a [GeoJSON source](https://maplibre.org/maplibre-style-spec/sources/#geojson) with
60
+ [`osmtogeojson`](https://github.com/tyrasd/osmtogeojson).
61
+
62
+ ### `geojson`
63
+ A JSON-encoded GeoJSON object or a URL to a GeoJSON file.
64
+
65
+ ### `raster`
66
+ A line delimited list of [tile URLs](https://maplibre.org/maplibre-style-spec/sources/#tiles_1) for
67
+ a [raster source](https://maplibre.org/maplibre-style-spec/sources/#raster) or a [TileJSON
68
+ url](https://maplibre.org/maplibre-style-spec/sources/#url_1)
69
+
70
+ ### `vector`
71
+ A line delimited list of [tile URLs](https://maplibre.org/maplibre-style-spec/sources/#tiles_2) for
72
+ a [vector source](https://maplibre.org/maplibre-style-spec/sources/#vector) or a [TileJSON
73
+ url](https://maplibre.org/maplibre-style-spec/sources/#url_2)
74
+
75
+ ## `options`
76
+
77
+ When an Overpass Ultra query is run in "interactive map" mode, you can specify the
78
+ [`MapOptions`](https://maplibre.org/maplibre-gl-js/docs/API/type-aliases/MapOptions/)
79
+ that are passed to the MapLibre constructor.
80
+
81
+ For example, you can use this to fit to bounds rather than relying on the z/x/y URL parameters,
82
+ making for a more consistent experience across screen sizes. EG:
83
+
84
+ ```
85
+ ---
86
+ options:
87
+ bounds: [-77.64656066894544,37.577235791111384,-76.92558288574232,38.13563674858875]
88
+ ---
89
+ ```
90
+
91
+ ## `controls`
92
+ When an Overpass Ultra query is run in "interactive map" mode, you can specify controls to be added to the map with the `controls` key
93
+ in the YAML-front matter. The key should contain a list of objects. Each object must specify a `type` key containing the
94
+ name of a control present in MapLibre. It can optionally contain an `options` key who's contents are passed to the
95
+ control's constructor and a `position` key that is passed to
96
+ [`map.addControl`](https://maplibre.org/maplibre-gl-js/docs/API/classes/Map/#addcontrol).
97
+
98
+ For example, to add a NavigationControl to your map:
99
+ ```
100
+ ---
101
+ controls:
102
+ - type: NavigationControl
103
+ options:
104
+ visualizePitch: true
105
+ position: bottom-left
106
+ ---
107
+ ```
108
+
109
+ ## `querySources`
110
+
111
+ Specify which sources can be queried by mouse-click
112
+
113
+ ```
114
+ ---
115
+ querySources: [ultra] # this is the default
116
+ ---
117
+ ```
package/index.js ADDED
@@ -0,0 +1,53 @@
1
+ import { Protocol } from "pmtiles";
2
+ import MapLibre from "@trailstash/maplibre-component";
3
+ import maplibregl from "maplibre-gl";
4
+
5
+ import { normalizeCSS } from "./lib/normalize.js";
6
+ import FallbackGlyphProtocol from "./lib/glyphFallback.js";
7
+
8
+ import { UltraLoader } from "./components/ultra-loader.js";
9
+ import { UltraMap } from "./components/ultra-map.js";
10
+ import { UltraIDE } from "./components/ultra-ide.js";
11
+ import { CodeEditor } from "./components/code-editor.js";
12
+ import { NavBar } from "./components/nav-bar.js";
13
+ import { RunButton } from "./components/run-button.js";
14
+ import { DownloadButton } from "./components/download-button.js";
15
+ import { StylePicker } from "./components/style-picker.js";
16
+ import { ShareModal as ShareButton } from "./components/share-modal.js";
17
+ import { HelpModal } from "./components/help-modal.js";
18
+ import { FSButton } from "./components/fs-button.js";
19
+ import { FontAwesomeIcon } from "./components/fontawesome-icon.js";
20
+ import { ButtonModal } from "./components/button-modal.js";
21
+ import { MapPopup } from "./components/map-popup.js";
22
+
23
+ // style
24
+ document.adoptedStyleSheets.push(normalizeCSS);
25
+
26
+ // maplibre plugins
27
+ const protocol = new Protocol();
28
+ maplibregl.addProtocol("pmtiles", protocol.tile);
29
+
30
+ maplibregl.setRTLTextPlugin("./mapbox-gl-rtl-text@0.2.3.js", true);
31
+
32
+ const fallbackGlyphsProtocol = new FallbackGlyphProtocol();
33
+ maplibregl.addProtocol(FallbackGlyphProtocol.name, fallbackGlyphsProtocol.tile);
34
+
35
+ // register element
36
+ customElements.define("code-editor", CodeEditor);
37
+ customElements.define("map-libre", MapLibre);
38
+ customElements.define("nav-bar", NavBar);
39
+ customElements.define("run-button", RunButton);
40
+ customElements.define("download-button", DownloadButton);
41
+ customElements.define("share-button", ShareButton);
42
+ customElements.define("help-modal", HelpModal);
43
+ customElements.define("style-picker", StylePicker);
44
+ customElements.define("fs-button", FSButton);
45
+ customElements.define("fa-icon", FontAwesomeIcon);
46
+ customElements.define("button-modal", ButtonModal);
47
+ customElements.define("map-popup", MapPopup);
48
+ customElements.define("ultra-map", UltraMap);
49
+ customElements.define("ultra-ide", UltraIDE);
50
+ customElements.define("ultra-loader", UltraLoader);
51
+
52
+ // reload on hash changes
53
+ addEventListener("hashchange", () => window.location.reload());
package/lib/base.css ADDED
@@ -0,0 +1,12 @@
1
+ /* full-page */
2
+ html,
3
+ body {
4
+ width: 100%;
5
+ height: 100%;
6
+ display: flex;
7
+ }
8
+
9
+ /* font */
10
+ body {
11
+ font-family: sans-serif;
12
+ }
package/lib/bounds.js ADDED
@@ -0,0 +1,8 @@
1
+ export function setQueryBounds(query, bounds) {
2
+ return query
3
+ .replace(/{{bbox}}/g, `{{south}},{{west}},{{north}},{{east}}`)
4
+ .replace(/{{south}}/g, bounds.getSouth())
5
+ .replace(/{{west}}/g, bounds.getWest())
6
+ .replace(/{{north}}/g, bounds.getNorth())
7
+ .replace(/{{east}}/g, bounds.getEast());
8
+ }
package/lib/dom.js ADDED
@@ -0,0 +1,21 @@
1
+ // DOM generation helpers
2
+
3
+ export const h = (elName, attrs, ...children) => {
4
+ const el = document.createElement(elName);
5
+ for (const key in attrs) {
6
+ if (key in el) {
7
+ el[key] = attrs[key];
8
+ } else {
9
+ el.setAttribute(key, attrs[key]);
10
+ }
11
+ }
12
+ if (children.length === 1 && typeof children[0] === "string") {
13
+ el.innerHTML = children[0];
14
+ } else {
15
+ for (const child of children) {
16
+ el.appendChild(child);
17
+ }
18
+ }
19
+ return el;
20
+ };
21
+ export const t = (text) => document.createTextNode(text);
@@ -0,0 +1,31 @@
1
+ export class Protocol {
2
+ static name = "glyphs";
3
+ static makeURL = (url) => {
4
+ const params = new URLSearchParams();
5
+ if (url) {
6
+ params.set("url", url);
7
+ }
8
+ return `${Protocol.name}://origin/{fontstack}/{range}?${params.toString()}`;
9
+ };
10
+ tile = async (params) => {
11
+ const url = new URL(params.url);
12
+ let resp;
13
+ const [fontstack, range] = url.pathname.split("/").slice(-2);
14
+ if (url.searchParams.has("url")) {
15
+ resp = await fetch(
16
+ url.searchParams
17
+ .get("url")
18
+ .replace("{fontstack}", fontstack)
19
+ .replace("{range}", range),
20
+ );
21
+ }
22
+ if (!resp || !resp.ok) {
23
+ resp = await fetch(`./font/${range}.pbf`);
24
+ }
25
+ if (resp) {
26
+ return { data: await resp.arrayBuffer() };
27
+ }
28
+ };
29
+ }
30
+
31
+ export default Protocol;
@@ -0,0 +1,34 @@
1
+ export const localStorage = {
2
+ getItem: (key) => {
3
+ try {
4
+ return JSON.parse(window.localStorage.getItem(key));
5
+ } catch {
6
+ return null;
7
+ }
8
+ },
9
+ setItem: (key, value) => {
10
+ try {
11
+ return window.localStorage.setItem(key, JSON.stringify(value));
12
+ } catch {
13
+ return;
14
+ }
15
+ },
16
+ };
17
+
18
+ export default localStorage;
19
+
20
+ export const optionsFromStorage = () => {
21
+ const options = {};
22
+ const center = localStorage.getItem("mapCenter");
23
+ const zoom = localStorage.getItem("mapZoom");
24
+ if (center) {
25
+ options.center = center;
26
+ }
27
+ if (zoom) {
28
+ options.zoom = zoom;
29
+ }
30
+ return options;
31
+ };
32
+ export const queryFromStorage = () => {
33
+ return localStorage.getItem("query");
34
+ };
@@ -0,0 +1,5 @@
1
+ import normalize from "normalize.css/normalize.css";
2
+ import base from "./base.css";
3
+
4
+ export const normalizeCSS = new CSSStyleSheet();
5
+ normalizeCSS.replaceSync(normalize + base);
@@ -0,0 +1,50 @@
1
+ import maplibregl from "maplibre-gl";
2
+
3
+ import { h } from "../lib/dom.js";
4
+
5
+ export const handleMouseMove = (e, popupTemplate, querySources) => {
6
+ if (popupTemplate === false) {
7
+ return;
8
+ }
9
+ const features = e.target
10
+ .queryRenderedFeatures(e.point)
11
+ .filter((l) => querySources?.includes(l.source));
12
+ if (features.length > 0) {
13
+ e.target.getCanvas().style.cursor = "pointer";
14
+ } else {
15
+ e.target.getCanvas().style.cursor = "";
16
+ }
17
+ };
18
+
19
+ export const handleMouseClick = (
20
+ e,
21
+ popupTemplate,
22
+ popupContextBuilder,
23
+ querySources,
24
+ ) => {
25
+ if (popupTemplate === false) {
26
+ return;
27
+ }
28
+ const features = e.target
29
+ .queryRenderedFeatures(e.point)
30
+ .filter((l) => querySources?.includes(l.source));
31
+ const distinctFeatures = {};
32
+ for (const f of features) {
33
+ distinctFeatures[f.id] = f;
34
+ }
35
+ const popup = h("map-popup");
36
+ popup.features = distinctFeatures;
37
+ if (popupTemplate) {
38
+ popup.template = popupTemplate;
39
+ }
40
+ if (popupContextBuilder) {
41
+ popup.contextBuilder = popupContextBuilder;
42
+ }
43
+ if (features.length > 0) {
44
+ new maplibregl.Popup()
45
+ .setMaxWidth("400px")
46
+ .setLngLat(e.lngLat)
47
+ .setDOMContent(popup)
48
+ .addTo(e.target);
49
+ }
50
+ };