A layer class which implements an ESRI WMS Layer.

Hierarchy (view full)

Constructors

Properties

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

APIScope

_drawOrder: DrawOrder[]
_lastFilterUpdate: string = ''
_mouseTolerance: number
_parentLayer: undefined | LayerInstance
_scaleSet: ScaleSet
_serverVisibility: undefined | boolean
_sublayers: LayerInstance[]
_touchTolerance: number
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: undefined | WMSLayer

The internal ESRI API layer

esriSubLayer: undefined | Sublayer

The internal ESRI API sublayer. Valid only by sublayers

esriView: undefined | LayerView

The internal ESRI API layer view

esriWatches: WatchHandle[]
expectedTime: LayerTimes

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

extent: undefined | Extent

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. Non-feature layers will return empty string;

fields: FieldDefinition[]

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

geomType: GeometryType

The geometry type of the layer.

hovertips: boolean

If the layer should show hovertips on the map

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

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.

layerTree: TreeNode
layerType: LayerType

Type of layer this is (describes the overall layer)

legend: LegendSymbology[]

Legend symbols of the layer

loadDefProm: DefPromise<void>
loadPromDone: boolean

A boolean to track whether the promise is pending (false) or fulfilled/rejected (true)

mapLayer: boolean

If the layer type can exist on the map

mimeType: string
name: string

The name of the layer.

nameField: string

Field name that contains value considered the name of a feature. Not applicable for non-feature layers.

oidField: string

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

origRampConfig: RampLayerConfig
sourceSR: undefined | SpatialReference

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

sublayerNames: string[]
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

timers: {
    draw: undefined | number;
    load: undefined | number;
}

Tracks load and draw elapsed time

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

viewDefProm: DefPromise<void>

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 layerExists(): boolean
  • Indicates if the Esri map layer exists

    Returns boolean

  • get mouseTolerance(): number
  • Get the mouse tolerance in pixels for this layer

    Returns number

    the mouse tolerance of this layer

  • set mouseTolerance(tolerance): void
  • Set the mouse tolerance for this layer in pixels

    Parameters

    • tolerance: number

      the new mouse tolerance

    Returns void

  • get opacity(): number
  • Returns the opacity of the layer.

    Returns number

    opacity of the layer (range between 0 and 1)

  • set opacity(value): void
  • Applies opacity to layer.

    Parameters

    • value: number

      the new opacity setting (range between 0 and 1)

    Returns void

  • get scaleSet(): ScaleSet
  • Returns the scale set (min and max visible scale) of the layer.

    Returns ScaleSet

    scale set of the layer

  • set scaleSet(scaleSet): void
  • Set the scale set (min and max visible scale) of the layer.

    Parameters

    • scaleSet: ScaleSet

      the new scale set of the layer

    Returns void

  • get touchTolerance(): number
  • Get the touch tolerance in pixels for this layer

    Returns number

    the touch tolerance of this layer

  • set touchTolerance(tolerance): void
  • Set the touch tolerance in pixels for this layer

    Parameters

    • tolerance: number

      the new touch tolerance

    Returns void

  • get visibility(): boolean
  • Returns the visibility of the layer.

    Returns boolean

    visibility of the layer

  • set visibility(value): void
  • Applies visibility to layer.

    Parameters

    • value: boolean

      the new visibility setting

    Returns void

Methods

  • Applies the current filter settings to the physical map layer.

    Parameters

    • exclusions: string[] = []

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

    Returns void

    applySqlFilter

  • 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

  • Handles click events for WMS layers (makes a WMS GetFeatureInfo call behind the scenes).

    Parameters

    • layerList: string[]

      a list of strings identifying the WMS sublayers to be queried

    • point: Point

      a RAMP Point indicating where the user clicked

    • mimeType: string

      the format to be requested for the response

    Returns Promise<any>

    a promise which resolves with the GetFeatureInfo response

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

    Parameters

    • exclusions: string[] = []

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

    • extent: undefined | Extent = undefined

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

    Returns Promise<undefined | number[]>

    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:

    • 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 include symbol styling information

    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 where the provided object id is on the map. Can only be used on feature layers with multipoint, polyline, polygon geometry.

    Parameters

    • objectId: number

      the object id to query

    Returns Promise<Extent>

    resolves with the extent where the object id is present

  • 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

  • Finds the appropriate legend URLs for WMS layers.

    Parameters

    • layerList: any[]

      a list of objects identifying the WMS layers to be queried

    Returns string[]

    a list of strings containing URLs for specified layers (order is preserved)

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

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

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

    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

    isOffscale

  • 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

  • Download or refresh the internal symbology for the sublayer.

    Returns void

    loadSymbology

  • Take a layer config from the RAMP application and derives a configuration for an ESRI layer

    Parameters

    Returns WMSLayerProperties

    configuration object for the ESRI layer representing this layer

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

    Parameters

    • genuineError: 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>

  • Add a WMS layer parameter, maybe even refresh the layer

    Parameters

    • key: string

      name of the key to be created or updated

    • value: string

      value of the key

    • forceRefresh: boolean = true

      show the new fancy version of the layer or not

    Returns void

    setCustomParameter

  • 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

  • Start the draw/load timer for the layer, after which is a slow to load/draw notification is shown.

    Parameters

    • type: TimerType

      the type of timer to start (load or draw)

    Returns 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

    • userCancel: boolean = false

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

    Returns void