Options
All
  • Public
  • Public/Protected
  • All
Menu

Observable view model for an ESRI Feature.

Hierarchy

Implements

Index

Constructors

constructor

  • Initializes a new instance of the {@link geocortex.essentialsHtmlViewer.mapping.infrastructure.Feature} class.

    class

    Represents a Geocortex Essentials Feature.

    constructs
    memberof

    geocortex.essentialsHtmlViewer.mapping.infrastructure

    Parameters

    • Optional options: FeatureOptions

      The options for the new Feature. (i.e. graphic / layer / resolveLayerFields / allowUnsafeContent)

    Returns Feature

Properties

attachmentInfos

Get the attachment infos associated with the feature.

type

ObservableCollection

attachmentInfosInitialized

attachmentInfosInitialized: Observable<boolean>

Indicates that the attachmentInfos collection has been initialized.

type

Observable

attributes

The attributes for the Feature.

type

FeatureAttribute[]

borderColor

borderColor: LazyObservable<number[]>

The border color of the Feature.

type

String

borderWidth

borderWidth: LazyObservable<number>

The border width of the Feature.

type

Number

dataLinkingResults

the features related data links

defaultDateFormat

defaultDateFormat: string

The default format to use for displaying date fields that have no explicit format.

defaultNumberFormat

defaultNumberFormat: string

The default format to use for displaying number fields that have no explicit format.

description

description: LazyObservable<string>

The description for the Feature.

type

String

descriptionFormat

descriptionFormat: LazyObservable<string>

The description format this Feature uses to render a description.

type

String

displayTimeZoneId

displayTimeZoneId: string

The IANA ID of the time zone in which this feature's field data will be displayed. Primarily used as a fallback when the FieldInfo object cannot access the appropriate ID.

esriFeature

esriFeature: Observable<Graphic>

Gets the Esri feature attached to the Geocortex feature.

type

esri.Graphic

extendedProperties

The extended properties for the Feature.

type

Array

featureLayer

featureLayer: FeatureLayer

The esri feature layer associated with the feature.

featureSet

featureSet: FeatureSet

The last featureSet that this feature was added to.

type

FeatureSet

featureSetUniqueIds

featureSetUniqueIds: string[]

The unique id's of the featureSets (if any) that currently contain this feature. With the introduction of Save Selections, it is now possible for a feature to be added to multiple feature sets simultaneously. The id of the latest featureSet that this feature is added to will be added to the end of the arrray. This array is automatically managed when this feature is added to or removed from a featureSet.

fillColor

fillColor: LazyObservable<number[]>

The fill color of the Feature.

type

String

hasAttachments

hasAttachments: Observable<boolean>

Gets a value indicating whether the feature has attachments.

type

Boolean

hasGeometry

hasGeometry: LazyObservable<boolean>

Gets a value indicating whether the feature has geometry attached.

type

Boolean

hasRelationships

hasRelationships: Observable<boolean>

Gets a value indicating whether the feature has relationships.

type

Boolean

hasValidGeometry

hasValidGeometry: LazyObservable<boolean>

Gets a value indicating whether the feature has a valid geometry attached.

type

Boolean

hasVisibleRelationships

hasVisibleRelationships: Observable<boolean>

Gets a value indicating whether the feature has visible relationships.

type

Boolean

hyperlinks

The hyperlinks associated with the feature (if any)

type

FeatureHyperlink[]

iconUri

iconUri: LazyObservable<string>

Observable public members - Layer config overrides

id

id: LazyObservable<string>

The id of the Feature.

type

Number

isModified

isModified: boolean

Whether the feature attribute data has been locally modified.

label

label: LazyObservable<string>

The label for the Feature.

type

String

labelFormat

labelFormat: LazyObservable<string>

The label format this Feature uses to render a label.

type

String

layer

layer: Layer

The Layer this Feature is a part of.

type

geocortex.essentials.Layer

linkedAttributes

linked data associated with a feature's linked attributes

longDescription

longDescription: LazyObservable<string>

The long description for the Feature.

type

String

longDescriptionFormat

longDescriptionFormat: LazyObservable<string>

The long description format this Feature uses to render a long description.

type

String

maxScale

maxScale: LazyObservable<number>

The configured max scale of the Feature.

type

Number

minScale

minScale: LazyObservable<number>

The configured min scale of the Feature.

type

Number

plainLabel

plainLabel: LazyObservable<string>

The plain label for the Feature, stripped of any HTML.

type

String

selected

selected: Observable<boolean>

Will be true when this feature is added to the starred selection. Is not flagged for any other result set. Note that creating a Feature via the constructor will set up bindings on this observable such that setting or unsetting it will also add/remove from the starred selection.

timeZoneId

timeZoneId: string

The IANA ID of the time zone in which this feature's field data are current. Primarily used as a fallback when the FieldInfo object cannot access the appropriate ID.

token

token: string

The token that should uniquely identify this feature for a specific application instance and run

type

AlphaNumeric token that should uniquely identify this feature

zoomExtent

zoomExtent: Observable<Extent>

The zoom extent of the Feature.

type

Extent

zoomFactor

zoomFactor: LazyObservable<number>

The zoom factor of the Feature.

type

Number

zoomScale

zoomScale: LazyObservable<number>

The zoom scale of the Feature.

type

Number

Static TOKEN_RESOLUTION_TIMEOUT

TOKEN_RESOLUTION_TIMEOUT: number

We will not wait for any tokens that take longer than this to resolve

Methods

Private _getLayerUniqueId

  • _getLayerUniqueId(): string
  • Returns string

calculateScaleToMakeVisible

  • calculateScaleToMakeVisible(scale: number): number
  • Calculates a scale at which the layer would be visible if it's not already.

    Parameters

    • scale: number

      The scale

    Returns number

    The scale at which the layer is visible, calculated to zoom in or out just enough such that the layer would be visible. If the layer is already visible, the current map scale is returned.

equals

  • Checks if the given Geocortex essentials feature is equal to this feature

    Parameters

    Returns boolean

formatTemplateString

  • formatTemplateString(template: string, obs?: Observable<string>): string
  • The method formatTemplateString was made public to be consistent with silverlight viewer. It is used by Hyperlink class "geocortex.essentialsHtmlViewer.mapping.modules.FeatureDetails.FeatureDetailsProviders.Hyperlink". Note that this will not populate any async replacement values, and the consumer will have to update later if these are needed.

    Parameters

    • template: string

      A string containing replacement tokens to be processed.

    • Optional obs: Observable<string>

      An optional observable to update with any async values as they come in.

    Returns string

formatTemplateStringAsync

  • formatTemplateStringAsync(template: string): Promise<string>
  • Use this version if you can, it returns a promise which will always resolve with the correct and final result.

    Parameters

    • template: string

      A string containing replacement tokens to be processed.

    Returns Promise<string>

getAttributes

  • Returns a set of all of the attributes associated with this feature

    Parameters

    • Optional resolveLayerFields: boolean

      boolean: Whether we should look at the layers fields to resolve the names.

    Returns FeatureAttribute[]

    array an of FeatureAttribute objects where we have attempted to resolve the names using this feature

getAttributesFromEsriFeature

  • getAttributesFromEsriFeature(attributes: any[], resolveLayerFields?: boolean): FeatureAttribute[]
  • Takes a collection of attributes from an Esri Graphic (feature) and returns a collection of feature attributes with the proper naming.

    Parameters

    • attributes: any[]

      attribute Collection of name value pairs to which we will attempt to resolve names using this feature

    • Optional resolveLayerFields: boolean

      Whether or not we should attempt to resolve the layers fields. Defaults to true.

    Returns FeatureAttribute[]

getExtendedPropertyByName

  • getExtendedPropertyByName(name: string): any
  • Finds the extended property matching the specified name.

    Parameters

    • name: string

      The name of the property to find.

    Returns any

getFeatureUrl

  • getFeatureUrl(): string
  • Gets the Url to the feature.

    Returns string

    Url to the Esri feature.

getPrimaryKeyValue

  • getPrimaryKeyValue(): string
  • Gets the value of the primary key field (ObjectID)

    Returns string

    Value of the primary key field.

getType

  • getType(): FeatureType
  • Gets the feature's type as defined by its feature layer.

    Returns FeatureType

loadAttributes

  • loadAttributes(resolveLayerFields: boolean): void
  • Load the feature attributes with proper naming

    Parameters

    • resolveLayerFields: boolean

      Whether or not we should attempt to resolve the layers fields. Defaults to true.

    Returns void

parseDataLinkId

  • parseDataLinkId(fieldName: string, result: DataLinkInfo): boolean
  • Process the fieldName into a dataLink/attributeName pair

    Parameters

    • fieldName: string

      String containing the value of datalink ID and attribute name

    • result: DataLinkInfo

      Empty map object used to store the datalink ID and attribute name

    Returns boolean

replaceToken

  • replaceToken(token: string): string | Promise<string>
  • Given a replacement token find an appropriate replacement value and return it as a string or a promise of a string in the case of async operations.

    Parameters

    • token: string

      The token to replace

    Returns string | Promise<string>

resetAttachmentInfos

  • resetAttachmentInfos(): void
  • Clears the attachmentInfos and forces a re-query of all the attachments from the server the next attachmentInfos.get() is called.

    Returns void

setExtendedProperty

  • setExtendedProperty(name: string, value: any): void
  • Sets the extended property matching the specified name.

    Parameters

    • name: string

      The name of the property to update.

    • value: any

      The property value.

    Returns void

structurallyEquals

  • structurallyEquals(o: Feature): boolean
  • Determines whether a Geocortex essentials feature is structurally equal to the current instance.

    Structural equality means that two objects are equal because they have equal values.
    It differs from reference equality, which indicates that two object references are equal because they reference the same physical object.
    Note: This comparison does not take geometry into account

    Parameters

    Returns boolean

    true if the two objects are equal; otherwise, false.

withinMinScaleRange

  • withinMinScaleRange(scale: number): boolean
  • Same as above but only returns true if the scale is below the min scale (not zoomed out too far)

    Parameters

    • scale: number

    Returns boolean

withinScaleRange

  • withinScaleRange(scale: number): boolean
  • Determines if the specified scale is within this layer's min and max scale.

    Parameters

    • scale: number

      The scale value to test if it is between 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.

    Returns boolean