API Object Reference
Features
There are a number of different ways that map features can be represented in the VertiGIS Web and Mobile APIs. While you should usually use FeatureProperties JSON when creating inputs for commands and operations, you may see other feature representations in the outputs of operations, in event payloads, or in the supplied context.
Feature
The base class that represents GIS features in the Vertigis Web and Mobile APIs, this object is analogous to and often directly represents an ESRI Graphic that has been added to the map or loaded in a table.
-
A new feature may be instantiated with a
FeaturePropertiesJSON object:new Feature(arg: FeatureProperties) -
You can retrieve this JSON object from a feature by calling
toJSON()on the feature. -
After creation, most of these properties are read only. You may alter a feature's
geometryproperty, but only if the new geometry type matches the old. The current feature geometry type is available on thegeometryTypeproperty. -
A non-spatial feature from a table will not have a geometry.
-
You can create a new ESRI
Graphicby calling thetoGraphic()method on anyFeature.
FeatureSet
A collection of Features that shares a common Schema, typically because they have all come from the same FeatureSource, eg: a single layer in the map.
-
You may create a new FeatureSet with a
FeatureSetPropertiesJSON object. CallingtoJSON()will return this object. -
You can add a
Featureor collection ofFeaturesto aFeatureSet. They must follow the sameSchema:add(feature: Feature)
addMany(features: Iterable<Feature>) -
You can delete a single
Featureor a collection ofFeatures. You can also clear the entireFeatureSet:delete(feature: Feature)
deleteMany(features: Iterable<Feature>)
clear() -
You can query for the existence of a feature, or find a feature by its Object ID:
has(feature: Feature)
findByPrimaryKey(primaryKey: string) -
You can iterate through every feature in the FeatureSet:
forEach(feature => { ... })
FeatureList
A read-only view of a FeatureSet that can be filtered and sorted. The FeatureList will always update as the underlying FeatureSet changes.
-
You may create a new
FeatureListdirectly from aFeatureSetor from aFeatureListPropertiesJSON object:new FeatureList(args: FeatureSet | FeatureListProperties) -
Calling
toJSON()will return theFeatureListProperties. -
You can pass in the name of a field in the backing
FeatureSetto sort alphabetically or numerically on that field:sort(criteria: string) -
You can pass in a string to to filter the
FeatureListby. Each searchable field will then be queried for the existence of the string. This operation does not alter the underlyingFeatureSet:filter(criteria: string)
FeatureStream
A read-only stream of Features that must be read asynchronously.
-
You may create a
FeatureStreamwith aFeatureStreamPropertiesJSON object, or with any collection of Features:new FeatureStream(args: Iterable<Feature> | AsyncIterable<Feature> | FeatureStreamProperties) -
Calling
toJSON()will return theFeatureStreamProperties. -
You can read the features asynchronously into an array or into a
FeatureSet:toArray(): Promise<Feature[]>
toFeatureSet(): Promise<FeatureSet>
Extensions
API objects ending in *Extension wrap and extend objects that exist in ESRI's API. Each extension makes the ESRI object available on a named property, and has an itemType property that contains the type of the Extension.
Here is a table listing common *Extensions along with their corresponding ESRI JSAPI item, the property where this ESRI object is made available on the *Extension, and their itemType.
| *Extension | ESRI JSAPI Object | Object Property | Item Type |
|---|---|---|---|
BasemapExtension | Basemap | basemap | basemap-extension |
FieldExtension | Field | field | field-extension |
LayerExtension | Layer | layer | layer-extension |
MapExtension | Map | map | map-extension |
PopupContentExtension | Content | content | popup-content-extension |
SublayerExtension | Sublayer | sublayer | sublayer-extension |
TableExtension | FeatureLayer* | table | table-extension |
*non-spatial variant
LayerExtensions
There are a number of *Extensions that inherit from LayerExtension and wrap different ESRI layer types. They share an itemType of layer-extension but the type of the object attached to the layer property varies by extension. Unless otherwise specified, these are all valid wherever a LayerExtension is called for:
| LayerExtension | ESRI JSAPI Object |
|---|---|
CSVLayerExtension | CSVLayer |
FeatureLayerExtension | FeatureLayer |
GeoJSONLayerExtension | GeoJSONLayer |
GeoRSSLayerExtension | GeoRSSLayer |
GraphicsLayerExtension | GraphicsLayer |
GroupLayerExtension | GroupLayer |
ImageryLayerExtension | ImageryLayer |
ImageryTileLayerExtension | ImageryTileLayer |
KMLLayerExtension | KMLLayer |
MapImageLayerExtension | MapImageLayer |
StreamLayerExtension | StreamLayer |
SubtypeGroupLayerExtension | SubtypeGroupLayer |
TileLayerExtension | TileLayer |
VectorTileLayerExtension | VectorTileLayer |
WFSLayerExtension | WFSLayer |
WMSLayerExtension | WMSLayer |
WMTSLayerExtension | WMTSLayer |
There should be a corresponding *Extension for every valid ESRI layer type, this list is not comprehensive.
FeatureSource
A FeatureSource is any source of features. Typically this is a FeatureLayerExtension backed by a FeatureLayer, but this isn't required. A FeatureSource has a Schema defining the type of features it holds.