@honua/app-platform 0.1.0-beta.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 +11 -2
- package/contract/index.d.ts.map +1 -1
- package/contract/index.js +4 -1
- package/contract/pmtiles.d.ts +31 -0
- package/contract/pmtiles.d.ts.map +1 -1
- package/contract/pmtiles.js +60 -20
- 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 +35 -17
- package/contract/source.d.ts.map +1 -1
- package/contract/source.js +267 -71
- package/contract/types.d.ts +140 -4
- package/contract/types.d.ts.map +1 -1
- package/contract/types.js +6 -14
- 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 +4 -1
- package/core/client.d.ts.map +1 -1
- package/core/client.js +115 -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 +45 -29
- package/core/errors.d.ts.map +1 -1
- package/core/errors.js +97 -50
- package/core/geoparquet-sql.d.ts +30 -2
- package/core/geoparquet-sql.d.ts.map +1 -1
- package/core/geoparquet-sql.js +38 -3
- 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-features.d.ts.map +1 -1
- package/core/ogc-features.js +3 -0
- 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 +6 -2
- package/core/stac-static.d.ts.map +1 -1
- package/core/stac-static.js +260 -69
- package/core/surfaces.d.ts.map +1 -1
- package/core/surfaces.js +69 -5
- package/core/types.d.ts +125 -7
- package/core/types.d.ts.map +1 -1
- package/core/wfs-capabilities.d.ts +2 -0
- package/core/wfs-capabilities.d.ts.map +1 -1
- package/core/wfs-capabilities.js +8 -1
- package/core/wfs.d.ts.map +1 -1
- package/core/wfs.js +10 -0
- 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/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/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/generated-app/errors.d.ts +18 -2
- package/generated-app/errors.d.ts.map +1 -1
- package/generated-app/errors.js +44 -11
- package/geocoding/index.d.ts +7 -0
- package/geocoding/index.d.ts.map +1 -1
- package/geocoding/index.js +5 -0
- package/geocoding/provider-http.d.ts +37 -0
- package/geocoding/provider-http.d.ts.map +1 -0
- package/geocoding/provider-http.js +91 -0
- package/geocoding/provider.d.ts +145 -0
- package/geocoding/provider.d.ts.map +1 -0
- package/geocoding/provider.js +41 -0
- package/geocoding/providers/honua.d.ts +28 -0
- package/geocoding/providers/honua.d.ts.map +1 -0
- package/geocoding/providers/honua.js +68 -0
- package/geocoding/providers/nominatim.d.ts +47 -0
- package/geocoding/providers/nominatim.d.ts.map +1 -0
- package/geocoding/providers/nominatim.js +105 -0
- package/geocoding/providers/pelias.d.ts +40 -0
- package/geocoding/providers/pelias.d.ts.map +1 -0
- package/geocoding/providers/pelias.js +115 -0
- package/geocoding/providers/photon.d.ts +39 -0
- package/geocoding/providers/photon.d.ts.map +1 -0
- package/geocoding/providers/photon.js +107 -0
- package/geometry/convert.d.ts +13 -0
- package/geometry/convert.d.ts.map +1 -0
- package/geometry/convert.js +12 -0
- package/geometry/index.d.ts +17 -0
- package/geometry/index.d.ts.map +1 -0
- package/geometry/index.js +15 -0
- package/geometry/internal.d.ts +25 -0
- package/geometry/internal.d.ts.map +1 -0
- package/geometry/internal.js +40 -0
- package/geometry/ops.d.ts +71 -0
- package/geometry/ops.d.ts.map +1 -0
- package/geometry/ops.js +147 -0
- package/geometry/project.d.ts +40 -0
- package/geometry/project.d.ts.map +1 -0
- package/geometry/project.js +88 -0
- package/geometry/types.d.ts +36 -0
- package/geometry/types.d.ts.map +1 -0
- package/geometry/types.js +12 -0
- 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 +28 -2
- 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/realtime/contract.d.ts +142 -0
- package/realtime/contract.d.ts.map +1 -0
- package/realtime/contract.js +154 -0
- package/realtime/honua-server.d.ts.map +1 -1
- package/realtime/honua-server.js +13 -8
- package/realtime/index.d.ts +19 -4
- package/realtime/index.d.ts.map +1 -1
- package/realtime/index.js +14 -4
- package/realtime/odata-delta.d.ts +114 -0
- package/realtime/odata-delta.d.ts.map +1 -0
- package/realtime/odata-delta.js +483 -0
- package/realtime/resumable-transport.d.ts +111 -0
- package/realtime/resumable-transport.d.ts.map +1 -0
- package/realtime/resumable-transport.js +406 -0
- package/realtime/resumable.d.ts +104 -0
- package/realtime/resumable.d.ts.map +1 -0
- package/realtime/resumable.js +632 -0
- package/realtime/sse.d.ts.map +1 -1
- package/realtime/sse.js +27 -23
- package/realtime/websocket.d.ts +60 -0
- package/realtime/websocket.d.ts.map +1 -0
- package/realtime/websocket.js +157 -0
- package/realtime/wire.d.ts +27 -0
- package/realtime/wire.d.ts.map +1 -0
- package/realtime/wire.js +57 -0
- package/replica-sync/errors.d.ts +2 -1
- package/replica-sync/errors.d.ts.map +1 -1
- package/replica-sync/errors.js +33 -2
- 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 +6 -0
- package/runtime/index.d.ts.map +1 -1
- package/runtime/index.js +3 -0
- 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/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 +9 -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/scene-workspace/index.d.ts +4 -0
- package/scene-workspace/index.d.ts.map +1 -1
- package/scene-workspace/index.js +2 -0
- package/scene-workspace/source-to-cesium.d.ts +116 -0
- package/scene-workspace/source-to-cesium.d.ts.map +1 -0
- package/scene-workspace/source-to-cesium.js +791 -0
- package/scene-workspace/state-sync.d.ts +147 -0
- package/scene-workspace/state-sync.d.ts.map +1 -0
- package/scene-workspace/state-sync.js +1123 -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/web-components/controller.d.ts +2 -0
- package/web-components/controller.d.ts.map +1 -1
- package/web-components/controller.js +49 -8
- package/web-components/elements.d.ts +95 -1
- package/web-components/elements.d.ts.map +1 -1
- package/web-components/elements.js +458 -19
- package/web-components/index.d.ts +8 -1
- package/web-components/index.d.ts.map +1 -1
- package/web-components/index.js +7 -0
- package/web-components/maplibre-renderer.d.ts.map +1 -1
- package/web-components/maplibre-renderer.js +87 -0
- package/web-components/measurement.d.ts +69 -0
- package/web-components/measurement.d.ts.map +1 -0
- package/web-components/measurement.js +523 -0
- package/web-components/types.d.ts +109 -0
- package/web-components/types.d.ts.map +1 -1
- 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
|
@@ -8,6 +8,8 @@ export class HonuaMapLibreRenderer {
|
|
|
8
8
|
#lastViewportKey;
|
|
9
9
|
#syncingViewport = false;
|
|
10
10
|
#layerVisibility = new Map();
|
|
11
|
+
#layerOpacity = new Map();
|
|
12
|
+
#layerOrderKey;
|
|
11
13
|
#selectionTarget;
|
|
12
14
|
#featureStates = new Map();
|
|
13
15
|
#state;
|
|
@@ -31,6 +33,8 @@ export class HonuaMapLibreRenderer {
|
|
|
31
33
|
return;
|
|
32
34
|
}
|
|
33
35
|
this.#applyLayerVisibility(state);
|
|
36
|
+
this.#applyLayerOpacity(state);
|
|
37
|
+
this.#applyLayerOrder(state);
|
|
34
38
|
this.#applyViewport(state);
|
|
35
39
|
this.#applyFeatureStates(state.featureStates);
|
|
36
40
|
this.#applySelection(state);
|
|
@@ -44,6 +48,8 @@ export class HonuaMapLibreRenderer {
|
|
|
44
48
|
this.#map = undefined;
|
|
45
49
|
this.#loadedPackageKey = undefined;
|
|
46
50
|
this.#layerVisibility.clear();
|
|
51
|
+
this.#layerOpacity.clear();
|
|
52
|
+
this.#layerOrderKey = undefined;
|
|
47
53
|
this.#featureStates.clear();
|
|
48
54
|
this.#selectionTarget = undefined;
|
|
49
55
|
this.#options.container.replaceChildren();
|
|
@@ -88,6 +94,11 @@ export class HonuaMapLibreRenderer {
|
|
|
88
94
|
}
|
|
89
95
|
this.#runtime = runtime;
|
|
90
96
|
this.#loadedPackageKey = mapPackageKey(mapPackage);
|
|
97
|
+
// Seed the order tracker with the order the map actually renders (the
|
|
98
|
+
// composed style), so a controller order that already diverged — e.g. a
|
|
99
|
+
// layer-list reorder issued while the package was still loading — is
|
|
100
|
+
// replayed by the next #applyLayerOrder pass instead of being absorbed.
|
|
101
|
+
this.#layerOrderKey = layerOrderKey(runtime.composedStyle.layers.map((layer) => layer.id));
|
|
91
102
|
this.#bindViewport(map);
|
|
92
103
|
this.#bindLayerInteractions(runtime);
|
|
93
104
|
map.resize?.();
|
|
@@ -115,6 +126,8 @@ export class HonuaMapLibreRenderer {
|
|
|
115
126
|
this.#map?.remove?.();
|
|
116
127
|
this.#map = undefined;
|
|
117
128
|
this.#layerVisibility.clear();
|
|
129
|
+
this.#layerOpacity.clear();
|
|
130
|
+
this.#layerOrderKey = undefined;
|
|
118
131
|
this.#featureStates.clear();
|
|
119
132
|
this.#selectionTarget = undefined;
|
|
120
133
|
this.#options.container.replaceChildren();
|
|
@@ -248,6 +261,53 @@ export class HonuaMapLibreRenderer {
|
|
|
248
261
|
}
|
|
249
262
|
}
|
|
250
263
|
}
|
|
264
|
+
#applyLayerOpacity(state) {
|
|
265
|
+
const map = this.#map;
|
|
266
|
+
if (!map?.setPaintProperty)
|
|
267
|
+
return;
|
|
268
|
+
for (const layer of state.layers) {
|
|
269
|
+
if (layer.opacity === undefined)
|
|
270
|
+
continue;
|
|
271
|
+
const previous = this.#layerOpacity.get(layer.id);
|
|
272
|
+
if (previous === layer.opacity)
|
|
273
|
+
continue;
|
|
274
|
+
this.#layerOpacity.set(layer.id, layer.opacity);
|
|
275
|
+
if (map.getLayer && !map.getLayer(layer.id))
|
|
276
|
+
continue;
|
|
277
|
+
for (const property of opacityPaintProperties(layer.type)) {
|
|
278
|
+
try {
|
|
279
|
+
map.setPaintProperty(layer.id, property, layer.opacity);
|
|
280
|
+
}
|
|
281
|
+
catch (error) {
|
|
282
|
+
this.#emitError(error);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
#applyLayerOrder(state) {
|
|
288
|
+
const key = layerOrderKey(state.layers.map((layer) => layer.id));
|
|
289
|
+
// `#layerOrderKey` is seeded from the composed style order when the map
|
|
290
|
+
// package loads (see #load), so a matching key means the map already
|
|
291
|
+
// renders this order and overlays are never hoisted above host-managed
|
|
292
|
+
// base layers gratuitously. Any diverging key — including a reorder
|
|
293
|
+
// issued while the package was still loading — is replayed onto the map.
|
|
294
|
+
if (key === this.#layerOrderKey)
|
|
295
|
+
return;
|
|
296
|
+
this.#layerOrderKey = key;
|
|
297
|
+
const map = this.#map;
|
|
298
|
+
if (!map?.moveLayer)
|
|
299
|
+
return;
|
|
300
|
+
for (const layer of state.layers) {
|
|
301
|
+
if (map.getLayer && !map.getLayer(layer.id))
|
|
302
|
+
continue;
|
|
303
|
+
try {
|
|
304
|
+
map.moveLayer(layer.id);
|
|
305
|
+
}
|
|
306
|
+
catch (error) {
|
|
307
|
+
this.#emitError(error);
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
}
|
|
251
311
|
#applyViewport(state) {
|
|
252
312
|
if (this.#syncingViewport || !this.#runtime)
|
|
253
313
|
return;
|
|
@@ -384,6 +444,33 @@ function featureStateKey(target) {
|
|
|
384
444
|
function stableKey(value) {
|
|
385
445
|
return JSON.stringify(value);
|
|
386
446
|
}
|
|
447
|
+
/** Order-tracking key over layer ids (NUL-delimited so ids with spaces stay distinct). */
|
|
448
|
+
function layerOrderKey(ids) {
|
|
449
|
+
return ids.join("\u0000");
|
|
450
|
+
}
|
|
451
|
+
/** Paint properties that carry a layer's overall opacity, by layer type. */
|
|
452
|
+
function opacityPaintProperties(type) {
|
|
453
|
+
switch (type) {
|
|
454
|
+
case "fill":
|
|
455
|
+
return ["fill-opacity"];
|
|
456
|
+
case "line":
|
|
457
|
+
return ["line-opacity"];
|
|
458
|
+
case "circle":
|
|
459
|
+
return ["circle-opacity", "circle-stroke-opacity"];
|
|
460
|
+
case "symbol":
|
|
461
|
+
return ["icon-opacity", "text-opacity"];
|
|
462
|
+
case "raster":
|
|
463
|
+
return ["raster-opacity"];
|
|
464
|
+
case "background":
|
|
465
|
+
return ["background-opacity"];
|
|
466
|
+
case "fill-extrusion":
|
|
467
|
+
return ["fill-extrusion-opacity"];
|
|
468
|
+
case "heatmap":
|
|
469
|
+
return ["heatmap-opacity"];
|
|
470
|
+
default:
|
|
471
|
+
return [];
|
|
472
|
+
}
|
|
473
|
+
}
|
|
387
474
|
function viewportKey(viewport) {
|
|
388
475
|
return JSON.stringify({
|
|
389
476
|
bbox: viewport.bbox,
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `<honua-measurement>` — the survival-tier distance/area measurement widget
|
|
3
|
+
* (issue #493).
|
|
4
|
+
*
|
|
5
|
+
* Unlike `<honua-measure-control>` (which requires a host-supplied drawing
|
|
6
|
+
* provider), this element ships a complete, deliberately simple drawing
|
|
7
|
+
* interaction on top of the map's own pointer events:
|
|
8
|
+
*
|
|
9
|
+
* - **click** adds a vertex;
|
|
10
|
+
* - **double-click** finishes the sketch (the map's double-click zoom is
|
|
11
|
+
* suspended while a mode is active when the map exposes the handle);
|
|
12
|
+
* - **Escape** (or the Cancel button) discards the in-progress sketch.
|
|
13
|
+
*
|
|
14
|
+
* Distance and area are computed with the geodesic ops from the public
|
|
15
|
+
* `@honua/geometry` surface (`length` / `area`), so the widget's numbers match
|
|
16
|
+
* `geometryEngine` parity math everywhere else in the SDK.
|
|
17
|
+
*
|
|
18
|
+
* ## Wiring
|
|
19
|
+
* - `element.map = map` (any MapLibre `Map`; duck-typed via
|
|
20
|
+
* {@link HonuaMeasurementMap}), or
|
|
21
|
+
* - declaratively via `for="<honua-map id>"` — the element listens for the
|
|
22
|
+
* `honua-map-ready` event dispatched by `<honua-map>`.
|
|
23
|
+
*
|
|
24
|
+
* When the map exposes style mutation methods (`addSource` / `addLayer`), the
|
|
25
|
+
* in-progress sketch renders as a line + fill overlay in a
|
|
26
|
+
* `honua-measurement` GeoJSON source; on plain stubs the overlay is skipped.
|
|
27
|
+
*
|
|
28
|
+
* ## Accessibility
|
|
29
|
+
* Mode buttons are a `role="group"` of toggle buttons with `aria-pressed`;
|
|
30
|
+
* the live result is announced through a `role="status"` region; Finish /
|
|
31
|
+
* Cancel buttons provide keyboard-operable equivalents of double-click /
|
|
32
|
+
* Escape. Theme via the `--honua-ui-*` CSS custom properties.
|
|
33
|
+
*
|
|
34
|
+
* @module
|
|
35
|
+
*/
|
|
36
|
+
import type { HonuaMeasureMode, HonuaMeasureResult, HonuaMeasurementMap } from "./types.js";
|
|
37
|
+
declare const HTMLElementBase: typeof HTMLElement;
|
|
38
|
+
type LngLat = readonly [number, number];
|
|
39
|
+
export declare class HonuaMeasurementElement extends HTMLElementBase {
|
|
40
|
+
#private;
|
|
41
|
+
static get observedAttributes(): string[];
|
|
42
|
+
/** The MapLibre map this widget draws on. */
|
|
43
|
+
get map(): HonuaMeasurementMap | undefined;
|
|
44
|
+
set map(map: HonuaMeasurementMap | undefined);
|
|
45
|
+
/** Wires the widget to a MapLibre map. Equivalent to setting `.map`. */
|
|
46
|
+
connect(map: HonuaMeasurementMap): void;
|
|
47
|
+
/** The active measure mode. */
|
|
48
|
+
get mode(): HonuaMeasureMode;
|
|
49
|
+
/** The current (or last finished) measurement result. */
|
|
50
|
+
get result(): HonuaMeasureResult | undefined;
|
|
51
|
+
/** The in-progress vertex list (`[lng, lat]` positions). */
|
|
52
|
+
get vertices(): readonly LngLat[];
|
|
53
|
+
/** Activates a measure mode; `"off"` cancels any in-progress sketch. */
|
|
54
|
+
setMode(mode: HonuaMeasureMode): void;
|
|
55
|
+
/** Adds a vertex programmatically (same as a map click). */
|
|
56
|
+
addVertex(lngLat: LngLat): void;
|
|
57
|
+
/** Finishes the in-progress sketch (same as double-click). */
|
|
58
|
+
finish(): void;
|
|
59
|
+
/** Cancels the in-progress sketch (same as Escape); the mode stays active. */
|
|
60
|
+
cancel(): void;
|
|
61
|
+
attributeChangedCallback(name: string): void;
|
|
62
|
+
connectedCallback(): void;
|
|
63
|
+
disconnectedCallback(): void;
|
|
64
|
+
protected render(): void;
|
|
65
|
+
}
|
|
66
|
+
/** Registers `<honua-measurement>`; skipped when the tag is already defined. */
|
|
67
|
+
export declare function defineHonuaMeasurement(registry?: CustomElementRegistry): void;
|
|
68
|
+
export {};
|
|
69
|
+
//# sourceMappingURL=measurement.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"measurement.d.ts","sourceRoot":"","sources":["../../../src/web-components/measurement.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAGH,OAAO,KAAK,EAA4B,gBAAgB,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAQtH,QAAA,MAAM,eAAe,EAAE,OAAO,WAAkF,CAAC;AAMjH,KAAK,MAAM,GAAG,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAExC,qBAAa,uBAAwB,SAAQ,eAAe;;IAC1D,WAAkB,kBAAkB,IAAI,MAAM,EAAE,CAE/C;IAaD,6CAA6C;IAC7C,IAAW,GAAG,IAAI,mBAAmB,GAAG,SAAS,CAEhD;IAED,IAAW,GAAG,CAAC,GAAG,EAAE,mBAAmB,GAAG,SAAS,EAMlD;IAED,wEAAwE;IACjE,OAAO,CAAC,GAAG,EAAE,mBAAmB,GAAG,IAAI;IAI9C,+BAA+B;IAC/B,IAAW,IAAI,IAAI,gBAAgB,CAElC;IAED,yDAAyD;IACzD,IAAW,MAAM,IAAI,kBAAkB,GAAG,SAAS,CAElD;IAED,4DAA4D;IAC5D,IAAW,QAAQ,IAAI,SAAS,MAAM,EAAE,CAEvC;IAED,wEAAwE;IACjE,OAAO,CAAC,IAAI,EAAE,gBAAgB,GAAG,IAAI;IAY5C,4DAA4D;IACrD,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAatC,8DAA8D;IACvD,MAAM,IAAI,IAAI;IASrB,8EAA8E;IACvE,MAAM,IAAI,IAAI;IAUd,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAQ5C,iBAAiB,IAAI,IAAI;IAQzB,oBAAoB,IAAI,IAAI;IAsMnC,SAAS,CAAC,MAAM,IAAI,IAAI;CAgFzB;AAED,gFAAgF;AAChF,wBAAgB,sBAAsB,CAAC,QAAQ,wBAA2B,GAAG,IAAI,CAKhF"}
|