Home Reference Source
import {ArrowButtons} from 'guide4you/src/controls/ArrowButtons.js'
public class | source

ArrowButtons

Extends:

Control → ArrowButtons

ArrowButtons shows Buttons on the map which let you move in all 4 directions and a button to return to the initial position of the map. It provides an Interface class with an produceOlControl returning an {ol.control.Control} - Object. This can be added as normal controls to the map (e.g. map.addControl(arrowButtons.produceOlControl) ).

The Options are passed as an Object (e.g. { initCenter : map.getView().getCenter(), initZoom : map.getView().getZoom() }.

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public

labels_: *

public
Private Members
private
private
private
private

initExtent_: ol.Extent | undefined

private

vectors_: {left: number[], up: number[], right: number[], down: number[]}

Method Summary

Public Methods
public

setMap(map: G4UMap)

Private Methods
private

onClick_(direction: string)

This method is called when a button is clicked and makes a move on the map corresponding to the direction.

Public Constructors

public constructor(options: ArrowButtonOptions) source

Params:

NameTypeAttributeDescription
options ArrowButtonOptions
  • optional
  • default: {}

Public Members

public labels_: * source

public pixelDelta_: * source

Private Members

private animated_: boolean source

private animationDuration_: number source

private directions_: string[] source

private initExtent_: ol.Extent | undefined source

private vectors_: {left: number[], up: number[], right: number[], down: number[]} source

Public Methods

public setMap(map: G4UMap) source

Params:

NameTypeAttributeDescription
map G4UMap

Private Methods

private onClick_(direction: string) source

This method is called when a button is clicked and makes a move on the map corresponding to the direction.

Params:

NameTypeAttributeDescription
direction string