RAMP4 - v4.21.0
    Preparing search index...

    A base class for Layer subclasses. It provides some utility functions to Layer and also gives access to $iApi and $vApp globals. Mostly it exposes stub methods; this is because layer subclasses can be wildly different, so we don't have a pile of common things to put here. The stubs will help debugging as they will alert devs when they have not implemented something. The stubs also allow us to get intellisense / typescript happiness when dealing with common layer variables typed as LayerInstance.

    LayerInstance

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    _parentLayer: LayerInstance | undefined
    _sublayers: LayerInstance[]

    The instance of RampMap API scoped to a single Vue R4MP application.

    APIScope

    canModifyLayer: boolean

    Indicates if the layer can be modified with filters.

    canReload: boolean

    Indicates if the layer can be reloaded.

    config: any = {}
    dataFormat: DataFormat

    The type of spatial data used to generate layer content

    drawState: DrawState

    State of drawing / refreshing data for a layer

    esriLayer: Layer | undefined

    The internal ESRI API layer

    esriSubLayer: Sublayer | undefined

    The internal ESRI API sublayer. Valid only by sublayers

    esriView: LayerView | undefined

    The internal ESRI API layer view

    expectedTime: LayerTimes

    Object that contains values for the expected draw/response time.

    extent: Extent | undefined

    The extent of the layer on the map

    featureCount: number

    Feature count

    fieldList: string

    Comma delimited string of field names (or '*' for all). Useful for numerous ESRI api calls. Attribute-less layers will return empty string;

    fields: FieldDefinition[]

    Array of field definitions about the given layer's fields. Attribute-less layers will have empty arrays.

    geomType: GeometryType

    The geometry type of the layer.

    id: string

    ID of this layer. Also known as the layerId.

    LayerInstance

    identify: boolean

    If the layer is set to participate in identify requests

    identifyMode: LayerIdentifyMode

    The type of logic used to identify items on the layer

    initiationState: InitiationState

    State of the initiation / termination process of the layer

    isCosmetic: boolean

    If the layer is non-interactive and only displays content on the map

    isFile: boolean

    If the layer was sourced from a file or a WFS source (which disconnects after load).

    isRemoved: boolean

    Tracks if layer is removed from map. Is false during the period "before" the layer gets added to map.

    isSublayer: boolean

    If the layer is a Sublayer

    isSystem: boolean

    If the layer is being managed by a RAMP functionality

    lastCancel: number

    Timecode value for the start of most recent cancel request. Used to avoid races between async things returning after layers cancel or reload.

    layerFormat: LayerFormat

    How the layer is instantiated in the map stack

    layerIdx: number

    Index of the layer. Aligns to index of arcgis server source, or defaults to 0 on other layers. Map Image Layers and layers that do not support attributes have a value of -1

    layerState: LayerState

    State of the actual layer on the map, such as loading, loaded, error'd.

    layerType: LayerType

    Type of layer this is (describes the overall layer)

    legend: LegendSymbology[]

    Legend symbols of the layer

    mapLayer: boolean

    If the layer type can exist on the map

    maptipField: string

    Field name that contains value considered the maptip of a feature. Not applicable for attribute-less layers. Ignored if maptipArcade is set. nameValue is used if neither are set.

    maptips: boolean

    If the layer should show maptips on the map

    name: string

    The name of the layer.

    nameField: string

    Field name that contains value considered the name of a feature. Not applicable for attribute-less layers. Ignored if nameArcade is set.

    oidField: string

    Field name that contains the object ID of a feature. Not applicable for attribute-less layers.

    sourceSR: SpatialReference | undefined

    The spatial reference of the source of geometry (e.g. map server). Undefined for non-ArcServer and non-spatial layers.

    supportsFeatures: boolean

    If the layer type can support Feature type requests and operations

    supportsIdentify: boolean

    If the layer type can support an identify request

    supportsSublayers: boolean

    If the layer has Sublayers

    uid: string

    Unique identifier for this layer. Randomly generated at runtime.

    url: string

    url of the service

    userAdded: boolean

    If the layer was added by user interaction during the session

    Accessors

    • get $element(): App<Element>

      Returns App<Element>

    • get $vApp(): ComponentPublicInstance

      The instance of Vue R4MP application controlled by this InstanceAPI. This is just a shorthand for this.$iApi.$vApp.

      Returns ComponentPublicInstance

      APIScope

    • get isLoaded(): boolean

      Indicates if the layer is in a state that is makes sense to interact with. I.e. False if layer has not done it's initial load, or is in error state. Acts as a handy shortcut to inspecting the layerState.

      Returns boolean

      true if layer is loaded

      isLoaded

    • get maptipArcade(): string

      Arcade formula to derive maptip of the feature. Empty string indicates no formula in use. Not applicable for attribute-less layers.

      Returns string

    • get mouseTolerance(): number

      Get the click tolerance in pixels for this layer

      Returns number

      the mouse tolerance of this layer

    • set mouseTolerance(tolerance: number): void

      Set the mouse tolerance for this layer in pixels

      Parameters

      • tolerance: number

        the new mouse tolerance

      Returns void

    • get nameArcade(): string

      Arcade formula to derive name of feature. Empty string indicates no formula in use. Not applicable for attribute-less layers.

      Returns string

    • get touchTolerance(): number

      Get the touch tolerance in pixels for this layer

      Returns number

      the touch tolerance of this layer

    • set touchTolerance(tolerance: number): void

      Set the touch tolerance in pixels for this layer

      Parameters

      • tolerance: number

        the new touch tolerance

      Returns void

    Methods

    • Requests that an attribute load request be aborted. Useful when encountering a massive dataset or a runaway process.

      Returns void

    • Function

      Applies the current filter settings to the physical map layer.

      applySqlFilter

      Parameters

      • Optionalexclusions: string[] = []

        list of any filters to exclude from the result. omission includes all keys

      Returns void

    • Indicates if the attribute load has been aborted.

      Returns boolean

      boolean if the process has been stopped

    • Cancels an in-progress initialize or load of the layer and places it in an Error state. Has no effect on a layer that is loaded, has been terminated, or never initiazed.

      Returns void

    • Requests that any downloaded attribute sets or cached geometry be removed from memory. The next requests will pull from the server again.

      Returns void

    • The number of attributes currently downloaded (will update as download progresses)

      Returns number

      current download count

    • Invokes the process to get the full set of attribute values for the layer. Repeat calls will re-use the downloaded values unless the values have been explicitly cleared.

      Returns Promise<AttributeSet>

      resolves with set of attribute values

    • Gets array of object ids that currently pass any filters for the layer

      Parameters

      • Optionalexclusions: string[] = []

        list of any filters keys to exclude from the result. omission includes all filters

      • Optionalextent: Extent = undefined

        if provided, the result list will only include features intersecting the extent

      Returns Promise<number[] | undefined>

      resolves with array of object ids that pass the filter. if no filters are active, resolves with undefined.

    • Gets information on a graphic in the most efficient way possible. Options object properties (each defaults to false):

      • getGeom ; a boolean to indicate if the result should include graphic geometry
      • getAttribs ; a boolean to indicate if the result should include graphic attributes
      • getStyle ; a boolean to indicate if the result should graphical styling information
      • forZoom ; a boolean to indicate if the geometry is for zooming. Only used for Point / Multipoint geometries.

      All option properties are optional and default to false

      Parameters

      • objectId: number

        the object id of the graphic to find

      • options: GetGraphicParams

        options object for the request, see above

      Returns Promise<Graphic>

      resolves with a Graphic containing the requested information

    • Gets the extent of the geometry for a given object id. Only valid for feature layers. Not applicable to point geometry.

      Parameters

      • objectId: number

        the object id of the feature in question

      Returns Promise<Extent | undefined>

      resolves with the extent of the desired feature's geometry. Undefined for invalid requests

    • Gets the icon for a specific feature, as an SVG string.

      Parameters

      • objectId: number

        the object id of the feature to find

      Returns Promise<string>

      resolves with an svg string encoding of the icon

    • Provides a tree structure describing the layer and any sublayers, including uid values. Should only be called after loadPromise resolves.

      Returns TreeNode

      the root of the layer tree

      getLayerTree

    • Attempts to find the local (client side) geometry for a given object id. Only valid for feature layers.

      Parameters

      • objectId: number

        the object id of the feature in question

      Returns Promise<BaseGeometry | undefined>

      resolves with the geometry of the desired feature. Undefined if the feature is not local or request is invalid.

    • Returns the value of a named SQL filter for the layer.

      Parameters

      • filterKey: string

        the filter key / named filter to view

      Returns string

      the value of the where clause for the filter. Empty string if not defined.

    • Invokes the process to get the full set of attribute values for the layer, formatted in a tabular format. Additional data properties are also included. Repeat calls will re-use the downloaded values unless the values have been explicitly cleared.

      Returns Promise<TabularAttributeSet>

      resolves with set of tabular attribute values

    • Sets up the internal layer object (ESRI) and initiates the loading process. The promise returned resolves when the object exists (i.e. .esriLayer is populated). This means the layer can be added to the map.

      Returns Promise<void>

    • Function

      Indicates if the layer is not in a visible scale range.

      isOffscale

      Parameters

      • OptionaltestScale: number = undefined

        optional scale to test against. if not provided, current map scale is used.

      Returns boolean

      true if the layer is outside of a visible scale range

    • Provides a promise that resolves when the layer has finished loading. If accessing layer properties that depend on the layer being loaded, wait on this promise before accessing them.

      Returns Promise<void>

      resolves when the layer has finished loading

      loadPromise

    • Given the attributes of a feature of this layer, returns the maptip of that feature. Valid only for layers that support attributes.

      Parameters

      Returns string

      the name

    • Given the attributes of a feature of this layer, returns the name of that feature. Valid only for layers that support attributes.

      Parameters

      Returns string

      the name

    • Initiates actions after layer load error. Should generally only be called internally by the RAMP core.

      Parameters

      • OptionalgenuineError: boolean = true

        Flag to detect error setting due to manual cancellation. Only genuine errors will raise notifications.

      Returns void

    • Attempts to reload the internal layer object (ESRI). Effectively doing a terminate then initiate, and removing/re-adding layer to the map.

      Returns Promise<void>

    • If layer is map bound, and has an esri layer in the esri map, remove it from esri map. Typically should only be called by RAMP internals.

      Returns void

    • Sets a new arcade formula for the maptip value.

      Parameters

      • formula: string

      Returns Promise<void>

      Promise that resolves when the arcade executor has been generated.

    • Sets a new arcade formula for the name value.

      Parameters

      • formula: string

      Returns Promise<void>

      Promise that resolves when the arcade executor has been generated.

    • Applies an SQL filter to the layer. Will overwrite any existing filter for the given key. Use 1=2 for a "hide all" where clause.

      Parameters

      • filterKey: string

        the filter key / named filter to apply the SQL to

      • whereClause: string

        the WHERE clause of the filter

      Returns void

    • DEPRECIATED #2595 Use setMaptipArcade

      Parameters

      • formula: string

      Returns Promise<void>

    • Resets the layer class to the state it was in "pre-initialize". Implementers can decide if they want to retain any state (e.g. UIDs/layerTree would be a good idea). Also an appropriate function to remove any event listeners/triggers. This would be called in situations like a layer getting deleted, or in a layer reload (initialize would be called again afterwards). Note this does not remove any layers from the map stack, that must be done by the caller.

      Returns Promise<void>

    • Updates layer load state and raises events. Should generally only be called internally by the RAMP core.

      Parameters

      • newState: LayerState

        load state the layer is entering

      • OptionaluserCancel: boolean = false

        optional flag to indicate if an error state was intentional due to a user cancel request

      Returns void

    • Provides a promise that resolves when the layer view has been created.

      Returns Promise<void>

      resolves when the layer view is created

      viewPromise

    • Will zoom the map to the geometry for a given object id. Only valid for layers that support features

      Parameters

      • objectId: number

        the object id of the feature in question

      Returns Promise<boolean>

      resolves with a boolean when the zoom finishes. The value indicates if the zoom was successful

    • Cause the map to zoom to this layer's boundary extent

      Returns Promise<void>

      resolves when map has finished zooming

    • Cause the map to zoom to a scale level where the layer is visible.

      Returns Promise<void>

      resolves when map has finished zooming