@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,1175 @@
|
|
|
1
|
+
import { CompatEventBus, resolveCompatEventBus, safeInvokeCompatListener } from "./event-bus.js";
|
|
2
|
+
import { FeatureFilterCompat } from "./feature-filter.js";
|
|
3
|
+
export class MapViewPopupCompat {
|
|
4
|
+
visible;
|
|
5
|
+
location;
|
|
6
|
+
features;
|
|
7
|
+
selectedFeature;
|
|
8
|
+
selectedFeatureIndex;
|
|
9
|
+
title;
|
|
10
|
+
content;
|
|
11
|
+
autoOpenEnabled;
|
|
12
|
+
dockEnabled;
|
|
13
|
+
dockOptions;
|
|
14
|
+
viewModel;
|
|
15
|
+
onChange;
|
|
16
|
+
constructor(onChange, options = {}) {
|
|
17
|
+
this.visible = false;
|
|
18
|
+
this.location = undefined;
|
|
19
|
+
this.features = [];
|
|
20
|
+
this.selectedFeature = undefined;
|
|
21
|
+
this.selectedFeatureIndex = -1;
|
|
22
|
+
this.title = undefined;
|
|
23
|
+
this.content = undefined;
|
|
24
|
+
this.autoOpenEnabled = options.autoOpenEnabled ?? true;
|
|
25
|
+
this.dockEnabled = options.dockEnabled ?? false;
|
|
26
|
+
this.dockOptions = options.dockOptions;
|
|
27
|
+
this.viewModel = {
|
|
28
|
+
active: false,
|
|
29
|
+
};
|
|
30
|
+
this.onChange = onChange;
|
|
31
|
+
}
|
|
32
|
+
open(options = {}) {
|
|
33
|
+
this.visible = true;
|
|
34
|
+
this.viewModel.active = true;
|
|
35
|
+
this.location = options.location;
|
|
36
|
+
this.features = options.features ? [...options.features] : [];
|
|
37
|
+
this.selectedFeature = this.features[0];
|
|
38
|
+
this.selectedFeatureIndex = this.features.length > 0 ? 0 : -1;
|
|
39
|
+
this.title = options.title;
|
|
40
|
+
this.content = options.content;
|
|
41
|
+
this.onChange("open", options);
|
|
42
|
+
}
|
|
43
|
+
close() {
|
|
44
|
+
if (!this.visible) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
this.visible = false;
|
|
48
|
+
this.viewModel.active = false;
|
|
49
|
+
this.location = undefined;
|
|
50
|
+
this.features = [];
|
|
51
|
+
this.selectedFeature = undefined;
|
|
52
|
+
this.selectedFeatureIndex = -1;
|
|
53
|
+
this.title = undefined;
|
|
54
|
+
this.content = undefined;
|
|
55
|
+
this.onChange("close");
|
|
56
|
+
}
|
|
57
|
+
selectFeature(featureOrIndex) {
|
|
58
|
+
if (this.features.length === 0) {
|
|
59
|
+
return undefined;
|
|
60
|
+
}
|
|
61
|
+
const index = typeof featureOrIndex === "number"
|
|
62
|
+
? normalizeFeatureIndex(featureOrIndex, this.features.length)
|
|
63
|
+
: this.features.findIndex((feature) => feature === featureOrIndex);
|
|
64
|
+
if (index < 0) {
|
|
65
|
+
return undefined;
|
|
66
|
+
}
|
|
67
|
+
this.selectedFeatureIndex = index;
|
|
68
|
+
this.selectedFeature = this.features[index];
|
|
69
|
+
this.onChange("selection");
|
|
70
|
+
return this.selectedFeature;
|
|
71
|
+
}
|
|
72
|
+
next() {
|
|
73
|
+
if (this.features.length === 0) {
|
|
74
|
+
return undefined;
|
|
75
|
+
}
|
|
76
|
+
const current = this.selectedFeatureIndex >= 0 ? this.selectedFeatureIndex : 0;
|
|
77
|
+
const next = Math.min(current + 1, this.features.length - 1);
|
|
78
|
+
return this.selectFeature(next);
|
|
79
|
+
}
|
|
80
|
+
previous() {
|
|
81
|
+
if (this.features.length === 0) {
|
|
82
|
+
return undefined;
|
|
83
|
+
}
|
|
84
|
+
const current = this.selectedFeatureIndex >= 0 ? this.selectedFeatureIndex : 0;
|
|
85
|
+
const previous = Math.max(current - 1, 0);
|
|
86
|
+
return this.selectFeature(previous);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
export class MapViewLayerViewCompat {
|
|
90
|
+
layer;
|
|
91
|
+
updating;
|
|
92
|
+
suspended;
|
|
93
|
+
hasAllFeatures;
|
|
94
|
+
hasAllFeaturesInView;
|
|
95
|
+
visible;
|
|
96
|
+
filter;
|
|
97
|
+
effect;
|
|
98
|
+
watchListeners;
|
|
99
|
+
eventBus;
|
|
100
|
+
highlightsInternal;
|
|
101
|
+
nextHighlightId;
|
|
102
|
+
constructor(layer, eventBus) {
|
|
103
|
+
this.layer = layer;
|
|
104
|
+
this.updating = false;
|
|
105
|
+
this.suspended = false;
|
|
106
|
+
this.hasAllFeatures = true;
|
|
107
|
+
this.hasAllFeaturesInView = true;
|
|
108
|
+
this.visible = true;
|
|
109
|
+
this.filter = null;
|
|
110
|
+
this.effect = undefined;
|
|
111
|
+
this.watchListeners = new Map();
|
|
112
|
+
this.eventBus = eventBus;
|
|
113
|
+
this.highlightsInternal = new Map();
|
|
114
|
+
this.nextHighlightId = 1;
|
|
115
|
+
}
|
|
116
|
+
setFilter(input) {
|
|
117
|
+
if (input === null || input === undefined) {
|
|
118
|
+
this.filter = null;
|
|
119
|
+
}
|
|
120
|
+
else if (input instanceof FeatureFilterCompat) {
|
|
121
|
+
this.filter = input;
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
this.filter = new FeatureFilterCompat({ ...input, eventBus: this.eventBus });
|
|
125
|
+
}
|
|
126
|
+
this.notifyWatchers("filter", this.filter);
|
|
127
|
+
this.eventBus?.emit("view.layer-view-filter-changed", { layer: this.layer, filter: this.filter?.toJSON() ?? null }, this);
|
|
128
|
+
}
|
|
129
|
+
setEffect(effect) {
|
|
130
|
+
this.effect = effect;
|
|
131
|
+
this.notifyWatchers("effect", effect);
|
|
132
|
+
this.eventBus?.emit("view.layer-view-effect-changed", { layer: this.layer, effect }, this);
|
|
133
|
+
}
|
|
134
|
+
setVisibility(visible) {
|
|
135
|
+
if (this.visible === visible)
|
|
136
|
+
return;
|
|
137
|
+
this.visible = visible;
|
|
138
|
+
this.notifyWatchers("visible", visible);
|
|
139
|
+
this.eventBus?.emit("view.layer-view-visibility-changed", { layer: this.layer, visible }, this);
|
|
140
|
+
}
|
|
141
|
+
get highlights() {
|
|
142
|
+
return Array.from(this.highlightsInternal.values()).map((record) => ({
|
|
143
|
+
targets: [...record.targets],
|
|
144
|
+
options: { ...record.options },
|
|
145
|
+
}));
|
|
146
|
+
}
|
|
147
|
+
watch(propertyName, listener) {
|
|
148
|
+
let listeners = this.watchListeners.get(propertyName);
|
|
149
|
+
if (!listeners) {
|
|
150
|
+
listeners = new Set();
|
|
151
|
+
this.watchListeners.set(propertyName, listeners);
|
|
152
|
+
}
|
|
153
|
+
listeners.add(listener);
|
|
154
|
+
return {
|
|
155
|
+
remove: () => {
|
|
156
|
+
listeners?.delete(listener);
|
|
157
|
+
},
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
setUpdating(value) {
|
|
161
|
+
this.updating = value;
|
|
162
|
+
this.notifyWatchers("updating", value);
|
|
163
|
+
this.eventBus?.emit("view.layer-view-updating-changed", { layer: this.layer, updating: value }, this);
|
|
164
|
+
}
|
|
165
|
+
setSuspended(value) {
|
|
166
|
+
this.suspended = value;
|
|
167
|
+
this.notifyWatchers("suspended", value);
|
|
168
|
+
this.eventBus?.emit("view.layer-view-suspended-changed", { layer: this.layer, suspended: value }, this);
|
|
169
|
+
}
|
|
170
|
+
setHasAllFeatures(value) {
|
|
171
|
+
this.hasAllFeatures = value;
|
|
172
|
+
this.notifyWatchers("hasAllFeatures", value);
|
|
173
|
+
this.eventBus?.emit("view.layer-view-has-all-features-changed", { layer: this.layer, hasAllFeatures: value }, this);
|
|
174
|
+
}
|
|
175
|
+
setHasAllFeaturesInView(value) {
|
|
176
|
+
this.hasAllFeaturesInView = value;
|
|
177
|
+
this.notifyWatchers("hasAllFeaturesInView", value);
|
|
178
|
+
this.eventBus?.emit("view.layer-view-has-all-features-in-view-changed", { layer: this.layer, hasAllFeaturesInView: value }, this);
|
|
179
|
+
}
|
|
180
|
+
async queryFeatures(options = {}) {
|
|
181
|
+
const merged = this.mergeFilter(options);
|
|
182
|
+
if (isQueryFeaturesProvider(this.layer)) {
|
|
183
|
+
return this.layer.queryFeatures(merged);
|
|
184
|
+
}
|
|
185
|
+
return { features: [] };
|
|
186
|
+
}
|
|
187
|
+
mergeFilter(options) {
|
|
188
|
+
const filter = this.filter;
|
|
189
|
+
if (!filter)
|
|
190
|
+
return options;
|
|
191
|
+
const merged = { ...options };
|
|
192
|
+
const filterWhere = filter.where;
|
|
193
|
+
if (typeof filterWhere === "string" && filterWhere.length > 0) {
|
|
194
|
+
const optionWhere = typeof merged.where === "string" && merged.where.length > 0 ? merged.where : undefined;
|
|
195
|
+
merged.where = optionWhere ? `(${optionWhere}) AND (${filterWhere})` : filterWhere;
|
|
196
|
+
}
|
|
197
|
+
if (filter.objectIds) {
|
|
198
|
+
if (merged.objectIds === undefined) {
|
|
199
|
+
merged.objectIds = [...filter.objectIds];
|
|
200
|
+
}
|
|
201
|
+
else if (Array.isArray(merged.objectIds)) {
|
|
202
|
+
const filterIds = new Set(filter.objectIds);
|
|
203
|
+
merged.objectIds = merged.objectIds.filter((id) => filterIds.has(id));
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
if (merged.geometry === undefined && filter.geometry) {
|
|
207
|
+
merged.geometry = filter.geometry;
|
|
208
|
+
}
|
|
209
|
+
if (merged.spatialRelationship === undefined) {
|
|
210
|
+
merged.spatialRelationship = filter.spatialRelationship;
|
|
211
|
+
}
|
|
212
|
+
if (merged.timeExtent === undefined && filter.timeExtent != null) {
|
|
213
|
+
merged.timeExtent = filter.timeExtent;
|
|
214
|
+
}
|
|
215
|
+
return merged;
|
|
216
|
+
}
|
|
217
|
+
async queryFeatureCount(options = {}) {
|
|
218
|
+
const merged = this.mergeFilter(options);
|
|
219
|
+
if (isQueryFeatureCountProvider(this.layer)) {
|
|
220
|
+
const count = await this.layer.queryFeatureCount(merged);
|
|
221
|
+
return normalizeCount(count);
|
|
222
|
+
}
|
|
223
|
+
const result = await this.queryFeatures(merged);
|
|
224
|
+
if (isFeatureCollection(result)) {
|
|
225
|
+
return result.features.length;
|
|
226
|
+
}
|
|
227
|
+
return 0;
|
|
228
|
+
}
|
|
229
|
+
async queryObjectIds(options = {}) {
|
|
230
|
+
const merged = this.mergeFilter(options);
|
|
231
|
+
if (isQueryObjectIdsProvider(this.layer)) {
|
|
232
|
+
const ids = await this.layer.queryObjectIds(merged);
|
|
233
|
+
return Array.isArray(ids)
|
|
234
|
+
? ids.filter((value) => typeof value === "number" && Number.isFinite(value))
|
|
235
|
+
: [];
|
|
236
|
+
}
|
|
237
|
+
const result = await this.queryFeatures(merged);
|
|
238
|
+
if (!isFeatureCollection(result)) {
|
|
239
|
+
return [];
|
|
240
|
+
}
|
|
241
|
+
const ids = [];
|
|
242
|
+
for (const feature of result.features) {
|
|
243
|
+
const objectId = extractObjectId(feature);
|
|
244
|
+
if (typeof objectId === "number" && Number.isFinite(objectId)) {
|
|
245
|
+
ids.push(objectId);
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
return ids;
|
|
249
|
+
}
|
|
250
|
+
highlight(target, options = {}) {
|
|
251
|
+
const id = this.nextHighlightId;
|
|
252
|
+
this.nextHighlightId += 1;
|
|
253
|
+
const record = {
|
|
254
|
+
targets: normalizeHighlightTargets(target),
|
|
255
|
+
options: { ...options },
|
|
256
|
+
};
|
|
257
|
+
this.highlightsInternal.set(id, record);
|
|
258
|
+
this.notifyWatchers("highlights", this.highlights);
|
|
259
|
+
this.eventBus?.emit("view.layer-view-highlight-added", {
|
|
260
|
+
layer: this.layer,
|
|
261
|
+
targets: [...record.targets],
|
|
262
|
+
options: { ...record.options },
|
|
263
|
+
count: this.highlightsInternal.size,
|
|
264
|
+
}, this);
|
|
265
|
+
return {
|
|
266
|
+
remove: () => {
|
|
267
|
+
this.removeHighlight(id);
|
|
268
|
+
},
|
|
269
|
+
};
|
|
270
|
+
}
|
|
271
|
+
destroy() {
|
|
272
|
+
if (this.highlightsInternal.size > 0) {
|
|
273
|
+
this.highlightsInternal.clear();
|
|
274
|
+
this.notifyWatchers("highlights", this.highlights);
|
|
275
|
+
this.eventBus?.emit("view.layer-view-highlights-cleared", { layer: this.layer, count: 0 }, this);
|
|
276
|
+
}
|
|
277
|
+
this.watchListeners.clear();
|
|
278
|
+
}
|
|
279
|
+
removeHighlight(id) {
|
|
280
|
+
const record = this.highlightsInternal.get(id);
|
|
281
|
+
if (!record) {
|
|
282
|
+
return false;
|
|
283
|
+
}
|
|
284
|
+
this.highlightsInternal.delete(id);
|
|
285
|
+
this.notifyWatchers("highlights", this.highlights);
|
|
286
|
+
this.eventBus?.emit("view.layer-view-highlight-removed", {
|
|
287
|
+
layer: this.layer,
|
|
288
|
+
targets: [...record.targets],
|
|
289
|
+
options: { ...record.options },
|
|
290
|
+
count: this.highlightsInternal.size,
|
|
291
|
+
}, this);
|
|
292
|
+
return true;
|
|
293
|
+
}
|
|
294
|
+
notifyWatchers(propertyName, value) {
|
|
295
|
+
const listeners = this.watchListeners.get(propertyName);
|
|
296
|
+
if (!listeners) {
|
|
297
|
+
return;
|
|
298
|
+
}
|
|
299
|
+
for (const listener of listeners) {
|
|
300
|
+
safeInvokeListener(() => listener(value));
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
export class MapViewUiCompat {
|
|
305
|
+
eventBus;
|
|
306
|
+
onChanged;
|
|
307
|
+
componentsInternal;
|
|
308
|
+
constructor(eventBus, onChanged) {
|
|
309
|
+
this.eventBus = eventBus;
|
|
310
|
+
this.onChanged = onChanged;
|
|
311
|
+
this.componentsInternal = [];
|
|
312
|
+
}
|
|
313
|
+
get components() {
|
|
314
|
+
return this.componentsInternal.map((record) => ({ ...record }));
|
|
315
|
+
}
|
|
316
|
+
add(componentOrComponents, positionOrOptions = "manual") {
|
|
317
|
+
if (Array.isArray(componentOrComponents)) {
|
|
318
|
+
for (const component of componentOrComponents) {
|
|
319
|
+
this.add(component, positionOrOptions);
|
|
320
|
+
}
|
|
321
|
+
return;
|
|
322
|
+
}
|
|
323
|
+
const component = componentOrComponents;
|
|
324
|
+
const options = normalizeUiOptions(positionOrOptions);
|
|
325
|
+
const existingIndex = this.findComponentIndex(component);
|
|
326
|
+
if (existingIndex >= 0) {
|
|
327
|
+
this.componentsInternal.splice(existingIndex, 1);
|
|
328
|
+
}
|
|
329
|
+
const insertIndex = normalizeUiIndex(options.index, this.componentsInternal.length);
|
|
330
|
+
const record = {
|
|
331
|
+
component,
|
|
332
|
+
position: options.position,
|
|
333
|
+
index: insertIndex,
|
|
334
|
+
};
|
|
335
|
+
this.componentsInternal.splice(insertIndex, 0, record);
|
|
336
|
+
this.reindexComponents();
|
|
337
|
+
this.eventBus.emit("view.ui.component-added", {
|
|
338
|
+
component,
|
|
339
|
+
position: record.position,
|
|
340
|
+
index: record.index,
|
|
341
|
+
}, this);
|
|
342
|
+
this.notifyChanged();
|
|
343
|
+
}
|
|
344
|
+
remove(componentOrId) {
|
|
345
|
+
const index = this.findComponentIndex(componentOrId);
|
|
346
|
+
if (index < 0) {
|
|
347
|
+
return false;
|
|
348
|
+
}
|
|
349
|
+
const [removed] = this.componentsInternal.splice(index, 1);
|
|
350
|
+
this.reindexComponents();
|
|
351
|
+
this.eventBus.emit("view.ui.component-removed", {
|
|
352
|
+
component: removed?.component,
|
|
353
|
+
position: removed?.position,
|
|
354
|
+
}, this);
|
|
355
|
+
this.notifyChanged();
|
|
356
|
+
return true;
|
|
357
|
+
}
|
|
358
|
+
removeAll() {
|
|
359
|
+
if (this.componentsInternal.length === 0) {
|
|
360
|
+
return;
|
|
361
|
+
}
|
|
362
|
+
const removedComponents = this.componentsInternal.map((record) => record.component);
|
|
363
|
+
this.componentsInternal.length = 0;
|
|
364
|
+
this.eventBus.emit("view.ui.components-cleared", {
|
|
365
|
+
count: removedComponents.length,
|
|
366
|
+
}, this);
|
|
367
|
+
this.notifyChanged();
|
|
368
|
+
}
|
|
369
|
+
empty(position) {
|
|
370
|
+
const previous = this.componentsInternal.length;
|
|
371
|
+
const remaining = this.componentsInternal.filter((record) => record.position !== position);
|
|
372
|
+
if (remaining.length === previous) {
|
|
373
|
+
return;
|
|
374
|
+
}
|
|
375
|
+
this.componentsInternal.length = 0;
|
|
376
|
+
this.componentsInternal.push(...remaining);
|
|
377
|
+
this.reindexComponents();
|
|
378
|
+
this.eventBus.emit("view.ui.position-cleared", {
|
|
379
|
+
position,
|
|
380
|
+
remainingCount: this.componentsInternal.length,
|
|
381
|
+
}, this);
|
|
382
|
+
this.notifyChanged();
|
|
383
|
+
}
|
|
384
|
+
move(componentOrId, positionOrOptions) {
|
|
385
|
+
const index = this.findComponentIndex(componentOrId);
|
|
386
|
+
if (index < 0) {
|
|
387
|
+
return false;
|
|
388
|
+
}
|
|
389
|
+
const [record] = this.componentsInternal.splice(index, 1);
|
|
390
|
+
const options = normalizeUiOptions(positionOrOptions);
|
|
391
|
+
const insertIndex = normalizeUiIndex(options.index, this.componentsInternal.length);
|
|
392
|
+
const movedRecord = {
|
|
393
|
+
component: record.component,
|
|
394
|
+
position: options.position,
|
|
395
|
+
index: insertIndex,
|
|
396
|
+
};
|
|
397
|
+
this.componentsInternal.splice(insertIndex, 0, movedRecord);
|
|
398
|
+
this.reindexComponents();
|
|
399
|
+
this.eventBus.emit("view.ui.component-moved", {
|
|
400
|
+
component: movedRecord.component,
|
|
401
|
+
position: movedRecord.position,
|
|
402
|
+
index: movedRecord.index,
|
|
403
|
+
}, this);
|
|
404
|
+
this.notifyChanged();
|
|
405
|
+
return true;
|
|
406
|
+
}
|
|
407
|
+
find(componentOrId) {
|
|
408
|
+
const index = this.findComponentIndex(componentOrId);
|
|
409
|
+
return index < 0 ? undefined : this.componentsInternal[index]?.component;
|
|
410
|
+
}
|
|
411
|
+
getComponents(position) {
|
|
412
|
+
if (position === undefined) {
|
|
413
|
+
return this.componentsInternal.map((record) => record.component);
|
|
414
|
+
}
|
|
415
|
+
return this.componentsInternal.filter((record) => record.position === position).map((record) => record.component);
|
|
416
|
+
}
|
|
417
|
+
findComponentIndex(componentOrId) {
|
|
418
|
+
if (typeof componentOrId === "string") {
|
|
419
|
+
for (let i = 0; i < this.componentsInternal.length; i += 1) {
|
|
420
|
+
const component = this.componentsInternal[i]?.component;
|
|
421
|
+
if (isRecord(component) && component.id === componentOrId) {
|
|
422
|
+
return i;
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
return -1;
|
|
426
|
+
}
|
|
427
|
+
return this.componentsInternal.findIndex((record) => record.component === componentOrId);
|
|
428
|
+
}
|
|
429
|
+
reindexComponents() {
|
|
430
|
+
for (let i = 0; i < this.componentsInternal.length; i += 1) {
|
|
431
|
+
const existing = this.componentsInternal[i];
|
|
432
|
+
if (!existing) {
|
|
433
|
+
continue;
|
|
434
|
+
}
|
|
435
|
+
existing.index = i;
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
notifyChanged() {
|
|
439
|
+
this.onChanged?.(this.components);
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
export class MapViewCompat {
|
|
443
|
+
map;
|
|
444
|
+
container;
|
|
445
|
+
loaded;
|
|
446
|
+
loadStatus;
|
|
447
|
+
center;
|
|
448
|
+
zoom;
|
|
449
|
+
scale;
|
|
450
|
+
rotation;
|
|
451
|
+
extent;
|
|
452
|
+
constraints;
|
|
453
|
+
padding;
|
|
454
|
+
highlightOptions;
|
|
455
|
+
spatialReference;
|
|
456
|
+
eventBus;
|
|
457
|
+
popup;
|
|
458
|
+
ui;
|
|
459
|
+
eventListeners;
|
|
460
|
+
watchListeners;
|
|
461
|
+
layerViews;
|
|
462
|
+
readyPromise;
|
|
463
|
+
constructor(options = {}) {
|
|
464
|
+
this.map = options.map;
|
|
465
|
+
this.container = options.container;
|
|
466
|
+
this.loaded = false;
|
|
467
|
+
this.loadStatus = "not-loaded";
|
|
468
|
+
this.center = options.center;
|
|
469
|
+
this.zoom = options.zoom;
|
|
470
|
+
this.scale = options.scale;
|
|
471
|
+
this.rotation = options.rotation;
|
|
472
|
+
this.extent = options.extent;
|
|
473
|
+
this.constraints = options.constraints;
|
|
474
|
+
this.padding = options.padding;
|
|
475
|
+
this.highlightOptions = options.highlightOptions;
|
|
476
|
+
this.spatialReference = options.spatialReference;
|
|
477
|
+
this.eventBus = options.eventBus ?? resolveCompatEventBus(options.map, options.container) ?? new CompatEventBus();
|
|
478
|
+
this.popup = new MapViewPopupCompat((type, popupOptions) => {
|
|
479
|
+
this.notifyWatchers("popup.visible", this.popup.visible);
|
|
480
|
+
this.notifyWatchers("popup.features", this.popup.features);
|
|
481
|
+
this.notifyWatchers("popup.selectedFeature", this.popup.selectedFeature);
|
|
482
|
+
this.notifyWatchers("popup.selectedFeatureIndex", this.popup.selectedFeatureIndex);
|
|
483
|
+
this.notifyWatchers("popup.location", this.popup.location);
|
|
484
|
+
this.notifyWatchers("popup.title", this.popup.title);
|
|
485
|
+
this.notifyWatchers("popup.content", this.popup.content);
|
|
486
|
+
this.notifyWatchers("popup.viewModel.active", this.popup.viewModel.active);
|
|
487
|
+
if (type === "open") {
|
|
488
|
+
this.eventBus.emit("popup.open", popupOptions, this);
|
|
489
|
+
this.emit("popup-open", popupOptions);
|
|
490
|
+
}
|
|
491
|
+
else if (type === "close") {
|
|
492
|
+
this.eventBus.emit("popup.close", popupOptions, this);
|
|
493
|
+
this.emit("popup-close", popupOptions);
|
|
494
|
+
}
|
|
495
|
+
else {
|
|
496
|
+
const selection = {
|
|
497
|
+
selectedFeature: this.popup.selectedFeature,
|
|
498
|
+
selectedFeatureIndex: this.popup.selectedFeatureIndex,
|
|
499
|
+
};
|
|
500
|
+
this.eventBus.emit("popup.selected-feature-changed", selection, this);
|
|
501
|
+
this.emit("popup-selection-change", selection);
|
|
502
|
+
}
|
|
503
|
+
}, extractPopupOptions(options.popup));
|
|
504
|
+
this.ui = new MapViewUiCompat(this.eventBus, (components) => {
|
|
505
|
+
this.notifyWatchers("ui.components", components);
|
|
506
|
+
});
|
|
507
|
+
this.eventListeners = new Map();
|
|
508
|
+
this.watchListeners = new Map();
|
|
509
|
+
this.layerViews = new Map();
|
|
510
|
+
this.readyPromise = Promise.resolve(this);
|
|
511
|
+
}
|
|
512
|
+
async load() {
|
|
513
|
+
if (this.loaded) {
|
|
514
|
+
return this;
|
|
515
|
+
}
|
|
516
|
+
this.loadStatus = "loading";
|
|
517
|
+
this.notifyWatchers("loadStatus", this.loadStatus);
|
|
518
|
+
this.eventBus.emit("view.loading", undefined, this);
|
|
519
|
+
await this.readyPromise;
|
|
520
|
+
this.loaded = true;
|
|
521
|
+
this.notifyWatchers("loaded", this.loaded);
|
|
522
|
+
this.loadStatus = "loaded";
|
|
523
|
+
this.notifyWatchers("loadStatus", this.loadStatus);
|
|
524
|
+
this.eventBus.emit("view.loaded", undefined, this);
|
|
525
|
+
return this;
|
|
526
|
+
}
|
|
527
|
+
async when(callback) {
|
|
528
|
+
const view = await this.load();
|
|
529
|
+
if (callback) {
|
|
530
|
+
callback(view);
|
|
531
|
+
}
|
|
532
|
+
return view;
|
|
533
|
+
}
|
|
534
|
+
toMap(screenPoint) {
|
|
535
|
+
const mapPoint = {
|
|
536
|
+
x: screenPoint.x,
|
|
537
|
+
y: screenPoint.y,
|
|
538
|
+
};
|
|
539
|
+
if (this.spatialReference !== undefined) {
|
|
540
|
+
mapPoint.spatialReference = this.spatialReference;
|
|
541
|
+
}
|
|
542
|
+
return mapPoint;
|
|
543
|
+
}
|
|
544
|
+
toScreen(mapPoint) {
|
|
545
|
+
return {
|
|
546
|
+
x: mapPoint.x,
|
|
547
|
+
y: mapPoint.y,
|
|
548
|
+
};
|
|
549
|
+
}
|
|
550
|
+
async hitTest(event = {}) {
|
|
551
|
+
const mapPoint = event.mapPoint ??
|
|
552
|
+
(typeof event.x === "number" && typeof event.y === "number" ? this.toMap({ x: event.x, y: event.y }) : undefined);
|
|
553
|
+
return {
|
|
554
|
+
results: this.popup.features.map((feature) => ({
|
|
555
|
+
type: "graphic",
|
|
556
|
+
graphic: feature,
|
|
557
|
+
layer: extractGraphicLayer(feature),
|
|
558
|
+
mapPoint,
|
|
559
|
+
})),
|
|
560
|
+
};
|
|
561
|
+
}
|
|
562
|
+
async goTo(target, options = {}) {
|
|
563
|
+
const normalizedTarget = normalizeGoToTarget(target);
|
|
564
|
+
if (normalizedTarget.center !== undefined) {
|
|
565
|
+
this.setCenter(normalizedTarget.center);
|
|
566
|
+
}
|
|
567
|
+
if (normalizedTarget.zoom !== undefined) {
|
|
568
|
+
this.setZoom(normalizedTarget.zoom);
|
|
569
|
+
}
|
|
570
|
+
if (normalizedTarget.scale !== undefined) {
|
|
571
|
+
this.setScale(normalizedTarget.scale);
|
|
572
|
+
}
|
|
573
|
+
if (normalizedTarget.rotation !== undefined) {
|
|
574
|
+
this.setRotation(normalizedTarget.rotation);
|
|
575
|
+
}
|
|
576
|
+
if (normalizedTarget.extent !== undefined) {
|
|
577
|
+
this.setExtent(normalizedTarget.extent);
|
|
578
|
+
}
|
|
579
|
+
const payload = hasGoToOptions(options) ? { target, options } : target;
|
|
580
|
+
this.eventBus.emit("view.go-to", payload, this);
|
|
581
|
+
this.emit("go-to", payload);
|
|
582
|
+
return this;
|
|
583
|
+
}
|
|
584
|
+
async takeScreenshot(options = {}) {
|
|
585
|
+
const width = normalizeScreenshotDimension(options.width, 1024);
|
|
586
|
+
const height = normalizeScreenshotDimension(options.height, 768);
|
|
587
|
+
const format = normalizeScreenshotFormat(options.format);
|
|
588
|
+
const mimeType = format === "jpg" ? "image/jpeg" : "image/png";
|
|
589
|
+
const result = {
|
|
590
|
+
data: new Uint8ClampedArray(width * height * 4),
|
|
591
|
+
dataUrl: `data:${mimeType};base64,`,
|
|
592
|
+
width,
|
|
593
|
+
height,
|
|
594
|
+
};
|
|
595
|
+
const payload = {
|
|
596
|
+
width,
|
|
597
|
+
height,
|
|
598
|
+
format,
|
|
599
|
+
quality: options.quality,
|
|
600
|
+
area: options.area,
|
|
601
|
+
ignoreBackground: options.ignoreBackground,
|
|
602
|
+
};
|
|
603
|
+
this.eventBus.emit("view.screenshot", payload, this);
|
|
604
|
+
this.emit("take-screenshot", payload);
|
|
605
|
+
return result;
|
|
606
|
+
}
|
|
607
|
+
openPopup(options = {}) {
|
|
608
|
+
this.popup.open(options);
|
|
609
|
+
}
|
|
610
|
+
closePopup() {
|
|
611
|
+
this.popup.close();
|
|
612
|
+
}
|
|
613
|
+
setCenter(center) {
|
|
614
|
+
this.center = center;
|
|
615
|
+
this.notifyWatchers("center", this.center);
|
|
616
|
+
this.eventBus.emit("view.center-changed", { center }, this);
|
|
617
|
+
}
|
|
618
|
+
setZoom(zoom) {
|
|
619
|
+
this.zoom = zoom;
|
|
620
|
+
this.notifyWatchers("zoom", this.zoom);
|
|
621
|
+
this.eventBus.emit("view.zoom-changed", { zoom }, this);
|
|
622
|
+
}
|
|
623
|
+
setScale(scale) {
|
|
624
|
+
this.scale = scale;
|
|
625
|
+
this.notifyWatchers("scale", this.scale);
|
|
626
|
+
this.eventBus.emit("view.scale-changed", { scale }, this);
|
|
627
|
+
}
|
|
628
|
+
setRotation(rotation) {
|
|
629
|
+
this.rotation = rotation;
|
|
630
|
+
this.notifyWatchers("rotation", this.rotation);
|
|
631
|
+
this.eventBus.emit("view.rotation-changed", { rotation }, this);
|
|
632
|
+
}
|
|
633
|
+
setExtent(extent) {
|
|
634
|
+
this.extent = extent;
|
|
635
|
+
this.notifyWatchers("extent", this.extent);
|
|
636
|
+
this.eventBus.emit("view.extent-changed", { extent }, this);
|
|
637
|
+
}
|
|
638
|
+
setPadding(padding) {
|
|
639
|
+
this.padding = padding;
|
|
640
|
+
this.notifyWatchers("padding", this.padding);
|
|
641
|
+
this.eventBus.emit("view.padding-changed", { padding }, this);
|
|
642
|
+
}
|
|
643
|
+
setConstraints(constraints) {
|
|
644
|
+
this.constraints = constraints;
|
|
645
|
+
this.notifyWatchers("constraints", this.constraints);
|
|
646
|
+
this.eventBus.emit("view.constraints-changed", { constraints }, this);
|
|
647
|
+
}
|
|
648
|
+
setHighlightOptions(highlightOptions) {
|
|
649
|
+
this.highlightOptions = highlightOptions;
|
|
650
|
+
this.notifyWatchers("highlightOptions", this.highlightOptions);
|
|
651
|
+
this.eventBus.emit("view.highlight-options-changed", { highlightOptions }, this);
|
|
652
|
+
}
|
|
653
|
+
setSpatialReference(spatialReference) {
|
|
654
|
+
this.spatialReference = spatialReference;
|
|
655
|
+
this.notifyWatchers("spatialReference", this.spatialReference);
|
|
656
|
+
this.eventBus.emit("view.spatial-reference-changed", { spatialReference }, this);
|
|
657
|
+
}
|
|
658
|
+
/** Returns all currently created layer views as a read-only collection. */
|
|
659
|
+
get allLayerViews() {
|
|
660
|
+
return Array.from(this.layerViews.values());
|
|
661
|
+
}
|
|
662
|
+
/**
|
|
663
|
+
* Returns an existing layer view for the given layer, or undefined if
|
|
664
|
+
* whenLayerView has not yet been called for it.
|
|
665
|
+
*/
|
|
666
|
+
getLayerView(layer) {
|
|
667
|
+
return this.layerViews.get(layer);
|
|
668
|
+
}
|
|
669
|
+
async whenLayerView(layer) {
|
|
670
|
+
const existing = this.layerViews.get(layer);
|
|
671
|
+
if (existing) {
|
|
672
|
+
return existing;
|
|
673
|
+
}
|
|
674
|
+
const layerView = new MapViewLayerViewCompat(layer, this.eventBus);
|
|
675
|
+
this.layerViews.set(layer, layerView);
|
|
676
|
+
this.notifyWatchers("allLayerViews", this.allLayerViews);
|
|
677
|
+
this.eventBus.emit("view.layer-view-created", { layer, layerView }, this);
|
|
678
|
+
this.eventBus.emit("feature-layer.layerview-create", { view: this, layerView }, this);
|
|
679
|
+
this.emit("layerview-create", { layer, layerView });
|
|
680
|
+
return layerView;
|
|
681
|
+
}
|
|
682
|
+
on(eventName, listener) {
|
|
683
|
+
let listeners = this.eventListeners.get(eventName);
|
|
684
|
+
if (!listeners) {
|
|
685
|
+
listeners = new Set();
|
|
686
|
+
this.eventListeners.set(eventName, listeners);
|
|
687
|
+
}
|
|
688
|
+
listeners.add(listener);
|
|
689
|
+
return {
|
|
690
|
+
remove: () => {
|
|
691
|
+
listeners?.delete(listener);
|
|
692
|
+
},
|
|
693
|
+
};
|
|
694
|
+
}
|
|
695
|
+
watch(propertyName, listener) {
|
|
696
|
+
let listeners = this.watchListeners.get(propertyName);
|
|
697
|
+
if (!listeners) {
|
|
698
|
+
listeners = new Set();
|
|
699
|
+
this.watchListeners.set(propertyName, listeners);
|
|
700
|
+
}
|
|
701
|
+
listeners.add(listener);
|
|
702
|
+
return {
|
|
703
|
+
remove: () => {
|
|
704
|
+
listeners?.delete(listener);
|
|
705
|
+
},
|
|
706
|
+
};
|
|
707
|
+
}
|
|
708
|
+
destroy() {
|
|
709
|
+
this.eventBus.emit("view.destroy", undefined, this);
|
|
710
|
+
this.emit("destroy", undefined);
|
|
711
|
+
this.ui.removeAll();
|
|
712
|
+
for (const layerView of this.layerViews.values()) {
|
|
713
|
+
layerView.destroy();
|
|
714
|
+
}
|
|
715
|
+
this.layerViews.clear();
|
|
716
|
+
this.notifyWatchers("allLayerViews", this.allLayerViews);
|
|
717
|
+
this.closePopup();
|
|
718
|
+
this.map = undefined;
|
|
719
|
+
this.notifyWatchers("map", this.map);
|
|
720
|
+
this.container = undefined;
|
|
721
|
+
this.notifyWatchers("container", this.container);
|
|
722
|
+
this.center = undefined;
|
|
723
|
+
this.notifyWatchers("center", this.center);
|
|
724
|
+
this.zoom = undefined;
|
|
725
|
+
this.notifyWatchers("zoom", this.zoom);
|
|
726
|
+
this.scale = undefined;
|
|
727
|
+
this.notifyWatchers("scale", this.scale);
|
|
728
|
+
this.rotation = undefined;
|
|
729
|
+
this.notifyWatchers("rotation", this.rotation);
|
|
730
|
+
this.extent = undefined;
|
|
731
|
+
this.notifyWatchers("extent", this.extent);
|
|
732
|
+
this.constraints = undefined;
|
|
733
|
+
this.notifyWatchers("constraints", this.constraints);
|
|
734
|
+
this.padding = undefined;
|
|
735
|
+
this.notifyWatchers("padding", this.padding);
|
|
736
|
+
this.highlightOptions = undefined;
|
|
737
|
+
this.notifyWatchers("highlightOptions", this.highlightOptions);
|
|
738
|
+
this.spatialReference = undefined;
|
|
739
|
+
this.notifyWatchers("spatialReference", this.spatialReference);
|
|
740
|
+
this.loaded = false;
|
|
741
|
+
this.notifyWatchers("loaded", this.loaded);
|
|
742
|
+
this.loadStatus = "not-loaded";
|
|
743
|
+
this.notifyWatchers("loadStatus", this.loadStatus);
|
|
744
|
+
this.eventListeners.clear();
|
|
745
|
+
this.watchListeners.clear();
|
|
746
|
+
}
|
|
747
|
+
emit(eventName, payload) {
|
|
748
|
+
const listeners = this.eventListeners.get(eventName);
|
|
749
|
+
if (!listeners || listeners.size === 0) {
|
|
750
|
+
return false;
|
|
751
|
+
}
|
|
752
|
+
for (const listener of listeners) {
|
|
753
|
+
safeInvokeListener(() => listener(payload));
|
|
754
|
+
}
|
|
755
|
+
return true;
|
|
756
|
+
}
|
|
757
|
+
notifyWatchers(propertyName, value) {
|
|
758
|
+
const listeners = this.watchListeners.get(propertyName);
|
|
759
|
+
if (!listeners) {
|
|
760
|
+
return;
|
|
761
|
+
}
|
|
762
|
+
for (const listener of listeners) {
|
|
763
|
+
safeInvokeListener(() => listener(value));
|
|
764
|
+
}
|
|
765
|
+
}
|
|
766
|
+
}
|
|
767
|
+
const GEOMETRY_SEQUENCE_KEYS = ["points", "path", "paths", "ring", "rings"];
|
|
768
|
+
function normalizeGoToTarget(target) {
|
|
769
|
+
const normalized = {};
|
|
770
|
+
const targetRecord = asRecord(target);
|
|
771
|
+
if (targetRecord !== undefined) {
|
|
772
|
+
if ("target" in targetRecord && targetRecord.target !== undefined) {
|
|
773
|
+
mergeGoToTarget(normalized, normalizeGoToTarget(targetRecord.target));
|
|
774
|
+
}
|
|
775
|
+
if (targetRecord.center !== undefined) {
|
|
776
|
+
normalized.center = targetRecord.center;
|
|
777
|
+
}
|
|
778
|
+
const zoom = normalizeFiniteNumber(targetRecord.zoom);
|
|
779
|
+
if (zoom !== undefined) {
|
|
780
|
+
normalized.zoom = zoom;
|
|
781
|
+
}
|
|
782
|
+
const scale = normalizeFiniteNumber(targetRecord.scale);
|
|
783
|
+
if (scale !== undefined) {
|
|
784
|
+
normalized.scale = scale;
|
|
785
|
+
}
|
|
786
|
+
const rotation = normalizeFiniteNumber(targetRecord.rotation);
|
|
787
|
+
if (rotation !== undefined) {
|
|
788
|
+
normalized.rotation = rotation;
|
|
789
|
+
}
|
|
790
|
+
if (targetRecord.extent !== undefined) {
|
|
791
|
+
normalized.extent = targetRecord.extent;
|
|
792
|
+
}
|
|
793
|
+
}
|
|
794
|
+
if (normalized.center === undefined) {
|
|
795
|
+
const derivedCenter = extractGoToCenter(target);
|
|
796
|
+
if (derivedCenter !== undefined) {
|
|
797
|
+
normalized.center = derivedCenter;
|
|
798
|
+
}
|
|
799
|
+
}
|
|
800
|
+
if (normalized.extent === undefined) {
|
|
801
|
+
const derivedExtent = extractGoToExtent(target);
|
|
802
|
+
if (derivedExtent !== undefined) {
|
|
803
|
+
normalized.extent = derivedExtent;
|
|
804
|
+
}
|
|
805
|
+
}
|
|
806
|
+
if (normalized.center === undefined && normalized.extent !== undefined) {
|
|
807
|
+
const centerFromExtent = extractExtentCenter(normalized.extent);
|
|
808
|
+
if (centerFromExtent !== undefined) {
|
|
809
|
+
normalized.center = centerFromExtent;
|
|
810
|
+
}
|
|
811
|
+
}
|
|
812
|
+
return normalized;
|
|
813
|
+
}
|
|
814
|
+
function mergeGoToTarget(target, source) {
|
|
815
|
+
if (source.center !== undefined) {
|
|
816
|
+
target.center = source.center;
|
|
817
|
+
}
|
|
818
|
+
if (source.zoom !== undefined) {
|
|
819
|
+
target.zoom = source.zoom;
|
|
820
|
+
}
|
|
821
|
+
if (source.scale !== undefined) {
|
|
822
|
+
target.scale = source.scale;
|
|
823
|
+
}
|
|
824
|
+
if (source.rotation !== undefined) {
|
|
825
|
+
target.rotation = source.rotation;
|
|
826
|
+
}
|
|
827
|
+
if (source.extent !== undefined) {
|
|
828
|
+
target.extent = source.extent;
|
|
829
|
+
}
|
|
830
|
+
}
|
|
831
|
+
function hasGoToOptions(options) {
|
|
832
|
+
return (options.animate !== undefined ||
|
|
833
|
+
options.duration !== undefined ||
|
|
834
|
+
options.speedFactor !== undefined ||
|
|
835
|
+
options.easing !== undefined);
|
|
836
|
+
}
|
|
837
|
+
function extractGoToCenter(value, visited = new Set()) {
|
|
838
|
+
if (isCoordinatePair(value)) {
|
|
839
|
+
return [value[0], value[1]];
|
|
840
|
+
}
|
|
841
|
+
if (Array.isArray(value)) {
|
|
842
|
+
return undefined;
|
|
843
|
+
}
|
|
844
|
+
if (!isRecord(value)) {
|
|
845
|
+
return undefined;
|
|
846
|
+
}
|
|
847
|
+
if (visited.has(value)) {
|
|
848
|
+
return undefined;
|
|
849
|
+
}
|
|
850
|
+
visited.add(value);
|
|
851
|
+
if ("target" in value && value.target !== undefined) {
|
|
852
|
+
const nestedCenter = extractGoToCenter(value.target, visited);
|
|
853
|
+
if (nestedCenter !== undefined) {
|
|
854
|
+
return nestedCenter;
|
|
855
|
+
}
|
|
856
|
+
}
|
|
857
|
+
if ("geometry" in value && value.geometry !== undefined) {
|
|
858
|
+
const nestedCenter = extractGoToCenter(value.geometry, visited);
|
|
859
|
+
if (nestedCenter !== undefined) {
|
|
860
|
+
return nestedCenter;
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
return extractPointCenterFromRecord(value);
|
|
864
|
+
}
|
|
865
|
+
function extractGoToExtent(value) {
|
|
866
|
+
if (!shouldDeriveExtentFromTarget(value)) {
|
|
867
|
+
return undefined;
|
|
868
|
+
}
|
|
869
|
+
const bounds = collectBounds(value);
|
|
870
|
+
return bounds ? toExtentLike(bounds) : undefined;
|
|
871
|
+
}
|
|
872
|
+
function shouldDeriveExtentFromTarget(value, visited = new Set()) {
|
|
873
|
+
if (isExtentLike(value)) {
|
|
874
|
+
return true;
|
|
875
|
+
}
|
|
876
|
+
if (isCoordinatePair(value)) {
|
|
877
|
+
return false;
|
|
878
|
+
}
|
|
879
|
+
if (Array.isArray(value)) {
|
|
880
|
+
return value.length > 0;
|
|
881
|
+
}
|
|
882
|
+
if (!isRecord(value)) {
|
|
883
|
+
return false;
|
|
884
|
+
}
|
|
885
|
+
if (visited.has(value)) {
|
|
886
|
+
return false;
|
|
887
|
+
}
|
|
888
|
+
visited.add(value);
|
|
889
|
+
if ("target" in value && value.target !== undefined && shouldDeriveExtentFromTarget(value.target, visited)) {
|
|
890
|
+
return true;
|
|
891
|
+
}
|
|
892
|
+
if ("geometry" in value && value.geometry !== undefined && shouldDeriveExtentFromTarget(value.geometry, visited)) {
|
|
893
|
+
return true;
|
|
894
|
+
}
|
|
895
|
+
return hasCoordinateSequences(value);
|
|
896
|
+
}
|
|
897
|
+
function collectBounds(value, visited = new Set()) {
|
|
898
|
+
if (isExtentLike(value)) {
|
|
899
|
+
return {
|
|
900
|
+
xmin: value.xmin,
|
|
901
|
+
ymin: value.ymin,
|
|
902
|
+
xmax: value.xmax,
|
|
903
|
+
ymax: value.ymax,
|
|
904
|
+
spatialReference: value.spatialReference,
|
|
905
|
+
};
|
|
906
|
+
}
|
|
907
|
+
if (isCoordinatePair(value)) {
|
|
908
|
+
return createBoundsFromPoint(value[0], value[1]);
|
|
909
|
+
}
|
|
910
|
+
if (Array.isArray(value)) {
|
|
911
|
+
let bounds;
|
|
912
|
+
for (const item of value) {
|
|
913
|
+
bounds = mergeBounds(bounds, collectBounds(item, visited));
|
|
914
|
+
}
|
|
915
|
+
return bounds;
|
|
916
|
+
}
|
|
917
|
+
if (!isRecord(value)) {
|
|
918
|
+
return undefined;
|
|
919
|
+
}
|
|
920
|
+
if (visited.has(value)) {
|
|
921
|
+
return undefined;
|
|
922
|
+
}
|
|
923
|
+
visited.add(value);
|
|
924
|
+
let bounds;
|
|
925
|
+
if ("target" in value && value.target !== undefined) {
|
|
926
|
+
bounds = mergeBounds(bounds, collectBounds(value.target, visited));
|
|
927
|
+
}
|
|
928
|
+
if ("geometry" in value && value.geometry !== undefined) {
|
|
929
|
+
bounds = mergeBounds(bounds, collectBounds(value.geometry, visited));
|
|
930
|
+
}
|
|
931
|
+
const point = extractPointFromRecord(value);
|
|
932
|
+
if (point !== undefined) {
|
|
933
|
+
bounds = mergeBounds(bounds, createBoundsFromPoint(point.x, point.y, point.spatialReference));
|
|
934
|
+
}
|
|
935
|
+
for (const key of GEOMETRY_SEQUENCE_KEYS) {
|
|
936
|
+
if (key in value) {
|
|
937
|
+
bounds = mergeBounds(bounds, collectBounds(value[key], visited));
|
|
938
|
+
}
|
|
939
|
+
}
|
|
940
|
+
return bounds;
|
|
941
|
+
}
|
|
942
|
+
function hasCoordinateSequences(value) {
|
|
943
|
+
return GEOMETRY_SEQUENCE_KEYS.some((key) => key in value && Array.isArray(value[key]));
|
|
944
|
+
}
|
|
945
|
+
function extractPointCenterFromRecord(value) {
|
|
946
|
+
const point = extractPointFromRecord(value);
|
|
947
|
+
if (point === undefined) {
|
|
948
|
+
return undefined;
|
|
949
|
+
}
|
|
950
|
+
return {
|
|
951
|
+
x: point.x,
|
|
952
|
+
y: point.y,
|
|
953
|
+
spatialReference: point.spatialReference,
|
|
954
|
+
};
|
|
955
|
+
}
|
|
956
|
+
function extractPointFromRecord(value) {
|
|
957
|
+
const x = normalizeFiniteNumber(value.x);
|
|
958
|
+
const y = normalizeFiniteNumber(value.y);
|
|
959
|
+
if (x !== undefined && y !== undefined) {
|
|
960
|
+
return {
|
|
961
|
+
x,
|
|
962
|
+
y,
|
|
963
|
+
spatialReference: asSpatialReferenceLike(value.spatialReference),
|
|
964
|
+
};
|
|
965
|
+
}
|
|
966
|
+
const longitude = normalizeFiniteNumber(value.longitude);
|
|
967
|
+
const latitude = normalizeFiniteNumber(value.latitude);
|
|
968
|
+
if (longitude !== undefined && latitude !== undefined) {
|
|
969
|
+
return {
|
|
970
|
+
x: longitude,
|
|
971
|
+
y: latitude,
|
|
972
|
+
spatialReference: asSpatialReferenceLike(value.spatialReference),
|
|
973
|
+
};
|
|
974
|
+
}
|
|
975
|
+
return undefined;
|
|
976
|
+
}
|
|
977
|
+
function asSpatialReferenceLike(value) {
|
|
978
|
+
return isRecord(value) ? value : undefined;
|
|
979
|
+
}
|
|
980
|
+
function normalizeFiniteNumber(value) {
|
|
981
|
+
return typeof value === "number" && Number.isFinite(value) ? value : undefined;
|
|
982
|
+
}
|
|
983
|
+
function normalizeScreenshotDimension(value, fallback) {
|
|
984
|
+
if (value === undefined || !Number.isFinite(value)) {
|
|
985
|
+
return fallback;
|
|
986
|
+
}
|
|
987
|
+
return Math.max(1, Math.trunc(value));
|
|
988
|
+
}
|
|
989
|
+
function normalizeScreenshotFormat(format) {
|
|
990
|
+
if (format === "jpg" || format === "jpeg") {
|
|
991
|
+
return "jpg";
|
|
992
|
+
}
|
|
993
|
+
return "png";
|
|
994
|
+
}
|
|
995
|
+
function createBoundsFromPoint(x, y, spatialReference) {
|
|
996
|
+
return {
|
|
997
|
+
xmin: x,
|
|
998
|
+
ymin: y,
|
|
999
|
+
xmax: x,
|
|
1000
|
+
ymax: y,
|
|
1001
|
+
spatialReference,
|
|
1002
|
+
};
|
|
1003
|
+
}
|
|
1004
|
+
function mergeBounds(current, next) {
|
|
1005
|
+
if (next === undefined) {
|
|
1006
|
+
return current;
|
|
1007
|
+
}
|
|
1008
|
+
if (current === undefined) {
|
|
1009
|
+
return next;
|
|
1010
|
+
}
|
|
1011
|
+
return {
|
|
1012
|
+
xmin: Math.min(current.xmin, next.xmin),
|
|
1013
|
+
ymin: Math.min(current.ymin, next.ymin),
|
|
1014
|
+
xmax: Math.max(current.xmax, next.xmax),
|
|
1015
|
+
ymax: Math.max(current.ymax, next.ymax),
|
|
1016
|
+
spatialReference: current.spatialReference ?? next.spatialReference,
|
|
1017
|
+
};
|
|
1018
|
+
}
|
|
1019
|
+
function toExtentLike(bounds) {
|
|
1020
|
+
return {
|
|
1021
|
+
xmin: bounds.xmin,
|
|
1022
|
+
ymin: bounds.ymin,
|
|
1023
|
+
xmax: bounds.xmax,
|
|
1024
|
+
ymax: bounds.ymax,
|
|
1025
|
+
spatialReference: bounds.spatialReference,
|
|
1026
|
+
};
|
|
1027
|
+
}
|
|
1028
|
+
function extractExtentCenter(extent) {
|
|
1029
|
+
if (!isExtentLike(extent)) {
|
|
1030
|
+
return undefined;
|
|
1031
|
+
}
|
|
1032
|
+
return {
|
|
1033
|
+
x: (extent.xmin + extent.xmax) / 2,
|
|
1034
|
+
y: (extent.ymin + extent.ymax) / 2,
|
|
1035
|
+
spatialReference: extent.spatialReference,
|
|
1036
|
+
};
|
|
1037
|
+
}
|
|
1038
|
+
function isCoordinatePair(value) {
|
|
1039
|
+
return (Array.isArray(value) &&
|
|
1040
|
+
value.length >= 2 &&
|
|
1041
|
+
typeof value[0] === "number" &&
|
|
1042
|
+
Number.isFinite(value[0]) &&
|
|
1043
|
+
typeof value[1] === "number" &&
|
|
1044
|
+
Number.isFinite(value[1]));
|
|
1045
|
+
}
|
|
1046
|
+
function isExtentLike(value) {
|
|
1047
|
+
return (isRecord(value) &&
|
|
1048
|
+
typeof value.xmin === "number" &&
|
|
1049
|
+
Number.isFinite(value.xmin) &&
|
|
1050
|
+
typeof value.ymin === "number" &&
|
|
1051
|
+
Number.isFinite(value.ymin) &&
|
|
1052
|
+
typeof value.xmax === "number" &&
|
|
1053
|
+
Number.isFinite(value.xmax) &&
|
|
1054
|
+
typeof value.ymax === "number" &&
|
|
1055
|
+
Number.isFinite(value.ymax));
|
|
1056
|
+
}
|
|
1057
|
+
function normalizeUiOptions(input) {
|
|
1058
|
+
if (typeof input === "string") {
|
|
1059
|
+
return {
|
|
1060
|
+
position: input,
|
|
1061
|
+
index: Number.NaN,
|
|
1062
|
+
};
|
|
1063
|
+
}
|
|
1064
|
+
const position = typeof input.position === "string" && input.position.length > 0 ? input.position : "manual";
|
|
1065
|
+
const index = typeof input.index === "number" && Number.isFinite(input.index) ? Math.trunc(input.index) : Number.NaN;
|
|
1066
|
+
return {
|
|
1067
|
+
position,
|
|
1068
|
+
index,
|
|
1069
|
+
};
|
|
1070
|
+
}
|
|
1071
|
+
function normalizeUiIndex(index, length) {
|
|
1072
|
+
if (!Number.isFinite(index)) {
|
|
1073
|
+
return length;
|
|
1074
|
+
}
|
|
1075
|
+
return Math.min(Math.max(index, 0), length);
|
|
1076
|
+
}
|
|
1077
|
+
function normalizeFeatureIndex(index, length) {
|
|
1078
|
+
if (!Number.isFinite(index)) {
|
|
1079
|
+
return -1;
|
|
1080
|
+
}
|
|
1081
|
+
const normalized = Math.trunc(index);
|
|
1082
|
+
if (normalized < 0 || normalized >= length) {
|
|
1083
|
+
return -1;
|
|
1084
|
+
}
|
|
1085
|
+
return normalized;
|
|
1086
|
+
}
|
|
1087
|
+
function normalizeHighlightTargets(target) {
|
|
1088
|
+
if (Array.isArray(target)) {
|
|
1089
|
+
return [...target];
|
|
1090
|
+
}
|
|
1091
|
+
return [target];
|
|
1092
|
+
}
|
|
1093
|
+
function isQueryFeaturesProvider(value) {
|
|
1094
|
+
return (typeof value === "object" && value !== null && "queryFeatures" in value && typeof value.queryFeatures === "function");
|
|
1095
|
+
}
|
|
1096
|
+
function isQueryFeatureCountProvider(value) {
|
|
1097
|
+
return (typeof value === "object" &&
|
|
1098
|
+
value !== null &&
|
|
1099
|
+
"queryFeatureCount" in value &&
|
|
1100
|
+
typeof value.queryFeatureCount === "function");
|
|
1101
|
+
}
|
|
1102
|
+
function isQueryObjectIdsProvider(value) {
|
|
1103
|
+
return (typeof value === "object" &&
|
|
1104
|
+
value !== null &&
|
|
1105
|
+
"queryObjectIds" in value &&
|
|
1106
|
+
typeof value.queryObjectIds === "function");
|
|
1107
|
+
}
|
|
1108
|
+
function isFeatureCollection(value) {
|
|
1109
|
+
return typeof value === "object" && value !== null && "features" in value && Array.isArray(value.features);
|
|
1110
|
+
}
|
|
1111
|
+
function extractObjectId(feature) {
|
|
1112
|
+
if (typeof feature !== "object" || feature === null) {
|
|
1113
|
+
return undefined;
|
|
1114
|
+
}
|
|
1115
|
+
if ("objectId" in feature && typeof feature.objectId === "number") {
|
|
1116
|
+
return feature.objectId;
|
|
1117
|
+
}
|
|
1118
|
+
if ("attributes" in feature && typeof feature.attributes === "object" && feature.attributes !== null) {
|
|
1119
|
+
if ("OBJECTID" in feature.attributes &&
|
|
1120
|
+
typeof feature.attributes.OBJECTID === "number" &&
|
|
1121
|
+
Number.isFinite(feature.attributes.OBJECTID)) {
|
|
1122
|
+
return feature.attributes.OBJECTID;
|
|
1123
|
+
}
|
|
1124
|
+
if ("objectid" in feature.attributes &&
|
|
1125
|
+
typeof feature.attributes.objectid === "number" &&
|
|
1126
|
+
Number.isFinite(feature.attributes.objectid)) {
|
|
1127
|
+
return feature.attributes.objectid;
|
|
1128
|
+
}
|
|
1129
|
+
if ("objectId" in feature.attributes &&
|
|
1130
|
+
typeof feature.attributes.objectId === "number" &&
|
|
1131
|
+
Number.isFinite(feature.attributes.objectId)) {
|
|
1132
|
+
return feature.attributes.objectId;
|
|
1133
|
+
}
|
|
1134
|
+
}
|
|
1135
|
+
return undefined;
|
|
1136
|
+
}
|
|
1137
|
+
function normalizeCount(value) {
|
|
1138
|
+
return typeof value === "number" && Number.isFinite(value) ? value : 0;
|
|
1139
|
+
}
|
|
1140
|
+
function extractGraphicLayer(value) {
|
|
1141
|
+
if (!("layer" in value) || value.layer === undefined || value.layer === null) {
|
|
1142
|
+
return undefined;
|
|
1143
|
+
}
|
|
1144
|
+
if (typeof value.layer === "object") {
|
|
1145
|
+
return value.layer;
|
|
1146
|
+
}
|
|
1147
|
+
return undefined;
|
|
1148
|
+
}
|
|
1149
|
+
function safeInvokeListener(invoke) {
|
|
1150
|
+
try {
|
|
1151
|
+
invoke();
|
|
1152
|
+
}
|
|
1153
|
+
catch {
|
|
1154
|
+
// Listener errors should not break compatibility flow.
|
|
1155
|
+
}
|
|
1156
|
+
}
|
|
1157
|
+
function isRecord(value) {
|
|
1158
|
+
return typeof value === "object" && value !== null;
|
|
1159
|
+
}
|
|
1160
|
+
function asRecord(value) {
|
|
1161
|
+
if (!isRecord(value) || Array.isArray(value)) {
|
|
1162
|
+
return undefined;
|
|
1163
|
+
}
|
|
1164
|
+
return value;
|
|
1165
|
+
}
|
|
1166
|
+
function extractPopupOptions(popup) {
|
|
1167
|
+
if (!isRecord(popup)) {
|
|
1168
|
+
return {};
|
|
1169
|
+
}
|
|
1170
|
+
return {
|
|
1171
|
+
autoOpenEnabled: typeof popup.autoOpenEnabled === "boolean" ? popup.autoOpenEnabled : undefined,
|
|
1172
|
+
dockEnabled: typeof popup.dockEnabled === "boolean" ? popup.dockEnabled : undefined,
|
|
1173
|
+
dockOptions: popup.dockOptions,
|
|
1174
|
+
};
|
|
1175
|
+
}
|