import type Graphic from "../Graphic.js"; import type Collection from "../core/Collection.js"; import type Extent from "../geometry/Extent.js"; import type Layer from "./Layer.js"; import type CatalogDynamicGroupLayer from "./catalog/CatalogDynamicGroupLayer.js"; import type CatalogFootprintLayer from "./catalog/CatalogFootprintLayer.js"; import type Field from "./support/Field.js"; import type AttributeBinsFeatureSet from "../rest/support/AttributeBinsFeatureSet.js"; import type FeatureSet from "../rest/support/FeatureSet.js"; import type Query from "../rest/support/Query.js"; import type { MultiOriginJSONSupportMixin } from "../core/MultiOriginJSONSupport.js"; import type { APIKeyMixin, APIKeyMixinProperties } from "./mixins/APIKeyMixin.js"; import type { BlendLayer, BlendLayerProperties } from "./mixins/BlendLayer.js"; import type { CustomParametersMixin, CustomParametersMixinProperties } from "./mixins/CustomParametersMixin.js"; import type { DisplayFilteredLayer, DisplayFilteredLayerProperties } from "./mixins/DisplayFilteredLayer.js"; import type { EditBusLayer } from "./mixins/EditBusLayer.js"; import type { FeatureLayerBase, FeatureLayerBaseProperties } from "./mixins/FeatureLayerBase.js"; import type { OperationalLayer, OperationalLayerProperties } from "./mixins/OperationalLayer.js"; import type { OrderedLayer, OrderedLayerProperties } from "./mixins/OrderedLayer.js"; import type { PortalLayer, PortalLayerProperties } from "./mixins/PortalLayer.js"; import type { RefreshableLayer, RefreshableLayerProperties } from "./mixins/RefreshableLayer.js"; import type { ScaleRangeLayer, ScaleRangeLayerProperties } from "./mixins/ScaleRangeLayer.js"; import type { TemporalLayer, TemporalLayerProperties } from "./mixins/TemporalLayer.js"; import type { RequestOptions } from "../request/types.js"; import type { AttributeBinsQueryProperties } from "../rest/support/AttributeBinsQuery.js"; import type { QueryProperties } from "../rest/support/Query.js"; import type { ObjectId } from "../views/types.js"; import type { LayerProperties } from "./Layer.js"; export interface CatalogLayerProperties extends LayerProperties, APIKeyMixinProperties, CustomParametersMixinProperties, PortalLayerProperties, OperationalLayerProperties, RefreshableLayerProperties, ScaleRangeLayerProperties, TemporalLayerProperties, OrderedLayerProperties, BlendLayerProperties, FeatureLayerBaseProperties, DisplayFilteredLayerProperties, Partial> { /** * The absolute URL of the REST endpoint of a catalog service. * * @example * // Create a catalog layer from a service * const layer = new CatalogLayer({ * url: "https://services3.arcgis.com/TVDq0jswpjtt1Xia/arcgis/rest/services/PNW_Forest_Fuels_Inventory_Status/FeatureServer" * }); * @example * // Hosted Feature Service on ArcGIS Online * layer.url = "http://services.arcgis.com/V6ZHFr6zdgNZuVG0/arcgis/rest/services/origins/FeatureServer/0"; * @example * // Layer from Map Service on ArcGIS Server * layer.url = "http://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer/2"; * @example * // Can also be used if URL points to service and not layer * const layer = new FeatureLayer({ * // Notice that the url doesn't end with /2 * url: "http://services.arcgis.com/V6ZHFr6zdgNZuVG0/arcgis/rest/services/MonterreyBayCanyon_WFL/FeatureServer", * layerId: 2 * }); * @example * // Non-spatial table in San Francisco incidents service. * const table = new FeatureLayer({ * url: "https://sampleserver6.arcgisonline.com/arcgis/rest/services/SF311/FeatureServer/1" * }); * // table must be loaded so it can be used in the app. * table.load().then(function() { * // table is loaded. ready to be queried. * }); */ url?: string | null; } /** * * [Overview](https://developers.arcgis.com/javascript/latest/references/core/layers/CatalogLayer/#overview) * * [Creating a CatalogLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/CatalogLayer/#creating-a-cataloglayer) * * [Sublayers of CatalogLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/CatalogLayer/#layer-types) * * [CatalogLayer attributes](https://developers.arcgis.com/javascript/latest/references/core/layers/CatalogLayer/#attributes) * * * ### Overview * * CatalogLayer points to different portal items and services, helping you to better organize and manage your data. It also makes it simpler for users to find information. * Instead of manually gathering and adding each dataset separately in your map, you can create a CatalogLayer, which serves as a centralized reference point for all * the data you need. CatalogLayer enhances collaboration by enabling users to share and access data more efficiently. For instance, if you're collaborating with * colleagues on a GIS project, you can share your CatalogLayer with them. They can then access the same datasets and services referenced in the CatalogLayer, * streamlining the collaboration process. * * * ### Creating a CatalogLayer * * CatalogLayers may be created in one of two ways: from a [service URL](https://developers.arcgis.com/javascript/latest/references/core/layers/CatalogLayer/#url) or from an ArcGIS portal [item ID](https://developers.arcgis.com/javascript/latest/references/core/layers/CatalogLayer/#portalItem). * *
* Read More * * #### Reference a service URL * * To create a CatalogLayer instance from a service, you must set the [url](https://developers.arcgis.com/javascript/latest/references/core/layers/CatalogLayer/#url) property to the REST endpoint of a layer in either a Feature Service or a Map Service. * For a layer to be visible in a view, it must be added to the [Map](https://developers.arcgis.com/javascript/latest/references/core/Map/) referenced by the view. See [Map.add()](https://developers.arcgis.com/javascript/latest/references/core/Map/#add) for information * about adding layers to a map. * * ```js * const CatalogLayer = await $arcgis.import("@arcgis/core/layers/CatalogLayer.js"); * // points to pacific northwest forest fuels inventory status * const layer = new CatalogLayer({ * url: "https://services3.arcgis.com/TVDq0jswpjtt1Xia/arcgis/rest/services/PNW_Forest_Fuels_Inventory_Status/FeatureServer" * }); * map.add(layer); // adds the layer to the map * ``` * * #### Reference an ArcGIS portal item ID * * You can also create a CatalogLayer from its portal item ID if it exists as an item in ArcGIS Online or ArcGIS Enterprise. * For example, the following snippet shows how to add a new CatalogLayer instance to a map using the [portalItem](https://developers.arcgis.com/javascript/latest/references/core/layers/CatalogLayer/#portalItem) property. * * ```js * // points to a hosted Feature Layer in ArcGIS Online * const layer = new CatalogLayer({ * portalItem: { // autocasts as esri/portal/PortalItem * id: "3a9938eab3a3483f88d20b9269f0c098" // portal item id * } * }); * map.add(layer); // adds the layer to the map * ``` * *
* * * ### Sublayers of CatalogLayer * * The catalog layer has two main sublayers which can be accessed via the [footprintLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/CatalogLayer/#footprintLayer) and the [dynamicGroupLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/CatalogLayer/#dynamicGroupLayer) properties. * These parts are grouped together under the catalog layer, which manages their settings. * *
* Read More * * #### Footprint layer * Every catalog item (layer) in the CatalogLayer has a footprint stored in the [footprintLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/CatalogLayer/#footprintLayer). * A footprint is a polygon feature that envelopes all of the item's features, rasters, and so forth. * Each footprint feature has attributes that provide details about the item, such as its name, layer type, source, minScale, and maxScale. * You can add, update, and maintain your own fields and values in the footprint layer. You cannot remove the `footprintLayer` from the CatalogLayer. * *
* footprint *
This image shows CatalogLayer and its footprint layer legend in the CatalogLayerList.
*
* * This layer has the same properties as a polygon feature layer, with some exceptions. You can update its [visibility](https://developers.arcgis.com/javascript/latest/references/core/layers/catalog/CatalogFootprintLayer/#visible) and * change how the layer is visualized by adding [labels](https://developers.arcgis.com/javascript/latest/references/core/layers/catalog/CatalogFootprintLayer/#labelingInfo), updating the [CatalogFootprintLayer.renderer](https://developers.arcgis.com/javascript/latest/references/core/layers/catalog/CatalogFootprintLayer/#renderer), * and [extruding](https://developers.arcgis.com/javascript/latest/references/core/layers/catalog/CatalogFootprintLayer/#elevationInfo) the features (in 3D). You can also [query](https://developers.arcgis.com/javascript/latest/references/core/layers/catalog/CatalogFootprintLayer/#queryFeatures) the layer to get the footprints of the items in the CatalogLayer. * * #### Dynamic group layer * The [dynamicGroupLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/CatalogLayer/#dynamicGroupLayer) dynamically updates to display catalog items (layers) in the current view. By default, it draws up to 10 layers at a time. * This default setting can be changed by adjusting [CatalogDynamicGroupLayer.maximumVisibleSublayers](https://developers.arcgis.com/javascript/latest/references/core/layers/catalog/CatalogDynamicGroupLayer/#maximumVisibleSublayers) * property on the `CatalogDynamicGroupLayer`. Additionally, the layer can be filtered to show catalog items in a defined scale range, time, or other property. * Because the layer is dynamic, its list of layers in the [LayerList.catalogLayerList](https://developers.arcgis.com/javascript/latest/references/core/widgets/LayerList/#catalogLayerList) changes as you pan, zoom, or change the view's extent. * * The layers in the dynamicGroupLayer are read-only and not editable. All layers in the dynamicGroupLayer draw with their default symbology. To edit, change, or save a layer, * you must add the layer to the map by calling [createLayerFromFootprint()](https://developers.arcgis.com/javascript/latest/references/core/layers/CatalogLayer/#createLayerFromFootprint) method on the parent [CatalogLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/CatalogLayer/). * *
* dynamic *
This image shows the sublayers of the CatalogDynamicGroupLayer visible on the map.
*
* *
* * * ### CatalogLayer attributes * * The catalog layer's attribute table can be opened to view all catalog items included in the layer. Each item is a record in the attribute table. * A catalog layer's attribute table typically includes the following fields that are required to be present in the catalog layer: * | Field name | Description | * | ----------- | ----------- | * | [cd_itemname](https://developers.arcgis.com/javascript/latest/references/core/layers/CatalogLayer/#itemNameField) | The name of the catalog item. | * | [cd_itemsource](https://developers.arcgis.com/javascript/latest/references/core/layers/CatalogLayer/#itemSourceField) | The source path of the catalog item. | * | [cd_itemtype](https://developers.arcgis.com/javascript/latest/references/core/layers/CatalogLayer/#itemTypeField) | The type of the catalog item, such as `Feature Class` or `Image Service`. | * | [cd_maxscale](https://developers.arcgis.com/javascript/latest/references/core/layers/CatalogLayer/#maxScaleField) | The maximum scale at which the catalog item can be displayed. | * | [cd_minscale](https://developers.arcgis.com/javascript/latest/references/core/layers/CatalogLayer/#minScaleField) | The minimum scale at which the catalog item can be displayed. | * | [cd_draworder](https://developers.arcgis.com/javascript/latest/references/core/layers/CatalogLayer/#drawOrderField) | The draw order field holds the value to sort catalog items. By default, items with the highest values draw first (on the bottom), and the lowest values draw last (on top). | * * * > [!WARNING] * > * > * > **Notes** * > * > The CatalogLayer's [dynamicGroupLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/CatalogLayer/#dynamicGroupLayer) frequently adds and removes layers from the map which puts more pressure on mobile devices. To improve performance on mobile devices, we recommend * > the following settings on your CatalogLayer: * > * Turn off the visibility of the [CatalogDynamicGroupLayer.visible](https://developers.arcgis.com/javascript/latest/references/core/layers/catalog/CatalogDynamicGroupLayer/#visible) by default. * > * Set the CatalogDynamicGroupLayer's [CatalogDynamicGroupLayer.maximumVisibleSublayers](https://developers.arcgis.com/javascript/latest/references/core/layers/catalog/CatalogDynamicGroupLayer/#maximumVisibleSublayers) to a small number. * > * Set appropriate scale ranges on catalog items with many features in the service via [minScaleField](https://developers.arcgis.com/javascript/latest/references/core/layers/CatalogLayer/#minScaleField) and [maxScaleField](https://developers.arcgis.com/javascript/latest/references/core/layers/CatalogLayer/#maxScaleField) properties. * > * Set scale ranges on the CatalogDynamicGroupLayer via its [minsScale](https://developers.arcgis.com/javascript/latest/references/core/layers/catalog/CatalogDynamicGroupLayer/#minScale) and [CatalogDynamicGroupLayer.maxScale](https://developers.arcgis.com/javascript/latest/references/core/layers/catalog/CatalogDynamicGroupLayer/#maxScale) * > properties to visualize `Layers in view` at appropriate scales. * * > [!WARNING] * > * > * > **Known Limitations** * > * > In 3D [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/), the [CatalogDynamicGroupLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/catalog/CatalogDynamicGroupLayer/) may load layers outside of the view's visible area. This will be improved in a future release. * * @since 4.30 * @see [CatalogDynamicGroupLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/catalog/CatalogDynamicGroupLayer/) * @see [CatalogFootprintLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/catalog/CatalogFootprintLayer/) * @see [Sample - Intro to CatalogLayer](https://developers.arcgis.com/javascript/latest/sample-code/layers-cataloglayer/) * @see [Sample - Explore data in CatalogLayer](https://developers.arcgis.com/javascript/latest/sample-code/layers-cataloglayer-2d/) */ export default class CatalogLayer extends CatalogLayerSuperclass { /** * @example * // Typical usage * // Create catalog layer from a service * const layer = new CatalogLayer({ * // URL to the service * url: "https://services3.arcgis.com/TVDq0jswpjtt1Xia/arcgis/rest/services/PNW_Forest_Fuels_Inventory_Status/FeatureServer" * }); */ constructor(properties?: CatalogLayerProperties); /** * The draw order field holds the value to sort catalog items (layers). By default, layers with the highest values draw first (on the bottom), and the lowest values draw last (on top). This can be changed by specifying the * [orderBy](https://developers.arcgis.com/javascript/latest/references/core/layers/CatalogLayer/#orderBy) property. */ get drawOrderField(): "cd_draworder"; /** * The dynamicGroupLayer includes the catalog items (layers) that are currently visible in your view. Since it's dynamic, its list of * layers in the [LayerList.catalogLayerList](https://developers.arcgis.com/javascript/latest/references/core/widgets/LayerList/#catalogLayerList) changes as you interact with the map. By default, CatalogLayer draws up to 10 layers at a time. * This default setting can be changed by adjusting the [CatalogDynamicGroupLayer.maximumVisibleSublayers](https://developers.arcgis.com/javascript/latest/references/core/layers/catalog/CatalogDynamicGroupLayer/#maximumVisibleSublayers) property. * * @example * // Change the maximumVisibleSublayers of the dynamicGroupLayer after the catalog layer is loaded * const layerView = await view.whenLayerView(layer); * await reactiveUtils.whenOnce(() => !layerView.updating); * layer.dynamicGroupLayer.maximumVisibleSublayers = 20; */ get dynamicGroupLayer(): CatalogDynamicGroupLayer; /** * An array of fields in the layer. Each field represents an attribute that may contain a value for each feature in the layer. * For example, a field named `cd_itemtype`, stores information about the type of the catalog item, such as `Feature Service` or `Map Service`. * * @example * // Create popup template for the footprint layer after the catalog layer is loaded * const layerView = await view.whenLayerView(layer); * * layer.footprintLayer.fields.forEach((field) => { * let fieldInfo = { * fieldName: field.name * }; * fieldInfosArray.push(fieldInfo); * }); * * layer.footprintLayer.popupTemplate = new PopupTemplate({ * title: layer.title, * fieldInfos: fieldInfosArray, * content: [ * { * type: "fields" * } * ] * }); */ get fields(): Field[]; /** * The footprint layer is a layer that displays footprints of items referenced in a CatalogLayer. In the CatalogLayer, each service or item has a footprint, which is a visual * representation covering all features, rasters, etc., within it. The attributes of each footprint feature provide details about the item's name, type, source, min and max scales. * * @example * layer.footprintLayer.fields.forEach((field) => { * let fieldInfo = { * fieldName: field.name * }; * fieldInfosArray.push(fieldInfo); * }); * * // Create popup template for the footprint layer and add a button in the popup template * // When button is clicked, create a new layer for the catalog item associated with the clicked * // footprint feature and add it to the map * layer.footprintLayer.popupTemplate = new PopupTemplate({ * title: layer.title, * fieldInfos: fieldInfosArray, * content: [ * { * type: "fields" * } * ], * actions: [ * { * type: "button", * id: "add-layer", * icon: "add-layer", * title: "Add layer" * } * ] * }); * * // Create a new layer for the catalog item associated from the clicked the footprint * // feature and add it to the map when the button is clicked * reactiveUtils.on(() => view.popup, "trigger-action", async (event) => { * if (event.action.id === "add-layer") { * const sublayer = await layer.createLayerFromFootprint(view.popup.selectedFeature); * map.layers.push(sublayer); * } * }); */ get footprintLayer(): CatalogFootprintLayer; /** * The geometry type of features in the layer. * * @see [Add an array of client-side features](https://developers.arcgis.com/javascript/latest/references/core/layers/mixins/FeatureLayerBase/#client-side) */ get geometryType(): "polygon"; /** The item name field stores the name of the catalog item referenced in the CatalogLayer. */ get itemNameField(): "cd_itemname"; /** The item source field stores the original source path of the catalog item. */ get itemSourceField(): "cd_itemsource"; /** The item type field stores the type of the catalog item, such as `Feature Service` or `Map Service`. */ get itemTypeField(): "cd_itemtype"; /** A collection of [CatalogFootprintLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/catalog/CatalogFootprintLayer/) and [CatalogDynamicGroupLayers](https://developers.arcgis.com/javascript/latest/references/core/layers/catalog/CatalogDynamicGroupLayer/). */ get layers(): Collection; /** * Indicates whether the layer will be included in the legend. When `false`, the layer will be excluded from the legend. * * @default true */ accessor legendEnabled: boolean; /** * The max scale field holds the maximum scale at which the catalog item is visible in the view. If the map is zoomed in beyond this scale, * the item will not be visible. A value of 0 or `null` means the catalog item does not have a maximum scale. The maxScale value should always be smaller * than the minScale value, and greater than or equal to the service specification. */ get maxScaleField(): "cd_maxscale"; /** * The min scale field holds the minimum scale at which the catalog item is visible in the view. If the map is zoomed in beyond this scale, * the item will not be visible. A value of 0 or `null` means the catalog item does not have a minimum scale. The minScale value should always * be larger than the maxScale value, and lesser than or equal to the service specification. */ get minScaleField(): "cd_minscale"; /** * An array of field names from the service to include with each feature. To fetch the values from all fields in the layer, use `["*"]`. * Fields specified in `outFields` will be requested alongside with required fields for [rendering](https://developers.arcgis.com/javascript/latest/references/core/layers/catalog/CatalogFootprintLayer/#renderer), * [labeling](https://developers.arcgis.com/javascript/latest/references/core/layers/catalog/CatalogFootprintLayer/#labelingInfo) and setting the [elevation info](https://developers.arcgis.com/javascript/latest/references/core/layers/catalog/CatalogFootprintLayer/#elevationInfo) for the layer. * * @see [fieldUtils](https://developers.arcgis.com/javascript/latest/references/core/layers/support/fieldUtils/) * @example * // Includes all fields from the service in the layer * catalogLayer.outFields = ["*"]; * @example * // Get the specified fields from the service in the layer. These fields will be added to * // catalogFootprintLayerView.availableFields along with rendering and labeling fields. * // Use these fields for client-side filtering and querying. * catalogLayer.outFields = ["NAME", "POP_2010", "FIPS", "AREA"]; * @example * // set the outFields for the layer coming from webmap * webmap.when(function () { * const catalogLayer = webmap.layers.at(1); * catalogLayer.outFields = ["*"]; * }); */ accessor outFields: string[] | null | undefined; /** The layer type provides a convenient way to check the type of the layer without the need to import specific layer modules. */ get type(): "catalog"; /** * The absolute URL of the REST endpoint of a catalog service. * * @example * // Create a catalog layer from a service * const layer = new CatalogLayer({ * url: "https://services3.arcgis.com/TVDq0jswpjtt1Xia/arcgis/rest/services/PNW_Forest_Fuels_Inventory_Status/FeatureServer" * }); * @example * // Hosted Feature Service on ArcGIS Online * layer.url = "http://services.arcgis.com/V6ZHFr6zdgNZuVG0/arcgis/rest/services/origins/FeatureServer/0"; * @example * // Layer from Map Service on ArcGIS Server * layer.url = "http://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer/2"; * @example * // Can also be used if URL points to service and not layer * const layer = new FeatureLayer({ * // Notice that the url doesn't end with /2 * url: "http://services.arcgis.com/V6ZHFr6zdgNZuVG0/arcgis/rest/services/MonterreyBayCanyon_WFL/FeatureServer", * layerId: 2 * }); * @example * // Non-spatial table in San Francisco incidents service. * const table = new FeatureLayer({ * url: "https://sampleserver6.arcgisonline.com/arcgis/rest/services/SF311/FeatureServer/1" * }); * // table must be loaded so it can be used in the app. * table.load().then(function() { * // table is loaded. ready to be queried. * }); */ accessor url: string | null | undefined; /** * Returns a footprint [Graphic](https://developers.arcgis.com/javascript/latest/references/core/Graphic/) that represents a layer in the [dynamicGroupLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/CatalogLayer/#dynamicGroupLayer). * The layer can be created by calling [createLayerFromFootprint()](https://developers.arcgis.com/javascript/latest/references/core/layers/CatalogLayer/#createLayerFromFootprint), * or found in the [CatalogDynamicGroupLayer.layers](https://developers.arcgis.com/javascript/latest/references/core/layers/catalog/CatalogDynamicGroupLayer/#layers) collection. * * @param layer - A layer in a [dynamicGroupLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/CatalogLayer/#dynamicGroupLayer) for which to obtain its footprint from. * @returns The graphic representing the layer's footprint. */ createFootprintFromLayer(layer: Layer): Graphic | null | undefined; /** * Creates a new instance of a layer for the given layer in the [dynamicGroupLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/CatalogLayer/#dynamicGroupLayer) based on its footprint feature. * The instance of the footprint feature associated with the layer can be obtained by calling the [createFootprintFromLayer()](https://developers.arcgis.com/javascript/latest/references/core/layers/CatalogLayer/#createFootprintFromLayer) method. * * @param footprint - The footprint feature used to instantiate a layer within its bounds. * @returns When resolved, a [Layer](https://developers.arcgis.com/javascript/latest/references/core/layers/Layer/) instance is returned. * @example * // This example demonstrates how to create a new layer for the catalog item from its footprint feature. * // Create popup template for a footprint layer, add a button to create a new layer from the footprint feature * layer.footprintLayer.popupTemplate = new PopupTemplate({ * title: "{cd_itemname}", * fieldInfos: fieldInfosArray, * actions: [ * { * type: "button", * id: "add-layer", * icon: "add-layer", * title: "Add layer" * } * ] * }); * * // Create a new layer for a catalog item from the given footprint feature * reactiveUtils.on(() => view.popup, "trigger-action", async (event) => { * if (event.action.id === "add-layer") { * const sublayer = await layer.createLayerFromFootprint(view.popup.selectedFeature); * map.layers.push(sublayer); * } * }); */ createLayerFromFootprint(footprint: Graphic): Promise; /** * Creates query parameter object that can be used to fetch features from feature-based layers or * image footprints from ImageryLayer that satisfy the layer's configurations such as [definitionExpression](https://developers.arcgis.com/javascript/latest/references/core/layers/CatalogLayer/#definitionExpression). * It will return `Z` and `M` values based on the layer's [data capabilities](https://developers.arcgis.com/javascript/latest/references/core/layers/CatalogLayer/#capabilities). * It sets the query parameter's [Query.outFields](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#outFields) property to `["*"]`. * The results will include feature geometries and values for all [available fields](https://developers.arcgis.com/javascript/latest/references/core/views/layers/FeatureLayerView/#availableFields) in * [queries](https://developers.arcgis.com/javascript/latest/references/core/views/layers/FeatureLayerView/#queryFeatures) against the layer views of feature-based layers, or all fields in the layer for * [queries against the layer](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#queryFeatures). * * @returns The query object representing the layer's definition expression and other configurations. * @see [Sample - Query features from a FeatureLayer](https://developers.arcgis.com/javascript/latest/sample-code/featurelayer-query/) * @example * ```js * // Get a query object for the layer's current configuration * queryParams.outFields will be set to ["*"] to get values for all available fields. * const queryParams = layer.createQuery(); * // set a geometry for filtering features by a region of interest * queryParams.geometry = extentForRegionOfInterest; * // Add to the layer's current definitionExpression * queryParams.where = queryParams.where + " AND TYPE = 'Extreme'"; * * // query the layer with the modified params object * layer.queryFeatures(queryParams).then(function(results){ * // prints the array of result graphics to the console * console.log(results.features); * }); * ``` * @example * ```js * // this snippet shows the query parameter object that is returned * // from FeatureLayer.createQuery(). * const queryParams = new Query(); * const dataCapabilities = layer.get("capabilities.data"); * * queryParams.gdbVersion = layer.gdbVersion; * queryParams.historicMoment = layer.historicMoment; * queryParams.returnGeometry = true; * * if (dataCapabilities) { * if (dataCapabilities.supportsZ && layer.returnZ != null) { * queryParams.returnZ = layer.returnZ; * } * * if (dataCapabilities.supportsM && layer.returnM != null) { * queryParams.returnM = layer.returnM; * } * } * * queryParams.outFields = ["*"]; * queryParams.where = layer.definitionExpression || "1=1"; * queryParams.multipatchOption = layer.geometryType === "multipatch" ? "xyFootprint" : null; * ``` * @example * ```js * // this snippet shows query image footprints from imagery layer * // that honors the layer's definitionExpression and other configurations. * if (imageryLayer.capabilities.operations.supportsQuery) { * const query = imageryLayer.createQuery(); * const rasters = await imageryLayer.queryRasters(query); * ``` */ createQuery(): Query; /** * Executes a [AttributeBinsQuery](https://developers.arcgis.com/javascript/latest/references/core/rest/support/AttributeBinsQuery/) against a [CatalogLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/CatalogLayer/), which groups features into bins based on ranges in numeric or date fields, and returns a * [AttributeBinsFeatureSet](https://developers.arcgis.com/javascript/latest/references/core/rest/support/AttributeBinsFeatureSet/) containing the series of bins. Please refer to the [AttributeBinsQuery](https://developers.arcgis.com/javascript/latest/references/core/rest/support/AttributeBinsQuery/) document for more detailed information * on how to configure the bin parameters. * * Binned data can condense complex information into meaningful insight. This query allows you to classify data into meaningful categories and summarize the data * within each bin with summary statistics. * * > [!WARNING] * > * > **Notes** * > * > The `queryAttributeBins()` method is unrelated to querying bins in [FeatureReductionBinning](https://developers.arcgis.com/javascript/latest/references/core/layers/support/FeatureReductionBinning/). * * @param binsQuery - Specifies the parameters of the `queryAttributeBins()` operation. The [AttributeBinsQuery.binParameters](https://developers.arcgis.com/javascript/latest/references/core/rest/support/AttributeBinsQuery/#binParameters) property must be set. * @param options - Abort options that can be passed into an asynchronous method to allow termination. * @returns When resolved, returns a [AttributeBinsFeatureSet](https://developers.arcgis.com/javascript/latest/references/core/rest/support/AttributeBinsFeatureSet/) containing a series of bins. Each feature in the AttributeBinsFeatureSet * represents a bin. The attributes of each feature contain statistics summarizing the data in the bin, including count, average, standard deviation, etc. * @since 4.33 * @see [AttributeBinsQuery](https://developers.arcgis.com/javascript/latest/references/core/rest/support/AttributeBinsQuery/) * @see [Sample - Attribute Bins Query](https://developers.arcgis.com/javascript/latest/sample-code/query-attribute-bins/) */ queryAttributeBins(binsQuery: AttributeBinsQueryProperties, options?: RequestOptions): Promise; /** * Executes a [Query](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/) against the feature service and returns the [Extent](https://developers.arcgis.com/javascript/latest/references/core/geometry/Extent/) of features that satisfy the query. If no * parameters are specified, then the extent and count of all features satisfying the layer's configuration/filters are returned. * * * @param query - Specifies the attributes and spatial filter of the query. If no parameters are specified, then the extent and count of all features satisfying the layer's configuration/filters are returned. * @param options - Additional request options. See [RequestOptions](https://developers.arcgis.com/javascript/latest/references/core/request/types/#RequestOptions). * @returns When resolved, returns the extent and count of the features * that satisfy the input query. See the object specification table below for details. * Property | Type | Description * ---------|------|------------- * count | Number | The number of features that satisfy the input query. * extent | [Extent](https://developers.arcgis.com/javascript/latest/references/core/geometry/Extent/) | The extent of the features that satisfy the query. * @see [Sample - Zoom to extent of all features](https://developers.arcgis.com/javascript/latest/sample-code/featurelayer-queryextent/) * @example * ```js * // Queries for the extent of all features matching the layer's configurations * // e.g. definitionExpression * layer.queryExtent().then((result) =>{ * // go to the extent of the result satisfying the query * viewElement.goTo(result.extent); * }); * ``` * @example * ```js * const query = new Query(); * query.where = "region = 'Southern California'"; * * const result = await layer.queryExtent(query); * viewElement.goTo(result.extent); // go to the extent of the result satisfying the query * }); * ``` */ queryExtent(query?: QueryProperties | null | undefined, options?: RequestOptions): Promise<{ count: number; extent: Extent | null; }>; /** * Executes a [Query](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/) against the feature service or layer data and * returns the number of features that satisfy the query. If no parameters are specified, * the total number of features satisfying the layer's configuration/filters is returned. * * * @param query - Specifies the attributes and spatial filter of the query. If no parameters are specified, the total number of features satisfying the layer's configuration/filters is returned. * @param options - Additional request options. See [RequestOptions](https://developers.arcgis.com/javascript/latest/references/core/request/types/#RequestOptions). * @returns When resolved, returns the number of features that satisfy the query. * @see [Sample - Query features from a FeatureLayer](https://developers.arcgis.com/javascript/latest/sample-code/featurelayer-query/) * @example * ```js * // Queries for the count of all features matching the layer's configurations * // e.g. definitionExpression * layer.queryFeatureCount().then((numFeatures) => { * // prints the total count to the console * console.log(numFeatures); * }); * ``` * @example * ```js * const query = new Query(); * query.where = "region = 'Southern California'"; * * const featureCount = await layer.queryFeatureCount(query); * console.log(featureCount); // prints the number of results satisfying the query * ``` */ queryFeatureCount(query?: QueryProperties | null | undefined, options?: RequestOptions): Promise; /** * Executes a [Query](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/) against a feature service or layer data and returns a * [FeatureSet](https://developers.arcgis.com/javascript/latest/references/core/rest/support/FeatureSet/) once the promise resolves. A FeatureSet contains an array of [features](https://developers.arcgis.com/javascript/latest/references/core/Graphic/). * * > [!WARNING] * > * > **Notes** * > - When querying a feature service with z-values and no [vertical coordinate system](https://doc.esri.com/en/arcgis-pro/latest/help/mapping/properties/vertical-coordinate-systems.html) * > information, z-values are automatically converted to match [Query.outSpatialReference](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#outSpatialReference) units. * > Example: The service has a horizontal spatial reference using `feet` units and the query is made with `outSpatialReference` * > based on `meter` units, then [FeatureLayer.queryFeatures()](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#queryFeatures) automatically converts the values from `feet` to `meter` units. * * * @param query - Specifies the attributes and spatial filter of the query. If no parameters are specified, all features satisfying the layer's configuration/filters are returned. * @param options - Additional request options. See [RequestOptions](https://developers.arcgis.com/javascript/latest/references/core/request/types/#RequestOptions). * @returns When resolved, returns a [FeatureSet](https://developers.arcgis.com/javascript/latest/references/core/rest/support/FeatureSet/) containing an array of graphic features. * @see [Samples using queryFeatures() method](https://developers.arcgis.com/javascript/latest/sample-code/?tagged=queryfeatures) * @see [Query and filter guide](https://developers.arcgis.com/javascript/latest/query-filter/) * @example * ```js * // Queries for all the features matching the layer's configurations * // e.g. definitionExpression * const results = await layer.queryFeatures(); * // prints the array of result graphics to the console * console.log(results.features); * ``` * @example * ```js * // create a query object to filter features by setting desired properties * const query = new Query(); * query.where = "STATE_NAME = 'Washington'"; * query.outSpatialReference = { wkid: 102100 }; * query.returnGeometry = true; * query.outFields = [ "CITY_NAME" ]; * * const results = await layer.queryFeatures(query); * console.log(results.features); // prints the array of features to the console * ``` * @example * ```js * // Get a query object for the layer's current configuration * const queryParams = layer.createQuery(); * // set a geometry for filtering features by a region of interest * queryParams.geometry = extentForRegionOfInterest; * // Add to the layer's current definitionExpression * queryParams.where = queryParams.where + " AND TYPE = 'Extreme'"; * * // query the layer with the modified params object * const results = await layer.queryFeatures(queryParams); * // prints the array of result graphics to the console * console.log(results.features); * ``` * @example * ```js * // query all features from the layer and only return * // attributes specified in outFields. * const query = { // autocasts as Query * where: "1=1", // select all features * returnGeometry: false, * outFields: ["State_Name", "City_Name", "pop2010"] * }; * * const results = await layer.queryFeatures(query); * console.log(results.features); // prints the array of features to the console * ``` */ queryFeatures(query?: QueryProperties | null | undefined, options?: RequestOptions): Promise; /** * Executes a [Query](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/) against the feature service and returns an * array of Object IDs for features that satisfy the input query. If no parameters are specified, * then the Object IDs of all features satisfying the layer's configuration/filters are returned. * * * @param query - Specifies the attributes and spatial filter of the query. If no parameters are specified, then the Object IDs of all features satisfying the layer's configuration/filters are returned. * @param options - Additional request options. See [RequestOptions](https://developers.arcgis.com/javascript/latest/references/core/request/types/#RequestOptions). * @returns When resolved, returns an array of numbers representing the object IDs of the features satisfying the query. * @see [Sample - Query Related Features](https://developers.arcgis.com/javascript/latest/sample-code/query-related-features/) * @example * ```js * // Queries for all the Object IDs of features matching the layer's configurations * // e.g. definitionExpression * layer.queryObjectIds().then((results) => { * // prints the array of Object IDs to the console * console.log(results); * }); * ``` * @example * ```js * const query = new Query({ * where: "SUB_REGION = 'Pacific'" * }); * * const ids = await layer.queryObjectIds(query); * console.log(ids); // an array of object IDs * ``` */ queryObjectIds(query?: QueryProperties | null | undefined, options?: RequestOptions): Promise; } declare const CatalogLayerSuperclass: typeof Layer & typeof APIKeyMixin & typeof CustomParametersMixin & typeof MultiOriginJSONSupportMixin & typeof PortalLayer & typeof OperationalLayer & typeof RefreshableLayer & typeof ScaleRangeLayer & typeof TemporalLayer & typeof OrderedLayer & typeof BlendLayer & typeof EditBusLayer & typeof FeatureLayerBase & typeof DisplayFilteredLayer