@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,410 @@
|
|
|
1
|
+
import { log, warn, error } from "../../utils/logger";
|
|
2
|
+
import { loadGeoTIFFSource } from "../geotiff/geotiff-source";
|
|
3
|
+
import { GeoTIFFTileProcessor, getTileProcessorConfig, } from "../geotiff/utils/GeoTIFFTileProcessor";
|
|
4
|
+
import { getColorStops, } from "../geotiff/utils/colormap-utils";
|
|
5
|
+
const LOG_PREFIX = 'v-map - deck - terrain-geotiff - ';
|
|
6
|
+
const TILE_LAYER_LOG_PREFIX = 'v-map - deck - terrain-geotiff - tilelayer - ';
|
|
7
|
+
/**
|
|
8
|
+
* Factory-Funktion zum Erstellen eines DeckGLGeoTIFFTerrainLayer
|
|
9
|
+
*
|
|
10
|
+
* Rendert GeoTIFF-Höhendaten als 3D-Terrain-Mesh (Standard) oder als
|
|
11
|
+
* colormap-basierte 2D-Kacheln.
|
|
12
|
+
*
|
|
13
|
+
* Im terrain-Modus (Standard) wird der Martini-Algorithmus (@mapbox/martini)
|
|
14
|
+
* für adaptive RTIN-Mesh-Generierung verwendet. meshMaxError, wireframe und
|
|
15
|
+
* elevationScale sind in diesem Modus funktional.
|
|
16
|
+
*/
|
|
17
|
+
export async function createDeckGLGeoTIFFTerrainLayer(props) {
|
|
18
|
+
const [{ CompositeLayer }, { TileLayer }, { BitmapLayer }, { SimpleMeshLayer }, MartiniModule, { default: proj4 }, geotiffModule, geokeysModule,] = await Promise.all([
|
|
19
|
+
import('@deck.gl/core'),
|
|
20
|
+
import('@deck.gl/geo-layers'),
|
|
21
|
+
import('@deck.gl/layers'),
|
|
22
|
+
import('@deck.gl/mesh-layers'),
|
|
23
|
+
import('@mapbox/martini'),
|
|
24
|
+
import('proj4'),
|
|
25
|
+
import('geotiff'),
|
|
26
|
+
import('geotiff-geokeys-to-proj4'),
|
|
27
|
+
]);
|
|
28
|
+
const Martini = MartiniModule.default ?? MartiniModule;
|
|
29
|
+
class DeckGLGeoTIFFTerrainLayer extends CompositeLayer {
|
|
30
|
+
static layerName = 'DeckGLGeoTIFFTerrainLayer';
|
|
31
|
+
static defaultProps = {
|
|
32
|
+
minZoom: 0,
|
|
33
|
+
maxZoom: 24,
|
|
34
|
+
tileSize: 256,
|
|
35
|
+
noDataValue: 0,
|
|
36
|
+
forceProjection: false,
|
|
37
|
+
meshMaxError: 4.0,
|
|
38
|
+
wireframe: false,
|
|
39
|
+
elevationScale: 1.0,
|
|
40
|
+
colorMap: 'terrain',
|
|
41
|
+
renderMode: 'terrain',
|
|
42
|
+
};
|
|
43
|
+
tiff;
|
|
44
|
+
image;
|
|
45
|
+
fromProjection = 'EPSG:4326';
|
|
46
|
+
viewProjection = 'EPSG:3857';
|
|
47
|
+
sourceBounds = [0, 0, 0, 0];
|
|
48
|
+
tileProcessor;
|
|
49
|
+
activeLoad;
|
|
50
|
+
loadedSignature;
|
|
51
|
+
loadToken = 0;
|
|
52
|
+
storeRuntimeState() {
|
|
53
|
+
this.setState({
|
|
54
|
+
runtime: {
|
|
55
|
+
tiff: this.tiff,
|
|
56
|
+
image: this.image,
|
|
57
|
+
fromProjection: this.fromProjection,
|
|
58
|
+
sourceBounds: this.sourceBounds,
|
|
59
|
+
tileProcessor: this.tileProcessor,
|
|
60
|
+
},
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
restoreRuntimeState() {
|
|
64
|
+
const runtime = this.state.runtime;
|
|
65
|
+
if (!runtime)
|
|
66
|
+
return;
|
|
67
|
+
this.tiff ??= runtime.tiff;
|
|
68
|
+
this.image ??= runtime.image;
|
|
69
|
+
this.tileProcessor ??= runtime.tileProcessor;
|
|
70
|
+
this.fromProjection = runtime.fromProjection ?? this.fromProjection;
|
|
71
|
+
this.sourceBounds = runtime.sourceBounds ?? this.sourceBounds;
|
|
72
|
+
}
|
|
73
|
+
constructor(layerProps) {
|
|
74
|
+
super(layerProps);
|
|
75
|
+
}
|
|
76
|
+
getLoadSignature(props = this.props) {
|
|
77
|
+
return JSON.stringify({
|
|
78
|
+
url: props.url ?? null,
|
|
79
|
+
projection: props.projection ?? null,
|
|
80
|
+
forceProjection: props.forceProjection ?? false,
|
|
81
|
+
noDataValue: props.noDataValue ?? null,
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
scheduleLoad(reason) {
|
|
85
|
+
const signature = this.getLoadSignature();
|
|
86
|
+
if (this.activeLoad?.signature === signature) {
|
|
87
|
+
log(`${LOG_PREFIX}skip duplicate load: ${reason}`);
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
if (this.loadedSignature === signature && this.state.init) {
|
|
91
|
+
log(`${LOG_PREFIX}skip already-loaded source: ${reason}`);
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
const token = ++this.loadToken;
|
|
95
|
+
this.activeLoad = { signature, token };
|
|
96
|
+
this.setState({ init: false });
|
|
97
|
+
void this._loadAsync(token, signature, reason);
|
|
98
|
+
}
|
|
99
|
+
async _loadAsync(token, signature, reason) {
|
|
100
|
+
try {
|
|
101
|
+
const applied = await this.loadGeoTIFF(token);
|
|
102
|
+
if (!applied || this.activeLoad?.token !== token) {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
this.loadedSignature = signature;
|
|
106
|
+
this.setState({ init: true });
|
|
107
|
+
log(`${LOG_PREFIX}load complete: ${reason}`);
|
|
108
|
+
}
|
|
109
|
+
finally {
|
|
110
|
+
if (this.activeLoad?.token === token) {
|
|
111
|
+
this.activeLoad = undefined;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
// ============================================================================
|
|
116
|
+
// LIFECYCLE METHODS
|
|
117
|
+
// ============================================================================
|
|
118
|
+
async initializeState(_context) {
|
|
119
|
+
this.scheduleLoad('initializeState');
|
|
120
|
+
}
|
|
121
|
+
shouldUpdateState({ changeFlags }) {
|
|
122
|
+
return Boolean(changeFlags.propsOrDataChanged || changeFlags.updateTriggersChanged);
|
|
123
|
+
}
|
|
124
|
+
updateState({ props: newProps, oldProps, changeFlags, }) {
|
|
125
|
+
this.restoreRuntimeState();
|
|
126
|
+
const reloadPropsChanged = newProps.url !== oldProps.url ||
|
|
127
|
+
newProps.projection !== oldProps.projection ||
|
|
128
|
+
newProps.forceProjection !== oldProps.forceProjection ||
|
|
129
|
+
newProps.noDataValue !== oldProps.noDataValue;
|
|
130
|
+
const invalidatePropsChanged = newProps.meshMaxError !== oldProps.meshMaxError ||
|
|
131
|
+
newProps.wireframe !== oldProps.wireframe ||
|
|
132
|
+
newProps.texture !== oldProps.texture ||
|
|
133
|
+
newProps.color !== oldProps.color ||
|
|
134
|
+
newProps.colorMap !== oldProps.colorMap ||
|
|
135
|
+
newProps.valueRange !== oldProps.valueRange ||
|
|
136
|
+
newProps.elevationScale !== oldProps.elevationScale ||
|
|
137
|
+
newProps.opacity !== oldProps.opacity ||
|
|
138
|
+
newProps.visible !== oldProps.visible ||
|
|
139
|
+
newProps.renderMode !== oldProps.renderMode ||
|
|
140
|
+
changeFlags.updateTriggersChanged;
|
|
141
|
+
if (changeFlags.dataChanged ||
|
|
142
|
+
newProps.data !== oldProps.data ||
|
|
143
|
+
reloadPropsChanged) {
|
|
144
|
+
this.scheduleLoad('updateState');
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
if (invalidatePropsChanged) {
|
|
148
|
+
this.setNeedsRedraw();
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
finalizeState(_context) {
|
|
152
|
+
if (this.tiff) {
|
|
153
|
+
this.tiff = null;
|
|
154
|
+
}
|
|
155
|
+
this.image = null;
|
|
156
|
+
}
|
|
157
|
+
// ============================================================================
|
|
158
|
+
// GEOTIFF LOADING
|
|
159
|
+
// ============================================================================
|
|
160
|
+
async loadGeoTIFF(token) {
|
|
161
|
+
const { url, projection, forceProjection } = this.props;
|
|
162
|
+
if (!url) {
|
|
163
|
+
this.tiff = undefined;
|
|
164
|
+
this.image = undefined;
|
|
165
|
+
this.tileProcessor = undefined;
|
|
166
|
+
this.sourceBounds = [0, 0, 0, 0];
|
|
167
|
+
this.storeRuntimeState();
|
|
168
|
+
log(`${LOG_PREFIX}no URL provided, skipping GeoTIFF loading`);
|
|
169
|
+
this.loadedSignature = this.getLoadSignature();
|
|
170
|
+
return true;
|
|
171
|
+
}
|
|
172
|
+
log(`${LOG_PREFIX}loadGeoTIFF: url=${url}, token=${token}`);
|
|
173
|
+
try {
|
|
174
|
+
const source = await loadGeoTIFFSource(url, {
|
|
175
|
+
projection,
|
|
176
|
+
forceProjection,
|
|
177
|
+
nodata: this.props.noDataValue,
|
|
178
|
+
}, {
|
|
179
|
+
geotiff: geotiffModule,
|
|
180
|
+
proj4,
|
|
181
|
+
geokeysToProj4: geokeysModule,
|
|
182
|
+
});
|
|
183
|
+
if (this.activeLoad?.token !== token) {
|
|
184
|
+
log(`${LOG_PREFIX}ignore stale source load result: token=${token}`);
|
|
185
|
+
return false;
|
|
186
|
+
}
|
|
187
|
+
this.tiff = source.tiff;
|
|
188
|
+
this.image = source.baseImage;
|
|
189
|
+
this.fromProjection = source.fromProjection;
|
|
190
|
+
this.sourceBounds = source.sourceBounds;
|
|
191
|
+
const config = await getTileProcessorConfig(source, this.viewProjection);
|
|
192
|
+
if (this.activeLoad?.token !== token) {
|
|
193
|
+
log(`${LOG_PREFIX}ignore stale tile processor result: token=${token}`);
|
|
194
|
+
return false;
|
|
195
|
+
}
|
|
196
|
+
this.tileProcessor = new GeoTIFFTileProcessor(config);
|
|
197
|
+
this.tileProcessor.createGlobalTriangulation();
|
|
198
|
+
this.storeRuntimeState();
|
|
199
|
+
log(`${LOG_PREFIX}loaded: projection=${this.fromProjection}→${this.viewProjection}, bounds=[${this.sourceBounds.map(v => v.toFixed(0)).join(',')}]`);
|
|
200
|
+
this.setNeedsRedraw();
|
|
201
|
+
return true;
|
|
202
|
+
}
|
|
203
|
+
catch (err) {
|
|
204
|
+
error(`${LOG_PREFIX}failed to load GeoTIFF:`, err);
|
|
205
|
+
this.raiseError(err, 'Failed to load GeoTIFF');
|
|
206
|
+
return false;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
// ============================================================================
|
|
210
|
+
// VIEW EXTENT
|
|
211
|
+
// ============================================================================
|
|
212
|
+
getViewExtent() {
|
|
213
|
+
if (!this.tileProcessor)
|
|
214
|
+
return null;
|
|
215
|
+
const [srcWest, srcSouth, srcEast, srcNorth] = this.sourceBounds;
|
|
216
|
+
const MAX_LAT = 85.05112878;
|
|
217
|
+
const clampLon = (lon) => Math.max(-180, Math.min(180, Number.isFinite(lon) ? lon : 0));
|
|
218
|
+
const clampLat = (lat) => Math.max(-MAX_LAT, Math.min(MAX_LAT, Number.isFinite(lat) ? lat : 0));
|
|
219
|
+
const transformSourceToWGS84 = (coord) => {
|
|
220
|
+
if (this.fromProjection === 'EPSG:4326') {
|
|
221
|
+
return coord;
|
|
222
|
+
}
|
|
223
|
+
const result = proj4(this.fromProjection, 'EPSG:4326', coord);
|
|
224
|
+
return [Number(result[0]), Number(result[1])];
|
|
225
|
+
};
|
|
226
|
+
try {
|
|
227
|
+
const corners = [
|
|
228
|
+
transformSourceToWGS84([srcWest, srcSouth]),
|
|
229
|
+
transformSourceToWGS84([srcEast, srcSouth]),
|
|
230
|
+
transformSourceToWGS84([srcEast, srcNorth]),
|
|
231
|
+
transformSourceToWGS84([srcWest, srcNorth]),
|
|
232
|
+
];
|
|
233
|
+
const minLng = clampLon(Math.min(...corners.map(corner => corner[0])));
|
|
234
|
+
const maxLng = clampLon(Math.max(...corners.map(corner => corner[0])));
|
|
235
|
+
const minLat = clampLat(Math.min(...corners.map(corner => corner[1])));
|
|
236
|
+
const maxLat = clampLat(Math.max(...corners.map(corner => corner[1])));
|
|
237
|
+
if (minLng > maxLng || minLat > maxLat) {
|
|
238
|
+
warn(`${LOG_PREFIX}invalid extent calculated from source bounds`);
|
|
239
|
+
return null;
|
|
240
|
+
}
|
|
241
|
+
return [minLng, minLat, maxLng, maxLat];
|
|
242
|
+
}
|
|
243
|
+
catch (err) {
|
|
244
|
+
warn(`${LOG_PREFIX}failed to calculate extent from source bounds:`, err);
|
|
245
|
+
return null;
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
// ============================================================================
|
|
249
|
+
// TILE DATA GENERATION
|
|
250
|
+
// ============================================================================
|
|
251
|
+
async getTileData(tile) {
|
|
252
|
+
if (!this.image || !this.tileProcessor)
|
|
253
|
+
return null;
|
|
254
|
+
const { x, y, z } = tile.index;
|
|
255
|
+
const { tileSize, renderMode } = this.props;
|
|
256
|
+
try {
|
|
257
|
+
if (renderMode === 'colormap') {
|
|
258
|
+
return this._getTileDataColormap(x, y, z, tileSize);
|
|
259
|
+
}
|
|
260
|
+
return this._getTileDataTerrain(x, y, z, tileSize);
|
|
261
|
+
}
|
|
262
|
+
catch (err) {
|
|
263
|
+
warn(`${LOG_PREFIX}tile [${z}/${x}/${y}] failed:`, err);
|
|
264
|
+
return null;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
async _getTileDataColormap(x, y, z, tileSize) {
|
|
268
|
+
const { colorMap, valueRange } = this.props;
|
|
269
|
+
let colorStops;
|
|
270
|
+
if (colorMap) {
|
|
271
|
+
colorStops = getColorStops(colorMap, valueRange).stops;
|
|
272
|
+
}
|
|
273
|
+
const rgbaData = await this.tileProcessor.getTileData({
|
|
274
|
+
x, y, z,
|
|
275
|
+
tileSize,
|
|
276
|
+
resolution: 1.0,
|
|
277
|
+
resampleMethod: 'bilinear',
|
|
278
|
+
colorStops,
|
|
279
|
+
});
|
|
280
|
+
if (!rgbaData)
|
|
281
|
+
return null;
|
|
282
|
+
return { data: rgbaData, width: tileSize, height: tileSize };
|
|
283
|
+
}
|
|
284
|
+
async _getTileDataTerrain(x, y, z, tileSize) {
|
|
285
|
+
const elevationData = await this.tileProcessor.getElevationData({ x, y, z, tileSize });
|
|
286
|
+
if (!elevationData)
|
|
287
|
+
return null;
|
|
288
|
+
return { elevationData, gridSize: tileSize + 1 };
|
|
289
|
+
}
|
|
290
|
+
// ============================================================================
|
|
291
|
+
// RENDERING
|
|
292
|
+
// ============================================================================
|
|
293
|
+
renderLayers() {
|
|
294
|
+
this.restoreRuntimeState();
|
|
295
|
+
if (!this.image || !this.tileProcessor || this.props.visible === false) {
|
|
296
|
+
return null;
|
|
297
|
+
}
|
|
298
|
+
const { minZoom, maxZoom, tileSize, renderMode, opacity } = this.props;
|
|
299
|
+
const extent = this.getViewExtent();
|
|
300
|
+
const layerConfig = {
|
|
301
|
+
id: `${this.props.id}-tiles`,
|
|
302
|
+
minZoom,
|
|
303
|
+
maxZoom,
|
|
304
|
+
tileSize,
|
|
305
|
+
opacity,
|
|
306
|
+
visible: this.props.visible,
|
|
307
|
+
getTileData: this.getTileData.bind(this),
|
|
308
|
+
onTileError: (err) => {
|
|
309
|
+
warn(`${TILE_LAYER_LOG_PREFIX}error: ${err.message}`);
|
|
310
|
+
this.props.onTileLoadError?.(err);
|
|
311
|
+
},
|
|
312
|
+
renderSubLayers: renderMode === 'colormap'
|
|
313
|
+
? this._renderColormapSubLayer.bind(this)
|
|
314
|
+
: this._renderTerrainSubLayer.bind(this),
|
|
315
|
+
};
|
|
316
|
+
if (extent) {
|
|
317
|
+
layerConfig.extent = extent;
|
|
318
|
+
}
|
|
319
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- TileLayer constructor expects TileLayerProps which conflicts with dynamic config assembly
|
|
320
|
+
return new TileLayer(layerConfig);
|
|
321
|
+
}
|
|
322
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- deck.gl renderSubLayers pass-through pattern requires any for prop spreading
|
|
323
|
+
_renderColormapSubLayer(subProps) {
|
|
324
|
+
const { tile } = subProps;
|
|
325
|
+
if (!tile?.data)
|
|
326
|
+
return null;
|
|
327
|
+
const { data, width, height } = tile.data;
|
|
328
|
+
const { west, south, east, north } = subProps.tile.bbox;
|
|
329
|
+
const bounds = [west, south, east, north];
|
|
330
|
+
const { opacity, visible } = this.props;
|
|
331
|
+
const webgl = globalThis.WebGLRenderingContext;
|
|
332
|
+
const textureMinFilter = webgl?.TEXTURE_MIN_FILTER ?? 10241;
|
|
333
|
+
const textureMagFilter = webgl?.TEXTURE_MAG_FILTER ?? 10240;
|
|
334
|
+
const linear = webgl?.LINEAR ?? 9729;
|
|
335
|
+
return new BitmapLayer({
|
|
336
|
+
...subProps,
|
|
337
|
+
id: `${subProps.id}-bitmap`,
|
|
338
|
+
opacity,
|
|
339
|
+
visible,
|
|
340
|
+
image: { data, width, height },
|
|
341
|
+
bounds,
|
|
342
|
+
textureParameters: {
|
|
343
|
+
[textureMinFilter]: linear,
|
|
344
|
+
[textureMagFilter]: linear,
|
|
345
|
+
},
|
|
346
|
+
});
|
|
347
|
+
}
|
|
348
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- deck.gl renderSubLayers pass-through pattern requires any for prop spreading
|
|
349
|
+
_renderTerrainSubLayer(subProps) {
|
|
350
|
+
const { tile } = subProps;
|
|
351
|
+
if (!tile?.data)
|
|
352
|
+
return null;
|
|
353
|
+
const { elevationData, gridSize } = tile.data;
|
|
354
|
+
const { west, south, east, north } = subProps.tile.bbox;
|
|
355
|
+
const { meshMaxError, wireframe, color, elevationScale, texture, opacity, visible } = this.props;
|
|
356
|
+
// Martini mesh is rebuilt here on each renderSubLayers call.
|
|
357
|
+
// This is acceptable because TileLayer only invokes renderSubLayers
|
|
358
|
+
// when tile data actually changes (new tile loaded or evicted),
|
|
359
|
+
// not on every frame redraw.
|
|
360
|
+
const martini = new Martini(gridSize);
|
|
361
|
+
const martiniTile = martini.createTile(elevationData);
|
|
362
|
+
const { vertices, triangles } = martiniTile.getMesh(meshMaxError ?? 4.0);
|
|
363
|
+
const tileSize = gridSize - 1;
|
|
364
|
+
const numVertices = vertices.length / 2;
|
|
365
|
+
const positions = new Float32Array(numVertices * 3);
|
|
366
|
+
const texCoords = new Float32Array(numVertices * 2);
|
|
367
|
+
const lonRange = east - west;
|
|
368
|
+
const latRange = north - south;
|
|
369
|
+
const scale = elevationScale ?? 1.0;
|
|
370
|
+
for (let i = 0; i < numVertices; i++) {
|
|
371
|
+
const px = vertices[i * 2];
|
|
372
|
+
const py = vertices[i * 2 + 1];
|
|
373
|
+
const elevation = elevationData[py * gridSize + px];
|
|
374
|
+
positions[i * 3 + 0] = west + (px / tileSize) * lonRange;
|
|
375
|
+
positions[i * 3 + 1] = north - (py / tileSize) * latRange;
|
|
376
|
+
positions[i * 3 + 2] = elevation * scale;
|
|
377
|
+
texCoords[i * 2 + 0] = px / tileSize;
|
|
378
|
+
texCoords[i * 2 + 1] = py / tileSize;
|
|
379
|
+
}
|
|
380
|
+
const mesh = {
|
|
381
|
+
attributes: {
|
|
382
|
+
POSITION: { value: positions, size: 3 },
|
|
383
|
+
TEXCOORD_0: { value: texCoords, size: 2 },
|
|
384
|
+
},
|
|
385
|
+
indices: { value: Uint32Array.from(triangles), size: 1 },
|
|
386
|
+
mode: 4, // TRIANGLES
|
|
387
|
+
};
|
|
388
|
+
const tileIndex = subProps.tile?.index;
|
|
389
|
+
const tileTexture = typeof texture === 'string'
|
|
390
|
+
? texture
|
|
391
|
+
.replaceAll('{x}', String(tileIndex?.x ?? '{x}'))
|
|
392
|
+
.replaceAll('{y}', String(tileIndex?.y ?? '{y}'))
|
|
393
|
+
.replaceAll('{z}', String(tileIndex?.z ?? '{z}'))
|
|
394
|
+
: undefined;
|
|
395
|
+
return new SimpleMeshLayer({
|
|
396
|
+
...subProps,
|
|
397
|
+
id: `${subProps.id}-mesh`,
|
|
398
|
+
opacity,
|
|
399
|
+
visible,
|
|
400
|
+
mesh,
|
|
401
|
+
data: [[0, 0, 0]],
|
|
402
|
+
getPosition: (d) => d,
|
|
403
|
+
getColor: tileTexture ? [255, 255, 255] : (color ?? [200, 200, 200]),
|
|
404
|
+
texture: tileTexture ?? null,
|
|
405
|
+
wireframe: wireframe ?? false,
|
|
406
|
+
});
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
return new DeckGLGeoTIFFTerrainLayer(props);
|
|
410
|
+
}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { log } from "../../utils/logger";
|
|
2
|
+
export class LayerGroupWithModel {
|
|
3
|
+
id;
|
|
4
|
+
_visible = true;
|
|
5
|
+
_syncMode = 'force-model';
|
|
6
|
+
_models = new Map();
|
|
7
|
+
_instances = new Map();
|
|
8
|
+
_recreateOnNextEmit = false;
|
|
9
|
+
_overrides = new Map(); // <<<< NEU
|
|
10
|
+
_dirty = true;
|
|
11
|
+
_cachedLayers = [];
|
|
12
|
+
_basemap = null;
|
|
13
|
+
constructor(opts) {
|
|
14
|
+
this.id = opts.id;
|
|
15
|
+
this._visible = opts.visible ?? true;
|
|
16
|
+
this._syncMode = opts.syncMode ?? 'force-model';
|
|
17
|
+
this._basemap = opts.basemap ?? null;
|
|
18
|
+
(opts.models ?? []).forEach(m => this.addModel(m));
|
|
19
|
+
}
|
|
20
|
+
get visible() {
|
|
21
|
+
return this._visible;
|
|
22
|
+
}
|
|
23
|
+
set visible(v) {
|
|
24
|
+
if (this._visible === v)
|
|
25
|
+
return;
|
|
26
|
+
this._visible = v;
|
|
27
|
+
if (!v) {
|
|
28
|
+
this._instances.clear(); // finalisierte Instanzen verwerfen
|
|
29
|
+
this._recreateOnNextEmit = true;
|
|
30
|
+
}
|
|
31
|
+
this._dirty = true;
|
|
32
|
+
}
|
|
33
|
+
get syncMode() {
|
|
34
|
+
return this._syncMode;
|
|
35
|
+
}
|
|
36
|
+
set syncMode(m) {
|
|
37
|
+
if (this._syncMode !== m) {
|
|
38
|
+
this._syncMode = m;
|
|
39
|
+
this._dirty = true;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
set basemap(b) {
|
|
43
|
+
if (this._basemap === b)
|
|
44
|
+
return;
|
|
45
|
+
this._basemap = b;
|
|
46
|
+
// Basemap-Änderung kann viele Modelle temporär entfernen
|
|
47
|
+
this._instances.clear();
|
|
48
|
+
this._recreateOnNextEmit = true;
|
|
49
|
+
this._dirty = true;
|
|
50
|
+
}
|
|
51
|
+
get basemap() {
|
|
52
|
+
return this._basemap;
|
|
53
|
+
}
|
|
54
|
+
isDirty() {
|
|
55
|
+
return this._dirty;
|
|
56
|
+
}
|
|
57
|
+
addModel(model) {
|
|
58
|
+
if (!model?.id)
|
|
59
|
+
throw new Error('LayerModel benötigt id');
|
|
60
|
+
this._models.set(model.id, { ...model });
|
|
61
|
+
this._dirty = true;
|
|
62
|
+
}
|
|
63
|
+
addModels(models) {
|
|
64
|
+
models.forEach(m => this.addModel(m));
|
|
65
|
+
}
|
|
66
|
+
getModel(id) {
|
|
67
|
+
const m = this._models.get(id);
|
|
68
|
+
return m ? { ...m } : undefined;
|
|
69
|
+
}
|
|
70
|
+
removeModel(id) {
|
|
71
|
+
if (this._models.delete(id)) {
|
|
72
|
+
this._instances.delete(id);
|
|
73
|
+
this._overrides.delete(id);
|
|
74
|
+
this._dirty = true;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
clear() {
|
|
78
|
+
this._models.clear();
|
|
79
|
+
this._instances.clear();
|
|
80
|
+
this._overrides.clear();
|
|
81
|
+
this._cachedLayers = [];
|
|
82
|
+
this._dirty = true;
|
|
83
|
+
}
|
|
84
|
+
setModelEnabled(id, enabled) {
|
|
85
|
+
const m = this._models.get(id);
|
|
86
|
+
if (!m)
|
|
87
|
+
throw new Error(`LayerModel "${id}" nicht gefunden`);
|
|
88
|
+
if (m.enabled === enabled)
|
|
89
|
+
return;
|
|
90
|
+
m.enabled = enabled;
|
|
91
|
+
if (!enabled) {
|
|
92
|
+
this._instances.delete(id); // bei Disable die Instanz verwerfen
|
|
93
|
+
}
|
|
94
|
+
this._dirty = true;
|
|
95
|
+
}
|
|
96
|
+
replaceModel(model) {
|
|
97
|
+
const had = this._models.has(model.id);
|
|
98
|
+
this._models.set(model.id, { ...model });
|
|
99
|
+
this._dirty = this._dirty || !had;
|
|
100
|
+
}
|
|
101
|
+
setModelOverrides(id, overrides) {
|
|
102
|
+
if (!this._models.has(id))
|
|
103
|
+
throw new Error(`LayerModel "${id}" nicht gefunden`);
|
|
104
|
+
const current = this._overrides.get(id) ?? {};
|
|
105
|
+
this._overrides.set(id, { ...current, ...overrides });
|
|
106
|
+
this._dirty = true;
|
|
107
|
+
}
|
|
108
|
+
clearModelOverrides(id) {
|
|
109
|
+
if (this._overrides.delete(id))
|
|
110
|
+
this._dirty = true;
|
|
111
|
+
}
|
|
112
|
+
getLayers() {
|
|
113
|
+
if (!this._dirty && this._cachedLayers.length)
|
|
114
|
+
return this._cachedLayers;
|
|
115
|
+
if (!this._visible) {
|
|
116
|
+
this._cachedLayers = [];
|
|
117
|
+
this._dirty = false;
|
|
118
|
+
return this._cachedLayers;
|
|
119
|
+
}
|
|
120
|
+
const out = [];
|
|
121
|
+
for (const [id, model] of this._models.entries()) {
|
|
122
|
+
let effective = this._visible && model.enabled;
|
|
123
|
+
if (this._basemap && model.elementId !== this._basemap) {
|
|
124
|
+
effective = false;
|
|
125
|
+
}
|
|
126
|
+
if (!effective) {
|
|
127
|
+
this._instances.delete(id);
|
|
128
|
+
continue;
|
|
129
|
+
}
|
|
130
|
+
// Instanz frisch erzeugen, wenn keine da (oder nach clear)
|
|
131
|
+
let inst = this._instances.get(id);
|
|
132
|
+
if (!inst || this._recreateOnNextEmit) {
|
|
133
|
+
log('deck - lgwm - getLayers - model.make()');
|
|
134
|
+
const base = model.make(); // neue Instanz
|
|
135
|
+
const cur = base.props.visible ?? true;
|
|
136
|
+
inst = cur === true ? base : base.clone({ visible: true });
|
|
137
|
+
this._instances.set(id, inst);
|
|
138
|
+
}
|
|
139
|
+
// force-model: Sichtbarkeit durchsetzen
|
|
140
|
+
if (this._syncMode === 'force-model') {
|
|
141
|
+
const cur = inst.props.visible ?? true;
|
|
142
|
+
if (cur !== effective) {
|
|
143
|
+
inst = inst.clone({ visible: effective });
|
|
144
|
+
this._instances.set(id, inst);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
// Overrides anwenden (nur klonen, wenn sich was ändert)
|
|
148
|
+
const ov = this._overrides.get(id);
|
|
149
|
+
if (ov && Object.keys(ov).length) {
|
|
150
|
+
const needClone = Object.entries(ov).some(([k, v]) => inst.props[k] !== v);
|
|
151
|
+
if (needClone) {
|
|
152
|
+
inst = inst.clone(ov);
|
|
153
|
+
this._instances.set(id, inst);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
// nur liefern, wenn Model enabled
|
|
157
|
+
// if (model.enabled)
|
|
158
|
+
out.push(inst);
|
|
159
|
+
}
|
|
160
|
+
this._recreateOnNextEmit = false;
|
|
161
|
+
this._cachedLayers = out;
|
|
162
|
+
this._dirty = false;
|
|
163
|
+
return this._cachedLayers;
|
|
164
|
+
}
|
|
165
|
+
destroy() {
|
|
166
|
+
this._instances.forEach(l => l.finalize?.());
|
|
167
|
+
this.clear();
|
|
168
|
+
}
|
|
169
|
+
}
|