public class MapView
extends AtakMapView
Responsible for dispatched MapEvent
s:
MapEvent.MAP_MOVED
when the position, zoom, or focus
changesModifier and Type | Class and Description |
---|---|
static class |
MapView.RenderStack |
Modifier and Type | Field and Description |
---|---|
static MapView |
_mapView |
static java.lang.String |
GDAL_DIRNAME |
Constructor and Description |
---|
MapView(android.content.Context context,
android.util.AttributeSet attrs)
Create the view in a given context and attributes
|
Modifier and Type | Method and Description |
---|---|
void |
addLayer(MapView.RenderStack stack,
int position,
Layer layer) |
void |
addLayer(MapView.RenderStack stack,
Layer layer) |
void |
addOnGenericMotionListener(android.view.View.OnGenericMotionListener l)
Adds the specified
View.OnGenericMotionListener |
void |
addOnKeyListener(android.view.View.OnKeyListener l)
Adds the specified
View.OnKeyListener |
void |
addOnTouchListener(android.view.View.OnTouchListener l)
Adds the specified
View.OnTouchListener . |
void |
addOnTouchListenerAt(int index,
android.view.View.OnTouchListener l)
Adds the specified
View.OnTouchListener at the specified index. |
GeoBounds |
createHitbox(GeoPoint center,
double radius)
Deprecated.
No longer efficient with perspective camera rendering
Utilize screen point data from the GL thread where possible
|
void |
destroy() |
boolean |
dispatchKeyEvent(android.view.KeyEvent event) |
void |
executeOnActive(java.lang.Runnable task)
Run a task only if/when the map activity is active
For more info see
MapActivity.executeOnActive(Runnable) |
GeoPointMetaData |
getCenterPoint() |
java.lang.Object |
getComponentExtra(java.lang.String name)
Get arbitrary data set by a
MapComponent . |
java.lang.String |
getDeviceCallsign()
Retreives the device callsign.
|
static java.lang.String |
getDeviceUid()
Returns the device uid which is exactly the same as the self markers uid.
|
double |
getFramerate()
Returns the current calculated framerate of the app.
|
android.os.Bundle |
getGPUInfo()
Returns a bundle with some basic GPU information.
|
GLAntiMeridianHelper |
getIDLHelper() |
java.util.List<Layer> |
getLayers(MapView.RenderStack stack) |
MapData |
getMapData()
Obtain data associated with the map that is not defined by
any other MapView getters and setters.
|
MapEventDispatcher |
getMapEventDispatcher() |
MapItem |
getMapItem(java.lang.String uid)
Return the MapItem if contained on the MapView provided a UID.
|
MapOverlayManager |
getMapOverlayManager() |
MapTouchController |
getMapTouchController()
Get the object that controls the map based on touch gestures
|
static MapView |
getMapView()
Obtain the MapView.
|
double |
getMaxMapTilt()
Returns the maximum allowed tilt level for the system.
|
double |
getMaxMapTilt(double mapScale)
Returns the maximum allowed tilt level for the system at a specific map scale.
|
double |
getMinMapTilt()
At any given zoom level, there may be a point in which there is a minimal tilt
level.
|
double |
getMinMapTilt(double mapScale)
At any given zoom level, there may be a point in which there is a minimal tilt
level.
|
GeoPointMetaData |
getPointWithElevation()
Obtains the centerpoint of the MapView with the associated Elevation.
|
GeoPointMetaData |
getPrecisePoint(GeoPointMetaData geoPoint)
Deprecated.
Will be removed without replacement
|
RasterLayer2 |
getRasterLayerAt2(GeoPoint point) |
RootMapGroup |
getRootGroup()
Get the root MapGroup
|
Marker |
getSelfMarker()
Obtain the self marker for the system.
|
protected void |
initGLSurface() |
GeoPointMetaData |
inverseWithElevation(float x,
float y)
Deprecated.
See
MapRenderer2#inverse(PointD, GeoPoint, MapRenderer2.InverseMode, int, MapRenderer2.DisplayOrigin)
and ElevationManager#getElevation(double, double, ElevationManager.QueryParameters, GeoPointMetaData) |
boolean |
isAutoSelectProjection()
Return the state of the map if auto selection of the projection
is enabled.
|
boolean |
isPortrait() |
boolean |
onGenericMotionEvent(android.view.MotionEvent event) |
protected void |
onMapMoved() |
protected void |
onSizeChanged(int w,
int h,
int oldw,
int oldh) |
void |
popStack(MapView.RenderStack stack) |
void |
postOnActive(java.lang.Runnable task)
Post a task only if/when the map activity is active
For more info see
MapActivity.postOnActive(Runnable) |
void |
pushStack(MapView.RenderStack stack) |
protected void |
registerServiceProviders() |
void |
removeLayer(MapView.RenderStack stack,
Layer layer) |
void |
removeOnGenericMotionListener(android.view.View.OnGenericMotionListener l)
Removes the specified
View.OnGenericMotionListener |
void |
removeOnKeyListener(android.view.View.OnKeyListener l)
Removes the specified
View.OnKeyListener |
boolean |
removeOnTouchListener(android.view.View.OnTouchListener l)
Removes the specified
View.OnTouchListener . |
void |
setAutoSelectProjection(boolean auto) |
void |
setComponentExtra(java.lang.String name,
java.lang.Object extra)
Set arbitrary data from a
MapComponent . |
void |
setDeviceCallsign(java.lang.String callsign)
Used to set the transient value of the device callsign and does not effect the
default user callsign between system restarts.
|
boolean |
setProjection(Projection proj) |
void |
setRelativeScaling(float s) |
void |
setSelfMarker(Marker m)
Method called by LocationMapComponent to register the self marker with the rest of the
system.
|
void |
updateView(double latitude,
double longitude,
double scale,
double rotation,
double tilt,
boolean animate) |
public static MapView _mapView
public static final java.lang.String GDAL_DIRNAME
public MapView(android.content.Context context, android.util.AttributeSet attrs)
context
- the contextattrs
- the attributespublic static MapView getMapView()
public void destroy()
protected void registerServiceProviders()
protected void initGLSurface()
public double getFramerate()
public android.os.Bundle getGPUInfo()
public void setRelativeScaling(float s)
public MapTouchController getMapTouchController()
public void addOnTouchListener(android.view.View.OnTouchListener l)
View.OnTouchListener
.l
- The View.OnTouchListener
to addpublic void addOnTouchListenerAt(int index, android.view.View.OnTouchListener l)
View.OnTouchListener
at the specified index.
The specified listener may intercept touch events prior to all other
registered listeners by specifying an index of 0
.index
- The indexl
- The View.OnTouchListener
to addpublic boolean removeOnTouchListener(android.view.View.OnTouchListener l)
View.OnTouchListener
.l
- The View.OnTouchListener
to addpublic void addOnKeyListener(android.view.View.OnKeyListener l)
View.OnKeyListener
l
- The View.OnKeyListener
to addpublic void removeOnKeyListener(android.view.View.OnKeyListener l)
View.OnKeyListener
l
- The View.OnKeyListener
to removepublic void addOnGenericMotionListener(android.view.View.OnGenericMotionListener l)
View.OnGenericMotionListener
l
- The View.OnGenericMotionListener
to addpublic void removeOnGenericMotionListener(android.view.View.OnGenericMotionListener l)
View.OnGenericMotionListener
l
- The View.OnGenericMotionListener
to removepublic final boolean dispatchKeyEvent(android.view.KeyEvent event)
public final boolean onGenericMotionEvent(android.view.MotionEvent event)
protected void onMapMoved()
public MapEventDispatcher getMapEventDispatcher()
public MapOverlayManager getMapOverlayManager()
public RootMapGroup getRootGroup()
public MapItem getMapItem(java.lang.String uid)
public void addLayer(MapView.RenderStack stack, Layer layer)
public void addLayer(MapView.RenderStack stack, int position, Layer layer)
public void removeLayer(MapView.RenderStack stack, Layer layer)
public void pushStack(MapView.RenderStack stack)
public void popStack(MapView.RenderStack stack)
public java.util.List<Layer> getLayers(MapView.RenderStack stack)
@Deprecated public GeoPointMetaData getPrecisePoint(GeoPointMetaData geoPoint)
geoPoint
- A coordinatepublic RasterLayer2 getRasterLayerAt2(GeoPoint point)
public java.lang.String getDeviceCallsign()
public static java.lang.String getDeviceUid()
public void setDeviceCallsign(java.lang.String callsign)
callsign
- the transient state of the device callsign which does not persist.public void setComponentExtra(java.lang.String name, java.lang.Object extra)
MapComponent
. This makes the
data available to other MapComponent
s. This is useful for loosely coupling
MapComponents
.name
- a unique name for the extra data Objectextra
- the extra data Objectpublic java.lang.Object getComponentExtra(java.lang.String name)
MapComponent
. This allows for
dynamic coupling of MapComponent
s.name
- the unique name of the extra Objectpublic MapData getMapData()
public boolean isAutoSelectProjection()
public void setAutoSelectProjection(boolean auto)
@Deprecated public GeoPointMetaData inverseWithElevation(float x, float y)
MapRenderer2#inverse(PointD, GeoPoint, MapRenderer2.InverseMode, int, MapRenderer2.DisplayOrigin)
and ElevationManager#getElevation(double, double, ElevationManager.QueryParameters, GeoPointMetaData)
x
- the x value for the screen coordinatey
- the y value for the screen coordinatepublic void setSelfMarker(Marker m)
m
- the self marker.public Marker getSelfMarker()
public GLAntiMeridianHelper getIDLHelper()
public GeoPointMetaData getPointWithElevation()
public GeoPointMetaData getCenterPoint()
@Deprecated public GeoBounds createHitbox(GeoPoint center, double radius)
center
- Center point of hit boxradius
- Inner radius of hit box in pixelsprotected void onSizeChanged(int w, int h, int oldw, int oldh)
public boolean isPortrait()
public void executeOnActive(java.lang.Runnable task)
MapActivity.executeOnActive(Runnable)
task
- Task to runpublic void postOnActive(java.lang.Runnable task)
MapActivity.postOnActive(Runnable)
task
- Task to run if the activity is active (ie onStart has been called).public double getMinMapTilt()
public double getMinMapTilt(double mapScale)
mapScale
- for which to return the value for the mininum map tilt level.public double getMaxMapTilt()
public double getMaxMapTilt(double mapScale)
public void updateView(double latitude, double longitude, double scale, double rotation, double tilt, boolean animate)
public boolean setProjection(Projection proj)