public class

MapEventListener

extends Object
java.lang.Object
   ↳ com.carto.ui.MapEventListener

Class Overview

Listener for events like map clicks etc.

Summary

Public Constructors
MapEventListener()
Public Methods
synchronized void delete()
void onMapClicked(MapClickInfo mapClickInfo)
Listener method that gets called when a click is performed on an empty area of the map.
void onMapIdle()
Listener method that gets called at the end of the rendering process when the
map view needs no further refreshing.
void onMapInteraction(MapInteractionInfo mapInteractionInfo)
Listener method that gets called when user has interacted with the map.
void onMapMoved()
Listener method that gets called when the map is panned, rotated, tilted or zoomed.
void onMapStable()
Listener method that gets called when map is in 'stable' state - map animations have finished,
user has lifted fingers from the screen.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public MapEventListener ()

Public Methods

public synchronized void delete ()

public void onMapClicked (MapClickInfo mapClickInfo)

Listener method that gets called when a click is performed on an empty area of the map.
This method will NOT be called from the main thread.

Parameters
mapClickInfo A container that provides information about the click.

public void onMapIdle ()

Listener method that gets called at the end of the rendering process when the
map view needs no further refreshing.
Note that there can still be background processes (tile loading) that may change
the map view but these may take long time.
This method is called from GL renderer thread, not from main thread.

public void onMapInteraction (MapInteractionInfo mapInteractionInfo)

Listener method that gets called when user has interacted with the map. The callback
includes info about interaction type (panning, zooming, etc).

Parameters
mapInteractionInfo A container that provides information about the interaction.

public void onMapMoved ()

Listener method that gets called when the map is panned, rotated, tilted or zoomed.
The callback is used for both UI events and map changes resulting from API calls.
It is recommended to use onMapInteraction callback instead of onMapMoved, if possible.
Doing any calls to update MapView state from this method is potentially dangerous and may
result in deadlocks or crashes.
The thread this method is called from may vary.

public void onMapStable ()

Listener method that gets called when map is in 'stable' state - map animations have finished,
user has lifted fingers from the screen. This method is similar to onMapIdle, but is called less
frequently and takes account touch state.
The thread this method is called from may vary.