UNPKG

@vertigis/viewer-spec

Version:

VertiGIS Viewer Specification

345 lines (344 loc) 11 kB
import type Viewpoint from "@arcgis/core/Viewpoint.js"; import type Point from "@arcgis/core/geometry/Point"; import type SpatialReference from "@arcgis/core/geometry/SpatialReference"; import type { GeometryUnion } from "@arcgis/core/unionTypes.js"; import type { FeatureSource } from "@vertigis/arcgis-extensions/data/FeatureSource"; import type { GeometryJsonType } from "@vertigis/arcgis-extensions/json/GeometryJson.js"; import type { IdentifyOptions } from "@vertigis/arcgis-extensions/tasks/identify/IdentifyOptions"; import type { Event } from "../Event.js"; import { EventRegistry } from "../EventRegistry.js"; import type { Operation } from "../Operation.js"; import { OperationRegistry } from "../OperationRegistry.js"; import type { Features, GeometryLike, LayerLike, MapsFeatureResultArgs, MapsLike } from "../common.js"; interface FilterSourcesBaseArgs { /** * The map from which to retrieve the sources. This argument will not be * forwarded in the result of this operation. */ maps?: MapsLike; /** * The sources to search in. This can be used in combination with the "maps" * argument to search both. */ sources?: FeatureSource[]; } interface FilterSourcesBaseResult { /** * The filtered sources from the map and/or sources. */ sources?: FeatureSource[]; /** * The filtered layers from the map and/or sources. */ layers?: LayerLike[]; } /** * Arguments for the "tasks.filter-sources.by-geometry-type" operation. */ export interface FilterSourcesByGeometryTypeArgs extends FilterSourcesBaseArgs { /** * The geometry type to filter the sources by. */ geometryType?: GeometryJsonType | GeometryJsonType[]; } /** * Result of the "tasks.filter-sources.by-geometry-type" operation. */ export interface FilterSourcesByGeometryTypeResult extends FilterSourcesBaseResult { } /** * Arguments for the "tasks.filter-sources.first-visible" operation. */ export interface FilterSourcesFirstVisibleArgs extends FilterSourcesBaseArgs { } /** * Result of the "tasks.filter-sources.first-visible" operation. */ export interface FilterSourcesFirstVisibleResult extends FilterSourcesBaseResult { } /** * Arguments for search operations. */ export interface SearchArgs { /** * By default the search area will be expanded to try and return the * specified maxResults. Set to true to disable this behavior. Not supported * in VertiGIS Studio Mobile. */ disableSearchAreaExpansion?: boolean; /** * The text to search for. Required. */ searchText: string; /** * The feature sources to search. Can be used instead of or in addition to * "maps". Not supported in VertiGIS Studio Mobile (use "maps"). */ sources?: FeatureSource[]; /** * The map(s) to search. Can be used instead of or in addition to "sources". * This property is required in VertiGIS Studio Mobile. */ maps?: MapsLike; /** * Id of source to filter for. */ sourceId?: string; /** * The maximum number of results to return per source. */ maxResults?: number; /** * The maximum number of results to query per source, the results per source * will still be limited by maxResults. */ maxQueryResults?: number; /** * If specified, results are limited to features that intersect the * geometry. This property is required in VertiGIS Studio Mobile. */ searchArea?: GeometryUnion; /** * If specified, this will influence the score of spatial features based on * their proximity to this point. Most commonly this would be the user's * current location, but can be any point of interest. This option requires * searchArea to also be specified. Not supported in VertiGIS Studio * Mobile. */ near?: Point; /** * The map Viewpoint at the time of the search. Mobile only. */ mapViewpoint?: Viewpoint; /** * The spatial reference for the returned geometry. Not supported in * VertiGIS Studio Mobile. */ outSpatialReference?: SpatialReference; } /** * Arguments for the tasks.identify operation. */ export interface IdentifyArgs { /** * The geometry to identify by. */ geometry: GeometryLike; /** * The feature sources to identify. Can be used instead of or in addition to * "maps". Not supported in VertiGIS Studio Mobile (use "maps"). */ sources?: FeatureSource[]; /** * Whether geometry for features should be returned. Not supported in * VertiGIS Studio Mobile. */ returnGeometry?: boolean; /** * List of fields that should be returned that overrides the default out * fields. Not supported in VertiGIS Studio Mobile. */ outFields?: string[]; /** * The spatial reference for the returned geometry. Not supported in * VertiGIS Studio Mobile. */ outSpatialReference?: SpatialReference; /** * The maximum allowable offset used for generalizing returned geometries. * Not supported in VertiGIS Studio Mobile. */ maxAllowableOffset?: number; /** * The maximum number of results to return per source. Not supported in * VertiGIS Studio Mobile. */ maxResults?: number; /** * The map to identify. Can be used instead of or in addition to "sources". * Layers on the map will be used as sources according to the * "layersInScaleRangeOnly", "layersWithPopupEnabledOnly", and * "visibleLayersOnly" flags. */ maps?: MapsLike; /** * When "map" is specified, this determines whether to include only layers * that are in visible scale range. The default is false. Not supported in * VertiGIS Studio Mobile. */ layersInScaleRangeOnly?: boolean; /** * When "map" is specified, this determines whether to include only layers * that have the `popupEnabled` layer property set to true. The default is * false. Not supported in VertiGIS Studio Mobile. */ layersWithPopupEnabledOnly?: boolean; /** * When "map" is specified, this determines whether to include only visible * layers. The default is true. Not supported in VertiGIS Studio Mobile. */ visibleLayersOnly?: boolean; /** * A tolerance value to use for point identify operations. All features * falling within a buffer of this many logical pixels around the point will * be returned by the identify operation. The default is 10. Not supported * in VertiGIS Studio Mobile. */ pointTolerance?: number; /** * A tolerance value to use for polyline and polygon identify operations. * All features falling within a buffer of this many logical pixels around * the geometry will be returned by the identify operation. The default is * 2. Not supported in VertiGIS Studio Mobile. */ polyTolerance?: number; } /** * Arguments for the tasks.query operation. */ export interface QueryArgs { /** * The feature source to query. */ source: FeatureSource; /** * The where clause to query by. */ where: string; /** * The geometry to query by. */ geometry?: GeometryLike; /** * Whether geometry for features should be returned. */ returnGeometry?: boolean; /** * Fields that should be returned for each feature. */ outFields?: string[]; /** * The spatial reference for the returned geometry. */ outSpatialReference?: SpatialReference; /** * The maximum allowable offset used for generalizing returned geometries. */ maxAllowableOffset?: number; /** * The maximum number of results to return. */ maxResults?: number; } /** * The arguments for the tasks.supports-identify operation. */ export interface SupportsIdentifyArgs { /** * The geometry to identify by. */ geometry?: GeometryUnion; /** * The feature source to identify. */ source: FeatureSource; /** * The options for the identify operation. */ options?: IdentifyOptions; } /** * The arguments for the tasks.supports-identify operation. */ export interface SupportsQueryArgs { /** * The feature source to query. */ source: FeatureSource; } export declare class TasksEvents extends EventRegistry { protected readonly _prefix = "tasks"; /** * Raised when an identify task has been executed. Mobile only. * * @mobileOnly */ get identified(): Event<MapsFeatureResultArgs>; /** * Raised when a reverse geocode is performed. Mobile only. * * @mobileOnly */ get reverseGeocoded(): Event<MapsFeatureResultArgs>; } export declare class TasksOperations extends OperationRegistry { readonly filterResults: FilterSourcesOperations; protected readonly _prefix = "tasks"; /** * Returns values for a specified field from features meeting where clause * criteria. Web only. * * @webOnly */ get suggest(): Operation<QueryArgs, Features>; /** * Returns a boolean indicating whether a FeatureSource supports suggest. * Web only. * * @webOnly */ get supportsSuggest(): Operation<FeatureSource | SupportsQueryArgs, boolean>; /** * Returns features that intersect a given geometry. */ get identify(): Operation<IdentifyArgs, Features>; /** * Returns a boolean depicting whether a FeatureSource supports identify. * Web only. * * @webOnly */ get supportsIdentify(): Operation<FeatureSource | SupportsIdentifyArgs, boolean>; /** * Returns features that match the supplied where clause. Web only. * * @webOnly */ get query(): Operation<QueryArgs, Features>; /** * Returns a boolean depicting whether a FeatureSource supports query. Web * only. * * @webOnly */ get supportsQuery(): Operation<FeatureSource | SupportsQueryArgs, boolean>; /** * Returns features that match the given search text. */ get search(): Operation<SearchArgs, Features>; /** * Returns a boolean depicting whether a FeatureSource supports search. Web * only. * * @webOnly */ get supportsSearch(): Operation<FeatureSource, boolean>; } declare class FilterSourcesOperations extends OperationRegistry { readonly _prefix = "filterSources"; /** * Returns FeatureSources that have a geometry type that matches the * supplied type. Web only. * * @webOnly */ get byGeometryType(): Operation<FilterSourcesByGeometryTypeArgs, FilterSourcesByGeometryTypeResult>; /** * Returns the first visible FeatureSource in the web map within the current * scale range. Web only. * * @webOnly */ get firstVisible(): Operation<FilterSourcesFirstVisibleArgs, FilterSourcesFirstVisibleResult>; } export {};