Skip to main content

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 FeatureProperties JSON 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 geometry property, but only if the new geometry type matches the old. The current feature geometry type is available on the geometryType property.

  • A non-spatial feature from a table will not have a geometry.

  • You can create a new ESRI Graphic by calling the toGraphic() method on any Feature.

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 FeatureSetProperties JSON object. Calling toJSON() will return this object.

  • You can add a Feature or collection of Features to a FeatureSet. They must follow the same Schema:

    add(feature: Feature)
    addMany(features: Iterable<Feature>)
  • You can delete a single Feature or a collection of Features. You can also clear the entire FeatureSet:

    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 FeatureList directly from a FeatureSet or from a FeatureListProperties JSON object:

    new FeatureList(args: FeatureSet | FeatureListProperties)
  • Calling toJSON() will return the FeatureListProperties.

  • You can pass in the name of a field in the backing FeatureSet to sort alphabetically or numerically on that field:

    sort(criteria: string)
  • You can pass in a string to to filter the FeatureList by. Each searchable field will then be queried for the existence of the string. This operation does not alter the underlying FeatureSet:

    filter(criteria: string)

FeatureStream

A read-only stream of Features that must be read asynchronously.

  • You may create a FeatureStream with a FeatureStreamProperties JSON object, or with any collection of Features:

    new FeatureStream(args: Iterable<Feature> | AsyncIterable<Feature> | FeatureStreamProperties)
  • Calling toJSON() will return the FeatureStreamProperties.

  • 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.

*ExtensionESRI JSAPI ObjectObject PropertyItem Type
BasemapExtensionBasemapbasemapbasemap-extension
FieldExtensionFieldfieldfield-extension
LayerExtensionLayerlayerlayer-extension
MapExtensionMapmapmap-extension
PopupContentExtensionContentcontentpopup-content-extension
SublayerExtensionSublayersublayersublayer-extension
TableExtensionFeatureLayer*tabletable-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:

LayerExtensionESRI JSAPI Object
CSVLayerExtensionCSVLayer
FeatureLayerExtensionFeatureLayer
GeoJSONLayerExtensionGeoJSONLayer
GeoRSSLayerExtensionGeoRSSLayer
GraphicsLayerExtensionGraphicsLayer
GroupLayerExtensionGroupLayer
ImageryLayerExtensionImageryLayer
ImageryTileLayerExtensionImageryTileLayer
KMLLayerExtensionKMLLayer
MapImageLayerExtensionMapImageLayer
StreamLayerExtensionStreamLayer
SubtypeGroupLayerExtensionSubtypeGroupLayer
TileLayerExtensionTileLayer
VectorTileLayerExtensionVectorTileLayer
WFSLayerExtensionWFSLayer
WMSLayerExtensionWMSLayer
WMTSLayerExtensionWMTSLayer

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.