Options
All
  • Public
  • Public/Protected
  • All
Menu

Representation of a ClusterLayer.

Hierarchy

  • GraphicsLayer
    • ClusterLayer

Index

Constructors

Properties

Methods

Constructors

constructor

Properties

CLUSTER_EXPLODED

CLUSTER_EXPLODED: string

Protected MAP_CLICK_PREVENTION_DELAY

MAP_CLICK_PREVENTION_DELAY: number

Don't change this unless you are really sure you know what you are doing.

Protected _clusters

_clusters: Cluster[]

Collection of information for all clusters.

Protected _currExtent

_currExtent: Extent

Needed to prevent bogus extent change events in Chrome

Protected _defaultClusterRadius

_defaultClusterRadius: number

Protected _defaultMaxFeatures

_defaultMaxFeatures: number

Protected _esriEventHandlers

_esriEventHandlers: Handle[]

Event handlers that are handled by esri/dojo.

Protected _explodedFeatures

_explodedFeatures: Graphic[]

Currently exploded features

Protected _featureLayerGraphics

_featureLayerGraphics: Graphic[]

All of the graphics from the feature layer.

Protected _featureSetName

_featureSetName: string

The name of the FeatureSet that the features inside of exploded clusters will be placed into.

Protected _firstCluster

_firstCluster: boolean

Tracking the clustering that happens on startup to make sure we don't do it too soon.

Protected _gcxEventHandlers

_gcxEventHandlers: GcxEventHandler[]

Event handlers that are handled by geocortex/Framework

Protected _hiddenClusters

_hiddenClusters: Graphic[]

The clusters that are currently being hidden when a cluster is focused upon/exploded.

Protected _isChrome

_isChrome: boolean

Is this Chrome?

Protected _mapClickEnabled

_mapClickEnabled: boolean

Flag to track whether map clicks are currently disabled

Protected _willCluster

_willCluster: boolean

app

attributionDataUrl

attributionDataUrl: string

The URL, when available, where the layer's attribution data is stored.

className

className: string

class attribute of the layer's node.

clusterBackgroundColor

clusterBackgroundColor: Color

Background color of clusters.

clusterLabelColor

clusterLabelColor: Color

Color of the label on clusters.

clusterRadius

clusterRadius: Observable<number>

The radius of each cluster.

credential

credential: Credential

Provides credential information for the layer such as userid and token if the layer represents a resource that is secured with token-based authentication.

dataAttributes

dataAttributes: string | string[]

List of attribute fields added as custom data attributes to graphics node.

featureLayer

featureLayer: FeatureLayer

The Feature Layer that is used as the basis for the cluster layer.

featureLayerRenderer

featureLayerRenderer: Renderer

The renderer for the Feature Layer that is passed in on object construction.

fontFamily

fontFamily: string

The font family

fontSize

fontSize: string

The font size

gcxLayer

gcxLayer: Layer

The Geocortex Layer that is used as the basis for the cluster layer.

graphics

graphics: Graphic[]

The array of graphics that make up the layer.

hasAttributionData

hasAttributionData: boolean

When true, the layer has attribution data.

hideClusters

hideClusters: Observable<number>

id

id: string

ID assigned to the layer.

infoTemplate

infoTemplate: InfoTemplate

The info template for the layer.

loadError

loadError: Error

Set if the layer failed to load.

loaded

loaded: boolean

When the layer is loaded, the value becomes "true", and layer properties can be accessed.

maxFeaturesInCluster

maxFeaturesInCluster: Observable<number>

The maximum number of features to include in a cluster.

maxScale

maxScale: number

Maximum visible scale for the layer.

minScale

minScale: number

Minimum visible scale for the layer.

opacity

opacity: number

Opacity or transparency of layer.

refreshInterval

refreshInterval: number

Refresh interval of the layer in minutes.

renderer

renderer: ClassBreaksRenderer

Retyping of the renderer to show that we're using a ClassBreaksRenderer

rendererInformation

rendererInformation: RendererInformation[]

Observale information about the renderer currently in use. Used by the legend.

showAttribution

showAttribution: boolean

When true, the layer's attribution is displayed on the map.

singleFeatureLayer

singleFeatureLayer: GraphicsLayer

Layer to represent the individual graphics within an expanded cluster.

styling

styling: boolean

Indicates whether the layer is responsible for styling graphics.

surfaceType

surfaceType: string

Type of vector graphics surface used to draw graphics.

suspended

suspended: boolean

When true, the layer is suspended.

url

url: string

URL to the ArcGIS Server REST resource that represents a map service.

visible

visible: boolean

Visibility of the layer.

visibleAtMapScale

visibleAtMapScale: boolean

When true, the layer is visible at the current map scale.

Methods

Protected _addBreak

  • _addBreak(renderer: ClassBreaksRenderer, symbolSize: number, rangeStart: number, rangeEnd: number, largestClusterSize: number, rendererInformationPosition: number): void
  • Checks to see if a valid break can be generated from the passed in information. If so, then generates a break on the passed renderer.

    Parameters

    • renderer: ClassBreaksRenderer

      The ClassBreaksRenderer that will have a new break added to it.

    • symbolSize: number

      The size in pixels of the circle to be generated.

    • rangeStart: number

      The start of the range.

    • rangeEnd: number

      The end of the range.

    • largestClusterSize: number

      The number of features in the largest cluster on screen.

    • rendererInformationPosition: number

      RendererInformation tracks visibility/values on a 0-3 scale to communicate to the legend.

    Returns void

Protected _addClusterToMapTip

  • _addClusterToMapTip(clusterId: any, currentlyExploded: boolean): void
  • Adds the cluster with a given id to a map tip, exploding it if necessary

    Parameters

    • clusterId: any
    • currentlyExploded: boolean

    Returns void

    void

Protected _addGraphicsToClusters

  • _addGraphicsToClusters(preserveClusterLocation: boolean): void
  • Matches up graphics with clusters and associates them.

    Parameters

    • preserveClusterLocation: boolean

      Whether the addition of a point to a cluster should adjust where the cluster is located.

    Returns void

Protected _clusterAddPoint

  • _clusterAddPoint(graphic: Graphic, p: any, cluster: Cluster, preserveClusterLocation: boolean): void
  • Adds a point to an existing cluster.

    Parameters

    • graphic: Graphic

      The graphic to be associated with the cluster.

    • p: any

      The point/graphic that will readjust the cluster location.

    • cluster: Cluster

      The cluster to be associated with.

    • preserveClusterLocation: boolean

      Whether the cluster's location should be adjusted when the point is added.

    Returns void

Protected _clusterLayerRemovedEvent

  • _clusterLayerRemovedEvent(clusterLayer: ClusterLayer): void
  • Cleans up the cluster layer that has been removed.

    Parameters

    • clusterLayer: ClusterLayer

      The ClusterLayer that is being disabled/removed.

    Returns void

Protected _createCluster

  • _createCluster(graphic: Graphic, point: Point): void
  • Called when there is no cluster within range of the point. Creates a new cluster in that location.

    Parameters

    • graphic: Graphic

      p The point specifying where the cluster is to be created.

    • point: Point

    Returns void

Protected _disableMapClick

  • _disableMapClick(): void
  • Disables normal clicks on the map. We'll use the next click to implode a cluster instead. This timeout needs to be the same as the timeout above to stop things being handled in the wrong order.

    Returns void

Protected _enableMapClick

  • _enableMapClick(cancelSearch?: boolean): void
  • Enables normal clicks on the map again, used after the click to implode an exploded cluster. Timeout is necessary here to prevent handling (sometimes!) the current mouse events as the enabled click.

    Parameters

    • Optional cancelSearch: boolean

    Returns void

Protected _explodeCluster

  • _explodeCluster(clusterId: any, clusterFeatures: Graphic[], currentlyExploded: boolean): void
  • If there is more than one feature in the cluster we need to 'explode' it to show all the features

    Parameters

    • clusterId: any
    • clusterFeatures: Graphic[]
    • currentlyExploded: boolean

    Returns void

Protected _generateClusters

  • _generateClusters(): void
  • Generates the clusters by going through the graphics stored in _featureLayerGraphics.

    Returns void

Protected _getRenderedSymbol

  • _getRenderedSymbol(graphic: Graphic): Symbol
  • Retrieves the symbology associated with the passed esri graphic.

    Parameters

    • graphic: Graphic

      The Esri graphic to retrieve the feature symbology for.

    Returns Symbol

Protected _handleEditorClosedEvent

  • _handleEditorClosedEvent(): void
  • Runs after the Feature Editor is closed.

    Returns void

Protected _handleGeometryChange

  • _handleGeometryChange(): void
  • Runs after a geometry edit/feature editor is closed to ensure what is represented is proper.

    Returns void

Protected _implodeCluster

  • _implodeCluster(): void
  • Handles removing the current exploded cluster and reclustering it

    Returns void

Protected _isClusterFull

  • _isClusterFull(cluster: Cluster): boolean
  • Checks to see if the current cluster has exceeded the configured maximum cluster size. Returns false if no maximum cluster size is configured.

    Parameters

    • cluster: Cluster

      The cluster to evaluate.

    Returns boolean

Protected _isEventPossiblyHandled

  • _isEventPossiblyHandled(event: AGSMouseEvent): boolean
  • Pre-filter to decide whether we should bother listening for a mouseup associated with this mousedown event

    Parameters

    • event: AGSMouseEvent

    Returns boolean

Protected _isValidCluster

  • _isValidCluster(point: Point, cluster: Cluster, resolution: number): boolean
  • Checks to see if the passed point is within the tolerance (pixels) of the current cluster.

    Parameters

    • point: Point

      The point to compare to the cluster.

    • cluster: Cluster

      The cluster to compare to the point.

    • resolution: number

    Returns boolean

Protected _layerVisibilityChangedEvent

  • _layerVisibilityChangedEvent(result: object[]): void
  • Raised whenever a layer's visibility changes. Used to make it so clusters are invisible when a layer is disabled at the layer list level.

    Parameters

    • result: object[]

      An object with an Essentials Layer, MapService, and visibility boolean.

    Returns void

Protected _loadRenderer

  • _loadRenderer(): void
  • Sets up the renderer and the various breaks that are used to represent clusters at different sizes. This can be called dynamically as the size of the clusters change depending on the number of features in the largest cluster.

    Returns void

Protected _makeTransparent

  • _makeTransparent(color: Array<number>): Array<number>
  • Used to make the passed color arrray slightly transparent.

    Parameters

    • color: Array<number>

      An array of RGBA color values.

    Returns Array<number>

Protected _mapClickedEvent

  • _mapClickedEvent(event: any): void
  • Run whenever the map is clicked and the cluster layer is active.

    Parameters

    • event: any

      The MouseEvent/TouchEvent that triggered this.

    Returns void

Protected _mapExtentChangedEvent

  • _mapExtentChangedEvent(extent: any, args: any): void
  • Run whenever the map's extent is changed and clustering is active.

    Parameters

    • extent: any

      The new extent of the map.

    • args: any

      Arguments involving the map's new extent.

    Returns void

Protected _mapMouseDownEvent

  • _mapMouseDownEvent(downEvent: AGSMouseEvent): void
  • GVH-8134: Handling mouse up / mouse down instead of mapClick as map clicks can fail to fire in Chrome sometimes when clicking on a cluster layer. This doesn't address the root cause (whatever that might be) but does effectively work around the problem.

    Parameters

    • downEvent: AGSMouseEvent

    Returns void

Protected _mapTipClosedEvent

  • _mapTipClosedEvent(): void
  • Clears the data from the cluster that has been exploded when a maptip is closed.

    Returns void

Protected _setupEventListeners

  • _setupEventListeners(map: Map): void
  • Assigns values and event listeners concerned with the map.

    Parameters

    • map: Map

      The esri map that is associated with this layer.

    Returns void

Protected _showAllClusters

  • _showAllClusters(): void
  • Adds all generated clusters to the layer. Before doing so, it checks to see what the breaks should be for graphically representing cluster size.

    Returns void

Protected _showCluster

  • _showCluster(cluster: Cluster): void
  • Adds an individual cluster to the layer.

    Parameters

    • cluster: Cluster

      The cluster to add to the layer.

    Returns void

add

  • add(graphic: Graphic): Graphic
  • Adds a graphic.

    Parameters

    • graphic: Graphic

      The graphic to add.

    Returns Graphic

attr

  • attr(name: string, value: string): Layer
  • Adds a new attribute or changes the value of an existing attribute on the layer's node.

    Parameters

    • name: string

      The name of the attribute.

    • value: string

      The value of the attribute.

    Returns Layer

clear

  • clear(): void
  • Clears all graphics.

    Returns void

destroy

  • destroy(): void
  • Clears all of the event handlers, layers, and other persistent things that are associated with this cluster.

    Returns void

disableMouseEvents

  • disableMouseEvents(): void
  • Disables all mouse events on the graphics layer.

    Returns void

enableMouseEvents

  • enableMouseEvents(): void
  • Enables all mouse events on the graphics layer.

    Returns void

getAttributionData

  • getAttributionData(): any
  • Asynchrously returns custom data for the layer when available.

    Returns any

getMap

  • getMap(): Map
  • Returns reference to the map control the layer is added to.

    Returns Map

getNode

  • getNode(): HTMLElement
  • Returns the layer's DOM node.

    Returns HTMLElement

hide

  • hide(): void
  • Sets the visibility of the layer to "false".

    Returns void

isClusterExploded

  • isClusterExploded(): boolean
  • Returns true if a cluster is exploded on the map

    Returns boolean

    boolean

isVisibleAtScale

  • isVisibleAtScale(scale: number): boolean
  • Returns true if the layer is visible at the given scale.

    Parameters

    • scale: number

      The scale at which to check if the layer is visible.

    Returns boolean

on

  • on(type: "click", listener: function): Handle
  • on(type: "dbl-click", listener: function): Handle
  • on(type: "graphic-add", listener: function): Handle
  • on(type: "graphic-draw", listener: function): Handle
  • on(type: "graphic-node-add", listener: function): Handle
  • on(type: "graphic-node-remove", listener: function): Handle
  • on(type: "graphic-remove", listener: function): Handle
  • on(type: "graphics-clear", listener: function): Handle
  • on(type: "mouse-down", listener: function): Handle
  • on(type: "mouse-drag", listener: function): Handle
  • on(type: "mouse-move", listener: function): Handle
  • on(type: "mouse-out", listener: function): Handle
  • on(type: "mouse-over", listener: function): Handle
  • on(type: "mouse-up", listener: function): Handle
  • on(type: string, listener: function): Handle
  • Fires when a graphic has been clicked.

    Parameters

    • type: "click"
    • listener: function
        • (event: object): void
        • Parameters

          • event: object
            • event: any
            • target: GraphicsLayer

          Returns void

    Returns Handle

  • Fires when a graphic has been double clicked.

    Parameters

    • type: "dbl-click"
    • listener: function
        • (event: object): void
        • Parameters

          • event: object
            • target: GraphicsLayer

          Returns void

    Returns Handle

  • Fires when a graphic is added to the GraphicsLayer.

    Parameters

    • type: "graphic-add"
    • listener: function
        • (event: object): void
        • Parameters

          • event: object
            • graphic: Graphic
            • target: GraphicsLayer

          Returns void

    Returns Handle

  • Fires when a graphic is drawn.

    Parameters

    • type: "graphic-draw"
    • listener: function
        • (event: object): void
        • Parameters

          • event: object
            • graphic: Graphic
            • target: GraphicsLayer

          Returns void

    Returns Handle

  • Fires when a graphic's DOM node is created and added to the layer.

    Parameters

    • type: "graphic-node-add"
    • listener: function
        • (event: object): void
        • Parameters

          • event: object
            • graphic: Graphic
            • node: HTMLElement
            • target: GraphicsLayer

          Returns void

    Returns Handle

  • This event is fired when a graphic's DOM node is removed (consider the node destroyed).

    Parameters

    • type: "graphic-node-remove"
    • listener: function
        • (event: object): void
        • Parameters

          • event: object
            • graphic: Graphic
            • node: HTMLElement
            • target: GraphicsLayer

          Returns void

    Returns Handle

  • Fires when a graphic is removed from the GraphicsLayer.

    Parameters

    • type: "graphic-remove"
    • listener: function
        • (event: object): void
        • Parameters

          • event: object
            • graphic: Graphic
            • target: GraphicsLayer

          Returns void

    Returns Handle

  • Fires when all graphics in the GraphicsLayer are cleared.

    Parameters

    • type: "graphics-clear"
    • listener: function
        • (event: object): void
        • Parameters

          • event: object
            • target: GraphicsLayer

          Returns void

    Returns Handle

  • Fires when a mouse button is pressed down and the mouse cursor is on a graphic.

    Parameters

    • type: "mouse-down"
    • listener: function
        • (event: AGSMouseEvent): void
        • Parameters

          • event: AGSMouseEvent

          Returns void

    Returns Handle

  • Fires while the mouse is being dragged until the mouse button is released.

    Parameters

    • type: "mouse-drag"
    • listener: function
        • (event: AGSMouseEvent): void
        • Parameters

          • event: AGSMouseEvent

          Returns void

    Returns Handle

  • Fires as the mouse moves through a graphic on the GraphicsLayer.

    Parameters

    • type: "mouse-move"
    • listener: function
        • (event: AGSMouseEvent): void
        • Parameters

          • event: AGSMouseEvent

          Returns void

    Returns Handle

  • Fires as the mouse exits a graphic on the GraphicsLayer.

    Parameters

    • type: "mouse-out"
    • listener: function
        • (event: AGSMouseEvent): void
        • Parameters

          • event: AGSMouseEvent

          Returns void

    Returns Handle

  • Fires when the mouse first enters into a graphic on the GraphicsLayer.

    Parameters

    • type: "mouse-over"
    • listener: function
        • (event: AGSMouseEvent): void
        • Parameters

          • event: AGSMouseEvent

          Returns void

    Returns Handle

  • Fires when a mouse button is released and the mouse cursor is on a graphic.

    Parameters

    • type: "mouse-up"
    • listener: function
        • (event: AGSMouseEvent): void
        • Parameters

          • event: AGSMouseEvent

          Returns void

    Returns Handle

  • Parameters

    • type: string
    • listener: function
        • (event: any): void
        • Parameters

          • event: any

          Returns void

    Returns Handle

onFeatureClicked

  • onFeatureClicked(event: AGSMouseEvent): void
  • Used to detect when a cluster is clicked by the user. If a valid click is detected, then all other clusters are hidden and the selected cluster has its graphics displayed.

    Parameters

    • event: AGSMouseEvent

      The ArcGIS MouseEvent that triggered the cluster's click action.

    Returns void

recluster

  • recluster(): void
  • Called whenever clusters need to be recalculated. Will clear the features from an exploded cluster on the map, recalculate the clusters, then redraw the cluster layer

    Returns void

redraw

  • redraw(): void
  • Returns void

remove

  • remove(graphic: Graphic): Graphic
  • Removes a graphic.

    Parameters

    • graphic: Graphic

      The graphic to remove.

    Returns Graphic

reset

  • reset(): void
  • Restore settings to the Essentials defaults

    Returns void

resume

  • resume(): void
  • Resumes layer drawing.

    Returns void

setInfoTemplate

  • setInfoTemplate(infoTemplate: InfoTemplate): void
  • Specify or change the info template for a layer.

    Parameters

    • infoTemplate: InfoTemplate

      The new info template.

    Returns void

setMaxScale

  • setMaxScale(scale: number): void
  • Set the maximum scale for the layer.

    Parameters

    • scale: number

      The maximum scale at which the layer is visible.

    Returns void

setMinScale

  • setMinScale(scale: number): void
  • Set the minimum scale for the layer.

    Parameters

    • scale: number

      The minimum scale at which the layer is visible.

    Returns void

setOpacity

  • setOpacity(opacity: number): void
  • Initial opacity or transparency of layer.

    Parameters

    • opacity: number

      Value from 0 to 1, where 0 is 100% transparent and 1 has no transparency.

    Returns void

setRefreshInterval

  • setRefreshInterval(interval: number): Layer
  • Changes the layer's refresh interval to the given value (in minutes).

    Parameters

    • interval: number

      Refresh interval of the layer in minutes.

    Returns Layer

setRenderer

  • setRenderer(renderer: Renderer): void
  • Sets the renderer for the graphics layer.

    Parameters

    • renderer: Renderer

      The renderer used for the graphic.

    Returns void

setScaleRange

  • setScaleRange(minScale: number, maxScale: number): void
  • Set the scale range for the layer.

    Parameters

    • minScale: number

      The minimum scale at which the layer is visible.

    • maxScale: number

      The maximum scale at which the layer is visible.

    Returns void

setVisibility

  • setVisibility(visible: boolean): void
  • Parameters

    • visible: boolean

    Returns void

show

  • show(): void
  • Sets the visibility of the layer to "true".

    Returns void

suspend

  • suspend(): void
  • Suspends layer drawing.

    Returns void