Options
All
  • Public
  • Public/Protected
  • All
Menu

Class MapStrategy<Map, Factory>

An abstract map strategy class that provides the core functionality required for a specific mapping strategy. This class should be subclassed per each strategy instead of being instantiated directly.

export

Type parameters

Hierarchy

Index

Constructors

constructor

  • new MapStrategy(target: HTMLElement | HTMLElement[] | string | Map, opts?: any): MapStrategy
  • Parameters

    • target: HTMLElement | HTMLElement[] | string | Map
    • Optional opts: any

    Returns MapStrategy

Properties

dataSource

Accessors

$el

  • get $el(): any
  • The HTML target in which the map is rendered to.

    Returns any

factory

  • get factory(): Factory
  • A factory provider that is responsible for generating the necessary map content as required by the mapping strategy.

    Returns Factory

map

  • get map(): Map
  • The third-party map view instance associated with the mapping strategy.

    Returns Map

opts

  • get opts(): {}
  • Returns {}

    • [key: string]: any

sources

  • get sources(): any[]
  • Returns any[]

strategy

  • get strategy(): string
  • Returns string

Methods

addMarker

  • addMarker(marker: any, data?: any): void
  • Adds the marker to the map view. The provided marker must be an instance type required by the current mapping strategy.

    Parameters

    • marker: any
    • Optional data: any

    Returns void

addMarkers

  • addMarkers(markers: any[]): void
  • Adds an array of markers to the map view. The provided markers must be an instance type required by the current mapping strategy.

    Parameters

    • markers: any[]

    Returns void

addOverlay

  • addOverlay(overlay: any): void
  • Adds the specified overlay layer to the map. The overlay must be an instance of the type required by the configured map strategy and underlying third-party mapping library.

    memberof

    MapStrategy

    Parameters

    • overlay: any

    Returns void

addOverlays

  • addOverlays(overlays: any[]): void
  • Adds a series of overlay layers to the map. The overlays must be an instance of the type required by the configured map strategy and underlying third-party mapping library.

    memberof

    MapStrategy

    Parameters

    • overlays: any[]

    Returns void

addShape

  • addShape(shape: any, data?: any): void
  • Adds a polygon or polyline to the map view. The provided shape must be an instance type required by the current mapping strategy.

    memberof

    MapStrategy

    Parameters

    • shape: any
    • Optional data: any

    Returns void

addShapes

  • addShapes(shapes: any[], data?: any): void
  • Adds an array of polylines and/or polygons to the map view. The provided shapes must be an instance type required by the current mapping strategy.

    memberof

    MapStrategy

    Parameters

    • shapes: any[]
    • Optional data: any

    Returns void

addSource

  • addSource(source: any): void
  • Adds the specified map content source to the map.

    memberof

    MapStrategy

    Parameters

    • source: any

    Returns void

bindCalloutToMarker

  • bindCalloutToMarker(marker: any, content: string): void
  • Parameters

    • marker: any
    • content: string

    Returns void

clear

  • clear(): void
  • Returns void

coordToPoint

  • Converts the specified geographical coordinate to pixel coordinates within the map view's container.

    memberof

    MapStrategy

    Parameters

    Returns Point

fitBounds

  • fitBounds(bounds: GeoBounds, padding: number[]): void
  • Sets the minimum visible geographical bounds for the map view so that the specified bounds are contained within the visible region with an optional inset.

    memberof

    MapStrategy

    Parameters

    Returns void

getBounds

  • Returns the geographical bounds for the visible region of the map view.

    memberof

    MapStrategy

    Returns GeoBounds

getCenter

  • Returns the geographical center coordinate of the map view.

    memberof

    MapStrategy

    Returns Coordinate

getZoom

  • getZoom(): number
  • Returns the current zoom level of the map view.

    memberof

    MapStrategy

    Returns number

has

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

    memberof

    EventDispatcher

    Parameters

    • type: string

    Returns boolean

hideShape

  • hideShape(shape: any): void
  • Parameters

    • shape: any

    Returns void

hideShapes

  • hideShapes(shapes: any[]): void
  • Parameters

    • shapes: any[]

    Returns void

isMarker

  • isMarker(el: any): boolean
  • Returns whether the element is a native map marker instance.

    memberof

    MapStrategy

    Parameters

    • el: any

    Returns boolean

isPolygon

  • isPolygon(el: any): boolean
  • Returns whether the element is a native map polygon instance.

    memberof

    MapStrategy

    Parameters

    • el: any

    Returns boolean

isPolyline

  • isPolyline(el: any): boolean
  • Returns whether the element is a native map polyline instance.

    memberof

    MapStrategy

    Parameters

    • el: any

    Returns boolean

isReady

  • isReady(): boolean
  • Returns whether the map and underlying map strategy have been fully setup and initialized.

    memberof

    MapStrategy

    Returns boolean

isText

  • isText(source: any): boolean
  • Parameters

    • source: any

    Returns boolean

isTile

  • isTile(source: any): boolean
  • Returns whether the element is a tile source object.

    memberof

    MapStrategy

    Parameters

    • source: any

    Returns boolean

isVector

  • isVector(source: any): boolean
  • Returns whether the element is a vector source object.

    memberof

    MapStrategy

    Parameters

    • source: any

    Returns boolean

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

pointToCoord

  • Converts the specified pixel coordinates within the map view's container to geographical coordinates on the map.

    memberof

    MapStrategy

    Parameters

    Returns Coordinate

removeMarker

  • removeMarker(marker: any): void
  • Removes the marker from the map view. The provided marker must be an instance type required by the current mapping strategy.

    Parameters

    • marker: any

    Returns void

removeMarkers

  • removeMarkers(markers: any[]): void
  • Adds an array of markers from the map view. The provided markers must be an instance type required by the current mapping strategy.

    Parameters

    • markers: any[]

    Returns void

removeOverlay

  • removeOverlay(overlay: any): void
  • Removes the specified overlay layer from the map. The overlay must be an instance of the type required by the configured map strategy and underlying third-party mapping library.

    memberof

    MapStrategy

    Parameters

    • overlay: any

    Returns void

removeOverlays

  • removeOverlays(overlays: any[]): void
  • Removes a series of overlay layers from the map. The overlay must be an instance of the type required by the configured map strategy and underlying third-party mapping library.

    memberof

    MapStrategy

    Parameters

    • overlays: any[]

    Returns void

removeShape

  • removeShape(shape: any): void
  • Removes the polyline or polygon from the map view. The provided shape must be an instance type required by the current mapping strategy.

    memberof

    MapStrategy

    Parameters

    • shape: any

    Returns void

removeShapes

  • removeShapes(shapes: any[]): void
  • Removes an array of polylines and/or polygons from the map view. The provided shape must be an instance type required by the current mapping strategy.

    memberof

    MapStrategy

    Parameters

    • shapes: any[]

    Returns void

removeSource

  • removeSource(source: any): void
  • Removes the specified map content source from the map.

    memberof

    MapStrategy

    Parameters

    • source: any

    Returns void

setBounds

  • Sets the geographical bounds for the visible region of the map view.

    memberof

    MapStrategy

    Parameters

    Returns void

setCenter

  • Sets the geographical center coordinate of the map view.

    memberof

    MapStrategy

    Parameters

    Returns void

setView

  • Sets the current map view using the specified center coordinate and zoom level.

    memberof

    MapStrategy

    Parameters

    Returns void

setZoom

  • setZoom(zoom: number): void
  • Sets the zoom level of the map view.

    memberof

    MapStrategy

    Parameters

    • zoom: number

    Returns void

showCallout

  • showCallout(marker: any, content: any, opts?: any): void
  • Presents a callout bubble on the map from the specified target. The target can either be an Coordinate object or a native marker object for the mapping strategy.

    memberof

    MapStrategy

    Parameters

    • marker: any
    • content: any
    • Optional opts: any

    Returns void

showShape

  • showShape(shape: any): void
  • Parameters

    • shape: any

    Returns void

showShapes

  • showShapes(shapes: any[]): void
  • Parameters

    • shapes: any[]

    Returns void

tileLayer

  • tileLayer(layer: string, date: Date, opts?: any): TileSource
  • Parameters

    • layer: string
    • date: Date
    • Optional opts: any

    Returns TileSource

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

updateMarker

  • updateMarker(marker: any, options: MarkerOptions, layer?: string): void
  • Updates an existing marker using the specified options. The provided marker must already exist on the map view and must be an instance type required by the current mapping strategy.

    Parameters

    • marker: any
    • options: MarkerOptions
    • Default value layer: string = null

    Returns void

Generated using TypeDoc