@honua/app-platform 0.0.20-alpha.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 +201 -0
- package/README.md +11 -0
- package/app/index.d.ts +164 -0
- package/app/index.d.ts.map +1 -0
- package/app/index.js +424 -0
- package/app-controller/controller.d.ts +425 -0
- package/app-controller/controller.d.ts.map +1 -0
- package/app-controller/controller.js +1173 -0
- package/app-controller/index.d.ts +14 -0
- package/app-controller/index.d.ts.map +1 -0
- package/app-controller/index.js +12 -0
- package/app-workspace/index.d.ts +421 -0
- package/app-workspace/index.d.ts.map +1 -0
- package/app-workspace/index.js +722 -0
- package/collaboration/client.d.ts +40 -0
- package/collaboration/client.d.ts.map +1 -0
- package/collaboration/client.js +299 -0
- package/collaboration/errors.d.ts +15 -0
- package/collaboration/errors.d.ts.map +1 -0
- package/collaboration/errors.js +17 -0
- package/collaboration/fixture.d.ts +41 -0
- package/collaboration/fixture.d.ts.map +1 -0
- package/collaboration/fixture.js +362 -0
- package/collaboration/index.d.ts +18 -0
- package/collaboration/index.d.ts.map +1 -0
- package/collaboration/index.js +14 -0
- package/collaboration/types.d.ts +240 -0
- package/collaboration/types.d.ts.map +1 -0
- package/collaboration/types.js +1 -0
- package/contract/analytics-sources.d.ts +149 -0
- package/contract/analytics-sources.d.ts.map +1 -0
- package/contract/analytics-sources.js +235 -0
- package/contract/edit-session.d.ts +203 -0
- package/contract/edit-session.d.ts.map +1 -0
- package/contract/edit-session.js +760 -0
- package/contract/edit-sketch.d.ts +91 -0
- package/contract/edit-sketch.d.ts.map +1 -0
- package/contract/edit-sketch.js +281 -0
- package/contract/index.d.ts +63 -0
- package/contract/index.d.ts.map +1 -0
- package/contract/index.js +52 -0
- package/contract/jobs.d.ts +149 -0
- package/contract/jobs.d.ts.map +1 -0
- package/contract/jobs.js +40 -0
- package/contract/pmtiles.d.ts +162 -0
- package/contract/pmtiles.d.ts.map +1 -0
- package/contract/pmtiles.js +155 -0
- package/contract/source.d.ts +447 -0
- package/contract/source.d.ts.map +1 -0
- package/contract/source.js +3909 -0
- package/contract/spatial-aggregation.d.ts +336 -0
- package/contract/spatial-aggregation.d.ts.map +1 -0
- package/contract/spatial-aggregation.js +298 -0
- package/contract/temporal.d.ts +455 -0
- package/contract/temporal.d.ts.map +1 -0
- package/contract/temporal.js +146 -0
- package/contract/tiles.d.ts +370 -0
- package/contract/tiles.d.ts.map +1 -0
- package/contract/tiles.js +519 -0
- package/contract/types.d.ts +694 -0
- package/contract/types.d.ts.map +1 -0
- package/contract/types.js +183 -0
- package/contract/widget-source.d.ts +205 -0
- package/contract/widget-source.d.ts.map +1 -0
- package/contract/widget-source.js +1473 -0
- package/control-plane/client.d.ts +95 -0
- package/control-plane/client.d.ts.map +1 -0
- package/control-plane/client.js +374 -0
- package/control-plane/index.d.ts +18 -0
- package/control-plane/index.d.ts.map +1 -0
- package/control-plane/index.js +14 -0
- package/control-plane/types.d.ts +233 -0
- package/control-plane/types.d.ts.map +1 -0
- package/control-plane/types.js +7 -0
- package/controls/basemap-style-binding.d.ts +54 -0
- package/controls/basemap-style-binding.d.ts.map +1 -0
- package/controls/basemap-style-binding.js +199 -0
- package/controls/basemap-switcher.d.ts +95 -0
- package/controls/basemap-switcher.d.ts.map +1 -0
- package/controls/basemap-switcher.js +379 -0
- package/controls/element-utils.d.ts +48 -0
- package/controls/element-utils.d.ts.map +1 -0
- package/controls/element-utils.js +78 -0
- package/controls/index.d.ts +33 -0
- package/controls/index.d.ts.map +1 -0
- package/controls/index.js +30 -0
- package/controls/layer-list.d.ts +98 -0
- package/controls/layer-list.d.ts.map +1 -0
- package/controls/layer-list.js +375 -0
- package/controls/legend-derive.d.ts +53 -0
- package/controls/legend-derive.d.ts.map +1 -0
- package/controls/legend-derive.js +196 -0
- package/controls/legend.d.ts +104 -0
- package/controls/legend.d.ts.map +1 -0
- package/controls/legend.js +381 -0
- package/controls/swipe-control.d.ts +80 -0
- package/controls/swipe-control.d.ts.map +1 -0
- package/controls/swipe-control.js +368 -0
- package/controls/types.d.ts +227 -0
- package/controls/types.d.ts.map +1 -0
- package/controls/types.js +11 -0
- 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/batch.d.ts +37 -0
- package/core/batch.d.ts.map +1 -0
- package/core/batch.js +79 -0
- package/core/cache-state.d.ts +79 -0
- package/core/cache-state.d.ts.map +1 -0
- package/core/cache-state.js +87 -0
- package/core/client.d.ts +607 -0
- package/core/client.d.ts.map +1 -0
- package/core/client.js +1716 -0
- package/core/compatibility.d.ts +18 -0
- package/core/compatibility.d.ts.map +1 -0
- package/core/compatibility.js +245 -0
- package/core/errors.d.ts +139 -0
- package/core/errors.d.ts.map +1 -0
- package/core/errors.js +176 -0
- package/core/esri-geojson.d.ts +66 -0
- package/core/esri-geojson.d.ts.map +1 -0
- package/core/esri-geojson.js +363 -0
- package/core/geoparquet-sql.d.ts +162 -0
- package/core/geoparquet-sql.d.ts.map +1 -0
- package/core/geoparquet-sql.js +333 -0
- package/core/geoservices.d.ts +34 -0
- package/core/geoservices.d.ts.map +1 -0
- package/core/geoservices.js +434 -0
- package/core/grpc-adapter.d.ts +23 -0
- package/core/grpc-adapter.d.ts.map +1 -0
- package/core/grpc-adapter.js +688 -0
- package/core/odata.d.ts +347 -0
- package/core/odata.d.ts.map +1 -0
- package/core/odata.js +913 -0
- package/core/ogc-conformance.d.ts +35 -0
- package/core/ogc-conformance.d.ts.map +1 -0
- package/core/ogc-conformance.js +134 -0
- 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 +23 -0
- package/core/ogc-features.d.ts.map +1 -0
- package/core/ogc-features.js +129 -0
- package/core/ogc-maps.d.ts +49 -0
- package/core/ogc-maps.d.ts.map +1 -0
- package/core/ogc-maps.js +126 -0
- package/core/ogc-processes.d.ts +118 -0
- package/core/ogc-processes.d.ts.map +1 -0
- package/core/ogc-processes.js +423 -0
- package/core/ogc-records.d.ts +75 -0
- package/core/ogc-records.d.ts.map +1 -0
- package/core/ogc-records.js +251 -0
- package/core/ogc-tiles.d.ts +125 -0
- package/core/ogc-tiles.d.ts.map +1 -0
- package/core/ogc-tiles.js +183 -0
- package/core/path-utils.d.ts +69 -0
- package/core/path-utils.d.ts.map +1 -0
- package/core/path-utils.js +123 -0
- package/core/pbf-decoder.d.ts +39 -0
- package/core/pbf-decoder.d.ts.map +1 -0
- package/core/pbf-decoder.js +702 -0
- package/core/process-runner.d.ts +104 -0
- package/core/process-runner.d.ts.map +1 -0
- package/core/process-runner.js +315 -0
- package/core/protocol-transport.d.ts +76 -0
- package/core/protocol-transport.d.ts.map +1 -0
- package/core/protocol-transport.js +15 -0
- package/core/query-builder.d.ts +261 -0
- package/core/query-builder.d.ts.map +1 -0
- package/core/query-builder.js +538 -0
- package/core/request-pipeline.d.ts +88 -0
- package/core/request-pipeline.d.ts.map +1 -0
- package/core/request-pipeline.js +273 -0
- package/core/spatial-filter.d.ts +93 -0
- package/core/spatial-filter.d.ts.map +1 -0
- package/core/spatial-filter.js +153 -0
- package/core/stac-static.d.ts +51 -0
- package/core/stac-static.d.ts.map +1 -0
- package/core/stac-static.js +195 -0
- package/core/stac.d.ts +67 -0
- package/core/stac.d.ts.map +1 -0
- package/core/stac.js +259 -0
- package/core/surfaces.d.ts +540 -0
- package/core/surfaces.d.ts.map +1 -0
- package/core/surfaces.js +1964 -0
- package/core/terrain-elevation.d.ts +114 -0
- package/core/terrain-elevation.d.ts.map +1 -0
- package/core/terrain-elevation.js +150 -0
- package/core/types.d.ts +1404 -0
- package/core/types.d.ts.map +1 -0
- package/core/types.js +13 -0
- package/core/wfs-capabilities.d.ts +153 -0
- package/core/wfs-capabilities.d.ts.map +1 -0
- package/core/wfs-capabilities.js +490 -0
- package/core/wfs-filter.d.ts +118 -0
- package/core/wfs-filter.d.ts.map +1 -0
- package/core/wfs-filter.js +634 -0
- package/core/wfs.d.ts +232 -0
- package/core/wfs.d.ts.map +1 -0
- package/core/wfs.js +426 -0
- package/core/wire-shared.d.ts +32 -0
- package/core/wire-shared.d.ts.map +1 -0
- package/core/wire-shared.js +76 -0
- package/core/wms-axis.d.ts +36 -0
- package/core/wms-axis.d.ts.map +1 -0
- package/core/wms-axis.js +73 -0
- package/core/wms-capabilities.d.ts +110 -0
- package/core/wms-capabilities.d.ts.map +1 -0
- package/core/wms-capabilities.js +559 -0
- package/core/wms-types.d.ts +128 -0
- package/core/wms-types.d.ts.map +1 -0
- package/core/wms-types.js +32 -0
- package/core/wms.d.ts +144 -0
- package/core/wms.d.ts.map +1 -0
- package/core/wms.js +338 -0
- package/core/wmts-capabilities.d.ts +82 -0
- package/core/wmts-capabilities.d.ts.map +1 -0
- package/core/wmts-capabilities.js +402 -0
- package/core/wmts.d.ts +103 -0
- package/core/wmts.d.ts.map +1 -0
- package/core/wmts.js +332 -0
- package/core/xml-text.d.ts +20 -0
- package/core/xml-text.d.ts.map +1 -0
- package/core/xml-text.js +85 -0
- package/esri-compat/basemap-gallery.d.ts +38 -0
- package/esri-compat/basemap-gallery.d.ts.map +1 -0
- package/esri-compat/basemap-gallery.js +159 -0
- package/esri-compat/basemap-layer-list.d.ts +35 -0
- package/esri-compat/basemap-layer-list.d.ts.map +1 -0
- package/esri-compat/basemap-layer-list.js +139 -0
- package/esri-compat/basemap.d.ts +32 -0
- package/esri-compat/basemap.d.ts.map +1 -0
- package/esri-compat/basemap.js +84 -0
- package/esri-compat/bookmarks.d.ts +36 -0
- package/esri-compat/bookmarks.d.ts.map +1 -0
- package/esri-compat/bookmarks.js +108 -0
- package/esri-compat/class-breaks-renderer.d.ts +50 -0
- package/esri-compat/class-breaks-renderer.d.ts.map +1 -0
- package/esri-compat/class-breaks-renderer.js +164 -0
- package/esri-compat/color.d.ts +22 -0
- package/esri-compat/color.d.ts.map +1 -0
- package/esri-compat/color.js +106 -0
- package/esri-compat/controls.d.ts +174 -0
- package/esri-compat/controls.d.ts.map +1 -0
- package/esri-compat/controls.js +479 -0
- package/esri-compat/coordinate-conversion.d.ts +41 -0
- package/esri-compat/coordinate-conversion.d.ts.map +1 -0
- package/esri-compat/coordinate-conversion.js +125 -0
- package/esri-compat/directions.d.ts +45 -0
- package/esri-compat/directions.d.ts.map +1 -0
- package/esri-compat/directions.js +123 -0
- package/esri-compat/editor.d.ts +47 -0
- package/esri-compat/editor.d.ts.map +1 -0
- package/esri-compat/editor.js +170 -0
- package/esri-compat/esri-config.d.ts +16 -0
- package/esri-compat/esri-config.d.ts.map +1 -0
- package/esri-compat/esri-config.js +23 -0
- package/esri-compat/esri-request.d.ts +17 -0
- package/esri-compat/esri-request.d.ts.map +1 -0
- package/esri-compat/esri-request.js +127 -0
- package/esri-compat/event-bus.d.ts +106 -0
- package/esri-compat/event-bus.d.ts.map +1 -0
- package/esri-compat/event-bus.js +90 -0
- package/esri-compat/expand.d.ts +36 -0
- package/esri-compat/expand.d.ts.map +1 -0
- package/esri-compat/expand.js +97 -0
- package/esri-compat/extent.d.ts +43 -0
- package/esri-compat/extent.d.ts.map +1 -0
- package/esri-compat/extent.js +140 -0
- package/esri-compat/feature-filter.d.ts +55 -0
- package/esri-compat/feature-filter.d.ts.map +1 -0
- package/esri-compat/feature-filter.js +109 -0
- package/esri-compat/feature-form.d.ts +64 -0
- package/esri-compat/feature-form.d.ts.map +1 -0
- package/esri-compat/feature-form.js +137 -0
- package/esri-compat/feature-layer.d.ts +173 -0
- package/esri-compat/feature-layer.d.ts.map +1 -0
- package/esri-compat/feature-layer.js +661 -0
- package/esri-compat/feature-set.d.ts +32 -0
- package/esri-compat/feature-set.d.ts.map +1 -0
- package/esri-compat/feature-set.js +80 -0
- package/esri-compat/feature-table.d.ts +141 -0
- package/esri-compat/feature-table.d.ts.map +1 -0
- package/esri-compat/feature-table.js +500 -0
- package/esri-compat/feature-templates.d.ts +41 -0
- package/esri-compat/feature-templates.d.ts.map +1 -0
- package/esri-compat/feature-templates.js +97 -0
- package/esri-compat/feature.d.ts +33 -0
- package/esri-compat/feature.d.ts.map +1 -0
- package/esri-compat/feature.js +83 -0
- package/esri-compat/geojson-layer.d.ts +86 -0
- package/esri-compat/geojson-layer.d.ts.map +1 -0
- package/esri-compat/geojson-layer.js +191 -0
- package/esri-compat/geometry-engine.d.ts +107 -0
- package/esri-compat/geometry-engine.d.ts.map +1 -0
- package/esri-compat/geometry-engine.js +266 -0
- package/esri-compat/graphic.d.ts +46 -0
- package/esri-compat/graphic.d.ts.map +1 -0
- package/esri-compat/graphic.js +103 -0
- package/esri-compat/graphics-layer.d.ts +49 -0
- package/esri-compat/graphics-layer.d.ts.map +1 -0
- package/esri-compat/graphics-layer.js +185 -0
- package/esri-compat/group-layer.d.ts +48 -0
- package/esri-compat/group-layer.d.ts.map +1 -0
- package/esri-compat/group-layer.js +212 -0
- package/esri-compat/identify.d.ts +71 -0
- package/esri-compat/identify.d.ts.map +1 -0
- package/esri-compat/identify.js +299 -0
- package/esri-compat/identity-manager.d.ts +74 -0
- package/esri-compat/identity-manager.d.ts.map +1 -0
- package/esri-compat/identity-manager.js +245 -0
- package/esri-compat/imagery-layer.d.ts +78 -0
- package/esri-compat/imagery-layer.d.ts.map +1 -0
- package/esri-compat/imagery-layer.js +167 -0
- package/esri-compat/label-class.d.ts +31 -0
- package/esri-compat/label-class.d.ts.map +1 -0
- package/esri-compat/label-class.js +102 -0
- package/esri-compat/layer-list.d.ts +77 -0
- package/esri-compat/layer-list.d.ts.map +1 -0
- package/esri-compat/layer-list.js +342 -0
- package/esri-compat/legend.d.ts +53 -0
- package/esri-compat/legend.d.ts.map +1 -0
- package/esri-compat/legend.js +254 -0
- package/esri-compat/map-image-layer.d.ts +162 -0
- package/esri-compat/map-image-layer.d.ts.map +1 -0
- package/esri-compat/map-image-layer.js +709 -0
- package/esri-compat/map-view.d.ts +323 -0
- package/esri-compat/map-view.d.ts.map +1 -0
- package/esri-compat/map-view.js +1175 -0
- package/esri-compat/map.d.ts +47 -0
- package/esri-compat/map.d.ts.map +1 -0
- package/esri-compat/map.js +209 -0
- package/esri-compat/measurement-2d.d.ts +61 -0
- package/esri-compat/measurement-2d.d.ts.map +1 -0
- package/esri-compat/measurement-2d.js +184 -0
- package/esri-compat/measurement.d.ts +45 -0
- package/esri-compat/measurement.d.ts.map +1 -0
- package/esri-compat/measurement.js +193 -0
- package/esri-compat/oauth-info.d.ts +50 -0
- package/esri-compat/oauth-info.d.ts.map +1 -0
- package/esri-compat/oauth-info.js +142 -0
- package/esri-compat/picture-marker-symbol.d.ts +35 -0
- package/esri-compat/picture-marker-symbol.d.ts.map +1 -0
- package/esri-compat/picture-marker-symbol.js +126 -0
- package/esri-compat/point.d.ts +31 -0
- package/esri-compat/point.d.ts.map +1 -0
- package/esri-compat/point.js +102 -0
- package/esri-compat/polygon.d.ts +31 -0
- package/esri-compat/polygon.d.ts.map +1 -0
- package/esri-compat/polygon.js +107 -0
- package/esri-compat/polyline.d.ts +31 -0
- package/esri-compat/polyline.d.ts.map +1 -0
- package/esri-compat/polyline.js +107 -0
- package/esri-compat/popup-template.d.ts +55 -0
- package/esri-compat/popup-template.d.ts.map +1 -0
- package/esri-compat/popup-template.js +128 -0
- package/esri-compat/popup.d.ts +54 -0
- package/esri-compat/popup.d.ts.map +1 -0
- package/esri-compat/popup.js +312 -0
- package/esri-compat/print.d.ts +47 -0
- package/esri-compat/print.d.ts.map +1 -0
- package/esri-compat/print.js +105 -0
- package/esri-compat/query.d.ts +58 -0
- package/esri-compat/query.d.ts.map +1 -0
- package/esri-compat/query.js +128 -0
- package/esri-compat/reactive-utils.d.ts +24 -0
- package/esri-compat/reactive-utils.d.ts.map +1 -0
- package/esri-compat/reactive-utils.js +193 -0
- package/esri-compat/request.d.ts +41 -0
- package/esri-compat/request.d.ts.map +1 -0
- package/esri-compat/request.js +253 -0
- package/esri-compat/route-layer.d.ts +59 -0
- package/esri-compat/route-layer.d.ts.map +1 -0
- package/esri-compat/route-layer.js +223 -0
- package/esri-compat/route-task.d.ts +88 -0
- package/esri-compat/route-task.d.ts.map +1 -0
- package/esri-compat/route-task.js +225 -0
- package/esri-compat/scene-view.d.ts +41 -0
- package/esri-compat/scene-view.d.ts.map +1 -0
- package/esri-compat/scene-view.js +68 -0
- package/esri-compat/search.d.ts +112 -0
- package/esri-compat/search.d.ts.map +1 -0
- package/esri-compat/search.js +820 -0
- package/esri-compat/simple-fill-symbol.d.ts +27 -0
- package/esri-compat/simple-fill-symbol.d.ts.map +1 -0
- package/esri-compat/simple-fill-symbol.js +85 -0
- package/esri-compat/simple-line-symbol.d.ts +27 -0
- package/esri-compat/simple-line-symbol.d.ts.map +1 -0
- package/esri-compat/simple-line-symbol.js +85 -0
- package/esri-compat/simple-marker-symbol.d.ts +29 -0
- package/esri-compat/simple-marker-symbol.d.ts.map +1 -0
- package/esri-compat/simple-marker-symbol.js +92 -0
- package/esri-compat/simple-renderer.d.ts +29 -0
- package/esri-compat/simple-renderer.d.ts.map +1 -0
- package/esri-compat/simple-renderer.js +92 -0
- package/esri-compat/sketch.d.ts +64 -0
- package/esri-compat/sketch.d.ts.map +1 -0
- package/esri-compat/sketch.js +227 -0
- package/esri-compat/spatial-reference.d.ts +31 -0
- package/esri-compat/spatial-reference.d.ts.map +1 -0
- package/esri-compat/spatial-reference.js +102 -0
- package/esri-compat/swipe.d.ts +34 -0
- package/esri-compat/swipe.d.ts.map +1 -0
- package/esri-compat/swipe.js +93 -0
- package/esri-compat/table-list.d.ts +36 -0
- package/esri-compat/table-list.d.ts.map +1 -0
- package/esri-compat/table-list.js +126 -0
- package/esri-compat/text-symbol.d.ts +37 -0
- package/esri-compat/text-symbol.d.ts.map +1 -0
- package/esri-compat/text-symbol.js +123 -0
- package/esri-compat/tile-layer.d.ts +52 -0
- package/esri-compat/tile-layer.d.ts.map +1 -0
- package/esri-compat/tile-layer.js +168 -0
- package/esri-compat/time-slider.d.ts +70 -0
- package/esri-compat/time-slider.d.ts.map +1 -0
- package/esri-compat/time-slider.js +208 -0
- package/esri-compat/track.d.ts +51 -0
- package/esri-compat/track.d.ts.map +1 -0
- package/esri-compat/track.js +174 -0
- package/esri-compat/unique-value-renderer.d.ts +41 -0
- package/esri-compat/unique-value-renderer.d.ts.map +1 -0
- package/esri-compat/unique-value-renderer.js +127 -0
- package/esri-compat/url.d.ts +13 -0
- package/esri-compat/url.d.ts.map +1 -0
- package/esri-compat/url.js +68 -0
- package/esri-compat/vector-tile-layer.d.ts +47 -0
- package/esri-compat/vector-tile-layer.d.ts.map +1 -0
- package/esri-compat/vector-tile-layer.js +130 -0
- package/esri-compat/web-map.d.ts +14 -0
- package/esri-compat/web-map.d.ts.map +1 -0
- package/esri-compat/web-map.js +24 -0
- package/esri-compat/wfs-layer.d.ts +64 -0
- package/esri-compat/wfs-layer.d.ts.map +1 -0
- package/esri-compat/wfs-layer.js +145 -0
- package/esri-compat/wms-layer.d.ts +76 -0
- package/esri-compat/wms-layer.d.ts.map +1 -0
- package/esri-compat/wms-layer.js +157 -0
- package/exploration/context.d.ts +25 -0
- package/exploration/context.d.ts.map +1 -0
- package/exploration/context.js +396 -0
- package/exploration/index.d.ts +27 -0
- package/exploration/index.d.ts.map +1 -0
- package/exploration/index.js +24 -0
- package/exploration/presets.d.ts +27 -0
- package/exploration/presets.d.ts.map +1 -0
- package/exploration/presets.js +114 -0
- package/exploration/reducer.d.ts +23 -0
- package/exploration/reducer.d.ts.map +1 -0
- package/exploration/reducer.js +332 -0
- package/exploration/selection.d.ts +25 -0
- package/exploration/selection.d.ts.map +1 -0
- package/exploration/selection.js +34 -0
- package/exploration/selectors.d.ts +56 -0
- package/exploration/selectors.d.ts.map +1 -0
- package/exploration/selectors.js +110 -0
- package/exploration/types.d.ts +294 -0
- package/exploration/types.d.ts.map +1 -0
- package/exploration/types.js +33 -0
- package/expr/expression.d.ts +457 -0
- package/expr/expression.d.ts.map +1 -0
- package/expr/expression.js +663 -0
- package/expr/index.d.ts +32 -0
- package/expr/index.d.ts.map +1 -0
- package/expr/index.js +30 -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/gen/honua/v1/feature_service_pb.d.ts +918 -0
- package/gen/honua/v1/feature_service_pb.d.ts.map +1 -0
- package/gen/honua/v1/feature_service_pb.js +375 -0
- package/generated-app/errors.d.ts +41 -0
- package/generated-app/errors.d.ts.map +1 -0
- package/generated-app/errors.js +41 -0
- package/generated-app/index.d.ts +17 -0
- package/generated-app/index.d.ts.map +1 -0
- package/generated-app/index.js +12 -0
- package/generated-app/manifest.d.ts +183 -0
- package/generated-app/manifest.d.ts.map +1 -0
- package/generated-app/manifest.js +14 -0
- package/generated-app/projection.d.ts +44 -0
- package/generated-app/projection.d.ts.map +1 -0
- package/generated-app/projection.js +234 -0
- package/generated-app/runtime.d.ts +215 -0
- package/generated-app/runtime.d.ts.map +1 -0
- package/generated-app/runtime.js +1196 -0
- package/geocoding/index.d.ts +106 -0
- package/geocoding/index.d.ts.map +1 -0
- package/geocoding/index.js +278 -0
- package/interactions/detail-model.d.ts +54 -0
- package/interactions/detail-model.d.ts.map +1 -0
- package/interactions/detail-model.js +105 -0
- package/interactions/exploration-bindings.d.ts +120 -0
- package/interactions/exploration-bindings.d.ts.map +1 -0
- package/interactions/exploration-bindings.js +218 -0
- package/interactions/feature-state.d.ts +144 -0
- package/interactions/feature-state.d.ts.map +1 -0
- package/interactions/feature-state.js +169 -0
- package/interactions/hit-test.d.ts +112 -0
- package/interactions/hit-test.d.ts.map +1 -0
- package/interactions/hit-test.js +291 -0
- package/interactions/index.d.ts +31 -0
- package/interactions/index.d.ts.map +1 -0
- package/interactions/index.js +24 -0
- package/interactions/share-state.d.ts +36 -0
- package/interactions/share-state.d.ts.map +1 -0
- package/interactions/share-state.js +123 -0
- package/map/feature-service-adapter.d.ts +138 -0
- package/map/feature-service-adapter.d.ts.map +1 -0
- package/map/feature-service-adapter.js +279 -0
- package/map/honua-map.d.ts +203 -0
- package/map/honua-map.d.ts.map +1 -0
- package/map/honua-map.js +347 -0
- package/map/index.d.ts +27 -0
- package/map/index.d.ts.map +1 -0
- package/map/index.js +22 -0
- package/map/maplibre-target.d.ts +103 -0
- package/map/maplibre-target.d.ts.map +1 -0
- package/map/maplibre-target.js +164 -0
- package/map/webmap-maplibre.d.ts +60 -0
- package/map/webmap-maplibre.d.ts.map +1 -0
- package/map/webmap-maplibre.js +212 -0
- package/operate/client.d.ts +94 -0
- package/operate/client.d.ts.map +1 -0
- package/operate/client.js +361 -0
- package/operate/index.d.ts +22 -0
- package/operate/index.d.ts.map +1 -0
- package/operate/index.js +19 -0
- package/operate/types.d.ts +397 -0
- package/operate/types.d.ts.map +1 -0
- package/operate/types.js +17 -0
- package/operator/client.d.ts +60 -0
- package/operator/client.d.ts.map +1 -0
- package/operator/client.js +20 -0
- package/operator/controllers/approval.d.ts +52 -0
- package/operator/controllers/approval.d.ts.map +1 -0
- package/operator/controllers/approval.js +123 -0
- package/operator/controllers/base.d.ts +27 -0
- package/operator/controllers/base.d.ts.map +1 -0
- package/operator/controllers/base.js +53 -0
- package/operator/controllers/builder-workspace.d.ts +55 -0
- package/operator/controllers/builder-workspace.d.ts.map +1 -0
- package/operator/controllers/builder-workspace.js +108 -0
- package/operator/controllers/chat.d.ts +61 -0
- package/operator/controllers/chat.d.ts.map +1 -0
- package/operator/controllers/chat.js +154 -0
- package/operator/controllers/clarification.d.ts +52 -0
- package/operator/controllers/clarification.d.ts.map +1 -0
- package/operator/controllers/clarification.js +121 -0
- package/operator/controllers/execution.d.ts +60 -0
- package/operator/controllers/execution.d.ts.map +1 -0
- package/operator/controllers/execution.js +286 -0
- package/operator/controllers/index.d.ts +23 -0
- package/operator/controllers/index.d.ts.map +1 -0
- package/operator/controllers/index.js +15 -0
- package/operator/controllers/map-workspace.d.ts +85 -0
- package/operator/controllers/map-workspace.d.ts.map +1 -0
- package/operator/controllers/map-workspace.js +296 -0
- package/operator/controllers/plan-review.d.ts +66 -0
- package/operator/controllers/plan-review.d.ts.map +1 -0
- package/operator/controllers/plan-review.js +124 -0
- package/operator/errors.d.ts +62 -0
- package/operator/errors.d.ts.map +1 -0
- package/operator/errors.js +75 -0
- package/operator/i18n/index.d.ts +10 -0
- package/operator/i18n/index.d.ts.map +1 -0
- package/operator/i18n/index.js +8 -0
- package/operator/i18n/messages.d.ts +19 -0
- package/operator/i18n/messages.d.ts.map +1 -0
- package/operator/i18n/messages.js +54 -0
- package/operator/index.d.ts +19 -0
- package/operator/index.d.ts.map +1 -0
- package/operator/index.js +15 -0
- package/operator/telemetry.d.ts +26 -0
- package/operator/telemetry.d.ts.map +1 -0
- package/operator/telemetry.js +9 -0
- package/operator/theming/index.d.ts +12 -0
- package/operator/theming/index.d.ts.map +1 -0
- package/operator/theming/index.js +9 -0
- package/operator/theming/provider.d.ts +27 -0
- package/operator/theming/provider.d.ts.map +1 -0
- package/operator/theming/provider.js +26 -0
- package/operator/theming/tokens.d.ts +28 -0
- package/operator/theming/tokens.d.ts.map +1 -0
- package/operator/theming/tokens.js +65 -0
- package/operator/workspace/events.d.ts +70 -0
- package/operator/workspace/events.d.ts.map +1 -0
- package/operator/workspace/events.js +9 -0
- package/operator/workspace/index.d.ts +12 -0
- package/operator/workspace/index.d.ts.map +1 -0
- package/operator/workspace/index.js +8 -0
- package/operator/workspace/types.d.ts +178 -0
- package/operator/workspace/types.d.ts.map +1 -0
- package/operator/workspace/types.js +47 -0
- package/operator/workspace/workspace.d.ts +58 -0
- package/operator/workspace/workspace.d.ts.map +1 -0
- package/operator/workspace/workspace.js +339 -0
- package/package.json +105 -0
- package/realtime/exploration.d.ts +16 -0
- package/realtime/exploration.d.ts.map +1 -0
- package/realtime/exploration.js +32 -0
- package/realtime/honua-server.d.ts +123 -0
- package/realtime/honua-server.d.ts.map +1 -0
- package/realtime/honua-server.js +188 -0
- package/realtime/index.d.ts +20 -0
- package/realtime/index.d.ts.map +1 -0
- package/realtime/index.js +14 -0
- package/realtime/projections.d.ts +30 -0
- package/realtime/projections.d.ts.map +1 -0
- package/realtime/projections.js +51 -0
- package/realtime/reducer.d.ts +14 -0
- package/realtime/reducer.d.ts.map +1 -0
- package/realtime/reducer.js +351 -0
- package/realtime/sse.d.ts +23 -0
- package/realtime/sse.d.ts.map +1 -0
- package/realtime/sse.js +143 -0
- package/realtime/store.d.ts +18 -0
- package/realtime/store.d.ts.map +1 -0
- package/realtime/store.js +63 -0
- package/realtime/types.d.ts +190 -0
- package/realtime/types.d.ts.map +1 -0
- package/realtime/types.js +10 -0
- package/replica-sync/client.d.ts +32 -0
- package/replica-sync/client.d.ts.map +1 -0
- package/replica-sync/client.js +52 -0
- package/replica-sync/errors.d.ts +22 -0
- package/replica-sync/errors.d.ts.map +1 -0
- package/replica-sync/errors.js +29 -0
- package/replica-sync/fixture.d.ts +40 -0
- package/replica-sync/fixture.d.ts.map +1 -0
- package/replica-sync/fixture.js +364 -0
- package/replica-sync/index.d.ts +22 -0
- package/replica-sync/index.d.ts.map +1 -0
- package/replica-sync/index.js +17 -0
- package/replica-sync/types.d.ts +270 -0
- package/replica-sync/types.d.ts.map +1 -0
- package/replica-sync/types.js +13 -0
- package/runtime/diff.d.ts +31 -0
- package/runtime/diff.d.ts.map +1 -0
- package/runtime/diff.js +143 -0
- package/runtime/errors.d.ts +40 -0
- package/runtime/errors.d.ts.map +1 -0
- package/runtime/errors.js +35 -0
- package/runtime/index.d.ts +59 -0
- package/runtime/index.d.ts.map +1 -0
- package/runtime/index.js +40 -0
- package/runtime/legend.d.ts +23 -0
- package/runtime/legend.d.ts.map +1 -0
- package/runtime/legend.js +38 -0
- package/runtime/load-package.d.ts +125 -0
- package/runtime/load-package.d.ts.map +1 -0
- package/runtime/load-package.js +272 -0
- package/runtime/map-package-fetch.d.ts +107 -0
- package/runtime/map-package-fetch.d.ts.map +1 -0
- package/runtime/map-package-fetch.js +336 -0
- package/runtime/map-package-realtime.d.ts +169 -0
- package/runtime/map-package-realtime.d.ts.map +1 -0
- package/runtime/map-package-realtime.js +350 -0
- package/runtime/map-package-validation.d.ts +30 -0
- package/runtime/map-package-validation.d.ts.map +1 -0
- package/runtime/map-package-validation.js +257 -0
- package/runtime/map-package-watch.d.ts +78 -0
- package/runtime/map-package-watch.d.ts.map +1 -0
- package/runtime/map-package-watch.js +695 -0
- package/runtime/map-package.d.ts +167 -0
- package/runtime/map-package.d.ts.map +1 -0
- package/runtime/map-package.js +15 -0
- package/runtime/ogc-styles.d.ts +110 -0
- package/runtime/ogc-styles.d.ts.map +1 -0
- package/runtime/ogc-styles.js +195 -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/popups.d.ts +62 -0
- package/runtime/popups.d.ts.map +1 -0
- package/runtime/popups.js +95 -0
- package/runtime/query-tiles.d.ts +217 -0
- package/runtime/query-tiles.d.ts.map +1 -0
- package/runtime/query-tiles.js +801 -0
- package/runtime/runtime.d.ts +243 -0
- package/runtime/runtime.d.ts.map +1 -0
- package/runtime/runtime.js +1147 -0
- package/runtime/source-bridge.d.ts +99 -0
- package/runtime/source-bridge.d.ts.map +1 -0
- package/runtime/source-bridge.js +428 -0
- package/runtime/style-compose.d.ts +46 -0
- package/runtime/style-compose.d.ts.map +1 -0
- package/runtime/style-compose.js +144 -0
- package/runtime/style-interactions.d.ts +141 -0
- package/runtime/style-interactions.d.ts.map +1 -0
- package/runtime/style-interactions.js +574 -0
- package/runtime/style-spec-validation.d.ts +23 -0
- package/runtime/style-spec-validation.d.ts.map +1 -0
- package/runtime/style-spec-validation.js +357 -0
- package/scene-workspace/analysis-widgets.d.ts +334 -0
- package/scene-workspace/analysis-widgets.d.ts.map +1 -0
- package/scene-workspace/analysis-widgets.js +424 -0
- package/scene-workspace/cesium-adapter.d.ts +438 -0
- package/scene-workspace/cesium-adapter.d.ts.map +1 -0
- package/scene-workspace/cesium-adapter.js +493 -0
- package/scene-workspace/index.d.ts +21 -0
- package/scene-workspace/index.d.ts.map +1 -0
- package/scene-workspace/index.js +14 -0
- package/scene-workspace/primitives.d.ts +162 -0
- package/scene-workspace/primitives.d.ts.map +1 -0
- package/scene-workspace/primitives.js +255 -0
- package/scene-workspace/scene-discovery.d.ts +196 -0
- package/scene-workspace/scene-discovery.d.ts.map +1 -0
- package/scene-workspace/scene-discovery.js +228 -0
- package/scene-workspace/scene-view.d.ts +209 -0
- package/scene-workspace/scene-view.d.ts.map +1 -0
- package/scene-workspace/scene-view.js +267 -0
- package/scene-workspace/types.d.ts +229 -0
- package/scene-workspace/types.d.ts.map +1 -0
- package/scene-workspace/types.js +23 -0
- package/scene-workspace/workspace.d.ts +13 -0
- package/scene-workspace/workspace.d.ts.map +1 -0
- package/scene-workspace/workspace.js +391 -0
- package/share/denial.d.ts +78 -0
- package/share/denial.d.ts.map +1 -0
- package/share/denial.js +61 -0
- package/share/embed-token.d.ts +71 -0
- package/share/embed-token.d.ts.map +1 -0
- package/share/embed-token.js +99 -0
- package/share/index.d.ts +35 -0
- package/share/index.d.ts.map +1 -0
- package/share/index.js +30 -0
- package/share/open-data.d.ts +114 -0
- package/share/open-data.d.ts.map +1 -0
- package/share/open-data.js +81 -0
- package/share/types.d.ts +163 -0
- package/share/types.d.ts.map +1 -0
- package/share/types.js +17 -0
- package/studio/capability-manifest.d.ts +285 -0
- package/studio/capability-manifest.d.ts.map +1 -0
- package/studio/capability-manifest.js +59 -0
- package/studio/chart-spec.d.ts +85 -0
- package/studio/chart-spec.d.ts.map +1 -0
- package/studio/chart-spec.js +106 -0
- package/studio/index.d.ts +34 -0
- package/studio/index.d.ts.map +1 -0
- package/studio/index.js +27 -0
- package/studio/provenance.d.ts +131 -0
- package/studio/provenance.d.ts.map +1 -0
- package/studio/provenance.js +39 -0
- package/studio/publish.d.ts +64 -0
- package/studio/publish.d.ts.map +1 -0
- package/studio/publish.js +13 -0
- package/studio/types.d.ts +278 -0
- package/studio/types.d.ts.map +1 -0
- package/studio/types.js +71 -0
- package/studio/validate.d.ts +45 -0
- package/studio/validate.d.ts.map +1 -0
- package/studio/validate.js +255 -0
- package/studio/validation.d.ts +112 -0
- package/studio/validation.d.ts.map +1 -0
- package/studio/validation.js +42 -0
- package/style/factory.d.ts +30 -0
- package/style/factory.d.ts.map +1 -0
- package/style/factory.js +61 -0
- package/style/index.d.ts +25 -0
- package/style/index.d.ts.map +1 -0
- package/style/index.js +24 -0
- package/style/specification.d.ts +203 -0
- package/style/specification.d.ts.map +1 -0
- package/style/specification.js +178 -0
- package/style/wms-wmts-resolvers.d.ts +38 -0
- package/style/wms-wmts-resolvers.d.ts.map +1 -0
- package/style/wms-wmts-resolvers.js +92 -0
- package/web-components/controller.d.ts +39 -0
- package/web-components/controller.d.ts.map +1 -0
- package/web-components/controller.js +640 -0
- package/web-components/elements.d.ts +210 -0
- package/web-components/elements.d.ts.map +1 -0
- package/web-components/elements.js +1651 -0
- package/web-components/index.d.ts +24 -0
- package/web-components/index.d.ts.map +1 -0
- package/web-components/index.js +22 -0
- package/web-components/maplibre-renderer.d.ts +22 -0
- package/web-components/maplibre-renderer.d.ts.map +1 -0
- package/web-components/maplibre-renderer.js +474 -0
- package/web-components/types.d.ts +397 -0
- package/web-components/types.d.ts.map +1 -0
- package/web-components/types.js +1 -0
- package/webmap/contract.d.ts +28 -0
- package/webmap/contract.d.ts.map +1 -0
- package/webmap/contract.js +130 -0
- package/webmap/convert-basemap.d.ts +17 -0
- package/webmap/convert-basemap.d.ts.map +1 -0
- package/webmap/convert-basemap.js +78 -0
- package/webmap/convert-extent.d.ts +17 -0
- package/webmap/convert-extent.d.ts.map +1 -0
- package/webmap/convert-extent.js +114 -0
- package/webmap/convert-label.d.ts +13 -0
- package/webmap/convert-label.d.ts.map +1 -0
- package/webmap/convert-label.js +125 -0
- package/webmap/convert-layer.d.ts +22 -0
- package/webmap/convert-layer.d.ts.map +1 -0
- package/webmap/convert-layer.js +181 -0
- package/webmap/convert-popup.d.ts +34 -0
- package/webmap/convert-popup.d.ts.map +1 -0
- package/webmap/convert-popup.js +68 -0
- package/webmap/convert-renderer.d.ts +17 -0
- package/webmap/convert-renderer.d.ts.map +1 -0
- package/webmap/convert-renderer.js +161 -0
- package/webmap/convert-symbol.d.ts +17 -0
- package/webmap/convert-symbol.d.ts.map +1 -0
- package/webmap/convert-symbol.js +122 -0
- package/webmap/index.d.ts +44 -0
- package/webmap/index.d.ts.map +1 -0
- package/webmap/index.js +33 -0
- package/webmap/parse.d.ts +25 -0
- package/webmap/parse.d.ts.map +1 -0
- package/webmap/parse.js +83 -0
- package/webmap/types.d.ts +264 -0
- package/webmap/types.d.ts.map +1 -0
- package/webmap/types.js +13 -0
- package/webmap/warnings.d.ts +30 -0
- package/webmap/warnings.d.ts.map +1 -0
- package/webmap/warnings.js +37 -0
package/map/honua-map.js
ADDED
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HonuaMap — Source/Layer separation for multi-protocol geospatial maps.
|
|
3
|
+
*
|
|
4
|
+
* Manages named data sources (protocol-aware: Feature Service, Map Service,
|
|
5
|
+
* OGC Features) separately from named rendering layers. One source can back
|
|
6
|
+
* multiple layers; layers reference sources by name.
|
|
7
|
+
*
|
|
8
|
+
* Does **not** depend on `maplibre-gl` at runtime. Produces a
|
|
9
|
+
* MapLibre-compatible style via {@link HonuaMap.toStyle} and exposes the
|
|
10
|
+
* underlying SDK surface instances via {@link HonuaMap.getSource}.
|
|
11
|
+
*
|
|
12
|
+
* @module
|
|
13
|
+
*/
|
|
14
|
+
import { HonuaFeatureLayer, HonuaMapService, HonuaOgcFeatures, } from "../core/surfaces.js";
|
|
15
|
+
import { parseFeatureLayerUrl, parseMapServiceUrl } from "../esri-compat/url.js";
|
|
16
|
+
import { isFeatureServiceSource, isHonuaSource, isMapServiceSource, isOgcFeaturesSource, isWmsSource, isWmtsSource, parseOgcFeaturesUrl, } from "../style/specification.js";
|
|
17
|
+
import { resolveWmsSpec, resolveWmtsSpec } from "../style/wms-wmts-resolvers.js";
|
|
18
|
+
// ── HonuaMap ──────────────────────────────────────────────────
|
|
19
|
+
/**
|
|
20
|
+
* A protocol-aware map that separates data sources from rendering layers.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```ts
|
|
24
|
+
* const map = new HonuaMap({ client });
|
|
25
|
+
*
|
|
26
|
+
* map.addSource("parcels", {
|
|
27
|
+
* type: "honua-feature-service",
|
|
28
|
+
* url: "https://gis.example.com/rest/services/parcels/FeatureServer/0",
|
|
29
|
+
* definitionExpression: "status = 'active'",
|
|
30
|
+
* });
|
|
31
|
+
*
|
|
32
|
+
* map.addLayer({
|
|
33
|
+
* id: "parcel-fill",
|
|
34
|
+
* source: "parcels",
|
|
35
|
+
* type: "fill",
|
|
36
|
+
* paint: { "fill-color": "#088", "fill-opacity": 0.5 },
|
|
37
|
+
* });
|
|
38
|
+
*
|
|
39
|
+
* map.addLayer({
|
|
40
|
+
* id: "parcel-labels",
|
|
41
|
+
* source: "parcels",
|
|
42
|
+
* type: "symbol",
|
|
43
|
+
* layout: { "text-field": ["get", "parcel_id"] },
|
|
44
|
+
* });
|
|
45
|
+
*
|
|
46
|
+
* // Access the underlying surface for queries
|
|
47
|
+
* const parcels = map.getSource("parcels"); // HonuaFeatureLayer
|
|
48
|
+
* const count = await (parcels as HonuaFeatureLayer).queryFeatureCount();
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
export class HonuaMap {
|
|
52
|
+
#client;
|
|
53
|
+
#sources = new Map();
|
|
54
|
+
#layers = [];
|
|
55
|
+
#listeners = new Set();
|
|
56
|
+
constructor(options) {
|
|
57
|
+
this.#client = options.client;
|
|
58
|
+
if (options.style) {
|
|
59
|
+
this.#loadStyle(options.style);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
// ── Source management ───────────────────────────────────────
|
|
63
|
+
/**
|
|
64
|
+
* Register a named data source.
|
|
65
|
+
*
|
|
66
|
+
* Honua sources (`honua-feature-service`, `honua-map-service`,
|
|
67
|
+
* `honua-ogc-features`) are resolved into SDK surface instances.
|
|
68
|
+
* Native MapLibre sources (`vector`, `raster`, `geojson`) are stored
|
|
69
|
+
* as-is and resolve to `null`.
|
|
70
|
+
*
|
|
71
|
+
* @throws If a source with the same name already exists.
|
|
72
|
+
*/
|
|
73
|
+
addSource(name, spec) {
|
|
74
|
+
if (this.#sources.has(name)) {
|
|
75
|
+
throw new Error(`Source "${name}" already exists. Remove it first.`);
|
|
76
|
+
}
|
|
77
|
+
const resolved = this.#resolveSource(spec);
|
|
78
|
+
this.#sources.set(name, { spec, resolved });
|
|
79
|
+
this.#emit({ type: "source-added", sourceId: name });
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Remove a named data source and all layers that reference it.
|
|
83
|
+
*
|
|
84
|
+
* @returns The IDs of layers that were removed.
|
|
85
|
+
*/
|
|
86
|
+
removeSource(name) {
|
|
87
|
+
if (!this.#sources.has(name))
|
|
88
|
+
return [];
|
|
89
|
+
// Collect dependent layers in order, then remove back-to-front
|
|
90
|
+
const removed = [];
|
|
91
|
+
const indicesToRemove = [];
|
|
92
|
+
for (let i = 0; i < this.#layers.length; i++) {
|
|
93
|
+
if (this.#layers[i].spec.source === name) {
|
|
94
|
+
removed.push(this.#layers[i].id);
|
|
95
|
+
indicesToRemove.push(i);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
for (let i = indicesToRemove.length - 1; i >= 0; i--) {
|
|
99
|
+
this.#layers.splice(indicesToRemove[i], 1);
|
|
100
|
+
}
|
|
101
|
+
for (const id of removed) {
|
|
102
|
+
this.#emit({ type: "layer-removed", layerId: id });
|
|
103
|
+
}
|
|
104
|
+
this.#sources.delete(name);
|
|
105
|
+
this.#emit({ type: "source-removed", sourceId: name });
|
|
106
|
+
return removed;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Get the resolved SDK surface for a source.
|
|
110
|
+
*
|
|
111
|
+
* Returns `null` for native MapLibre sources (they should be handled
|
|
112
|
+
* by MapLibre directly). Returns `undefined` if the source does not exist.
|
|
113
|
+
*/
|
|
114
|
+
getSource(name) {
|
|
115
|
+
return this.#sources.get(name)?.resolved;
|
|
116
|
+
}
|
|
117
|
+
/** Get the raw specification for a source. */
|
|
118
|
+
getSourceSpec(name) {
|
|
119
|
+
return this.#sources.get(name)?.spec;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Replace a source specification while preserving layers that reference it.
|
|
123
|
+
*
|
|
124
|
+
* This updates the resolved SDK surface for Honua custom source types and
|
|
125
|
+
* leaves render layers in place so callers can decide how to patch the
|
|
126
|
+
* renderer.
|
|
127
|
+
*
|
|
128
|
+
* @throws If the source does not exist.
|
|
129
|
+
*/
|
|
130
|
+
updateSource(name, spec) {
|
|
131
|
+
if (!this.#sources.has(name)) {
|
|
132
|
+
throw new Error(`Source "${name}" not found.`);
|
|
133
|
+
}
|
|
134
|
+
const resolved = this.#resolveSource(spec);
|
|
135
|
+
this.#sources.set(name, { spec, resolved });
|
|
136
|
+
this.#emit({ type: "source-updated", sourceId: name });
|
|
137
|
+
}
|
|
138
|
+
/** Check whether a source with the given name exists. */
|
|
139
|
+
hasSource(name) {
|
|
140
|
+
return this.#sources.has(name);
|
|
141
|
+
}
|
|
142
|
+
/** Get all registered source names. */
|
|
143
|
+
get sourceIds() {
|
|
144
|
+
return [...this.#sources.keys()];
|
|
145
|
+
}
|
|
146
|
+
// ── Layer management ────────────────────────────────────────
|
|
147
|
+
/**
|
|
148
|
+
* Add a rendering layer.
|
|
149
|
+
*
|
|
150
|
+
* Layers reference a source by name. Multiple layers can reference the
|
|
151
|
+
* same source (e.g. a fill layer and a symbol layer over the same
|
|
152
|
+
* Feature Service).
|
|
153
|
+
*
|
|
154
|
+
* @param spec - Layer specification (must include `id`, `source`, `type`).
|
|
155
|
+
* @param beforeId - Insert this layer before the layer with this ID.
|
|
156
|
+
* If omitted, appends to the end.
|
|
157
|
+
* @throws If the referenced source does not exist.
|
|
158
|
+
* @throws If a layer with the same ID already exists.
|
|
159
|
+
*/
|
|
160
|
+
addLayer(spec, beforeId) {
|
|
161
|
+
const layerSource = spec.source;
|
|
162
|
+
if (layerSource && !this.#sources.has(layerSource)) {
|
|
163
|
+
throw new Error(`Cannot add layer "${spec.id}": source "${layerSource}" does not exist.`);
|
|
164
|
+
}
|
|
165
|
+
if (this.#layers.some((l) => l.id === spec.id)) {
|
|
166
|
+
throw new Error(`Layer "${spec.id}" already exists.`);
|
|
167
|
+
}
|
|
168
|
+
if (beforeId) {
|
|
169
|
+
const idx = this.#layers.findIndex((l) => l.id === beforeId);
|
|
170
|
+
if (idx === -1) {
|
|
171
|
+
throw new Error(`Cannot insert before "${beforeId}": layer not found.`);
|
|
172
|
+
}
|
|
173
|
+
this.#layers.splice(idx, 0, { id: spec.id, spec });
|
|
174
|
+
}
|
|
175
|
+
else {
|
|
176
|
+
this.#layers.push({ id: spec.id, spec });
|
|
177
|
+
}
|
|
178
|
+
this.#emit({ type: "layer-added", layerId: spec.id });
|
|
179
|
+
}
|
|
180
|
+
/** Remove a layer by ID. Returns `true` if the layer was found and removed. */
|
|
181
|
+
removeLayer(id) {
|
|
182
|
+
const idx = this.#layers.findIndex((l) => l.id === id);
|
|
183
|
+
if (idx === -1)
|
|
184
|
+
return false;
|
|
185
|
+
this.#layers.splice(idx, 1);
|
|
186
|
+
this.#emit({ type: "layer-removed", layerId: id });
|
|
187
|
+
return true;
|
|
188
|
+
}
|
|
189
|
+
/** Get a layer specification by ID. */
|
|
190
|
+
getLayer(id) {
|
|
191
|
+
return this.#layers.find((l) => l.id === id)?.spec;
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Patch a layer specification by ID. The layer ID remains stable.
|
|
195
|
+
*
|
|
196
|
+
* @throws If the layer does not exist.
|
|
197
|
+
* @throws If the patched source does not exist.
|
|
198
|
+
*/
|
|
199
|
+
updateLayer(id, patch) {
|
|
200
|
+
const entry = this.#layers.find((l) => l.id === id);
|
|
201
|
+
if (!entry) {
|
|
202
|
+
throw new Error(`Layer "${id}" not found.`);
|
|
203
|
+
}
|
|
204
|
+
const next = { ...entry.spec, ...patch, id };
|
|
205
|
+
if (next.source && !this.#sources.has(next.source)) {
|
|
206
|
+
throw new Error(`Cannot update layer "${id}": source "${next.source}" does not exist.`);
|
|
207
|
+
}
|
|
208
|
+
entry.spec = next;
|
|
209
|
+
this.#emit({ type: "layer-updated", layerId: id });
|
|
210
|
+
return next;
|
|
211
|
+
}
|
|
212
|
+
/** Check whether a layer with the given ID exists. */
|
|
213
|
+
hasLayer(id) {
|
|
214
|
+
return this.#layers.some((l) => l.id === id);
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Move a layer to a new position in the render order.
|
|
218
|
+
*
|
|
219
|
+
* @param id - The layer to move.
|
|
220
|
+
* @param beforeId - Place it before this layer. If omitted, moves to end.
|
|
221
|
+
*/
|
|
222
|
+
moveLayer(id, beforeId) {
|
|
223
|
+
const fromIdx = this.#layers.findIndex((l) => l.id === id);
|
|
224
|
+
if (fromIdx === -1)
|
|
225
|
+
throw new Error(`Layer "${id}" not found.`);
|
|
226
|
+
const [entry] = this.#layers.splice(fromIdx, 1);
|
|
227
|
+
if (beforeId) {
|
|
228
|
+
const toIdx = this.#layers.findIndex((l) => l.id === beforeId);
|
|
229
|
+
if (toIdx === -1)
|
|
230
|
+
throw new Error(`Target layer "${beforeId}" not found.`);
|
|
231
|
+
this.#layers.splice(toIdx, 0, entry);
|
|
232
|
+
}
|
|
233
|
+
else {
|
|
234
|
+
this.#layers.push(entry);
|
|
235
|
+
}
|
|
236
|
+
this.#emit({ type: "layer-moved", layerId: id, beforeId });
|
|
237
|
+
}
|
|
238
|
+
/** Get all layer IDs in render order. */
|
|
239
|
+
get layerIds() {
|
|
240
|
+
return this.#layers.map((l) => l.id);
|
|
241
|
+
}
|
|
242
|
+
/** Get all layers in render order. */
|
|
243
|
+
get layers() {
|
|
244
|
+
return this.#layers.map((l) => l.spec);
|
|
245
|
+
}
|
|
246
|
+
/** Get all layers that reference a given source. */
|
|
247
|
+
getLayersForSource(sourceId) {
|
|
248
|
+
return this.#layers.filter((l) => l.spec.source === sourceId).map((l) => l.spec);
|
|
249
|
+
}
|
|
250
|
+
// ── Style serialization ─────────────────────────────────────
|
|
251
|
+
/**
|
|
252
|
+
* Produce a MapLibre-compatible style specification.
|
|
253
|
+
*
|
|
254
|
+
* Honua sources are included with their original custom `type` values.
|
|
255
|
+
* Use this to feed into a MapLibre map via `map.setStyle(honuaMap.toStyle())`
|
|
256
|
+
* alongside a MapLibre source-type plugin that handles the Honua types.
|
|
257
|
+
*/
|
|
258
|
+
toStyle(options) {
|
|
259
|
+
const sources = {};
|
|
260
|
+
for (const [name, { spec }] of this.#sources) {
|
|
261
|
+
sources[name] = spec;
|
|
262
|
+
}
|
|
263
|
+
return {
|
|
264
|
+
version: 8,
|
|
265
|
+
name: options?.name,
|
|
266
|
+
sources,
|
|
267
|
+
layers: this.#layers.map((l) => ({ ...l.spec })),
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
// ── Events ──────────────────────────────────────────────────
|
|
271
|
+
/** Subscribe to map structure changes. Returns a remove handle. */
|
|
272
|
+
on(listener) {
|
|
273
|
+
this.#listeners.add(listener);
|
|
274
|
+
return {
|
|
275
|
+
remove: () => {
|
|
276
|
+
this.#listeners.delete(listener);
|
|
277
|
+
},
|
|
278
|
+
};
|
|
279
|
+
}
|
|
280
|
+
// ── Bulk operations ─────────────────────────────────────────
|
|
281
|
+
/** Number of registered sources. */
|
|
282
|
+
get sourceCount() {
|
|
283
|
+
return this.#sources.size;
|
|
284
|
+
}
|
|
285
|
+
/** Number of registered layers. */
|
|
286
|
+
get layerCount() {
|
|
287
|
+
return this.#layers.length;
|
|
288
|
+
}
|
|
289
|
+
/** Remove all sources and layers. */
|
|
290
|
+
clear() {
|
|
291
|
+
const layerIds = [...this.layerIds];
|
|
292
|
+
const sourceIds = [...this.sourceIds];
|
|
293
|
+
this.#layers.length = 0;
|
|
294
|
+
for (const id of layerIds) {
|
|
295
|
+
this.#emit({ type: "layer-removed", layerId: id });
|
|
296
|
+
}
|
|
297
|
+
this.#sources.clear();
|
|
298
|
+
for (const id of sourceIds) {
|
|
299
|
+
this.#emit({ type: "source-removed", sourceId: id });
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
// ── Private ─────────────────────────────────────────────────
|
|
303
|
+
#loadStyle(style) {
|
|
304
|
+
for (const [name, spec] of Object.entries(style.sources)) {
|
|
305
|
+
const resolved = this.#resolveSource(spec);
|
|
306
|
+
this.#sources.set(name, { spec, resolved });
|
|
307
|
+
}
|
|
308
|
+
for (const layer of style.layers) {
|
|
309
|
+
this.#layers.push({ id: layer.id, spec: layer });
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
#resolveSource(spec) {
|
|
313
|
+
if (isFeatureServiceSource(spec)) {
|
|
314
|
+
const parsed = parseFeatureLayerUrl(spec.url);
|
|
315
|
+
return new HonuaFeatureLayer({
|
|
316
|
+
client: this.#client,
|
|
317
|
+
serviceId: parsed.serviceId,
|
|
318
|
+
layerId: parsed.layerId,
|
|
319
|
+
});
|
|
320
|
+
}
|
|
321
|
+
if (isMapServiceSource(spec)) {
|
|
322
|
+
const parsed = parseMapServiceUrl(spec.url);
|
|
323
|
+
return new HonuaMapService({
|
|
324
|
+
client: this.#client,
|
|
325
|
+
serviceId: parsed.serviceId,
|
|
326
|
+
});
|
|
327
|
+
}
|
|
328
|
+
if (isOgcFeaturesSource(spec)) {
|
|
329
|
+
const parsed = parseOgcFeaturesUrl(spec.url);
|
|
330
|
+
const ogcRoot = new HonuaOgcFeatures({ client: this.#client });
|
|
331
|
+
const collectionId = spec.collectionId ?? parsed.collectionId ?? "";
|
|
332
|
+
return ogcRoot.collection(collectionId);
|
|
333
|
+
}
|
|
334
|
+
if (isWmsSource(spec)) {
|
|
335
|
+
return resolveWmsSpec(this.#client, spec);
|
|
336
|
+
}
|
|
337
|
+
if (isWmtsSource(spec)) {
|
|
338
|
+
return resolveWmtsSpec(this.#client, spec);
|
|
339
|
+
}
|
|
340
|
+
return null;
|
|
341
|
+
}
|
|
342
|
+
#emit(event) {
|
|
343
|
+
for (const listener of this.#listeners) {
|
|
344
|
+
listener(event);
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
}
|
package/map/index.d.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@honua/sdk-js/map` — `HonuaMap` programmatic map container.
|
|
3
|
+
*
|
|
4
|
+
* A small, renderer-neutral map handle for tests and headless workflows that
|
|
5
|
+
* mirrors the subset of the MapLibre / Cesium runtime API the SDK contracts
|
|
6
|
+
* against.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* import { HonuaMap } from "@honua/sdk-js/map";
|
|
11
|
+
*
|
|
12
|
+
* const map = new HonuaMap({ extent: { xmin: -158, ymin: 21, xmax: -157, ymax: 22 } });
|
|
13
|
+
* map.on("extentchange", (event) => console.log(event.extent));
|
|
14
|
+
* map.setSourceVisible("parcels", false);
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* @packageDocumentation
|
|
18
|
+
*/
|
|
19
|
+
export { HonuaMap } from "./honua-map.js";
|
|
20
|
+
export type { HonuaMapOptions, HonuaMapEvent, HonuaMapEventListener, LayerSnapshot, ResolvedMapSource, } from "./honua-map.js";
|
|
21
|
+
export { createHonuaFeatureServiceLayer, createHonuaMapLibreMapOptions, createHonuaMapLibreStyle, createHonuaMapServiceLayer, createHonuaTileServiceLayer, } from "./maplibre-target.js";
|
|
22
|
+
export type { HonuaFeatureServiceLayerOptions, HonuaMapLibreLayerDefinition, HonuaMapLibreLayerOptionsBase, HonuaMapLibreMapOptions, HonuaMapLibreRasterSourceSpecification, HonuaMapLibreStyleOptions, HonuaMapServiceLayerOptions, HonuaTileServiceLayerOptions, } from "./maplibre-target.js";
|
|
23
|
+
export { esriFeaturesToGeoJson, esriGeometryToGeoJson, loadHonuaFeatureServiceGeoJson, registerHonuaFeatureServiceSources, } from "./feature-service-adapter.js";
|
|
24
|
+
export type { AdapterGeoJsonFeature, AdapterGeoJsonFeatureCollection, AdapterGeoJsonGeometry, FeatureServiceAdapterMap, LoadHonuaFeatureServiceGeoJsonOptions, MapLibreGeoJsonSourceSpecification, RegisterHonuaFeatureServiceSourcesResult, } from "./feature-service-adapter.js";
|
|
25
|
+
export { webmapJsonToMapLibreStyle } from "./webmap-maplibre.js";
|
|
26
|
+
export type { WebMapJsonToMapLibreStyleOptions, WebMapJsonToMapLibreStyleResult, WebMapMapLibreGapKind, WebMapMapLibreManualGap, } from "./webmap-maplibre.js";
|
|
27
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/map/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,YAAY,EACV,eAAe,EACf,aAAa,EACb,qBAAqB,EACrB,aAAa,EACb,iBAAiB,GAClB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,8BAA8B,EAC9B,6BAA6B,EAC7B,wBAAwB,EACxB,0BAA0B,EAC1B,2BAA2B,GAC5B,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EACV,+BAA+B,EAC/B,4BAA4B,EAC5B,6BAA6B,EAC7B,uBAAuB,EACvB,sCAAsC,EACtC,yBAAyB,EACzB,2BAA2B,EAC3B,4BAA4B,GAC7B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,qBAAqB,EACrB,qBAAqB,EACrB,8BAA8B,EAC9B,kCAAkC,GACnC,MAAM,8BAA8B,CAAC;AACtC,YAAY,EACV,qBAAqB,EACrB,+BAA+B,EAC/B,sBAAsB,EACtB,wBAAwB,EACxB,qCAAqC,EACrC,kCAAkC,EAClC,wCAAwC,GACzC,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AACjE,YAAY,EACV,gCAAgC,EAChC,+BAA+B,EAC/B,qBAAqB,EACrB,uBAAuB,GACxB,MAAM,sBAAsB,CAAC"}
|
package/map/index.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@honua/sdk-js/map` — `HonuaMap` programmatic map container.
|
|
3
|
+
*
|
|
4
|
+
* A small, renderer-neutral map handle for tests and headless workflows that
|
|
5
|
+
* mirrors the subset of the MapLibre / Cesium runtime API the SDK contracts
|
|
6
|
+
* against.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* import { HonuaMap } from "@honua/sdk-js/map";
|
|
11
|
+
*
|
|
12
|
+
* const map = new HonuaMap({ extent: { xmin: -158, ymin: 21, xmax: -157, ymax: 22 } });
|
|
13
|
+
* map.on("extentchange", (event) => console.log(event.extent));
|
|
14
|
+
* map.setSourceVisible("parcels", false);
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* @packageDocumentation
|
|
18
|
+
*/
|
|
19
|
+
export { HonuaMap } from "./honua-map.js";
|
|
20
|
+
export { createHonuaFeatureServiceLayer, createHonuaMapLibreMapOptions, createHonuaMapLibreStyle, createHonuaMapServiceLayer, createHonuaTileServiceLayer, } from "./maplibre-target.js";
|
|
21
|
+
export { esriFeaturesToGeoJson, esriGeometryToGeoJson, loadHonuaFeatureServiceGeoJson, registerHonuaFeatureServiceSources, } from "./feature-service-adapter.js";
|
|
22
|
+
export { webmapJsonToMapLibreStyle } from "./webmap-maplibre.js";
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import type { HonuaFeatureServiceSourceSpecification, HonuaLayerSpecification, HonuaMapServiceSourceSpecification, HonuaStyleSpecification } from "../style/specification.js";
|
|
2
|
+
/** Standard MapLibre raster source shape used by migrated tiled services. */
|
|
3
|
+
export interface HonuaMapLibreRasterSourceSpecification {
|
|
4
|
+
[key: string]: unknown;
|
|
5
|
+
type: "raster";
|
|
6
|
+
tiles: string[];
|
|
7
|
+
tileSize?: number;
|
|
8
|
+
attribution?: string;
|
|
9
|
+
}
|
|
10
|
+
/** Layer/source pair consumed by {@link createHonuaMapLibreStyle}. */
|
|
11
|
+
export interface HonuaMapLibreLayerDefinition {
|
|
12
|
+
id: string;
|
|
13
|
+
sourceId: string;
|
|
14
|
+
source: HonuaFeatureServiceSourceSpecification | HonuaMapServiceSourceSpecification | HonuaMapLibreRasterSourceSpecification;
|
|
15
|
+
layer: HonuaLayerSpecification;
|
|
16
|
+
}
|
|
17
|
+
/** Shared options for migrated ArcGIS layer constructors. */
|
|
18
|
+
export interface HonuaMapLibreLayerOptionsBase {
|
|
19
|
+
id?: string;
|
|
20
|
+
title?: string;
|
|
21
|
+
visible?: boolean;
|
|
22
|
+
opacity?: number;
|
|
23
|
+
minScale?: number;
|
|
24
|
+
maxScale?: number;
|
|
25
|
+
attribution?: string;
|
|
26
|
+
paint?: Record<string, unknown>;
|
|
27
|
+
layout?: Record<string, unknown>;
|
|
28
|
+
}
|
|
29
|
+
/** Options for an ArcGIS FeatureLayer migrated into a Honua feature-service source. */
|
|
30
|
+
export interface HonuaFeatureServiceLayerOptions extends HonuaMapLibreLayerOptionsBase {
|
|
31
|
+
url: string;
|
|
32
|
+
outFields?: string[];
|
|
33
|
+
definitionExpression?: string;
|
|
34
|
+
returnGeometry?: boolean;
|
|
35
|
+
outSR?: number;
|
|
36
|
+
layerType?: "circle" | "line" | "fill";
|
|
37
|
+
}
|
|
38
|
+
/** Options for an ArcGIS MapImageLayer migrated into a Honua map-service source. */
|
|
39
|
+
export interface HonuaMapServiceLayerOptions extends HonuaMapLibreLayerOptionsBase {
|
|
40
|
+
url: string;
|
|
41
|
+
sublayers?: unknown;
|
|
42
|
+
layers?: string;
|
|
43
|
+
dpi?: number;
|
|
44
|
+
format?: "png" | "png24" | "png32" | "jpg" | "gif";
|
|
45
|
+
transparent?: boolean;
|
|
46
|
+
}
|
|
47
|
+
/** Options for an ArcGIS TileLayer migrated into a MapLibre raster tile source. */
|
|
48
|
+
export interface HonuaTileServiceLayerOptions extends HonuaMapLibreLayerOptionsBase {
|
|
49
|
+
url: string;
|
|
50
|
+
tileSize?: number;
|
|
51
|
+
}
|
|
52
|
+
/** Options for an ArcGIS Map migrated into a MapLibre style document. */
|
|
53
|
+
export interface HonuaMapLibreStyleOptions {
|
|
54
|
+
basemap?: string;
|
|
55
|
+
layers?: readonly HonuaMapLibreLayerDefinition[];
|
|
56
|
+
name?: string;
|
|
57
|
+
center?: [number, number];
|
|
58
|
+
zoom?: number;
|
|
59
|
+
}
|
|
60
|
+
/** Options for an ArcGIS MapView migrated into MapLibre's `Map` constructor. */
|
|
61
|
+
export interface HonuaMapLibreMapOptions {
|
|
62
|
+
map?: HonuaStyleSpecification;
|
|
63
|
+
style?: HonuaStyleSpecification;
|
|
64
|
+
container?: string | HTMLElement;
|
|
65
|
+
center?: [number, number];
|
|
66
|
+
zoom?: number;
|
|
67
|
+
bearing?: number;
|
|
68
|
+
pitch?: number;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Create a Honua feature-service source and a default MapLibre render layer.
|
|
72
|
+
*
|
|
73
|
+
* The returned `source` carries the custom `honua-feature-service` type, which
|
|
74
|
+
* MapLibre's renderer does not understand on its own — adding it to a
|
|
75
|
+
* `maplibre-gl` `Map` directly is a silent no-op. To render it, run the layer's
|
|
76
|
+
* source through the MapLibre runtime adapter
|
|
77
|
+
* (`loadHonuaFeatureServiceGeoJson` / `registerHonuaFeatureServiceSources` from
|
|
78
|
+
* `@honua/sdk-js/map`), which fetches features via the SDK and produces a
|
|
79
|
+
* standard `geojson` source. This differs from
|
|
80
|
+
* {@link createHonuaTileServiceLayer}, which emits a native MapLibre `raster`
|
|
81
|
+
* source that renders without an adapter.
|
|
82
|
+
*
|
|
83
|
+
* @see loadHonuaFeatureServiceGeoJson
|
|
84
|
+
* @see registerHonuaFeatureServiceSources
|
|
85
|
+
*/
|
|
86
|
+
export declare function createHonuaFeatureServiceLayer(options: HonuaFeatureServiceLayerOptions): HonuaMapLibreLayerDefinition;
|
|
87
|
+
/**
|
|
88
|
+
* Create a Honua map-service source and a default MapLibre raster layer.
|
|
89
|
+
*/
|
|
90
|
+
export declare function createHonuaMapServiceLayer(options: HonuaMapServiceLayerOptions): HonuaMapLibreLayerDefinition;
|
|
91
|
+
/**
|
|
92
|
+
* Create a MapLibre raster source and layer for an ArcGIS tiled service.
|
|
93
|
+
*/
|
|
94
|
+
export declare function createHonuaTileServiceLayer(options: HonuaTileServiceLayerOptions): HonuaMapLibreLayerDefinition;
|
|
95
|
+
/**
|
|
96
|
+
* Create a MapLibre style document from migrated ArcGIS `Map` options.
|
|
97
|
+
*/
|
|
98
|
+
export declare function createHonuaMapLibreStyle(options?: HonuaMapLibreStyleOptions): HonuaStyleSpecification;
|
|
99
|
+
/**
|
|
100
|
+
* Create the options object passed to `new maplibregl.Map(...)`.
|
|
101
|
+
*/
|
|
102
|
+
export declare function createHonuaMapLibreMapOptions(options: HonuaMapLibreMapOptions): Record<string, unknown>;
|
|
103
|
+
//# sourceMappingURL=maplibre-target.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"maplibre-target.d.ts","sourceRoot":"","sources":["../../../src/map/maplibre-target.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,sCAAsC,EACtC,uBAAuB,EACvB,kCAAkC,EAClC,uBAAuB,EACxB,MAAM,2BAA2B,CAAC;AAEnC,6EAA6E;AAC7E,MAAM,WAAW,sCAAsC;IACrD,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,sEAAsE;AACtE,MAAM,WAAW,4BAA4B;IAC3C,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EACF,sCAAsC,GACtC,kCAAkC,GAClC,sCAAsC,CAAC;IAC3C,KAAK,EAAE,uBAAuB,CAAC;CAChC;AAED,6DAA6D;AAC7D,MAAM,WAAW,6BAA6B;IAC5C,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC;AAED,uFAAuF;AACvF,MAAM,WAAW,+BAAgC,SAAQ,6BAA6B;IACpF,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAC;CACxC;AAED,oFAAoF;AACpF,MAAM,WAAW,2BAA4B,SAAQ,6BAA6B;IAChF,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,KAAK,GAAG,OAAO,GAAG,OAAO,GAAG,KAAK,GAAG,KAAK,CAAC;IACnD,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,mFAAmF;AACnF,MAAM,WAAW,4BAA6B,SAAQ,6BAA6B;IACjF,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,yEAAyE;AACzE,MAAM,WAAW,yBAAyB;IACxC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,SAAS,4BAA4B,EAAE,CAAC;IACjD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,gFAAgF;AAChF,MAAM,WAAW,uBAAuB;IACtC,GAAG,CAAC,EAAE,uBAAuB,CAAC;IAC9B,KAAK,CAAC,EAAE,uBAAuB,CAAC;IAChC,SAAS,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC;IACjC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,8BAA8B,CAAC,OAAO,EAAE,+BAA+B,GAAG,4BAA4B,CAmBrH;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,2BAA2B,GAAG,4BAA4B,CAkB7G;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,4BAA4B,GAAG,4BAA4B,CAgB/G;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,GAAE,yBAA8B,GAAG,uBAAuB,CAkBzG;AAED;;GAEG;AACH,wBAAgB,6BAA6B,CAAC,OAAO,EAAE,uBAAuB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAUvG"}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import { stripQueryAndFragment, trimTrailingSlashes } from "../core/path-utils.js";
|
|
2
|
+
/**
|
|
3
|
+
* Create a Honua feature-service source and a default MapLibre render layer.
|
|
4
|
+
*
|
|
5
|
+
* The returned `source` carries the custom `honua-feature-service` type, which
|
|
6
|
+
* MapLibre's renderer does not understand on its own — adding it to a
|
|
7
|
+
* `maplibre-gl` `Map` directly is a silent no-op. To render it, run the layer's
|
|
8
|
+
* source through the MapLibre runtime adapter
|
|
9
|
+
* (`loadHonuaFeatureServiceGeoJson` / `registerHonuaFeatureServiceSources` from
|
|
10
|
+
* `@honua/sdk-js/map`), which fetches features via the SDK and produces a
|
|
11
|
+
* standard `geojson` source. This differs from
|
|
12
|
+
* {@link createHonuaTileServiceLayer}, which emits a native MapLibre `raster`
|
|
13
|
+
* source that renders without an adapter.
|
|
14
|
+
*
|
|
15
|
+
* @see loadHonuaFeatureServiceGeoJson
|
|
16
|
+
* @see registerHonuaFeatureServiceSources
|
|
17
|
+
*/
|
|
18
|
+
export function createHonuaFeatureServiceLayer(options) {
|
|
19
|
+
const sourceId = normalizeLayerId(options.id, options.title, options.url, "feature-service");
|
|
20
|
+
const layerType = options.layerType ?? "circle";
|
|
21
|
+
const source = {
|
|
22
|
+
type: "honua-feature-service",
|
|
23
|
+
url: options.url,
|
|
24
|
+
...(options.attribution ? { attribution: options.attribution } : {}),
|
|
25
|
+
...(options.definitionExpression ? { definitionExpression: options.definitionExpression } : {}),
|
|
26
|
+
...(options.outFields ? { outFields: [...options.outFields] } : {}),
|
|
27
|
+
...(options.returnGeometry !== undefined ? { returnGeometry: options.returnGeometry } : {}),
|
|
28
|
+
...(options.outSR !== undefined ? { outSR: options.outSR } : {}),
|
|
29
|
+
};
|
|
30
|
+
return {
|
|
31
|
+
id: sourceId,
|
|
32
|
+
sourceId,
|
|
33
|
+
source,
|
|
34
|
+
layer: buildLayer(sourceId, layerType, options),
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Create a Honua map-service source and a default MapLibre raster layer.
|
|
39
|
+
*/
|
|
40
|
+
export function createHonuaMapServiceLayer(options) {
|
|
41
|
+
const sourceId = normalizeLayerId(options.id, options.title, options.url, "map-service");
|
|
42
|
+
const source = {
|
|
43
|
+
type: "honua-map-service",
|
|
44
|
+
url: options.url,
|
|
45
|
+
...(options.attribution ? { attribution: options.attribution } : {}),
|
|
46
|
+
...(options.layers ? { layers: options.layers } : {}),
|
|
47
|
+
...(options.dpi !== undefined ? { dpi: options.dpi } : {}),
|
|
48
|
+
...(options.format ? { format: options.format } : {}),
|
|
49
|
+
...(options.transparent !== undefined ? { transparent: options.transparent } : {}),
|
|
50
|
+
};
|
|
51
|
+
return {
|
|
52
|
+
id: sourceId,
|
|
53
|
+
sourceId,
|
|
54
|
+
source,
|
|
55
|
+
layer: buildLayer(sourceId, "raster", options),
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Create a MapLibre raster source and layer for an ArcGIS tiled service.
|
|
60
|
+
*/
|
|
61
|
+
export function createHonuaTileServiceLayer(options) {
|
|
62
|
+
const sourceId = normalizeLayerId(options.id, options.title, options.url, "tile-service");
|
|
63
|
+
const baseUrl = trimTrailingSlashes(options.url);
|
|
64
|
+
const source = {
|
|
65
|
+
type: "raster",
|
|
66
|
+
tiles: [`${baseUrl}/tile/{z}/{y}/{x}`],
|
|
67
|
+
tileSize: options.tileSize ?? 256,
|
|
68
|
+
...(options.attribution ? { attribution: options.attribution } : {}),
|
|
69
|
+
};
|
|
70
|
+
return {
|
|
71
|
+
id: sourceId,
|
|
72
|
+
sourceId,
|
|
73
|
+
source,
|
|
74
|
+
layer: buildLayer(sourceId, "raster", options),
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Create a MapLibre style document from migrated ArcGIS `Map` options.
|
|
79
|
+
*/
|
|
80
|
+
export function createHonuaMapLibreStyle(options = {}) {
|
|
81
|
+
const sources = {};
|
|
82
|
+
const layers = [];
|
|
83
|
+
for (const layer of options.layers ?? []) {
|
|
84
|
+
sources[layer.sourceId] = layer.source;
|
|
85
|
+
layers.push(layer.layer);
|
|
86
|
+
}
|
|
87
|
+
return {
|
|
88
|
+
version: 8,
|
|
89
|
+
...(options.name ? { name: options.name } : {}),
|
|
90
|
+
...(options.center ? { center: options.center } : {}),
|
|
91
|
+
...(options.zoom !== undefined ? { zoom: options.zoom } : {}),
|
|
92
|
+
metadata: options.basemap ? { "honua:arcgis-basemap": options.basemap } : undefined,
|
|
93
|
+
sources,
|
|
94
|
+
layers,
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Create the options object passed to `new maplibregl.Map(...)`.
|
|
99
|
+
*/
|
|
100
|
+
export function createHonuaMapLibreMapOptions(options) {
|
|
101
|
+
const style = options.style ?? options.map ?? createHonuaMapLibreStyle();
|
|
102
|
+
return {
|
|
103
|
+
style,
|
|
104
|
+
...(options.container !== undefined ? { container: options.container } : {}),
|
|
105
|
+
...(options.center ? { center: options.center } : {}),
|
|
106
|
+
...(options.zoom !== undefined ? { zoom: options.zoom } : {}),
|
|
107
|
+
...(options.bearing !== undefined ? { bearing: options.bearing } : {}),
|
|
108
|
+
...(options.pitch !== undefined ? { pitch: options.pitch } : {}),
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
function buildLayer(sourceId, type, options) {
|
|
112
|
+
return {
|
|
113
|
+
id: `${sourceId}-${type}`,
|
|
114
|
+
source: sourceId,
|
|
115
|
+
type,
|
|
116
|
+
...(options.visible === false ? { layout: { ...(options.layout ?? {}), visibility: "none" } } : {}),
|
|
117
|
+
...(options.visible !== false && options.layout ? { layout: options.layout } : {}),
|
|
118
|
+
...(options.paint || options.opacity !== undefined ? { paint: buildPaint(type, options) } : {}),
|
|
119
|
+
...(options.minScale !== undefined ? { minzoom: scaleToZoom(options.minScale) } : {}),
|
|
120
|
+
...(options.maxScale !== undefined ? { maxzoom: scaleToZoom(options.maxScale) } : {}),
|
|
121
|
+
metadata: {
|
|
122
|
+
...(options.title ? { title: options.title } : {}),
|
|
123
|
+
...(options.id ? { "honua:source-id": options.id } : {}),
|
|
124
|
+
},
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
function buildPaint(type, options) {
|
|
128
|
+
const paint = { ...(options.paint ?? {}) };
|
|
129
|
+
if (options.opacity === undefined) {
|
|
130
|
+
return paint;
|
|
131
|
+
}
|
|
132
|
+
if (type === "circle")
|
|
133
|
+
paint["circle-opacity"] = options.opacity;
|
|
134
|
+
if (type === "line")
|
|
135
|
+
paint["line-opacity"] = options.opacity;
|
|
136
|
+
if (type === "fill")
|
|
137
|
+
paint["fill-opacity"] = options.opacity;
|
|
138
|
+
if (type === "raster")
|
|
139
|
+
paint["raster-opacity"] = options.opacity;
|
|
140
|
+
return paint;
|
|
141
|
+
}
|
|
142
|
+
function normalizeLayerId(id, title, url, fallback) {
|
|
143
|
+
return sanitizeId(id ?? title ?? lastUrlSegment(url) ?? fallback);
|
|
144
|
+
}
|
|
145
|
+
function lastUrlSegment(url) {
|
|
146
|
+
const trimmed = trimTrailingSlashes(stripQueryAndFragment(url));
|
|
147
|
+
const segment = trimmed.slice(trimmed.lastIndexOf("/") + 1);
|
|
148
|
+
return segment || undefined;
|
|
149
|
+
}
|
|
150
|
+
function sanitizeId(value) {
|
|
151
|
+
const id = value
|
|
152
|
+
.trim()
|
|
153
|
+
.replace(/([a-z0-9])([A-Z])/g, "$1-$2")
|
|
154
|
+
.replace(/[^A-Za-z0-9_-]+/g, "-")
|
|
155
|
+
.replace(/^-+|-+$/g, "")
|
|
156
|
+
.toLowerCase();
|
|
157
|
+
return id || "layer";
|
|
158
|
+
}
|
|
159
|
+
function scaleToZoom(scale) {
|
|
160
|
+
if (!Number.isFinite(scale) || scale <= 0) {
|
|
161
|
+
return 0;
|
|
162
|
+
}
|
|
163
|
+
return Math.max(0, Math.log2(591657550.5 / scale));
|
|
164
|
+
}
|