Class: CurrentMap

ol.interaction. CurrentMap

An interaction to check the current map and add key events listeners. It will fire a 'focus' event on the map when map is focused (use mapCondition option to handle the condition when the map is focused).


new CurrentMap(options, condition, onKeyDown, onKeyPress, onKeyUp)

Parameters:
Name Type Description
options *
condition function

a function that takes a mapBrowserEvent and returns true if the map must be activated, default always true

onKeyDown function

a function that takes a keydown event is fired on the active map

onKeyPress function

a function that takes a keypress event is fired on the active map

onKeyUp function

a function that takes a keyup event is fired on the active map

Fires:
  • event:focus

Extends

  • ol.interaction.Interaction

Members


_currentMap

The current map

Methods


getCurrentMap()

Get the current map

Returns:
Type
ol.Map

isCurrentMap()

Check if is the current map

Returns:
Type
boolean

setCurrentMap(map)

Set the current map

Parameters:
Name Type Description
map ol.Map