A layer class which implements an ESRI Map Image Sublayer.

Hierarchy (view full)

Constructors

Properties

Accessors

Methods

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
attribs: AttribSource
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 | Layer

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.

filter: Filter
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

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
renderer: undefined | BaseRenderer
serviceUrl: string
sourceSR: undefined | SpatialReference

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

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

Tracks load and draw elapsed time

tooltipField: string
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 sublayer and the parent's Esri map layer exist.

    Returns boolean

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

    Returns number

    the mouse tolerance of the parent layer

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

    Parameters

    • tolerance: number

      the new mouse tolerance

    Returns void

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

    Returns number

    opacity of the sublayer

    getOpacity

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

    Parameters

    • value: number

      the new opacity setting

    Returns void

    setOpacity

  • 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 sublayer's parent layer

    Returns number

    the touch tolerance of the parent layer

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

    Parameters

    • tolerance: number

      the new touch tolerance of the parent layer

    Returns void

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

    Returns boolean

    visibility of the sublayer

    getVisibility

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

    Parameters

    • value: boolean

      the new visibility setting

    Returns void

    setVisibility

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

  • Processes any layer order configuration and modifies the passed ESRI layer config with ESRI-friendly definitions

    Parameters

    • rampConfig: RampLayerConfig

      {RampLayerConfig} Ramp layer configuration object.

    • esriConfig: FeatureLayerProperties

    Returns void

  • Returns a SQL WHERE condition that is combination of active filters.

    Parameters

    • Optionalexclusions: string[]

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

    Returns string

    all non-excluded sql statements connected with AND operators.

    getCombinedSqlFilter

  • 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

  • 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

  • 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

  • Requests a set of features for this layer that match the criteria of the options

    • filterGeometry : a RAMP API geometry to restrict results to
    • filterSql : a where clause to apply against feature attributes
    • includeGeometry : a boolean to indicate if result features should include the geometry
    • outFields : a string of comma separated field names. will restrict fields included in the output
    • sourceSR : a spatial reference indicating what the source layer is encoded in. providing can assist in result geometry being of a proper resolution

    Parameters

    Returns Promise<Graphic[]>

    resolves with an array of features that satisfy the criteria

  • Requests a set of features for this layer that match the criteria of the options

    • filterGeometry : a RAMP API geometry to restrict results to
    • filterSql : a where clause to apply against feature attributes
    • includeGeometry : a boolean to indicate if result features should include the geometry
    • sourceSR : a spatial reference indicating what the source layer is encoded in. providing can assist in result geometry being of a proper resolution

    Each result item is loaded independently. This will capitalize on caching, but will be expensive when expecting a large result set and nothing currently cached.

    Parameters

    Returns Promise<DiscreteGraphicResult[]>

    resolves in an array of object ids and promises resolving in each feature

  • Will return an array of object ids for features in the layer that satisfy the conditions of the query options parameter.

    Parameters

    Returns Promise<number[]>

    resolves with an array of numbers (object ids)

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

  • A utility method to allow a parent layer to request this layer to update its internal attribute loader after field data has been properly processed. Generally should only be called internally.

    Returns void

  • A utility method to allow a parent layer to request this layer to update its fields to be trimmed after field data is processed. Generally should only be called internally.

    Returns 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