@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.
- package/LICENSE +21 -0
- package/README.md +185 -0
- package/dist/cjs/_commonjsHelpers-B83fTs8d.js +36 -0
- package/dist/cjs/app-globals-V2Kpy_OQ.js +5 -0
- package/dist/cjs/cesium-provider-BiFFyAl9.js +2598 -0
- package/dist/cjs/deck-provider-Ctq3Q8a1.js +47824 -0
- package/dist/cjs/geotiff-CEwvF9cG.js +47 -0
- package/dist/cjs/geotiff-source-RaNzzWkC.js +1522 -0
- package/dist/cjs/index-B1oGO1g-.js +10658 -0
- package/dist/cjs/index-B8LHqjyg.js +1765 -0
- package/dist/cjs/index-BIL4VsgP.js +310 -0
- package/dist/cjs/index-Blku2QY8.js +167 -0
- package/dist/cjs/index-CJvvX4yx.js +21 -0
- package/dist/cjs/index-CbVT-Con.js +699 -0
- package/dist/cjs/index-ISOEpMC3.js +20478 -0
- package/dist/cjs/index-JSwBbvGA.js +1621 -0
- package/dist/cjs/index.browser-DQhD8Jwl.js +6873 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/layer-extension-B_olS0rc.js +65 -0
- package/dist/cjs/leaflet-provider-DOqfs7g5.js +1815 -0
- package/dist/cjs/loader.cjs.js +13 -0
- package/dist/cjs/main-dist-7TykwFci.js +2655 -0
- package/dist/cjs/messages-D7h4m8Tx.js +186 -0
- package/dist/cjs/openlayers-provider-Dfeg6L4n.js +1604 -0
- package/dist/cjs/polygon-layer-B9PrN7vr.js +1300 -0
- package/dist/cjs/scenegraph-layer-DwNoxQdi.js +2530 -0
- package/dist/cjs/styleconfig-CVRqArk-.js +23 -0
- package/dist/cjs/v-map-builder.cjs.entry.js +3786 -0
- package/dist/cjs/v-map-layer-geojson_12.cjs.entry.js +40894 -0
- package/dist/cjs/v-map-layer-helper-iAzxAg9I.js +285 -0
- package/dist/cjs/v-map-layer-terrain-geotiff.cjs.entry.js +258 -0
- package/dist/cjs/v-map-layercontrol.cjs.entry.js +247 -0
- package/dist/cjs/v-map.cjs.js +25 -0
- package/dist/cjs/v-map.v-map-layer-osm.v-map-layergroup-BsXp3BoL.js +582 -0
- package/dist/cjs/v-map_3.cjs.entry.js +12 -0
- package/dist/collection/collection-manifest.json +30 -0
- package/dist/collection/components/v-map/v-map.css +3 -0
- package/dist/collection/components/v-map/v-map.js +467 -0
- package/dist/collection/components/v-map/v-map.test.js +33 -0
- package/dist/collection/components/v-map-builder/v-map-builder.css +1 -0
- package/dist/collection/components/v-map-builder/v-map-builder.js +913 -0
- package/dist/collection/components/v-map-builder/v-map-builder.test.js +56 -0
- package/dist/collection/components/v-map-layer-geojson/v-map-layer-geojson.js +862 -0
- package/dist/collection/components/v-map-layer-geojson/v-map-layer-geojson.test.js +42 -0
- package/dist/collection/components/v-map-layer-geotiff/v-map-layer-geotiff.css +4 -0
- package/dist/collection/components/v-map-layer-geotiff/v-map-layer-geotiff.js +500 -0
- package/dist/collection/components/v-map-layer-geotiff/v-map-layer-geotiff.test.js +38 -0
- package/dist/collection/components/v-map-layer-google/v-map-layer-google.css +1 -0
- package/dist/collection/components/v-map-layer-google/v-map-layer-google.js +442 -0
- package/dist/collection/components/v-map-layer-osm/error-api.test.js +108 -0
- package/dist/collection/components/v-map-layer-osm/v-map-layer-osm.css +4 -0
- package/dist/collection/components/v-map-layer-osm/v-map-layer-osm.js +311 -0
- package/dist/collection/components/v-map-layer-osm/v-map-layer-osm.test.js +36 -0
- package/dist/collection/components/v-map-layer-scatterplot/v-map-layer-scatterplot.css +1 -0
- package/dist/collection/components/v-map-layer-scatterplot/v-map-layer-scatterplot.js +305 -0
- package/dist/collection/components/v-map-layer-terrain/v-map-layer-terrain.css +3 -0
- package/dist/collection/components/v-map-layer-terrain/v-map-layer-terrain.js +548 -0
- package/dist/collection/components/v-map-layer-terrain/v-map-layer-terrain.test.js +36 -0
- package/dist/collection/components/v-map-layer-terrain-geotiff/v-map-layer-terrain-geotiff.css +3 -0
- package/dist/collection/components/v-map-layer-terrain-geotiff/v-map-layer-terrain-geotiff.js +735 -0
- package/dist/collection/components/v-map-layer-terrain-geotiff/v-map-layer-terrain-geotiff.test.js +42 -0
- package/dist/collection/components/v-map-layer-tile3d/v-map-layer-tile3d.css +3 -0
- package/dist/collection/components/v-map-layer-tile3d/v-map-layer-tile3d.js +449 -0
- package/dist/collection/components/v-map-layer-tile3d/v-map-layer-tile3d.test.js +50 -0
- package/dist/collection/components/v-map-layer-wcs/v-map-layer-wcs.css +1 -0
- package/dist/collection/components/v-map-layer-wcs/v-map-layer-wcs.js +448 -0
- package/dist/collection/components/v-map-layer-wcs/v-map-layer-wcs.test.js +39 -0
- package/dist/collection/components/v-map-layer-wfs/v-map-layer-wfs.css +1 -0
- package/dist/collection/components/v-map-layer-wfs/v-map-layer-wfs.js +489 -0
- package/dist/collection/components/v-map-layer-wfs/v-map-layer-wfs.test.js +43 -0
- package/dist/collection/components/v-map-layer-wkt/v-map-layer-wkt.css +1 -0
- package/dist/collection/components/v-map-layer-wkt/v-map-layer-wkt.js +811 -0
- package/dist/collection/components/v-map-layer-wkt/v-map-layer-wkt.test.js +34 -0
- package/dist/collection/components/v-map-layer-wms/v-map-layer-wms.css +1 -0
- package/dist/collection/components/v-map-layer-wms/v-map-layer-wms.js +453 -0
- package/dist/collection/components/v-map-layer-wms/v-map-layer-wms.test.js +36 -0
- package/dist/collection/components/v-map-layer-xyz/v-map-layer-xyz.css +1 -0
- package/dist/collection/components/v-map-layer-xyz/v-map-layer-xyz.js +331 -0
- package/dist/collection/components/v-map-layer-xyz/v-map-layer-xyz.test.js +28 -0
- package/dist/collection/components/v-map-layercontrol/v-map-layercontrol.css +74 -0
- package/dist/collection/components/v-map-layercontrol/v-map-layercontrol.js +277 -0
- package/dist/collection/components/v-map-layercontrol/v-map-layercontrol.test.js +134 -0
- package/dist/collection/components/v-map-layergroup/v-map-layergroup.css +4 -0
- package/dist/collection/components/v-map-layergroup/v-map-layergroup.js +212 -0
- package/dist/collection/components/v-map-layergroup/v-map-layergroup.test.js +39 -0
- package/dist/collection/components/v-map-style/v-map-style.css +38 -0
- package/dist/collection/components/v-map-style/v-map-style.js +492 -0
- package/dist/collection/components/v-map-style/v-map-style.unit.js +62 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/layer/v-map-layer-helper.js +281 -0
- package/dist/collection/layer/v-map-layer-helper.unit.js +234 -0
- package/dist/collection/lib/cesium-loader.js +58 -0
- package/dist/collection/lib/ensure-importmap.js +12 -0
- package/dist/collection/lib/ensure-importmap.unit.js +57 -0
- package/dist/collection/lib/versions.gen.js +6 -0
- package/dist/collection/lib/vstyle.js +8 -0
- package/dist/collection/map-provider/cesium/CesiumGeoTIFFTerrainProvider.js +285 -0
- package/dist/collection/map-provider/cesium/CesiumLayerGroups.js +159 -0
- package/dist/collection/map-provider/cesium/GeoTIFFImageryProvider.js +192 -0
- package/dist/collection/map-provider/cesium/GeoTIFFImageryProvider.test.js +57 -0
- package/dist/collection/map-provider/cesium/cesium-provider.js +1408 -0
- package/dist/collection/map-provider/cesium/i-layer.js +1 -0
- package/dist/collection/map-provider/cesium/layer-manager.js +467 -0
- package/dist/collection/map-provider/deck/DeckGLGeoTIFFLayer.js +483 -0
- package/dist/collection/map-provider/deck/DeckGLGeoTIFFTerrainLayer.js +410 -0
- package/dist/collection/map-provider/deck/LayerGroupWithModel.js +169 -0
- package/dist/collection/map-provider/deck/LayerGroups.js +192 -0
- package/dist/collection/map-provider/deck/LayerModel.js +1 -0
- package/dist/collection/map-provider/deck/RenderableGroup.js +1 -0
- package/dist/collection/map-provider/deck/deck-provider.js +1563 -0
- package/dist/collection/map-provider/geotiff/geotiff-source.js +172 -0
- package/dist/collection/map-provider/geotiff/utils/AABB2D.js +24 -0
- package/dist/collection/map-provider/geotiff/utils/BVHNode2D.js +166 -0
- package/dist/collection/map-provider/geotiff/utils/GeoTIFFTileProcessor.js +484 -0
- package/dist/collection/map-provider/geotiff/utils/Triangle.js +1 -0
- package/dist/collection/map-provider/geotiff/utils/Triangulation.js +321 -0
- package/dist/collection/map-provider/geotiff/utils/colormap-utils.js +190 -0
- package/dist/collection/map-provider/geotiff/utils/normalization-utils.js +122 -0
- package/dist/collection/map-provider/geotiff/utils/sampling-utils.js +108 -0
- package/dist/collection/map-provider/leaflet/GeoTIFFGridLayer.js +147 -0
- package/dist/collection/map-provider/leaflet/WCSGridLayer.js +124 -0
- package/dist/collection/map-provider/leaflet/google-map-tiles-layer.js +352 -0
- package/dist/collection/map-provider/leaflet/leaflet-helpers.js +94 -0
- package/dist/collection/map-provider/leaflet/leaflet-provider.js +1095 -0
- package/dist/collection/map-provider/ol/CustomGeoTiff.js +145 -0
- package/dist/collection/map-provider/ol/openlayers-helper.js +26 -0
- package/dist/collection/map-provider/ol/openlayers-provider.js +1427 -0
- package/dist/collection/map-provider/provider-factory.js +44 -0
- package/dist/collection/map-provider/provider-factory.unit.js +66 -0
- package/dist/collection/testing/browser-test-utils.js +49 -0
- package/dist/collection/testing/e2e-testing.js +122 -0
- package/dist/collection/testing/e2e-utils.js +70 -0
- package/dist/collection/testing/geotiff-test-server.js +100 -0
- package/dist/collection/testing/mocks/geostyler-lyrx-parser.js +12 -0
- package/dist/collection/testing/mocks/geostyler-mapbox-parser.js +12 -0
- package/dist/collection/testing/mocks/geostyler-qgis-parser.js +12 -0
- package/dist/collection/testing/mocks/geostyler-sld-parser.js +13 -0
- package/dist/collection/testing/mocks/geostyler-style.js +5 -0
- package/dist/collection/testing/setupTests.browser.js +1 -0
- package/dist/collection/testing/setupTests.stencil.js +20 -0
- package/dist/collection/testing/setupTests.vitest.js +59 -0
- package/dist/collection/testing/stencil-testing-wrapper.js +43 -0
- package/dist/collection/testing/styleMock.js +1 -0
- package/dist/collection/types/color.js +1 -0
- package/dist/collection/types/cssmode.js +1 -0
- package/dist/collection/types/flavour.js +1 -0
- package/dist/collection/types/layerconfig.js +1 -0
- package/dist/collection/types/lonlat.js +1 -0
- package/dist/collection/types/mapinitoptions.js +1 -0
- package/dist/collection/types/mapprovider.js +1 -0
- package/dist/collection/types/provideroptions.js +1 -0
- package/dist/collection/types/styleconfig.js +19 -0
- package/dist/collection/types/styling.js +13 -0
- package/dist/collection/types/styling.unit.js +37 -0
- package/dist/collection/types/vmaplayer.js +1 -0
- package/dist/collection/utils/async-mutex.js +28 -0
- package/dist/collection/utils/diff.js +142 -0
- package/dist/collection/utils/diff.unit.js +59 -0
- package/dist/collection/utils/dom-env.js +43 -0
- package/dist/collection/utils/dom-env.unit.js +92 -0
- package/dist/collection/utils/events.js +8 -0
- package/dist/collection/utils/logger.js +183 -0
- package/dist/collection/utils/logger.unit.js +98 -0
- package/dist/collection/utils/messages.js +12 -0
- package/dist/collection/utils/spatial-utils.js +27 -0
- package/dist/collection/utils/spatial-utils.unit.js +24 -0
- package/dist/components/_commonjsHelpers.js +1 -0
- package/dist/components/cesium-provider.js +1 -0
- package/dist/components/deck-provider.js +1 -0
- package/dist/components/events.js +1 -0
- package/dist/components/geotiff-source.js +1 -0
- package/dist/components/geotiff.js +4 -0
- package/dist/components/index.browser.js +15 -0
- package/dist/components/index.d.ts +35 -0
- package/dist/components/index.js +1 -0
- package/dist/components/index2.js +1 -0
- package/dist/components/index3.js +1 -0
- package/dist/components/index4.js +1 -0
- package/dist/components/index5.js +1 -0
- package/dist/components/index6.js +1 -0
- package/dist/components/index7.js +1 -0
- package/dist/components/index8.js +7 -0
- package/dist/components/layer-extension.js +1 -0
- package/dist/components/leaflet-provider.js +1 -0
- package/dist/components/main-dist.js +1 -0
- package/dist/components/messages.js +1 -0
- package/dist/components/openlayers-provider.js +1 -0
- package/dist/components/polygon-layer.js +1 -0
- package/dist/components/scenegraph-layer.js +1 -0
- package/dist/components/styleconfig.js +1 -0
- package/dist/components/styling.js +1 -0
- package/dist/components/v-map-builder.d.ts +11 -0
- package/dist/components/v-map-builder.js +2 -0
- package/dist/components/v-map-layer-geojson.d.ts +11 -0
- package/dist/components/v-map-layer-geojson.js +1 -0
- package/dist/components/v-map-layer-geojson2.js +1 -0
- package/dist/components/v-map-layer-geotiff.d.ts +11 -0
- package/dist/components/v-map-layer-geotiff.js +1 -0
- package/dist/components/v-map-layer-geotiff2.js +1 -0
- package/dist/components/v-map-layer-google.d.ts +11 -0
- package/dist/components/v-map-layer-google.js +1 -0
- package/dist/components/v-map-layer-google2.js +1 -0
- package/dist/components/v-map-layer-helper.js +1 -0
- package/dist/components/v-map-layer-osm.d.ts +11 -0
- package/dist/components/v-map-layer-osm.js +1 -0
- package/dist/components/v-map-layer-osm2.js +1 -0
- package/dist/components/v-map-layer-scatterplot.d.ts +11 -0
- package/dist/components/v-map-layer-scatterplot.js +1 -0
- package/dist/components/v-map-layer-scatterplot2.js +1 -0
- package/dist/components/v-map-layer-terrain-geotiff.d.ts +11 -0
- package/dist/components/v-map-layer-terrain-geotiff.js +1 -0
- package/dist/components/v-map-layer-terrain.d.ts +11 -0
- package/dist/components/v-map-layer-terrain.js +1 -0
- package/dist/components/v-map-layer-terrain2.js +1 -0
- package/dist/components/v-map-layer-tile3d.d.ts +11 -0
- package/dist/components/v-map-layer-tile3d.js +1 -0
- package/dist/components/v-map-layer-tile3d2.js +1 -0
- package/dist/components/v-map-layer-wcs.d.ts +11 -0
- package/dist/components/v-map-layer-wcs.js +1 -0
- package/dist/components/v-map-layer-wcs2.js +1 -0
- package/dist/components/v-map-layer-wfs.d.ts +11 -0
- package/dist/components/v-map-layer-wfs.js +1 -0
- package/dist/components/v-map-layer-wfs2.js +1 -0
- package/dist/components/v-map-layer-wkt.d.ts +11 -0
- package/dist/components/v-map-layer-wkt.js +1 -0
- package/dist/components/v-map-layer-wkt2.js +1 -0
- package/dist/components/v-map-layer-wms.d.ts +11 -0
- package/dist/components/v-map-layer-wms.js +1 -0
- package/dist/components/v-map-layer-wms2.js +1 -0
- package/dist/components/v-map-layer-xyz.d.ts +11 -0
- package/dist/components/v-map-layer-xyz.js +1 -0
- package/dist/components/v-map-layer-xyz2.js +1 -0
- package/dist/components/v-map-layercontrol.d.ts +11 -0
- package/dist/components/v-map-layercontrol.js +1 -0
- package/dist/components/v-map-layergroup.d.ts +11 -0
- package/dist/components/v-map-layergroup.js +1 -0
- package/dist/components/v-map-layergroup2.js +1 -0
- package/dist/components/v-map-style.d.ts +11 -0
- package/dist/components/v-map-style.js +1 -0
- package/dist/components/v-map-style2.js +10 -0
- package/dist/components/v-map.d.ts +11 -0
- package/dist/components/v-map.js +1 -0
- package/dist/components/v-map2.js +1 -0
- package/dist/esm/_commonjsHelpers-E-ZsRS8r.js +32 -0
- package/dist/esm/app-globals-DQuL1Twl.js +3 -0
- package/dist/esm/cesium-provider-BJfAup3w.js +2596 -0
- package/dist/esm/deck-provider-C7U9VDEq.js +47709 -0
- package/dist/esm/geotiff-BEWxTIfH.js +45 -0
- package/dist/esm/geotiff-source-esnDnC-u.js +1516 -0
- package/dist/esm/index-B1zwA4IC.js +685 -0
- package/dist/esm/index-BBpiaTpT.js +165 -0
- package/dist/esm/index-BIEmlzCf.js +1697 -0
- package/dist/esm/index-BUHa4Jj0.js +307 -0
- package/dist/esm/index-DbSdn93t.js +20461 -0
- package/dist/esm/index-RpJarvr_.js +10656 -0
- package/dist/esm/index-jN06TXUp.js +14 -0
- package/dist/esm/index-jzneDarq.js +1613 -0
- package/dist/esm/index.browser-DhQAXuA7.js +6860 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/layer-extension-CZXK5goK.js +63 -0
- package/dist/esm/leaflet-provider-Q41TB6ku.js +1794 -0
- package/dist/esm/loader.js +11 -0
- package/dist/esm/main-dist-CwnA7_Xn.js +2652 -0
- package/dist/esm/messages-CMKJzsgL.js +180 -0
- package/dist/esm/openlayers-provider-CMsDsQTQ.js +1602 -0
- package/dist/esm/polygon-layer-ByhxGhWC.js +1295 -0
- package/dist/esm/scenegraph-layer-09K_B6DT.js +2526 -0
- package/dist/esm/styleconfig-B-bAcABs.js +21 -0
- package/dist/esm/v-map-builder.entry.js +3784 -0
- package/dist/esm/v-map-layer-geojson_12.entry.js +40881 -0
- package/dist/esm/v-map-layer-helper-Dys44Cgo.js +283 -0
- package/dist/esm/v-map-layer-terrain-geotiff.entry.js +256 -0
- package/dist/esm/v-map-layercontrol.entry.js +245 -0
- package/dist/esm/v-map.js +21 -0
- package/dist/esm/v-map.v-map-layer-osm.v-map-layergroup-B4pFHuSf.js +572 -0
- package/dist/esm/v-map_3.entry.js +4 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/types/cesium-augment.d.ts +5 -0
- package/dist/types/components/v-map/v-map.d.ts +70 -0
- package/dist/types/components/v-map/v-map.test.d.ts +1 -0
- package/dist/types/components/v-map-builder/v-map-builder.d.ts +48 -0
- package/dist/types/components/v-map-builder/v-map-builder.test.d.ts +1 -0
- package/dist/types/components/v-map-layer-geojson/v-map-layer-geojson.d.ts +129 -0
- package/dist/types/components/v-map-layer-geojson/v-map-layer-geojson.test.d.ts +1 -0
- package/dist/types/components/v-map-layer-geotiff/v-map-layer-geotiff.d.ts +74 -0
- package/dist/types/components/v-map-layer-geotiff/v-map-layer-geotiff.test.d.ts +1 -0
- package/dist/types/components/v-map-layer-google/v-map-layer-google.d.ts +78 -0
- package/dist/types/components/v-map-layer-osm/error-api.test.d.ts +1 -0
- package/dist/types/components/v-map-layer-osm/v-map-layer-osm.d.ts +50 -0
- package/dist/types/components/v-map-layer-osm/v-map-layer-osm.test.d.ts +1 -0
- package/dist/types/components/v-map-layer-scatterplot/v-map-layer-scatterplot.d.ts +54 -0
- package/dist/types/components/v-map-layer-terrain/v-map-layer-terrain.d.ts +74 -0
- package/dist/types/components/v-map-layer-terrain/v-map-layer-terrain.test.d.ts +1 -0
- package/dist/types/components/v-map-layer-terrain-geotiff/v-map-layer-terrain-geotiff.d.ts +117 -0
- package/dist/types/components/v-map-layer-terrain-geotiff/v-map-layer-terrain-geotiff.test.d.ts +1 -0
- package/dist/types/components/v-map-layer-tile3d/v-map-layer-tile3d.d.ts +69 -0
- package/dist/types/components/v-map-layer-tile3d/v-map-layer-tile3d.test.d.ts +1 -0
- package/dist/types/components/v-map-layer-wcs/v-map-layer-wcs.d.ts +47 -0
- package/dist/types/components/v-map-layer-wcs/v-map-layer-wcs.test.d.ts +1 -0
- package/dist/types/components/v-map-layer-wfs/v-map-layer-wfs.d.ts +59 -0
- package/dist/types/components/v-map-layer-wfs/v-map-layer-wfs.test.d.ts +1 -0
- package/dist/types/components/v-map-layer-wkt/v-map-layer-wkt.d.ts +132 -0
- package/dist/types/components/v-map-layer-wkt/v-map-layer-wkt.test.d.ts +1 -0
- package/dist/types/components/v-map-layer-wms/v-map-layer-wms.d.ts +76 -0
- package/dist/types/components/v-map-layer-wms/v-map-layer-wms.test.d.ts +1 -0
- package/dist/types/components/v-map-layer-xyz/v-map-layer-xyz.d.ts +59 -0
- package/dist/types/components/v-map-layer-xyz/v-map-layer-xyz.test.d.ts +1 -0
- package/dist/types/components/v-map-layercontrol/v-map-layercontrol.d.ts +44 -0
- package/dist/types/components/v-map-layercontrol/v-map-layercontrol.test.d.ts +1 -0
- package/dist/types/components/v-map-layergroup/v-map-layergroup.d.ts +31 -0
- package/dist/types/components/v-map-layergroup/v-map-layergroup.test.d.ts +1 -0
- package/dist/types/components/v-map-style/v-map-style.d.ts +75 -0
- package/dist/types/components/v-map-style/v-map-style.unit.d.ts +1 -0
- package/dist/types/components.d.ts +2391 -0
- package/dist/types/globals.d.ts +16 -0
- package/dist/types/index.d.ts +10 -0
- package/dist/types/layer/v-map-layer-helper.d.ts +45 -0
- package/dist/types/layer/v-map-layer-helper.unit.d.ts +1 -0
- package/dist/types/leaflet-augment.d.ts +15 -0
- package/dist/types/lib/cesium-loader.d.ts +3 -0
- package/dist/types/lib/ensure-importmap.d.ts +3 -0
- package/dist/types/lib/ensure-importmap.unit.d.ts +1 -0
- package/dist/types/lib/versions.gen.d.ts +5 -0
- package/dist/types/lib/vstyle.d.ts +44 -0
- package/dist/types/map-provider/cesium/CesiumGeoTIFFTerrainProvider.d.ts +92 -0
- package/dist/types/map-provider/cesium/CesiumLayerGroups.d.ts +64 -0
- package/dist/types/map-provider/cesium/GeoTIFFImageryProvider.d.ts +75 -0
- package/dist/types/map-provider/cesium/GeoTIFFImageryProvider.test.d.ts +1 -0
- package/dist/types/map-provider/cesium/cesium-provider.d.ts +87 -0
- package/dist/types/map-provider/cesium/i-layer.d.ts +11 -0
- package/dist/types/map-provider/cesium/layer-manager.d.ts +31 -0
- package/dist/types/map-provider/deck/DeckGLGeoTIFFLayer.d.ts +91 -0
- package/dist/types/map-provider/deck/DeckGLGeoTIFFTerrainLayer.d.ts +82 -0
- package/dist/types/map-provider/deck/LayerGroupWithModel.d.ts +55 -0
- package/dist/types/map-provider/deck/LayerGroups.d.ts +63 -0
- package/dist/types/map-provider/deck/LayerModel.d.ts +8 -0
- package/dist/types/map-provider/deck/RenderableGroup.d.ts +20 -0
- package/dist/types/map-provider/deck/deck-provider.d.ts +92 -0
- package/dist/types/map-provider/geotiff/geotiff-source.d.ts +30 -0
- package/dist/types/map-provider/geotiff/utils/AABB2D.d.ts +28 -0
- package/dist/types/map-provider/geotiff/utils/BVHNode2D.d.ts +36 -0
- package/dist/types/map-provider/geotiff/utils/GeoTIFFTileProcessor.d.ts +116 -0
- package/dist/types/map-provider/geotiff/utils/Triangle.d.ts +5 -0
- package/dist/types/map-provider/geotiff/utils/Triangulation.d.ts +94 -0
- package/dist/types/map-provider/geotiff/utils/colormap-utils.d.ts +47 -0
- package/dist/types/map-provider/geotiff/utils/normalization-utils.d.ts +39 -0
- package/dist/types/map-provider/geotiff/utils/sampling-utils.d.ts +13 -0
- package/dist/types/map-provider/leaflet/GeoTIFFGridLayer.d.ts +34 -0
- package/dist/types/map-provider/leaflet/WCSGridLayer.d.ts +38 -0
- package/dist/types/map-provider/leaflet/google-map-tiles-layer.d.ts +73 -0
- package/dist/types/map-provider/leaflet/leaflet-helpers.d.ts +6 -0
- package/dist/types/map-provider/leaflet/leaflet-provider.d.ts +73 -0
- package/dist/types/map-provider/ol/CustomGeoTiff.d.ts +14 -0
- package/dist/types/map-provider/ol/openlayers-helper.d.ts +2 -0
- package/dist/types/map-provider/ol/openlayers-provider.d.ts +80 -0
- package/dist/types/map-provider/provider-factory.d.ts +12 -0
- package/dist/types/map-provider/provider-factory.unit.d.ts +1 -0
- package/dist/types/namespaces.d.ts +3 -0
- package/dist/types/ol-augment.d.ts +3 -0
- package/dist/types/ol-override.d.ts +7 -0
- package/dist/types/ol.d.ts +10 -0
- package/dist/types/stencil-public-runtime.d.ts +1860 -0
- package/dist/types/testing/browser-test-utils.d.ts +6 -0
- package/dist/types/testing/e2e-testing.d.ts +5 -0
- package/dist/types/testing/e2e-utils.d.ts +4 -0
- package/dist/types/testing/geotiff-test-server.d.ts +5 -0
- package/dist/types/testing/mocks/geostyler-lyrx-parser.d.ts +11 -0
- package/dist/types/testing/mocks/geostyler-mapbox-parser.d.ts +11 -0
- package/dist/types/testing/mocks/geostyler-qgis-parser.d.ts +11 -0
- package/dist/types/testing/mocks/geostyler-sld-parser.d.ts +11 -0
- package/dist/types/testing/mocks/geostyler-style.d.ts +5 -0
- package/dist/types/testing/setupTests.browser.d.ts +1 -0
- package/dist/types/testing/setupTests.stencil.d.ts +1 -0
- package/dist/types/testing/setupTests.vitest.d.ts +1 -0
- package/dist/types/testing/stencil-testing-wrapper.d.ts +3 -0
- package/dist/types/types/color.d.ts +1 -0
- package/dist/types/types/cssmode.d.ts +1 -0
- package/dist/types/types/flavour.d.ts +1 -0
- package/dist/types/types/layerconfig.d.ts +207 -0
- package/dist/types/types/lonlat.d.ts +1 -0
- package/dist/types/types/mapinitoptions.d.ts +4 -0
- package/dist/types/types/mapprovider.d.ts +46 -0
- package/dist/types/types/provideroptions.d.ts +8 -0
- package/dist/types/types/styleconfig.d.ts +27 -0
- package/dist/types/types/styling.d.ts +24 -0
- package/dist/types/types/styling.unit.d.ts +1 -0
- package/dist/types/types/vmaplayer.d.ts +10 -0
- package/dist/types/utils/async-mutex.d.ts +7 -0
- package/dist/types/utils/diff.d.ts +64 -0
- package/dist/types/utils/diff.unit.d.ts +1 -0
- package/dist/types/utils/dom-env.d.ts +5 -0
- package/dist/types/utils/dom-env.unit.d.ts +1 -0
- package/dist/types/utils/events.d.ts +29 -0
- package/dist/types/utils/logger.d.ts +47 -0
- package/dist/types/utils/logger.unit.d.ts +1 -0
- package/dist/types/utils/messages.d.ts +12 -0
- package/dist/types/utils/spatial-utils.d.ts +6 -0
- package/dist/types/utils/spatial-utils.unit.d.ts +1 -0
- package/dist/types/versions.d.ts +7 -0
- package/dist/v-map/index.esm.js +0 -0
- package/dist/v-map/p--vVleK-M.js +1 -0
- package/dist/v-map/p-09d10db0.entry.js +1 -0
- package/dist/v-map/p-5eba6058.entry.js +10 -0
- package/dist/v-map/p-6b102336.entry.js +1 -0
- package/dist/v-map/p-B-bAcABs.js +1 -0
- package/dist/v-map/p-BBpiaTpT.js +1 -0
- package/dist/v-map/p-BdijL4Av.js +1 -0
- package/dist/v-map/p-Be3r33VF.js +4 -0
- package/dist/v-map/p-BeFu0ap4.js +1 -0
- package/dist/v-map/p-BxFJezdK.js +1 -0
- package/dist/v-map/p-CMKJzsgL.js +1 -0
- package/dist/v-map/p-CXfA_q8m.js +1 -0
- package/dist/v-map/p-CZqY0yW4.js +1 -0
- package/dist/v-map/p-CafTHT9i.js +1 -0
- package/dist/v-map/p-DCTHyf58.js +1 -0
- package/dist/v-map/p-DQuL1Twl.js +1 -0
- package/dist/v-map/p-DR9McdNX.js +1 -0
- package/dist/v-map/p-Dckgonw8.js +1 -0
- package/dist/v-map/p-DhQAXuA7.js +15 -0
- package/dist/v-map/p-DmICdG34.js +7 -0
- package/dist/v-map/p-DrOQ9V4h.js +1 -0
- package/dist/v-map/p-DvHXtWUg.js +1 -0
- package/dist/v-map/p-E-ZsRS8r.js +1 -0
- package/dist/v-map/p-MyTSFnEk.js +1 -0
- package/dist/v-map/p-RpJarvr_.js +1 -0
- package/dist/v-map/p-WaMDUuAz.js +1 -0
- package/dist/v-map/p-aa410e64.entry.js +2 -0
- package/dist/v-map/p-c21c93fe.entry.js +1 -0
- package/dist/v-map/p-jzneDarq.js +2 -0
- package/dist/v-map/p-uiIP-taz.js +1 -0
- package/dist/v-map/v-map.esm.js +1 -0
- package/loader/cdn.js +1 -0
- package/loader/index.cjs.js +1 -0
- package/loader/index.d.ts +24 -0
- package/loader/index.es2017.js +1 -0
- package/loader/index.js +2 -0
- package/package.json +193 -0
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { normalizeValue, normalizeToColorMapRange, } from "./normalization-utils";
|
|
2
|
+
import { applyColorMap } from "./colormap-utils";
|
|
3
|
+
/**
|
|
4
|
+
* Nearest-Neighbor Sampling with window-based reading and multi-band support
|
|
5
|
+
* Returns [R, G, B, A] values (0-255)
|
|
6
|
+
*/
|
|
7
|
+
export function sampleNearest(x, y, rasterBands, arrayType, width, height, offsetX, offsetY, colorStops) {
|
|
8
|
+
const px = Math.round(x) - offsetX;
|
|
9
|
+
const py = Math.round(y) - offsetY;
|
|
10
|
+
if (px < 0 || px >= width || py < 0 || py >= height) {
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
const idx = py * width + px;
|
|
14
|
+
const bandCount = rasterBands.length;
|
|
15
|
+
if (bandCount === 1) {
|
|
16
|
+
// Grayscale - apply colormap if specified
|
|
17
|
+
const rawValue = rasterBands[0][idx];
|
|
18
|
+
if (colorStops) {
|
|
19
|
+
// Apply colormap (only for Float types or when colorStops provided)
|
|
20
|
+
const normalizedValue = normalizeToColorMapRange(rawValue);
|
|
21
|
+
const [r, g, b] = applyColorMap(normalizedValue, colorStops);
|
|
22
|
+
return [r, g, b, 255];
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
// Regular grayscale normalization
|
|
26
|
+
const gray = normalizeValue(rawValue, arrayType);
|
|
27
|
+
return [gray, gray, gray, 255];
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
else if (bandCount === 3) {
|
|
31
|
+
// RGB
|
|
32
|
+
const r = normalizeValue(rasterBands[0][idx], arrayType);
|
|
33
|
+
const g = normalizeValue(rasterBands[1][idx], arrayType);
|
|
34
|
+
const b = normalizeValue(rasterBands[2][idx], arrayType);
|
|
35
|
+
return [r, g, b, 255];
|
|
36
|
+
}
|
|
37
|
+
else if (bandCount >= 4) {
|
|
38
|
+
// RGBA
|
|
39
|
+
const r = normalizeValue(rasterBands[0][idx], arrayType);
|
|
40
|
+
const g = normalizeValue(rasterBands[1][idx], arrayType);
|
|
41
|
+
const b = normalizeValue(rasterBands[2][idx], arrayType);
|
|
42
|
+
const a = normalizeValue(rasterBands[3][idx], arrayType);
|
|
43
|
+
return [r, g, b, a];
|
|
44
|
+
}
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Bilinear Interpolation with window-based reading and multi-band support
|
|
49
|
+
* Returns [R, G, B, A] values (0-255)
|
|
50
|
+
*/
|
|
51
|
+
export function sampleBilinear(x, y, rasterBands, arrayType, width, height, offsetX, offsetY, colorStops) {
|
|
52
|
+
const localX = x - offsetX;
|
|
53
|
+
const localY = y - offsetY;
|
|
54
|
+
// Bounds-Check
|
|
55
|
+
if (localX < 0 ||
|
|
56
|
+
localX >= width - 1 ||
|
|
57
|
+
localY < 0 ||
|
|
58
|
+
localY >= height - 1) {
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
// Bilineare Interpolation
|
|
62
|
+
const x0 = Math.floor(localX);
|
|
63
|
+
const x1 = Math.ceil(localX);
|
|
64
|
+
const y0 = Math.floor(localY);
|
|
65
|
+
const y1 = Math.ceil(localY);
|
|
66
|
+
const fx = localX - x0;
|
|
67
|
+
const fy = localY - y0;
|
|
68
|
+
const bandCount = rasterBands.length;
|
|
69
|
+
const result = [0, 0, 0, 255];
|
|
70
|
+
if (bandCount === 1) {
|
|
71
|
+
// Grayscale - interpolate first, then apply colormap
|
|
72
|
+
const band = rasterBands[0];
|
|
73
|
+
const v00 = band[y0 * width + x0];
|
|
74
|
+
const v10 = band[y0 * width + x1];
|
|
75
|
+
const v01 = band[y1 * width + x0];
|
|
76
|
+
const v11 = band[y1 * width + x1];
|
|
77
|
+
const v0 = v00 * (1 - fx) + v10 * fx;
|
|
78
|
+
const v1 = v01 * (1 - fx) + v11 * fx;
|
|
79
|
+
const interpolated = v0 * (1 - fy) + v1 * fy;
|
|
80
|
+
if (colorStops) {
|
|
81
|
+
// Apply colormap (only for Float types or when colorStops provided)
|
|
82
|
+
const normalizedValue = normalizeToColorMapRange(interpolated);
|
|
83
|
+
const [r, g, b] = applyColorMap(normalizedValue, colorStops);
|
|
84
|
+
return [r, g, b, 255];
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
// Regular grayscale normalization
|
|
88
|
+
const gray = normalizeValue(interpolated, arrayType);
|
|
89
|
+
return [gray, gray, gray, 255];
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
// RGB/RGBA - interpolate each band
|
|
94
|
+
const bandsToProcess = Math.min(bandCount, 4);
|
|
95
|
+
for (let b = 0; b < bandsToProcess; b++) {
|
|
96
|
+
const band = rasterBands[b];
|
|
97
|
+
const v00 = band[y0 * width + x0];
|
|
98
|
+
const v10 = band[y0 * width + x1];
|
|
99
|
+
const v01 = band[y1 * width + x0];
|
|
100
|
+
const v11 = band[y1 * width + x1];
|
|
101
|
+
const v0 = v00 * (1 - fx) + v10 * fx;
|
|
102
|
+
const v1 = v01 * (1 - fx) + v11 * fx;
|
|
103
|
+
const interpolated = v0 * (1 - fy) + v1 * fy;
|
|
104
|
+
result[b] = normalizeValue(interpolated, arrayType);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return result;
|
|
108
|
+
}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import * as L from "leaflet";
|
|
2
|
+
import { GeoTIFFTileProcessor } from "../geotiff/utils/GeoTIFFTileProcessor";
|
|
3
|
+
import { getColorStops } from "../geotiff/utils/colormap-utils";
|
|
4
|
+
import { loadGeoTIFFSource } from "../geotiff/geotiff-source";
|
|
5
|
+
export class GeoTIFFGridLayer extends L.GridLayer {
|
|
6
|
+
geotiffOptions;
|
|
7
|
+
tileProcessor = null;
|
|
8
|
+
colorStops;
|
|
9
|
+
loadingPromise;
|
|
10
|
+
defaultResolution = 1;
|
|
11
|
+
defaultResample = 'bilinear';
|
|
12
|
+
constructor(options) {
|
|
13
|
+
super(options);
|
|
14
|
+
this.geotiffOptions = { ...options };
|
|
15
|
+
}
|
|
16
|
+
onAdd(map) {
|
|
17
|
+
super.onAdd(map);
|
|
18
|
+
void this.ensureReady().then(() => this.redraw());
|
|
19
|
+
return this;
|
|
20
|
+
}
|
|
21
|
+
createTile(coords, done) {
|
|
22
|
+
const size = this.getTileSize();
|
|
23
|
+
const canvas = L.DomUtil.create('canvas', 'leaflet-tile');
|
|
24
|
+
canvas.width = size.x;
|
|
25
|
+
canvas.height = size.y;
|
|
26
|
+
this.ensureReady()
|
|
27
|
+
.then(async () => {
|
|
28
|
+
if (!this.tileProcessor) {
|
|
29
|
+
done(null, canvas);
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
try {
|
|
33
|
+
const rgba = await this.tileProcessor.getTileData({
|
|
34
|
+
x: coords.x,
|
|
35
|
+
y: coords.y,
|
|
36
|
+
z: coords.z,
|
|
37
|
+
tileSize: size.x,
|
|
38
|
+
resolution: this.geotiffOptions.resolution ?? this.defaultResolution,
|
|
39
|
+
resampleMethod: this.geotiffOptions.resampleMethod ?? this.defaultResample,
|
|
40
|
+
colorStops: this.colorStops,
|
|
41
|
+
});
|
|
42
|
+
if (!rgba) {
|
|
43
|
+
done(null, canvas);
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
const ctx = canvas.getContext('2d');
|
|
47
|
+
if (ctx) {
|
|
48
|
+
const imageData = ctx.createImageData(size.x, size.y);
|
|
49
|
+
imageData.data.set(rgba);
|
|
50
|
+
ctx.putImageData(imageData, 0, 0);
|
|
51
|
+
}
|
|
52
|
+
done(null, canvas);
|
|
53
|
+
}
|
|
54
|
+
catch (err) {
|
|
55
|
+
done(err, canvas);
|
|
56
|
+
}
|
|
57
|
+
})
|
|
58
|
+
.catch(err => {
|
|
59
|
+
done(err, canvas);
|
|
60
|
+
});
|
|
61
|
+
return canvas;
|
|
62
|
+
}
|
|
63
|
+
async ensureReady() {
|
|
64
|
+
if (!this.loadingPromise) {
|
|
65
|
+
this.loadingPromise = this.initializeProcessor();
|
|
66
|
+
}
|
|
67
|
+
return this.loadingPromise;
|
|
68
|
+
}
|
|
69
|
+
async updateSource(options) {
|
|
70
|
+
Object.assign(this.geotiffOptions, options);
|
|
71
|
+
this.tileProcessor = null;
|
|
72
|
+
this.colorStops = undefined;
|
|
73
|
+
this.loadingPromise = undefined;
|
|
74
|
+
await this.ensureReady();
|
|
75
|
+
this.redraw();
|
|
76
|
+
}
|
|
77
|
+
async initializeProcessor() {
|
|
78
|
+
if (this.tileProcessor)
|
|
79
|
+
return;
|
|
80
|
+
const [geotiffModule, { default: proj4 }, geokeysModule] = await Promise.all([
|
|
81
|
+
import('geotiff'),
|
|
82
|
+
import('proj4'),
|
|
83
|
+
import('geotiff-geokeys-to-proj4'),
|
|
84
|
+
]);
|
|
85
|
+
const source = await loadGeoTIFFSource(this.geotiffOptions.url, {
|
|
86
|
+
projection: undefined,
|
|
87
|
+
forceProjection: false,
|
|
88
|
+
nodata: this.geotiffOptions.nodata,
|
|
89
|
+
}, {
|
|
90
|
+
geotiff: geotiffModule,
|
|
91
|
+
proj4,
|
|
92
|
+
geokeysToProj4: geokeysModule,
|
|
93
|
+
});
|
|
94
|
+
const transformViewToSourceMapFn = (coord) => {
|
|
95
|
+
const result = source.proj4(this.geotiffOptions.viewProjection, //source.toProjection,
|
|
96
|
+
source.fromProjection, coord);
|
|
97
|
+
return [Number(result[0]), Number(result[1])];
|
|
98
|
+
};
|
|
99
|
+
const transformSourceMapToViewFn = (coord) => {
|
|
100
|
+
const result = source.proj4(source.fromProjection, this.geotiffOptions.viewProjection, //source.toProjection,
|
|
101
|
+
coord);
|
|
102
|
+
return [Number(result[0]), Number(result[1])];
|
|
103
|
+
};
|
|
104
|
+
this.tileProcessor = new GeoTIFFTileProcessor({
|
|
105
|
+
transformViewToSourceMapFn,
|
|
106
|
+
transformSourceMapToViewFn,
|
|
107
|
+
sourceBounds: source.sourceBounds,
|
|
108
|
+
sourceRef: source.sourceRef,
|
|
109
|
+
resolution: source.resolution,
|
|
110
|
+
imageWidth: source.width,
|
|
111
|
+
imageHeight: source.height,
|
|
112
|
+
fromProjection: source.fromProjection,
|
|
113
|
+
toProjection: this.geotiffOptions.viewProjection, //source.toProjection,
|
|
114
|
+
baseImage: source.baseImage,
|
|
115
|
+
overviewImages: source.overviewImages ?? [],
|
|
116
|
+
});
|
|
117
|
+
this.tileProcessor.createGlobalTriangulation();
|
|
118
|
+
// Set bounds to restrict tile loading to GeoTIFF coverage area
|
|
119
|
+
this.setViewBounds(source.sourceBounds, transformSourceMapToViewFn);
|
|
120
|
+
if (this.geotiffOptions.colorMap) {
|
|
121
|
+
const { stops } = getColorStops(this.geotiffOptions.colorMap, this.geotiffOptions.valueRange);
|
|
122
|
+
this.colorStops = stops;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Set Leaflet bounds from GeoTIFF source bounds
|
|
127
|
+
* Restricts tile loading to the GeoTIFF coverage area
|
|
128
|
+
*/
|
|
129
|
+
setViewBounds(sourceBounds, transformSourceToView) {
|
|
130
|
+
const [srcWest, srcSouth, srcEast, srcNorth] = sourceBounds;
|
|
131
|
+
// Transform corners from Source to View (Web Mercator for Leaflet)
|
|
132
|
+
const sw = transformSourceToView([srcWest, srcSouth]);
|
|
133
|
+
const se = transformSourceToView([srcEast, srcSouth]);
|
|
134
|
+
const nw = transformSourceToView([srcWest, srcNorth]);
|
|
135
|
+
const ne = transformSourceToView([srcEast, srcNorth]);
|
|
136
|
+
// Calculate bounds in View coordinates
|
|
137
|
+
const minX = Math.min(sw[0], se[0], nw[0], ne[0]);
|
|
138
|
+
const maxX = Math.max(sw[0], se[0], nw[0], ne[0]);
|
|
139
|
+
const minY = Math.min(sw[1], se[1], nw[1], ne[1]);
|
|
140
|
+
const maxY = Math.max(sw[1], se[1], nw[1], ne[1]);
|
|
141
|
+
// Convert to Leaflet LatLngBounds (Web Mercator meters to lat/lng)
|
|
142
|
+
const southWest = L.CRS.EPSG3857.unproject(L.point(minX, maxY));
|
|
143
|
+
const northEast = L.CRS.EPSG3857.unproject(L.point(maxX, minY));
|
|
144
|
+
// Set bounds option - Leaflet will use this to restrict tile loading
|
|
145
|
+
this.options.bounds = L.latLngBounds(southWest, northEast);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import * as L from "leaflet";
|
|
2
|
+
import { log, error } from "../../utils/logger";
|
|
3
|
+
const LOG_PREFIX = 'v-map - leaflet - wcs - tile - ';
|
|
4
|
+
/**
|
|
5
|
+
* Custom Leaflet GridLayer for WCS (Web Coverage Service) support
|
|
6
|
+
*
|
|
7
|
+
* Supports:
|
|
8
|
+
* - WCS 2.0.1 with subset parameters
|
|
9
|
+
* - WCS 1.x.x with BBOX parameters (backward compatibility)
|
|
10
|
+
* - GeoTIFF FLOAT32 format
|
|
11
|
+
* - Dynamic BBOX-based requests
|
|
12
|
+
*/
|
|
13
|
+
export class WCSGridLayer extends L.GridLayer {
|
|
14
|
+
wcsOptions;
|
|
15
|
+
constructor(options) {
|
|
16
|
+
super(options);
|
|
17
|
+
this.wcsOptions = {
|
|
18
|
+
...options,
|
|
19
|
+
version: options.version ?? '2.0.1',
|
|
20
|
+
format: options.format ?? 'image/tiff',
|
|
21
|
+
projection: options.projection ?? 'EPSG:4326',
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Build WCS GetCoverage URL for a given tile
|
|
26
|
+
*/
|
|
27
|
+
buildWCSUrl(coords) {
|
|
28
|
+
const { url, coverageName, version, format, projection, params } = this.wcsOptions;
|
|
29
|
+
// Calculate tile bounds in lat/lng
|
|
30
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Leaflet private method not exposed in type definitions
|
|
31
|
+
const tileBounds = this._tileCoordsToBounds(coords);
|
|
32
|
+
const southwest = tileBounds.getSouthWest();
|
|
33
|
+
const northeast = tileBounds.getNorthEast();
|
|
34
|
+
const minx = southwest.lng;
|
|
35
|
+
const miny = southwest.lat;
|
|
36
|
+
const maxx = northeast.lng;
|
|
37
|
+
const maxy = northeast.lat;
|
|
38
|
+
const baseParams = {
|
|
39
|
+
SERVICE: 'WCS',
|
|
40
|
+
REQUEST: 'GetCoverage',
|
|
41
|
+
VERSION: version,
|
|
42
|
+
FORMAT: format,
|
|
43
|
+
};
|
|
44
|
+
// WCS 2.0.1 uses subset parameters
|
|
45
|
+
if (version.startsWith('2.0')) {
|
|
46
|
+
baseParams.coverageId = coverageName;
|
|
47
|
+
// Build URL with subset parameters
|
|
48
|
+
// Note: We can't use the same param name twice in URLSearchParams,
|
|
49
|
+
// so we'll manually construct the query string
|
|
50
|
+
const extraParams = params ? { ...params } : {};
|
|
51
|
+
const allParams = { ...baseParams, ...extraParams };
|
|
52
|
+
// Add GeoTIFF compression if format is tiff
|
|
53
|
+
if (format.includes('tiff') || format.includes('geotiff')) {
|
|
54
|
+
allParams['geotiff:compression'] = 'LZW';
|
|
55
|
+
}
|
|
56
|
+
const query = new URLSearchParams();
|
|
57
|
+
Object.entries(allParams).forEach(([key, value]) => {
|
|
58
|
+
if (value !== undefined && value !== null) {
|
|
59
|
+
query.set(key, String(value));
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
// Manually add subset parameters (can't use URLSearchParams for duplicate keys)
|
|
63
|
+
const queryString = query.toString();
|
|
64
|
+
const subsetX = `subset=X(${minx},${maxx})`;
|
|
65
|
+
const subsetY = `subset=Y(${miny},${maxy})`;
|
|
66
|
+
return `${url}${url.includes('?') ? '&' : '?'}${queryString}&${subsetX}&${subsetY}`;
|
|
67
|
+
}
|
|
68
|
+
// WCS 1.x.x uses BBOX parameter
|
|
69
|
+
else {
|
|
70
|
+
baseParams.COVERAGE = coverageName;
|
|
71
|
+
baseParams.BBOX = `${minx},${miny},${maxx},${maxy}`;
|
|
72
|
+
baseParams.CRS = projection;
|
|
73
|
+
// Calculate width and height for the tile
|
|
74
|
+
const tileSize = this.getTileSize();
|
|
75
|
+
baseParams.WIDTH = typeof tileSize === 'number' ? tileSize : tileSize.x;
|
|
76
|
+
baseParams.HEIGHT = typeof tileSize === 'number' ? tileSize : tileSize.y;
|
|
77
|
+
const extraParams = params ? { ...params } : {};
|
|
78
|
+
const allParams = { ...baseParams, ...extraParams };
|
|
79
|
+
const query = new URLSearchParams();
|
|
80
|
+
Object.entries(allParams).forEach(([key, value]) => {
|
|
81
|
+
if (value !== undefined && value !== null) {
|
|
82
|
+
query.set(key, String(value));
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
return `${url}${url.includes('?') ? '&' : '?'}${query.toString()}`;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Create tile element (required by GridLayer)
|
|
90
|
+
*/
|
|
91
|
+
createTile(coords, done) {
|
|
92
|
+
const tile = document.createElement('img');
|
|
93
|
+
const wcsUrl = this.buildWCSUrl(coords);
|
|
94
|
+
log(`${LOG_PREFIX}load: coords=(${coords.x},${coords.y},${coords.z})`);
|
|
95
|
+
log(`${LOG_PREFIX}url: ${wcsUrl}`);
|
|
96
|
+
tile.onload = () => {
|
|
97
|
+
done(null, tile);
|
|
98
|
+
};
|
|
99
|
+
tile.onerror = (err) => {
|
|
100
|
+
error(`${LOG_PREFIX}failed to load tile:`, err);
|
|
101
|
+
done(err instanceof Error ? err : new Error(String(err)), tile);
|
|
102
|
+
};
|
|
103
|
+
// Set crossOrigin for CORS support
|
|
104
|
+
tile.crossOrigin = 'anonymous';
|
|
105
|
+
tile.src = wcsUrl;
|
|
106
|
+
return tile;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Update WCS options and redraw
|
|
110
|
+
*/
|
|
111
|
+
updateOptions(newOptions) {
|
|
112
|
+
this.wcsOptions = {
|
|
113
|
+
...this.wcsOptions,
|
|
114
|
+
...newOptions,
|
|
115
|
+
};
|
|
116
|
+
this.redraw();
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Factory function to create a WCS GridLayer
|
|
121
|
+
*/
|
|
122
|
+
export function createWCSGridLayer(options) {
|
|
123
|
+
return new WCSGridLayer(options);
|
|
124
|
+
}
|