Options
All
  • Public
  • Public/Protected
  • All
Menu

Class GeoJsonSource

GeoJsonSource is an object that is responsible for loading data and managing a series of vector elements on a map view from GeoJSON data.

Hierarchy

Implements

Index

Constructors

constructor

Properties

code

code: string

key

key: string

Identifier associated with the data source.

memberof

VectorSource

Readonly opts

requiresBounds

requiresBounds: boolean = false

Whether the data source requests data for the visible map bounds. If true, then data will be reloaded whenever the map's visible region changes.

Default value is false.

memberof

VectorSource

Optional style

Style configuration provider.

memberof

VectorSource

Accessors

animation

  • Returns the animation associated with the static layer.

    readonly
    memberof

    VectorSource

    Returns DataAnimation

animationEnabled

  • get animationEnabled(): boolean

enabled

  • get enabled(): boolean
  • set enabled(value: boolean): void
  • Whether the data source is enabled.

    memberof

    VectorSource

    Returns boolean

  • Whether the data source is enabled.

    memberof

    VectorSource

    Parameters

    • value: boolean

    Returns void

isLoading

  • get isLoading(): boolean
  • Returns boolean

markers

  • Current markers being managed by the data source.

    readonly
    memberof

    VectorSource

    Returns Array<MarkerMapElement>

markersById

  • Returns an object containing all active markers keyed by their unique identifiers.

    readonly
    memberof

    VectorSource

    Returns Record<string, MarkerMapElement>

polygons

polylines

service

  • API service used to request data for the data source.

    readonly
    memberof

    VectorSource

    Returns ApiRequest

shapes

  • Current polygons and polylines being managed by the data source.

    readonly
    memberof

    VectorSource

    Returns Array<AnyMapElement>

strategy

  • Map strategy the source is associated with.

    memberof

    VectorSource

    Returns AnyMapStrategy

  • Map strategy the source is associated with.

    memberof

    VectorSource

    Parameters

    Returns void

Methods

has

  • has(type: string): boolean
  • Returns whether the listeners are registered for the specified event name.

    memberof

    EventDispatcher

    Parameters

    • type: string

    Returns boolean

hasData

  • hasData(): boolean
  • Returns whether the source currently has data cached from a previous request.

    memberof

    VectorSource

    Returns boolean

load

  • load(params: {}, animateOnLoad?: boolean, appendData?: any): Promise<LayerDataType>
  • Requests data for the layer based on the provided geographical map bounds and date range.

    Parameters

    • params: {}
      • [key: string]: any
    • Default value animateOnLoad: boolean = false
    • Optional appendData: any

    Returns Promise<LayerDataType>

    A Promise containing the resulting marker data objects.

off

  • Removes a registered listener function for the specified event.

    memberof

    EventDispatcher

    Parameters

    • type: string

      Name of the event to remove the listener for.

    • callback: Function

      Handler function to remove so it won't be executed next time the event is triggered.

    • Default value scope: any = null

    Returns EventDispatcher

offAll

on

  • on(type: string, callback: Function, scope?: any, priority?: number): EventDispatcher
  • Registers a listener function to be executed each time an event occurs

    memberof

    EventDispatcher

    Parameters

    • type: string

      Name of the event to listen for. Value can contain multiple event names separated by spaces to trigger the same handler function for each event name.

    • callback: Function

      Handler function to be called when the event occurs

    • Default value scope: any = null
    • Default value priority: number = 0

    Returns EventDispatcher

once

  • once(type: string, callback: Function, scope?: any, priority?: number): EventDispatcher
  • Registers a listener function to be executed the first time an event occurs.

    memberof

    EventDispatcher

    Parameters

    • type: string

      Name of the event to listen for. Value can contain multiple event names separated by spaces to trigger the same handler function for each event name.

    • callback: Function

      Handler function to be called when the event occurs

    • Default value scope: any = null
    • Default value priority: number = 0

    Returns EventDispatcher

reload

  • reload(params?: any, appendData?: any): void
  • Reloads the data source using the last request parameters.

    memberof

    VectorSource

    Parameters

    • Optional params: any
    • Optional appendData: any

    Returns void

render

  • render(): void
  • Returns void

reset

  • reset(): void
  • Resets the data source by removing all map elements and clearing cached data.

    memberof

    VectorSource

    Returns void

setData

  • setData(data: any): void
  • Parameters

    • data: any

    Returns void

setOpacity

  • setOpacity(value?: number): void
  • Parameters

    • Default value value: number = 1

    Returns void

trigger

  • Triggers the specified event so that all registered listeners will be executed with the specified parameters.

    memberof

    EventDispatcher

    Parameters

    • type: any

      Event name to trigger

    • Default value data: any = null

    Returns EventDispatcher

update

  • update(data?: any): void
  • Reloads the data source by updating the data configuration.

    memberof

    VectorSource

    see

    VectorSourceOptions

    Parameters

    • Optional data: any

    Returns void

Generated using TypeDoc