@npm9912/v-map 0.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 (438) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +185 -0
  3. package/dist/cjs/_commonjsHelpers-B83fTs8d.js +36 -0
  4. package/dist/cjs/app-globals-V2Kpy_OQ.js +5 -0
  5. package/dist/cjs/cesium-provider-BiFFyAl9.js +2598 -0
  6. package/dist/cjs/deck-provider-Ctq3Q8a1.js +47824 -0
  7. package/dist/cjs/geotiff-CEwvF9cG.js +47 -0
  8. package/dist/cjs/geotiff-source-RaNzzWkC.js +1522 -0
  9. package/dist/cjs/index-B1oGO1g-.js +10658 -0
  10. package/dist/cjs/index-B8LHqjyg.js +1765 -0
  11. package/dist/cjs/index-BIL4VsgP.js +310 -0
  12. package/dist/cjs/index-Blku2QY8.js +167 -0
  13. package/dist/cjs/index-CJvvX4yx.js +21 -0
  14. package/dist/cjs/index-CbVT-Con.js +699 -0
  15. package/dist/cjs/index-ISOEpMC3.js +20478 -0
  16. package/dist/cjs/index-JSwBbvGA.js +1621 -0
  17. package/dist/cjs/index.browser-DQhD8Jwl.js +6873 -0
  18. package/dist/cjs/index.cjs.js +2 -0
  19. package/dist/cjs/layer-extension-B_olS0rc.js +65 -0
  20. package/dist/cjs/leaflet-provider-DOqfs7g5.js +1815 -0
  21. package/dist/cjs/loader.cjs.js +13 -0
  22. package/dist/cjs/main-dist-7TykwFci.js +2655 -0
  23. package/dist/cjs/messages-D7h4m8Tx.js +186 -0
  24. package/dist/cjs/openlayers-provider-Dfeg6L4n.js +1604 -0
  25. package/dist/cjs/polygon-layer-B9PrN7vr.js +1300 -0
  26. package/dist/cjs/scenegraph-layer-DwNoxQdi.js +2530 -0
  27. package/dist/cjs/styleconfig-CVRqArk-.js +23 -0
  28. package/dist/cjs/v-map-builder.cjs.entry.js +3786 -0
  29. package/dist/cjs/v-map-layer-geojson_12.cjs.entry.js +40894 -0
  30. package/dist/cjs/v-map-layer-helper-iAzxAg9I.js +285 -0
  31. package/dist/cjs/v-map-layer-terrain-geotiff.cjs.entry.js +258 -0
  32. package/dist/cjs/v-map-layercontrol.cjs.entry.js +247 -0
  33. package/dist/cjs/v-map.cjs.js +25 -0
  34. package/dist/cjs/v-map.v-map-layer-osm.v-map-layergroup-BsXp3BoL.js +582 -0
  35. package/dist/cjs/v-map_3.cjs.entry.js +12 -0
  36. package/dist/collection/collection-manifest.json +30 -0
  37. package/dist/collection/components/v-map/v-map.css +3 -0
  38. package/dist/collection/components/v-map/v-map.js +467 -0
  39. package/dist/collection/components/v-map/v-map.test.js +33 -0
  40. package/dist/collection/components/v-map-builder/v-map-builder.css +1 -0
  41. package/dist/collection/components/v-map-builder/v-map-builder.js +913 -0
  42. package/dist/collection/components/v-map-builder/v-map-builder.test.js +56 -0
  43. package/dist/collection/components/v-map-layer-geojson/v-map-layer-geojson.js +862 -0
  44. package/dist/collection/components/v-map-layer-geojson/v-map-layer-geojson.test.js +42 -0
  45. package/dist/collection/components/v-map-layer-geotiff/v-map-layer-geotiff.css +4 -0
  46. package/dist/collection/components/v-map-layer-geotiff/v-map-layer-geotiff.js +500 -0
  47. package/dist/collection/components/v-map-layer-geotiff/v-map-layer-geotiff.test.js +38 -0
  48. package/dist/collection/components/v-map-layer-google/v-map-layer-google.css +1 -0
  49. package/dist/collection/components/v-map-layer-google/v-map-layer-google.js +442 -0
  50. package/dist/collection/components/v-map-layer-osm/error-api.test.js +108 -0
  51. package/dist/collection/components/v-map-layer-osm/v-map-layer-osm.css +4 -0
  52. package/dist/collection/components/v-map-layer-osm/v-map-layer-osm.js +311 -0
  53. package/dist/collection/components/v-map-layer-osm/v-map-layer-osm.test.js +36 -0
  54. package/dist/collection/components/v-map-layer-scatterplot/v-map-layer-scatterplot.css +1 -0
  55. package/dist/collection/components/v-map-layer-scatterplot/v-map-layer-scatterplot.js +305 -0
  56. package/dist/collection/components/v-map-layer-terrain/v-map-layer-terrain.css +3 -0
  57. package/dist/collection/components/v-map-layer-terrain/v-map-layer-terrain.js +548 -0
  58. package/dist/collection/components/v-map-layer-terrain/v-map-layer-terrain.test.js +36 -0
  59. package/dist/collection/components/v-map-layer-terrain-geotiff/v-map-layer-terrain-geotiff.css +3 -0
  60. package/dist/collection/components/v-map-layer-terrain-geotiff/v-map-layer-terrain-geotiff.js +735 -0
  61. package/dist/collection/components/v-map-layer-terrain-geotiff/v-map-layer-terrain-geotiff.test.js +42 -0
  62. package/dist/collection/components/v-map-layer-tile3d/v-map-layer-tile3d.css +3 -0
  63. package/dist/collection/components/v-map-layer-tile3d/v-map-layer-tile3d.js +449 -0
  64. package/dist/collection/components/v-map-layer-tile3d/v-map-layer-tile3d.test.js +50 -0
  65. package/dist/collection/components/v-map-layer-wcs/v-map-layer-wcs.css +1 -0
  66. package/dist/collection/components/v-map-layer-wcs/v-map-layer-wcs.js +448 -0
  67. package/dist/collection/components/v-map-layer-wcs/v-map-layer-wcs.test.js +39 -0
  68. package/dist/collection/components/v-map-layer-wfs/v-map-layer-wfs.css +1 -0
  69. package/dist/collection/components/v-map-layer-wfs/v-map-layer-wfs.js +489 -0
  70. package/dist/collection/components/v-map-layer-wfs/v-map-layer-wfs.test.js +43 -0
  71. package/dist/collection/components/v-map-layer-wkt/v-map-layer-wkt.css +1 -0
  72. package/dist/collection/components/v-map-layer-wkt/v-map-layer-wkt.js +811 -0
  73. package/dist/collection/components/v-map-layer-wkt/v-map-layer-wkt.test.js +34 -0
  74. package/dist/collection/components/v-map-layer-wms/v-map-layer-wms.css +1 -0
  75. package/dist/collection/components/v-map-layer-wms/v-map-layer-wms.js +453 -0
  76. package/dist/collection/components/v-map-layer-wms/v-map-layer-wms.test.js +36 -0
  77. package/dist/collection/components/v-map-layer-xyz/v-map-layer-xyz.css +1 -0
  78. package/dist/collection/components/v-map-layer-xyz/v-map-layer-xyz.js +331 -0
  79. package/dist/collection/components/v-map-layer-xyz/v-map-layer-xyz.test.js +28 -0
  80. package/dist/collection/components/v-map-layercontrol/v-map-layercontrol.css +74 -0
  81. package/dist/collection/components/v-map-layercontrol/v-map-layercontrol.js +277 -0
  82. package/dist/collection/components/v-map-layercontrol/v-map-layercontrol.test.js +134 -0
  83. package/dist/collection/components/v-map-layergroup/v-map-layergroup.css +4 -0
  84. package/dist/collection/components/v-map-layergroup/v-map-layergroup.js +212 -0
  85. package/dist/collection/components/v-map-layergroup/v-map-layergroup.test.js +39 -0
  86. package/dist/collection/components/v-map-style/v-map-style.css +38 -0
  87. package/dist/collection/components/v-map-style/v-map-style.js +492 -0
  88. package/dist/collection/components/v-map-style/v-map-style.unit.js +62 -0
  89. package/dist/collection/index.js +1 -0
  90. package/dist/collection/layer/v-map-layer-helper.js +281 -0
  91. package/dist/collection/layer/v-map-layer-helper.unit.js +234 -0
  92. package/dist/collection/lib/cesium-loader.js +58 -0
  93. package/dist/collection/lib/ensure-importmap.js +12 -0
  94. package/dist/collection/lib/ensure-importmap.unit.js +57 -0
  95. package/dist/collection/lib/versions.gen.js +6 -0
  96. package/dist/collection/lib/vstyle.js +8 -0
  97. package/dist/collection/map-provider/cesium/CesiumGeoTIFFTerrainProvider.js +285 -0
  98. package/dist/collection/map-provider/cesium/CesiumLayerGroups.js +159 -0
  99. package/dist/collection/map-provider/cesium/GeoTIFFImageryProvider.js +192 -0
  100. package/dist/collection/map-provider/cesium/GeoTIFFImageryProvider.test.js +57 -0
  101. package/dist/collection/map-provider/cesium/cesium-provider.js +1408 -0
  102. package/dist/collection/map-provider/cesium/i-layer.js +1 -0
  103. package/dist/collection/map-provider/cesium/layer-manager.js +467 -0
  104. package/dist/collection/map-provider/deck/DeckGLGeoTIFFLayer.js +483 -0
  105. package/dist/collection/map-provider/deck/DeckGLGeoTIFFTerrainLayer.js +410 -0
  106. package/dist/collection/map-provider/deck/LayerGroupWithModel.js +169 -0
  107. package/dist/collection/map-provider/deck/LayerGroups.js +192 -0
  108. package/dist/collection/map-provider/deck/LayerModel.js +1 -0
  109. package/dist/collection/map-provider/deck/RenderableGroup.js +1 -0
  110. package/dist/collection/map-provider/deck/deck-provider.js +1563 -0
  111. package/dist/collection/map-provider/geotiff/geotiff-source.js +172 -0
  112. package/dist/collection/map-provider/geotiff/utils/AABB2D.js +24 -0
  113. package/dist/collection/map-provider/geotiff/utils/BVHNode2D.js +166 -0
  114. package/dist/collection/map-provider/geotiff/utils/GeoTIFFTileProcessor.js +484 -0
  115. package/dist/collection/map-provider/geotiff/utils/Triangle.js +1 -0
  116. package/dist/collection/map-provider/geotiff/utils/Triangulation.js +321 -0
  117. package/dist/collection/map-provider/geotiff/utils/colormap-utils.js +190 -0
  118. package/dist/collection/map-provider/geotiff/utils/normalization-utils.js +122 -0
  119. package/dist/collection/map-provider/geotiff/utils/sampling-utils.js +108 -0
  120. package/dist/collection/map-provider/leaflet/GeoTIFFGridLayer.js +147 -0
  121. package/dist/collection/map-provider/leaflet/WCSGridLayer.js +124 -0
  122. package/dist/collection/map-provider/leaflet/google-map-tiles-layer.js +352 -0
  123. package/dist/collection/map-provider/leaflet/leaflet-helpers.js +94 -0
  124. package/dist/collection/map-provider/leaflet/leaflet-provider.js +1095 -0
  125. package/dist/collection/map-provider/ol/CustomGeoTiff.js +145 -0
  126. package/dist/collection/map-provider/ol/openlayers-helper.js +26 -0
  127. package/dist/collection/map-provider/ol/openlayers-provider.js +1427 -0
  128. package/dist/collection/map-provider/provider-factory.js +44 -0
  129. package/dist/collection/map-provider/provider-factory.unit.js +66 -0
  130. package/dist/collection/testing/browser-test-utils.js +49 -0
  131. package/dist/collection/testing/e2e-testing.js +122 -0
  132. package/dist/collection/testing/e2e-utils.js +70 -0
  133. package/dist/collection/testing/geotiff-test-server.js +100 -0
  134. package/dist/collection/testing/mocks/geostyler-lyrx-parser.js +12 -0
  135. package/dist/collection/testing/mocks/geostyler-mapbox-parser.js +12 -0
  136. package/dist/collection/testing/mocks/geostyler-qgis-parser.js +12 -0
  137. package/dist/collection/testing/mocks/geostyler-sld-parser.js +13 -0
  138. package/dist/collection/testing/mocks/geostyler-style.js +5 -0
  139. package/dist/collection/testing/setupTests.browser.js +1 -0
  140. package/dist/collection/testing/setupTests.stencil.js +20 -0
  141. package/dist/collection/testing/setupTests.vitest.js +59 -0
  142. package/dist/collection/testing/stencil-testing-wrapper.js +43 -0
  143. package/dist/collection/testing/styleMock.js +1 -0
  144. package/dist/collection/types/color.js +1 -0
  145. package/dist/collection/types/cssmode.js +1 -0
  146. package/dist/collection/types/flavour.js +1 -0
  147. package/dist/collection/types/layerconfig.js +1 -0
  148. package/dist/collection/types/lonlat.js +1 -0
  149. package/dist/collection/types/mapinitoptions.js +1 -0
  150. package/dist/collection/types/mapprovider.js +1 -0
  151. package/dist/collection/types/provideroptions.js +1 -0
  152. package/dist/collection/types/styleconfig.js +19 -0
  153. package/dist/collection/types/styling.js +13 -0
  154. package/dist/collection/types/styling.unit.js +37 -0
  155. package/dist/collection/types/vmaplayer.js +1 -0
  156. package/dist/collection/utils/async-mutex.js +28 -0
  157. package/dist/collection/utils/diff.js +142 -0
  158. package/dist/collection/utils/diff.unit.js +59 -0
  159. package/dist/collection/utils/dom-env.js +43 -0
  160. package/dist/collection/utils/dom-env.unit.js +92 -0
  161. package/dist/collection/utils/events.js +8 -0
  162. package/dist/collection/utils/logger.js +183 -0
  163. package/dist/collection/utils/logger.unit.js +98 -0
  164. package/dist/collection/utils/messages.js +12 -0
  165. package/dist/collection/utils/spatial-utils.js +27 -0
  166. package/dist/collection/utils/spatial-utils.unit.js +24 -0
  167. package/dist/components/_commonjsHelpers.js +1 -0
  168. package/dist/components/cesium-provider.js +1 -0
  169. package/dist/components/deck-provider.js +1 -0
  170. package/dist/components/events.js +1 -0
  171. package/dist/components/geotiff-source.js +1 -0
  172. package/dist/components/geotiff.js +4 -0
  173. package/dist/components/index.browser.js +15 -0
  174. package/dist/components/index.d.ts +35 -0
  175. package/dist/components/index.js +1 -0
  176. package/dist/components/index2.js +1 -0
  177. package/dist/components/index3.js +1 -0
  178. package/dist/components/index4.js +1 -0
  179. package/dist/components/index5.js +1 -0
  180. package/dist/components/index6.js +1 -0
  181. package/dist/components/index7.js +1 -0
  182. package/dist/components/index8.js +7 -0
  183. package/dist/components/layer-extension.js +1 -0
  184. package/dist/components/leaflet-provider.js +1 -0
  185. package/dist/components/main-dist.js +1 -0
  186. package/dist/components/messages.js +1 -0
  187. package/dist/components/openlayers-provider.js +1 -0
  188. package/dist/components/polygon-layer.js +1 -0
  189. package/dist/components/scenegraph-layer.js +1 -0
  190. package/dist/components/styleconfig.js +1 -0
  191. package/dist/components/styling.js +1 -0
  192. package/dist/components/v-map-builder.d.ts +11 -0
  193. package/dist/components/v-map-builder.js +2 -0
  194. package/dist/components/v-map-layer-geojson.d.ts +11 -0
  195. package/dist/components/v-map-layer-geojson.js +1 -0
  196. package/dist/components/v-map-layer-geojson2.js +1 -0
  197. package/dist/components/v-map-layer-geotiff.d.ts +11 -0
  198. package/dist/components/v-map-layer-geotiff.js +1 -0
  199. package/dist/components/v-map-layer-geotiff2.js +1 -0
  200. package/dist/components/v-map-layer-google.d.ts +11 -0
  201. package/dist/components/v-map-layer-google.js +1 -0
  202. package/dist/components/v-map-layer-google2.js +1 -0
  203. package/dist/components/v-map-layer-helper.js +1 -0
  204. package/dist/components/v-map-layer-osm.d.ts +11 -0
  205. package/dist/components/v-map-layer-osm.js +1 -0
  206. package/dist/components/v-map-layer-osm2.js +1 -0
  207. package/dist/components/v-map-layer-scatterplot.d.ts +11 -0
  208. package/dist/components/v-map-layer-scatterplot.js +1 -0
  209. package/dist/components/v-map-layer-scatterplot2.js +1 -0
  210. package/dist/components/v-map-layer-terrain-geotiff.d.ts +11 -0
  211. package/dist/components/v-map-layer-terrain-geotiff.js +1 -0
  212. package/dist/components/v-map-layer-terrain.d.ts +11 -0
  213. package/dist/components/v-map-layer-terrain.js +1 -0
  214. package/dist/components/v-map-layer-terrain2.js +1 -0
  215. package/dist/components/v-map-layer-tile3d.d.ts +11 -0
  216. package/dist/components/v-map-layer-tile3d.js +1 -0
  217. package/dist/components/v-map-layer-tile3d2.js +1 -0
  218. package/dist/components/v-map-layer-wcs.d.ts +11 -0
  219. package/dist/components/v-map-layer-wcs.js +1 -0
  220. package/dist/components/v-map-layer-wcs2.js +1 -0
  221. package/dist/components/v-map-layer-wfs.d.ts +11 -0
  222. package/dist/components/v-map-layer-wfs.js +1 -0
  223. package/dist/components/v-map-layer-wfs2.js +1 -0
  224. package/dist/components/v-map-layer-wkt.d.ts +11 -0
  225. package/dist/components/v-map-layer-wkt.js +1 -0
  226. package/dist/components/v-map-layer-wkt2.js +1 -0
  227. package/dist/components/v-map-layer-wms.d.ts +11 -0
  228. package/dist/components/v-map-layer-wms.js +1 -0
  229. package/dist/components/v-map-layer-wms2.js +1 -0
  230. package/dist/components/v-map-layer-xyz.d.ts +11 -0
  231. package/dist/components/v-map-layer-xyz.js +1 -0
  232. package/dist/components/v-map-layer-xyz2.js +1 -0
  233. package/dist/components/v-map-layercontrol.d.ts +11 -0
  234. package/dist/components/v-map-layercontrol.js +1 -0
  235. package/dist/components/v-map-layergroup.d.ts +11 -0
  236. package/dist/components/v-map-layergroup.js +1 -0
  237. package/dist/components/v-map-layergroup2.js +1 -0
  238. package/dist/components/v-map-style.d.ts +11 -0
  239. package/dist/components/v-map-style.js +1 -0
  240. package/dist/components/v-map-style2.js +10 -0
  241. package/dist/components/v-map.d.ts +11 -0
  242. package/dist/components/v-map.js +1 -0
  243. package/dist/components/v-map2.js +1 -0
  244. package/dist/esm/_commonjsHelpers-E-ZsRS8r.js +32 -0
  245. package/dist/esm/app-globals-DQuL1Twl.js +3 -0
  246. package/dist/esm/cesium-provider-BJfAup3w.js +2596 -0
  247. package/dist/esm/deck-provider-C7U9VDEq.js +47709 -0
  248. package/dist/esm/geotiff-BEWxTIfH.js +45 -0
  249. package/dist/esm/geotiff-source-esnDnC-u.js +1516 -0
  250. package/dist/esm/index-B1zwA4IC.js +685 -0
  251. package/dist/esm/index-BBpiaTpT.js +165 -0
  252. package/dist/esm/index-BIEmlzCf.js +1697 -0
  253. package/dist/esm/index-BUHa4Jj0.js +307 -0
  254. package/dist/esm/index-DbSdn93t.js +20461 -0
  255. package/dist/esm/index-RpJarvr_.js +10656 -0
  256. package/dist/esm/index-jN06TXUp.js +14 -0
  257. package/dist/esm/index-jzneDarq.js +1613 -0
  258. package/dist/esm/index.browser-DhQAXuA7.js +6860 -0
  259. package/dist/esm/index.js +1 -0
  260. package/dist/esm/layer-extension-CZXK5goK.js +63 -0
  261. package/dist/esm/leaflet-provider-Q41TB6ku.js +1794 -0
  262. package/dist/esm/loader.js +11 -0
  263. package/dist/esm/main-dist-CwnA7_Xn.js +2652 -0
  264. package/dist/esm/messages-CMKJzsgL.js +180 -0
  265. package/dist/esm/openlayers-provider-CMsDsQTQ.js +1602 -0
  266. package/dist/esm/polygon-layer-ByhxGhWC.js +1295 -0
  267. package/dist/esm/scenegraph-layer-09K_B6DT.js +2526 -0
  268. package/dist/esm/styleconfig-B-bAcABs.js +21 -0
  269. package/dist/esm/v-map-builder.entry.js +3784 -0
  270. package/dist/esm/v-map-layer-geojson_12.entry.js +40881 -0
  271. package/dist/esm/v-map-layer-helper-Dys44Cgo.js +283 -0
  272. package/dist/esm/v-map-layer-terrain-geotiff.entry.js +256 -0
  273. package/dist/esm/v-map-layercontrol.entry.js +245 -0
  274. package/dist/esm/v-map.js +21 -0
  275. package/dist/esm/v-map.v-map-layer-osm.v-map-layergroup-B4pFHuSf.js +572 -0
  276. package/dist/esm/v-map_3.entry.js +4 -0
  277. package/dist/index.cjs.js +1 -0
  278. package/dist/index.js +1 -0
  279. package/dist/types/cesium-augment.d.ts +5 -0
  280. package/dist/types/components/v-map/v-map.d.ts +70 -0
  281. package/dist/types/components/v-map/v-map.test.d.ts +1 -0
  282. package/dist/types/components/v-map-builder/v-map-builder.d.ts +48 -0
  283. package/dist/types/components/v-map-builder/v-map-builder.test.d.ts +1 -0
  284. package/dist/types/components/v-map-layer-geojson/v-map-layer-geojson.d.ts +129 -0
  285. package/dist/types/components/v-map-layer-geojson/v-map-layer-geojson.test.d.ts +1 -0
  286. package/dist/types/components/v-map-layer-geotiff/v-map-layer-geotiff.d.ts +74 -0
  287. package/dist/types/components/v-map-layer-geotiff/v-map-layer-geotiff.test.d.ts +1 -0
  288. package/dist/types/components/v-map-layer-google/v-map-layer-google.d.ts +78 -0
  289. package/dist/types/components/v-map-layer-osm/error-api.test.d.ts +1 -0
  290. package/dist/types/components/v-map-layer-osm/v-map-layer-osm.d.ts +50 -0
  291. package/dist/types/components/v-map-layer-osm/v-map-layer-osm.test.d.ts +1 -0
  292. package/dist/types/components/v-map-layer-scatterplot/v-map-layer-scatterplot.d.ts +54 -0
  293. package/dist/types/components/v-map-layer-terrain/v-map-layer-terrain.d.ts +74 -0
  294. package/dist/types/components/v-map-layer-terrain/v-map-layer-terrain.test.d.ts +1 -0
  295. package/dist/types/components/v-map-layer-terrain-geotiff/v-map-layer-terrain-geotiff.d.ts +117 -0
  296. package/dist/types/components/v-map-layer-terrain-geotiff/v-map-layer-terrain-geotiff.test.d.ts +1 -0
  297. package/dist/types/components/v-map-layer-tile3d/v-map-layer-tile3d.d.ts +69 -0
  298. package/dist/types/components/v-map-layer-tile3d/v-map-layer-tile3d.test.d.ts +1 -0
  299. package/dist/types/components/v-map-layer-wcs/v-map-layer-wcs.d.ts +47 -0
  300. package/dist/types/components/v-map-layer-wcs/v-map-layer-wcs.test.d.ts +1 -0
  301. package/dist/types/components/v-map-layer-wfs/v-map-layer-wfs.d.ts +59 -0
  302. package/dist/types/components/v-map-layer-wfs/v-map-layer-wfs.test.d.ts +1 -0
  303. package/dist/types/components/v-map-layer-wkt/v-map-layer-wkt.d.ts +132 -0
  304. package/dist/types/components/v-map-layer-wkt/v-map-layer-wkt.test.d.ts +1 -0
  305. package/dist/types/components/v-map-layer-wms/v-map-layer-wms.d.ts +76 -0
  306. package/dist/types/components/v-map-layer-wms/v-map-layer-wms.test.d.ts +1 -0
  307. package/dist/types/components/v-map-layer-xyz/v-map-layer-xyz.d.ts +59 -0
  308. package/dist/types/components/v-map-layer-xyz/v-map-layer-xyz.test.d.ts +1 -0
  309. package/dist/types/components/v-map-layercontrol/v-map-layercontrol.d.ts +44 -0
  310. package/dist/types/components/v-map-layercontrol/v-map-layercontrol.test.d.ts +1 -0
  311. package/dist/types/components/v-map-layergroup/v-map-layergroup.d.ts +31 -0
  312. package/dist/types/components/v-map-layergroup/v-map-layergroup.test.d.ts +1 -0
  313. package/dist/types/components/v-map-style/v-map-style.d.ts +75 -0
  314. package/dist/types/components/v-map-style/v-map-style.unit.d.ts +1 -0
  315. package/dist/types/components.d.ts +2391 -0
  316. package/dist/types/globals.d.ts +16 -0
  317. package/dist/types/index.d.ts +10 -0
  318. package/dist/types/layer/v-map-layer-helper.d.ts +45 -0
  319. package/dist/types/layer/v-map-layer-helper.unit.d.ts +1 -0
  320. package/dist/types/leaflet-augment.d.ts +15 -0
  321. package/dist/types/lib/cesium-loader.d.ts +3 -0
  322. package/dist/types/lib/ensure-importmap.d.ts +3 -0
  323. package/dist/types/lib/ensure-importmap.unit.d.ts +1 -0
  324. package/dist/types/lib/versions.gen.d.ts +5 -0
  325. package/dist/types/lib/vstyle.d.ts +44 -0
  326. package/dist/types/map-provider/cesium/CesiumGeoTIFFTerrainProvider.d.ts +92 -0
  327. package/dist/types/map-provider/cesium/CesiumLayerGroups.d.ts +64 -0
  328. package/dist/types/map-provider/cesium/GeoTIFFImageryProvider.d.ts +75 -0
  329. package/dist/types/map-provider/cesium/GeoTIFFImageryProvider.test.d.ts +1 -0
  330. package/dist/types/map-provider/cesium/cesium-provider.d.ts +87 -0
  331. package/dist/types/map-provider/cesium/i-layer.d.ts +11 -0
  332. package/dist/types/map-provider/cesium/layer-manager.d.ts +31 -0
  333. package/dist/types/map-provider/deck/DeckGLGeoTIFFLayer.d.ts +91 -0
  334. package/dist/types/map-provider/deck/DeckGLGeoTIFFTerrainLayer.d.ts +82 -0
  335. package/dist/types/map-provider/deck/LayerGroupWithModel.d.ts +55 -0
  336. package/dist/types/map-provider/deck/LayerGroups.d.ts +63 -0
  337. package/dist/types/map-provider/deck/LayerModel.d.ts +8 -0
  338. package/dist/types/map-provider/deck/RenderableGroup.d.ts +20 -0
  339. package/dist/types/map-provider/deck/deck-provider.d.ts +92 -0
  340. package/dist/types/map-provider/geotiff/geotiff-source.d.ts +30 -0
  341. package/dist/types/map-provider/geotiff/utils/AABB2D.d.ts +28 -0
  342. package/dist/types/map-provider/geotiff/utils/BVHNode2D.d.ts +36 -0
  343. package/dist/types/map-provider/geotiff/utils/GeoTIFFTileProcessor.d.ts +116 -0
  344. package/dist/types/map-provider/geotiff/utils/Triangle.d.ts +5 -0
  345. package/dist/types/map-provider/geotiff/utils/Triangulation.d.ts +94 -0
  346. package/dist/types/map-provider/geotiff/utils/colormap-utils.d.ts +47 -0
  347. package/dist/types/map-provider/geotiff/utils/normalization-utils.d.ts +39 -0
  348. package/dist/types/map-provider/geotiff/utils/sampling-utils.d.ts +13 -0
  349. package/dist/types/map-provider/leaflet/GeoTIFFGridLayer.d.ts +34 -0
  350. package/dist/types/map-provider/leaflet/WCSGridLayer.d.ts +38 -0
  351. package/dist/types/map-provider/leaflet/google-map-tiles-layer.d.ts +73 -0
  352. package/dist/types/map-provider/leaflet/leaflet-helpers.d.ts +6 -0
  353. package/dist/types/map-provider/leaflet/leaflet-provider.d.ts +73 -0
  354. package/dist/types/map-provider/ol/CustomGeoTiff.d.ts +14 -0
  355. package/dist/types/map-provider/ol/openlayers-helper.d.ts +2 -0
  356. package/dist/types/map-provider/ol/openlayers-provider.d.ts +80 -0
  357. package/dist/types/map-provider/provider-factory.d.ts +12 -0
  358. package/dist/types/map-provider/provider-factory.unit.d.ts +1 -0
  359. package/dist/types/namespaces.d.ts +3 -0
  360. package/dist/types/ol-augment.d.ts +3 -0
  361. package/dist/types/ol-override.d.ts +7 -0
  362. package/dist/types/ol.d.ts +10 -0
  363. package/dist/types/stencil-public-runtime.d.ts +1860 -0
  364. package/dist/types/testing/browser-test-utils.d.ts +6 -0
  365. package/dist/types/testing/e2e-testing.d.ts +5 -0
  366. package/dist/types/testing/e2e-utils.d.ts +4 -0
  367. package/dist/types/testing/geotiff-test-server.d.ts +5 -0
  368. package/dist/types/testing/mocks/geostyler-lyrx-parser.d.ts +11 -0
  369. package/dist/types/testing/mocks/geostyler-mapbox-parser.d.ts +11 -0
  370. package/dist/types/testing/mocks/geostyler-qgis-parser.d.ts +11 -0
  371. package/dist/types/testing/mocks/geostyler-sld-parser.d.ts +11 -0
  372. package/dist/types/testing/mocks/geostyler-style.d.ts +5 -0
  373. package/dist/types/testing/setupTests.browser.d.ts +1 -0
  374. package/dist/types/testing/setupTests.stencil.d.ts +1 -0
  375. package/dist/types/testing/setupTests.vitest.d.ts +1 -0
  376. package/dist/types/testing/stencil-testing-wrapper.d.ts +3 -0
  377. package/dist/types/types/color.d.ts +1 -0
  378. package/dist/types/types/cssmode.d.ts +1 -0
  379. package/dist/types/types/flavour.d.ts +1 -0
  380. package/dist/types/types/layerconfig.d.ts +207 -0
  381. package/dist/types/types/lonlat.d.ts +1 -0
  382. package/dist/types/types/mapinitoptions.d.ts +4 -0
  383. package/dist/types/types/mapprovider.d.ts +46 -0
  384. package/dist/types/types/provideroptions.d.ts +8 -0
  385. package/dist/types/types/styleconfig.d.ts +27 -0
  386. package/dist/types/types/styling.d.ts +24 -0
  387. package/dist/types/types/styling.unit.d.ts +1 -0
  388. package/dist/types/types/vmaplayer.d.ts +10 -0
  389. package/dist/types/utils/async-mutex.d.ts +7 -0
  390. package/dist/types/utils/diff.d.ts +64 -0
  391. package/dist/types/utils/diff.unit.d.ts +1 -0
  392. package/dist/types/utils/dom-env.d.ts +5 -0
  393. package/dist/types/utils/dom-env.unit.d.ts +1 -0
  394. package/dist/types/utils/events.d.ts +29 -0
  395. package/dist/types/utils/logger.d.ts +47 -0
  396. package/dist/types/utils/logger.unit.d.ts +1 -0
  397. package/dist/types/utils/messages.d.ts +12 -0
  398. package/dist/types/utils/spatial-utils.d.ts +6 -0
  399. package/dist/types/utils/spatial-utils.unit.d.ts +1 -0
  400. package/dist/types/versions.d.ts +7 -0
  401. package/dist/v-map/index.esm.js +0 -0
  402. package/dist/v-map/p--vVleK-M.js +1 -0
  403. package/dist/v-map/p-09d10db0.entry.js +1 -0
  404. package/dist/v-map/p-5eba6058.entry.js +10 -0
  405. package/dist/v-map/p-6b102336.entry.js +1 -0
  406. package/dist/v-map/p-B-bAcABs.js +1 -0
  407. package/dist/v-map/p-BBpiaTpT.js +1 -0
  408. package/dist/v-map/p-BdijL4Av.js +1 -0
  409. package/dist/v-map/p-Be3r33VF.js +4 -0
  410. package/dist/v-map/p-BeFu0ap4.js +1 -0
  411. package/dist/v-map/p-BxFJezdK.js +1 -0
  412. package/dist/v-map/p-CMKJzsgL.js +1 -0
  413. package/dist/v-map/p-CXfA_q8m.js +1 -0
  414. package/dist/v-map/p-CZqY0yW4.js +1 -0
  415. package/dist/v-map/p-CafTHT9i.js +1 -0
  416. package/dist/v-map/p-DCTHyf58.js +1 -0
  417. package/dist/v-map/p-DQuL1Twl.js +1 -0
  418. package/dist/v-map/p-DR9McdNX.js +1 -0
  419. package/dist/v-map/p-Dckgonw8.js +1 -0
  420. package/dist/v-map/p-DhQAXuA7.js +15 -0
  421. package/dist/v-map/p-DmICdG34.js +7 -0
  422. package/dist/v-map/p-DrOQ9V4h.js +1 -0
  423. package/dist/v-map/p-DvHXtWUg.js +1 -0
  424. package/dist/v-map/p-E-ZsRS8r.js +1 -0
  425. package/dist/v-map/p-MyTSFnEk.js +1 -0
  426. package/dist/v-map/p-RpJarvr_.js +1 -0
  427. package/dist/v-map/p-WaMDUuAz.js +1 -0
  428. package/dist/v-map/p-aa410e64.entry.js +2 -0
  429. package/dist/v-map/p-c21c93fe.entry.js +1 -0
  430. package/dist/v-map/p-jzneDarq.js +2 -0
  431. package/dist/v-map/p-uiIP-taz.js +1 -0
  432. package/dist/v-map/v-map.esm.js +1 -0
  433. package/loader/cdn.js +1 -0
  434. package/loader/index.cjs.js +1 -0
  435. package/loader/index.d.ts +24 -0
  436. package/loader/index.es2017.js +1 -0
  437. package/loader/index.js +2 -0
  438. package/package.json +193 -0
@@ -0,0 +1 @@
1
+ import{d as t}from"./deck-provider.js";class e{static get componentName(){return Object.prototype.hasOwnProperty.call(this,"extensionName")?this.extensionName:""}constructor(t){t&&(this.opts=t)}equals(e){return this===e||this.constructor===e.constructor&&t(this.opts,e.opts,1)}getShaders(t){return null}getSubLayerProps(t){const{defaultProps:e}=t.constructor,s={updateTriggers:{}};for(const t in e)if(t in this.props){const r=e[t],i=this.props[t];s[t]=i,r&&"accessor"===r.type&&(s.updateTriggers[t]=this.props.updateTriggers[t],"function"==typeof i&&(s[t]=this.getSubLayerAccessor(i)))}return s}initializeState(t,e){}updateState(t,e){}onNeedsRedraw(t){}getNeedsPickingBuffer(t){return!1}draw(t,e){}finalizeState(t,e){}}e.defaultProps={},e.extensionName="LayerExtension";export{e as L}
@@ -0,0 +1 @@
1
+ import{i as t,L as e,s,w as i}from"./v-map2.js";import*as r from"leaflet";import{e as o,l as a}from"./events.js";import{D as n}from"./styleconfig.js";import{l as c,G as l,g as h}from"./geotiff-source.js";import{w as u}from"./index5.js";import{GmlParser as f}from"./index.browser.js";const p=256;class y extends r.GridLayer{apiKey;highDpi;sessionRequest;scaleFactor;sessionToken;sessionPromise;sessionRefreshId;previousViewport;currentAttribution;mapInstance;onMoveEnd;constructor(t){super(),this.applyInitialGridOptions(t);const{apiKey:e,mapType:s,language:i,region:r,imageFormat:o,scale:a,highDpi:n,layerTypes:c,overlay:l,styles:h,apiOptions:u}=t;if(!e)throw new Error("Google Map Tiles layer requires an apiKey");this.apiKey=e,this.highDpi=n??(void 0===a||"scaleFactor1x"!==a),this.scaleFactor=this.mapScaleToFactor(a,this.highDpi);const f={mapType:s??"roadmap",language:i??"en-US",region:r??"US"};o&&(f.imageFormat=o),c?.length&&(f.layerTypes=c),u?.length&&(f.apiOptions=u),Array.isArray(h)&&h.length>0&&(f.styles=h),!0===l&&(f.overlay=!0);const p=a??(this.scaleFactor>1?this.factorToScale(this.scaleFactor):void 0);p&&(f.scale=p),this.highDpi&&(f.highDpi=!0),this.sessionRequest=f,this.onMoveEnd=()=>{this.updateAttribution()},this.sessionPromise=this.startSessionFetch()}onAdd(t){return this.mapInstance=t,t.on("moveend",this.onMoveEnd),t.on("zoomend",this.onMoveEnd),this.ensureSession().then((()=>this.updateAttribution())),super.onAdd(t)}onRemove(t){return t.off("moveend",this.onMoveEnd),t.off("zoomend",this.onMoveEnd),this.clearSessionRefresh(),this.removeCurrentAttribution(),this.mapInstance=void 0,super.onRemove(t)}createTile(t,e){const s=document.createElement("img");s.decoding="async",s.alt="",s.crossOrigin="anonymous";const i=this.resolveTileSize();s.width=i.x,s.height=i.y;const r=t=>{const i=t instanceof Error?t.message:"Google tile load error";e(new Error(i),s)};return s.onload=()=>e(null,s),s.onerror=t=>{const e=t instanceof ErrorEvent?t.error??new Error(t.message):new Error("Google tile failed to load");r(e)},this.ensureSession().then((()=>{this.sessionToken?s.src=this.buildTileUrl(t):r(new Error("Google Maps session unavailable"))})).catch((t=>{r(t)})),s}ensureSession(){return this.sessionToken?Promise.resolve():(this.sessionPromise||(this.sessionPromise=this.startSessionFetch()),this.sessionPromise)}startSessionFetch(t=!1){if(this.sessionPromise&&!t)return this.sessionPromise;const e=this.fetchAndApplySession().catch((t=>{const e=t instanceof Error?t:new Error("Failed to create Google Maps session");throw o("Google Map Tiles session error",e),this.sessionToken=void 0,e})).finally((()=>{this.sessionPromise===e&&(this.sessionPromise=void 0)}));return this.sessionPromise=e,e}async fetchAndApplySession(){const t=`https://tile.googleapis.com/v1/createSession?key=${this.apiKey}`,e=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(this.sessionRequest)});if(!e.ok){let t;try{const s=await e.json();t=s?.error?.message}catch{}throw new Error(t??`Google Maps session request failed (${e.status})`)}const s=await e.json();this.sessionToken=s.session,this.applyTileSize(s),this.scheduleSessionRefresh(this.parseExpiry(s.expiry)),this.mapInstance&&(this.updateAttribution(),this.redrawLayer()),a("Google Map Tiles session established")}scheduleSessionRefresh(t){if(!isFinite(t))return;const e=Math.max(t-Date.now()-6e4,1e3);this.clearSessionRefresh(),this.sessionRefreshId=setTimeout((()=>{this.startSessionFetch(!0).then((()=>{this.mapInstance&&(this.updateAttribution(),this.redrawLayer())}))}),e)}clearSessionRefresh(){void 0!==this.sessionRefreshId&&(clearTimeout(this.sessionRefreshId),this.sessionRefreshId=void 0)}async updateAttribution(){if(!this.mapInstance||!this.sessionToken)return;const t=this.mapInstance.getBounds();if(!t?.isValid())return;const e=`zoom=${this.mapInstance.getZoom()}&north=${t.getNorth()}&south=${t.getSouth()}&east=${t.getEast()}&west=${t.getWest()}`;if(this.previousViewport!==e){this.previousViewport=e;try{const t=await fetch(`https://tile.googleapis.com/tile/v1/viewport?session=${this.sessionToken}&key=${this.apiKey}&${e}`);if(!t.ok)throw new Error(`Attribution request failed (${t.status})`);const s=await t.json(),i=s?.copyright;"string"==typeof i&&i.length>0&&this.applyAttribution(i)}catch(t){o("Failed to fetch Google attribution",t)}}}applyAttribution(t){const e=this.mapInstance;e?.attributionControl&&(this.currentAttribution&&this.currentAttribution!==t&&e.attributionControl.removeAttribution(this.currentAttribution),this.currentAttribution&&this.currentAttribution===t||(e.attributionControl.addAttribution(t),this.currentAttribution=t))}removeCurrentAttribution(){const t=this.mapInstance;t?.attributionControl&&this.currentAttribution&&(t.attributionControl.removeAttribution(this.currentAttribution),this.currentAttribution=void 0)}applyTileSize(t){const e=Math.max(1,Math.round(t.tileWidth/this.scaleFactor)),s=Math.max(1,Math.round(t.tileHeight/this.scaleFactor)),i=r.point(e,s);this.setGridOptions({tileSize:i})}parseExpiry(t){const e=parseInt(t,10);return Number.isFinite(e)?1e3*e:Number.NaN}buildTileUrl(t){if(!this.sessionToken)throw new Error("Google Maps session missing");return`https://tile.googleapis.com/v1/2dtiles/${t.z}/${t.x}/${t.y}?session=${this.sessionToken}&key=${this.apiKey}`}mapScaleToFactor(t,e){switch(t){case"scaleFactor4x":return 4;case"scaleFactor2x":return 2;case"scaleFactor1x":return 1;default:return e?2:1}}factorToScale(t){switch(t){case 4:return"scaleFactor4x";case 2:return"scaleFactor2x";case 1:return"scaleFactor1x";default:return}}applyInitialGridOptions(t){const e={},s=["attribution","bounds","className","detectRetina","errorTileUrl","keepBuffer","maxNativeZoom","maxZoom","minNativeZoom","minZoom","noWrap","opacity","pane","reuseTiles","subdomains","tileSize","tms","updateInterval","updateWhenIdle","updateWhenZooming","zIndex","zoomOffset"];for(const i of s){const s=t[i];void 0!==s&&(e[i]=s)}void 0===e.maxZoom&&(e.maxZoom=22),this.setGridOptions(e)}setGridOptions(t){const e=r.Util?.setOptions;if("function"==typeof e)e(this,t);else{const e=this;e.options={...e.options,...t}}}resolveTileSize(){const t=this.options?.tileSize;if(t&&"object"==typeof t){if(Array.isArray(t)&&2===t.length){const[e,s]=t;return r.point(Number(e)||p,Number(s)||p)}if("x"in t&&"y"in t){const e=t;return r.point(Number(e.x)||p,Number(e.y)||p)}}return"number"==typeof t&&Number.isFinite(t)?r.point(t,t):r.point(p,p)}redrawLayer(){this.redraw()}}class d extends r.GridLayer{geotiffOptions;tileProcessor=null;colorStops;loadingPromise;defaultResolution=1;defaultResample="bilinear";constructor(t){super(t),this.geotiffOptions={...t}}onAdd(t){return super.onAdd(t),this.ensureReady().then((()=>this.redraw())),this}createTile(t,e){const s=this.getTileSize(),i=r.DomUtil.create("canvas","leaflet-tile");return i.width=s.x,i.height=s.y,this.ensureReady().then((async()=>{if(this.tileProcessor)try{const r=await this.tileProcessor.getTileData({x:t.x,y:t.y,z:t.z,tileSize:s.x,resolution:this.geotiffOptions.resolution??this.defaultResolution,resampleMethod:this.geotiffOptions.resampleMethod??this.defaultResample,colorStops:this.colorStops});if(!r)return void e(null,i);const o=i.getContext("2d");if(o){const t=o.createImageData(s.x,s.y);t.data.set(r),o.putImageData(t,0,0)}e(null,i)}catch(t){e(t,i)}else e(null,i)})).catch((t=>{e(t,i)})),i}async ensureReady(){return this.loadingPromise||(this.loadingPromise=this.initializeProcessor()),this.loadingPromise}async updateSource(t){Object.assign(this.geotiffOptions,t),this.tileProcessor=null,this.colorStops=void 0,this.loadingPromise=void 0,await this.ensureReady(),this.redraw()}async initializeProcessor(){if(this.tileProcessor)return;const[t,{default:e},s]=await Promise.all([import("./geotiff.js").then((function(t){return t.g})),import("./index4.js"),import("./main-dist.js").then((function(t){return t.m}))]),i=await c(this.geotiffOptions.url,{projection:void 0,forceProjection:!1,nodata:this.geotiffOptions.nodata},{geotiff:t,proj4:e,geokeysToProj4:s}),r=t=>{const e=i.proj4(i.fromProjection,this.geotiffOptions.viewProjection,t);return[Number(e[0]),Number(e[1])]};if(this.tileProcessor=new l({transformViewToSourceMapFn:t=>{const e=i.proj4(this.geotiffOptions.viewProjection,i.fromProjection,t);return[Number(e[0]),Number(e[1])]},transformSourceMapToViewFn:r,sourceBounds:i.sourceBounds,sourceRef:i.sourceRef,resolution:i.resolution,imageWidth:i.width,imageHeight:i.height,fromProjection:i.fromProjection,toProjection:this.geotiffOptions.viewProjection,baseImage:i.baseImage,overviewImages:i.overviewImages??[]}),this.tileProcessor.createGlobalTriangulation(),this.setViewBounds(i.sourceBounds,r),this.geotiffOptions.colorMap){const{stops:t}=h(this.geotiffOptions.colorMap,this.geotiffOptions.valueRange);this.colorStops=t}}setViewBounds(t,e){const[s,i,o,a]=t,n=e([s,i]),c=e([o,i]),l=e([s,a]),h=e([o,a]),u=Math.min(n[0],c[0],l[0],h[0]),f=Math.max(n[0],c[0],l[0],h[0]),p=Math.min(n[1],c[1],l[1],h[1]),y=Math.max(n[1],c[1],l[1],h[1]),d=r.CRS.EPSG3857.unproject(r.point(u,y)),m=r.CRS.EPSG3857.unproject(r.point(f,p));this.options.bounds=r.latLngBounds(d,m)}}const m="v-map - leaflet - wcs - tile - ";class w extends r.GridLayer{wcsOptions;constructor(t){super(t),this.wcsOptions={...t,version:t.version??"2.0.1",format:t.format??"image/tiff",projection:t.projection??"EPSG:4326"}}buildWCSUrl(t){const{url:e,coverageName:s,version:i,format:r,projection:o,params:a}=this.wcsOptions,n=this._tileCoordsToBounds(t),c=n.getSouthWest(),l=n.getNorthEast(),h=c.lng,u=c.lat,f=l.lng,p=l.lat,y={SERVICE:"WCS",REQUEST:"GetCoverage",VERSION:i,FORMAT:r};if(i.startsWith("2.0")){y.coverageId=s;const t=a?{...a}:{},i={...y,...t};(r.includes("tiff")||r.includes("geotiff"))&&(i["geotiff:compression"]="LZW");const o=new URLSearchParams;Object.entries(i).forEach((([t,e])=>{null!=e&&o.set(t,String(e))}));const n=o.toString(),c=`subset=X(${h},${f})`,l=`subset=Y(${u},${p})`;return`${e}${e.includes("?")?"&":"?"}${n}&${c}&${l}`}{y.COVERAGE=s,y.BBOX=`${h},${u},${f},${p}`,y.CRS=o;const t=this.getTileSize();y.WIDTH="number"==typeof t?t:t.x,y.HEIGHT="number"==typeof t?t:t.y;const i=a?{...a}:{},r={...y,...i},n=new URLSearchParams;return Object.entries(r).forEach((([t,e])=>{null!=e&&n.set(t,String(e))})),`${e}${e.includes("?")?"&":"?"}${n.toString()}`}}createTile(t,e){const s=document.createElement("img"),i=this.buildWCSUrl(t);return a(`${m}load: coords=(${t.x},${t.y},${t.z})`),a(`${m}url: ${i}`),s.onload=()=>{e(null,s)},s.onerror=t=>{o(`${m}failed to load tile:`,t),e(t instanceof Error?t:new Error(String(t)),s)},s.crossOrigin="anonymous",s.src=i,s}updateOptions(t){this.wcsOptions={...this.wcsOptions,...t},this.redraw()}}class g{map;layers=[];baseLayers=[];hiddenLayerGroups=[];googleLogoAdded=!1;unsubscribeResize;shadowRoot;injectedStyle;layerErrorCallbacks=new Map;layerErrorCleanups=new Map;async init(o){if(!t())return;this.shadowRoot=o.shadowRoot,this.injectedStyle=function(i,o){if(t()){switch(i){case"cdn":return function(s,i=e,o="jsdelivr"){if(!t())return;const a="unpkg"===o?`https://unpkg.com/leaflet@${i}/dist/leaflet.css`:`https://cdn.jsdelivr.net/npm/leaflet@${i}/dist/leaflet.css`;r.Icon.Default.imagePath="unpkg"===o?`https://unpkg.com/npm/leaflet@${i}/dist/images/`:`https://cdn.jsdelivr.net/npm/leaflet@${i}/dist/images/`;const n=s??document;if(n.querySelector?.(`link[rel="stylesheet"][href="${a}"]`)||document.head.querySelector(`link[rel="stylesheet"][href="${a}"]`))return null;const c=document.createElement("link");return c.rel="stylesheet",c.href=a,(s??document.head).appendChild(c),c}(o);case"inline-min":return function(e){if(!t())return;const i="\n :host { display:block; }\n #map { width:100%; height:100%; display:block; }\n ";if(s()){const t=new CSSStyleSheet;t.replaceSync(i);const s=e??document;return s.adoptedStyleSheets=[...s.adoptedStyleSheets??[],t],null}{const t=document.createElement("style");return t.textContent=i,(e??document.head).appendChild(t),t}}(o)}return null}}(o.cssMode,this.shadowRoot);const[a,n]=o?.mapInitOptions?.center??[0,0];this.map=r.map(o.target,{zoomControl:!0,attributionControl:!0}).setView([n,a],o?.mapInitOptions?.zoom??2),this.unsubscribeResize=i(o.target,(()=>{this.map?.invalidateSize()}),{attributes:!0,attributeFilter:["style","class"]})}async updateLayer(t,e){const s=await this._getLayerById(t);switch(e.type){case"geojson":await this.updateGeoJSONLayer(s,e.data);break;case"osm":await this.updateOSMLayer(s,e.data);break;case"arcgis":await this.updateArcGISLayer(s,e.data);break;case"wkt":await this.updateWKTLayer(s,e.data);break;case"geotiff":await this.updateGeoTIFFLayer(s,e.data);break;case"wcs":await this.updateWCSLayer(s,e.data);break;case"wfs":s instanceof r.GeoJSON&&await this.updateWFSLayer(s,e.data)}}async addLayerToGroup(t){const e=await this._ensureGroup(t.groupId,t.groupVisible),s=await this.createLayer(t);if(null==s)return null;e.addLayer(s);const i=this.getLayerId(s);return s.vmapVisible=!0,s.vmapOpacity=1,void 0!==t.opacity&&this.setOpacityByLayer(s,t.opacity),void 0!==t.zIndex&&s.setZIndex?.(t.zIndex),t.visible?this.setVisibleByLayer(s,!0):!1===t.visible&&this.setVisibleByLayer(s,!1),i}async addBaseLayer(t,e,s){if(null==s)return a("leaflet - addBaseLayer - layerElementId not set."),null;null==e&&a("leaflet - addBaseLayer - basemapid not set.");const i=await this._ensureGroup(t.groupId,t.groupVisible);i.basemap=!0;const r=await this.createLayer(t);if(this.baseLayers.push(r),null==r)return null;r.layerElementId=s;const o=this.getLayerId(r);if(r.vmapVisible=!0,r.vmapOpacity=1,void 0!==t.opacity&&this.setOpacityByLayer(r,t.opacity),void 0!==t.zIndex&&r.setZIndex?.(t.zIndex),t.visible?this.setVisibleByLayer(r,!0):!1===t.visible&&this.setVisibleByLayer(r,!1),e===s){const t=i.getLayers()[0];t&&(this.map.removeLayer(t),i.clearLayers()),i.addLayer(r),i.visible&&r.addTo(this.map)}return o}async setBaseLayer(t,e){if(null===e)return void a("leaflet - setBaseLayer - layerElementId is null.");const s=this.layers.find((e=>e._groupId===t)),i=this.baseLayers.find((t=>t.layerElementId===e));if(void 0===i)return void a("leaflet - setBaseLayer - layer not found. layerElementId: "+e);if(!s)return;const r=s.getLayers()[0];r&&(this.map.removeLayer(r),s.clearLayers()),s.addLayer(i)}getLayerId(t){return String(r.Util.stamp(t))}normalizeAttribution(t){return Array.isArray(t)?t.join(", "):t}async _getLayerById(t){let e=null;return this.map?.eachLayer((s=>{this.getLayerId(s)===t&&(e=s)})),e||(e=this.baseLayers.find((e=>this.getLayerId(e)===t))??null,void 0===e?null:e)}async createLayer(t){switch(t.type){case"geojson":return this.createGeoJSONLayer(t);case"xyz":return this.createXYZLayer(t);case"osm":return this.createOSMLayer(t);case"wms":return this.createWMSLayer(t);case"wcs":return this.createWCSLayer(t);case"wfs":return this.createWFSLayer(t);case"arcgis":return this.createArcGISLayer(t);case"google":return this.createGoogleLayer(t);case"wkt":return this.createWKTLayer(t);case"geotiff":return this.createGeoTIFFLayer(t);default:throw new Error(`Unsupported layer type: ${t.type}`)}}async updateGeoJSONLayer(t,e){if(!(t instanceof r.GeoJSON))return;let s=null;if(e.geojson)s=JSON.parse(e.geojson);else if(e.url){const t=await fetch(e.url);if(!t.ok)throw new Error(`GeoJSON fetch failed: ${t.status} ${t.statusText}`);s=await t.json()}t.clearLayers(),t.addData(s)}async createGeoJSONLayer(t){let e=null;if(t.geojson)e=JSON.parse(t.geojson);else if(t.url){const s=await fetch(t.url);if(!s.ok)throw new Error(`GeoJSON fetch failed: ${s.status} ${s.statusText}`);e=await s.json()}if(e){let s={};if(t.geostylerStyle)s=await this.createGeostylerLeafletOptions(t.geostylerStyle);else{const e=t.style?{...n,...t.style}:n;s={style:this.createLeafletStyle(e),pointToLayer:(t,s)=>this.createLeafletPoint(t,s,e),onEachFeature:(t,s)=>this.bindLeafletPopup(t,s,e)}}return r.geoJSON(e,s)}return null}async createXYZLayer(t){return r.tileLayer(t.url,{attribution:this.normalizeAttribution(t.attributions),maxZoom:t.maxZoom??19,...t.options??{}})}async updateOSMLayer(t,e){if(!("setUrl"in t)||"function"!=typeof t.setUrl)return;let s="https://tile.openstreetmap.org/{z}/{x}/{y}.png";e.url&&(s=e.url+"/{z}/{x}/{y}.png"),t.setUrl(s)}async createOSMLayer(t){let e="https://tile.openstreetmap.org/{z}/{x}/{y}.png";return t.url&&(e=t.url+"/{z}/{x}/{y}.png"),r.tileLayer(e,{attribution:"© OpenStreetMap contributors",maxZoom:19})}async createWMSLayer(t){return r.tileLayer.wms(t.url,{layers:t.layers,format:t.format??"image/png",transparent:t.transparent??!0,...t.extraParams??{}})}buildArcGISUrl(t,e){if(!e||0===Object.keys(e).length)return t;const s=new URLSearchParams;return Object.entries(e).forEach((([t,e])=>{null!=e&&s.set(t,String(e))})),0===s.toString().length?t:`${t}${t.includes("?")?"&":"?"}${s.toString()}`}async createArcGISLayer(t){const e={...t.params??{}};t.token&&(e.token=t.token);const s=this.buildArcGISUrl(t.url,e),i={attribution:this.normalizeAttribution(t.attributions),minZoom:t.minZoom,maxZoom:t.maxZoom,...t.options??{}};return r.tileLayer(s,i)}async updateArcGISLayer(t,e){const s={...e?.params??{}};e?.token&&(s.token=e.token);const i=t,r=this.buildArcGISUrl(e?.url??i.options?.url??"",s);"setUrl"in i&&"function"==typeof i.setUrl&&i.setUrl(r)}async createGoogleLayer(t){if(!this.map)throw new Error("Map not initialized");if(!t.apiKey)throw new Error("Google-Layer benötigt 'apiKey' (Google Maps Platform).");const e="string"==typeof t.styles?this.tryParseStyles(t.styles):t.styles,s=new y({apiKey:t.apiKey,mapType:t.mapType??"roadmap",language:t.language,region:t.region,scale:t.scale,highDpi:t.highDpi,layerTypes:t.layerTypes,overlay:t.overlay,styles:Array.isArray(e)?e:void 0,imageFormat:t.imageFormat,apiOptions:t.apiOptions,maxZoom:t.maxZoom??22});return o=()=>{this.googleLogoAdded=!0,a("v-map - provider - leaflet - googleLogoAdded: ",this.googleLogoAdded)},(i=this.map)._googleLogoAdded||(new(r.Control.extend({onAdd(){const t=r.DomUtil.create("img");return t.src="https://developers.google.com/static/maps/documentation/images/google_on_white.png",t.alt="Google",t.style.pointerEvents="none",t.style.height="18px",t.style.margin="0 0 6px 6px",t},onRemove(){}}))({position:"bottomleft"}).addTo(i),i._googleLogoAdded=!0,o()),s;var i,o}tryParseStyles(t){try{const e=JSON.parse(t);return Array.isArray(e)?e:void 0}catch{return void o("Failed to parse Google styles JSON")}}async destroy(){var t;this.unsubscribeResize?.(),t=this.injectedStyle,this.shadowRoot&&t&&t.remove();for(const t of this.layers)this.map?.removeLayer(t);this.layers=[],this.map?.remove(),this.map=void 0}async setView([t,e],s){this.map?.setView([e,t],s,{animate:!1})}onLayerError(t,e){this.layerErrorCallbacks.set(t,e),this._getLayerById(t).then((s=>{if(!s)return;const i=()=>{e({type:"network",message:"Tile load error"})};s.on("tileerror",i),this.layerErrorCleanups.set(t,(()=>s.off("tileerror",i)))}))}offLayerError(t){this.layerErrorCleanups.get(t)?.(),this.layerErrorCleanups.delete(t),this.layerErrorCallbacks.delete(t)}async removeLayer(t){if(!t)return;this.offLayerError(t);const e=await this._getLayerById(t);e&&this.map.removeLayer(e)}async setZIndex(t,e){if(!t)return;const s=await this._getLayerById(t);s&&"function"==typeof s.setZIndex&&s.setZIndex(e)}async setOpacity(t,e){if(!t)return;const s=await this._getLayerById(t);this.setOpacityByLayer(s,e)}setOpacityByLayer(t,e){t&&(t.vmapOpacity=e,void 0===t.vmapVisible&&(t.vmapVisible=!0),!1!==t.vmapVisible&&this.setLayerOpacity(t,e))}async setVisible(t,e){if(!t)return;const s=await this._getLayerById(t);this.setVisibleByLayer(s,e)}setVisibleByLayer(t,e){t&&(t.vmapVisible=e,void 0===t.vmapOpacity&&(t.vmapOpacity=1),this.setLayerOpacity(t,e?t.vmapOpacity:0))}setLayerOpacity(t,e){if(!t)return;const s="number"==typeof e?e:e.opacity??1,i="number"==typeof e?e:e.fillOpacity??s,o=(t,e)=>{if(!(e in r))return!1;const s=r[e];return"function"==typeof s&&t instanceof s};var a;o(a=t,"GeoJSON")||o(a,"LayerGroup")?t.eachLayer((t=>this.setLayerOpacity(t,e))):(t=>o(t,"Path"))(t)?t.setStyle({opacity:s,fillOpacity:i}):((t=>o(t,"Marker"))(t)||"setOpacity"in t)&&t.setOpacity(s)}async ensureGroup(t,e,s){await this._ensureGroup(t,e)}async _ensureGroup(t,e){let s=await this._getLayerGroupById(t);return s||(s=r.layerGroup(),s._groupId=t,s.visible=!0,s.addTo(this.map),this.layers.push(s)),this.setGroupVisible(t,void 0===e||e),s}async _getLayerGroupById(t){if(!this.map)return null;let e=this.layers.find((e=>e instanceof r.LayerGroup&&e._groupId===t));return e||(e=this.hiddenLayerGroups.find((e=>e._groupId===t)),e)?e:null}async setGroupVisible(t,e){const s=await this._getLayerGroupById(t);if(s){if(s.visible===e)return;!1===s.visible?(s.addTo(this.map),this.hiddenLayerGroups=this.hiddenLayerGroups.filter((e=>e._groupId!==t)),s.visible=e):!0===s.visible&&(this.map.removeLayer(s),s.visible=e,this.hiddenLayerGroups.push(s))}}async updateWKTLayer(t,e){if(!(t instanceof r.GeoJSON))return;let s=null;if(e.wkt)s=await this.wktToGeoJSON(e.wkt);else if(e.url)try{const t=await fetch(e.url);if(!t.ok)throw new Error(`Failed to fetch WKT: ${t.status}`);const i=await t.text();s=await this.wktToGeoJSON(i)}catch(t){return void o("Failed to load WKT from URL:",t)}if(s){t.clearLayers();const i=t;i.options.style=this.createLeafletStyle(e.style),i.options.pointToLayer=(t,s)=>this.createLeafletPoint(t,s,e.style),i.options.onEachFeature=(t,s)=>this.bindLeafletPopup(t,s,e.style),i.addData(s)}}async createWKTLayer(t){let e=null;const s={type:"FeatureCollection",features:[]};if(t.wkt)e=await this.wktToGeoJSON(t.wkt);else if(t.url)try{const s=await fetch(t.url);if(!s.ok)throw new Error(`Failed to fetch WKT: ${s.status}`);const i=await s.text();e=await this.wktToGeoJSON(i)}catch(t){o("Failed to load WKT from URL:",t),e=s}else e=s;a("[Leaflet WKT] Creating layer with GeoJSON data:",e),a("[Leaflet WKT] Config:",t);let i={};if(t.geostylerStyle)i=await this.createGeostylerLeafletOptions(t.geostylerStyle);else{const e=t.style?{...n,...t.style}:n;i={style:this.createLeafletStyle(e),pointToLayer:(t,s)=>this.createLeafletPoint(t,s,e),onEachFeature:(t,s)=>this.bindLeafletPopup(t,s,e)}}a("[Leaflet WKT] Layer options:",i);const c=r.geoJSON(e,i);return a("[Leaflet WKT] Created layer:",c),"function"==typeof c.getBounds&&a("[Leaflet WKT] Layer bounds:",c.getBounds()),c}async wktToGeoJSON(t){try{const e=u.wellknown.parse(t);if(!e)throw new Error("Failed to parse WKT - returned null");const s={type:"Feature",geometry:e,properties:{}};return a("[Leaflet WKT] Input WKT:",t),a("[Leaflet WKT] Generated GeoJSON:",JSON.stringify(s,null,2)),{type:"FeatureCollection",features:[s]}}catch(e){return o("[Leaflet WKT] Failed to parse WKT:",t,e),{type:"FeatureCollection",features:[]}}}async createGeoTIFFLayer(t){if(!t.url)throw new Error("GeoTIFF layer requires a URL");try{const e=new d({url:t.url,tileSize:256,colorMap:t.colorMap,valueRange:t.valueRange,nodata:t.nodata,resolution:t.resolution,resampleMethod:t.resampleMethod,viewProjection:this.map.options.crs.code});return void 0!==t.opacity&&e.setOpacity?.(t.opacity),void 0!==t.zIndex&&e.setZIndex?.(t.zIndex),e}catch(t){return o("Failed to create GeoTIFF layer:",t),r.layerGroup([])}}async updateGeoTIFFLayer(t,e){if(!e.url)throw new Error("GeoTIFF update requires a URL");if(!t)return;if(!(t instanceof d))return;const s=e;await t.updateSource({url:e.url,colorMap:e.colorMap,valueRange:e.valueRange,nodata:e.nodata,resolution:s.resolution,resampleMethod:s.resampleMethod})}async createWCSLayer(t){if(!t.url)throw new Error("WCS layer requires a URL");if(!t.coverageName)throw new Error("WCS layer requires a coverageName");try{const e={url:t.url,coverageName:t.coverageName,version:t.version??"2.0.1",format:t.format??"image/tiff",projection:t.projection??"EPSG:4326",params:t.params};t.tileSize&&(e.tileSize=t.tileSize),void 0!==t.minZoom&&(e.minZoom=t.minZoom),void 0!==t.maxZoom&&(e.maxZoom=t.maxZoom);const s=new w(e);return void 0!==t.opacity&&s.setOpacity?.(t.opacity),void 0!==t.zIndex&&s.setZIndex?.(t.zIndex),s}catch(t){return o("[Leaflet WCS] Failed to create WCS layer:",t),r.layerGroup([])}}async updateWCSLayer(t,e){if(t&&t instanceof w){const s={};e.url&&(s.url=e.url),e.coverageName&&(s.coverageName=e.coverageName),e.version&&(s.version=e.version),e.format&&(s.format=e.format),e.projection&&(s.projection=e.projection),e.params&&(s.params=e.params),t.updateOptions(s)}}async createGeostylerLeafletOptions(t){const e=(t,e)=>null==t||"object"==typeof t&&t.name?e:t;return{style:s=>{const i=s?.geometry?.type;let r={};if(t.rules)for(const s of t.rules)if(s.symbolizers)for(const t of s.symbolizers)switch(t.kind){case"Fill":if("Polygon"===i||"MultiPolygon"===i){const s=e(t.color,"rgba(0,100,255,0.3)"),i=e(t.opacity,.3),o=e(t.outlineColor,"rgba(0,100,255,1)"),a=e(t.outlineWidth,1);r={...r,fillColor:s,fillOpacity:i,color:o,weight:a}}break;case"Line":const s=e(t.color,"rgba(0,100,255,1)"),o=e(t.width,2),a=t.dasharray&&Array.isArray(t.dasharray)?t.dasharray.map((t=>e(t,0))).join(","):void 0;r={...r,color:s,weight:o,dashArray:a}}return r},pointToLayer:(s,i)=>{if(t.rules)for(const s of t.rules)if(s.symbolizers)for(const t of s.symbolizers)switch(t.kind){case"Mark":const s=e(t.color,"rgba(0,100,255,1)"),o=e(t.radius,6),a=e(t.strokeColor,"rgba(0,100,255,1)"),n=e(t.strokeWidth,2);return r.circleMarker(i,{radius:o,fillColor:s,fillOpacity:1,color:a,weight:n});case"Icon":const c=e(t.image),l=e(t.size,32);if(c&&"string"==typeof c){const t=r.icon({iconUrl:c,iconSize:[l,l],iconAnchor:[l/2,l]});return r.marker(i,{icon:t})}}return r.circleMarker(i,{radius:6,fillColor:"rgba(0,100,255,1)",fillOpacity:1,color:"rgba(0,100,255,1)",weight:2})},onEachFeature:(s,i)=>{if(t.rules)for(const r of t.rules)if(r.symbolizers)for(const t of r.symbolizers)if("Text"===t.kind){const r=t.label;if(r&&"string"==typeof r&&s.properties&&s.properties[r]){const o=String(s.properties[r]),a=e(t.color,"#000000"),n=e(t.size,12);i.bindTooltip(`<div style="color: ${a}; font-size: ${n}px; font-family: Arial, sans-serif;">${o}</div>`,{permanent:!0,direction:"center",className:"leaflet-tooltip-custom"})}}}}}createLeafletStyle(t){return e=>{const s=e?.geometry?.type,i=t?.fillColor??"rgba(0,100,255,0.3)",r=t?.fillOpacity??.3,o=t?.strokeColor??"rgba(0,100,255,1)",a=t?.strokeOpacity??1,n=t?.strokeWidth??2;return"Polygon"===s||"MultiPolygon"===s?{fillColor:i,fillOpacity:r,color:o,opacity:a,weight:n,dashArray:t?.strokeDashArray?t.strokeDashArray.join(","):void 0}:"LineString"===s||"MultiLineString"===s?{color:o,opacity:a,weight:n,dashArray:t?.strokeDashArray?t.strokeDashArray.join(","):void 0}:{}}}createLeafletPoint(t,e,s){let i={...s??{}};if(s?.styleFunction){const e=s.styleFunction(t);e&&(i={...s,...e})}if(i?.iconUrl){const t=i.iconSize||[32,32],s=r.icon({iconUrl:i.iconUrl,iconSize:t,iconAnchor:i.iconAnchor||[t[0]/2,t[1]]});return r.marker(e,{icon:s})}{const t=i?.pointColor??"rgba(0,100,255,1)",s=i?.pointOpacity??1;return r.circleMarker(e,{radius:i?.pointRadius??6,fillColor:t,fillOpacity:s,color:i?.strokeColor??"rgba(0,100,255,1)",opacity:i?.strokeOpacity??1,weight:i?.strokeWidth??2})}}bindLeafletPopup(t,e,s){if(s?.textProperty&&t.properties&&t.properties[s.textProperty]){const i=String(t.properties[s.textProperty]);e.bindTooltip(`<div style="color: ${s?.textColor??"#000000"}; font-size: ${s?.textSize??12}px; font-family: Arial, sans-serif;">${i}</div>`,{permanent:!0,direction:"center",className:"leaflet-tooltip-custom"})}}async createWFSLayer(t){const e=await this.fetchWFSFromUrl(t);let s={};if(t.geostylerStyle)s=await this.createGeostylerLeafletOptions(t.geostylerStyle);else{const e=t.style?{...n,...t.style}:n;s={style:this.createLeafletStyle(e),pointToLayer:(t,s)=>this.createLeafletPoint(t,s,e),onEachFeature:(t,s)=>this.bindLeafletPopup(t,s,e)}}return r.geoJSON(e,s)}async updateWFSLayer(t,e){const s=await this.fetchWFSFromUrl(e);t.clearLayers(),t.addData(s)}async fetchWFSFromUrl(t){const e={service:"WFS",request:"GetFeature",version:t.version??"1.1.0",typeName:t.typeName,outputFormat:t.outputFormat??"application/json",srsName:t.srsName??"EPSG:4326",...t.params??{}},s=this.appendParams(t.url,e),i=await fetch(s);if(!i.ok)throw new Error(`WFS request failed (${i.status} ${i.statusText})`);const r=(t.outputFormat??"application/json").toLowerCase();if(r.includes("json")||r.includes("geojson")||"application/json"===r)return await i.json();if(r.includes("gml")||r.includes("xml")){const t=await i.text(),e=new f;return await e.parse(t)}return await i.json()}appendParams(t,e){const s=new URLSearchParams;return Object.entries(e).forEach((([t,e])=>{null!=e&&s.set(t,String(e))})),s.toString()?`${t}${t.includes("?")?"&":"?"}${s.toString()}`:t}getMap(){return this.map}}export{g as LeafletProvider}