@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 @@
|
|
|
1
|
+
import{Build as o}from"@stencil/core/internal/client";const n=!o.isDev,e=(()=>{try{return"undefined"!=typeof location&&new URLSearchParams(location.search).has("vmapDebug")}catch{return!1}})(),r=!n||e||"undefined"!=typeof localStorage&&"1"===localStorage.getItem("@pt9912/v-map:exposeConsoleAPI"),t="@pt9912/v-map:logLevel";function a(){try{if("undefined"!=typeof window&&"localStorage"in window)return window.localStorage}catch{}return null}const c=n?"warn":"debug";let i=function(){const o=a();if(!o)return null;const n=o.getItem(t);return!n||"none"!==n&&"error"!==n&&"warn"!==n&&"info"!==n&&"debug"!==n?null:n}()??c,l=new class{log(o,n,e){const r=e?`[${e}]`:void 0,t=[...n];if("debug"===o||"warn"===o||"error"===o){const n="debug"===o||"warn"===o||"error"===o?(new Error).stack?.split("\n")[4]?.trim():null;n&&t.push(`${n}`)}switch(o){case"debug":case"info":r?console.log(r,...t):console.log(...t);break;case"warn":r?console.warn(r,...t):console.warn(...t);break;case"error":r?console.error(r,...t):console.error(...t)}}};function s(o,n,e){(function(o){const n={none:0,error:1,warn:2,info:3,debug:4};return n[o]<=n[i]})(o)&&l.log(o,n,e)}const u=(...o)=>s("debug",o),d=(...o)=>s("warn",o),f=(...o)=>s("error",o);if(r&&"undefined"!=typeof globalThis){const o=globalThis;o.setLogLevel=function(o){i=o,function(o){const n=a();if(n)try{n.setItem(t,o)}catch{}}(o)},o.getLogLevel=function(){return i},o.log=(...o)=>u(...o),o.info=(...o)=>((...o)=>s("info",o))(...o),o.warn=(...o)=>d(...o),o.error=(...o)=>f(...o)}const p={Error:"vmap-error",MapProviderReady:"map-provider-ready",MapProviderWillShutdown:"map-provider-will-shutdown",MapMouseMove:"map-mousemove"};export{p as V,f as e,u as l,d as w}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{w as t,l as e}from"./events.js";const r={grayscale:[{value:0,color:[0,0,0]},{value:1,color:[255,255,255]}],viridis:[{value:0,color:[68,1,84]},{value:.25,color:[59,82,139]},{value:.5,color:[33,145,140]},{value:.75,color:[94,201,98]},{value:1,color:[253,231,37]}],terrain:[{value:0,color:[0,128,0]},{value:.25,color:[139,195,74]},{value:.5,color:[255,235,59]},{value:.75,color:[255,152,0]},{value:1,color:[255,255,255]}],turbo:[{value:0,color:[48,18,59]},{value:.2,color:[33,102,172]},{value:.4,color:[68,190,112]},{value:.6,color:[253,231,37]},{value:.8,color:[234,51,35]},{value:1,color:[122,4,3]}],rainbow:[{value:0,color:[148,0,211]},{value:.2,color:[0,0,255]},{value:.4,color:[0,255,0]},{value:.6,color:[255,255,0]},{value:.8,color:[255,127,0]},{value:1,color:[255,0,0]}]};function n(t,e){const r=Math.max(0,Math.min(1,t));if(0===e.length)return[0,0,0];if(1===e.length)return e[0].color;let n=0,a=e.length-1;if(r<=e[n].value)return e[n].color;if(r>=e[a].value)return e[a].color;for(;a-n>1;){const t=Math.floor((n+a)/2);e[t].value<=r?n=t:a=t}const i=e[n],o=e[a],s=(r-i.value)/(o.value-i.value);return[Math.round(i.color[0]+s*(o.color[0]-i.color[0])),Math.round(i.color[1]+s*(o.color[1]-i.color[1])),Math.round(i.color[2]+s*(o.color[2]-i.color[2]))]}function a(e,n){if("string"==typeof e){const n=r[e];return n?{stops:n}:(t(`Unknown colormap: ${e}, using grayscale`),{stops:r.grayscale})}return function(e,n){const a=e.colorMapEntries||[];if(0===a.length)return t("GeoStyler ColorMap has no entries, using grayscale"),{stops:r.grayscale};const i=a.map((t=>t.quantity)).filter((t=>"number"==typeof t));let o,s;n?[o,s]=n:i.length>0?(o=Math.min(...i),s=Math.max(...i)):(o=0,s=1),s===o&&(s=o+1);const l=a.map((e=>{const r=(("number"==typeof e.quantity?e.quantity:0)-o)/(s-o),n=function(e){let r=e.trim();if(r.startsWith("#")&&(r=r.slice(1)),3===r.length&&(r=r.split("").map((t=>t+t)).join("")),6!==r.length)return t(`Invalid hex color: ${e}, using black`),[0,0,0];const n=parseInt(r.slice(0,2),16),a=parseInt(r.slice(2,4),16),i=parseInt(r.slice(4,6),16);return isNaN(n)||isNaN(a)||isNaN(i)?(t(`Invalid hex color: ${e}, using black`),[0,0,0]):[n,a,i]}("string"==typeof e.color?e.color:String(e.color));return{value:Math.max(0,Math.min(1,r)),color:n}}));return l.sort(((t,e)=>t.value-e.value)),{stops:l,computedRange:n?void 0:[o,s]}}(e,n)}class i{min;max;constructor(t,e){this.min=t,this.max=e}contains(t){return t.x>=this.min.x&&t.x<=this.max.x&&t.y>=this.min.y&&t.y<=this.max.y}static fromTriangle(t){const e=Math.min(t.a.x,t.b.x,t.c.x),r=Math.min(t.a.y,t.b.y,t.c.y),n=Math.max(t.a.x,t.b.x,t.c.x),a=Math.max(t.a.y,t.b.y,t.c.y);return new i({x:e,y:r},{x:n,y:a})}static union(t,e){return new i({x:Math.min(t.min.x,e.min.x),y:Math.min(t.min.y,e.min.y)},{x:Math.max(t.max.x,e.max.x),y:Math.max(t.max.y,e.max.y)})}}class o{bbox;triangles;left;right;constructor(t,e=[],r=null,n=null){this.bbox=t,this.triangles=e,this.left=r,this.right=n}static build(t,e=0,r=10){if(t.length<=2||e>=r){let e=i.fromTriangle(t[0]);for(let r=1;r<t.length;r++)e=i.union(e,i.fromTriangle(t[r]));return new o(e,t)}const n=t.map((t=>({x:(t.a.x+t.b.x+t.c.x)/3,y:(t.a.y+t.b.y+t.c.y)/3}))),{min:a,max:s}=n.reduce(((t,e)=>({min:{x:Math.min(t.min.x,e.x),y:Math.min(t.min.y,e.y)},max:{x:Math.max(t.max.x,e.x),y:Math.max(t.max.y,e.y)}})),{min:n[0],max:n[0]}),l=s.x-a.x>s.y-a.y?"x":"y";n.sort(((t,e)=>t[l]-e[l]));const h=Math.floor(n.length/2),u=[],c=[];for(let e=0;e<t.length;e++)(e<h?u:c).push(t[e]);const f=o.build(u,e+1,r),d=o.build(c,e+1,r),M=i.union(f.bbox,d.bbox);return new o(M,[],f,d)}findContainingTriangle(t){if(!this.bbox.contains(t))return null;if(this.triangles.length>0){for(const e of this.triangles)if(o.punktInDreieck2D(t,e))return e;return null}return this.left?.findContainingTriangle(t)||this.right?.findContainingTriangle(t)||null}static punktInDreieck2D(t,e){const{a:r,b:n,c:a}=e,i=a.x-r.x,o=a.y-r.y,s=n.x-r.x,l=n.y-r.y,h=t.x-r.x,u=t.y-r.y,c=i*i+o*o,f=i*s+o*l,d=i*h+o*u,M=s*s+l*l,m=s*h+l*u,g=1/(c*M-f*f),p=(M*d-f*m)*g,y=(c*m-f*d)*g;return p>=0&&y>=0&&p+y<=1}static toTriangle2D(t){return{a:{x:t.target[0][0],y:t.target[0][1]},b:{x:t.target[1][0],y:t.target[1][1]},c:{x:t.target[2][0],y:t.target[2][1]},triangle:t,transform:null}}toString(t=""){const e=this.triangles.length>0;let r=`${t}${e?"LEAF":"NODE"} bbox=[${this.bbox.min.x.toFixed(2)}, ${this.bbox.min.y.toFixed(2)}, ${this.bbox.max.x.toFixed(2)}, ${this.bbox.max.y.toFixed(2)}]`;if(e){const t=this.triangles.map((t=>t.a.x.toFixed(2)+","+t.a.y.toFixed(2)+" "+t.b.x.toFixed(2)+","+t.b.y.toFixed(2)+" "+t.c.x.toFixed(2)+","+t.c.y.toFixed(2))).toString();r+=` triangles=${this.triangles.length} - ${t}`}else r+="\n",this.left&&(r+=`${t}├─ left:\n${this.left.toString(t+"│ ")}`),this.right&&(r+=`${t}└─ right:\n${this.right.toString(t+" ")}`);return r}getStats(){const t={depth:1,nodeCount:1,leafCount:0,triangleCount:this.triangles.length,minTrianglesPerLeaf:1/0,maxTrianglesPerLeaf:0};if(this.triangles.length>0)t.leafCount=1,t.minTrianglesPerLeaf=this.triangles.length,t.maxTrianglesPerLeaf=this.triangles.length;else{if(this.left){const e=this.left.getStats();t.depth=Math.max(t.depth,e.depth+1),t.nodeCount+=e.nodeCount,t.leafCount+=e.leafCount,t.triangleCount+=e.triangleCount,t.minTrianglesPerLeaf=Math.min(t.minTrianglesPerLeaf,e.minTrianglesPerLeaf),t.maxTrianglesPerLeaf=Math.max(t.maxTrianglesPerLeaf,e.maxTrianglesPerLeaf)}if(this.right){const e=this.right.getStats();t.depth=Math.max(t.depth,e.depth+1),t.nodeCount+=e.nodeCount,t.leafCount+=e.leafCount,t.triangleCount+=e.triangleCount,t.minTrianglesPerLeaf=Math.min(t.minTrianglesPerLeaf,e.minTrianglesPerLeaf),t.maxTrianglesPerLeaf=Math.max(t.maxTrianglesPerLeaf,e.maxTrianglesPerLeaf)}}return t}}function s(t,e,r,n,a=10){const[i,o,s,l]=r;let h=1/0,u=1/0,c=-1/0,f=-1/0,d=[0,0],M=[0,0],m=[0,0],g=[0,0];const p=(t,e,r)=>{for(let a=0;a<=r;a++){const i=a/r,o=[t[0]+(e[0]-t[0])*i,t[1]+(e[1]-t[1])*i],[s,l]=n(o);s<h&&(h=s,d=o),l<u&&(u=l,M=o),s>c&&(c=s,m=o),l>f&&(f=l,g=o)}};if(p([i,l],[s,l],a),p([s,l],[s,o],a),p([s,o],[i,o],a),p([i,o],[i,l],a),null!=t&&null!=e){const r=Math.floor((h-t[0])/e);h=t[0]+r*e;const n=Math.floor((u-t[1])/e);u=t[1]+n*e;const a=Math.ceil((c-t[0])/e);c=t[0]+a*e;const i=Math.ceil((f-t[1])/e);f=t[1]+i*e}return{source:{minX:h,minY:u,maxX:c,maxY:f},target:{minX:d[0],minY:M[1],maxX:m[0],maxY:g[1]}}}class l{triangles_=[];transformFn_;errorThresholdSquared_;bvh_=null;bounds;constructor(t,e,r=.5,n=null,a=null,i=10){this.transformFn_=t,this.errorThresholdSquared_=r*r;const[o,l,h,u]=e,c=[o,u],f=[h,u],d=[h,l],M=[o,l],m=s(n,a,e,this.transformFn_,i),g=[m.source.minX,m.source.maxY],p=[m.source.maxX,m.source.maxY],y=[m.source.maxX,m.source.minY],b=[m.source.minX,m.source.minY];this.bounds=m.source,this.addQuad_(c,f,d,M,g,p,y,b,10)}getBounds(){return this.bounds}addQuad_(t,e,r,n,a,i,o,s,l){let h=!1;if(l>0){const l=[(e[0]+r[0])/2,(e[1]+r[1])/2],u=[(r[0]+n[0])/2,(r[1]+n[1])/2],c=[(n[0]+t[0])/2,(n[1]+t[1])/2],f=this.transformFn_([(t[0]+e[0])/2,(t[1]+e[1])/2]),d=this.transformFn_(l),M=this.transformFn_(u),m=this.transformFn_(c),g=[(i[0]+o[0])/2,(i[1]+o[1])/2],p=[(o[0]+s[0])/2,(o[1]+s[1])/2],y=[(s[0]+a[0])/2,(s[1]+a[1])/2],b=this.getSquaredError_(f,[(a[0]+i[0])/2,(a[1]+i[1])/2]),v=this.getSquaredError_(d,g),w=this.getSquaredError_(M,p),S=this.getSquaredError_(m,y);(b>this.errorThresholdSquared_||v>this.errorThresholdSquared_||w>this.errorThresholdSquared_||S>this.errorThresholdSquared_)&&(h=!0)}if(h){const h=[(t[0]+e[0]+r[0]+n[0])/4,(t[1]+e[1]+r[1]+n[1])/4],u=this.transformFn_(h),c=[(t[0]+e[0])/2,(t[1]+e[1])/2],f=[(e[0]+r[0])/2,(e[1]+r[1])/2],d=[(r[0]+n[0])/2,(r[1]+n[1])/2],M=[(n[0]+t[0])/2,(n[1]+t[1])/2],m=this.transformFn_(c),g=this.transformFn_(f),p=this.transformFn_(d),y=this.transformFn_(M),b=l-1;this.addQuad_(t,c,h,M,a,m,u,y,b),this.addQuad_(c,e,f,h,m,i,g,u,b),this.addQuad_(h,f,r,d,u,g,o,p,b),this.addQuad_(M,h,d,n,y,u,p,s,b)}else this.addTriangle_(t,e,n,a,i,s),this.addTriangle_(e,r,n,i,o,s)}addTriangle_(t,e,r,n,a,i){isFinite(n[0])&&isFinite(n[1])&&isFinite(a[0])&&isFinite(a[1])&&isFinite(i[0])&&isFinite(i[1])&&this.triangles_.push({source:[n,a,i],target:[t,e,r]})}getSquaredError_(t,e){const r=t[0]-e[0],n=t[1]-e[1];return r*r+n*n}getTriangles(){return this.triangles_}calculateSourceExtent(){if(0===this.triangles_.length)return null;let t=1/0,e=1/0,r=-1/0,n=-1/0;for(const a of this.triangles_)for(const[i,o]of a.source)i<t&&(t=i),i>r&&(r=i),o<e&&(e=o),o>n&&(n=o);return[t,e,r,n]}buildBVH(){const t=this.triangles_.map(o.toTriangle2D);this.bvh_=o.build(t)}findSourceTriangleForTargetPoint(t,e=null){this.bvh_||this.buildBVH();const r={x:t[0],y:t[1]};if(e?.tri&&o.punktInDreieck2D(r,o.toTriangle2D(e.tri)))return e;const n=this.bvh_.findContainingTriangle(r);return n&&!n.transform&&(n.transform=this.calculateAffineTransform(n.triangle)),n?{tri:n.triangle,transform:n.transform}:null}calculateAffineTransform(t){const[[e,r],[n,a],[i,o]]=t.target,[[s,l],[h,u],[c,f]]=t.source,d=(n-e)*(o-r)-(i-e)*(a-r);if(Math.abs(d)<1e-10)return{a:1,b:0,c:s,d:0,e:1,f:l};const M=((h-s)*(o-r)-(c-s)*(a-r))/d,m=((c-s)*(n-e)-(h-s)*(i-e))/d,g=((u-l)*(o-r)-(f-l)*(a-r))/d,p=((f-l)*(n-e)-(u-l)*(i-e))/d;return{a:M,b:m,c:s-M*e-m*r,d:g,e:p,f:l-g*e-p*r}}applyAffineTransform(t,e,r){return[r.a*t+r.b*e+r.c,r.d*t+r.e*e+r.f]}}function h(e,r){switch(r){case"Uint8Array":return e;case"Uint16Array":return Math.round(e/65535*255);case"Int16Array":return Math.round((e+32768)/65535*255);case"Uint32Array":return Math.round(e/4294967295*255);case"Int32Array":return Math.round((e+2147483648)/4294967295*255);case"Float32Array":case"Float64Array":const n=Math.max(0,Math.min(1,e));return Math.round(255*n);default:return t(`Unknown array type: ${r}, treating as Uint8`),e}}function u(t){return Math.max(0,Math.min(1,t))}function c(t,e,r,a,i,o,s,l,c){const f=Math.round(t)-s,d=Math.round(e)-l;if(f<0||f>=i||d<0||d>=o)return null;const M=d*i+f,m=r.length;if(1===m){const t=r[0][M];if(c){const e=u(t),[r,a,i]=n(e,c);return[r,a,i,255]}{const e=h(t,a);return[e,e,e,255]}}return 3===m?[h(r[0][M],a),h(r[1][M],a),h(r[2][M],a),255]:m>=4?[h(r[0][M],a),h(r[1][M],a),h(r[2][M],a),h(r[3][M],a)]:null}function f(t,e,r,a,i,o,s,l,c){const f=t-s,d=e-l;if(f<0||f>=i-1||d<0||d>=o-1)return null;const M=Math.floor(f),m=Math.ceil(f),g=Math.floor(d),p=Math.ceil(d),y=f-M,b=d-g,v=r.length,w=[0,0,0,255];if(1===v){const t=r[0],e=(t[g*i+M]*(1-y)+t[g*i+m]*y)*(1-b)+(t[p*i+M]*(1-y)+t[p*i+m]*y)*b;if(c){const t=u(e),[r,a,i]=n(t,c);return[r,a,i,255]}{const t=h(e,a);return[t,t,t,255]}}{const t=Math.min(v,4);for(let e=0;e<t;e++){const t=r[e];w[e]=h((t[g*i+M]*(1-y)+t[g*i+m]*y)*(1-b)+(t[p*i+M]*(1-y)+t[p*i+m]*y)*b,a)}}return w}class d{config;worldSize=40075016.686;globalTriangulation;constructor(t){this.config=t,t.worldSize&&(this.worldSize=t.worldSize)}createGlobalTriangulation(){const t=performance.now(),[r,n,a,i]=this.config.sourceBounds,{source:o}=s(null,null,[r,n,a,i],(t=>this.config.transformSourceMapToViewFn(t))),h=[o.minX,o.minY,o.maxX,o.maxY];e("Creating global triangulation for bounds:",{source:this.config.sourceBounds,mercator:h});const u=this.config.resolution/2,c=Math.min(10,Math.max(this.config.imageWidth,this.config.imageHeight)/256);this.globalTriangulation=new l((t=>this.config.transformViewToSourceMapFn(t)),h,u,this.config.sourceRef,this.config.resolution,c),this.globalTriangulation.findSourceTriangleForTargetPoint([0,0]);const f=this.globalTriangulation.getTriangles();e(`Global triangulation created: ${f.length} triangles in ${(performance.now()-t).toFixed(2)}ms`)}getGlobalTriangulation(){return this.globalTriangulation}sanitizeElevationValue(t){return Number.isFinite(t)?void 0!==this.config.noDataValue&&t===this.config.noDataValue?0:t:0}getTileSizeInMeter(t){return this.worldSize/Math.pow(2,t)}getTileBounds(t,e,r){const n=this.getTileSizeInMeter(r),a=-this.worldSize/2+t*n,i=this.worldSize/2-e*n;return[a,i-n,a+n,i]}selectOverviewImage(t,e){const r=this.config.baseImage.getResolution()[0];if(!this.config.overviewImages||0===this.config.overviewImages.length)return{bestImage:this.config.baseImage,bestResolution:r,imageLevel:0};const n=this.getTileSizeInMeter(t)/e,a=[this.config.baseImage,...this.config.overviewImages],i=a[this.config.overviewImages.length],o=r*Math.pow(2,this.config.overviewImages.length);let s=this.config.overviewImages.length,l=o,h=i,u=0,c=r;for(const t of a){if(n/(2*c)<=1){h=t,l=c,s=u;break}u++,c*=2}return{bestImage:h,bestResolution:l,imageLevel:s}}calculateTileSourceBounds(t){const[e,r,n,a]=t,{source:i}=s(this.config.sourceRef,this.config.resolution,[e,r,n,a],this.config.transformViewToSourceMapFn),o=this.config.transformViewToSourceMapFn([e,r]),l=this.config.transformViewToSourceMapFn([n,a]),h=this.config.transformViewToSourceMapFn([e,a]),u=this.config.transformViewToSourceMapFn([n,r]);return{tileSrcWest:Math.min(i.minX,o[0],l[0],h[0],u[0]),tileSrcEast:Math.max(i.maxX,o[0],l[0],h[0],u[0]),tileSrcSouth:Math.min(i.minY,o[1],l[1],h[1],u[1]),tileSrcNorth:Math.max(i.maxY,o[1],l[1],h[1],u[1])}}calculateReadWindow(e,r,n){const[a,i,o,s]=this.config.sourceBounds,l=o-a,h=s-i,{tileSrcWest:u,tileSrcEast:c,tileSrcSouth:f,tileSrcNorth:d}=e,M=Math.floor((u-a)/l*r),m=Math.ceil((c-a)/l*r),g=Math.floor((s-d)/h*n),p=Math.ceil((s-f)/h*n),y=Math.min(r,Math.max(0,M-2)),b=Math.max(0,Math.min(r,m+2)),v=Math.min(n,Math.max(0,g-2)),w=Math.max(0,Math.min(n,p+2)),S=b-y,x=w-v;return S<=0||x<=0?(t("Invalid read window for tile",{readXMin:y,readXMax:b,readYMin:v,readYMax:w,ovWidth:r,ovHeight:n}),null):{readXMin:y,readXMax:b,readYMin:v,readYMax:w,readWidth:S,readHeight:x}}async loadAndConvertRasterData(r,n){const{readXMin:a,readYMin:i,readXMax:o,readYMax:s}=n;let l=null,h=null;for(let t=0;t<=2;t++){try{l=await r.readRasters({window:[a,i,o,s]})}catch(t){h=t}if(null!=l){h=null;break}}if(null!=h)throw e(h),t("Error - readRasters - read window: ",n),h;const u=[];let c="";for(let e=0;e<l.length;e++){const r=l[e];"number"!=typeof r?(u.push(r),0===e&&(c=r.constructor.name)):t("Unexpected number in rasters array")}return{rasterBands:u,arrayType:c}}renderTilePixels(t){const{sampleSize:e,mercatorBounds:r,triangulation:n,rasterBands:a,arrayType:i,readWindow:o,ovWidth:s,ovHeight:l,resampleMethod:h,colorStops:u}=t,[d,M,m,g]=r,[p,y,b,v]=this.config.sourceBounds,w=b-p,S=v-y,x=new Uint8ClampedArray(e*e*4);let $=null;for(let t=0;t<e;t++)for(let r=0;r<e;r++){const T=4*(t*e+r),P=d+r/e*(m-d),j=g-t/e*(g-M);if($=n.findSourceTriangleForTargetPoint([P,j],$),$){const[t,e]=n.applyAffineTransform(P,j,$.transform);if(t<p||t>b||e<y||e>v)x[T]=0,x[T+1]=0,x[T+2]=0,x[T+3]=0;else{const r=(t-p)/w*s,n=(v-e)/S*l,d="near"===h?c(r,n,a,i,o.readWidth,o.readHeight,o.readXMin,o.readYMin,u):f(r,n,a,i,o.readWidth,o.readHeight,o.readXMin,o.readYMin,u);d?(x[T]=d[0],x[T+1]=d[1],x[T+2]=d[2],x[T+3]=d[3]):(x[T]=0,x[T+1]=0,x[T+2]=0,x[T+3]=0)}}else x[T]=0,x[T+1]=0,x[T+2]=0,x[T+3]=0}return x}tileIntersectsSource(t){const[e,r,n,a]=t,[i,o,s,l]=this.config.sourceBounds,h=this.config.transformViewToSourceMapFn([e,r]),u=this.config.transformViewToSourceMapFn([n,a]),c=this.config.transformViewToSourceMapFn([e,a]),f=this.config.transformViewToSourceMapFn([n,r]),d=Math.min(h[0],u[0],c[0],f[0]),M=Math.max(h[0],u[0],c[0],f[0]),m=Math.min(h[1],u[1],c[1],f[1]),g=Math.max(h[1],u[1],c[1],f[1]);return M>=i&&d<=s&&g>=o&&m<=l}async getTileData(r){const{x:n,y:a,z:i,tileSize:o,resolution:s,resampleMethod:h,colorStops:u}=r,c=this.getTileBounds(n,a,i);if(e(`v-map - geotiff - getTileData(${n},${a},${i}): viewBounds=[${c.map((t=>t.toFixed(0))).join(",")}], sourceBounds=[${this.config.sourceBounds.map((t=>t.toFixed(0))).join(",")}], toProjection=${this.config.toProjection}`),!this.tileIntersectsSource(c)){e(`v-map - geotiff - getTileData(${n},${a},${i}): no intersection, returning transparent`);const t=Math.ceil(o*s);return new Uint8ClampedArray(t*t*4)}const f=Math.ceil(o*s);let d;this.globalTriangulation?d=this.globalTriangulation:(t("Global triangulation not available, creating fallback for tile"),d=new l(this.config.transformViewToSourceMapFn,c,.5));const M=this.calculateTileSourceBounds(c),{bestImage:m,bestResolution:g,imageLevel:p}=this.selectOverviewImage(i,o),y=m.getWidth(),b=m.getHeight(),v=this.calculateReadWindow(M,y,b);if(!v)return new Uint8ClampedArray(f*f*4);const{rasterBands:w,arrayType:S}=await this.loadAndConvertRasterData(m,v);return e(`Read window: [${v.readXMin}, ${v.readYMin}, ${v.readXMax}, ${v.readYMax}] (${v.readWidth}x${v.readHeight} pixels), ${w.length} bands, type: ${S}, imageLevel: ${p}, resolution: ${g}`),this.renderTilePixels({sampleSize:f,mercatorBounds:c,triangulation:d,rasterBands:w,arrayType:S,readWindow:v,ovWidth:y,ovHeight:b,resampleMethod:h,colorStops:u})}async getElevationData(e){const{x:r,y:n,z:a,tileSize:i}=e,o=i+1,s=this.getTileBounds(r,n,a);if(!this.tileIntersectsSource(s))return new Float32Array(o*o);let h;this.globalTriangulation?h=this.globalTriangulation:(t("Global triangulation not available, creating fallback for elevation tile"),h=new l(this.config.transformViewToSourceMapFn,s,.5));const u=this.calculateTileSourceBounds(s),{bestImage:c}=this.selectOverviewImage(a,i),f=c.getWidth(),d=c.getHeight(),M=this.calculateReadWindow(u,f,d);if(!M)return new Float32Array(o*o);const{rasterBands:m}=await this.loadAndConvertRasterData(c,M),[g,p,y,b]=s,[v,w,S,x]=this.config.sourceBounds,$=S-v,T=x-w,P=new Float32Array(o*o);let j=null;for(let t=0;t<i;t++)for(let e=0;e<i;e++){const r=g+e/i*(y-g),n=b-t/i*(b-p);if(j=h.findSourceTriangleForTargetPoint([r,n],j),j){const[a,i]=h.applyAffineTransform(r,n,j.transform);if(a>=v&&a<=S&&i>=w&&i<=x){const r=(x-i)/T*d,n=Math.round((a-v)/$*f)-M.readXMin,s=Math.round(r)-M.readYMin;if(n>=0&&n<M.readWidth&&s>=0&&s<M.readHeight){const r=Number(m[0][s*M.readWidth+n]);P[t*o+e]=this.sanitizeElevationValue(r)}}}}for(let t=0;t<i;t++)P[t*o+i]=P[t*o+i-1];for(let t=0;t<=i;t++)P[i*o+t]=P[(i-1)*o+t];return P}}async function M(t,e){const{default:r}=await import("./index4.js");return{transformViewToSourceMapFn:n=>{const a=r(e,t.fromProjection,n);return[Number(a[0]),Number(a[1])]},transformSourceMapToViewFn:n=>{const a=r(t.fromProjection,e,n);return[Number(a[0]),Number(a[1])]},sourceBounds:t.sourceBounds,sourceRef:t.sourceRef,resolution:t.resolution,imageWidth:t.width,imageHeight:t.height,fromProjection:t.fromProjection,toProjection:e,baseImage:t.baseImage,overviewImages:t.overviewImages??[],noDataValue:t.noDataValue}}async function m(r,n,a){const{geotiff:i,proj4:o,geokeysToProj4:s}=a,{fromUrl:l}=i,{toProj4:h}=s;let u=null,c=null;for(let t=0;t<=2;t++){try{u=await l(r,{allowFullFile:!0,blockSize:1048576,cacheSize:100})}catch(t){c=t}if(null!=u){c=null;break}}if(null!=c)throw e(c),t("Error - loadGeoTIFFSource - fromUrl: ",r),c;const f=await u.getImage(0),d=await u.getImageCount(),M=[];for(let t=1;t<d;t++)M.push(await u.getImage(t));const m=f.getWidth(),g=f.getHeight(),p=Math.max(1,f.getSamplesPerPixel?.()??1);let y=n.forceProjection&&n.projection?n.projection:n.projection??"EPSG:4326",b=null;if(!n.forceProjection){const e="function"==typeof f.getGeoKeys?f.getGeoKeys()??null:null;if(e)try{const t=h(e),r=e.ProjectedCSTypeGeoKey??e.GeographicTypeGeoKey;if(r&&(y=`EPSG:${r}`),t?.proj4){b=t.proj4;const e=String(r);r&&!o.defs(y)&&o.defs(y,t.proj4),r&&!o.defs(e)&&o.defs(e,t.proj4)}}catch(e){t("v-map - geotiff - failed to parse GeoKeys",e)}}if(!b)switch(y){case"EPSG:4326":b="+proj=longlat +datum=WGS84 +no_defs";break;case"EPSG:3857":b="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs";break;case"EPSG:32632":b="+proj=utm +zone=32 +datum=WGS84 +units=m +no_defs"}y&&""!==y.trim()||(y="EPSG:4326"),b&&!o.defs(y)&&o.defs(y,b);const v=f.getBoundingBox(),w=[v[0],v[1]],S=f.getResolution()[0],x=null!=n.nodata?Number(n.nodata):"function"==typeof f.getGDALNoData?f.getGDALNoData():void 0,$=null!=x?Number(x):void 0,T=t=>Math.max(-180,Math.min(180,Number.isFinite(t)?t:0)),P=t=>Math.max(-90,Math.min(90,Number.isFinite(t)?t:0));let j;j=y&&"EPSG:4326"!==y?e=>{try{const t=o(y,"EPSG:4326",e);return[Number(t[0]),Number(t[1])]}catch(r){return t("v-map - geotiff - transform to WGS84 failed, falling back",r),e}}:t=>t;const[I,N,F,G]=v,k=[j([I,N]),j([F,N]),j([F,G]),j([I,G])],E=T(Math.min(...k.map((t=>t[0])))),A=T(Math.max(...k.map((t=>t[0])))),B=P(Math.min(...k.map((t=>t[1])))),W=P(Math.max(...k.map((t=>t[1]))));return e("v-map - geotiff - loaded source",{url:r,width:m,height:g,samplesPerPixel:p,fromProjection:y,bounds:v}),{tiff:u,baseImage:f,overviewImages:M,width:m,height:g,samplesPerPixel:p,fromProjection:y,sourceBounds:v,sourceRef:w,resolution:S,proj4:o,noDataValue:$,wgs84Bounds:[E,B,A,W],transformToWgs84:j}}async function g(t,e,r,n){const[a,{default:i},o]=await Promise.all([import("./geotiff.js").then((function(t){return t.g})),import("./index4.js"),import("./main-dist.js").then((function(t){return t.m}))]);return await m(t,{projection:e,forceProjection:r,nodata:n},{geotiff:a,proj4:i,geokeysToProj4:o})}export{d as G,g as a,M as b,a as g,m as l}
|