Options
All
  • Public
  • Public/Protected
  • All
Menu

Represents a layer configured in a MapService. A Geocortex layer should not be confused with an ArcGISDynamicMapServiceLayer or an ArcGISTiledMapServiceLayer. It is more akin to the esri.layers.LayerInfo class. The layer provides additional configuration beyond what is defined in an ArcGIS server map service sub layer. For example, the layer might have reports and datalinks defined. Also, the layer's configuration overrides the default visibility of the layer. In order for sub-layers to appear on the map, they must be explicitly defined in the layer collection of the MapService.

Hierarchy

Index

Constructors

Events

Properties

Methods

Constructors

constructor

  • new Layer(url?: string): Layer

Events

onInitializationFailed

onInitializationFailed: function

Occurs when initialization of this object fails.

Type declaration

    • (error: Error): void
    • Parameters

      • error: Error

      Returns void

onInitialized

onInitialized: function

Occurs when initialization succeeds with a response from the REST endpoint. Depending on the API, this response may actually be an error message served as a correct HTTP response.

Type declaration

    • (sender: any): void
    • Parameters

      • sender: any

      Returns void

Properties

Private _initializing

_initializing: boolean

Private _visible

_visible: boolean

Whether the Layer is currently visible or not.

allowSymbolization

allowSymbolization: boolean

Whether or not this layer should allow the end user to configure custom symbolization

arcadeExpressions

arcadeExpressions: ArcadeExpression[]

An array of arcade expressions associated with this layer

canToggleLabels

canToggleLabels: boolean

Whether or not the layer supports toggling labels.

catalogId

catalogId: string

The catalog id

charts

charts: LayerChart[]

Array of charts associated with this layer

configuredVisible

configuredVisible: boolean

The layer's initial visibility, defined in the site. This will be true if the layer was configured to be visible by default, false otherwise.

dataLinks

dataLinks: DataLink[]

Gets the collection of DataLink objects that belongs to the Layer.

dataProvider

dataProvider: string

The name of the underlying data provider for the layer, e.g. "SqlServer" or "Oracle".

defaultDateFormat

defaultDateFormat: string

The default format string used for formatting date values originating from this layer.

defaultNumberFormat

defaultNumberFormat: string

The default format string used for formatting numeric values originating from this layer.

defaultRenderer

defaultRenderer: string

A default renderer for this layer. Will override the esri default if set.

defaultVisibility

defaultVisibility: boolean

Whether or not the layer is visible by default in the service.

description

description: string

The description to use for the layer in client applications.

displayField

displayField: Field

The field to use as the primary representative of the layer in reports.

displayName

displayName: string

The alias to use for the layer in client applications.

drawIndex

drawIndex: number

The layer's draw index that determines its drawing order (only applies to dynamic map services).

dynamicDefinition

dynamicDefinition: string

The dynamic definition of the Layer.

extensions

extensions: Extension[]

The extensions of the Layer, as defined by an administrator.

featureBorderColor

featureBorderColor: number[]

The border color used when highlighting a feature from this layer.

featureBorderWidth

featureBorderWidth: number

The width of the border for a feature from this layer.

featureDescription

featureDescription: string

The format for a description of a feature from this layer.

featureFillColor

featureFillColor: number[]

The fill color used when highlighting a feature from this layer, represented as an array of RGB values in the range of 0-255.

featureHyperlinks

featureHyperlinks: FeatureHyperlink[]

Array of feature hyperlinks associated with this layer

featureLabel

featureLabel: string

The format for a label of a feature.

featureLongDescription

featureLongDescription: string

The format for a long description of a feature.

featureType

featureType: string

Shape type of the layer. One of:

  • None
  • Point
  • Multipoint
  • Polygon
  • Line

featureZoomFactor

featureZoomFactor: number

Zoom factor to use to expand the extent by when zooming to a feature. For example, if this value is set to 3, then the extent will be expanded by a factor of 3 when zooming to that feature. This property is not applicable to point layers since points do not have an extent to expand.

featureZoomScale

featureZoomScale: number

Scale to which the map should zoom when a standard viewer "zoom to feature" concept is invoked, from a list of results or otherwise. This value should be respected by implementing clients and viewers. If no value has been configured in the Essentials site for this, it will remain null.

fields

fields: Field[]

Array of fields associated with this layer.

fullExtent

fullExtent: Extent

The full extent of the layer.

hasAttachments

hasAttachments: boolean

Whether the Layer has attachments associated with it.

hasDataLinks

hasDataLinks: boolean

Whether the Layer contains a collection of DataLink objects. This information is available even if the Layer has not been initialized.

hasReports

hasReports: boolean

Whether the Layer contains a collection of Report objects. This information is available even if the Layer has not been initialized.

iconUri

iconUri: string

URI to an icon representing this layer in the client application.

id

id: string

The ID of the Layer.

identifiable

identifiable: boolean

Whether or not this layer can be identified in the client application.

identifiableAtAllScales

identifiableAtAllScales: boolean

Whether or not this layer can be identified in the client application at scales it's not visible at.

inActiveTheme

inActiveTheme: boolean

An observable indicating whether this layer is participating in the currently configured layer theme or not

includeInLayerList

includeInLayerList: boolean

Whether or not to include this layer in the a layer list.

includeInLegend

includeInLegend: boolean

Whether or not to include this layer in the legend.

initializationFailure

initializationFailure: Error

The exception that occurred if the object could not be initialized.

isDynamic

isDynamic: boolean

Whether the Layer is dynamic.

isExpanded

isExpanded: boolean

Whether or not the layer will be expanded by default when shown in a layer list. Only applies to group layers.

isInitialized

isInitialized: boolean

Whether or not the object was successfully initialized.

isUserCreated

isUserCreated: boolean

Indicates whether or not a layer was created by a user at runtime

layerHyperlinks

layerHyperlinks: LayerHyperlink[]

An array of hyperlinks associated with this layer.

layerThemeSettings

layerThemeSettings: LayerThemeSetting[]

A collection containing the layer theme settings for this layer.

legendUrl

legendUrl: string

The URL of the image for the layer legend.

mapService

mapService: MapService

The map service that the Layer belongs to.

maxScale

maxScale: number

The layer's maximum scale.

minScale

minScale: number

The layer's minimum scale.

name

name: string

The name of the Layer.

parentLayerId

parentLayerId: string

Gets the ID of the parent Layer.

primaryKeyField

primaryKeyField: Field

Field to use as the layer's primary key.

properties

properties: any

The properties of the Layer, as defined by the administrator on the server.

queries

queries: LayerQuery[]

A list of administrator defined queries that can be used with the Query Builder or Filter Builder

queryable

queryable: boolean

A flag indicating whether the layer is queryable or not.

relationships

relationships: Relationship[]

Array of relationships associated with this layer.

reports

reports: Report[]

The collection of Report objects that belongs to the Layer.

searchable

searchable: boolean

Indicates if the layer is searchable.

showFeatureHyperlinks

showFeatureHyperlinks: string

The display preference for feature hyperlinks. One of:

  • "ShowAll"
  • "DisableBrokenLinks"
  • "HideBrokenLinks"

showLabels

showLabels: boolean

Whether this layer should show its labels.

showMapTips

showMapTips: boolean

Whether the client application is to show map tips for this layer.

site

The {@link geocortex.essentials.Site} that this resource belongs to.

snappable

snappable: boolean

Whether the layer can be snapped.

snappingEnabled

snappingEnabled: boolean

Whether the layer is enabled for snapping by default.

styleName

styleName: string

The style name, for WMS requests.

styles

styles: LayerStyle[]

A list of predefined renderers that can be applied to this layer

subLayerIds

subLayerIds: string[]

Gets the IDs of all Layer objects that are sub-layers (children) of this Layer. The value is only set when the layer is a group layer.

supportsIdentify

supportsIdentify: boolean

Indicates whether or not this layer supports the Identify task/endpoint. This is not the same as identifiable which is affected by user preference.

supportsQuery

supportsQuery: boolean

Indicates whether or not this layer supports the Query task/endpoint. This is not the same as queryable which is affected by user preference.

timeZoneId

timeZoneId: string

The IANA ID of the time zone in which the data in this layer's fields are current.

type

type: number

The type of the layer, such as feature layer, raster layer, group layer, etc. Represented as a numerical value, defined by LayerType.

url

url: string

The URL that this resource was initialized from.

userLayerType

userLayerType: string

The type of user created layer. One of:

  • LayerAddition - the layer was added by browsing/searching for services and layers in a dialog
  • LayerCatalog - the layer was added from a catalog
  • Upload - the layer was added by uploading a file

Only applies to layers created at runtime.

visibleStateForRefresh

visibleStateForRefresh: RefreshVisibility

A flag used when changing map services and preserving user visibility settings.

wfsLayerName

wfsLayerName: string

The name of the WFS layer. This is the actual layer name from the capabilities, unlike the name property of this Layer which is actually the title in the capabilities.

wmsLayerName

wmsLayerName: string

The name of the WMS layer. This is the actual layer name from the capabilities, unlike the name property of this Layer which is actually the title in the capabilities.

Methods

Private _configureObject

  • _configureObject(results: any, deepInitialize?: boolean): void

Private _createFrom

  • _createFrom(results: any): void
  • Parameters

    • results: any

    Returns void

Private _getRelation

  • _getRelation(relationshipId: number): Relationship
  • Parameters

    • relationshipId: number

    Returns Relationship

Private _initializationFailedHandler

  • _initializationFailedHandler(err: Error): void

Private _initializedHandler

  • _initializedHandler(sender: any): void

Private _isAnnotationLayer

  • _isAnnotationLayer(): boolean
  • Not pretty but we are working around a deficiency in Essentials here

    Returns boolean

_populateOgcID

  • _populateOgcID(nativeID: string): void
  • Parameters

    • nativeID: string

    Returns void

Private _restErrorHandler

  • _restErrorHandler(error: Error): void

Private _restLoadHandler

  • _restLoadHandler(deepInitialize: boolean, result: any): void

Private _syncProgramaticallyChangedLayerVisibility

  • _syncProgramaticallyChangedLayerVisibility(visible: boolean): void
  • Accessor method for the LayerVisibilityEventManager class in MapService.ts to sync layer visibility with programmatic layer visibility changed made using esri's setLayerVisibility method.

    Parameters

    • visible: boolean

    Returns void

areAllAncestorsVisible

  • areAllAncestorsVisible(): boolean
  • Gets a value representing whether or not all of this layer's ancestors are currently visible in the map.

    Returns boolean

createFromDefinition

  • createFromDefinition(layerDefinition: any): void
  • Populates the Layer from a dynamic object which represents a layer.

    Parameters

    • layerDefinition: any

      An object which represents the Layer.

    Returns void

doWhenInitialized

  • doWhenInitialized(callback: function): void
  • doWhenInitialized(scope: any, callback: function): void
  • Parameters

    Returns void

  • Performs a callback function when this instance has been initialized. If this instance is already initialized when this function is called, the callback function will execute immediately.

    Parameters

    • scope: any

      The scope to using when executing the callback - i.e. the value of the 'this' variable in the callback function. This parameter may be ommitted in which cased the first parameter will be used as the callback function.

    • callback: function

      The callback function to execute when this instance has been initialized.

    Returns void

findReportById

  • findReportById(reportId: string): Report
  • Find the Report matching the specified report ID.

    Parameters

    • reportId: string

      The Id of the Report to find.

    Returns Report

getDefinitionExpression

  • getDefinitionExpression(serviceLayer?: Layer): string
  • Returns a string representing the layers definition expression. Uses a service layer if passed in to find the most up to date definition expression. If no service layer, get the definition expression for the layers dynamic definition json. A service layer would be useless here if you were initializing these layers for the first time. (ie. it is not added yet.)

    Parameters

    • Optional serviceLayer: Layer

      Service layer.

    Returns string

    The definition expression.

getFeatureLayer

  • getFeatureLayer(): Promise<FeatureLayer>
  • Gets the feature layer associated with this layer. Not supported for all layers types, in which case the value will be null.

    Returns Promise<FeatureLayer>

getFieldByName

  • getFieldByName(name: string): Field
  • Given a field name, returns the field object by that name.

    Parameters

    • name: string

      of the field to return

    Returns Field

getLayerDrawingOptions

  • getLayerDrawingOptions(): LayerDrawingOptions
  • Gets the layers drawing options from the dynamicDefinition.

    Returns LayerDrawingOptions

    The LayerDrawingOptions for the layer or null.

getLayerThemeSettings

  • Retrieves the layer theme settings for this layer by specified layer theme or layer theme id

    Parameters

    Returns LayerThemeSetting

getLayerTimeInfo

  • Retrieve the layer time info if available. This method needs to be called after the service layers have loaded.

    Returns TimeInfo

getLayerUrl

  • getLayerUrl(): string
  • Gets the URL to the actual Esri layer (or Essentials endpoint if appropriate).

    Returns string

getObjectIdFieldName

  • getObjectIdFieldName(): string
  • Determine what the Esri OBJECTID field name is for the feature in the layer.

    Returns string

getRelatedFeatureLayer

  • getRelatedFeatureLayer(relationshipId: number, callbackResults?: function, callbackErrors?: function): Deferred
  • Returns a Feature Layer for a given relationship ID.

    Parameters

    • relationshipId: number

      The id of the relationship.

    • Optional callbackResults: function

      A callback to invoke upon success.

        • (result: FeatureLayer): void
        • Parameters

          • result: FeatureLayer

          Returns void

    • Optional callbackErrors: function

      A callback to invoke if an error is encountered.

        • (error: Error): void
        • Parameters

          • error: Error

          Returns void

    Returns Deferred

initialize

  • initialize(obj?: any): void
  • Initializes the {@link geocortex.essentials.AsyncInitializable}. This is an asynchronous method, you may subscribe to the onInitialized and onInitializationFailed events for completion information.

    Parameters

    • Optional obj: any

    Returns void

isVisible

  • isVisible(): boolean
  • Returns whether or not the layer is currently visible in the map.

    Returns boolean

setInActiveTheme

  • setInActiveTheme(value: boolean): void
  • Sets the inActiveTheme property of the Layer. Raises the "LayerInActiveThemeChangedEvent" event.

    Parameters

    • value: boolean

      The value to set.

    Returns void

setVisibility

  • setVisibility(value: boolean, doNotRefresh?: boolean): void
  • Sets the visibility of the Layer. If the Layer is part of a tiled (or image) service, then the whole MapService visibility is set.

    Parameters

    • value: boolean
    • Optional doNotRefresh: boolean

    Returns void

toJson

  • toJson(): object
  • Exports the state of the layer as a JSON object. This can be used to recreate the layer again via createFromDefinition().

    Returns object

withinScaleRange

  • withinScaleRange(scale?: number): boolean
  • Determines if the specified scale is within this layer's min and max scale. If a value is not provided for this parameter, then the map's current scale value will be used.

    Parameters

    • Optional scale: number

      The scale value to test if it is between this layer's min and max scale.

    Returns boolean