Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "geocortex/essentials/utilities/GraphicsLayerUtilities"

Index

Variables

Const ExcludeFromEnum

ExcludeFromEnum: object

Type declaration

  • ExportApplyStateName: string
  • ExportMapTaskName: string
  • WebMapName: string

Const GraphicsLayerType

GraphicsLayerType: object

Types of graphics layer created internally by the Viewer. These need to be kept in a certain order. Pushpins on top, labels below this, highlights underneath labels, and all above markup.

Type declaration

  • Highlight: string
  • Label: string
  • Markup: string
  • Pushpin: string

Const excludeFromExportMapTaskName

excludeFromExportMapTaskName: "ExportMapTask" = "ExportMapTask"

Built in names of components which modules can have their graphics layers be excluded from. Third party modules may pass in additional components as strings.

Const featureTypeSelector

featureTypeSelector: object

Converts from both webMap JSON and JSAPI representations of geometry type to the appropriate FeatureCollectionType

Type declaration

Functions

addGraphicToLayer

  • addGraphicToLayer(graphic: Graphic, layerId: string, map: Map): boolean
  • Add a graphic to the specified layer. You must create the layer first.

    app

    The app that this module belongs to

    Parameters

    • graphic: Graphic

      The graphic to be added

    • layerId: string

      The layer ID to add the graphic to

    • map: Map

    Returns boolean

    A boolean returning true on success and false otherwise

addToGraphicsLayerIdsToExclude

  • addToGraphicsLayerIdsToExclude(excludeFromList: string[], graphicsLayerId: string): void
  • Allows both GVH and 3rd party modules to add their own graphics layer IDs to the list of layers be excluded.

    Parameters

    • excludeFromList: string[]
    • graphicsLayerId: string

    Returns void

getAllMarkupLayers

  • getAllMarkupLayers(): GraphicsLayer[]
  • Returns a copy of an array containing the current registered markup layers. Do not modify this array!

    Returns GraphicsLayer[]

getGraphicsLayerIdsToExclude

  • getGraphicsLayerIdsToExclude(excludeFromList: string[]): string[]
  • Gets the list of graphics layer IDs to be excluded from a given task. Most tasks were set up to filter out graphics layer IDs based on another list of graphics layer IDs, this provides that other list.

    Parameters

    • excludeFromList: string[]

      The list of activities to exclude, can be found in ExcludeFromEnum

    Returns string[]

getInternalGraphicsLayer

  • getInternalGraphicsLayer(id: string, site: Site, layerType?: string, registerClickable?: boolean): GraphicsLayer
  • Create a new graphics layer and place it in the correct order in the map graphics layers collection.

    Parameters

    • id: string

      Id of the graphics layer.

    • site: Site
    • Optional layerType: string

      One of "Pushpin", "Label", Highlight" or "Markup". Only required for layer creation. To simply retrieve a layer leave this out.

    • Optional registerClickable: boolean

    Returns GraphicsLayer

registerMarkupLayerAsClickable

  • registerMarkupLayerAsClickable(layer: GraphicsLayer, displayName: string, site: Site): void
  • This method registers the markup layer as a clickable graphic layer

    Parameters

    • layer: GraphicsLayer

      The markup layer

    • displayName: string
    • site: Site

    Returns void

registerStreamLayerAsClickable

  • registerStreamLayerAsClickable(layer: GraphicsLayer, site: Site, displayName: string): void
  • This method registers the stream layer as a clickable graphic layer

    Parameters

    • layer: GraphicsLayer

      The stream layer

    • site: Site
    • displayName: string

      The display name for the Stream layer

    Returns void

removeFromGraphicsLayerIdsToExclude

  • removeFromGraphicsLayerIdsToExclude(excludeFromList: string[], graphicsLayerId: string): void
  • Allows both GVH and 3rd party modules to remove their own graphics layers IDs to the list of layers be excluded.

    Parameters

    • excludeFromList: string[]
    • graphicsLayerId: string

    Returns void

removeInternalGraphicsLayer

  • removeInternalGraphicsLayer(id: string, map: Map, layerType: string): void
  • Call this function to remove an internal graphics layer. This just ensures that the internal layer count is correct and that new layers get added to the right location.

    Parameters

    • id: string

      Id of the layer to remove

    • map: Map
    • layerType: string

      Type of layer being removed. No checks performed to see if this is 'right'

    Returns void

tryRegisterClickableLayer

  • Convenience method to register a graphics layer as clickable if it's not been registered already.

    param:

    layer The graphics layer to register

    Parameters

    Returns boolean

    True if successfully registered, false otherwise.