| Modifier and Type | Class and Description |
|---|---|
static interface |
Map.InputListener
Listener interface for input events.
|
static interface |
Map.UpdateListener
Listener interface for map update notifications.
|
| Modifier and Type | Field and Description |
|---|---|
static Event |
ANIM_END |
static Event |
ANIM_START |
static Event |
CLEAR_EVENT
UpdateListerner event.
|
EventDispatcher<Map.UpdateListener,MapPosition> |
events |
EventDispatcher<Map.InputListener,MotionEvent> |
input |
protected Animator |
mAnimator |
protected boolean |
mClearMap |
protected AbstractMapEventLayer |
mEventLayer |
protected MapPosition |
mMapPosition |
static Event |
MOVE_EVENT
UpdateListener event.
|
static Event |
POSITION_EVENT
UpdateListener event.
|
static Event |
ROTATE_EVENT
UpdateListener event.
|
static Event |
SCALE_EVENT
UpdateListener event.
|
static Event |
TILT_EVENT
UpdateListener event.
|
static Event |
UPDATE_EVENT
UpdateLister event.
|
| Constructor and Description |
|---|
Map() |
| Modifier and Type | Method and Description |
|---|---|
void |
addTask(java.lang.Runnable task)
Post a task to run on a shared worker-thread.
|
Animator |
animator() |
abstract void |
beginFrame()
Called on render thread, use synchronized!
|
void |
clearMap()
Request to clear all layers before rendering next frame
|
void |
destroy() |
abstract void |
doneFrame(boolean needsRedraw)
Called on render thread, use synchronized!
|
BoundingBox |
getBoundingBox(int expand) |
AbstractMapEventLayer |
getEventLayer() |
abstract int |
getHeight()
Return screen height in pixel.
|
MapPosition |
getMapPosition()
Get current
MapPosition. |
boolean |
getMapPosition(boolean animationEnd,
MapPosition mapPosition)
Get current
MapPosition or at possible animation end. |
boolean |
getMapPosition(MapPosition mapPosition)
Get current
MapPosition. |
abstract int |
getWidth()
Return screen width in pixel.
|
boolean |
handleGesture(Gesture g,
MotionEvent e) |
Layers |
layers() |
abstract boolean |
post(java.lang.Runnable action)
Post a runnable to be executed on main-thread
|
abstract boolean |
postDelayed(java.lang.Runnable action,
long delay)
Post a runnable to be executed on main-thread.
|
protected void |
prepareFrame()
This function is run on main-thread before rendering a frame.
|
abstract void |
render()
Request to render a frame.
|
TileLayer |
setBaseMap(TileLayer tileLayer) |
VectorTileLayer |
setBaseMap(TileSource tileSource)
Create OsmTileLayer with given TileSource and
set as base map (layer 1)
|
void |
setMapPosition(double latitude,
double longitude,
double scale) |
void |
setMapPosition(MapPosition mapPosition)
Set
MapPosition of Viewport and trigger a redraw. |
void |
setTheme(IRenderTheme theme) |
void |
setTheme(IRenderTheme theme,
boolean allLayers) |
void |
setTheme(ThemeFile theme)
Utility function to set theme of base vector-layer and
use map background color from theme.
|
void |
setTheme(ThemeFile theme,
boolean allLayers)
Utility function to set theme of base vector-layer, optionally
to all vector layers and use map background color from theme.
|
abstract void |
updateMap(boolean redraw)
Request call to onUpdate for all layers.
|
ViewController |
viewport() |
public static final Event POSITION_EVENT
public static final Event MOVE_EVENT
public static final Event SCALE_EVENT
public static final Event ROTATE_EVENT
public static final Event TILT_EVENT
public static final Event UPDATE_EVENT
public static final Event CLEAR_EVENT
public static final Event ANIM_END
public static final Event ANIM_START
public final EventDispatcher<Map.InputListener,MotionEvent> input
public final EventDispatcher<Map.UpdateListener,MapPosition> events
protected final Animator mAnimator
protected final MapPosition mMapPosition
protected final AbstractMapEventLayer mEventLayer
protected boolean mClearMap
public AbstractMapEventLayer getEventLayer()
public VectorTileLayer setBaseMap(TileSource tileSource)
TODO deprecate
public void setTheme(ThemeFile theme)
public void setTheme(ThemeFile theme, boolean allLayers)
public void setTheme(IRenderTheme theme)
public void setTheme(IRenderTheme theme, boolean allLayers)
public void destroy()
public abstract void updateMap(boolean redraw)
redraw - pass true to render next frame afterwardspublic abstract void render()
public abstract boolean post(java.lang.Runnable action)
public abstract boolean postDelayed(java.lang.Runnable action,
long delay)
public void addTask(java.lang.Runnable task)
public abstract int getWidth()
public abstract int getHeight()
public void clearMap()
public void setMapPosition(MapPosition mapPosition)
MapPosition of Viewport and trigger a redraw.public void setMapPosition(double latitude,
double longitude,
double scale)
public boolean getMapPosition(boolean animationEnd,
MapPosition mapPosition)
MapPosition or at possible animation end.animationEnd - map position at animation end (valid with Animator.animateTo methods)mapPosition - reuse MapPosition instancepublic boolean getMapPosition(MapPosition mapPosition)
MapPosition.public MapPosition getMapPosition()
MapPosition. Consider using
getViewport.getMapPosition(pos) instead to reuse
MapPosition instance.public BoundingBox getBoundingBox(int expand)
public ViewController viewport()
public Layers layers()
public Animator animator()
protected void prepareFrame()
For internal use only. Do not call!
public boolean handleGesture(Gesture g, MotionEvent e)
public abstract void beginFrame()
public abstract void doneFrame(boolean needsRedraw)