Home Reference Source Repository
import MapMoveCls from 'webmapsjs/src/olHelpers/mapMoveCls.js'
public class | source

MapMoveCls

Extends:

MapInteractionBase → MapMoveCls

assists with map move interactions, trigger callback functions

Constructor Summary

Public Constructor
public

constructor called implicitly

Member Summary

Public Members
public get

return the map extent

Method Summary

Public Methods
public

addCallback(func: mapMoveCallbackFunction, context: *, delay: number, triggerOnAdd: boolean, functionId: string)

add a callback to the map move event

public

addVectorLayer(lyr: LayerBaseVector | *, triggerOnAdd: boolean)

Add a layer to the interaction

public

init(theMap: ol.Map)

initialize the map move object

public

triggerLyrLoad(lyr: LayerBaseVector | *, index: number, eventType: string | *)

Trigger the layer load

public

triggerMoveCallback(ind: number, eventType: string | *, functionId: string)

trigger the map move call back at the given index

Inherited Summary

From class MapInteractionBase
public get

get if is initialized

public get

map: ol.Map: *

get reference to the ol map object

public

Check the initialization status and throw exception if not valid yet

public

init(theMap: ol.Map): boolean

base initializer, returns true for already initialized

protected

Check the initialization status and throw exception if not valid yet

Public Constructors

public constructor source

constructor called implicitly

Override:

MapInteractionBase#constructor

Public Members

public get mapExtent: * source

return the map extent

Public Methods

public addCallback(func: mapMoveCallbackFunction, context: *, delay: number, triggerOnAdd: boolean, functionId: string) source

add a callback to the map move event

Params:

NameTypeAttributeDescription
func mapMoveCallbackFunction

callback function

context *

the context to use for this function

delay number
  • optional
  • default: 50

the delay before call load

triggerOnAdd boolean
  • optional
  • default: true

if the layer should be loaded on add to mapMove

functionId string
  • optional
  • default: undefined

optional id to reference the function later for outside triggering

public addVectorLayer(lyr: LayerBaseVector | *, triggerOnAdd: boolean) source

Add a layer to the interaction

Params:

NameTypeAttributeDescription
lyr LayerBaseVector | *

layer to add

triggerOnAdd boolean
  • optional
  • default: true

if the layer should be loaded on add

public init(theMap: ol.Map) source

initialize the map move object

Override:

MapInteractionBase#init

Params:

NameTypeAttributeDescription
theMap ol.Map

the ol map

public triggerLyrLoad(lyr: LayerBaseVector | *, index: number, eventType: string | *) source

Trigger the layer load

Params:

NameTypeAttributeDescription
lyr LayerBaseVector | *

the layer being acted on

index number
  • optional
  • default: undefined

index of the layer

eventType string | *
  • optional
  • default: undefined

the event triggering the load, as 'change:center' or 'change:resolution'

public triggerMoveCallback(ind: number, eventType: string | *, functionId: string) source

trigger the map move call back at the given index

Params:

NameTypeAttributeDescription
ind number

the index of the layer

eventType string | *
  • optional
  • default: undefined

the event triggering the load as 'change:center' or 'change:resolution'

functionId string
  • optional
  • default: undefined

the function id used to reference the added callback function