@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,285 @@
|
|
|
1
|
+
import { log, warn, error } from "../../utils/logger";
|
|
2
|
+
import { loadGeoTIFFSource } from "../geotiff/geotiff-source";
|
|
3
|
+
const LOG_PREFIX = 'v-map - cesium - terrain-geotiff - ';
|
|
4
|
+
/**
|
|
5
|
+
* Custom Cesium Terrain Provider for GeoTIFF elevation data
|
|
6
|
+
*
|
|
7
|
+
* This provider loads a GeoTIFF file containing elevation data and provides
|
|
8
|
+
* it to Cesium's terrain system as a heightmap.
|
|
9
|
+
*/
|
|
10
|
+
export class CesiumGeoTIFFTerrainProvider {
|
|
11
|
+
Cesium;
|
|
12
|
+
image;
|
|
13
|
+
fromProjection = 'EPSG:4326';
|
|
14
|
+
sourceBounds = [0, 0, 0, 0];
|
|
15
|
+
wgs84Bounds = [0, 0, 0, 0];
|
|
16
|
+
width = 0;
|
|
17
|
+
height = 0;
|
|
18
|
+
noDataValue = 0;
|
|
19
|
+
ready = false;
|
|
20
|
+
_readyPromise;
|
|
21
|
+
heightmapWidth = 65;
|
|
22
|
+
heightmapHeight = 65;
|
|
23
|
+
proj4;
|
|
24
|
+
tilingScheme;
|
|
25
|
+
constructor(options) {
|
|
26
|
+
this.Cesium = options.Cesium;
|
|
27
|
+
// Initialize with GeographicTilingScheme (WGS84)
|
|
28
|
+
this.tilingScheme = new this.Cesium.GeographicTilingScheme();
|
|
29
|
+
// Start loading the GeoTIFF
|
|
30
|
+
this._readyPromise = this.initialize(options);
|
|
31
|
+
}
|
|
32
|
+
async initialize(options) {
|
|
33
|
+
try {
|
|
34
|
+
log(`${LOG_PREFIX}loadGeoTIFF: url=${options.url}`);
|
|
35
|
+
const [geotiffModule, { default: proj4 }, geokeysModule] = await Promise.all([
|
|
36
|
+
import('geotiff'),
|
|
37
|
+
import('proj4'),
|
|
38
|
+
import('geotiff-geokeys-to-proj4'),
|
|
39
|
+
]);
|
|
40
|
+
const source = await loadGeoTIFFSource(options.url, {
|
|
41
|
+
projection: options.projection,
|
|
42
|
+
forceProjection: options.forceProjection ?? false,
|
|
43
|
+
nodata: options.nodata,
|
|
44
|
+
}, {
|
|
45
|
+
geotiff: geotiffModule,
|
|
46
|
+
proj4,
|
|
47
|
+
geokeysToProj4: geokeysModule,
|
|
48
|
+
});
|
|
49
|
+
this.image = source.baseImage;
|
|
50
|
+
this.fromProjection = source.fromProjection;
|
|
51
|
+
this.sourceBounds = source.sourceBounds;
|
|
52
|
+
this.wgs84Bounds = source.wgs84Bounds;
|
|
53
|
+
this.width = source.width;
|
|
54
|
+
this.height = source.height;
|
|
55
|
+
this.noDataValue = source.noDataValue ?? 0;
|
|
56
|
+
this.proj4 = source.proj4; // Store proj4 instance with registered projections
|
|
57
|
+
log(`${LOG_PREFIX}loaded: projection=${this.fromProjection}, bounds=[${this.sourceBounds.map(v => v.toFixed(0)).join(',')}], wgs84=[${this.wgs84Bounds.map(v => v.toFixed(4)).join(',')}], size=${this.width}x${this.height}`);
|
|
58
|
+
this.ready = true;
|
|
59
|
+
return true;
|
|
60
|
+
}
|
|
61
|
+
catch (err) {
|
|
62
|
+
error(`${LOG_PREFIX}failed to load GeoTIFF:`, err);
|
|
63
|
+
this.ready = false;
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Get the coverage rectangle in WGS84 coordinates
|
|
69
|
+
*/
|
|
70
|
+
get rectangle() {
|
|
71
|
+
if (!this.ready || !this.wgs84Bounds) {
|
|
72
|
+
return this.Cesium.Rectangle.MAX_VALUE;
|
|
73
|
+
}
|
|
74
|
+
const [west, south, east, north] = this.wgs84Bounds;
|
|
75
|
+
return this.Cesium.Rectangle.fromDegrees(west, south, east, north);
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Request tile geometry for a specific tile
|
|
79
|
+
*/
|
|
80
|
+
async requestTileGeometry(x, y, level) {
|
|
81
|
+
if (!this.ready || !this.image) {
|
|
82
|
+
return undefined;
|
|
83
|
+
}
|
|
84
|
+
try {
|
|
85
|
+
// Get tile bounds in WGS84
|
|
86
|
+
const rectangle = this.tilingScheme.tileXYToRectangle(x, y, level);
|
|
87
|
+
let west = this.Cesium.Math.toDegrees(rectangle.west);
|
|
88
|
+
let south = this.Cesium.Math.toDegrees(rectangle.south);
|
|
89
|
+
let east = this.Cesium.Math.toDegrees(rectangle.east);
|
|
90
|
+
let north = this.Cesium.Math.toDegrees(rectangle.north);
|
|
91
|
+
// Get GeoTIFF bounds in WGS84
|
|
92
|
+
const [geoWest, geoSouth, geoEast, geoNorth] = this.wgs84Bounds;
|
|
93
|
+
// Check if tile intersects with GeoTIFF bounds
|
|
94
|
+
if (east < geoWest ||
|
|
95
|
+
west > geoEast ||
|
|
96
|
+
north < geoSouth ||
|
|
97
|
+
south > geoNorth) {
|
|
98
|
+
// Tile is completely outside GeoTIFF bounds, return flat heightmap
|
|
99
|
+
return this.createFlatHeightmap();
|
|
100
|
+
}
|
|
101
|
+
// Clamp tile bounds to GeoTIFF coverage area
|
|
102
|
+
// This prevents transformation errors when the GeoTIFF projection
|
|
103
|
+
// doesn't support the full WGS84 range (e.g., Mercator and poles)
|
|
104
|
+
west = Math.max(geoWest, Math.min(geoEast, west));
|
|
105
|
+
east = Math.max(geoWest, Math.min(geoEast, east));
|
|
106
|
+
south = Math.max(geoSouth, Math.min(geoNorth, south));
|
|
107
|
+
north = Math.max(geoSouth, Math.min(geoNorth, north));
|
|
108
|
+
// Transform tile bounds to source projection
|
|
109
|
+
// Use the stored proj4 instance that has the projection definitions
|
|
110
|
+
const transformToSource = (coord) => {
|
|
111
|
+
try {
|
|
112
|
+
return this.proj4('EPSG:4326', this.fromProjection, coord);
|
|
113
|
+
}
|
|
114
|
+
catch (err) {
|
|
115
|
+
warn(`${LOG_PREFIX}transform failed:`, err);
|
|
116
|
+
return coord;
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
const swSource = transformToSource([west, south]);
|
|
120
|
+
const neSource = transformToSource([east, north]);
|
|
121
|
+
// Calculate pixel coordinates in GeoTIFF
|
|
122
|
+
const [srcWest, srcSouth, srcEast, srcNorth] = this.sourceBounds;
|
|
123
|
+
const srcWidth = this.width;
|
|
124
|
+
const srcHeight = this.height;
|
|
125
|
+
const pixelWidth = srcEast - srcWest;
|
|
126
|
+
const pixelHeight = srcNorth - srcSouth;
|
|
127
|
+
const x0 = Math.floor(((swSource[0] - srcWest) / pixelWidth) * srcWidth);
|
|
128
|
+
const y0 = Math.floor(((srcNorth - neSource[1]) / pixelHeight) * srcHeight);
|
|
129
|
+
const x1 = Math.ceil(((neSource[0] - srcWest) / pixelWidth) * srcWidth);
|
|
130
|
+
const y1 = Math.ceil(((srcNorth - swSource[1]) / pixelHeight) * srcHeight);
|
|
131
|
+
// Clamp to image bounds
|
|
132
|
+
const windowX = Math.max(0, Math.min(x0, srcWidth));
|
|
133
|
+
const windowY = Math.max(0, Math.min(y0, srcHeight));
|
|
134
|
+
const windowWidth = Math.max(1, Math.min(x1 - x0, srcWidth - windowX));
|
|
135
|
+
const windowHeight = Math.max(1, Math.min(y1 - y0, srcHeight - windowY));
|
|
136
|
+
// Read elevation data from GeoTIFF
|
|
137
|
+
const rasterData = await this.image.readRasters({
|
|
138
|
+
window: [
|
|
139
|
+
windowX,
|
|
140
|
+
windowY,
|
|
141
|
+
windowX + windowWidth,
|
|
142
|
+
windowY + windowHeight,
|
|
143
|
+
],
|
|
144
|
+
width: this.heightmapWidth,
|
|
145
|
+
height: this.heightmapHeight,
|
|
146
|
+
resampleMethod: 'bilinear',
|
|
147
|
+
});
|
|
148
|
+
// Convert to heightmap array (first band contains elevation)
|
|
149
|
+
const elevationData = rasterData[0];
|
|
150
|
+
const buffer = new Float32Array(this.heightmapWidth * this.heightmapHeight);
|
|
151
|
+
for (let i = 0; i < buffer.length; i++) {
|
|
152
|
+
let value = elevationData[i];
|
|
153
|
+
// Replace nodata values with 0
|
|
154
|
+
if (value === this.noDataValue || !isFinite(value)) {
|
|
155
|
+
value = 0;
|
|
156
|
+
}
|
|
157
|
+
buffer[i] = value;
|
|
158
|
+
}
|
|
159
|
+
// Create Cesium HeightmapTerrainData
|
|
160
|
+
return new this.Cesium.HeightmapTerrainData({
|
|
161
|
+
buffer,
|
|
162
|
+
width: this.heightmapWidth,
|
|
163
|
+
height: this.heightmapHeight,
|
|
164
|
+
childTileMask: 0,
|
|
165
|
+
structure: {
|
|
166
|
+
heightScale: 1.0,
|
|
167
|
+
heightOffset: 0.0,
|
|
168
|
+
elementsPerHeight: 1,
|
|
169
|
+
stride: 1,
|
|
170
|
+
elementMultiplier: 1.0,
|
|
171
|
+
},
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
catch (err) {
|
|
175
|
+
warn(`${LOG_PREFIX}failed to load tile geometry:`, err);
|
|
176
|
+
return this.createFlatHeightmap();
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Create a flat heightmap for tiles outside the GeoTIFF bounds
|
|
181
|
+
*/
|
|
182
|
+
createFlatHeightmap() {
|
|
183
|
+
const buffer = new Float32Array(this.heightmapWidth * this.heightmapHeight);
|
|
184
|
+
buffer.fill(0);
|
|
185
|
+
return new this.Cesium.HeightmapTerrainData({
|
|
186
|
+
buffer,
|
|
187
|
+
width: this.heightmapWidth,
|
|
188
|
+
height: this.heightmapHeight,
|
|
189
|
+
childTileMask: 0,
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Get the availability of tiles
|
|
194
|
+
*/
|
|
195
|
+
get availability() {
|
|
196
|
+
// For now, we say all tiles are available
|
|
197
|
+
// In a more sophisticated implementation, we'd track which tiles
|
|
198
|
+
// intersect with the GeoTIFF bounds
|
|
199
|
+
return undefined;
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Get the tiling scheme
|
|
203
|
+
*/
|
|
204
|
+
getTilingScheme() {
|
|
205
|
+
return this.tilingScheme;
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Get the maximum geometric error allowed at a specific level
|
|
209
|
+
* Required by Cesium's TerrainProvider interface
|
|
210
|
+
*
|
|
211
|
+
* The geometric error is the difference (in meters) between the actual terrain
|
|
212
|
+
* and the terrain approximation at this level. Higher levels have lower error.
|
|
213
|
+
*/
|
|
214
|
+
getLevelMaximumGeometricError(level) {
|
|
215
|
+
// Standard geometric error calculation for terrain providers
|
|
216
|
+
// Based on Cesium's approach: error decreases exponentially with level
|
|
217
|
+
// Formula: maximumRadius / (tileWidth * (2^level))
|
|
218
|
+
const ellipsoid = this.tilingScheme.ellipsoid;
|
|
219
|
+
const maximumRadius = ellipsoid.maximumRadius;
|
|
220
|
+
const tileWidth = 65; // Standard heightmap width
|
|
221
|
+
return maximumRadius / (tileWidth * Math.pow(2, level));
|
|
222
|
+
}
|
|
223
|
+
loadTileDataAvailability(_x, _y, _level) {
|
|
224
|
+
return undefined;
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* Check if tile data is available for a specific tile
|
|
228
|
+
* Required by Cesium's TerrainProvider interface
|
|
229
|
+
*/
|
|
230
|
+
getTileDataAvailable(x, y, level) {
|
|
231
|
+
if (!this.ready) {
|
|
232
|
+
return false;
|
|
233
|
+
}
|
|
234
|
+
// Check if tile intersects with GeoTIFF bounds
|
|
235
|
+
const rectangle = this.tilingScheme.tileXYToRectangle(x, y, level);
|
|
236
|
+
const west = this.Cesium.Math.toDegrees(rectangle.west);
|
|
237
|
+
const south = this.Cesium.Math.toDegrees(rectangle.south);
|
|
238
|
+
const east = this.Cesium.Math.toDegrees(rectangle.east);
|
|
239
|
+
const north = this.Cesium.Math.toDegrees(rectangle.north);
|
|
240
|
+
const [geoWest, geoSouth, geoEast, geoNorth] = this.wgs84Bounds;
|
|
241
|
+
// Return true if tile intersects with GeoTIFF bounds
|
|
242
|
+
return !(east < geoWest ||
|
|
243
|
+
west > geoEast ||
|
|
244
|
+
north < geoSouth ||
|
|
245
|
+
south > geoNorth);
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* Check if the provider is ready
|
|
249
|
+
*/
|
|
250
|
+
get readyPromise() {
|
|
251
|
+
return this._readyPromise;
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* Get the credit to display
|
|
255
|
+
*/
|
|
256
|
+
get credit() {
|
|
257
|
+
return new this.Cesium.Credit('GeoTIFF Terrain');
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* Check if the provider has water mask
|
|
261
|
+
*/
|
|
262
|
+
get hasWaterMask() {
|
|
263
|
+
return false;
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* Check if the provider has vertex normals
|
|
267
|
+
*/
|
|
268
|
+
get hasVertexNormals() {
|
|
269
|
+
return false;
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* Get the error event
|
|
273
|
+
*/
|
|
274
|
+
get errorEvent() {
|
|
275
|
+
return new this.Cesium.Event();
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* Factory function to create a CesiumGeoTIFFTerrainProvider
|
|
280
|
+
*/
|
|
281
|
+
export async function createCesiumGeoTIFFTerrainProvider(options) {
|
|
282
|
+
const provider = new CesiumGeoTIFFTerrainProvider(options);
|
|
283
|
+
await provider.readyPromise;
|
|
284
|
+
return provider;
|
|
285
|
+
}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Eine Gruppe verwaltet Sichtbarkeit & Basemap-Filter ihrer Cesium-Layer.
|
|
3
|
+
* - group.visible = false => Alle Layer der Gruppe unsichtbar.
|
|
4
|
+
* - group.basemap = "X" => Nur Layer mit elementId==="X" in der Gruppe sichtbar.
|
|
5
|
+
* - Der ursprüngliche Sichtbarkeitszustand jedes Layers wird gemerkt und bei
|
|
6
|
+
* Re-Aktivierung wiederhergestellt.
|
|
7
|
+
*/
|
|
8
|
+
export class CesiumLayerGroup {
|
|
9
|
+
id;
|
|
10
|
+
_visible = true;
|
|
11
|
+
_basemap = null;
|
|
12
|
+
_layers = new Map();
|
|
13
|
+
_originalVisible = new Map();
|
|
14
|
+
_dirty = true;
|
|
15
|
+
constructor(id, visible = true) {
|
|
16
|
+
this.id = id;
|
|
17
|
+
this._visible = visible;
|
|
18
|
+
}
|
|
19
|
+
get visible() {
|
|
20
|
+
return this._visible;
|
|
21
|
+
}
|
|
22
|
+
set visible(v) {
|
|
23
|
+
if (this._visible === v)
|
|
24
|
+
return;
|
|
25
|
+
this._visible = v;
|
|
26
|
+
this._dirty = true;
|
|
27
|
+
}
|
|
28
|
+
get basemap() {
|
|
29
|
+
return this._basemap;
|
|
30
|
+
}
|
|
31
|
+
set basemap(b) {
|
|
32
|
+
if (this._basemap === b)
|
|
33
|
+
return;
|
|
34
|
+
this._basemap = b;
|
|
35
|
+
this._dirty = true;
|
|
36
|
+
}
|
|
37
|
+
isDirty() {
|
|
38
|
+
return this._dirty;
|
|
39
|
+
}
|
|
40
|
+
addLayer(ref) {
|
|
41
|
+
if (this._layers.has(ref.id))
|
|
42
|
+
return;
|
|
43
|
+
this._layers.set(ref.id, ref);
|
|
44
|
+
this._originalVisible.set(ref.id, ref.layer.getVisible());
|
|
45
|
+
this._dirty = true;
|
|
46
|
+
}
|
|
47
|
+
/** optional zum Nachziehen von elementId (z. B. wenn erst später bekannt) */
|
|
48
|
+
setLayerElementId(layerId, elementId) {
|
|
49
|
+
const r = this._layers.get(layerId);
|
|
50
|
+
if (!r)
|
|
51
|
+
return;
|
|
52
|
+
if (r.elementId === elementId)
|
|
53
|
+
return;
|
|
54
|
+
r.elementId = elementId ?? null;
|
|
55
|
+
this._dirty = true;
|
|
56
|
+
}
|
|
57
|
+
removeLayer(layerId) {
|
|
58
|
+
const had = this._layers.delete(layerId);
|
|
59
|
+
this._originalVisible.delete(layerId);
|
|
60
|
+
if (had)
|
|
61
|
+
this._dirty = true;
|
|
62
|
+
return had;
|
|
63
|
+
}
|
|
64
|
+
clear() {
|
|
65
|
+
this._layers.clear();
|
|
66
|
+
this._originalVisible.clear();
|
|
67
|
+
this._dirty = true;
|
|
68
|
+
}
|
|
69
|
+
/** zentrale Logik: Basemap/Visibility anwenden */
|
|
70
|
+
apply() {
|
|
71
|
+
if (!this._dirty)
|
|
72
|
+
return;
|
|
73
|
+
for (const [id, ref] of this._layers) {
|
|
74
|
+
const original = this._originalVisible.get(id) ?? true;
|
|
75
|
+
// effektive Sichtbarkeit nach Gruppenregeln
|
|
76
|
+
let effective = this._visible && original;
|
|
77
|
+
if (effective && this._basemap) {
|
|
78
|
+
// innerhalb der Gruppe nur Layer mit passender elementId anzeigen
|
|
79
|
+
effective = ref.elementId === this._basemap;
|
|
80
|
+
}
|
|
81
|
+
// Nur dann setzen, wenn sich etwas ändert
|
|
82
|
+
if (ref.layer.getVisible() !== effective) {
|
|
83
|
+
ref.layer.setVisible(effective);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
this._dirty = false;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Root-Store für mehrere Cesium-Gruppen.
|
|
91
|
+
* - Ordnung/Z-Index übernimmst du weiterhin im LayerManager pro Layer.
|
|
92
|
+
* - Diese Klasse kümmert sich um Gruppensichtbarkeit & Basemap-Filter.
|
|
93
|
+
*/
|
|
94
|
+
export class CesiumLayerGroups {
|
|
95
|
+
_groups = [];
|
|
96
|
+
_dirty = true;
|
|
97
|
+
get groups() {
|
|
98
|
+
return [...this._groups];
|
|
99
|
+
}
|
|
100
|
+
getGroup(id) {
|
|
101
|
+
return this._groups.find(g => g.id === id);
|
|
102
|
+
}
|
|
103
|
+
hasGroup(id) {
|
|
104
|
+
return this._groups.some(g => g.id === id);
|
|
105
|
+
}
|
|
106
|
+
ensureGroup(id, visible = true) {
|
|
107
|
+
let g = this.getGroup(id);
|
|
108
|
+
if (g)
|
|
109
|
+
return g;
|
|
110
|
+
g = new CesiumLayerGroup(id, visible);
|
|
111
|
+
this._groups.push(g);
|
|
112
|
+
this._dirty = true;
|
|
113
|
+
return g;
|
|
114
|
+
}
|
|
115
|
+
addLayerToGroup(groupId, visible, ref) {
|
|
116
|
+
const g = this.ensureGroup(groupId, visible);
|
|
117
|
+
g.addLayer(ref);
|
|
118
|
+
this._dirty = true;
|
|
119
|
+
}
|
|
120
|
+
removeLayer(layerId, removeFromAll = true) {
|
|
121
|
+
let removed = false;
|
|
122
|
+
for (const g of this._groups) {
|
|
123
|
+
if (g.removeLayer(layerId)) {
|
|
124
|
+
removed = true;
|
|
125
|
+
if (!removeFromAll)
|
|
126
|
+
break;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
if (removed)
|
|
130
|
+
this._dirty = true;
|
|
131
|
+
return removed;
|
|
132
|
+
}
|
|
133
|
+
setGroupVisible(groupId, visible) {
|
|
134
|
+
const g = this.getGroup(groupId);
|
|
135
|
+
if (!g)
|
|
136
|
+
throw new Error(`CesiumLayerGroup "${groupId}" nicht gefunden`);
|
|
137
|
+
g.visible = visible;
|
|
138
|
+
this._dirty = true;
|
|
139
|
+
}
|
|
140
|
+
setBasemap(groupId, basemap) {
|
|
141
|
+
const g = this.getGroup(groupId);
|
|
142
|
+
if (!g)
|
|
143
|
+
throw new Error(`CesiumLayerGroup "${groupId}" nicht gefunden`);
|
|
144
|
+
g.basemap = basemap;
|
|
145
|
+
this._dirty = true;
|
|
146
|
+
}
|
|
147
|
+
/** Wendet alle Gruppenregeln an (sichtbar/basemap). */
|
|
148
|
+
apply() {
|
|
149
|
+
if (!this._dirty && !this._groups.some(g => g.isDirty()))
|
|
150
|
+
return;
|
|
151
|
+
for (const g of this._groups)
|
|
152
|
+
g.apply();
|
|
153
|
+
this._dirty = false;
|
|
154
|
+
}
|
|
155
|
+
clear() {
|
|
156
|
+
this._groups = [];
|
|
157
|
+
this._dirty = true;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import { log, warn } from "../../utils/logger";
|
|
2
|
+
/**
|
|
3
|
+
* Custom ImageryProvider that renders GeoTIFF tiles on demand using
|
|
4
|
+
* the shared GeoTIFFTileProcessor (triangulation-based reprojection).
|
|
5
|
+
*/
|
|
6
|
+
export class GeoTIFFImageryProvider {
|
|
7
|
+
tileWidth;
|
|
8
|
+
tileHeight;
|
|
9
|
+
tilingScheme;
|
|
10
|
+
rectangle;
|
|
11
|
+
errorEvent;
|
|
12
|
+
credit = undefined;
|
|
13
|
+
tileDiscardPolicy = undefined;
|
|
14
|
+
proxy = undefined;
|
|
15
|
+
hasAlphaChannel = true;
|
|
16
|
+
minimumLevel;
|
|
17
|
+
maximumLevel;
|
|
18
|
+
Cesium;
|
|
19
|
+
tileProcessor;
|
|
20
|
+
resolution;
|
|
21
|
+
resampleMethod;
|
|
22
|
+
colorStops;
|
|
23
|
+
readyPromiseInternal;
|
|
24
|
+
ready = false;
|
|
25
|
+
constructor(options) {
|
|
26
|
+
const { Cesium, rectangleDegrees, tileProcessor, tileSize, resolution, resampleMethod, colorStops, minimumLevel, maximumLevel, } = options;
|
|
27
|
+
this.Cesium = Cesium;
|
|
28
|
+
this.tileProcessor = tileProcessor;
|
|
29
|
+
this.tileWidth = tileSize;
|
|
30
|
+
this.tileHeight = tileSize;
|
|
31
|
+
this.resolution = resolution;
|
|
32
|
+
this.resampleMethod = resampleMethod;
|
|
33
|
+
this.colorStops = colorStops;
|
|
34
|
+
this.minimumLevel = minimumLevel ?? 0;
|
|
35
|
+
this.maximumLevel = maximumLevel;
|
|
36
|
+
this.rectangle = Cesium.Rectangle.fromDegrees(rectangleDegrees[0], rectangleDegrees[1], rectangleDegrees[2], rectangleDegrees[3]);
|
|
37
|
+
// Always use WebMercatorTilingScheme because the GeoTIFFTileProcessor
|
|
38
|
+
// interprets (x,y,z) as Web Mercator tile coordinates.
|
|
39
|
+
this.tilingScheme = new Cesium.WebMercatorTilingScheme();
|
|
40
|
+
this.errorEvent = new Cesium.Event();
|
|
41
|
+
this.ready = true;
|
|
42
|
+
this.readyPromiseInternal = Promise.resolve(true);
|
|
43
|
+
}
|
|
44
|
+
get tilingSchemeName() {
|
|
45
|
+
// Expose helper for debugging if needed.
|
|
46
|
+
return this.tilingScheme instanceof this.Cesium.WebMercatorTilingScheme
|
|
47
|
+
? 'WebMercator'
|
|
48
|
+
: undefined;
|
|
49
|
+
}
|
|
50
|
+
get readyPromise() {
|
|
51
|
+
return this.readyPromiseInternal;
|
|
52
|
+
}
|
|
53
|
+
get tileCredits() {
|
|
54
|
+
return undefined;
|
|
55
|
+
}
|
|
56
|
+
getTileCredits(_x, _y, _level) {
|
|
57
|
+
return undefined;
|
|
58
|
+
}
|
|
59
|
+
get url() {
|
|
60
|
+
return undefined;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Flips a canvas vertically (Y-axis inversion) for Cesium.
|
|
64
|
+
* Creates a new canvas with the flipped content.
|
|
65
|
+
*
|
|
66
|
+
* @param sourceCanvas - The canvas to flip
|
|
67
|
+
* @param width - Width of the canvas
|
|
68
|
+
* @param height - Height of the canvas
|
|
69
|
+
* @returns A new canvas with vertically flipped content, or the source canvas if flipping fails
|
|
70
|
+
*/
|
|
71
|
+
flipCanvasVertically(sourceCanvas, width, height) {
|
|
72
|
+
const flippedCanvas = document.createElement('canvas');
|
|
73
|
+
flippedCanvas.width = width;
|
|
74
|
+
flippedCanvas.height = height;
|
|
75
|
+
const flippedCtx = flippedCanvas.getContext('2d');
|
|
76
|
+
if (!flippedCtx) {
|
|
77
|
+
warn('v-map - cesium - failed to get 2d context for flip');
|
|
78
|
+
return sourceCanvas; // Fallback to source canvas
|
|
79
|
+
}
|
|
80
|
+
flippedCtx.translate(0, height);
|
|
81
|
+
flippedCtx.scale(1, -1);
|
|
82
|
+
flippedCtx.drawImage(sourceCanvas, 0, 0);
|
|
83
|
+
return flippedCanvas;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Creates a flipped ImageBitmap from RGBA data.
|
|
87
|
+
* Uses ImageBitmap for better performance when available.
|
|
88
|
+
*
|
|
89
|
+
* @param rgbaData - The RGBA pixel data
|
|
90
|
+
* @param sampleSize - Size of the tile (width and height)
|
|
91
|
+
* @returns A flipped ImageBitmap, or undefined if creation fails
|
|
92
|
+
*/
|
|
93
|
+
async createFlippedImageBitmap(rgbaData, sampleSize) {
|
|
94
|
+
if (typeof createImageBitmap !== 'function') {
|
|
95
|
+
return undefined;
|
|
96
|
+
}
|
|
97
|
+
try {
|
|
98
|
+
// Create temporary canvas for Y-axis flip
|
|
99
|
+
const tempCanvas = document.createElement('canvas');
|
|
100
|
+
tempCanvas.width = sampleSize;
|
|
101
|
+
tempCanvas.height = sampleSize;
|
|
102
|
+
const tempCtx = tempCanvas.getContext('2d');
|
|
103
|
+
if (!tempCtx) {
|
|
104
|
+
throw new Error('Failed to get 2d context');
|
|
105
|
+
}
|
|
106
|
+
const imageData = tempCtx.createImageData(sampleSize, sampleSize);
|
|
107
|
+
imageData.data.set(rgbaData);
|
|
108
|
+
tempCtx.putImageData(imageData, 0, 0);
|
|
109
|
+
// Flip vertically for Cesium
|
|
110
|
+
const flippedCanvas = this.flipCanvasVertically(tempCanvas, sampleSize, sampleSize);
|
|
111
|
+
return await createImageBitmap(flippedCanvas);
|
|
112
|
+
}
|
|
113
|
+
catch (err) {
|
|
114
|
+
warn('v-map - cesium - createImageBitmap failed, falling back', err);
|
|
115
|
+
return undefined;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Creates a flipped image (ImageBitmap or Canvas) from RGBA data.
|
|
120
|
+
* Prefers ImageBitmap for better performance, falls back to Canvas.
|
|
121
|
+
*
|
|
122
|
+
* @param rgbaData - The RGBA pixel data
|
|
123
|
+
* @returns A flipped ImageBitmap or Canvas, or undefined if creation fails
|
|
124
|
+
*/
|
|
125
|
+
async createFlippedImageFromRGBA(rgbaData) {
|
|
126
|
+
// Calculate actual sample size (may differ from tileWidth due to resolution)
|
|
127
|
+
const sampleSize = Math.ceil(this.tileWidth * this.resolution);
|
|
128
|
+
// Prefer ImageBitmap when available for better performance
|
|
129
|
+
const imageBitmap = await this.createFlippedImageBitmap(rgbaData, sampleSize);
|
|
130
|
+
if (imageBitmap) {
|
|
131
|
+
return imageBitmap;
|
|
132
|
+
}
|
|
133
|
+
// Fallback to Canvas
|
|
134
|
+
const canvas = document.createElement('canvas');
|
|
135
|
+
canvas.width = sampleSize;
|
|
136
|
+
canvas.height = sampleSize;
|
|
137
|
+
const ctx = canvas.getContext('2d');
|
|
138
|
+
if (!ctx) {
|
|
139
|
+
warn('v-map - cesium - unable to acquire canvas 2d context');
|
|
140
|
+
return undefined;
|
|
141
|
+
}
|
|
142
|
+
const imageData = ctx.createImageData(sampleSize, sampleSize);
|
|
143
|
+
imageData.data.set(rgbaData);
|
|
144
|
+
ctx.putImageData(imageData, 0, 0);
|
|
145
|
+
// Flip the canvas vertically for Cesium (Y-axis inversion)
|
|
146
|
+
return this.flipCanvasVertically(canvas, sampleSize, sampleSize);
|
|
147
|
+
}
|
|
148
|
+
async requestImage(x, y, level) {
|
|
149
|
+
if (!this.ready)
|
|
150
|
+
return undefined;
|
|
151
|
+
if (level < this.minimumLevel ||
|
|
152
|
+
(this.maximumLevel !== undefined && level > this.maximumLevel)) {
|
|
153
|
+
return undefined;
|
|
154
|
+
}
|
|
155
|
+
const params = {
|
|
156
|
+
x,
|
|
157
|
+
y,
|
|
158
|
+
z: level,
|
|
159
|
+
tileSize: this.tileWidth,
|
|
160
|
+
resolution: this.resolution,
|
|
161
|
+
resampleMethod: this.resampleMethod,
|
|
162
|
+
colorStops: this.colorStops,
|
|
163
|
+
};
|
|
164
|
+
let rgbaData = null;
|
|
165
|
+
try {
|
|
166
|
+
rgbaData = await this.tileProcessor.getTileData(params);
|
|
167
|
+
if (!rgbaData) {
|
|
168
|
+
log(`v-map - cesium - geotiff - requestImage(${x},${y},${level}): no data returned`);
|
|
169
|
+
return undefined;
|
|
170
|
+
}
|
|
171
|
+
log(`v-map - cesium - geotiff - requestImage(${x},${y},${level}): rgba ${rgbaData.length} bytes, sampleSize=${Math.ceil(this.tileWidth * this.resolution)}`);
|
|
172
|
+
}
|
|
173
|
+
catch (err) {
|
|
174
|
+
this.errorEvent.raiseEvent(err);
|
|
175
|
+
warn('v-map - cesium - getTileData - GeoTIFF tile request failed', err);
|
|
176
|
+
return undefined;
|
|
177
|
+
}
|
|
178
|
+
try {
|
|
179
|
+
const result = await this.createFlippedImageFromRGBA(rgbaData);
|
|
180
|
+
log(`v-map - cesium - geotiff - requestImage(${x},${y},${level}): result=${result?.constructor?.name ?? 'undefined'}, size=${result instanceof HTMLCanvasElement ? `${result.width}x${result.height}` : result instanceof ImageBitmap ? `${result.width}x${result.height}` : 'n/a'}`);
|
|
181
|
+
return result;
|
|
182
|
+
}
|
|
183
|
+
catch (err) {
|
|
184
|
+
this.errorEvent.raiseEvent(err);
|
|
185
|
+
warn('v-map - cesium - createFlippedImageFromRGBA - GeoTIFF tile request failed', err);
|
|
186
|
+
return undefined;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
pickFeatures() {
|
|
190
|
+
return undefined;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { describe, expect, it, vi } from "vitest";
|
|
2
|
+
vi.mock('../../utils/logger', () => ({
|
|
3
|
+
log: vi.fn(),
|
|
4
|
+
warn: vi.fn(),
|
|
5
|
+
error: vi.fn(),
|
|
6
|
+
}));
|
|
7
|
+
import { GeoTIFFImageryProvider, } from "./GeoTIFFImageryProvider";
|
|
8
|
+
const mockTileProcessor = {
|
|
9
|
+
getTileData: vi.fn().mockResolvedValue(new Uint8ClampedArray(16 * 16 * 4)),
|
|
10
|
+
createGlobalTriangulation: vi.fn(),
|
|
11
|
+
};
|
|
12
|
+
const mockCesium = {
|
|
13
|
+
Rectangle: {
|
|
14
|
+
fromDegrees: vi.fn().mockImplementation((w, s, e, n) => ({
|
|
15
|
+
west: w,
|
|
16
|
+
south: s,
|
|
17
|
+
east: e,
|
|
18
|
+
north: n,
|
|
19
|
+
})),
|
|
20
|
+
},
|
|
21
|
+
WebMercatorTilingScheme: vi.fn().mockImplementation(function () {
|
|
22
|
+
return { _type: 'WebMercatorTilingScheme' };
|
|
23
|
+
}),
|
|
24
|
+
Event: vi.fn().mockImplementation(function () {
|
|
25
|
+
return { raiseEvent: vi.fn() };
|
|
26
|
+
}),
|
|
27
|
+
};
|
|
28
|
+
describe('GeoTIFFImageryProvider browser example', () => {
|
|
29
|
+
it('renders tile data through real browser canvas APIs', async () => {
|
|
30
|
+
const provider = new GeoTIFFImageryProvider({
|
|
31
|
+
Cesium: mockCesium,
|
|
32
|
+
rectangleDegrees: [8, 50, 9, 51],
|
|
33
|
+
tileProcessor: mockTileProcessor,
|
|
34
|
+
tileSize: 16,
|
|
35
|
+
resolution: 1,
|
|
36
|
+
resampleMethod: 'bilinear',
|
|
37
|
+
});
|
|
38
|
+
const result = await provider.requestImage(1, 2, 5);
|
|
39
|
+
expect(mockTileProcessor.getTileData).toHaveBeenCalledWith(expect.objectContaining({
|
|
40
|
+
x: 1,
|
|
41
|
+
y: 2,
|
|
42
|
+
z: 5,
|
|
43
|
+
tileSize: 16,
|
|
44
|
+
}));
|
|
45
|
+
expect(result).toBeTruthy();
|
|
46
|
+
expect(result instanceof HTMLCanvasElement || result instanceof ImageBitmap).toBe(true);
|
|
47
|
+
if (result instanceof HTMLCanvasElement) {
|
|
48
|
+
expect(result.width).toBe(16);
|
|
49
|
+
expect(result.height).toBe(16);
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
expect(result.width).toBe(16);
|
|
53
|
+
expect(result.height).toBe(16);
|
|
54
|
+
result.close();
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
});
|