@honua/react 0.0.20-alpha.0 → 0.1.1-beta.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/contract/discovery.d.ts +231 -0
- package/contract/discovery.d.ts.map +1 -0
- package/contract/discovery.js +554 -0
- package/contract/edit-sketch.d.ts +8 -0
- package/contract/edit-sketch.d.ts.map +1 -1
- package/contract/edit-sketch.js +15 -0
- package/contract/edit-snapping.d.ts +160 -0
- package/contract/edit-snapping.d.ts.map +1 -0
- package/contract/edit-snapping.js +675 -0
- package/contract/generated/projjson-v0.7-crs-validator.d.ts +35 -0
- package/contract/generated/projjson-v0.7-crs-validator.d.ts.map +1 -0
- package/contract/generated/projjson-v0.7-crs-validator.js +3941 -0
- package/contract/index.d.ts +12 -1
- package/contract/index.d.ts.map +1 -1
- package/contract/index.js +4 -0
- package/contract/pmtiles.d.ts +193 -0
- package/contract/pmtiles.d.ts.map +1 -0
- package/contract/pmtiles.js +195 -0
- package/contract/protocol-module.d.ts +70 -0
- package/contract/protocol-module.d.ts.map +1 -0
- package/contract/protocol-module.js +1 -0
- package/contract/schema-envelope.d.ts +26 -0
- package/contract/schema-envelope.d.ts.map +1 -0
- package/contract/schema-envelope.js +25 -0
- package/contract/schema.d.ts +582 -0
- package/contract/schema.d.ts.map +1 -0
- package/contract/schema.js +2483 -0
- package/contract/source-capability-support.d.ts +6 -0
- package/contract/source-capability-support.d.ts.map +1 -0
- package/contract/source-capability-support.js +154 -0
- package/contract/source.d.ts +57 -15
- package/contract/source.d.ts.map +1 -1
- package/contract/source.js +368 -65
- package/contract/types.d.ts +171 -6
- package/contract/types.d.ts.map +1 -1
- package/contract/types.js +14 -14
- package/core/auth/client-credentials-provider.d.ts +51 -0
- package/core/auth/client-credentials-provider.d.ts.map +1 -0
- package/core/auth/client-credentials-provider.js +115 -0
- package/core/auth/credential-store.d.ts +52 -0
- package/core/auth/credential-store.d.ts.map +1 -0
- package/core/auth/credential-store.js +82 -0
- package/core/auth/index.d.ts +23 -0
- package/core/auth/index.d.ts.map +1 -0
- package/core/auth/index.js +20 -0
- package/core/auth/oauth2-provider.d.ts +114 -0
- package/core/auth/oauth2-provider.d.ts.map +1 -0
- package/core/auth/oauth2-provider.js +408 -0
- package/core/auth/pkce.d.ts +25 -0
- package/core/auth/pkce.d.ts.map +1 -0
- package/core/auth/pkce.js +46 -0
- package/core/auth/static-providers.d.ts +20 -0
- package/core/auth/static-providers.d.ts.map +1 -0
- package/core/auth/static-providers.js +26 -0
- package/core/auth/token-endpoint.d.ts +40 -0
- package/core/auth/token-endpoint.d.ts.map +1 -0
- package/core/auth/token-endpoint.js +133 -0
- package/core/auth/types.d.ts +144 -0
- package/core/auth/types.d.ts.map +1 -0
- package/core/auth/types.js +8 -0
- package/core/bounded-json.d.ts +4 -0
- package/core/bounded-json.d.ts.map +1 -0
- package/core/bounded-json.js +38 -0
- package/core/cache-state.d.ts +9 -0
- package/core/cache-state.d.ts.map +1 -1
- package/core/cache-state.js +10 -0
- package/core/capabilities-xml.d.ts +33 -0
- package/core/capabilities-xml.d.ts.map +1 -0
- package/core/capabilities-xml.js +331 -0
- package/core/client.d.ts +35 -2
- package/core/client.d.ts.map +1 -1
- package/core/client.js +167 -29
- package/core/error-classifications.d.ts +153 -0
- package/core/error-classifications.d.ts.map +1 -0
- package/core/error-classifications.js +140 -0
- package/core/error-code-registry.d.ts +158 -0
- package/core/error-code-registry.d.ts.map +1 -0
- package/core/error-code-registry.js +143 -0
- package/core/error-envelope.d.ts +68 -0
- package/core/error-envelope.d.ts.map +1 -0
- package/core/error-envelope.js +357 -0
- package/core/errors.d.ts +73 -25
- package/core/errors.d.ts.map +1 -1
- package/core/errors.js +113 -46
- package/core/geoparquet-sql.d.ts +190 -0
- package/core/geoparquet-sql.d.ts.map +1 -0
- package/core/geoparquet-sql.js +368 -0
- package/core/odata-key-path.d.ts +12 -0
- package/core/odata-key-path.d.ts.map +1 -0
- package/core/odata-key-path.js +28 -0
- package/core/odata-write-codec.d.ts +66 -0
- package/core/odata-write-codec.d.ts.map +1 -0
- package/core/odata-write-codec.js +1083 -0
- package/core/odata.d.ts +59 -7
- package/core/odata.d.ts.map +1 -1
- package/core/odata.js +431 -99
- package/core/ogc-endpoint-layout.d.ts +70 -0
- package/core/ogc-endpoint-layout.d.ts.map +1 -0
- package/core/ogc-endpoint-layout.js +173 -0
- package/core/ogc-features.d.ts.map +1 -1
- package/core/ogc-features.js +35 -17
- package/core/ogc-maps.d.ts +7 -0
- package/core/ogc-maps.d.ts.map +1 -1
- package/core/ogc-maps.js +46 -7
- package/core/ogc-processes.d.ts +2 -1
- package/core/ogc-processes.d.ts.map +1 -1
- package/core/ogc-processes.js +33 -5
- package/core/ogc-records.d.ts +9 -0
- package/core/ogc-records.d.ts.map +1 -1
- package/core/ogc-records.js +78 -29
- package/core/ogc-tiles.d.ts +10 -1
- package/core/ogc-tiles.d.ts.map +1 -1
- package/core/ogc-tiles.js +56 -17
- package/core/path-utils.d.ts +9 -0
- package/core/path-utils.d.ts.map +1 -1
- package/core/path-utils.js +19 -0
- package/core/protocol-transport.d.ts +1 -0
- package/core/protocol-transport.d.ts.map +1 -1
- package/core/request-pipeline.d.ts.map +1 -1
- package/core/request-pipeline.js +1 -1
- package/core/spatial-filter.d.ts +8 -4
- package/core/spatial-filter.d.ts.map +1 -1
- package/core/spatial-filter.js +206 -16
- package/core/stac-static.d.ts +55 -0
- package/core/stac-static.d.ts.map +1 -0
- package/core/stac-static.js +386 -0
- package/core/stac.d.ts +12 -0
- package/core/stac.d.ts.map +1 -1
- package/core/stac.js +45 -15
- package/core/surfaces.d.ts +13 -0
- package/core/surfaces.d.ts.map +1 -1
- package/core/surfaces.js +127 -16
- package/core/types.d.ts +174 -7
- package/core/types.d.ts.map +1 -1
- package/core/wfs-capabilities.d.ts +12 -0
- package/core/wfs-capabilities.d.ts.map +1 -1
- package/core/wfs-capabilities.js +22 -3
- package/core/wfs.d.ts +13 -0
- package/core/wfs.d.ts.map +1 -1
- package/core/wfs.js +35 -5
- package/core/wms-capabilities.d.ts +56 -84
- package/core/wms-capabilities.d.ts.map +1 -1
- package/core/wms-capabilities.js +212 -509
- package/core/wmts-capabilities.d.ts +62 -62
- package/core/wmts-capabilities.d.ts.map +1 -1
- package/core/wmts-capabilities.js +224 -371
- package/esri-compat/editor.d.ts +8 -0
- package/esri-compat/editor.d.ts.map +1 -1
- package/esri-compat/editor.js +13 -0
- package/esri-compat/feature-layer.d.ts +2 -0
- package/esri-compat/feature-layer.d.ts.map +1 -1
- package/esri-compat/feature-layer.js +1 -0
- package/esri-compat/identity-manager.d.ts +43 -0
- package/esri-compat/identity-manager.d.ts.map +1 -1
- package/esri-compat/identity-manager.js +131 -1
- package/esri-compat/layer-list.d.ts +11 -0
- package/esri-compat/layer-list.d.ts.map +1 -1
- package/esri-compat/layer-list.js +49 -0
- package/esri-compat/legend.d.ts +10 -0
- package/esri-compat/legend.d.ts.map +1 -1
- package/esri-compat/legend.js +27 -0
- package/esri-compat/oauth-info.d.ts +15 -0
- package/esri-compat/oauth-info.d.ts.map +1 -1
- package/esri-compat/oauth-info.js +27 -0
- package/esri-compat/portal.d.ts +197 -0
- package/esri-compat/portal.d.ts.map +1 -0
- package/esri-compat/portal.js +251 -0
- package/esri-compat/renderer-objects.d.ts +40 -0
- package/esri-compat/renderer-objects.d.ts.map +1 -0
- package/esri-compat/renderer-objects.js +62 -0
- package/esri-compat/sketch.d.ts +43 -0
- package/esri-compat/sketch.d.ts.map +1 -1
- package/esri-compat/sketch.js +46 -0
- package/esri-compat/snapping.d.ts +43 -0
- package/esri-compat/snapping.d.ts.map +1 -0
- package/esri-compat/snapping.js +45 -0
- package/esri-compat/url.d.ts.map +1 -1
- package/esri-compat/url.js +1 -1
- package/esri-compat/widget-host.d.ts +84 -0
- package/esri-compat/widget-host.d.ts.map +1 -0
- package/esri-compat/widget-host.js +159 -0
- package/filter-registry/index.d.ts +145 -0
- package/filter-registry/index.d.ts.map +1 -0
- package/filter-registry/index.js +531 -0
- package/generated-app/errors.d.ts +18 -2
- package/generated-app/errors.d.ts.map +1 -1
- package/generated-app/errors.js +44 -11
- package/map/automatic-mount-integration.d.ts +134 -0
- package/map/automatic-mount-integration.d.ts.map +1 -0
- package/map/automatic-mount-integration.js +305 -0
- package/map/automatic-source-strategy.d.ts +125 -0
- package/map/automatic-source-strategy.d.ts.map +1 -0
- package/map/automatic-source-strategy.js +494 -0
- package/map/data-to-map-bridge.d.ts +293 -0
- package/map/data-to-map-bridge.d.ts.map +1 -0
- package/map/data-to-map-bridge.js +817 -0
- package/map/geojson-projection.d.ts +33 -0
- package/map/geojson-projection.d.ts.map +1 -0
- package/map/geojson-projection.js +118 -0
- package/map/index.d.ts +14 -0
- package/map/index.d.ts.map +1 -1
- package/map/index.js +8 -0
- package/map/raster-source-spec.d.ts +30 -0
- package/map/raster-source-spec.d.ts.map +1 -0
- package/map/raster-source-spec.js +190 -0
- package/map/raster-source-strategy.d.ts +65 -0
- package/map/raster-source-strategy.d.ts.map +1 -0
- package/map/raster-source-strategy.js +232 -0
- package/map/source-to-maplibre.d.ts +91 -0
- package/map/source-to-maplibre.d.ts.map +1 -0
- package/map/source-to-maplibre.js +454 -0
- package/map/temporal-playback.d.ts +139 -0
- package/map/temporal-playback.d.ts.map +1 -0
- package/map/temporal-playback.js +247 -0
- package/package.json +19 -1
- package/query-planner/canonical.d.ts +7 -0
- package/query-planner/canonical.d.ts.map +1 -0
- package/query-planner/canonical.js +145 -0
- package/query-planner/cql2-json.d.ts +17 -0
- package/query-planner/cql2-json.d.ts.map +1 -0
- package/query-planner/cql2-json.js +646 -0
- package/query-planner/diagnostics.d.ts +35 -0
- package/query-planner/diagnostics.d.ts.map +1 -0
- package/query-planner/diagnostics.js +373 -0
- package/query-planner/duckdb.d.ts +79 -0
- package/query-planner/duckdb.d.ts.map +1 -0
- package/query-planner/duckdb.js +758 -0
- package/query-planner/execution-context.d.ts +5 -0
- package/query-planner/execution-context.d.ts.map +1 -0
- package/query-planner/execution-context.js +50 -0
- package/query-planner/executor.d.ts +5 -0
- package/query-planner/executor.d.ts.map +1 -0
- package/query-planner/executor.js +223 -0
- package/query-planner/geoservices.d.ts +91 -0
- package/query-planner/geoservices.d.ts.map +1 -0
- package/query-planner/geoservices.js +667 -0
- package/query-planner/grpc.d.ts +100 -0
- package/query-planner/grpc.d.ts.map +1 -0
- package/query-planner/grpc.js +736 -0
- package/query-planner/index.d.ts +44 -0
- package/query-planner/index.d.ts.map +1 -0
- package/query-planner/index.js +30 -0
- package/query-planner/ir.d.ts +20 -0
- package/query-planner/ir.d.ts.map +1 -0
- package/query-planner/ir.js +417 -0
- package/query-planner/local-aggregate.d.ts +5 -0
- package/query-planner/local-aggregate.d.ts.map +1 -0
- package/query-planner/local-aggregate.js +126 -0
- package/query-planner/odata.d.ts +48 -0
- package/query-planner/odata.d.ts.map +1 -0
- package/query-planner/odata.js +662 -0
- package/query-planner/ogc-compiler.d.ts +55 -0
- package/query-planner/ogc-compiler.d.ts.map +1 -0
- package/query-planner/ogc-compiler.js +480 -0
- package/query-planner/ogc-features.d.ts +53 -0
- package/query-planner/ogc-features.d.ts.map +1 -0
- package/query-planner/ogc-features.js +617 -0
- package/query-planner/planner.d.ts +17 -0
- package/query-planner/planner.d.ts.map +1 -0
- package/query-planner/planner.js +818 -0
- package/query-planner/resource.d.ts +94 -0
- package/query-planner/resource.d.ts.map +1 -0
- package/query-planner/resource.js +526 -0
- package/query-planner/semantic-canonical.d.ts +15 -0
- package/query-planner/semantic-canonical.d.ts.map +1 -0
- package/query-planner/semantic-canonical.js +62 -0
- package/query-planner/semantic-compat.d.ts +10 -0
- package/query-planner/semantic-compat.d.ts.map +1 -0
- package/query-planner/semantic-compat.js +35 -0
- package/query-planner/semantic-compiler.d.ts +64 -0
- package/query-planner/semantic-compiler.d.ts.map +1 -0
- package/query-planner/semantic-compiler.js +81 -0
- package/query-planner/semantic-literals.d.ts +30 -0
- package/query-planner/semantic-literals.d.ts.map +1 -0
- package/query-planner/semantic-literals.js +133 -0
- package/query-planner/semantic-types.d.ts +265 -0
- package/query-planner/semantic-types.d.ts.map +1 -0
- package/query-planner/semantic-types.js +1 -0
- package/query-planner/semantic.d.ts +54 -0
- package/query-planner/semantic.d.ts.map +1 -0
- package/query-planner/semantic.js +1421 -0
- package/query-planner/types.d.ts +560 -0
- package/query-planner/types.d.ts.map +1 -0
- package/query-planner/types.js +49 -0
- package/query-planner/wfs-semantic.d.ts +58 -0
- package/query-planner/wfs-semantic.d.ts.map +1 -0
- package/query-planner/wfs-semantic.js +547 -0
- package/query-planner/wfs.d.ts +6 -0
- package/query-planner/wfs.d.ts.map +1 -0
- package/query-planner/wfs.js +71 -0
- package/react/external-map.d.ts +67 -0
- package/react/external-map.d.ts.map +1 -0
- package/react/external-map.js +63 -0
- package/react/honua-map.d.ts.map +1 -1
- package/react/honua-map.js +3 -2
- package/react/honua-source-layer.d.ts +110 -0
- package/react/honua-source-layer.d.ts.map +1 -0
- package/react/honua-source-layer.js +101 -0
- package/react/hooks.d.ts +28 -0
- package/react/hooks.d.ts.map +1 -1
- package/react/hooks.js +26 -4
- package/react/index.d.ts +8 -0
- package/react/index.d.ts.map +1 -1
- package/react/index.js +5 -0
- package/react/query-cache.d.ts +26 -4
- package/react/query-cache.d.ts.map +1 -1
- package/react/query-cache.js +51 -8
- package/react/selection.d.ts +177 -0
- package/react/selection.d.ts.map +1 -0
- package/react/selection.js +0 -0
- package/react/use-mounted-source.d.ts +69 -0
- package/react/use-mounted-source.d.ts.map +1 -0
- package/react/use-mounted-source.js +346 -0
- package/runtime/edit-snapping.d.ts +107 -0
- package/runtime/edit-snapping.d.ts.map +1 -0
- package/runtime/edit-snapping.js +190 -0
- package/runtime/errors.d.ts +3 -2
- package/runtime/errors.d.ts.map +1 -1
- package/runtime/errors.js +19 -2
- package/runtime/index.d.ts +8 -2
- package/runtime/index.d.ts.map +1 -1
- package/runtime/index.js +4 -4
- package/runtime/load-package.d.ts.map +1 -1
- package/runtime/load-package.js +8 -0
- package/runtime/map-package-validation.d.ts +0 -13
- package/runtime/map-package-validation.d.ts.map +1 -1
- package/runtime/map-package-validation.js +0 -12
- package/runtime/map-package.d.ts +1 -1
- package/runtime/map-package.d.ts.map +1 -1
- package/runtime/maplibre-renderer.d.ts +41 -0
- package/runtime/maplibre-renderer.d.ts.map +1 -0
- package/runtime/maplibre-renderer.js +322 -0
- package/runtime/pmtiles-protocol.d.ts +77 -0
- package/runtime/pmtiles-protocol.d.ts.map +1 -0
- package/runtime/pmtiles-protocol.js +120 -0
- package/runtime/query-tiles.d.ts +2 -1
- package/runtime/query-tiles.d.ts.map +1 -1
- package/runtime/query-tiles.js +6 -2
- package/runtime/source-bridge.d.ts +4 -4
- package/runtime/source-bridge.d.ts.map +1 -1
- package/runtime/source-bridge.js +36 -56
- package/runtime/style-interactions.d.ts +3 -2
- package/runtime/style-interactions.d.ts.map +1 -1
- package/runtime/style-interactions.js +11 -3
- package/runtime/terra-draw-sketch.d.ts +275 -0
- package/runtime/terra-draw-sketch.d.ts.map +1 -0
- package/runtime/terra-draw-sketch.js +404 -0
- package/source-capability-registry.d.ts +1 -0
- package/source-capability-registry.js +1 -0
- package/source-capability-types.d.ts +186 -0
- package/source-capability-types.js +7 -0
- package/style/index.d.ts +2 -0
- package/style/index.d.ts.map +1 -1
- package/style/index.js +2 -0
- package/style/renderers.d.ts +326 -0
- package/style/renderers.d.ts.map +1 -0
- package/style/renderers.js +517 -0
- package/webmap/convert-renderer.d.ts +24 -3
- package/webmap/convert-renderer.d.ts.map +1 -1
- package/webmap/convert-renderer.js +93 -112
- package/webmap/index.d.ts +1 -1
- package/webmap/index.d.ts.map +1 -1
- package/webmap/index.js +1 -1
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auto-registration of the MapLibre `pmtiles://` protocol.
|
|
3
|
+
*
|
|
4
|
+
* MapLibre GL JS resolves a source `url` of `pmtiles://https://…` by calling a
|
|
5
|
+
* protocol handler registered through `maplibregl.addProtocol("pmtiles", …)`.
|
|
6
|
+
* The `pmtiles` package supplies that handler via its `Protocol` class. This
|
|
7
|
+
* module wires the two together **lazily and idempotently**: the `pmtiles` and
|
|
8
|
+
* `maplibre-gl` packages are only pulled in (`await import(...)`) the first time
|
|
9
|
+
* a PMTiles-backed map is loaded, and registration happens exactly once no
|
|
10
|
+
* matter how many maps attach (MapLibre's protocol registry is process-global,
|
|
11
|
+
* and the `pmtiles.Protocol` instance caches every archive it opens).
|
|
12
|
+
*
|
|
13
|
+
* `loadMapPackage` calls {@link ensurePmtilesProtocol} before `map.setStyle`
|
|
14
|
+
* whenever the composed style references a `pmtiles://` source, so consumers get
|
|
15
|
+
* PMTiles rendering out-of-the-box with no manual `addProtocol` wiring. Adding a
|
|
16
|
+
* PMTiles source to a live map through `runtime.addSource` is synchronous — call
|
|
17
|
+
* {@link ensurePmtilesProtocol} yourself beforehand in that case.
|
|
18
|
+
*
|
|
19
|
+
* The `maplibre-gl` / `pmtiles` slices are injectable so the wiring is
|
|
20
|
+
* unit-testable without either real package.
|
|
21
|
+
*
|
|
22
|
+
* @module
|
|
23
|
+
*/
|
|
24
|
+
/** The MapLibre `addProtocol` / `removeProtocol` surface this module drives. */
|
|
25
|
+
export interface MaplibreProtocolRegistrar {
|
|
26
|
+
addProtocol(scheme: string, handler: unknown): void;
|
|
27
|
+
removeProtocol?(scheme: string): void;
|
|
28
|
+
}
|
|
29
|
+
/** The `pmtiles.Protocol` surface this module drives. */
|
|
30
|
+
export interface PmtilesProtocolLike {
|
|
31
|
+
readonly tile: unknown;
|
|
32
|
+
}
|
|
33
|
+
/** The minimal slice of `typeof import("pmtiles")` registration needs. */
|
|
34
|
+
export interface PmtilesProtocolModuleLike {
|
|
35
|
+
Protocol: new (options?: {
|
|
36
|
+
metadata?: boolean;
|
|
37
|
+
errorOnMissingTile?: boolean;
|
|
38
|
+
}) => PmtilesProtocolLike;
|
|
39
|
+
}
|
|
40
|
+
/** Injectable dependencies for {@link ensurePmtilesProtocol} (test seams). */
|
|
41
|
+
export interface EnsurePmtilesProtocolDeps {
|
|
42
|
+
/** Override the lazily-imported MapLibre `addProtocol` registrar. */
|
|
43
|
+
readonly maplibre?: MaplibreProtocolRegistrar;
|
|
44
|
+
/** Override the lazily-imported `pmtiles` module. */
|
|
45
|
+
readonly pmtilesModule?: PmtilesProtocolModuleLike;
|
|
46
|
+
/** Protocol scheme to register. Defaults to `"pmtiles"`. */
|
|
47
|
+
readonly scheme?: string;
|
|
48
|
+
}
|
|
49
|
+
/** The default MapLibre protocol scheme PMTiles archives are addressed under. */
|
|
50
|
+
export declare const PMTILES_PROTOCOL_SCHEME = "pmtiles";
|
|
51
|
+
/**
|
|
52
|
+
* Register the `pmtiles://` protocol on MapLibre if it has not been registered
|
|
53
|
+
* already. Idempotent: repeated calls (including from multiple maps loading
|
|
54
|
+
* concurrently) share a single registration and a single in-flight import.
|
|
55
|
+
*
|
|
56
|
+
* Returns once the protocol is registered so callers can `await` it before
|
|
57
|
+
* handing a `pmtiles://`-referencing style to `map.setStyle`.
|
|
58
|
+
*/
|
|
59
|
+
export declare function ensurePmtilesProtocol(deps?: EnsurePmtilesProtocolDeps): Promise<void>;
|
|
60
|
+
/** Whether the `pmtiles://` protocol (or `scheme`) is currently registered. */
|
|
61
|
+
export declare function isPmtilesProtocolRegistered(scheme?: string): boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Tear down a prior {@link ensurePmtilesProtocol} registration. Primarily a test
|
|
64
|
+
* seam so the module-global registration does not leak between cases; also
|
|
65
|
+
* useful if a host wants to fully release the protocol. Best-effort — a
|
|
66
|
+
* registrar without `removeProtocol` just clears the local record.
|
|
67
|
+
*/
|
|
68
|
+
export declare function resetPmtilesProtocol(): void;
|
|
69
|
+
/**
|
|
70
|
+
* Whether a composed MapLibre style references at least one `pmtiles://` source.
|
|
71
|
+
* Used by `loadMapPackage` to decide whether the protocol must be registered
|
|
72
|
+
* before `map.setStyle`.
|
|
73
|
+
*/
|
|
74
|
+
export declare function styleUsesPmtiles(style: {
|
|
75
|
+
sources?: Record<string, unknown>;
|
|
76
|
+
} | null | undefined, scheme?: string): boolean;
|
|
77
|
+
//# sourceMappingURL=pmtiles-protocol.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pmtiles-protocol.d.ts","sourceRoot":"","sources":["../../../src/runtime/pmtiles-protocol.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,gFAAgF;AAChF,MAAM,WAAW,yBAAyB;IACxC,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;IACpD,cAAc,CAAC,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvC;AAED,yDAAyD;AACzD,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;CACxB;AAED,0EAA0E;AAC1E,MAAM,WAAW,yBAAyB;IACxC,QAAQ,EAAE,KAAK,OAAO,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,OAAO,CAAC;QAAC,kBAAkB,CAAC,EAAE,OAAO,CAAA;KAAE,KAAK,mBAAmB,CAAC;CACvG;AAED,8EAA8E;AAC9E,MAAM,WAAW,yBAAyB;IACxC,qEAAqE;IACrE,QAAQ,CAAC,QAAQ,CAAC,EAAE,yBAAyB,CAAC;IAC9C,qDAAqD;IACrD,QAAQ,CAAC,aAAa,CAAC,EAAE,yBAAyB,CAAC;IACnD,4DAA4D;IAC5D,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,iFAAiF;AACjF,eAAO,MAAM,uBAAuB,YAAY,CAAC;AAmCjD;;;;;;;GAOG;AACH,wBAAsB,qBAAqB,CAAC,IAAI,GAAE,yBAA8B,GAAG,OAAO,CAAC,IAAI,CAAC,CAoB/F;AAED,+EAA+E;AAC/E,wBAAgB,2BAA2B,CAAC,MAAM,GAAE,MAAgC,GAAG,OAAO,CAE7F;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,IAAI,IAAI,CAM3C;AAcD;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,GAAG,IAAI,GAAG,SAAS,EAC/D,MAAM,GAAE,MAAgC,GACvC,OAAO,CAOT"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auto-registration of the MapLibre `pmtiles://` protocol.
|
|
3
|
+
*
|
|
4
|
+
* MapLibre GL JS resolves a source `url` of `pmtiles://https://…` by calling a
|
|
5
|
+
* protocol handler registered through `maplibregl.addProtocol("pmtiles", …)`.
|
|
6
|
+
* The `pmtiles` package supplies that handler via its `Protocol` class. This
|
|
7
|
+
* module wires the two together **lazily and idempotently**: the `pmtiles` and
|
|
8
|
+
* `maplibre-gl` packages are only pulled in (`await import(...)`) the first time
|
|
9
|
+
* a PMTiles-backed map is loaded, and registration happens exactly once no
|
|
10
|
+
* matter how many maps attach (MapLibre's protocol registry is process-global,
|
|
11
|
+
* and the `pmtiles.Protocol` instance caches every archive it opens).
|
|
12
|
+
*
|
|
13
|
+
* `loadMapPackage` calls {@link ensurePmtilesProtocol} before `map.setStyle`
|
|
14
|
+
* whenever the composed style references a `pmtiles://` source, so consumers get
|
|
15
|
+
* PMTiles rendering out-of-the-box with no manual `addProtocol` wiring. Adding a
|
|
16
|
+
* PMTiles source to a live map through `runtime.addSource` is synchronous — call
|
|
17
|
+
* {@link ensurePmtilesProtocol} yourself beforehand in that case.
|
|
18
|
+
*
|
|
19
|
+
* The `maplibre-gl` / `pmtiles` slices are injectable so the wiring is
|
|
20
|
+
* unit-testable without either real package.
|
|
21
|
+
*
|
|
22
|
+
* @module
|
|
23
|
+
*/
|
|
24
|
+
/** The default MapLibre protocol scheme PMTiles archives are addressed under. */
|
|
25
|
+
export const PMTILES_PROTOCOL_SCHEME = "pmtiles";
|
|
26
|
+
let registration;
|
|
27
|
+
let inFlight;
|
|
28
|
+
/**
|
|
29
|
+
* Resolve the MapLibre `addProtocol` registrar from the lazily-imported module.
|
|
30
|
+
* MapLibre exposes it both as a named ESM export and off the default namespace;
|
|
31
|
+
* accept either so this works against any v5 packaging.
|
|
32
|
+
*/
|
|
33
|
+
async function loadMaplibreRegistrar() {
|
|
34
|
+
const mod = (await import("maplibre-gl"));
|
|
35
|
+
if (typeof mod.addProtocol === "function") {
|
|
36
|
+
return { addProtocol: mod.addProtocol, removeProtocol: mod.removeProtocol };
|
|
37
|
+
}
|
|
38
|
+
if (mod.default && typeof mod.default.addProtocol === "function") {
|
|
39
|
+
return mod.default;
|
|
40
|
+
}
|
|
41
|
+
throw new Error("maplibre-gl does not expose addProtocol(); ensure maplibre-gl >= 2 is installed.");
|
|
42
|
+
}
|
|
43
|
+
async function loadPmtilesModule() {
|
|
44
|
+
return (await import("pmtiles"));
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Register the `pmtiles://` protocol on MapLibre if it has not been registered
|
|
48
|
+
* already. Idempotent: repeated calls (including from multiple maps loading
|
|
49
|
+
* concurrently) share a single registration and a single in-flight import.
|
|
50
|
+
*
|
|
51
|
+
* Returns once the protocol is registered so callers can `await` it before
|
|
52
|
+
* handing a `pmtiles://`-referencing style to `map.setStyle`.
|
|
53
|
+
*/
|
|
54
|
+
export async function ensurePmtilesProtocol(deps = {}) {
|
|
55
|
+
const scheme = deps.scheme ?? PMTILES_PROTOCOL_SCHEME;
|
|
56
|
+
if (registration && registration.scheme === scheme)
|
|
57
|
+
return;
|
|
58
|
+
if (inFlight)
|
|
59
|
+
return inFlight;
|
|
60
|
+
inFlight = (async () => {
|
|
61
|
+
const registrar = deps.maplibre ?? (await loadMaplibreRegistrar());
|
|
62
|
+
const pmtilesModule = deps.pmtilesModule ?? (await loadPmtilesModule());
|
|
63
|
+
// `metadata: true` lets MapLibre auto-populate source attribution and the
|
|
64
|
+
// inspect surface from the archive header without a second wiring step.
|
|
65
|
+
const protocol = new pmtilesModule.Protocol({ metadata: true });
|
|
66
|
+
registrar.addProtocol(scheme, protocol.tile);
|
|
67
|
+
registration = { scheme, registrar, protocol };
|
|
68
|
+
})();
|
|
69
|
+
try {
|
|
70
|
+
await inFlight;
|
|
71
|
+
}
|
|
72
|
+
finally {
|
|
73
|
+
inFlight = undefined;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
/** Whether the `pmtiles://` protocol (or `scheme`) is currently registered. */
|
|
77
|
+
export function isPmtilesProtocolRegistered(scheme = PMTILES_PROTOCOL_SCHEME) {
|
|
78
|
+
return registration?.scheme === scheme;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Tear down a prior {@link ensurePmtilesProtocol} registration. Primarily a test
|
|
82
|
+
* seam so the module-global registration does not leak between cases; also
|
|
83
|
+
* useful if a host wants to fully release the protocol. Best-effort — a
|
|
84
|
+
* registrar without `removeProtocol` just clears the local record.
|
|
85
|
+
*/
|
|
86
|
+
export function resetPmtilesProtocol() {
|
|
87
|
+
if (registration) {
|
|
88
|
+
registration.registrar.removeProtocol?.(registration.scheme);
|
|
89
|
+
registration = undefined;
|
|
90
|
+
}
|
|
91
|
+
inFlight = undefined;
|
|
92
|
+
}
|
|
93
|
+
function sourceReferencesPmtiles(source, scheme) {
|
|
94
|
+
if (!source || typeof source !== "object")
|
|
95
|
+
return false;
|
|
96
|
+
const prefix = `${scheme}://`;
|
|
97
|
+
const url = source.url;
|
|
98
|
+
if (typeof url === "string" && url.startsWith(prefix))
|
|
99
|
+
return true;
|
|
100
|
+
const tiles = source.tiles;
|
|
101
|
+
if (Array.isArray(tiles) && tiles.some((tile) => typeof tile === "string" && tile.startsWith(prefix))) {
|
|
102
|
+
return true;
|
|
103
|
+
}
|
|
104
|
+
return false;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Whether a composed MapLibre style references at least one `pmtiles://` source.
|
|
108
|
+
* Used by `loadMapPackage` to decide whether the protocol must be registered
|
|
109
|
+
* before `map.setStyle`.
|
|
110
|
+
*/
|
|
111
|
+
export function styleUsesPmtiles(style, scheme = PMTILES_PROTOCOL_SCHEME) {
|
|
112
|
+
const sources = style?.sources;
|
|
113
|
+
if (!sources)
|
|
114
|
+
return false;
|
|
115
|
+
for (const source of Object.values(sources)) {
|
|
116
|
+
if (sourceReferencesPmtiles(source, scheme))
|
|
117
|
+
return true;
|
|
118
|
+
}
|
|
119
|
+
return false;
|
|
120
|
+
}
|
package/runtime/query-tiles.d.ts
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import { type QueryTileCacheKeyOptions, type QueryTileCachePolicy, type QueryTileEndpointDescriptor, type QueryTileFeatureDetailResponse, type QueryTileFeatureIdentityTarget, type QueryTileJson, type QueryTileKey, type QueryTileKeyInput, type QueryTileServerCacheValidators, type QueryTileServerDegradation, type QueryTileServerErrorResponse, type QueryTileServerRequestParameters, type QueryTileSourceDescriptor } from "../contract/tiles.js";
|
|
12
12
|
import type { Capability, Protocol } from "../contract/types.js";
|
|
13
|
+
import { HonuaSdkError } from "../core/error-envelope.js";
|
|
13
14
|
export interface MapLibreQueryTileSourceSpec {
|
|
14
15
|
type: "vector";
|
|
15
16
|
tiles?: string[];
|
|
@@ -68,7 +69,7 @@ export interface QueryTileFeatureDetailFetchResult<T = Record<string, unknown>>
|
|
|
68
69
|
detail?: QueryTileFeatureDetailResponse<T>;
|
|
69
70
|
degraded?: readonly QueryTileServerDegradation[];
|
|
70
71
|
}
|
|
71
|
-
export declare class QueryTileServerResponseError extends
|
|
72
|
+
export declare class QueryTileServerResponseError extends HonuaSdkError {
|
|
72
73
|
readonly status: number;
|
|
73
74
|
readonly url: string;
|
|
74
75
|
readonly response: QueryTileServerErrorResponse | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query-tiles.d.ts","sourceRoot":"","sources":["../../../src/runtime/query-tiles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EACL,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EACzB,KAAK,2BAA2B,EAChC,KAAK,8BAA8B,EAEnC,KAAK,8BAA8B,EACnC,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,8BAA8B,EACnC,KAAK,0BAA0B,EAC/B,KAAK,4BAA4B,EACjC,KAAK,gCAAgC,EACrC,KAAK,yBAAyB,EAW/B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"query-tiles.d.ts","sourceRoot":"","sources":["../../../src/runtime/query-tiles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EACL,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EACzB,KAAK,2BAA2B,EAChC,KAAK,8BAA8B,EAEnC,KAAK,8BAA8B,EACnC,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,8BAA8B,EACnC,KAAK,0BAA0B,EAC/B,KAAK,4BAA4B,EACjC,KAAK,gCAAgC,EACrC,KAAK,yBAAyB,EAW/B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAG1D,MAAM,WAAW,2BAA2B;IAC1C,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,C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,OAAO,EAC1D,UAAU,EAAE,yBAAyB,EACrC,OAAO,EAAE,iCAAiC,CAAC,CAAC,CAAC,GAC5C,0BAA0B,CAAC,CAAC,CAAC,CAE/B;AAED,8FAA8F;AAC9F,qBAAa,0BAA0B,CAAC,CAAC,GAAG,OAAO;;IACjD,SAAgB,UAAU,EAAE,yBAAyB,CAAC;gBAQnC,UAAU,EAAE,yBAAyB,EAAE,OAAO,EAAE,iCAAiC,CAAC,CAAC,CAAC;IAOhG,WAAW,CAAC,OAAO,EAAE,iBAAiB,EAAE,OAAO,GAAE,2BAAgC,GAAG,OAAO,CAAC,CAAC,CAAC;IAwExF,eAAe,CAC1B,QAAQ,EAAE,iBAAiB,EAC3B,OAAO,GAAE,+BAAoC,GAC5C,OAAO,CAAC,8BAA8B,CAAC,CAAC,CAAC,CAAC;IAqBtC,KAAK,CAAC,OAAO,CAAC,EAAE,iBAAiB,EAAE,MAAM,GAAE,OAAmB,GAAG,IAAI;IAWrE,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,YAAY,CAAC;QAAC,KAAK,EAAE,CAAC,CAAA;KAAE,KAAK,OAAO,GAAG,MAAM;IAWzG,UAAU,IAAI,IAAI;IAMlB,OAAO,IAAI,IAAI;IAKf,aAAa,IAAI,sBAAsB;IASvC,WAAW,IAAI,SAAS,mBAAmB,EAAE;CAwDrD"}
|
package/runtime/query-tiles.js
CHANGED
|
@@ -10,15 +10,18 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import { assessAnalyticsSourcePushdown } from "../contract/analytics-sources.js";
|
|
12
12
|
import { buildQueryTileCacheKey, buildQueryTileServerPath, normalizeQueryTileKey, normalizeQueryTileSourceDescriptor, parseQueryTileFeatureDetailResponse, parseQueryTileJson, parseQueryTileServerErrorResponse, queryTileKeyString, queryTileServerRequestParamsFromDescriptor, stableJson, } from "../contract/tiles.js";
|
|
13
|
+
import { HonuaSdkError } from "../core/error-envelope.js";
|
|
13
14
|
import { trimLeadingSlashes, trimTrailingSlashes } from "../core/path-utils.js";
|
|
14
|
-
export class QueryTileServerResponseError extends
|
|
15
|
+
export class QueryTileServerResponseError extends HonuaSdkError {
|
|
15
16
|
status;
|
|
16
17
|
url;
|
|
17
18
|
response;
|
|
18
19
|
body;
|
|
19
20
|
validators;
|
|
20
21
|
constructor(options) {
|
|
21
|
-
super(options.
|
|
22
|
+
super(QUERY_TILE_RETRYABLE_STATUSES.has(options.status)
|
|
23
|
+
? "runtime.query-tiles.transient"
|
|
24
|
+
: "runtime.query-tiles.rejected", options.message, { context: { status: options.status, url: options.url } });
|
|
22
25
|
this.name = "QueryTileServerResponseError";
|
|
23
26
|
this.status = options.status;
|
|
24
27
|
this.url = options.url;
|
|
@@ -27,6 +30,7 @@ export class QueryTileServerResponseError extends Error {
|
|
|
27
30
|
this.validators = options.validators ?? {};
|
|
28
31
|
}
|
|
29
32
|
}
|
|
33
|
+
const QUERY_TILE_RETRYABLE_STATUSES = new Set([408, 429, 500, 502, 503, 504]);
|
|
30
34
|
const WEB_MERCATOR_LAT_LIMIT = 85.05112878;
|
|
31
35
|
const DEFAULT_MAX_VIEWPORT_TILES = 1024;
|
|
32
36
|
const MAX_SAFE_TILE_ZOOM = 30;
|
|
@@ -60,10 +60,10 @@ export declare function toHonuaSourceSpec(descriptor: SourceDescriptor, filter?:
|
|
|
60
60
|
};
|
|
61
61
|
/**
|
|
62
62
|
* Build a MapLibre `raster` source spec for a WMS descriptor. The
|
|
63
|
-
* `tiles` template uses MapLibre's
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
* URLs themselves.
|
|
63
|
+
* `tiles` template uses MapLibre's exact `{bbox-epsg-3857}` runtime
|
|
64
|
+
* placeholder plus validated (1–4096) literal WIDTH / HEIGHT values
|
|
65
|
+
* equal to `tileSize`, so each tile request is a pre-baked KVP URL —
|
|
66
|
+
* consumers do not have to hand-assemble GetMap URLs themselves.
|
|
67
67
|
*/
|
|
68
68
|
export declare function buildWmsRasterSourceSpec(descriptor: SourceDescriptor, options?: {
|
|
69
69
|
tileSize?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source-bridge.d.ts","sourceRoot":"","sources":["../../../src/runtime/source-bridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAGL,KAAK,gBAAgB,EAEtB,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"source-bridge.d.ts","sourceRoot":"","sources":["../../../src/runtime/source-bridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAGL,KAAK,gBAAgB,EAEtB,MAAM,sBAAsB,CAAC;AAM9B,OAAO,KAAK,EAAE,sBAAsB,EAA2B,4BAA4B,EAAE,MAAM,kBAAkB,CAAC;AAEtH,+DAA+D;AAC/D,MAAM,WAAW,yBAAyB;IACxC,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;IAC/C,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,wDAAwD;AACxD,MAAM,WAAW,sBAAsB;IACrC,gEAAgE;IAChE,WAAW,EAAE,gBAAgB,EAAE,CAAC;IAChC;;;;OAIG;IACH,aAAa,EAAE,yBAAyB,EAAE,CAAC;IAC3C,yDAAyD;IACzD,iBAAiB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACxC;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACnC,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,QAAQ,EAAE,SAAS,4BAA4B,EAAE,GAChD,sBAAsB,CA4CxB;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,gBAAgB,EAC5B,MAAM,CAAC,EAAE,MAAM,GACd;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,CAkE1C;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CACtC,UAAU,EAAE,gBAAgB,EAC5B,OAAO,GAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,OAAO,CAAA;CAAO,GAC1E;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,KAAK,EAAE,MAAM,EAAE,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,CAG7E;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CACvC,UAAU,EAAE,gBAAgB,EAC5B,OAAO,GAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAO,GACvF;IACD,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAGA;AA2ND,oFAAoF;AACpF,YAAY,EAAE,sBAAsB,EAAE,CAAC"}
|
package/runtime/source-bridge.js
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
* @module
|
|
21
21
|
*/
|
|
22
22
|
import { PROTOCOL_DEFAULT_CAPABILITIES, } from "../contract/index.js";
|
|
23
|
-
import {
|
|
23
|
+
import { buildWmsRasterSourceSpec as buildMapWmsRasterSourceSpec, buildWmtsRasterSourceSpec as buildMapWmtsRasterSourceSpec, } from "../map/raster-source-spec.js";
|
|
24
24
|
import { HonuaMapPackageError } from "./errors.js";
|
|
25
25
|
/**
|
|
26
26
|
* Project the bindings on a MapPackage into SDK contract descriptors and
|
|
@@ -145,42 +145,14 @@ export function toHonuaSourceSpec(descriptor, filter) {
|
|
|
145
145
|
}
|
|
146
146
|
/**
|
|
147
147
|
* Build a MapLibre `raster` source spec for a WMS descriptor. The
|
|
148
|
-
* `tiles` template uses MapLibre's
|
|
149
|
-
*
|
|
150
|
-
*
|
|
151
|
-
* URLs themselves.
|
|
148
|
+
* `tiles` template uses MapLibre's exact `{bbox-epsg-3857}` runtime
|
|
149
|
+
* placeholder plus validated (1–4096) literal WIDTH / HEIGHT values
|
|
150
|
+
* equal to `tileSize`, so each tile request is a pre-baked KVP URL —
|
|
151
|
+
* consumers do not have to hand-assemble GetMap URLs themselves.
|
|
152
152
|
*/
|
|
153
153
|
export function buildWmsRasterSourceSpec(descriptor, options = {}) {
|
|
154
|
-
const
|
|
155
|
-
|
|
156
|
-
const format = options.format ?? "image/png";
|
|
157
|
-
const transparent = options.transparent ?? true;
|
|
158
|
-
const layers = descriptor.locator.typeName ?? "";
|
|
159
|
-
const styles = descriptor.locator.styleId ?? "";
|
|
160
|
-
const params = new URLSearchParams();
|
|
161
|
-
params.set("SERVICE", "WMS");
|
|
162
|
-
params.set("VERSION", "1.3.0");
|
|
163
|
-
params.set("REQUEST", "GetMap");
|
|
164
|
-
params.set("LAYERS", layers);
|
|
165
|
-
params.set("STYLES", styles);
|
|
166
|
-
params.set("CRS", "EPSG:3857");
|
|
167
|
-
params.set("FORMAT", format);
|
|
168
|
-
params.set("TRANSPARENT", String(transparent).toUpperCase());
|
|
169
|
-
// MapLibre substitutes these placeholders at fetch-time. They are
|
|
170
|
-
// intentionally appended verbatim (no encoding) so MapLibre's
|
|
171
|
-
// template parser sees the literal tokens. WIDTH and HEIGHT are
|
|
172
|
-
// emitted only as placeholders — duplicating them as fixed params
|
|
173
|
-
// would produce ambiguous query keys that honua-server's
|
|
174
|
-
// TryGetRequiredQueryValue / int.TryParse pair rejects.
|
|
175
|
-
const baseUrl = `${url}?${params.toString()}&BBOX={bbox-epsg3857}&WIDTH={width}&HEIGHT={height}`;
|
|
176
|
-
const out = {
|
|
177
|
-
type: "raster",
|
|
178
|
-
tiles: [baseUrl],
|
|
179
|
-
tileSize,
|
|
180
|
-
};
|
|
181
|
-
if (descriptor.attribution)
|
|
182
|
-
out.attribution = descriptor.attribution;
|
|
183
|
-
return out;
|
|
154
|
+
const spec = buildMapWmsRasterSourceSpec(descriptor, options);
|
|
155
|
+
return { ...spec, tiles: [...spec.tiles] };
|
|
184
156
|
}
|
|
185
157
|
/**
|
|
186
158
|
* Build a MapLibre `raster` source spec for a WMTS descriptor using the
|
|
@@ -188,27 +160,8 @@ export function buildWmsRasterSourceSpec(descriptor, options = {}) {
|
|
|
188
160
|
* (MapLibre's standard tile placeholders).
|
|
189
161
|
*/
|
|
190
162
|
export function buildWmtsRasterSourceSpec(descriptor, options = {}) {
|
|
191
|
-
const
|
|
192
|
-
|
|
193
|
-
const format = options.format ?? "image/png";
|
|
194
|
-
const ext = wmtsExtensionForFormat(format);
|
|
195
|
-
const layer = descriptor.locator.typeName ?? "";
|
|
196
|
-
const style = descriptor.locator.styleId ?? "default";
|
|
197
|
-
const tms = descriptor.locator.tileMatrixSetId ?? "WebMercatorQuad";
|
|
198
|
-
const tileTemplate = `${url}/${encodeURIComponent(layer)}/${encodeURIComponent(style)}/${encodeURIComponent(tms)}/{z}/{y}/{x}.${ext}`;
|
|
199
|
-
const out = {
|
|
200
|
-
type: "raster",
|
|
201
|
-
tiles: [tileTemplate],
|
|
202
|
-
tileSize,
|
|
203
|
-
scheme: "xyz",
|
|
204
|
-
};
|
|
205
|
-
if (options.minzoom !== undefined)
|
|
206
|
-
out.minzoom = options.minzoom;
|
|
207
|
-
if (options.maxzoom !== undefined)
|
|
208
|
-
out.maxzoom = options.maxzoom;
|
|
209
|
-
if (descriptor.attribution)
|
|
210
|
-
out.attribution = descriptor.attribution;
|
|
211
|
-
return out;
|
|
163
|
+
const spec = buildMapWmtsRasterSourceSpec(descriptor, options);
|
|
164
|
+
return { ...spec, tiles: [...spec.tiles] };
|
|
212
165
|
}
|
|
213
166
|
function toSdkProtocol(protocol) {
|
|
214
167
|
switch (protocol) {
|
|
@@ -254,10 +207,37 @@ function toMapLibreNativeSource(binding) {
|
|
|
254
207
|
...(binding.attribution ? { attribution: binding.attribution } : {}),
|
|
255
208
|
},
|
|
256
209
|
};
|
|
210
|
+
case "pmtiles":
|
|
211
|
+
return toPmtilesNativeSource(binding);
|
|
257
212
|
default:
|
|
258
213
|
return undefined;
|
|
259
214
|
}
|
|
260
215
|
}
|
|
216
|
+
/**
|
|
217
|
+
* Project a PMTiles binding onto a MapLibre-native source. A PMTiles archive is
|
|
218
|
+
* a single immutable file addressed by MapLibre as a `pmtiles://<archive-url>`
|
|
219
|
+
* source `url` (the `pmtiles://` protocol is auto-registered by the runtime on
|
|
220
|
+
* map attach). Whether the archive is vector or raster comes from the binding's
|
|
221
|
+
* `locator.sourceType` hint (`"vector"` | `"raster"`), defaulting to vector —
|
|
222
|
+
* the common PMTiles basemap case.
|
|
223
|
+
*/
|
|
224
|
+
function toPmtilesNativeSource(binding) {
|
|
225
|
+
const url = binding.locator.url;
|
|
226
|
+
if (typeof url !== "string" || url.length === 0)
|
|
227
|
+
return undefined;
|
|
228
|
+
const sourceUrl = url.startsWith("pmtiles://") ? url : `pmtiles://${url}`;
|
|
229
|
+
const hint = binding.locator.sourceType;
|
|
230
|
+
const type = hint === "raster" ? "raster" : "vector";
|
|
231
|
+
return {
|
|
232
|
+
sourceId: binding.sourceId,
|
|
233
|
+
attribution: binding.attribution,
|
|
234
|
+
spec: {
|
|
235
|
+
type,
|
|
236
|
+
url: sourceUrl,
|
|
237
|
+
...(binding.attribution ? { attribution: binding.attribution } : {}),
|
|
238
|
+
},
|
|
239
|
+
};
|
|
240
|
+
}
|
|
261
241
|
function toSourceLocator(packageId, binding, sdkProtocol) {
|
|
262
242
|
const loc = binding.locator;
|
|
263
243
|
if (binding.protocol === "workspace_artifact") {
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
* @module
|
|
11
11
|
*/
|
|
12
12
|
import type { FeatureId } from "../contract/types.js";
|
|
13
|
+
import { type HonuaErrorMetadata, HonuaSdkError } from "../core/error-envelope.js";
|
|
13
14
|
import type { SourceQualifiedFeatureSelectionTarget } from "../exploration/types.js";
|
|
14
15
|
import type { HonuaLayerSpecification, HonuaSourceSpecification, HonuaStyleSpecification } from "../style/specification.js";
|
|
15
16
|
import type { HonuaMapPackage } from "./map-package.js";
|
|
@@ -26,10 +27,10 @@ export interface HonuaRuntimeDiagnostic {
|
|
|
26
27
|
readonly capability?: string;
|
|
27
28
|
readonly context?: Readonly<Record<string, unknown>>;
|
|
28
29
|
}
|
|
29
|
-
export declare class HonuaRuntimeDiagnosticError extends
|
|
30
|
+
export declare class HonuaRuntimeDiagnosticError extends HonuaSdkError {
|
|
30
31
|
readonly diagnostics: readonly HonuaRuntimeDiagnostic[];
|
|
31
32
|
readonly cause: unknown;
|
|
32
|
-
constructor(message: string, diagnostics: readonly HonuaRuntimeDiagnostic[], cause?: unknown);
|
|
33
|
+
constructor(message: string, diagnostics: readonly HonuaRuntimeDiagnostic[], cause?: unknown, metadata?: HonuaErrorMetadata);
|
|
33
34
|
}
|
|
34
35
|
export interface NativeMapLibreSourceSpecification {
|
|
35
36
|
readonly type: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style-interactions.d.ts","sourceRoot":"","sources":["../../../src/runtime/style-interactions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"style-interactions.d.ts","sourceRoot":"","sources":["../../../src/runtime/style-interactions.ts"],"names":[],"mappings":"AAA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AG,SAAS,EACvC,OAAO,EAAE,MAAM,GACd;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,GAAG,SAAS,CAQjG;AAED,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,uBAAuB,EAC9B,OAAO,EAAE,MAAM,EACf,EAAE,EAAE,SAAS,GACZ,yBAAyB,GAAG,SAAS,CAQvC;AAED,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,uBAAuB,EAC9B,OAAO,EAAE,MAAM,EACf,EAAE,EAAE,SAAS,GACZ,qCAAqC,GAAG,SAAS,CAInD;AAED,wBAAgB,+BAA+B,CAC7C,MAAM,EAAE,qCAAqC,GAC5C,yBAAyB,CAM3B;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,yBAAyB,GAAG,MAAM,CAE/E;AAED,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,uBAAuB,EAC9B,UAAU,EAAE,eAAe,GAAG,SAAS,EACvC,QAAQ,EAAE,MAAM,GAAG,SAAS,GAC3B,MAAM,GAAG,SAAS,CAMpB;AAED,wBAAgB,gCAAgC,CAC9C,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,OAAO,EACd,OAAO,GAAE,8BAAmC,GAC3C,SAAS,GAAG,SAAS,CAevB"}
|
|
@@ -9,15 +9,23 @@
|
|
|
9
9
|
*
|
|
10
10
|
* @module
|
|
11
11
|
*/
|
|
12
|
+
import { HonuaSdkError, mergeHonuaErrorContext } from "../core/error-envelope.js";
|
|
12
13
|
import { sourceFeatureSelectionTarget } from "../exploration/selection.js";
|
|
13
14
|
import { Expr } from "../expr/index.js";
|
|
14
15
|
import { isHonuaSource } from "../style/specification.js";
|
|
15
16
|
import { validateRuntimeFilterStyleSpecSync, validateRuntimeLayerStyleSpecSync, validateRuntimeSourceStyleSpecSync, validateRuntimeStyleExpressionStyleSpecSync, } from "./style-spec-validation.js";
|
|
16
|
-
export class HonuaRuntimeDiagnosticError extends
|
|
17
|
+
export class HonuaRuntimeDiagnosticError extends HonuaSdkError {
|
|
17
18
|
diagnostics;
|
|
18
19
|
cause;
|
|
19
|
-
constructor(message, diagnostics, cause) {
|
|
20
|
-
super(message
|
|
20
|
+
constructor(message, diagnostics, cause, metadata = {}) {
|
|
21
|
+
super("runtime.diagnostic", message, {
|
|
22
|
+
...metadata,
|
|
23
|
+
cause,
|
|
24
|
+
context: mergeHonuaErrorContext(metadata.context, {
|
|
25
|
+
diagnosticCount: diagnostics.length,
|
|
26
|
+
diagnosticCodes: diagnostics.map(({ code }) => code),
|
|
27
|
+
}),
|
|
28
|
+
});
|
|
21
29
|
this.name = "HonuaRuntimeDiagnosticError";
|
|
22
30
|
this.diagnostics = diagnostics;
|
|
23
31
|
this.cause = cause;
|