public class MapView
extends GLMapSurfaceView
| Modifier and Type | Class and Description |
|---|---|
static class |
MapView.RasterMode
Raster Modes supported by the mapView API
|
static class |
MapView.RenderMode
The Enum for the rendering modes supported by mapView
|
static class |
MapView.TouchMode
The Enum defining the touch mode supported by mapView
|
| Constructor and Description |
|---|
MapView(android.content.Context context)
This is the class' default constructor.
|
MapView(android.content.Context context,
android.util.AttributeSet attrs)
This is the constructor used by the system when creating MapView from an XML layout file.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addAnnotation(Annotation annotation)
This method is used to add an annotation to the map view
|
OverlayId |
addOverLay(Overlay overlay)
This method is used to add an overlay to the map view.
|
float |
calculateZoom(ArrayList<Annotation> annotations,
Annotation centerAnno)
This method is used to calculate the zoom level at which to show the annotations.
|
void |
disableAllAnnotationLayers()
This method is used to disable all annotation layers at once.
|
void |
disableAnnotationLayer(Annotation.AnnotationLayer layer)
This method is used to disable an annotation layer.
|
void |
disableAnnotationLayers(ArrayList<Annotation.AnnotationLayer> layers)
This method is used to disable a list of specific annotation layers at once.
|
void |
enableAnnotationLayer(Annotation.AnnotationLayer layer)
This method is used to enable an annotation layer.
|
void |
enableAnnotationLayers(ArrayList<Annotation.AnnotationLayer> layers)
This method is used to enable a list of annotation layers.
|
void |
followVehicle(boolean follow)
This method is used to configure the camera to follow the vehicle moving.
|
android.location.Location |
getCameraLocation()
This method is used to get the camera location.
|
android.location.Location |
getLocationForScreenPoint(android.graphics.Point point)
This method is used to get information for the screen location
|
byte[] |
getSnapShot(int x,
int y,
int width,
int height)
This method is used to get a bitmap snapshot for the current map view window.
|
MapView.TouchMode |
getTouchMode()
This method is used to get the touch mode of the current map view.
|
boolean |
getUseMetricUnits()
This method is used to get the current configuration of the unit system.
|
float |
getZoomLevel()
This method is used to get the current zoom level as a float value.
|
void |
hideAnnotation(Annotation annotation)
This method is used to set the annotation status to invisible.
|
boolean |
isNightMode()
This method is used to get the current display mode.
|
void |
lookAt(ArrayList<Annotation> annotations)
This method is used to configure the camera to show the annotations on the screen.
|
void |
lookAt(double north,
double west,
double south,
double east)
This method is used to configure the map view camera to look at the boundary.
|
void |
lookAt(android.location.Location location)
This method is used to change the camera configuration.
|
void |
removeAllAnnotation()
This method is used to remove all annotations.
|
void |
removeAnnotation(Annotation annotation)
This method is used to remove the annotation from the map view
|
void |
removeOverLay(OverlayId ids)
This method is used to remove an overlay by the overlay Id.
|
void |
setDisplaySpeedTraps(boolean enable)
This method is used to turn on or off speed traps information.
|
void |
setDisplayTraffic(boolean enable)
This method is used to turn on or off the traffic information.
|
void |
setDisplayTrafficCameras(boolean enable)
This method is used to turn on or off traffic camera information.
|
void |
setDisplayTrafficIncidents(boolean enable)
This method is used to turn on or off the traffic incidents information.
|
void |
setDisplayVehicle(boolean enable)
This method is used to turn on or off vehicle visibility.
|
void |
setNightMode(boolean nightMode)
This method is used to configure the map view style to night mode or day mode.
|
void |
setRasterMode(MapView.RasterMode mode)
This method is used to configure the map raster mode.
|
void |
setRenderMode(MapView.RenderMode mode)
This method is used to change the render mode.
|
void |
setTouchMode(MapView.TouchMode mode)
This method is used to configure the touch mode of the map view.
|
void |
setUseMetricUnits(Boolean useMetric)
This method is used to change the configuration of the unit system.
|
void |
setVehicle2D(Annotation annotation)
This method is used to change the vehicle style in 2D mode.
|
void |
setVehicle3D(String modelName)
This method is used to configure the vehicle texture in 3D mode.
|
void |
setVehiclePosition(android.location.Location l)
This method is used to configure the vehicle location.
|
void |
setZoomLevel(float zoom,
boolean needTransition)
This method is used to configure the map view zoom level.
|
void |
showAnnotation(Annotation annotation)
This method is used to set the annotation status to visible.
|
void |
showCopyRight(int x,
int y,
int pixelWidth,
int pixelHeight)
This method is used to configure the copyright information location.
|
Annotation.AnnotationLayer |
unusedAnnotationLayer()
This method is used to get an unused annotation layer.
|
void |
updateAnnotationLocation(Annotation annotation)
This method is used to update annotation information.
|
public MapView(android.content.Context context)
context - the owner context; used to retrieve a resource from the contextpublic MapView(android.content.Context context,
android.util.AttributeSet attrs)
context - the owner context used to retrieve a resourceattrs - the XML attributes defined in the layout filepublic android.location.Location getCameraLocation()
public android.location.Location getLocationForScreenPoint(android.graphics.Point point)
point - the x,y offset on the map viewpublic void removeAnnotation(Annotation annotation)
annotation - the annotation you want removepublic void addAnnotation(Annotation annotation)
Note: If you want to remove it later, keep a reference of this annotation.
annotation - the annotation you want to addpublic void updateAnnotationLocation(Annotation annotation)
Note: if you want to change an attribute of the annotation, change the attribute first, and then call this method to update the information on the map view.
annotation - the annotation you want updatepublic void showAnnotation(Annotation annotation)
annotation - the annotation you want to show on the screenpublic void hideAnnotation(Annotation annotation)
annotation - the annotation you want to hide from the screenpublic void setNightMode(boolean nightMode)
nightMode - to use night mode or notpublic boolean isNightMode()
public void setRasterMode(MapView.RasterMode mode)
mode - a value of the RasterMode EnumMapView.RasterModepublic void lookAt(ArrayList<Annotation> annotations)
The camera will automatically zoom in or out to make all annotations available on the screen.
annotations - an array of annotations you want show
.public float calculateZoom(ArrayList<Annotation> annotations, Annotation centerAnno)
annotations - an array of annotation you want to be available on the screencenterAnno - the annotation you want display in the centerpublic void lookAt(android.location.Location location)
location - the location you want show in the center of the mappublic void lookAt(double north,
double west,
double south,
double east)
north - the most northwardwest - the most westwardsouth - the most southwardeast - the most eastwardpublic void setDisplayTraffic(boolean enable)
enable - boolean value, to enable traffic or notpublic void setDisplayTrafficIncidents(boolean enable)
enable - boolean value, to enable incidents information or notpublic void setDisplayTrafficCameras(boolean enable)
enable - boolean value, to enable traffic camera information or notpublic void setDisplaySpeedTraps(boolean enable)
enable - boolean value, to enable speed traps information or notpublic void setDisplayVehicle(boolean enable)
enable - to show vehicle icon or notpublic void followVehicle(boolean follow)
follow - boolean value, to follow the vehicle or notpublic void setVehicle2D(Annotation annotation)
annotation - using the configuration of the annotation to show the vehiclepublic void setVehicle3D(String modelName)
modelName - the name of the 3D model file. That file must be placed in the correct path.
For the path information, see the Developer Documentation.public void setVehiclePosition(android.location.Location l)
l - the location at which you want to place the vehiclepublic void setRenderMode(MapView.RenderMode mode)
mode - one of the RenderMode Enum valuespublic OverlayId addOverLay(Overlay overlay)
overlay - the overlay you want to add to the map view.
Note: Before adding an overlay, you mush configure it.
public void removeAllAnnotation()
public void removeOverLay(OverlayId ids)
ids - the id of the overlay you want to removepublic byte[] getSnapShot(int x,
int y,
int width,
int height)
x - the origin x of the windowy - the origin y of the windowwidth - the width of the windowheight - the height of the windowpublic void setTouchMode(MapView.TouchMode mode)
mode - a value of the TouchMode Enumpublic final MapView.TouchMode getTouchMode()
public void setUseMetricUnits(Boolean useMetric)
useMetric - boolean value, to use metric values or notpublic boolean getUseMetricUnits()
public float getZoomLevel()
public void setZoomLevel(float zoom,
boolean needTransition)
zoom - the zoom level you want to setneedTransition - boolean value, to use transition animation or notpublic void showCopyRight(int x,
int y,
int pixelWidth,
int pixelHeight)
x - original x locationy - original y locationpixelWidth - width of the copyright boxpixelHeight - height of the copyright boxpublic Annotation.AnnotationLayer unusedAnnotationLayer()
public void enableAnnotationLayer(Annotation.AnnotationLayer layer)
layer - the annotation layer to enablepublic void enableAnnotationLayers(ArrayList<Annotation.AnnotationLayer> layers)
layers - the list of annotation layers to enablepublic void disableAnnotationLayer(Annotation.AnnotationLayer layer)
layer - the annotation layer to disablepublic void disableAnnotationLayers(ArrayList<Annotation.AnnotationLayer> layers)
layers - the list of annotation layers to disablepublic void disableAllAnnotationLayers()