@honua/react 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 +9 -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 +61 -0
- package/contract/index.d.ts.map +1 -0
- package/contract/index.js +51 -0
- package/contract/jobs.d.ts +149 -0
- package/contract/jobs.d.ts.map +1 -0
- package/contract/jobs.js +40 -0
- package/contract/source.d.ts +423 -0
- package/contract/source.d.ts.map +1 -0
- package/contract/source.js +3802 -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 +665 -0
- package/contract/types.d.ts.map +1 -0
- package/contract/types.js +175 -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/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 +577 -0
- package/core/client.d.ts.map +1 -0
- package/core/client.js +1664 -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 +107 -0
- package/core/errors.d.ts.map +1 -0
- package/core/errors.js +156 -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/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-features.d.ts +23 -0
- package/core/ogc-features.d.ts.map +1 -0
- package/core/ogc-features.js +114 -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.d.ts +55 -0
- package/core/stac.d.ts.map +1 -0
- package/core/stac.js +229 -0
- package/core/surfaces.d.ts +527 -0
- package/core/surfaces.d.ts.map +1 -0
- package/core/surfaces.js +1917 -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 +1355 -0
- package/core/types.d.ts.map +1 -0
- package/core/types.js +13 -0
- package/core/wfs-capabilities.d.ts +143 -0
- package/core/wfs-capabilities.d.ts.map +1 -0
- package/core/wfs-capabilities.js +478 -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 +219 -0
- package/core/wfs.d.ts.map +1 -0
- package/core/wfs.js +406 -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 +31 -0
- package/esri-compat/identity-manager.d.ts.map +1 -0
- package/esri-compat/identity-manager.js +115 -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 +35 -0
- package/esri-compat/oauth-info.d.ts.map +1 -0
- package/esri-compat/oauth-info.js +115 -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/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/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/package.json +37 -0
- package/react/context.d.ts +32 -0
- package/react/context.d.ts.map +1 -0
- package/react/context.js +19 -0
- package/react/honua-layer.d.ts +35 -0
- package/react/honua-layer.d.ts.map +1 -0
- package/react/honua-layer.js +47 -0
- package/react/honua-map.d.ts +83 -0
- package/react/honua-map.d.ts.map +1 -0
- package/react/honua-map.js +109 -0
- package/react/honua-popup.d.ts +26 -0
- package/react/honua-popup.d.ts.map +1 -0
- package/react/honua-popup.js +34 -0
- package/react/hooks.d.ts +127 -0
- package/react/hooks.d.ts.map +1 -0
- package/react/hooks.js +206 -0
- package/react/index.d.ts +42 -0
- package/react/index.d.ts.map +1 -0
- package/react/index.js +34 -0
- package/react/provider.d.ts +36 -0
- package/react/provider.d.ts.map +1 -0
- package/react/provider.js +35 -0
- package/react/query-cache.d.ts +76 -0
- package/react/query-cache.d.ts.map +1 -0
- package/react/query-cache.js +188 -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 +43 -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 +264 -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 +43 -0
- package/runtime/map-package-validation.d.ts.map +1 -0
- package/runtime/map-package-validation.js +269 -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/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 +401 -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/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/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
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { CompatEventBus } from "./event-bus.js";
|
|
2
|
+
export interface TrackPositionCompat {
|
|
3
|
+
coords: {
|
|
4
|
+
latitude: number;
|
|
5
|
+
longitude: number;
|
|
6
|
+
accuracy?: number;
|
|
7
|
+
heading?: number | null;
|
|
8
|
+
speed?: number | null;
|
|
9
|
+
};
|
|
10
|
+
timestamp?: number;
|
|
11
|
+
}
|
|
12
|
+
export interface TrackCompatOptions {
|
|
13
|
+
view?: unknown;
|
|
14
|
+
container?: unknown;
|
|
15
|
+
eventBus?: CompatEventBus;
|
|
16
|
+
tracking?: boolean;
|
|
17
|
+
goToLocationEnabled?: boolean;
|
|
18
|
+
useHeadingEnabled?: boolean;
|
|
19
|
+
rotationEnabled?: boolean;
|
|
20
|
+
scale?: number;
|
|
21
|
+
trackProvider?: () => Promise<TrackPositionCompat>;
|
|
22
|
+
}
|
|
23
|
+
export type TrackLoadStatusCompat = "not-loaded" | "loading" | "loaded";
|
|
24
|
+
export interface TrackHandleCompat {
|
|
25
|
+
remove(): void;
|
|
26
|
+
}
|
|
27
|
+
export declare class TrackCompat {
|
|
28
|
+
readonly view: unknown;
|
|
29
|
+
readonly container: unknown;
|
|
30
|
+
readonly eventBus: CompatEventBus;
|
|
31
|
+
loaded: boolean;
|
|
32
|
+
loadStatus: TrackLoadStatusCompat;
|
|
33
|
+
tracking: boolean;
|
|
34
|
+
readonly goToLocationEnabled: boolean;
|
|
35
|
+
readonly useHeadingEnabled: boolean;
|
|
36
|
+
readonly rotationEnabled: boolean;
|
|
37
|
+
readonly scale: number | undefined;
|
|
38
|
+
position: TrackPositionCompat | undefined;
|
|
39
|
+
private readonly watchListeners;
|
|
40
|
+
private readonly trackProvider;
|
|
41
|
+
constructor(options?: TrackCompatOptions);
|
|
42
|
+
load(): Promise<TrackCompat>;
|
|
43
|
+
when(callback?: (widget: TrackCompat) => void): Promise<TrackCompat>;
|
|
44
|
+
watch(propertyName: string, listener: (value: unknown) => void): TrackHandleCompat;
|
|
45
|
+
start(): Promise<TrackPositionCompat>;
|
|
46
|
+
stop(): void;
|
|
47
|
+
toggle(force?: boolean): Promise<boolean>;
|
|
48
|
+
destroy(): void;
|
|
49
|
+
private notifyWatchers;
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=track.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"track.d.ts","sourceRoot":"","sources":["../../../src/esri-compat/track.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAmD,MAAM,gBAAgB,CAAC;AAEjG,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE;QACN,QAAQ,EAAE,MAAM,CAAC;QACjB,SAAS,EAAE,MAAM,CAAC;QAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QACxB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;KACvB,CAAC;IACF,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,OAAO,CAAC,mBAAmB,CAAC,CAAC;CACpD;AAED,MAAM,MAAM,qBAAqB,GAAG,YAAY,GAAG,SAAS,GAAG,QAAQ,CAAC;AAExE,MAAM,WAAW,iBAAiB;IAChC,MAAM,IAAI,IAAI,CAAC;CAChB;AAED,qBAAa,WAAW;IACtB,SAAgB,IAAI,EAAE,OAAO,CAAC;IAC9B,SAAgB,SAAS,EAAE,OAAO,CAAC;IACnC,SAAgB,QAAQ,EAAE,cAAc,CAAC;IAClC,MAAM,EAAE,OAAO,CAAC;IAChB,UAAU,EAAE,qBAAqB,CAAC;IAClC,QAAQ,EAAE,OAAO,CAAC;IACzB,SAAgB,mBAAmB,EAAE,OAAO,CAAC;IAC7C,SAAgB,iBAAiB,EAAE,OAAO,CAAC;IAC3C,SAAgB,eAAe,EAAE,OAAO,CAAC;IACzC,SAAgB,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,QAAQ,EAAE,mBAAmB,GAAG,SAAS,CAAC;IACjD,OAAO,CAAC,QAAQ,CAAC,cAAc,CAA6C;IAE5E,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAqC;gBAEhD,OAAO,GAAE,kBAAuB;IAgBtC,IAAI,IAAI,OAAO,CAAC,WAAW,CAAC;IAgB5B,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,GAAG,OAAO,CAAC,WAAW,CAAC;IAQ1E,KAAK,CAAC,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,GAAG,iBAAiB;IAe5E,KAAK,IAAI,OAAO,CAAC,mBAAmB,CAAC;IAoD3C,IAAI,IAAI,IAAI;IASN,MAAM,CAAC,KAAK,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAW/C,OAAO,IAAI,IAAI;IAItB,OAAO,CAAC,cAAc;CAUvB"}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { CompatEventBus, resolveCompatEventBus, safeInvokeCompatListener } from "./event-bus.js";
|
|
2
|
+
export class TrackCompat {
|
|
3
|
+
view;
|
|
4
|
+
container;
|
|
5
|
+
eventBus;
|
|
6
|
+
loaded;
|
|
7
|
+
loadStatus;
|
|
8
|
+
tracking;
|
|
9
|
+
goToLocationEnabled;
|
|
10
|
+
useHeadingEnabled;
|
|
11
|
+
rotationEnabled;
|
|
12
|
+
scale;
|
|
13
|
+
position;
|
|
14
|
+
watchListeners;
|
|
15
|
+
trackProvider;
|
|
16
|
+
constructor(options = {}) {
|
|
17
|
+
this.view = options.view;
|
|
18
|
+
this.container = options.container;
|
|
19
|
+
this.eventBus = options.eventBus ?? resolveCompatEventBus(options.view) ?? new CompatEventBus();
|
|
20
|
+
this.loaded = false;
|
|
21
|
+
this.loadStatus = "not-loaded";
|
|
22
|
+
this.tracking = options.tracking ?? false;
|
|
23
|
+
this.goToLocationEnabled = options.goToLocationEnabled ?? true;
|
|
24
|
+
this.useHeadingEnabled = options.useHeadingEnabled ?? false;
|
|
25
|
+
this.rotationEnabled = options.rotationEnabled ?? false;
|
|
26
|
+
this.scale = options.scale;
|
|
27
|
+
this.position = undefined;
|
|
28
|
+
this.trackProvider = options.trackProvider ?? getDefaultTrackProvider();
|
|
29
|
+
this.watchListeners = new Map();
|
|
30
|
+
}
|
|
31
|
+
async load() {
|
|
32
|
+
if (this.loaded) {
|
|
33
|
+
return this;
|
|
34
|
+
}
|
|
35
|
+
this.loadStatus = "loading";
|
|
36
|
+
this.notifyWatchers("loadStatus", this.loadStatus);
|
|
37
|
+
this.eventBus.emit("track.loading", undefined, this);
|
|
38
|
+
this.loaded = true;
|
|
39
|
+
this.notifyWatchers("loaded", this.loaded);
|
|
40
|
+
this.loadStatus = "loaded";
|
|
41
|
+
this.notifyWatchers("loadStatus", this.loadStatus);
|
|
42
|
+
this.eventBus.emit("track.loaded", undefined, this);
|
|
43
|
+
return this;
|
|
44
|
+
}
|
|
45
|
+
async when(callback) {
|
|
46
|
+
const widget = await this.load();
|
|
47
|
+
if (callback) {
|
|
48
|
+
callback(widget);
|
|
49
|
+
}
|
|
50
|
+
return widget;
|
|
51
|
+
}
|
|
52
|
+
watch(propertyName, listener) {
|
|
53
|
+
let listeners = this.watchListeners.get(propertyName);
|
|
54
|
+
if (!listeners) {
|
|
55
|
+
listeners = new Set();
|
|
56
|
+
this.watchListeners.set(propertyName, listeners);
|
|
57
|
+
}
|
|
58
|
+
listeners.add(listener);
|
|
59
|
+
return {
|
|
60
|
+
remove: () => {
|
|
61
|
+
listeners?.delete(listener);
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
async start() {
|
|
66
|
+
this.tracking = true;
|
|
67
|
+
this.notifyWatchers("tracking", this.tracking);
|
|
68
|
+
this.eventBus.emit("track.start", undefined, this);
|
|
69
|
+
try {
|
|
70
|
+
const position = await this.trackProvider();
|
|
71
|
+
this.position = position;
|
|
72
|
+
this.notifyWatchers("position", this.position);
|
|
73
|
+
const center = [position.coords.longitude, position.coords.latitude];
|
|
74
|
+
if (this.goToLocationEnabled) {
|
|
75
|
+
const target = { center };
|
|
76
|
+
if (typeof this.scale === "number" && Number.isFinite(this.scale)) {
|
|
77
|
+
target.scale = this.scale;
|
|
78
|
+
}
|
|
79
|
+
if (isGoToProvider(this.view)) {
|
|
80
|
+
await this.view.goTo(target);
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
applyViewCenterScale(this.view, target);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
if (this.rotationEnabled &&
|
|
87
|
+
this.useHeadingEnabled &&
|
|
88
|
+
typeof position.coords.heading === "number" &&
|
|
89
|
+
Number.isFinite(position.coords.heading) &&
|
|
90
|
+
isRecord(this.view)) {
|
|
91
|
+
this.view.rotation = position.coords.heading;
|
|
92
|
+
}
|
|
93
|
+
this.eventBus.emit("track.position", {
|
|
94
|
+
position,
|
|
95
|
+
center,
|
|
96
|
+
tracking: this.tracking,
|
|
97
|
+
}, this);
|
|
98
|
+
return position;
|
|
99
|
+
}
|
|
100
|
+
catch (error) {
|
|
101
|
+
this.tracking = false;
|
|
102
|
+
this.notifyWatchers("tracking", this.tracking);
|
|
103
|
+
this.eventBus.emit("track.error", { error }, this);
|
|
104
|
+
throw error;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
stop() {
|
|
108
|
+
if (!this.tracking) {
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
this.tracking = false;
|
|
112
|
+
this.notifyWatchers("tracking", this.tracking);
|
|
113
|
+
this.eventBus.emit("track.stop", undefined, this);
|
|
114
|
+
}
|
|
115
|
+
async toggle(force) {
|
|
116
|
+
const next = force ?? !this.tracking;
|
|
117
|
+
if (!next) {
|
|
118
|
+
this.stop();
|
|
119
|
+
return this.tracking;
|
|
120
|
+
}
|
|
121
|
+
await this.start();
|
|
122
|
+
return this.tracking;
|
|
123
|
+
}
|
|
124
|
+
destroy() {
|
|
125
|
+
this.watchListeners.clear();
|
|
126
|
+
}
|
|
127
|
+
notifyWatchers(propertyName, value) {
|
|
128
|
+
const listeners = this.watchListeners.get(propertyName);
|
|
129
|
+
if (!listeners) {
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
for (const listener of listeners) {
|
|
133
|
+
safeInvokeCompatListener(listener, value);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
function isGoToProvider(value) {
|
|
138
|
+
return isRecord(value) && typeof value.goTo === "function";
|
|
139
|
+
}
|
|
140
|
+
function applyViewCenterScale(view, target) {
|
|
141
|
+
if (!isRecord(view)) {
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
view.center = target.center;
|
|
145
|
+
if (typeof target.scale === "number") {
|
|
146
|
+
view.scale = target.scale;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
function getDefaultTrackProvider() {
|
|
150
|
+
return () => new Promise((resolve, reject) => {
|
|
151
|
+
const geolocation = globalThis.navigator?.geolocation;
|
|
152
|
+
if (!geolocation || typeof geolocation.getCurrentPosition !== "function") {
|
|
153
|
+
reject(new Error("Geolocation API is unavailable; provide trackProvider."));
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
geolocation.getCurrentPosition((position) => {
|
|
157
|
+
resolve({
|
|
158
|
+
coords: {
|
|
159
|
+
latitude: position.coords.latitude,
|
|
160
|
+
longitude: position.coords.longitude,
|
|
161
|
+
accuracy: position.coords.accuracy,
|
|
162
|
+
heading: position.coords.heading,
|
|
163
|
+
speed: position.coords.speed,
|
|
164
|
+
},
|
|
165
|
+
timestamp: position.timestamp,
|
|
166
|
+
});
|
|
167
|
+
}, (error) => {
|
|
168
|
+
reject(error);
|
|
169
|
+
});
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
function isRecord(value) {
|
|
173
|
+
return typeof value === "object" && value !== null;
|
|
174
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export interface UniqueValueInfoCompat {
|
|
2
|
+
value: string | number;
|
|
3
|
+
symbol?: unknown;
|
|
4
|
+
label?: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface UniqueValueRendererCompatOptions {
|
|
8
|
+
field?: string;
|
|
9
|
+
field2?: string;
|
|
10
|
+
field3?: string;
|
|
11
|
+
defaultSymbol?: unknown;
|
|
12
|
+
defaultLabel?: string;
|
|
13
|
+
uniqueValueInfos?: UniqueValueInfoCompat[];
|
|
14
|
+
}
|
|
15
|
+
export type UniqueValueRendererLoadStatusCompat = "not-loaded" | "loading" | "loaded";
|
|
16
|
+
export interface UniqueValueRendererHandleCompat {
|
|
17
|
+
remove(): void;
|
|
18
|
+
}
|
|
19
|
+
export declare class UniqueValueRendererCompat {
|
|
20
|
+
loaded: boolean;
|
|
21
|
+
loadStatus: UniqueValueRendererLoadStatusCompat;
|
|
22
|
+
field: string | undefined;
|
|
23
|
+
field2: string | undefined;
|
|
24
|
+
field3: string | undefined;
|
|
25
|
+
defaultSymbol: unknown;
|
|
26
|
+
defaultLabel: string | undefined;
|
|
27
|
+
uniqueValueInfos: UniqueValueInfoCompat[];
|
|
28
|
+
private readonly watchListeners;
|
|
29
|
+
constructor(options?: UniqueValueRendererCompatOptions);
|
|
30
|
+
load(): Promise<UniqueValueRendererCompat>;
|
|
31
|
+
when(callback?: (renderer: UniqueValueRendererCompat) => void): Promise<UniqueValueRendererCompat>;
|
|
32
|
+
watch(propertyName: string, listener: (value: unknown) => void): UniqueValueRendererHandleCompat;
|
|
33
|
+
update(options: UniqueValueRendererCompatOptions): void;
|
|
34
|
+
addUniqueValueInfo(info: UniqueValueInfoCompat): void;
|
|
35
|
+
removeUniqueValueInfo(value: string | number): boolean;
|
|
36
|
+
clone(): UniqueValueRendererCompat;
|
|
37
|
+
toJSON(): UniqueValueRendererCompatOptions;
|
|
38
|
+
destroy(): void;
|
|
39
|
+
private notifyWatchers;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=unique-value-renderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unique-value-renderer.d.ts","sourceRoot":"","sources":["../../../src/esri-compat/unique-value-renderer.ts"],"names":[],"mappings":"AACA,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,gCAAgC;IAC/C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gBAAgB,CAAC,EAAE,qBAAqB,EAAE,CAAC;CAC5C;AAED,MAAM,MAAM,mCAAmC,GAAG,YAAY,GAAG,SAAS,GAAG,QAAQ,CAAC;AAEtF,MAAM,WAAW,+BAA+B;IAC9C,MAAM,IAAI,IAAI,CAAC;CAChB;AAED,qBAAa,yBAAyB;IAC7B,MAAM,EAAE,OAAO,CAAC;IAChB,UAAU,EAAE,mCAAmC,CAAC;IAChD,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,aAAa,EAAE,OAAO,CAAC;IACvB,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,gBAAgB,EAAE,qBAAqB,EAAE,CAAC;IACjD,OAAO,CAAC,QAAQ,CAAC,cAAc,CAA6C;gBAEzD,OAAO,GAAE,gCAAqC;IAYpD,IAAI,IAAI,OAAO,CAAC,yBAAyB,CAAC;IAc1C,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,yBAAyB,KAAK,IAAI,GAAG,OAAO,CAAC,yBAAyB,CAAC;IAQxG,KAAK,CAAC,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,GAAG,+BAA+B;IAehG,MAAM,CAAC,OAAO,EAAE,gCAAgC,GAAG,IAAI;IA2BvD,kBAAkB,CAAC,IAAI,EAAE,qBAAqB,GAAG,IAAI;IAKrD,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO;IAUtD,KAAK,IAAI,yBAAyB;IAIlC,MAAM,IAAI,gCAAgC;IAW1C,OAAO,IAAI,IAAI;IAItB,OAAO,CAAC,cAAc;CAUvB"}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { safeInvokeCompatListener } from "./event-bus.js";
|
|
2
|
+
export class UniqueValueRendererCompat {
|
|
3
|
+
loaded;
|
|
4
|
+
loadStatus;
|
|
5
|
+
field;
|
|
6
|
+
field2;
|
|
7
|
+
field3;
|
|
8
|
+
defaultSymbol;
|
|
9
|
+
defaultLabel;
|
|
10
|
+
uniqueValueInfos;
|
|
11
|
+
watchListeners;
|
|
12
|
+
constructor(options = {}) {
|
|
13
|
+
this.loaded = false;
|
|
14
|
+
this.loadStatus = "not-loaded";
|
|
15
|
+
this.field = options.field;
|
|
16
|
+
this.field2 = options.field2;
|
|
17
|
+
this.field3 = options.field3;
|
|
18
|
+
this.defaultSymbol = options.defaultSymbol;
|
|
19
|
+
this.defaultLabel = options.defaultLabel;
|
|
20
|
+
this.uniqueValueInfos = options.uniqueValueInfos ? options.uniqueValueInfos.map(cloneUniqueValueInfo) : [];
|
|
21
|
+
this.watchListeners = new Map();
|
|
22
|
+
}
|
|
23
|
+
async load() {
|
|
24
|
+
if (this.loaded) {
|
|
25
|
+
return this;
|
|
26
|
+
}
|
|
27
|
+
this.loadStatus = "loading";
|
|
28
|
+
this.notifyWatchers("loadStatus", this.loadStatus);
|
|
29
|
+
this.loaded = true;
|
|
30
|
+
this.notifyWatchers("loaded", this.loaded);
|
|
31
|
+
this.loadStatus = "loaded";
|
|
32
|
+
this.notifyWatchers("loadStatus", this.loadStatus);
|
|
33
|
+
return this;
|
|
34
|
+
}
|
|
35
|
+
async when(callback) {
|
|
36
|
+
const renderer = await this.load();
|
|
37
|
+
if (callback) {
|
|
38
|
+
callback(renderer);
|
|
39
|
+
}
|
|
40
|
+
return renderer;
|
|
41
|
+
}
|
|
42
|
+
watch(propertyName, listener) {
|
|
43
|
+
let listeners = this.watchListeners.get(propertyName);
|
|
44
|
+
if (!listeners) {
|
|
45
|
+
listeners = new Set();
|
|
46
|
+
this.watchListeners.set(propertyName, listeners);
|
|
47
|
+
}
|
|
48
|
+
listeners.add(listener);
|
|
49
|
+
return {
|
|
50
|
+
remove: () => {
|
|
51
|
+
listeners?.delete(listener);
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
update(options) {
|
|
56
|
+
if (options.field !== undefined) {
|
|
57
|
+
this.field = options.field;
|
|
58
|
+
this.notifyWatchers("field", this.field);
|
|
59
|
+
}
|
|
60
|
+
if (options.field2 !== undefined) {
|
|
61
|
+
this.field2 = options.field2;
|
|
62
|
+
this.notifyWatchers("field2", this.field2);
|
|
63
|
+
}
|
|
64
|
+
if (options.field3 !== undefined) {
|
|
65
|
+
this.field3 = options.field3;
|
|
66
|
+
this.notifyWatchers("field3", this.field3);
|
|
67
|
+
}
|
|
68
|
+
if (options.defaultSymbol !== undefined) {
|
|
69
|
+
this.defaultSymbol = options.defaultSymbol;
|
|
70
|
+
this.notifyWatchers("defaultSymbol", this.defaultSymbol);
|
|
71
|
+
}
|
|
72
|
+
if (options.defaultLabel !== undefined) {
|
|
73
|
+
this.defaultLabel = options.defaultLabel;
|
|
74
|
+
this.notifyWatchers("defaultLabel", this.defaultLabel);
|
|
75
|
+
}
|
|
76
|
+
if (options.uniqueValueInfos !== undefined) {
|
|
77
|
+
this.uniqueValueInfos = options.uniqueValueInfos.map(cloneUniqueValueInfo);
|
|
78
|
+
this.notifyWatchers("uniqueValueInfos", this.uniqueValueInfos);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
addUniqueValueInfo(info) {
|
|
82
|
+
this.uniqueValueInfos.push(cloneUniqueValueInfo(info));
|
|
83
|
+
this.notifyWatchers("uniqueValueInfos", this.uniqueValueInfos);
|
|
84
|
+
}
|
|
85
|
+
removeUniqueValueInfo(value) {
|
|
86
|
+
const index = this.uniqueValueInfos.findIndex((item) => item.value === value);
|
|
87
|
+
if (index < 0) {
|
|
88
|
+
return false;
|
|
89
|
+
}
|
|
90
|
+
this.uniqueValueInfos.splice(index, 1);
|
|
91
|
+
this.notifyWatchers("uniqueValueInfos", this.uniqueValueInfos);
|
|
92
|
+
return true;
|
|
93
|
+
}
|
|
94
|
+
clone() {
|
|
95
|
+
return new UniqueValueRendererCompat(this.toJSON());
|
|
96
|
+
}
|
|
97
|
+
toJSON() {
|
|
98
|
+
return {
|
|
99
|
+
field: this.field,
|
|
100
|
+
field2: this.field2,
|
|
101
|
+
field3: this.field3,
|
|
102
|
+
defaultSymbol: this.defaultSymbol,
|
|
103
|
+
defaultLabel: this.defaultLabel,
|
|
104
|
+
uniqueValueInfos: this.uniqueValueInfos.map(cloneUniqueValueInfo),
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
destroy() {
|
|
108
|
+
this.watchListeners.clear();
|
|
109
|
+
}
|
|
110
|
+
notifyWatchers(propertyName, value) {
|
|
111
|
+
const listeners = this.watchListeners.get(propertyName);
|
|
112
|
+
if (!listeners) {
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
for (const listener of listeners) {
|
|
116
|
+
safeInvokeCompatListener(listener, value);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
function cloneUniqueValueInfo(info) {
|
|
121
|
+
return {
|
|
122
|
+
value: info.value,
|
|
123
|
+
symbol: info.symbol,
|
|
124
|
+
label: info.label,
|
|
125
|
+
description: info.description,
|
|
126
|
+
};
|
|
127
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface ParsedFeatureLayerUrl {
|
|
2
|
+
baseUrl: string;
|
|
3
|
+
serviceId: string;
|
|
4
|
+
layerId: number;
|
|
5
|
+
}
|
|
6
|
+
export interface ParsedMapServiceUrl {
|
|
7
|
+
baseUrl: string;
|
|
8
|
+
serviceId: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function parseFeatureLayerUrl(url: string): ParsedFeatureLayerUrl;
|
|
11
|
+
export declare function parseMapServiceUrl(url: string): ParsedMapServiceUrl;
|
|
12
|
+
export declare function parseImageServiceUrl(url: string): ParsedMapServiceUrl;
|
|
13
|
+
//# sourceMappingURL=url.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"url.d.ts","sourceRoot":"","sources":["../../../src/esri-compat/url.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACnB;AASD,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,qBAAqB,CAkBvE;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,mBAAmB,CAanE;AAED,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,mBAAmB,CAarE"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
const ABSOLUTE_URL_RE = /^[A-Za-z][A-Za-z\d+.-]*:\/\//;
|
|
2
|
+
const PROTOCOL_RELATIVE_URL_RE = /^\/\//;
|
|
3
|
+
const RELATIVE_URL_BASE = "https://honua.invalid";
|
|
4
|
+
const FEATURE_LAYER_PATH_RE = /^(?<prefix>.*)\/rest\/services\/(?<serviceId>[^/]+)\/FeatureServer\/(?<layerId>\d+)\/?$/;
|
|
5
|
+
const MAP_SERVICE_PATH_RE = /^(?<prefix>.*)\/rest\/services\/(?<serviceId>[^/]+)\/MapServer(?:\/\d+)?\/?$/;
|
|
6
|
+
const IMAGE_SERVICE_PATH_RE = /^(?<prefix>.*)\/rest\/services\/(?<serviceId>[^/]+)\/ImageServer(?:\/\d+)?\/?$/;
|
|
7
|
+
export function parseFeatureLayerUrl(url) {
|
|
8
|
+
const { parsed, absolute } = parseServiceUrl(url);
|
|
9
|
+
const match = parsed.pathname.match(FEATURE_LAYER_PATH_RE);
|
|
10
|
+
if (!match || !match.groups) {
|
|
11
|
+
throw new Error("Invalid FeatureLayer URL. Expected .../rest/services/{serviceId}/FeatureServer/{layerId}");
|
|
12
|
+
}
|
|
13
|
+
const serviceId = decodeURIComponent(match.groups.serviceId);
|
|
14
|
+
const layerId = Number.parseInt(match.groups.layerId, 10);
|
|
15
|
+
if (Number.isNaN(layerId)) {
|
|
16
|
+
throw new Error("FeatureLayer URL contains an invalid numeric layerId.");
|
|
17
|
+
}
|
|
18
|
+
const prefix = match.groups.prefix || "";
|
|
19
|
+
const baseUrl = absolute
|
|
20
|
+
? `${parsed.protocol}//${parsed.host}${prefix}`.replace(/\/+$/, "")
|
|
21
|
+
: prefix.replace(/\/+$/, "");
|
|
22
|
+
return { baseUrl, serviceId, layerId };
|
|
23
|
+
}
|
|
24
|
+
export function parseMapServiceUrl(url) {
|
|
25
|
+
const { parsed, absolute } = parseServiceUrl(url);
|
|
26
|
+
const match = parsed.pathname.match(MAP_SERVICE_PATH_RE);
|
|
27
|
+
if (!match || !match.groups) {
|
|
28
|
+
throw new Error("Invalid MapServer URL. Expected .../rest/services/{serviceId}/MapServer");
|
|
29
|
+
}
|
|
30
|
+
const serviceId = decodeURIComponent(match.groups.serviceId);
|
|
31
|
+
const prefix = match.groups.prefix || "";
|
|
32
|
+
const baseUrl = absolute
|
|
33
|
+
? `${parsed.protocol}//${parsed.host}${prefix}`.replace(/\/+$/, "")
|
|
34
|
+
: prefix.replace(/\/+$/, "");
|
|
35
|
+
return { baseUrl, serviceId };
|
|
36
|
+
}
|
|
37
|
+
export function parseImageServiceUrl(url) {
|
|
38
|
+
const { parsed, absolute } = parseServiceUrl(url);
|
|
39
|
+
const match = parsed.pathname.match(IMAGE_SERVICE_PATH_RE);
|
|
40
|
+
if (!match || !match.groups) {
|
|
41
|
+
throw new Error("Invalid ImageServer URL. Expected .../rest/services/{serviceId}/ImageServer");
|
|
42
|
+
}
|
|
43
|
+
const serviceId = decodeURIComponent(match.groups.serviceId);
|
|
44
|
+
const prefix = match.groups.prefix || "";
|
|
45
|
+
const baseUrl = absolute
|
|
46
|
+
? `${parsed.protocol}//${parsed.host}${prefix}`.replace(/\/+$/, "")
|
|
47
|
+
: prefix.replace(/\/+$/, "");
|
|
48
|
+
return { baseUrl, serviceId };
|
|
49
|
+
}
|
|
50
|
+
function parseServiceUrl(url) {
|
|
51
|
+
if (ABSOLUTE_URL_RE.test(url)) {
|
|
52
|
+
return {
|
|
53
|
+
parsed: new URL(url),
|
|
54
|
+
absolute: true,
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
if (PROTOCOL_RELATIVE_URL_RE.test(url)) {
|
|
58
|
+
return {
|
|
59
|
+
parsed: new URL(`https:${url}`),
|
|
60
|
+
absolute: true,
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
const normalized = url.startsWith("/") ? url : `/${url}`;
|
|
64
|
+
return {
|
|
65
|
+
parsed: new URL(normalized, RELATIVE_URL_BASE),
|
|
66
|
+
absolute: false,
|
|
67
|
+
};
|
|
68
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { CompatEventBus } from "./event-bus.js";
|
|
2
|
+
export interface VectorTileLayerCompatOptions {
|
|
3
|
+
url?: string;
|
|
4
|
+
style?: string | Record<string, unknown>;
|
|
5
|
+
id?: string;
|
|
6
|
+
title?: string;
|
|
7
|
+
opacity?: number;
|
|
8
|
+
visible?: boolean;
|
|
9
|
+
minScale?: number;
|
|
10
|
+
maxScale?: number;
|
|
11
|
+
listMode?: string;
|
|
12
|
+
eventBus?: CompatEventBus;
|
|
13
|
+
}
|
|
14
|
+
export type VectorTileLayerLoadStatusCompat = "not-loaded" | "loading" | "loaded" | "failed";
|
|
15
|
+
export interface VectorTileLayerHandleCompat {
|
|
16
|
+
remove(): void;
|
|
17
|
+
}
|
|
18
|
+
export declare class VectorTileLayerCompat {
|
|
19
|
+
readonly type: "vector-tile";
|
|
20
|
+
id: string | undefined;
|
|
21
|
+
title: string | undefined;
|
|
22
|
+
url: string | undefined;
|
|
23
|
+
style: string | Record<string, unknown> | undefined;
|
|
24
|
+
opacity: number;
|
|
25
|
+
visible: boolean;
|
|
26
|
+
minScale: number;
|
|
27
|
+
maxScale: number;
|
|
28
|
+
listMode: string;
|
|
29
|
+
loaded: boolean;
|
|
30
|
+
loadStatus: VectorTileLayerLoadStatusCompat;
|
|
31
|
+
readonly eventBus: CompatEventBus;
|
|
32
|
+
private styleJson;
|
|
33
|
+
private readonly watchListeners;
|
|
34
|
+
private readonly eventListeners;
|
|
35
|
+
constructor(options?: VectorTileLayerCompatOptions);
|
|
36
|
+
load(): Promise<VectorTileLayerCompat>;
|
|
37
|
+
when(callback?: (layer: VectorTileLayerCompat) => void): Promise<VectorTileLayerCompat>;
|
|
38
|
+
watch(propertyName: string, listener: (value: unknown) => void): VectorTileLayerHandleCompat;
|
|
39
|
+
on(eventName: string, listener: (event: unknown) => void): VectorTileLayerHandleCompat;
|
|
40
|
+
setVisibility(visible: boolean): void;
|
|
41
|
+
setOpacity(opacity: number): void;
|
|
42
|
+
getStyle(): Record<string, unknown> | undefined;
|
|
43
|
+
loadStyle(style: Record<string, unknown>): void;
|
|
44
|
+
destroy(): void;
|
|
45
|
+
private notifyWatchers;
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=vector-tile-layer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vector-tile-layer.d.ts","sourceRoot":"","sources":["../../../src/esri-compat/vector-tile-layer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAmD,MAAM,gBAAgB,CAAC;AAEjG,MAAM,WAAW,4BAA4B;IAC3C,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACzC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,cAAc,CAAC;CAC3B;AAED,MAAM,MAAM,+BAA+B,GAAG,YAAY,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAE7F,MAAM,WAAW,2BAA2B;IAC1C,MAAM,IAAI,IAAI,CAAC;CAChB;AAED,qBAAa,qBAAqB;IAChC,SAAgB,IAAI,EAAE,aAAa,CAAC;IAC7B,EAAE,EAAE,MAAM,GAAG,SAAS,CAAC;IACvB,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;IACxB,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC;IACpD,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB,UAAU,EAAE,+BAA+B,CAAC;IACnD,SAAgB,QAAQ,EAAE,cAAc,CAAC;IACzC,OAAO,CAAC,SAAS,CAAsC;IACvD,OAAO,CAAC,QAAQ,CAAC,cAAc,CAA6C;IAC5E,OAAO,CAAC,QAAQ,CAAC,cAAc,CAA6C;gBAEzD,OAAO,GAAE,4BAAiC;IAmBhD,IAAI,IAAI,OAAO,CAAC,qBAAqB,CAAC;IAwBtC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,qBAAqB,KAAK,IAAI,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAM7F,KAAK,CAAC,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,GAAG,2BAA2B;IAc5F,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,GAAG,2BAA2B;IAkBtF,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAMrC,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAMjC,QAAQ,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS;IAI/C,SAAS,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAO/C,OAAO,IAAI,IAAI;IAMtB,OAAO,CAAC,cAAc;CAKvB"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { CompatEventBus, resolveCompatEventBus, safeInvokeCompatListener } from "./event-bus.js";
|
|
2
|
+
export class VectorTileLayerCompat {
|
|
3
|
+
type;
|
|
4
|
+
id;
|
|
5
|
+
title;
|
|
6
|
+
url;
|
|
7
|
+
style;
|
|
8
|
+
opacity;
|
|
9
|
+
visible;
|
|
10
|
+
minScale;
|
|
11
|
+
maxScale;
|
|
12
|
+
listMode;
|
|
13
|
+
loaded;
|
|
14
|
+
loadStatus;
|
|
15
|
+
eventBus;
|
|
16
|
+
styleJson;
|
|
17
|
+
watchListeners;
|
|
18
|
+
eventListeners;
|
|
19
|
+
constructor(options = {}) {
|
|
20
|
+
this.type = "vector-tile";
|
|
21
|
+
this.id = options.id;
|
|
22
|
+
this.title = options.title;
|
|
23
|
+
this.url = options.url;
|
|
24
|
+
this.style = options.style;
|
|
25
|
+
this.opacity = options.opacity ?? 1;
|
|
26
|
+
this.visible = options.visible ?? true;
|
|
27
|
+
this.minScale = options.minScale ?? 0;
|
|
28
|
+
this.maxScale = options.maxScale ?? 0;
|
|
29
|
+
this.listMode = options.listMode ?? "show";
|
|
30
|
+
this.loaded = false;
|
|
31
|
+
this.loadStatus = "not-loaded";
|
|
32
|
+
this.eventBus = options.eventBus ?? resolveCompatEventBus(options.style) ?? new CompatEventBus();
|
|
33
|
+
this.styleJson = typeof options.style === "object" && options.style !== null ? { ...options.style } : undefined;
|
|
34
|
+
this.watchListeners = new Map();
|
|
35
|
+
this.eventListeners = new Map();
|
|
36
|
+
}
|
|
37
|
+
async load() {
|
|
38
|
+
if (this.loaded)
|
|
39
|
+
return this;
|
|
40
|
+
this.loadStatus = "loading";
|
|
41
|
+
this.notifyWatchers("loadStatus", this.loadStatus);
|
|
42
|
+
try {
|
|
43
|
+
if (this.styleJson === undefined && typeof this.style === "string") {
|
|
44
|
+
const response = await fetch(this.style);
|
|
45
|
+
if (!response.ok)
|
|
46
|
+
throw new Error(`Failed to fetch vector tile style: ${response.status}`);
|
|
47
|
+
this.styleJson = (await response.json());
|
|
48
|
+
}
|
|
49
|
+
this.loaded = true;
|
|
50
|
+
this.loadStatus = "loaded";
|
|
51
|
+
this.notifyWatchers("loaded", this.loaded);
|
|
52
|
+
this.notifyWatchers("loadStatus", this.loadStatus);
|
|
53
|
+
this.eventBus.emit("vector-tile-layer.loaded", { layerId: this.id, url: this.url }, this);
|
|
54
|
+
}
|
|
55
|
+
catch (error) {
|
|
56
|
+
this.loadStatus = "failed";
|
|
57
|
+
this.notifyWatchers("loadStatus", this.loadStatus);
|
|
58
|
+
this.eventBus.emit("vector-tile-layer.failed", { layerId: this.id, error }, this);
|
|
59
|
+
throw error;
|
|
60
|
+
}
|
|
61
|
+
return this;
|
|
62
|
+
}
|
|
63
|
+
async when(callback) {
|
|
64
|
+
const layer = await this.load();
|
|
65
|
+
if (callback)
|
|
66
|
+
callback(layer);
|
|
67
|
+
return layer;
|
|
68
|
+
}
|
|
69
|
+
watch(propertyName, listener) {
|
|
70
|
+
let listeners = this.watchListeners.get(propertyName);
|
|
71
|
+
if (!listeners) {
|
|
72
|
+
listeners = new Set();
|
|
73
|
+
this.watchListeners.set(propertyName, listeners);
|
|
74
|
+
}
|
|
75
|
+
listeners.add(listener);
|
|
76
|
+
return {
|
|
77
|
+
remove: () => {
|
|
78
|
+
listeners?.delete(listener);
|
|
79
|
+
},
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
on(eventName, listener) {
|
|
83
|
+
let listeners = this.eventListeners.get(eventName);
|
|
84
|
+
if (!listeners) {
|
|
85
|
+
listeners = new Set();
|
|
86
|
+
this.eventListeners.set(eventName, listeners);
|
|
87
|
+
}
|
|
88
|
+
listeners.add(listener);
|
|
89
|
+
const subscription = this.eventBus.on(`vector-tile-layer.${eventName}`, (event) => {
|
|
90
|
+
safeInvokeCompatListener(listener, event.payload);
|
|
91
|
+
});
|
|
92
|
+
return {
|
|
93
|
+
remove: () => {
|
|
94
|
+
listeners?.delete(listener);
|
|
95
|
+
subscription.remove();
|
|
96
|
+
},
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
setVisibility(visible) {
|
|
100
|
+
this.visible = visible;
|
|
101
|
+
this.notifyWatchers("visible", this.visible);
|
|
102
|
+
this.eventBus.emit("layer.visibility-changed", { layerId: this.id, visible }, this);
|
|
103
|
+
}
|
|
104
|
+
setOpacity(opacity) {
|
|
105
|
+
this.opacity = Math.min(Math.max(opacity, 0), 1);
|
|
106
|
+
this.notifyWatchers("opacity", this.opacity);
|
|
107
|
+
this.eventBus.emit("layer.opacity-changed", { layerId: this.id, opacity: this.opacity }, this);
|
|
108
|
+
}
|
|
109
|
+
getStyle() {
|
|
110
|
+
return this.styleJson ? { ...this.styleJson } : undefined;
|
|
111
|
+
}
|
|
112
|
+
loadStyle(style) {
|
|
113
|
+
this.styleJson = { ...style };
|
|
114
|
+
this.style = style;
|
|
115
|
+
this.notifyWatchers("style", this.styleJson);
|
|
116
|
+
this.eventBus.emit("vector-tile-layer.style-changed", { layerId: this.id, style: this.styleJson }, this);
|
|
117
|
+
}
|
|
118
|
+
destroy() {
|
|
119
|
+
this.watchListeners.clear();
|
|
120
|
+
this.eventListeners.clear();
|
|
121
|
+
this.eventBus.emit("vector-tile-layer.destroyed", { layerId: this.id }, this);
|
|
122
|
+
}
|
|
123
|
+
notifyWatchers(propertyName, value) {
|
|
124
|
+
const listeners = this.watchListeners.get(propertyName);
|
|
125
|
+
if (!listeners)
|
|
126
|
+
return;
|
|
127
|
+
for (const listener of listeners)
|
|
128
|
+
safeInvokeCompatListener(listener, value);
|
|
129
|
+
}
|
|
130
|
+
}
|