The Mapbox Android SDK 1.x.x tree has been deprecated

Mapbox Android SDK 1.x.x is no longer maintained. Instead, we recommend our Mapbox GL-based Android SDK 2.0.0+ for vector-based maps.

Mapbox Android SDK 0.7.0

ILatLng

All Known Implementing Classes:
LatLng
public interface ILatLng
A Latitude, Longitude point.

Method Summary

Methods 
Modifier and Type Method and Description
double getAltitude() 
double getLatitude() 
double getLongitude() 

Method Detail

getLatitude

double getLatitude()

getLongitude

double getLongitude()

getAltitude

double getAltitude()

GeoConstants

All Known Implementing Classes:
Projection
public interface GeoConstants

Field Summary

Fields 
Modifier and Type Field and Description
static double MAX_LATITUDE 
static double MAX_LONGITUDE 
static double MIN_LATITUDE 
static double MIN_LONGITUDE 
static int RADIUS_EARTH_METERS 

Field Detail

RADIUS_EARTH_METERS

static final int RADIUS_EARTH_METERS
See Also:
Constant Field Values

MIN_LATITUDE

static final double MIN_LATITUDE
See Also:
Constant Field Values

MAX_LATITUDE

static final double MAX_LATITUDE
See Also:
Constant Field Values

MIN_LONGITUDE

static final double MIN_LONGITUDE
See Also:
Constant Field Values

MAX_LONGITUDE

static final double MAX_LONGITUDE
See Also:
Constant Field Values

MapboxConstants

All Known Implementing Classes:
WebSourceTileLayer
public interface MapboxConstants
Storing certain attributes of the Mapbox online service as constants to centralize references.

Nested Class Summary

Nested Classes 
Modifier and Type Interface and Description
static class  MapboxConstants.RasterImageQuality 

Field Summary

Fields 
Modifier and Type Field and Description
static java.lang.String MAPBOX_BASE_URL_V4
The default base endpoint of Mapbox services.
static java.util.Locale MAPBOX_LOCALE 
static java.lang.String USER_AGENT 

Field Detail

MAPBOX_BASE_URL_V4

static final java.lang.String MAPBOX_BASE_URL_V4
The default base endpoint of Mapbox services.
See Also:
Constant Field Values

USER_AGENT

static final java.lang.String USER_AGENT
See Also:
Constant Field Values

MAPBOX_LOCALE

static final java.util.Locale MAPBOX_LOCALE

MapboxConstants.RasterImageQuality

java.lang.Object java.lang.Enum<MapboxConstants.RasterImageQuality> com.mapbox.mapboxsdk.constants.MapboxConstants.RasterImageQuality
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<MapboxConstants.RasterImageQuality>
Enclosing interface:
MapboxConstants
public static enum MapboxConstants.RasterImageQuality
extends java.lang.Enum<MapboxConstants.RasterImageQuality>

Enum Constant Summary

Enum Constants 
Enum Constant and Description
MBXRasterImageQualityFull
Full image quality.
MBXRasterImageQualityJPEG70
70% quality JPEG.
MBXRasterImageQualityJPEG80
80% quality JPEG.
MBXRasterImageQualityJPEG90
90% quality JPEG.
MBXRasterImageQualityPNG128
128 color indexed PNG.
MBXRasterImageQualityPNG256
256 color indexed PNG.
MBXRasterImageQualityPNG32
32 color indexed PNG.
MBXRasterImageQualityPNG64
64 color indexed PNG.

Method Summary

Methods 
Modifier and Type Method and Description
static MapboxConstants.RasterImageQuality getEnumForValue(int value) 
int getValue() 
static MapboxConstants.RasterImageQuality valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
static MapboxConstants.RasterImageQuality[] values()
Returns an array containing the constants of this enum type, in the order they are declared.

Methods inherited from class java.lang.Enum

clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf

Methods inherited from class java.lang.Object

getClass, notify, notifyAll, wait, wait, wait

Enum Constant Detail

MBXRasterImageQualityFull

public static final MapboxConstants.RasterImageQuality MBXRasterImageQualityFull
Full image quality.

MBXRasterImageQualityPNG32

public static final MapboxConstants.RasterImageQuality MBXRasterImageQualityPNG32
32 color indexed PNG.

MBXRasterImageQualityPNG64

public static final MapboxConstants.RasterImageQuality MBXRasterImageQualityPNG64
64 color indexed PNG.

MBXRasterImageQualityPNG128

public static final MapboxConstants.RasterImageQuality MBXRasterImageQualityPNG128
128 color indexed PNG.

MBXRasterImageQualityPNG256

public static final MapboxConstants.RasterImageQuality MBXRasterImageQualityPNG256
256 color indexed PNG.

MBXRasterImageQualityJPEG70

public static final MapboxConstants.RasterImageQuality MBXRasterImageQualityJPEG70
70% quality JPEG.

MBXRasterImageQualityJPEG80

public static final MapboxConstants.RasterImageQuality MBXRasterImageQualityJPEG80
80% quality JPEG.

MBXRasterImageQualityJPEG90

public static final MapboxConstants.RasterImageQuality MBXRasterImageQualityJPEG90
90% quality JPEG.

Method Detail

values

public static MapboxConstants.RasterImageQuality[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (MapboxConstants.RasterImageQuality c : MapboxConstants.RasterImageQuality.values())
    System.out.println(c);
Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static MapboxConstants.RasterImageQuality valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

getValue

public int getValue()

getEnumForValue

public static MapboxConstants.RasterImageQuality getEnumForValue(int value)

MathConstants

All Known Implementing Classes:
LatLng
public interface MathConstants

Field Summary

Fields 
Modifier and Type Field and Description
static float DEG2RAD 
static float PI 
static float RAD2DEG 

Field Detail

DEG2RAD

static final float DEG2RAD
See Also:
Constant Field Values

RAD2DEG

static final float RAD2DEG
See Also:
Constant Field Values

PI

static final float PI
See Also:
Constant Field Values

DelayedMapListener

java.lang.Object com.mapbox.mapboxsdk.events.DelayedMapListener
All Implemented Interfaces:
MapListener
public class DelayedMapListener
extends java.lang.Object
implements MapListener
A MapListener that aggregates multiple events called in quick succession. After an event arrives, if another event arrives within delay milliseconds, the original event is discarded. Otherwise, the event is propagated to the wrapped MapListener. Note: This class is not thread-safe.]

Field Summary

Fields 
Modifier and Type Field and Description
protected com.mapbox.mapboxsdk.events.DelayedMapListener.CallbackTask callback 
protected static int DEFAULT_DELAY
Default listening delay
protected long delay
Listening delay, in milliseconds
protected android.os.Handler handler 

Constructor Summary

Constructors 
Constructor and Description
MapListener aWrappedListener)
Constructor with default delay.
MapListener aWrappedListener, long aDelay) 

Method Summary

Methods 
Modifier and Type Method and Description
protected void MapEvent event) 
void RotateEvent event)
Called when a map is rotated.
void ScrollEvent event)
Called when a map is scrolled.
void ZoomEvent event)
Called when a map is zoomed.

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

DEFAULT_DELAY

protected static final int DEFAULT_DELAY
Default listening delay
See Also:
Constant Field Values

delay

protected long delay
Listening delay, in milliseconds

handler

protected android.os.Handler handler

callback

protected com.mapbox.mapboxsdk.events.DelayedMapListener.CallbackTask callback

Constructor Detail

DelayedMapListener

public DelayedMapListener(MapListener aWrappedListener,
                  long aDelay)
Parameters:
aWrappedListener - The wrapped MapListener
aDelay - Listening delay, in milliseconds

DelayedMapListener

public DelayedMapListener(MapListener aWrappedListener)
Constructor with default delay.
Parameters:
aWrappedListener - The wrapped MapListener

Method Detail

onScroll

public void onScroll(ScrollEvent event)
Description copied from interface: MapListener
Called when a map is scrolled.
Specified by:
MapListener

onZoom

public void onZoom(ZoomEvent event)
Description copied from interface: MapListener
Called when a map is zoomed.
Specified by:
MapListener

onRotate

public void onRotate(RotateEvent event)
Description copied from interface: MapListener
Called when a map is rotated.
Specified by:
MapListener

dispatch

protected void dispatch(MapEvent event)

MapEvent

All Known Implementing Classes:
ZoomEvent
public interface MapEvent
Tagging interface for map events

MapListener

All Known Implementing Classes:
UserLocationOverlay
public interface MapListener
The listener interface for receiving map movement events. To process a map event, either implement this interface or extend MapAdapter, then register with the MapView using setMapListener.

Method Summary

Methods 
Modifier and Type Method and Description
void RotateEvent event)
Called when a map is rotated.
void ScrollEvent event)
Called when a map is scrolled.
void ZoomEvent event)
Called when a map is zoomed.

Method Detail

onScroll

void onScroll(ScrollEvent event)
Called when a map is scrolled.

onZoom

void onZoom(ZoomEvent event)
Called when a map is zoomed.

onRotate

void onRotate(RotateEvent event)
Called when a map is rotated.

RotateEvent

java.lang.Object com.mapbox.mapboxsdk.events.RotateEvent
All Implemented Interfaces:
MapEvent
public class RotateEvent
extends java.lang.Object
implements MapEvent
The event generated when a map has finished rotating

Field Summary

Fields 
Modifier and Type Field and Description
protected float angle 
protected MapView source 
protected boolean userAction 

Constructor Summary

Constructors 
Constructor and Description
MapView aSource, float aAngle, boolean userAction) 

Method Summary

Methods 
Modifier and Type Method and Description
float getAngle()
Return the map angle.
MapView getSource()
Return the map which generated this event.
boolean getUserAction() 
java.lang.String toString() 

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail

source

protected MapView source

angle

protected float angle

userAction

protected boolean userAction

Constructor Detail

RotateEvent

public RotateEvent(MapView aSource,
           float aAngle,
           boolean userAction)

Method Detail

getSource

public MapView getSource()
Return the map which generated this event.

getAngle

public float getAngle()
Return the map angle.

getUserAction

public boolean getUserAction()
Returns:
true if it was a user action (touch action).

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

ScrollEvent

java.lang.Object com.mapbox.mapboxsdk.events.ScrollEvent
All Implemented Interfaces:
MapEvent
public class ScrollEvent
extends java.lang.Object
implements MapEvent
The event generated when a map has finished scrolling to the coordinates (x,y).

Field Summary

Fields 
Modifier and Type Field and Description
protected MapView source 
protected boolean userAction 
protected int x 
protected int y 

Constructor Summary

Constructors 
Constructor and Description
MapView aSource, int ax, int ay, boolean userAction) 

Method Summary

Methods 
Modifier and Type Method and Description
MapView getSource()
Return the map which generated this event.
boolean getUserAction() 
int getX()
Return the x-coordinate scrolled to.
int getY()
Return the y-coordinate scrolled to.
java.lang.String toString() 

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail

source

protected MapView source

x

protected int x

y

protected int y

userAction

protected boolean userAction

Constructor Detail

ScrollEvent

public ScrollEvent(MapView aSource,
           int ax,
           int ay,
           boolean userAction)

Method Detail

getSource

public MapView getSource()
Return the map which generated this event.

getX

public int getX()
Return the x-coordinate scrolled to.

getY

public int getY()
Return the y-coordinate scrolled to.

getUserAction

public boolean getUserAction()
Returns:
true if it was a user action (touch action).

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

ZoomEvent

java.lang.Object com.mapbox.mapboxsdk.events.ZoomEvent
All Implemented Interfaces:
MapEvent
public class ZoomEvent
extends java.lang.Object
implements MapEvent
The event generated when a map has finished zooming to the level zoomLevel

Field Summary

Fields 
Modifier and Type Field and Description
protected MapView source 
protected boolean userAction 
protected float zoomLevel 

Constructor Summary

Constructors 
Constructor and Description
MapView aSource, float aZoomLevel, boolean userAction) 

Method Summary

Methods 
Modifier and Type Method and Description
MapView getSource()
Return the map which generated this event.
boolean getUserAction() 
float getZoomLevel()
Return the zoom level zoomed to.
java.lang.String toString() 

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail

source

protected MapView source

zoomLevel

protected float zoomLevel

userAction

protected boolean userAction

Constructor Detail

ZoomEvent

public ZoomEvent(MapView aSource,
         float aZoomLevel,
         boolean userAction)

Method Detail

getSource

public MapView getSource()
Return the map which generated this event.

getZoomLevel

public float getZoomLevel()
Return the zoom level zoomed to.

getUserAction

public boolean getUserAction()
Returns:
true if it was a user action (touch action).

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

MissingAttributeException

java.lang.Object java.lang.Throwable java.lang.Exception com.mapbox.mapboxsdk.exceptions.MissingAttributeException
All Implemented Interfaces:
java.io.Serializable
public class MissingAttributeException
extends java.lang.Exception
See Also:
Serialized Form

Constructor Summary

Constructors 
Constructor and Description
MissingAttributeException(java.lang.String detailMessage)
Default Constructor

Method Summary

Methods inherited from class java.lang.Throwable

addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

MissingAttributeException

public MissingAttributeException(java.lang.String detailMessage)
Default Constructor
Parameters:
detailMessage - Information on missing attribute

MissingTokenException

java.lang.Object java.lang.Throwable java.lang.Exception com.mapbox.mapboxsdk.exceptions.MissingTokenException
All Implemented Interfaces:
java.io.Serializable
public class MissingTokenException
extends java.lang.Exception
See Also:
Serialized Form

Constructor Summary

Constructors 
Constructor and Description
MissingTokenException()
Default Constructor

Method Summary

Methods inherited from class java.lang.Throwable

addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

MissingTokenException

public MissingTokenException()
Default Constructor

OfflineDatabaseException

java.lang.Object java.lang.Throwable java.lang.Exception com.mapbox.mapboxsdk.exceptions.OfflineDatabaseException
All Implemented Interfaces:
java.io.Serializable
public class OfflineDatabaseException
extends java.lang.Exception
See Also:
Serialized Form

Constructor Summary

Constructors 
Constructor and Description
OfflineDatabaseException(java.lang.String detailMessage) 

Method Summary

Methods inherited from class java.lang.Throwable

addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

OfflineDatabaseException

public OfflineDatabaseException(java.lang.String detailMessage)

BoundingBox

java.lang.Object com.mapbox.mapboxsdk.geometry.BoundingBox
All Implemented Interfaces:
android.os.Parcelable, MapViewConstants, java.io.Serializable
public final class BoundingBox
extends java.lang.Object
implements android.os.Parcelable, java.io.Serializable, MapViewConstants
A rectangular geographical area defined in latitude and longitude units.
See Also:
Serialized Form

Nested Class Summary

Nested classes/interfaces inherited from interface android.os.Parcelable

android.os.Parcelable.ClassLoaderCreator<T>, android.os.Parcelable.Creator<T>

Field Summary

Fields 
Modifier and Type Field and Description
static android.os.Parcelable.Creator<BoundingBox> CREATOR 

Fields inherited from interface android.os.Parcelable

CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE

Fields inherited from interface com.mapbox.mapboxsdk.views.util.constants.MapViewConstants

DEFAULT_PIN_ANCHOR

Constructor Summary

Constructors 
Constructor and Description
BoundingBox()
Create a new BoundingBox with no size centered at 0, 0, also known as null island
BoundingBox other)
Create a bounding box from another bounding box
BoundingBox(double north, double east, double south, double west)
Construct a new bounding box based on its corners, given in NESW order.
LatLng northEast, LatLng southWest)
Construct a new bounding box based on its corners, given in NESW order.

Method Summary

Methods 
Modifier and Type Method and Description
boolean ILatLng pGeoPoint)
Determines whether this bounding box contains a point and the point does not touch its boundary.
int describeContents() 
boolean BoundingBox other)
Determines whether this bounding box matches another one via coordinates.
static BoundingBox ILatLng> latLngs)
Constructs a bounding box that contains all of a list of LatLng objects.
LatLng getCenter()
Calculates the centerpoint of this bounding box by simple interpolation and returns it as a point.
double getLatitudeSpan()
Get the absolute distance, in degrees, between the north and south boundaries of this bounding box
double getLatNorth() 
double getLatSouth() 
double getLonEast() 
double getLongitudeSpan()
Get the absolute distance, in degrees, between the west and east boundaries of this bounding box
double getLonWest() 
int hashCode() 
BoundingBox BoundingBox box)
Returns a new BoundingBox that is the intersection of this with another box
BoundingBox intersect(double north, double east, double south, double west)
Returns a new BoundingBox that is the intersection of this with another box
boolean isValid() 
java.lang.String toString() 
BoundingBox BoundingBox box)
Returns a new BoundingBox that stretches to contain both this and another BoundingBox.
BoundingBox union(double pLatNorth, double pLonEast, double pLatSouth, double pLonWest)
Returns a new BoundingBox that stretches to include another bounding box, given by corner points.
void writeToParcel(android.os.Parcel out, int arg1) 

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait

Field Detail

CREATOR

public static final android.os.Parcelable.Creator<BoundingBox> CREATOR

Constructor Detail

BoundingBox

public BoundingBox(double north,
           double east,
           double south,
           double west)
Construct a new bounding box based on its corners, given in NESW order.
Parameters:
north - Northern Coordinate
east - Eastern Coordinate
south - Southern Coordinate
west - Western Coordinate

BoundingBox

public BoundingBox(LatLng northEast,
           LatLng southWest)
Construct a new bounding box based on its corners, given in NESW order.
Parameters:
northEast - Coordinate
southWest - Coordinate

BoundingBox

public BoundingBox(BoundingBox other)
Create a bounding box from another bounding box
Parameters:
other - the other bounding box

BoundingBox

public BoundingBox()
Create a new BoundingBox with no size centered at 0, 0, also known as null island

Method Detail

getCenter

public LatLng getCenter()
Calculates the centerpoint of this bounding box by simple interpolation and returns it as a point. This is a non-geodesic calculation which is not the geographic center.
Returns:
LatLng center of this BoundingBox

getLatNorth

public double getLatNorth()

getLatSouth

public double getLatSouth()

getLonEast

public double getLonEast()

getLonWest

public double getLonWest()

isValid

public boolean isValid()

getLatitudeSpan

public double getLatitudeSpan()
Get the absolute distance, in degrees, between the north and south boundaries of this bounding box
Returns:
Span distance

getLongitudeSpan

public double getLongitudeSpan()
Get the absolute distance, in degrees, between the west and east boundaries of this bounding box
Returns:
Span distance

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

fromLatLngs

public static ILatLng> latLngs)
Constructs a bounding box that contains all of a list of LatLng objects. Empty lists will yield invalid bounding boxes.
Parameters:
latLngs - List of LatLng objects
Returns:
BoundingBox

equals

public boolean equals(BoundingBox other)
Determines whether this bounding box matches another one via coordinates.
Parameters:
other - another bounding box
Returns:
a boolean indicating whether the bounding boxes are equal

contains

public boolean contains(ILatLng pGeoPoint)
Determines whether this bounding box contains a point and the point does not touch its boundary.
Parameters:
pGeoPoint - the point which may be contained
Returns:
true, if the point is contained within the box.

union

public BoundingBox box)
Returns a new BoundingBox that stretches to contain both this and another BoundingBox.
Parameters:
box - BoundingBox to add
Returns:
BoundingBox

union

public BoundingBox union(double pLatNorth,
                double pLonEast,
                double pLatSouth,
                double pLonWest)
Returns a new BoundingBox that stretches to include another bounding box, given by corner points.
Parameters:
pLatNorth - Northern Coordinate
pLonEast - Eastern Coordinate
pLatSouth - Southern Coordinate
pLonWest - Western Coordinate
Returns:
BoundingBox

intersect

public BoundingBox box)
Returns a new BoundingBox that is the intersection of this with another box
Parameters:
box - BoundingBox to intersect with
Returns:
BoundingBox

intersect

public BoundingBox intersect(double north,
                    double east,
                    double south,
                    double west)
Returns a new BoundingBox that is the intersection of this with another box
Parameters:
north - Northern Coordinate
east - Eastern Coordinate
south - Southern Coordinate
west - Western Coordinate
Returns:
BoundingBox

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

describeContents

public int describeContents()
Specified by:
describeContents in interface android.os.Parcelable

writeToParcel

public void writeToParcel(android.os.Parcel out,
                 int arg1)
Specified by:
writeToParcel in interface android.os.Parcelable

CoordinateRegion

java.lang.Object com.mapbox.mapboxsdk.geometry.CoordinateRegion
public class CoordinateRegion
extends java.lang.Object
Implementation of iOS MKCoordinateRegion

Constructor Summary

Constructors 
Constructor and Description
LatLng center, CoordinateSpan span) 

Method Summary

Methods 
Modifier and Type Method and Description
LatLng getCenter() 
CoordinateSpan getSpan() 
void LatLng center) 
void CoordinateSpan span) 

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

CoordinateRegion

public CoordinateRegion(LatLng center,
                CoordinateSpan span)

Method Detail

getCenter

public LatLng getCenter()

setCenter

public void setCenter(LatLng center)

getSpan

public CoordinateSpan getSpan()

setSpan

public void setSpan(CoordinateSpan span)

CoordinateSpan

java.lang.Object com.mapbox.mapboxsdk.geometry.CoordinateSpan
public final class CoordinateSpan
extends java.lang.Object
Implementation of iOS MKCoordinateSpan

Constructor Summary

Constructors 
Constructor and Description
CoordinateSpan(double latitudeSpan, double longitudeSpan) 

Method Summary

Methods 
Modifier and Type Method and Description
double getLatitudeSpan() 
double getLongitudeSpan() 
void setLatitudeSpan(double latitudeSpan) 
void setLongitudeSpan(double longitudeSpan) 

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

CoordinateSpan

public CoordinateSpan(double latitudeSpan,
              double longitudeSpan)

Method Detail

getLatitudeSpan

public double getLatitudeSpan()

setLatitudeSpan

public void setLatitudeSpan(double latitudeSpan)

getLongitudeSpan

public double getLongitudeSpan()

setLongitudeSpan

public void setLongitudeSpan(double longitudeSpan)

LatLng

java.lang.Object com.mapbox.mapboxsdk.geometry.LatLng
All Implemented Interfaces:
android.os.Parcelable, MathConstants, java.io.Serializable
public final class LatLng
extends java.lang.Object
implements MathConstants, android.os.Parcelable, java.io.Serializable
An immutable latitude, longitude, and optionally altitude point. Coordinates are stored as WGS84 degrees.
See Also:
Serialized Form

Nested Class Summary

Nested classes/interfaces inherited from interface android.os.Parcelable

android.os.Parcelable.ClassLoaderCreator<T>, android.os.Parcelable.Creator<T>

Field Summary

Fields 
Modifier and Type Field and Description
static android.os.Parcelable.Creator<LatLng> CREATOR 

Fields inherited from interface com.mapbox.mapboxsdk.constants.GeoConstants

RADIUS_EARTH_METERS

Fields inherited from interface com.mapbox.mapboxsdk.constants.MathConstants

RAD2DEG

Fields inherited from interface android.os.Parcelable

CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE

Constructor Summary

Constructors 
Constructor and Description
LatLng(double aLatitude, double aLongitude)
Construct a new latitude, longitude point given float arguments
LatLng(double aLatitude, double aLongitude, double aAltitude)
Construct a new latitude, longitude, altitude point given float arguments
LatLng aLatLng)
Clone an existing latitude longitude point
LatLng(android.location.Location aLocation)
Transform a Location into a LatLng point

Method Summary

Methods 
Modifier and Type Method and Description
int describeContents() 
int LatLng other)
Calculate distance between two points
boolean equals(java.lang.Object obj) 
double getAltitude()
Returns the altitude value of this point.
double getLatitude()
Returns the latitude value of this point
double getLongitude()
Returns the longitude value of this point
int hashCode() 
java.lang.String toString() 
void writeToParcel(android.os.Parcel out, int flags) 

Methods inherited from class java.lang.Object

clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Field Detail

CREATOR

public static final android.os.Parcelable.Creator<LatLng> CREATOR

Constructor Detail

LatLng

public LatLng(double aLatitude,
      double aLongitude)
Construct a new latitude, longitude point given float arguments
Parameters:
aLatitude -
aLongitude -

LatLng

public LatLng(double aLatitude,
      double aLongitude,
      double aAltitude)
Construct a new latitude, longitude, altitude point given float arguments
Parameters:
aLatitude -
aLongitude -
aAltitude -

LatLng

public LatLng(android.location.Location aLocation)
Transform a Location into a LatLng point
Parameters:
aLocation -

LatLng

public LatLng(LatLng aLatLng)
Clone an existing latitude longitude point
Parameters:
aLatLng -

Method Detail

getLongitude

public double getLongitude()
Returns the longitude value of this point
Specified by:
ILatLng
Returns:
the longitude value in decimal degrees

getLatitude

public double getLatitude()
Returns the latitude value of this point
Specified by:
ILatLng
Returns:
the latitude value in decimal degrees

getAltitude

public double getAltitude()
Returns the altitude value of this point. The encoding of altitude is unspecified.
Specified by:
ILatLng
Returns:
the altitude value

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

describeContents

public int describeContents()
Specified by:
describeContents in interface android.os.Parcelable

writeToParcel

public void writeToParcel(android.os.Parcel out,
                 int flags)
Specified by:
writeToParcel in interface android.os.Parcelable

distanceTo

public int distanceTo(LatLng other)
Calculate distance between two points
Parameters:
other - Other LatLng to compare to
Returns:
distance in meters

OfflineDatabaseHandler

java.lang.Object android.database.sqlite.SQLiteOpenHelper com.mapbox.mapboxsdk.offline.OfflineDatabaseHandler
public class OfflineDatabaseHandler
extends android.database.sqlite.SQLiteOpenHelper

Field Summary

Fields 
Modifier and Type Field and Description
static int DATABASE_VERSION 
static java.lang.String FIELD_DATA_ID 
static java.lang.String FIELD_DATA_VALUE 
static java.lang.String FIELD_METADATA_NAME 
static java.lang.String FIELD_METADATA_VALUE 
static java.lang.String FIELD_RESOURCES_ID 
static java.lang.String FIELD_RESOURCES_STATUS 
static java.lang.String FIELD_RESOURCES_URL 
static java.lang.String TABLE_DATA 
static java.lang.String TABLE_METADATA 
static java.lang.String TABLE_RESOURCES 

Constructor Summary

Constructors 
Constructor and Description
OfflineDatabaseHandler(android.content.Context context, java.lang.String dbName)
Constructor

Method Summary

Methods 
Modifier and Type Method and Description
void onCreate(android.database.sqlite.SQLiteDatabase db) 
void onUpgrade(android.database.sqlite.SQLiteDatabase db, int oldVersion, int newVersion) 

Methods inherited from class android.database.sqlite.SQLiteOpenHelper

close, getDatabaseName, getReadableDatabase, getWritableDatabase, onConfigure, onDowngrade, onOpen, setWriteAheadLoggingEnabled

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

DATABASE_VERSION

public static final int DATABASE_VERSION
See Also:
Constant Field Values

TABLE_METADATA

public static final java.lang.String TABLE_METADATA
See Also:
Constant Field Values

TABLE_DATA

public static final java.lang.String TABLE_DATA
See Also:
Constant Field Values

TABLE_RESOURCES

public static final java.lang.String TABLE_RESOURCES
See Also:
Constant Field Values

FIELD_METADATA_NAME

public static final java.lang.String FIELD_METADATA_NAME
See Also:
Constant Field Values

FIELD_METADATA_VALUE

public static final java.lang.String FIELD_METADATA_VALUE
See Also:
Constant Field Values

FIELD_DATA_ID

public static final java.lang.String FIELD_DATA_ID
See Also:
Constant Field Values

FIELD_DATA_VALUE

public static final java.lang.String FIELD_DATA_VALUE
See Also:
Constant Field Values

FIELD_RESOURCES_ID

public static final java.lang.String FIELD_RESOURCES_ID
See Also:
Constant Field Values

FIELD_RESOURCES_URL

public static final java.lang.String FIELD_RESOURCES_URL
See Also:
Constant Field Values

FIELD_RESOURCES_STATUS

public static final java.lang.String FIELD_RESOURCES_STATUS
See Also:
Constant Field Values

Constructor Detail

OfflineDatabaseHandler

public OfflineDatabaseHandler(android.content.Context context,
                      java.lang.String dbName)
Constructor
Parameters:
context - Context

Method Detail

onCreate

public void onCreate(android.database.sqlite.SQLiteDatabase db)
Specified by:
onCreate in class android.database.sqlite.SQLiteOpenHelper

onUpgrade

public void onUpgrade(android.database.sqlite.SQLiteDatabase db,
             int oldVersion,
             int newVersion)
Specified by:
onUpgrade in class android.database.sqlite.SQLiteOpenHelper

OfflineDatabaseManager

java.lang.Object com.mapbox.mapboxsdk.offline.OfflineDatabaseManager
public class OfflineDatabaseManager
extends java.lang.Object

Method Summary

Methods 
Modifier and Type Method and Description
OfflineDatabaseHandler getOfflineDatabaseHandlerForMapId(java.lang.String mapId) 
OfflineDatabaseHandler getOfflineDatabaseHandlerForMapId(java.lang.String mapId, boolean fromFileSystem) 
static OfflineDatabaseManager getOfflineDatabaseManager(android.content.Context ctx) 
boolean switchHandlerFromPartialToRegular(java.lang.String mapId) 

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Method Detail

getOfflineDatabaseManager

public static OfflineDatabaseManager getOfflineDatabaseManager(android.content.Context ctx)

getOfflineDatabaseHandlerForMapId

public OfflineDatabaseHandler getOfflineDatabaseHandlerForMapId(java.lang.String mapId)

getOfflineDatabaseHandlerForMapId

public OfflineDatabaseHandler getOfflineDatabaseHandlerForMapId(java.lang.String mapId,
                                                       boolean fromFileSystem)

switchHandlerFromPartialToRegular

public boolean switchHandlerFromPartialToRegular(java.lang.String mapId)

OfflineMapDatabase

java.lang.Object com.mapbox.mapboxsdk.offline.OfflineMapDatabase
All Implemented Interfaces:
MapboxConstants
public class OfflineMapDatabase
extends java.lang.Object
implements MapboxConstants

Nested Class Summary

Nested classes/interfaces inherited from interface com.mapbox.mapboxsdk.constants.MapboxConstants

MapboxConstants.RasterImageQuality

Field Summary

Fields inherited from interface com.mapbox.mapboxsdk.constants.MapboxConstants

USER_AGENT

Constructor Summary

Constructors 
Constructor and Description
OfflineMapDatabase(android.content.Context context)
Default Constructor
OfflineMapDatabase(android.content.Context context, java.lang.String mapID)
Constructor

Method Summary

Methods 
Modifier and Type Method and Description
byte[] dataForURL(java.lang.String url) 
MapboxConstants.RasterImageQuality getImageQuality() 
java.lang.String getMapID() 
java.lang.String getPath() 
java.lang.String getUniqueID() 
boolean initializeDatabase() 
void invalidate() 
byte[] sqliteDataForURL(java.lang.String url) 
java.lang.String sqliteMetadataForName(java.lang.String name) 

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

OfflineMapDatabase

public OfflineMapDatabase(android.content.Context context)
Default Constructor
Parameters:
context - Context of Android app

OfflineMapDatabase

public OfflineMapDatabase(android.content.Context context,
                  java.lang.String mapID)
Constructor
Parameters:
context - Context of Android app
mapID - MapId

Method Detail

getUniqueID

public java.lang.String getUniqueID()

getMapID

public java.lang.String getMapID()

getPath

public java.lang.String getPath()

getImageQuality

public MapboxConstants.RasterImageQuality getImageQuality()

initializeDatabase

public boolean initializeDatabase()

dataForURL

public byte[] dataForURL(java.lang.String url)
                  throws OfflineDatabaseException
Throws:
OfflineDatabaseException

invalidate

public void invalidate()

sqliteMetadataForName

public java.lang.String sqliteMetadataForName(java.lang.String name)

sqliteDataForURL

public byte[] sqliteDataForURL(java.lang.String url)

OfflineMapDownloader

java.lang.Object com.mapbox.mapboxsdk.offline.OfflineMapDownloader
All Implemented Interfaces:
MapboxConstants
public class OfflineMapDownloader
extends java.lang.Object
implements MapboxConstants

Nested Class Summary

Nested Classes 
Modifier and Type Class and Description
static class  OfflineMapDownloader.MBXOfflineMapDownloaderState
The possible states of the offline map downloader.

Nested classes/interfaces inherited from interface com.mapbox.mapboxsdk.constants.MapboxConstants

MapboxConstants.RasterImageQuality

Field Summary

Fields inherited from interface com.mapbox.mapboxsdk.constants.MapboxConstants

USER_AGENT

Method Summary

Methods 
Modifier and Type Method and Description
boolean OfflineMapDownloaderListener listener) 
void beginDownloadingMapID(java.lang.String mapID, CoordinateRegion mapRegion, java.lang.Integer minimumZ, java.lang.Integer maximumZ) 
void beginDownloadingMapID(java.lang.String mapID, CoordinateRegion mapRegion, java.lang.Integer minimumZ, java.lang.Integer maximumZ, boolean includeMetadata, boolean includeMarkers) 
void beginDownloadingMapID(java.lang.String mapID, CoordinateRegion mapRegion, java.lang.Integer minimumZ, java.lang.Integer maximumZ, boolean includeMetadata, boolean includeMarkers, MapboxConstants.RasterImageQuality imageQuality) 
void cancel() 
void cancelImmediatelyWithError(java.lang.String error) 
OfflineMapDatabase completeDatabaseAndInstantiateOfflineMapWithError() 
java.util.ArrayList<OfflineMapDatabase> getMutableOfflineMapDatabases() 
static OfflineMapDownloader getOfflineMapDownloader(android.content.Context context) 
boolean isMapIdAlreadyAnOfflineMapDatabase(java.lang.String mapId) 
void OfflineMapDatabase offlineMap) 
void notifyDelegateOfHTTPStatusError(int status, java.lang.String url) 
void notifyDelegateOfInitialCount() 
void notifyDelegateOfNetworkConnectivityError(java.lang.Throwable error) 
void notifyDelegateOfProgress() 
void notifyDelegateOfSqliteError(java.lang.Throwable error) 
void notifyDelegateOfStateChange() 
java.util.Set<java.lang.String> parseMarkerIconURLStringsFromGeojsonData(java.lang.String data) 
boolean OfflineMapDatabase offlineMapDatabase) 
boolean removeOfflineMapDatabaseWithID(java.lang.String mid) 
boolean OfflineMapDownloaderListener listener) 
void resume() 
boolean sqliteCreateDatabaseUsingMetadata(java.util.Hashtable<java.lang.String,java.lang.String> metadata, java.util.List<java.lang.String> urlStrings) 
boolean sqliteQueryWrittenAndExpectedCountsWithError() 
java.util.ArrayList<java.lang.String> sqliteReadArrayOfOfflineMapURLsToBeDownloadLimit(int limit) 
void sqliteSaveDownloadedData(byte[] data, java.lang.String url) 
void startDownloading() 
void suspend() 

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Method Detail

getOfflineMapDownloader

public static OfflineMapDownloader getOfflineMapDownloader(android.content.Context context)

addOfflineMapDownloaderListener

public boolean addOfflineMapDownloaderListener(OfflineMapDownloaderListener listener)

removeOfflineMapDownloaderListener

public boolean removeOfflineMapDownloaderListener(OfflineMapDownloaderListener listener)

notifyDelegateOfStateChange

public void notifyDelegateOfStateChange()

notifyDelegateOfInitialCount

public void notifyDelegateOfInitialCount()

notifyDelegateOfProgress

public void notifyDelegateOfProgress()

notifyDelegateOfNetworkConnectivityError

public void notifyDelegateOfNetworkConnectivityError(java.lang.Throwable error)

notifyDelegateOfSqliteError

public void notifyDelegateOfSqliteError(java.lang.Throwable error)

notifyDelegateOfHTTPStatusError

public void notifyDelegateOfHTTPStatusError(int status,
                                   java.lang.String url)

notifyDelegateOfCompletionWithOfflineMapDatabase

public void notifyDelegateOfCompletionWithOfflineMapDatabase(OfflineMapDatabase offlineMap)

completeDatabaseAndInstantiateOfflineMapWithError

public OfflineMapDatabase completeDatabaseAndInstantiateOfflineMapWithError()

startDownloading

public void startDownloading()

sqliteSaveDownloadedData

public void sqliteSaveDownloadedData(byte[] data,
                            java.lang.String url)

sqliteReadArrayOfOfflineMapURLsToBeDownloadLimit

public java.util.ArrayList<java.lang.String> sqliteReadArrayOfOfflineMapURLsToBeDownloadLimit(int limit)

sqliteQueryWrittenAndExpectedCountsWithError

public boolean sqliteQueryWrittenAndExpectedCountsWithError()

sqliteCreateDatabaseUsingMetadata

public boolean sqliteCreateDatabaseUsingMetadata(java.util.Hashtable<java.lang.String,java.lang.String> metadata,
                                        java.util.List<java.lang.String> urlStrings)

beginDownloadingMapID

public void beginDownloadingMapID(java.lang.String mapID,
                         CoordinateRegion mapRegion,
                         java.lang.Integer minimumZ,
                         java.lang.Integer maximumZ)

beginDownloadingMapID

public void beginDownloadingMapID(java.lang.String mapID,
                         CoordinateRegion mapRegion,
                         java.lang.Integer minimumZ,
                         java.lang.Integer maximumZ,
                         boolean includeMetadata,
                         boolean includeMarkers)

beginDownloadingMapID

public void beginDownloadingMapID(java.lang.String mapID,
                         CoordinateRegion mapRegion,
                         java.lang.Integer minimumZ,
                         java.lang.Integer maximumZ,
                         boolean includeMetadata,
                         boolean includeMarkers,
                         MapboxConstants.RasterImageQuality imageQuality)

parseMarkerIconURLStringsFromGeojsonData

public java.util.Set<java.lang.String> parseMarkerIconURLStringsFromGeojsonData(java.lang.String data)

cancelImmediatelyWithError

public void cancelImmediatelyWithError(java.lang.String error)

cancel

public void cancel()

resume

public void resume()

suspend

public void suspend()

getMutableOfflineMapDatabases

public java.util.ArrayList<OfflineMapDatabase> getMutableOfflineMapDatabases()

isMapIdAlreadyAnOfflineMapDatabase

public boolean isMapIdAlreadyAnOfflineMapDatabase(java.lang.String mapId)

removeOfflineMapDatabase

public boolean removeOfflineMapDatabase(OfflineMapDatabase offlineMapDatabase)

removeOfflineMapDatabaseWithID

public boolean removeOfflineMapDatabaseWithID(java.lang.String mid)

OfflineMapDownloader.MBXOfflineMapDownloaderState

java.lang.Object java.lang.Enum<OfflineMapDownloader.MBXOfflineMapDownloaderState> com.mapbox.mapboxsdk.offline.OfflineMapDownloader.MBXOfflineMapDownloaderState
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<OfflineMapDownloader.MBXOfflineMapDownloaderState>
Enclosing class:
OfflineMapDownloader
public static enum OfflineMapDownloader.MBXOfflineMapDownloaderState
extends java.lang.Enum<OfflineMapDownloader.MBXOfflineMapDownloaderState>
The possible states of the offline map downloader.

Enum Constant Summary

Enum Constants 
Enum Constant and Description
MBXOfflineMapDownloaderStateAvailable
The offline map downloader is ready to begin a new offline map download job.
MBXOfflineMapDownloaderStateCanceling
An offline map download job is being canceled.
MBXOfflineMapDownloaderStateRunning
An offline map download job is in progress.
MBXOfflineMapDownloaderStateSuspended
An offline map download job is suspended and can be either resumed or canceled.

Method Summary

Methods 
Modifier and Type Method and Description
static OfflineMapDownloader.MBXOfflineMapDownloaderState valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
static OfflineMapDownloader.MBXOfflineMapDownloaderState[] values()
Returns an array containing the constants of this enum type, in the order they are declared.

Methods inherited from class java.lang.Enum

clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf

Methods inherited from class java.lang.Object

getClass, notify, notifyAll, wait, wait, wait

Enum Constant Detail

MBXOfflineMapDownloaderStateRunning

public static final OfflineMapDownloader.MBXOfflineMapDownloaderState MBXOfflineMapDownloaderStateRunning
An offline map download job is in progress.

MBXOfflineMapDownloaderStateSuspended

public static final OfflineMapDownloader.MBXOfflineMapDownloaderState MBXOfflineMapDownloaderStateSuspended
An offline map download job is suspended and can be either resumed or canceled.

MBXOfflineMapDownloaderStateCanceling

public static final OfflineMapDownloader.MBXOfflineMapDownloaderState MBXOfflineMapDownloaderStateCanceling
An offline map download job is being canceled.

MBXOfflineMapDownloaderStateAvailable

public static final OfflineMapDownloader.MBXOfflineMapDownloaderState MBXOfflineMapDownloaderStateAvailable
The offline map downloader is ready to begin a new offline map download job.

Method Detail

values

public static OfflineMapDownloader.MBXOfflineMapDownloaderState[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (OfflineMapDownloader.MBXOfflineMapDownloaderState c : OfflineMapDownloader.MBXOfflineMapDownloaderState.values())
    System.out.println(c);
Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static OfflineMapDownloader.MBXOfflineMapDownloaderState valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

OfflineMapDownloaderListener

public interface OfflineMapDownloaderListener

Method Summary

Methods 
Modifier and Type Method and Description
void OfflineMapDatabase offlineMapDatabase) 
void httpStatusError(java.lang.Throwable error) 
void initialCountOfFiles(java.lang.Integer numberOfFiles) 
void networkConnectivityError(java.lang.Throwable error) 
void progressUpdate(java.lang.Integer numberOfFilesWritten, java.lang.Integer numberOfFilesExcepted) 
void sqlLiteError(java.lang.Throwable error) 
void OfflineMapDownloader.MBXOfflineMapDownloaderState newState) 

Method Detail

stateChanged

void stateChanged(OfflineMapDownloader.MBXOfflineMapDownloaderState newState)

initialCountOfFiles

void initialCountOfFiles(java.lang.Integer numberOfFiles)

progressUpdate

void progressUpdate(java.lang.Integer numberOfFilesWritten,
                  java.lang.Integer numberOfFilesExcepted)

networkConnectivityError

void networkConnectivityError(java.lang.Throwable error)

sqlLiteError

void sqlLiteError(java.lang.Throwable error)

httpStatusError

void httpStatusError(java.lang.Throwable error)

completionOfOfflineDatabaseMap

void completionOfOfflineDatabaseMap(OfflineMapDatabase offlineMapDatabase)

GeoJSONPainter

java.lang.Object com.mapbox.mapboxsdk.overlay.GeoJSONPainter
public class GeoJSONPainter
extends java.lang.Object

Constructor Summary

Constructors 
Constructor and Description
MapView mapView, Icon markerIcon) 

Method Summary

Methods 
Modifier and Type Method and Description
void loadFromURL(java.lang.String url) 

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

GeoJSONPainter

public GeoJSONPainter(MapView mapView,
              Icon markerIcon)

Method Detail

loadFromURL

public void loadFromURL(java.lang.String url)

GpsLocationProvider

java.lang.Object com.mapbox.mapboxsdk.overlay.GpsLocationProvider
All Implemented Interfaces:
android.location.LocationListener
public class GpsLocationProvider
extends java.lang.Object
implements android.location.LocationListener

Constructor Summary

Constructors 
Constructor and Description
GpsLocationProvider(android.content.Context context) 

Method Summary

Methods 
Modifier and Type Method and Description
android.location.Location getLastKnownLocation() 
float getLocationUpdateMinDistance() 
long getLocationUpdateMinTime() 
void onLocationChanged(android.location.Location location) 
void onProviderDisabled(java.lang.String provider) 
void onProviderEnabled(java.lang.String provider) 
void onStatusChanged(java.lang.String provider, int status, android.os.Bundle extras) 
void setLocationUpdateMinDistance(float meters)
Set the minimum distance for location updates.
void setLocationUpdateMinTime(long milliSeconds)
Set the minimum interval for location updates.
boolean UserLocationOverlay myLocationConsumer)
Enable location updates and show your current location on the map.
void stopLocationProvider() 

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

GpsLocationProvider

public GpsLocationProvider(android.content.Context context)

Method Detail

getLocationUpdateMinTime

public long getLocationUpdateMinTime()

setLocationUpdateMinTime

public void setLocationUpdateMinTime(long milliSeconds)
Set the minimum interval for location updates. See LocationManager.requestLocationUpdates(String, long, float, LocationListener). Note that you should call this before calling enableMyLocation().

getLocationUpdateMinDistance

public float getLocationUpdateMinDistance()

setLocationUpdateMinDistance

public void setLocationUpdateMinDistance(float meters)
Set the minimum distance for location updates. See LocationManager.requestLocationUpdates. Note that you should call this before calling enableMyLocation().

startLocationProvider

public boolean startLocationProvider(UserLocationOverlay myLocationConsumer)
Enable location updates and show your current location on the map. By default this will request location updates as frequently as possible, but you can change the frequency and/or distance by calling setLocationUpdateMinDistance(float) before calling this method.

stopLocationProvider

public void stopLocationProvider()

getLastKnownLocation

public android.location.Location getLastKnownLocation()

onLocationChanged

public void onLocationChanged(android.location.Location location)
Specified by:
onLocationChanged in interface android.location.LocationListener

onProviderDisabled

public void onProviderDisabled(java.lang.String provider)
Specified by:
onProviderDisabled in interface android.location.LocationListener

onProviderEnabled

public void onProviderEnabled(java.lang.String provider)
Specified by:
onProviderEnabled in interface android.location.LocationListener

onStatusChanged

public void onStatusChanged(java.lang.String provider,
                   int status,
                   android.os.Bundle extras)
Specified by:
onStatusChanged in interface android.location.LocationListener

Icon

java.lang.Object com.mapbox.mapboxsdk.overlay.Icon
All Implemented Interfaces:
MapboxConstants
public class Icon
extends java.lang.Object
implements MapboxConstants
An Icon provided by the Mapbox marker API, optionally with a symbol from Maki

Nested Class Summary

Nested Classes 
Modifier and Type Class and Description
static class  Icon.Size 

Nested classes/interfaces inherited from interface com.mapbox.mapboxsdk.constants.MapboxConstants

MapboxConstants.RasterImageQuality

Field Summary

Fields 
Modifier and Type Field and Description
protected static BitmapLruCache sIconCache 

Fields inherited from interface com.mapbox.mapboxsdk.constants.MapboxConstants

USER_AGENT

Constructor Summary

Constructors 
Constructor and Description
Icon(android.content.Context context, Icon.Size size, java.lang.String symbol, java.lang.String aColor)
Initialize an icon with size, symbol, and color, and start a download process to load it from the API.
Icon(android.graphics.drawable.Drawable drawable)
Initialize an Icon with a custom Drawable

Method Summary

Methods 
Modifier and Type Method and Description
protected BitmapLruCache getCache() 
protected BitmapLruCache getCache(android.content.Context context) 
static java.io.File getDiskCacheDir(android.content.Context context, java.lang.String uniqueName)
Creates a unique subdirectory of the designated app cache directory.
Icon Marker aMarker)
Set the marker that this icon belongs to, calling the same method on the other side

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

sIconCache

protected static BitmapLruCache sIconCache

Constructor Detail

Icon

public Icon(android.content.Context context,
    Icon.Size size,
    java.lang.String symbol,
    java.lang.String aColor)
Initialize an icon with size, symbol, and color, and start a download process to load it from the API.
Parameters:
context - Android context - Used for proper Bitmap Density generation
size - Size of Icon
symbol - Maki Symbol
aColor - Color of Icon

Icon

public Icon(android.graphics.drawable.Drawable drawable)
Initialize an Icon with a custom Drawable
Parameters:
drawable - Custom Drawable

Method Detail

getCache

protected BitmapLruCache getCache()

getCache

protected BitmapLruCache getCache(android.content.Context context)

getDiskCacheDir

public static java.io.File getDiskCacheDir(android.content.Context context,
                           java.lang.String uniqueName)
Creates a unique subdirectory of the designated app cache directory. Tries to use external but if not mounted, falls back on internal storage.

setMarker

public Marker aMarker)
Set the marker that this icon belongs to, calling the same method on the other side
Parameters:
aMarker - the marker to be added to
Returns:
this icon

Icon.Size

java.lang.Object java.lang.Enum<Icon.Size> com.mapbox.mapboxsdk.overlay.Icon.Size
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<Icon.Size>
Enclosing class:
Icon
public static enum Icon.Size
extends java.lang.Enum<Icon.Size>

Enum Constant Summary

Enum Constants 
Enum Constant and Description
LARGE 
MEDIUM 
SMALL 

Method Summary

Methods 
Modifier and Type Method and Description
java.lang.String getApiString() 
static Icon.Size valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
static Icon.Size[] values()
Returns an array containing the constants of this enum type, in the order they are declared.

Methods inherited from class java.lang.Enum

clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf

Methods inherited from class java.lang.Object

getClass, notify, notifyAll, wait, wait, wait

Enum Constant Detail

LARGE

public static final Icon.Size LARGE

MEDIUM

public static final Icon.Size MEDIUM

SMALL

public static final Icon.Size SMALL

Method Detail

values

public static Icon.Size[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (Icon.Size c : Icon.Size.values())
    System.out.println(c);
Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static Icon.Size valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

getApiString

public java.lang.String getApiString()

IOverlayMenuProvider

public interface IOverlayMenuProvider

Method Summary

Methods 
Modifier and Type Method and Description
boolean isOptionsMenuEnabled()
Can be used to signal to external callers that this Overlay should not be used for providing option menu items.
boolean onCreateOptionsMenu(android.view.Menu pMenu, int pMenuIdOffset, MapView pMapView) 
boolean onOptionsItemSelected(android.view.MenuItem pItem, int pMenuIdOffset, MapView pMapView) 
boolean onPrepareOptionsMenu(android.view.Menu pMenu, int pMenuIdOffset, MapView pMapView) 
void setOptionsMenuEnabled(boolean pOptionsMenuEnabled) 

Method Detail

onCreateOptionsMenu

boolean onCreateOptionsMenu(android.view.Menu pMenu,
                          int pMenuIdOffset,
                          MapView pMapView)

onPrepareOptionsMenu

boolean onPrepareOptionsMenu(android.view.Menu pMenu,
                           int pMenuIdOffset,
                           MapView pMapView)

onOptionsItemSelected

boolean onOptionsItemSelected(android.view.MenuItem pItem,
                            int pMenuIdOffset,
                            MapView pMapView)

isOptionsMenuEnabled

boolean isOptionsMenuEnabled()
Can be used to signal to external callers that this Overlay should not be used for providing option menu items.

setOptionsMenuEnabled

void setOptionsMenuEnabled(boolean pOptionsMenuEnabled)

ItemizedIconOverlay.ActiveItem

Enclosing class:
ItemizedIconOverlay
public static interface ItemizedIconOverlay.ActiveItem

Method Summary

Methods 
Modifier and Type Method and Description
boolean run(int aIndex) 

Method Detail

run

boolean run(int aIndex)

ItemizedIconOverlay

java.lang.Object com.mapbox.mapboxsdk.overlay.Overlay com.mapbox.mapboxsdk.overlay.SafeDrawOverlay com.mapbox.mapboxsdk.overlay.ItemizedOverlay com.mapbox.mapboxsdk.overlay.ItemizedIconOverlay
All Implemented Interfaces:
Overlay.Snappable
public class ItemizedIconOverlay
extends ItemizedOverlay

Nested Class Summary

Nested Classes 
Modifier and Type Class and Description
static interface  ItemizedIconOverlay.ActiveItem 
static interface  T>
When the item is touched one of these methods may be invoked depending on the type of touch.

Nested classes/interfaces inherited from class com.mapbox.mapboxsdk.overlay.ItemizedOverlay

ItemizedOverlay.OnFocusChangeListener

Nested classes/interfaces inherited from class com.mapbox.mapboxsdk.overlay.Overlay

Overlay.Snappable

Field Summary

Fields 
Modifier and Type Field and Description
protected java.util.List<Marker> mItemList 
protected Marker> mOnItemGestureListener 

Fields inherited from class com.mapbox.mapboxsdk.overlay.ItemizedOverlay

mDrawFocusedItem

Fields inherited from class com.mapbox.mapboxsdk.overlay.Overlay

USERLOCATIONOVERLAY_INDEX

Constructor Summary

Constructors 
Constructor and Description
ItemizedIconOverlay(android.content.Context pContext, java.util.List<Marker> pList, Marker> pOnItemGestureListener) 
ItemizedIconOverlay(android.content.Context pContext, java.util.List<Marker> pList, Marker> pOnItemGestureListener, boolean sortList) 

Method Summary

Methods 
Modifier and Type Method and Description
boolean Marker item) 
boolean addItems(java.util.List items) 
protected Marker createItem(int index)
Method by which subclasses create the actual Items.
int getDrawnItemsLimit() 
protected void Marker item) 
boolean onLongPress(android.view.MotionEvent event, MapView mapView)
By default does nothing (return false).
protected boolean onLongPressHelper(int index, Marker item) 
boolean onSingleTapConfirmed(android.view.MotionEvent event, MapView mapView)
Each of these methods performs a item sensitive check.
protected boolean onSingleTapUpHelper(int index, Marker item, MapView mapView) 
boolean onSnapToItem(int pX, int pY, android.graphics.Point pSnapPoint, MapView pMapView)
Checks to see if the given x and y are close enough to an item resulting in snapping the current action (e.g.
void removeAllItems() 
void removeAllItems(boolean withPopulate) 
Marker removeItem(int position) 
boolean Marker item) 
void removeItems(java.util.List items) 
void setDrawnItemsLimit(int aLimit) 
int size()
The number of items in this overlay.

Methods inherited from class com.mapbox.mapboxsdk.overlay.ItemizedOverlay

setOnFocusChangeListener

Methods inherited from class com.mapbox.mapboxsdk.overlay.SafeDrawOverlay

setUseSafeCanvas

Methods inherited from class com.mapbox.mapboxsdk.overlay.Overlay

setOverlayIndex

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

mItemList

protected final java.util.List<Marker> mItemList

mOnItemGestureListener

protected Marker> mOnItemGestureListener

Constructor Detail

ItemizedIconOverlay

public ItemizedIconOverlay(android.content.Context pContext,
                   java.util.List<Marker> pList,
                   Marker> pOnItemGestureListener)

ItemizedIconOverlay

public ItemizedIconOverlay(android.content.Context pContext,
                   java.util.List<Marker> pList,
                   Marker> pOnItemGestureListener,
                   boolean sortList)

Method Detail

onSnapToItem

public boolean onSnapToItem(int pX,
                   int pY,
                   android.graphics.Point pSnapPoint,
                   MapView pMapView)
Description copied from interface: Overlay.Snappable
Checks to see if the given x and y are close enough to an item resulting in snapping the current action (e.g. zoom) to the item.
Parameters:
pX - The x in screen coordinates.
pY - The y in screen coordinates.
pSnapPoint - To be filled with the the interesting point (in screen coordinates) that is closest to the given x and y. Can be untouched if not snapping.
pMapView - The MapView that is requesting the snap. Use MapView.getProjection() to convert between on-screen pixels and latitude/longitude pairs.
Returns:
Whether or not to snap to the interesting point.

createItem

protected Marker createItem(int index)
Description copied from class: ItemizedOverlay
Method by which subclasses create the actual Items. This will only be called from populate() we'll cache them for later use.
Specified by:
ItemizedOverlay

size

public int size()
Description copied from class: ItemizedOverlay
The number of items in this overlay.
Specified by:
ItemizedOverlay

addItem

public boolean addItem(Marker item)

addItems

public boolean addItems(java.util.List items)

removeAllItems

public void removeAllItems()

removeAllItems

public void removeAllItems(boolean withPopulate)

onItemRemoved

protected void onItemRemoved(Marker item)

removeItem

public boolean removeItem(Marker item)

removeItem

public Marker removeItem(int position)

removeItems

public void removeItems(java.util.List items)

onSingleTapConfirmed

public boolean onSingleTapConfirmed(android.view.MotionEvent event,
                           MapView mapView)
Each of these methods performs a item sensitive check. If the item is located its corresponding method is called. The result of the call is returned.

Helper methods are provided so that child classes may more easily override behavior without resorting to overriding the ItemGestureListener methods.

Overrides:
ItemizedOverlay

onSingleTapUpHelper

protected boolean onSingleTapUpHelper(int index,
                          Marker item,
                          MapView mapView)

onLongPress

public boolean onLongPress(android.view.MotionEvent event,
                  MapView mapView)
Description copied from class: Overlay
By default does nothing (return false). If you handled the Event, return true, otherwise return false. If you returned true none of the following Overlays or the underlying MapView has the chance to handle this event.
Overrides:
Overlay

onLongPressHelper

protected boolean onLongPressHelper(int index,
                        Marker item)

getDrawnItemsLimit

public int getDrawnItemsLimit()

setDrawnItemsLimit

public void setDrawnItemsLimit(int aLimit)

ItemizedIconOverlay.OnItemGestureListener

Enclosing class:
ItemizedIconOverlay
public static interface ItemizedIconOverlay.OnItemGestureListener<T>
When the item is touched one of these methods may be invoked depending on the type of touch. Each of them returns true if the event was completely handled.

Method Summary

Methods 
Modifier and Type Method and Description
boolean onItemLongPress(int index, T item) 
boolean onItemSingleTapUp(int index, T item) 

Method Detail

onItemSingleTapUp

boolean onItemSingleTapUp(int index,
                        T item)

onItemLongPress

boolean onItemLongPress(int index,
                      T item)

ItemizedOverlay

java.lang.Object com.mapbox.mapboxsdk.overlay.Overlay com.mapbox.mapboxsdk.overlay.SafeDrawOverlay com.mapbox.mapboxsdk.overlay.ItemizedOverlay
All Implemented Interfaces:
Overlay.Snappable
Direct Known Subclasses:
ItemizedIconOverlay
public abstract class ItemizedOverlay
extends SafeDrawOverlay
implements Overlay.Snappable
Draws a list of Marker as markers to a map. The item with the lowest index is drawn as last and therefore the 'topmost' marker. It also gets checked for onTap first. This class is generic, because you then you get your custom item-class passed back in onTap().

Nested Class Summary

Nested Classes 
Modifier and Type Class and Description
static interface  ItemizedOverlay.OnFocusChangeListener 

Nested classes/interfaces inherited from class com.mapbox.mapboxsdk.overlay.Overlay

Overlay.Snappable

Field Summary

Fields 
Modifier and Type Field and Description
protected boolean mDrawFocusedItem 

Fields inherited from class com.mapbox.mapboxsdk.overlay.Overlay

USERLOCATIONOVERLAY_INDEX

Constructor Summary

Constructors 
Constructor and Description
ItemizedOverlay() 

Method Summary

Methods 
Modifier and Type Method and Description
void Marker item)
an item want's to be blured, if it is the focused one, blur it
protected abstract Marker createItem(int i)
Method by which subclasses create the actual Items.
protected void ISafeCanvas canvas, MapView mapView, boolean shadow)
Draw a marker on each of our items.
Marker getFocus() 
Marker getItem(int position)
Returns the Item at the given index.
protected boolean Marker pMarker, Projection pProjection, float pX, float pY) 
protected void ISafeCanvas canvas, Marker item, Projection projection, float aMapOrientation, android.graphics.RectF mapBounds, float mapScale)
Draws an item located at the provided screen coordinates to the canvas.
boolean onSingleTapConfirmed(android.view.MotionEvent e, MapView mapView)
By default does nothing (return false).
protected boolean onTap(int index)
Override this method to handle a "tap" on an item.
protected void populate()
Utility method to perform all processing on a new ItemizedOverlay.
void setDrawFocusedItem(boolean drawFocusedItem)
Set whether or not to draw the focused item.
void Marker item)
If the given Item is found in the overlay, force it to be the current focus-bearer.
void ItemizedOverlay.OnFocusChangeListener l) 
abstract int size()
The number of items in this overlay.

Methods inherited from class com.mapbox.mapboxsdk.overlay.SafeDrawOverlay

setUseSafeCanvas

Methods inherited from class com.mapbox.mapboxsdk.overlay.Overlay

setOverlayIndex

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Methods inherited from interface com.mapbox.mapboxsdk.overlay.Overlay.Snappable

onSnapToItem

Field Detail

mDrawFocusedItem

protected boolean mDrawFocusedItem

Constructor Detail

ItemizedOverlay

public ItemizedOverlay()

Method Detail

createItem

protected abstract Marker createItem(int i)
Method by which subclasses create the actual Items. This will only be called from populate() we'll cache them for later use.

size

public abstract int size()
The number of items in this overlay.

drawSafe

protected void drawSafe(ISafeCanvas canvas,
            MapView mapView,
            boolean shadow)
Draw a marker on each of our items. populate() must have been called first. The marker will be drawn twice for each Item in the Overlay--once in the shadow phase, skewed and darkened, then again in the non-shadow phase. The bottom-center of the marker will be aligned with the geographical coordinates of the Item. The order of drawing may be changed by overriding the getIndexToDraw(int) method. An item may provide an alternate marker via its Marker.getMarker(int) method. If that method returns null, the default marker is used. The focused item is always drawn last, which puts it visually on top of the other items.
Specified by:
SafeDrawOverlay
Parameters:
canvas - the Canvas upon which to draw. Note that this may already have a transformation applied, so be sure to leave it the way you found it
mapView - the MapView that requested the draw. Use MapView.getProjection() to convert between on-screen pixels and latitude/longitude pairs
shadow - if true, draw the shadow layer. If false, draw the overlay contents.

populate

protected void populate()
Utility method to perform all processing on a new ItemizedOverlay. Subclasses provide Items through the createItem(int) method. The subclass should call this as soon as it has data, before anything else gets called.

getItem

public final Marker getItem(int position)
Returns the Item at the given index.
Parameters:
position - the position of the item to return
Returns:
the Item of the given index.

onDrawItem

protected void onDrawItem(ISafeCanvas canvas,
              Marker item,
              Projection projection,
              float aMapOrientation,
              android.graphics.RectF mapBounds,
              float mapScale)
Draws an item located at the provided screen coordinates to the canvas.
Parameters:
canvas - what the item is drawn upon.
item - the item to be drawn.
projection - the projection to use.
aMapOrientation -
mapBounds -
mapScale -

markerHitTest

protected boolean markerHitTest(Marker pMarker,
                    Projection pProjection,
                    float pX,
                    float pY)

onSingleTapConfirmed

public boolean onSingleTapConfirmed(android.view.MotionEvent e,
                           MapView mapView)
Description copied from class: Overlay
By default does nothing (return false). If you handled the Event, return true, otherwise return false. If you returned true none of the following Overlays or the underlying MapView has the chance to handle this event.
Overrides:
Overlay

onTap

protected boolean onTap(int index)
Override this method to handle a "tap" on an item. This could be from a touchscreen tap on an onscreen Item, or from a trackball click on a centered, selected Item. By default, does nothing and returns false.
Returns:
true if you handled the tap, false if you want the event that generated it to pass to other overlays.

setDrawFocusedItem

public void setDrawFocusedItem(boolean drawFocusedItem)
Set whether or not to draw the focused item. The default is to draw it, but some clients may prefer to draw the focused item themselves.

setFocus

public void setFocus(Marker item)
If the given Item is found in the overlay, force it to be the current focus-bearer. Any registered ItemizedOverlay will be notified. This does not move the map, so if the Item isn't already centered, the user may get confused. If the Item is not found, this is a no-op. You can also pass null to remove focus.

getFocus

public Marker getFocus()
Returns:
the currently-focused item, or null if no item is currently focused.

blurItem

public void blurItem(Marker item)
an item want's to be blured, if it is the focused one, blur it

setOnFocusChangeListener

public void setOnFocusChangeListener(ItemizedOverlay.OnFocusChangeListener l)

ItemizedOverlay.OnFocusChangeListener

Enclosing class:
ItemizedOverlay
public static interface ItemizedOverlay.OnFocusChangeListener

Method Summary

Methods 
Modifier and Type Method and Description
void ItemizedOverlay overlay, Marker newFocus) 

Method Detail

onFocusChanged

void onFocusChanged(ItemizedOverlay overlay,
                  Marker newFocus)

MapEventsOverlay

java.lang.Object com.mapbox.mapboxsdk.overlay.Overlay com.mapbox.mapboxsdk.overlay.MapEventsOverlay
public class MapEventsOverlay
extends Overlay
Empty overlay than can be used to detect events on the map, and to throw them to a MapEventsReceiver.
See Also:
MapEventsReceiver

Nested Class Summary

Nested classes/interfaces inherited from class com.mapbox.mapboxsdk.overlay.Overlay

Overlay.Snappable

Field Summary

Fields inherited from class com.mapbox.mapboxsdk.overlay.Overlay

USERLOCATIONOVERLAY_INDEX

Constructor Summary

Constructors 
Constructor and Description
MapEventsOverlay(android.content.Context ctx, MapEventsReceiver receiver) 

Method Summary

Methods 
Modifier and Type Method and Description
protected void draw(android.graphics.Canvas c, MapView osmv, boolean shadow)
Draw the overlay over the map.
boolean onLongPress(android.view.MotionEvent e, MapView mapView)
By default does nothing (return false).
boolean onSingleTapConfirmed(android.view.MotionEvent e, MapView mapView)
By default does nothing (return false).

Methods inherited from class com.mapbox.mapboxsdk.overlay.Overlay

setOverlayIndex

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

MapEventsOverlay

public MapEventsOverlay(android.content.Context ctx,
                MapEventsReceiver receiver)
Parameters:
ctx - the context
receiver - the object that will receive/handle the events. It must implement MapEventsReceiver interface.

Method Detail

draw

protected void draw(android.graphics.Canvas c,
        MapView osmv,
        boolean shadow)
Description copied from class: Overlay
Draw the overlay over the map. This will be called on all active overlays with shadow=true, to lay down the shadow layer, and then again on all overlays with shadow=false. Callers should check isEnabled() before calling draw(). By default, draws nothing.
Specified by:
Overlay

onSingleTapConfirmed

public boolean onSingleTapConfirmed(android.view.MotionEvent e,
                           MapView mapView)
Description copied from class: Overlay
By default does nothing (return false). If you handled the Event, return true, otherwise return false. If you returned true none of the following Overlays or the underlying MapView has the chance to handle this event.
Overrides:
Overlay

onLongPress

public boolean onLongPress(android.view.MotionEvent e,
                  MapView mapView)
Description copied from class: Overlay
By default does nothing (return false). If you handled the Event, return true, otherwise return false. If you returned true none of the following Overlays or the underlying MapView has the chance to handle this event.
Overrides:
Overlay

MapEventsReceiver

All Known Implementing Classes:
MapView
public interface MapEventsReceiver
Interface for objects that need to handle map events thrown by a MapEventsOverlay.
See Also:
MapEventsOverlay

Method Summary

Methods 
Modifier and Type Method and Description
boolean ILatLng p) 
boolean ILatLng p) 

Method Detail

singleTapUpHelper

boolean singleTapUpHelper(ILatLng p)
Parameters:
p - the position where the event occurred.
Returns:
true if the event has been "consumed" and should not be handled by other objects.

longPressHelper

boolean longPressHelper(ILatLng p)
Parameters:
p - the position where the event occurred.
Returns:
true if the event has been "consumed" and should not be handled by other objects.

Marker.HotspotPlace

java.lang.Object java.lang.Enum<Marker.HotspotPlace> com.mapbox.mapboxsdk.overlay.Marker.HotspotPlace
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<Marker.HotspotPlace>
Enclosing class:
Marker
public static enum Marker.HotspotPlace
extends java.lang.Enum<Marker.HotspotPlace>
Indicates a hotspot for an area. This is where the origin (0,0)of a point will be located relative to the area. In otherwords this acts as an offset. NONE indicates that no adjustment should be made.

Enum Constant Summary

Enum Constants 
Enum Constant and Description
BOTTOM_CENTER 
CENTER 
LEFT_CENTER 
LOWER_LEFT_CORNER 
LOWER_RIGHT_CORNER 
NONE 
RIGHT_CENTER 
TOP_CENTER 
UPPER_LEFT_CORNER 
UPPER_RIGHT_CORNER 

Method Summary

Methods 
Modifier and Type Method and Description
static Marker.HotspotPlace valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
static Marker.HotspotPlace[] values()
Returns an array containing the constants of this enum type, in the order they are declared.

Methods inherited from class java.lang.Enum

clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf

Methods inherited from class java.lang.Object

getClass, notify, notifyAll, wait, wait, wait

Enum Constant Detail

NONE

public static final Marker.HotspotPlace NONE

CENTER

public static final Marker.HotspotPlace CENTER

BOTTOM_CENTER

public static final Marker.HotspotPlace BOTTOM_CENTER

TOP_CENTER

public static final Marker.HotspotPlace TOP_CENTER

RIGHT_CENTER

public static final Marker.HotspotPlace RIGHT_CENTER

LEFT_CENTER

public static final Marker.HotspotPlace LEFT_CENTER

UPPER_RIGHT_CORNER

public static final Marker.HotspotPlace UPPER_RIGHT_CORNER

LOWER_RIGHT_CORNER

public static final Marker.HotspotPlace LOWER_RIGHT_CORNER

UPPER_LEFT_CORNER

public static final Marker.HotspotPlace UPPER_LEFT_CORNER

LOWER_LEFT_CORNER

public static final Marker.HotspotPlace LOWER_LEFT_CORNER

Method Detail

values

public static Marker.HotspotPlace[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (Marker.HotspotPlace c : Marker.HotspotPlace.values())
    System.out.println(c);
Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static Marker.HotspotPlace valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

Marker

java.lang.Object com.mapbox.mapboxsdk.overlay.Marker
All Implemented Interfaces:
MapViewConstants
public class Marker
extends java.lang.Object
implements MapViewConstants
Immutable class describing a LatLng with a Title and a Description.

Nested Class Summary

Nested Classes 
Modifier and Type Class and Description
static class  Marker.HotspotPlace
Indicates a hotspot for an area.

Field Summary

Fields 
Modifier and Type Field and Description
static int ITEM_STATE_FOCUSED_MASK 
static int ITEM_STATE_PRESSED_MASK 
static int ITEM_STATE_SELECTED_MASK 
protected android.graphics.PointF mAnchor 
protected android.graphics.PointF mCurMapCoords 
protected LatLng mLatLng 
protected android.graphics.drawable.Drawable mMarker 
protected java.lang.String mUid 

Fields inherited from interface com.mapbox.mapboxsdk.views.util.constants.MapViewConstants

DEFAULT_PIN_ANCHOR

Constructor Summary

Constructors 
Constructor and Description
MapView mv, java.lang.String aTitle, java.lang.String aDescription, LatLng aLatLng)
Initialize a new marker object, adding it to a MapView and attaching a tooltip
Marker(java.lang.String title, java.lang.String description, LatLng latLng)
Construct a new Marker, given title, description, and place

Method Summary

Methods 
Modifier and Type Method and Description
Marker MapView mv)
Attach this marker to a given MapView and that MapView's context
void blur() 
void closeToolTip() 
protected InfoWindow MapView mv) 
android.graphics.Point getAnchor() 
android.graphics.Point Marker.HotspotPlace place) 
android.graphics.drawable.Drawable getDefaultPinDrawable()
Default Marker image loaded from Library
java.lang.String getDescription()
Set the description attached to this marker
android.graphics.drawable.Drawable getDrawable() 
protected android.graphics.RectF Projection projection, android.graphics.RectF reuse) 
android.graphics.PointF Projection projection, android.graphics.PointF reuse) 
int getHeight() 
protected android.graphics.RectF Projection projection, android.graphics.RectF reuse) 
android.graphics.Point Marker.HotspotPlace place, int w, int h)
From a HotspotPlace and drawable dimensions (width, height), return the hotspot position.
android.graphics.PointF Marker.HotspotPlace place, android.graphics.PointF reuse) 
android.graphics.drawable.Drawable getImage()
Set the image attached to this marker
protected android.graphics.RectF Projection projection, android.graphics.RectF reuse) 
android.graphics.drawable.Drawable getMarker(int stateBitset)
Gets the custom image (Drawable) used for the Marker's image
ItemizedOverlay getParentHolder() 
LatLng getPoint() 
android.graphics.PointF getPositionOnMap() 
android.graphics.PointF Projection projection, android.graphics.PointF reuse)
Get the current position of the marker in pixels
int getRealHeight() 
java.lang.Object getRelatedObject() 
java.lang.String getSubDescription()
Set the sub-description attached to this marker
java.lang.String getTitle() 
InfoWindow MapView mv)
Get this marker's tooltip, creating it if it doesn't exist yet.
java.lang.String getUid() 
int getWidth()
Get the width of the marker, based on the width of the image backing it.
boolean hasContent()
Determine if this marker has a title, description, subdescription, or image that could be displayed
void invalidate()
Sets the marker to be redrawn.
boolean isUsingMakiIcon() 
void setAnchor(android.graphics.PointF anchor) 
void setDescription(java.lang.String aDescription) 
void Marker.HotspotPlace place)
Sets the marker hotspot
Marker Icon aIcon)
Sets the Icon image that represents this marker on screen.
void setImage(android.graphics.drawable.Drawable anImage) 
void setMarker(android.graphics.drawable.Drawable marker)
Set a custom image to be used as the Marker's image NOTE: Convenience method for setting a custom image as the marker
void setMarker(android.graphics.drawable.Drawable marker, boolean isMakiIcon)
Set a custom image to be used as the Marker's image
void ItemizedOverlay o) 
void LatLng point)
Set the centerpoint of this marker in geographical coordinates
void setRelatedObject(java.lang.Object o) 
static void setState(android.graphics.drawable.Drawable drawable, int stateBitset) 
void setSubDescription(java.lang.String aSubDescription) 
void setTitle(java.lang.String aTitle) 
void InfoWindow mToolTip) 
void InfoWindow tooltip, MapView aMapView, boolean panIntoView)
Populates this tooltip with all item info: title and description in any case, image and sub-description if any. and centers the map view on the item if panIntoView is true.
void updateDrawingPosition() 

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

ITEM_STATE_FOCUSED_MASK

public static final int ITEM_STATE_FOCUSED_MASK
See Also:
Constant Field Values

ITEM_STATE_PRESSED_MASK

public static final int ITEM_STATE_PRESSED_MASK
See Also:
Constant Field Values

ITEM_STATE_SELECTED_MASK

public static final int ITEM_STATE_SELECTED_MASK
See Also:
Constant Field Values

mCurMapCoords

protected final android.graphics.PointF mCurMapCoords

mUid

protected java.lang.String mUid

mLatLng

protected LatLng mLatLng

mMarker

protected android.graphics.drawable.Drawable mMarker

mAnchor

protected android.graphics.PointF mAnchor

Constructor Detail

Marker

public Marker(java.lang.String title,
      java.lang.String description,
      LatLng latLng)
Construct a new Marker, given title, description, and place
Parameters:
title - Marker title
description - Marker description
latLng - Marker position

Marker

public Marker(MapView mv,
      java.lang.String aTitle,
      java.lang.String aDescription,
      LatLng aLatLng)
Initialize a new marker object, adding it to a MapView and attaching a tooltip
Parameters:
mv - a mapview
aTitle - the title of the marker, in a potential tooltip
aDescription - the description of the marker, in a tooltip
aLatLng - the location of the marker

Method Detail

getDefaultPinDrawable

public android.graphics.drawable.Drawable getDefaultPinDrawable()
Default Marker image loaded from Library
Returns:
BitMapDrawable of the Default Marker image

addTo

public MapView mv)
Attach this marker to a given MapView and that MapView's context
Parameters:
mv - the MapView to add this marker to
Returns:
Marker

hasContent

public boolean hasContent()
Determine if this marker has a title, description, subdescription, or image that could be displayed
Returns:
true if the marker has content

createTooltip

protected MapView mv)

getToolTip

public MapView mv)
Get this marker's tooltip, creating it if it doesn't exist yet.
Parameters:
mv - MapView
Returns:
InfoWindow

setToolTip

public void setToolTip(InfoWindow mToolTip)

closeToolTip

public void closeToolTip()

blur

public void blur()

getUid

public java.lang.String getUid()

getTitle

public java.lang.String getTitle()

getPoint

public LatLng getPoint()

setTitle

public void setTitle(java.lang.String aTitle)

setDescription

public void setDescription(java.lang.String aDescription)

setSubDescription

public void setSubDescription(java.lang.String aSubDescription)

setImage

public void setImage(android.graphics.drawable.Drawable anImage)

setRelatedObject

public void setRelatedObject(java.lang.Object o)

setPoint

public void setPoint(LatLng point)
Set the centerpoint of this marker in geographical coordinates
Parameters:
point -

getDescription

public java.lang.String getDescription()
Set the description attached to this marker
Returns:

getSubDescription

public java.lang.String getSubDescription()
Set the sub-description attached to this marker
Returns:

getImage

public android.graphics.drawable.Drawable getImage()
Set the image attached to this marker
Returns:

getRelatedObject

public java.lang.Object getRelatedObject()

getParentHolder

public ItemizedOverlay getParentHolder()

setParentHolder

public void setParentHolder(ItemizedOverlay o)

getMarker

public android.graphics.drawable.Drawable getMarker(int stateBitset)
Gets the custom image (Drawable) used for the Marker's image
Parameters:
stateBitset - State Of Marker (@see #ITEM_STATE_FOCUSED_MASK , @see #ITEM_STATE_PRESSED_MASK, @see #ITEM_STATE_SELECTED_MASK)
Returns:
marker drawable corresponding to stateBitset

setMarker

public void setMarker(android.graphics.drawable.Drawable marker,
             boolean isMakiIcon)
Set a custom image to be used as the Marker's image
Parameters:
marker - Drawable resource to be used as Marker image
isMakiIcon - True if Maki Icon, False if not (ex: Custom Image)

setMarker

public void setMarker(android.graphics.drawable.Drawable marker)
Set a custom image to be used as the Marker's image NOTE: Convenience method for setting a custom image as the marker
Parameters:
marker - Drawable resource to be used as Marker image

setHotspot

public void setHotspot(Marker.HotspotPlace place)
Sets the marker hotspot
Parameters:
place - Hotspot Location @see #HotspotPlace

getAnchor

public android.graphics.Point getAnchor()

getAnchor

public android.graphics.Point getAnchor(Marker.HotspotPlace place)

setAnchor

public void setAnchor(android.graphics.PointF anchor)

setState

public static void setState(android.graphics.drawable.Drawable drawable,
            int stateBitset)

getDrawable

public android.graphics.drawable.Drawable getDrawable()

getWidth

public int getWidth()
Get the width of the marker, based on the width of the image backing it.

getHeight

public int getHeight()

getRealHeight

public int getRealHeight()

getPositionOnScreen

public android.graphics.PointF getPositionOnScreen(Projection projection,
                                          android.graphics.PointF reuse)
Get the current position of the marker in pixels
Parameters:
projection - Projection
reuse - PointF to reuse

getDrawingPositionOnScreen

public android.graphics.PointF getDrawingPositionOnScreen(Projection projection,
                                                 android.graphics.PointF reuse)

getDrawingBounds

protected android.graphics.RectF getDrawingBounds(Projection projection,
                                      android.graphics.RectF reuse)

getMapDrawingBounds

protected android.graphics.RectF getMapDrawingBounds(Projection projection,
                                         android.graphics.RectF reuse)

getHitBounds

protected android.graphics.RectF getHitBounds(Projection projection,
                                  android.graphics.RectF reuse)

getHotspotScale

public android.graphics.PointF getHotspotScale(Marker.HotspotPlace place,
                                      android.graphics.PointF reuse)

getHotspot

public android.graphics.Point getHotspot(Marker.HotspotPlace place,
                                int w,
                                int h)
From a HotspotPlace and drawable dimensions (width, height), return the hotspot position. Could be a public method of HotspotPlace or OverlayItem...

showBubble

public void showBubble(InfoWindow tooltip,
              MapView aMapView,
              boolean panIntoView)
Populates this tooltip with all item info:
    title and description in any case,
      image and sub-description if any. and centers the map view on the item if panIntoView is true.

setIcon

public Icon aIcon)
Sets the Icon image that represents this marker on screen.

isUsingMakiIcon

public boolean isUsingMakiIcon()

getPositionOnMap

public android.graphics.PointF getPositionOnMap()

updateDrawingPosition

public void updateDrawingPosition()

invalidate

public void invalidate()
Sets the marker to be redrawn.

OfflineMapTileProvider

java.lang.Object com.mapbox.mapboxsdk.tileprovider.MapTileLayerBase com.mapbox.mapboxsdk.overlay.OfflineMapTileProvider
All Implemented Interfaces:
IMapTileProviderCallback
public class OfflineMapTileProvider
extends MapTileLayerBase
implements MapboxConstants

Nested Class Summary

Nested classes/interfaces inherited from interface com.mapbox.mapboxsdk.constants.MapboxConstants

MapboxConstants.RasterImageQuality

Field Summary

Fields inherited from class com.mapbox.mapboxsdk.tileprovider.MapTileLayerBase

mTileCache

Fields inherited from interface com.mapbox.mapboxsdk.constants.MapboxConstants

USER_AGENT

Fields inherited from interface com.mapbox.mapboxsdk.tileprovider.constants.TileLayerConstants

WORLD_BOUNDING_BOX

Constructor Summary

Constructors 
Constructor and Description
OfflineMapTileProvider(android.content.Context context, OfflineMapDatabase offlineMapDatabase) 

Method Summary

Methods 
Modifier and Type Method and Description
void detach() 
android.graphics.drawable.Drawable MapTile pTile, boolean allowRemote)
Attempts to get a Drawable that represents a MapTile.

Methods inherited from class com.mapbox.mapboxsdk.tileprovider.MapTileLayerBase

useDataConnection

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

OfflineMapTileProvider

public OfflineMapTileProvider(android.content.Context context,
                      OfflineMapDatabase offlineMapDatabase)

Method Detail

getMapTile

public android.graphics.drawable.Drawable getMapTile(MapTile pTile,
                                            boolean allowRemote)
Description copied from class: MapTileLayerBase
Attempts to get a Drawable that represents a MapTile. If the tile is not immediately available this will return null and attempt to get the tile from known tile sources for subsequent future requests. Note that this may return a CacheableBitmapDrawable in which case you should follow proper handling procedures for using that Drawable or it may reused while you are working with it.
Specified by:
MapTileLayerBase
See Also:
CacheableBitmapDrawable

detach

public void detach()
Specified by:
MapTileLayerBase

Overlay

java.lang.Object com.mapbox.mapboxsdk.overlay.Overlay
Direct Known Subclasses:
SafeDrawOverlay
public abstract class Overlay
extends java.lang.Object
Base class representing an overlay which may be displayed on top of a MapView. To add an overlay, subclass this class, create an instance, and add it to the list obtained from getOverlays() of MapView.

This class implements a form of Gesture Handling similar to GestureDetector.SimpleOnGestureListener and GestureDetector.OnGestureListener. The difference is there is an additional argument for the item.

Nested Class Summary

Nested Classes 
Modifier and Type Class and Description
static interface  Overlay.Snappable
Interface definition for overlays that contain items that can be snapped to (for example, when the user invokes a zoom, this could be called allowing the user to snap the zoom to an interesting point.)

Field Summary

Fields 
Modifier and Type Field and Description
static int MAPEVENTSOVERLAY_INDEX 
protected float mScale 
static int PATHOVERLAY_INDEX 
static int USERLOCATIONOVERLAY_INDEX 

Constructor Summary

Constructors 
Constructor and Description
Overlay() 
Overlay(android.content.Context ctx) 

Method Summary

Methods 
Modifier and Type Method and Description
protected abstract void draw(android.graphics.Canvas c, MapView osmv, boolean shadow)
Draw the overlay over the map.
protected static void drawAt(android.graphics.Canvas canvas, android.graphics.drawable.Drawable drawable, android.graphics.Point origin, android.graphics.Point offset, boolean shadow, float aMapOrientation)
Convenience method to draw a Drawable at an offset.
int getOverlayIndex()
Get the z position of this layer in the overlay stack
protected static int getSafeMenuId()
Since the menu-chain will pass through several independent Overlays, menu IDs cannot be fixed at compile time.
boolean isEnabled()
Specifies if the Overlay is marked to be enabled.
void MapView mapView)
Override to perform clean up of resources before shutdown.
boolean onDoubleTap(android.view.MotionEvent e, MapView mapView)
By default does nothing (return false).
boolean onDoubleTapEvent(android.view.MotionEvent e, MapView mapView)
By default does nothing (return false).
boolean onDown(android.view.MotionEvent e, MapView mapView)
By default does nothing (return false).
boolean onFling(android.view.MotionEvent pEvent1, android.view.MotionEvent pEvent2, float pVelocityX, float pVelocityY, MapView pMapView)
By default does nothing (return false).
boolean onKeyDown(int keyCode, android.view.KeyEvent event, MapView mapView)
By default does nothing (return false).
boolean onKeyUp(int keyCode, android.view.KeyEvent event, MapView mapView)
By default does nothing (return false).
boolean onLongPress(android.view.MotionEvent e, MapView mapView)
By default does nothing (return false).
boolean onScroll(android.view.MotionEvent pEvent1, android.view.MotionEvent pEvent2, float pDistanceX, float pDistanceY, MapView pMapView)
By default does nothing (return false).
void onShowPress(android.view.MotionEvent pEvent, MapView pMapView) 
boolean onSingleTapConfirmed(android.view.MotionEvent e, MapView mapView)
By default does nothing (return false).
boolean onSingleTapUp(android.view.MotionEvent e, MapView mapView)
By default does nothing (return false).
boolean onTouchEvent(android.view.MotionEvent event, MapView mapView)
You can prevent all(!) other Touch-related events from happening! By default does nothing (return false).
boolean onTrackballEvent(android.view.MotionEvent event, MapView mapView)
By default does nothing (return false).
Overlay setContext(android.content.Context ctx) 
void setEnabled(boolean pEnabled)
Sets whether the Overlay is marked to be enabled.
void setOverlayIndex(int overlayIndex)
Sets the z position of this layer in the layer stack larger values for @param layerIndex are drawn on top.

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

mScale

protected float mScale

MAPEVENTSOVERLAY_INDEX

public static final int MAPEVENTSOVERLAY_INDEX
See Also:
Constant Field Values

PATHOVERLAY_INDEX

public static final int PATHOVERLAY_INDEX
See Also:
Constant Field Values

USERLOCATIONOVERLAY_INDEX

public static final int USERLOCATIONOVERLAY_INDEX
See Also:
Constant Field Values

Constructor Detail

Overlay

public Overlay()

Overlay

public Overlay(android.content.Context ctx)

Method Detail

setContext

public Overlay setContext(android.content.Context ctx)

setOverlayIndex

public void setOverlayIndex(int overlayIndex)
Sets the z position of this layer in the layer stack larger values for @param layerIndex are drawn on top. Default values are: 0 for MapEventsOverlay 1 for PathOverlay 2 for UserLocationOverlay 3 for other Overlays

getOverlayIndex

public int getOverlayIndex()
Get the z position of this layer in the overlay stack
Returns:
overlay index, larger values are drawn on top

setEnabled

public void setEnabled(boolean pEnabled)
Sets whether the Overlay is marked to be enabled. This setting does nothing by default, but should be checked before calling draw().

isEnabled

public boolean isEnabled()
Specifies if the Overlay is marked to be enabled. This should be checked before calling draw().
Returns:
true if the Overlay is marked enabled, false otherwise

getSafeMenuId

protected static final int getSafeMenuId()
Since the menu-chain will pass through several independent Overlays, menu IDs cannot be fixed at compile time. Overlays should use this method to obtain and store a menu id for each menu item at construction time. This will ensure that two overlays don't use the same id.
Returns:
an integer suitable to be used as a menu identifier

draw

protected abstract void draw(android.graphics.Canvas c,
        MapView osmv,
        boolean shadow)
Draw the overlay over the map. This will be called on all active overlays with shadow=true, to lay down the shadow layer, and then again on all overlays with shadow=false. Callers should check isEnabled() before calling draw(). By default, draws nothing.

onDetach

public void onDetach(MapView mapView)
Override to perform clean up of resources before shutdown. By default does nothing.

onKeyDown

public boolean onKeyDown(int keyCode,
                android.view.KeyEvent event,
                MapView mapView)
By default does nothing (return false). If you handled the Event, return true, otherwise return false. If you returned true none of the following Overlays or the underlying MapView has the chance to handle this event.

onKeyUp

public boolean onKeyUp(int keyCode,
              android.view.KeyEvent event,
              MapView mapView)
By default does nothing (return false). If you handled the Event, return true, otherwise return false. If you returned true none of the following Overlays or the underlying MapView has the chance to handle this event.

onTouchEvent

public boolean onTouchEvent(android.view.MotionEvent event,
                   MapView mapView)
You can prevent all(!) other Touch-related events from happening! By default does nothing (return false). If you handled the Event, return true, otherwise return false. If you returned true none of the following Overlays or the underlying MapView has the chance to handle this event.

onTrackballEvent

public boolean onTrackballEvent(android.view.MotionEvent event,
                       MapView mapView)
By default does nothing (return false). If you handled the Event, return true, otherwise return false. If you returned true none of the following Overlays or the underlying MapView has the chance to handle this event.

onDoubleTap

public boolean onDoubleTap(android.view.MotionEvent e,
                  MapView mapView)
By default does nothing (return false). If you handled the Event, return true, otherwise return false. If you returned true none of the following Overlays or the underlying MapView has the chance to handle this event.

onDoubleTapEvent

public boolean onDoubleTapEvent(android.view.MotionEvent e,
                       MapView mapView)
By default does nothing (return false). If you handled the Event, return true, otherwise return false. If you returned true none of the following Overlays or the underlying MapView has the chance to handle this event.

onSingleTapConfirmed

public boolean onSingleTapConfirmed(android.view.MotionEvent e,
                           MapView mapView)
By default does nothing (return false). If you handled the Event, return true, otherwise return false. If you returned true none of the following Overlays or the underlying MapView has the chance to handle this event.

onDown

public boolean onDown(android.view.MotionEvent e,
             MapView mapView)
By default does nothing (return false). If you handled the Event, return true, otherwise return false. If you returned true none of the following Overlays or the underlying MapView has the chance to handle this event.

onFling

public boolean onFling(android.view.MotionEvent pEvent1,
              android.view.MotionEvent pEvent2,
              float pVelocityX,
              float pVelocityY,
              MapView pMapView)
By default does nothing (return false). If you handled the Event, return true, otherwise return false. If you returned true none of the following Overlays or the underlying MapView has the chance to handle this event.

onLongPress

public boolean onLongPress(android.view.MotionEvent e,
                  MapView mapView)
By default does nothing (return false). If you handled the Event, return true, otherwise return false. If you returned true none of the following Overlays or the underlying MapView has the chance to handle this event.

onScroll

public boolean onScroll(android.view.MotionEvent pEvent1,
               android.view.MotionEvent pEvent2,
               float pDistanceX,
               float pDistanceY,
               MapView pMapView)
By default does nothing (return false). If you handled the Event, return true, otherwise return false. If you returned true none of the following Overlays or the underlying MapView has the chance to handle this event.

onShowPress

public void onShowPress(android.view.MotionEvent pEvent,
               MapView pMapView)

onSingleTapUp

public boolean onSingleTapUp(android.view.MotionEvent e,
                    MapView mapView)
By default does nothing (return false). If you handled the Event, return true, otherwise return false. If you returned true none of the following Overlays or the underlying MapView has the chance to handle this event.

drawAt

protected static void drawAt(android.graphics.Canvas canvas,
          android.graphics.drawable.Drawable drawable,
          android.graphics.Point origin,
          android.graphics.Point offset,
          boolean shadow,
          float aMapOrientation)
Convenience method to draw a Drawable at an offset. x and y are pixel coordinates. You can find appropriate coordinates from latitude/longitude using the MapView.getProjection() method on the MapView passed to you in draw(Canvas, MapView, boolean).
Parameters:
shadow - If true, draw only the drawable's shadow. Otherwise, draw the drawable itself.

Overlay.Snappable

All Known Implementing Classes:
UserLocationOverlay
Enclosing class:
Overlay
public static interface Overlay.Snappable
Interface definition for overlays that contain items that can be snapped to (for example, when the user invokes a zoom, this could be called allowing the user to snap the zoom to an interesting point.)

Method Summary

Methods 
Modifier and Type Method and Description
boolean onSnapToItem(int x, int y, android.graphics.Point snapPoint, MapView mapView)
Checks to see if the given x and y are close enough to an item resulting in snapping the current action (e.g.

Method Detail

onSnapToItem

boolean onSnapToItem(int x,
                   int y,
                   android.graphics.Point snapPoint,
                   MapView mapView)
Checks to see if the given x and y are close enough to an item resulting in snapping the current action (e.g. zoom) to the item.
Parameters:
x - The x in screen coordinates.
y - The y in screen coordinates.
snapPoint - To be filled with the the interesting point (in screen coordinates) that is closest to the given x and y. Can be untouched if not snapping.
mapView - The MapView that is requesting the snap. Use MapView.getProjection() to convert between on-screen pixels and latitude/longitude pairs.
Returns:
Whether or not to snap to the interesting point.

OverlayManager

java.lang.Object java.util.AbstractCollection<E> java.util.AbstractList<Overlay> com.mapbox.mapboxsdk.overlay.OverlayManager
All Implemented Interfaces:
java.lang.Iterable<Overlay>
public class OverlayManager
extends java.util.AbstractList<Overlay>

Field Summary

Fields inherited from class java.util.AbstractList

modCount

Constructor Summary

Constructors 
Constructor and Description
TilesOverlay tilesOverlay) 

Method Summary

Methods 
Modifier and Type Method and Description
void add(int pIndex, Overlay pElement) 
void draw(android.graphics.Canvas c, MapView pMapView) 
Overlay get(int pIndex) 
TilesOverlay getTilesOverlay()
Gets the optional TilesOverlay class.
boolean isUsingSafeCanvas() 
boolean onCreateOptionsMenu(android.view.Menu pMenu, int menuIdOffset, MapView mapView) 
void MapView pMapView) 
boolean onDoubleTap(android.view.MotionEvent e, MapView pMapView) 
boolean onDoubleTapEvent(android.view.MotionEvent e, MapView pMapView) 
boolean onDown(android.view.MotionEvent pEvent, MapView pMapView) 
boolean onFling(android.view.MotionEvent pEvent1, android.view.MotionEvent pEvent2, float pVelocityX, float pVelocityY, MapView pMapView) 
boolean onKeyDown(int keyCode, android.view.KeyEvent event, MapView pMapView) 
boolean onKeyUp(int keyCode, android.view.KeyEvent event, MapView pMapView) 
boolean onLongPress(android.view.MotionEvent pEvent, MapView pMapView) 
boolean onOptionsItemSelected(android.view.MenuItem item, int menuIdOffset, MapView mapView) 
boolean onPrepareOptionsMenu(android.view.Menu pMenu, int menuIdOffset, MapView mapView) 
boolean onScroll(android.view.MotionEvent pEvent1, android.view.MotionEvent pEvent2, float pDistanceX, float pDistanceY, MapView pMapView) 
void onShowPress(android.view.MotionEvent pEvent, MapView pMapView) 
boolean onSingleTapConfirmed(android.view.MotionEvent e, MapView pMapView) 
boolean onSingleTapUp(android.view.MotionEvent pEvent, MapView pMapView) 
boolean onSnapToItem(int x, int y, android.graphics.Point snapPoint, MapView pMapView) 
boolean onTouchEvent(android.view.MotionEvent event, MapView pMapView) 
boolean onTrackballEvent(android.view.MotionEvent event, MapView pMapView) 
java.lang.Iterable<Overlay> overlaysReversed() 
Overlay remove(int pIndex) 
Overlay set(int pIndex, Overlay pElement) 
void setOptionsMenusEnabled(boolean pEnabled) 
void TilesOverlay tilesOverlay)
Sets the optional TilesOverlay class.
void setUseSafeCanvas(boolean useSafeCanvas) 
int size() 

Methods inherited from class java.util.AbstractList

add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, removeRange, subList

Methods inherited from class java.util.AbstractCollection

addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString

Methods inherited from class java.lang.Object

clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Methods inherited from interface java.util.List

addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray

Constructor Detail

OverlayManager

public OverlayManager(TilesOverlay tilesOverlay)

Method Detail

get

public Overlay get(int pIndex)
Specified by:
get in interface java.util.List<Overlay>
Specified by:
get in class java.util.AbstractList<Overlay>

size

public int size()
Specified by:
size in interface java.util.Collection<Overlay>
Specified by:
size in interface java.util.List<Overlay>
Specified by:
size in class java.util.AbstractCollection<Overlay>

add

public void add(int pIndex,
       Overlay pElement)
Specified by:
add in interface java.util.List<Overlay>
Overrides:
add in class java.util.AbstractList<Overlay>

remove

public Overlay remove(int pIndex)
Specified by:
remove in interface java.util.List<Overlay>
Overrides:
remove in class java.util.AbstractList<Overlay>

set

public Overlay set(int pIndex,
          Overlay pElement)
Specified by:
set in interface java.util.List<Overlay>
Overrides:
set in class java.util.AbstractList<Overlay>

isUsingSafeCanvas

public boolean isUsingSafeCanvas()

setUseSafeCanvas

public void setUseSafeCanvas(boolean useSafeCanvas)

getTilesOverlay

public TilesOverlay getTilesOverlay()
Gets the optional TilesOverlay class.
Returns:
the tilesOverlay

setTilesOverlay

public void setTilesOverlay(TilesOverlay tilesOverlay)
Sets the optional TilesOverlay class. If set, this overlay will be drawn before all other overlays and will not be included in the editable list of overlays and can't be cleared except by a subsequent call to setTilesOverlay().
Parameters:
tilesOverlay - the tilesOverlay to set

overlaysReversed

public java.lang.Iterable<Overlay> overlaysReversed()

draw

public void draw(android.graphics.Canvas c,
        MapView pMapView)

onDetach

public void onDetach(MapView pMapView)

onKeyDown

public boolean onKeyDown(int keyCode,
                android.view.KeyEvent event,
                MapView pMapView)

onKeyUp

public boolean onKeyUp(int keyCode,
              android.view.KeyEvent event,
              MapView pMapView)

onTouchEvent

public boolean onTouchEvent(android.view.MotionEvent event,
                   MapView pMapView)

onTrackballEvent

public boolean onTrackballEvent(android.view.MotionEvent event,
                       MapView pMapView)

onSnapToItem

public boolean onSnapToItem(int x,
                   int y,
                   android.graphics.Point snapPoint,
                   MapView pMapView)

onDoubleTap

public boolean onDoubleTap(android.view.MotionEvent e,
                  MapView pMapView)

onDoubleTapEvent

public boolean onDoubleTapEvent(android.view.MotionEvent e,
                       MapView pMapView)

onSingleTapConfirmed

public boolean onSingleTapConfirmed(android.view.MotionEvent e,
                           MapView pMapView)

onDown

public boolean onDown(android.view.MotionEvent pEvent,
             MapView pMapView)

onFling

public boolean onFling(android.view.MotionEvent pEvent1,
              android.view.MotionEvent pEvent2,
              float pVelocityX,
              float pVelocityY,
              MapView pMapView)

onLongPress

public boolean onLongPress(android.view.MotionEvent pEvent,
                  MapView pMapView)

onScroll

public boolean onScroll(android.view.MotionEvent pEvent1,
               android.view.MotionEvent pEvent2,
               float pDistanceX,
               float pDistanceY,
               MapView pMapView)

onShowPress

public void onShowPress(android.view.MotionEvent pEvent,
               MapView pMapView)

onSingleTapUp

public boolean onSingleTapUp(android.view.MotionEvent pEvent,
                    MapView pMapView)

setOptionsMenusEnabled

public void setOptionsMenusEnabled(boolean pEnabled)

onCreateOptionsMenu

public boolean onCreateOptionsMenu(android.view.Menu pMenu,
                          int menuIdOffset,
                          MapView mapView)

onPrepareOptionsMenu

public boolean onPrepareOptionsMenu(android.view.Menu pMenu,
                           int menuIdOffset,
                           MapView mapView)

onOptionsItemSelected

public boolean onOptionsItemSelected(android.view.MenuItem item,
                            int menuIdOffset,
                            MapView mapView)

PathOverlay

java.lang.Object com.mapbox.mapboxsdk.overlay.Overlay com.mapbox.mapboxsdk.overlay.PathOverlay
public class PathOverlay
extends Overlay

Nested Class Summary

Nested classes/interfaces inherited from class com.mapbox.mapboxsdk.overlay.Overlay

Overlay.Snappable

Field Summary

Fields 
Modifier and Type Field and Description
protected android.graphics.Paint mPaint
Paint settings.

Fields inherited from class com.mapbox.mapboxsdk.overlay.Overlay

USERLOCATIONOVERLAY_INDEX

Constructor Summary

Constructors 
Constructor and Description
PathOverlay() 
PathOverlay(int color, float width) 

Method Summary

Methods 
Modifier and Type Method and Description
void addPoint(double aLatitude, double aLongitude) 
void LatLng aPoint) 
void LatLng... aPoints) 
void LatLng> aPoints) 
void clearPath() 
protected void draw(android.graphics.Canvas canvas, MapView mapView, boolean shadow)
This method draws the line.
int getNumberOfPoints() 
android.graphics.Paint getPaint() 
void removeAllPoints() 
void setOptimizePath(boolean value)
if true the path will be optimised.
PathOverlay setPaint(android.graphics.Paint pPaint) 

Methods inherited from class com.mapbox.mapboxsdk.overlay.Overlay

setOverlayIndex

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

mPaint

protected android.graphics.Paint mPaint
Paint settings.

Constructor Detail

PathOverlay

public PathOverlay()

PathOverlay

public PathOverlay(int color,
           float width)

Method Detail

getPaint

public android.graphics.Paint getPaint()

setPaint

public PathOverlay setPaint(android.graphics.Paint pPaint)

clearPath

public void clearPath()

addPoint

public void addPoint(LatLng aPoint)

addPoint

public void addPoint(double aLatitude,
            double aLongitude)

addPoints

public void addPoints(LatLng... aPoints)

addPoints

public void addPoints(java.util.List<LatLng> aPoints)

removeAllPoints

public void removeAllPoints()

getNumberOfPoints

public int getNumberOfPoints()

draw

protected void draw(android.graphics.Canvas canvas,
        MapView mapView,
        boolean shadow)
This method draws the line. Note - highly optimized to handle long paths, proceed with care. Should be fine up to 10K points.
Specified by:
Overlay

setOptimizePath

public void setOptimizePath(boolean value)
if true the path will be optimised. True by default. But be aware that the optimize method does not work for filled path.

SafeDrawOverlay

java.lang.Object com.mapbox.mapboxsdk.overlay.Overlay com.mapbox.mapboxsdk.overlay.SafeDrawOverlay
Direct Known Subclasses:
UserLocationOverlay
public abstract class SafeDrawOverlay
extends Overlay
An overlay class that uses the safe drawing canvas to draw itself and can be zoomed in to high levels without drawing issues.
See Also:
ISafeCanvas}

Nested Class Summary

Nested classes/interfaces inherited from class com.mapbox.mapboxsdk.overlay.Overlay

Overlay.Snappable

Field Summary

Fields inherited from class com.mapbox.mapboxsdk.overlay.Overlay

USERLOCATIONOVERLAY_INDEX

Constructor Summary

Constructors 
Constructor and Description
SafeDrawOverlay() 

Method Summary

Methods 
Modifier and Type Method and Description
protected void draw(android.graphics.Canvas c, MapView mapView, boolean shadow)
Draw the overlay over the map.
protected abstract void ISafeCanvas c, MapView mapView, boolean shadow) 
boolean isUsingSafeCanvas() 
void setUseSafeCanvas(boolean useSafeCanvas) 

Methods inherited from class com.mapbox.mapboxsdk.overlay.Overlay

setOverlayIndex

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SafeDrawOverlay

public SafeDrawOverlay()

Method Detail

drawSafe

protected abstract void drawSafe(ISafeCanvas c,
            MapView mapView,
            boolean shadow)

draw

protected void draw(android.graphics.Canvas c,
        MapView mapView,
        boolean shadow)
Description copied from class: Overlay
Draw the overlay over the map. This will be called on all active overlays with shadow=true, to lay down the shadow layer, and then again on all overlays with shadow=false. Callers should check isEnabled() before calling draw(). By default, draws nothing.
Specified by:
Overlay

isUsingSafeCanvas

public boolean isUsingSafeCanvas()

setUseSafeCanvas

public void setUseSafeCanvas(boolean useSafeCanvas)

TilesOverlay

java.lang.Object com.mapbox.mapboxsdk.overlay.Overlay com.mapbox.mapboxsdk.overlay.SafeDrawOverlay com.mapbox.mapboxsdk.overlay.TilesOverlay
public class TilesOverlay
extends SafeDrawOverlay
These objects are the principle consumer of map tiles.

see MapTile for an overview of how tiles are acquired by this overlay.

Nested Class Summary

Nested classes/interfaces inherited from class com.mapbox.mapboxsdk.overlay.Overlay

Overlay.Snappable

Field Summary

Fields 
Modifier and Type Field and Description
protected static SafePaint mDebugPaint 
static int MENU_OFFLINE 
protected android.graphics.Paint mLoadingPaint 
protected static android.graphics.Bitmap mLoadingTileBitmap 
protected static SafePaint mLoadingTilePaint 
protected MapTileLayerBase mTileProvider
Current tile source

Fields inherited from class com.mapbox.mapboxsdk.overlay.Overlay

USERLOCATIONOVERLAY_INDEX

Constructor Summary

Constructors 
Constructor and Description
MapTileLayerBase aTileProvider) 

Method Summary

Methods 
Modifier and Type Method and Description
void drawLoadingTile(android.graphics.Canvas c, MapView mapView, float zoomLevel, android.graphics.Rect viewPort)
Draw a loading tile image to make in-progress tiles easier to deal with.
protected void ISafeCanvas c, MapView mapView, boolean shadow) 
void drawTiles(android.graphics.Canvas c, float zoomLevel, int tileSizePx, android.graphics.Rect viewPort, android.graphics.Rect pClipRect)
This is meant to be a "pure" tile drawing function that doesn't take into account osmdroid-specific characteristics (like osmdroid's canvas's having 0,0 as the center rather than the upper-left corner).
static SafePaint getDebugPaint() 
int getLoadingBackgroundColor() 
int getLoadingLineColor() 
float getMaximumZoomLevel() 
float getMinimumZoomLevel() 
void MapView pMapView)
Override to perform clean up of resources before shutdown.
void rescaleCache(float pNewZoomLevel, float pOldZoomLevel, Projection projection)
Recreate the cache using scaled versions of the tiles currently in it
void setLoadingBackgroundColor(int pLoadingBackgroundColor)
Set the color to use to draw the background while we're waiting for the tile to load.
void setLoadingLineColor(int pLoadingLineColor) 
void setUseDataConnection(boolean aMode)
Set whether to use the network connection if it's available.
boolean useDataConnection()
Whether to use the network connection if it's available.

Methods inherited from class com.mapbox.mapboxsdk.overlay.SafeDrawOverlay

setUseSafeCanvas

Methods inherited from class com.mapbox.mapboxsdk.overlay.Overlay

setOverlayIndex

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

MENU_OFFLINE

public static final int MENU_OFFLINE

mTileProvider

protected final MapTileLayerBase mTileProvider
Current tile source

mDebugPaint

protected static SafePaint mDebugPaint

mLoadingTilePaint

protected static SafePaint mLoadingTilePaint

mLoadingTileBitmap

protected static android.graphics.Bitmap mLoadingTileBitmap

mLoadingPaint

protected android.graphics.Paint mLoadingPaint

Constructor Detail

TilesOverlay

public TilesOverlay(MapTileLayerBase aTileProvider)

Method Detail

getDebugPaint

public static SafePaint getDebugPaint()

onDetach

public void onDetach(MapView pMapView)
Description copied from class: Overlay
Override to perform clean up of resources before shutdown. By default does nothing.
Overrides:
Overlay

getMinimumZoomLevel

public float getMinimumZoomLevel()

getMaximumZoomLevel

public float getMaximumZoomLevel()

useDataConnection

public boolean useDataConnection()
Whether to use the network connection if it's available.
Returns:
true if this uses a data connection

setUseDataConnection

public void setUseDataConnection(boolean aMode)
Set whether to use the network connection if it's available.
Parameters:
aMode - if true use the network connection if it's available. if false don't use the network connection even if it's available.

drawSafe

protected void drawSafe(ISafeCanvas c,
            MapView mapView,
            boolean shadow)
Specified by:
SafeDrawOverlay

drawLoadingTile

public void drawLoadingTile(android.graphics.Canvas c,
                   MapView mapView,
                   float zoomLevel,
                   android.graphics.Rect viewPort)
Draw a loading tile image to make in-progress tiles easier to deal with.
Parameters:
c -
mapView -
zoomLevel -
viewPort -

drawTiles

public void drawTiles(android.graphics.Canvas c,
             float zoomLevel,
             int tileSizePx,
             android.graphics.Rect viewPort,
             android.graphics.Rect pClipRect)
This is meant to be a "pure" tile drawing function that doesn't take into account osmdroid-specific characteristics (like osmdroid's canvas's having 0,0 as the center rather than the upper-left corner). Once the tile is ready to be drawn, it is passed to onTileReadyToDraw where custom manipulations can be made before drawing the tile.

getLoadingBackgroundColor

public int getLoadingBackgroundColor()

setLoadingBackgroundColor

public void setLoadingBackgroundColor(int pLoadingBackgroundColor)
Set the color to use to draw the background while we're waiting for the tile to load.
Parameters:
pLoadingBackgroundColor - the color to use. If the value is Color.TRANSPARENT then there will be no loading tile.

getLoadingLineColor

public int getLoadingLineColor()

setLoadingLineColor

public void setLoadingLineColor(int pLoadingLineColor)

rescaleCache

public void rescaleCache(float pNewZoomLevel,
                float pOldZoomLevel,
                Projection projection)
Recreate the cache using scaled versions of the tiles currently in it
Parameters:
pNewZoomLevel - the zoom level that we need now
pOldZoomLevel - the previous zoom level that we should get the tiles to rescale
projection - the projection to compute view port

UserLocationOverlay

java.lang.Object com.mapbox.mapboxsdk.overlay.Overlay com.mapbox.mapboxsdk.overlay.SafeDrawOverlay com.mapbox.mapboxsdk.overlay.UserLocationOverlay
All Implemented Interfaces:
Overlay.Snappable
public class UserLocationOverlay
extends SafeDrawOverlay
implements MapListener

Nested Class Summary

Nested Classes 
Modifier and Type Class and Description
static class  UserLocationOverlay.TrackingMode 

Nested classes/interfaces inherited from class com.mapbox.mapboxsdk.overlay.Overlay

Overlay.Snappable

Field Summary

Fields 
Modifier and Type Field and Description
protected android.content.Context mContext 
protected MapView mMapView 
GpsLocationProvider mMyLocationProvider 

Fields inherited from class com.mapbox.mapboxsdk.overlay.Overlay

USERLOCATIONOVERLAY_INDEX

Constructor Summary

Constructors 
Constructor and Description
GpsLocationProvider myLocationProvider, MapView mapView) 
GpsLocationProvider myLocationProvider, MapView mapView, int arrowId, int personId) 

Method Summary

Methods 
Modifier and Type Method and Description
void disableFollowLocation()
Disables "follow" functionality.
void disableMyLocation()
Disable location updates
protected void ISafeCanvas canvas, MapView mapView, android.location.Location lastFix) 
protected void ISafeCanvas canvas, MapView mapView, boolean shadow) 
void enableFollowLocation()
Enables "follow" functionality.
boolean enableMyLocation()
Enable receiving location updates from the provided GpsLocationProvider and show your location on the maps.
boolean GpsLocationProvider myLocationProvider) 
protected android.graphics.RectF getDrawingBounds(android.graphics.PointF positionOnScreen, android.location.Location lastFix, android.graphics.RectF reuse) 
protected android.graphics.RectF Projection projection, android.location.Location lastFix, android.graphics.RectF reuse) 
android.graphics.PointF Projection projection, android.location.Location lastFix, android.graphics.PointF reuse) 
android.location.Location getLastFix() 
LatLng getMyLocation()
Return a LatLng of the last known location, or null if not known.
protected android.graphics.RectF MapView mv, android.location.Location lastFix, android.graphics.RectF reuse) 
GpsLocationProvider getMyLocationProvider() 
android.graphics.PointF Projection projection, android.graphics.PointF reuse) 
UserLocationOverlay.TrackingMode getTrackingMode() 
boolean goToMyPosition(boolean animated) 
boolean isDrawAccuracyEnabled()
If enabled, an accuracy circle will be drawn around your current position.
boolean isFollowLocationEnabled()
If enabled, the map will center on your current location and automatically scroll as you move.
boolean isMyLocationEnabled()
If enabled, the map is receiving location updates and drawing your location on the map.
void MapView mapView)
Override to perform clean up of resources before shutdown.
void onLocationChanged(android.location.Location location, GpsLocationProvider source) 
void RotateEvent event)
Called when a map is rotated.
void ScrollEvent event)
Called when a map is scrolled.
boolean onSnapToItem(int x, int y, android.graphics.Point snapPoint, MapView mapView)
Checks to see if the given x and y are close enough to an item resulting in snapping the current action (e.g.
boolean onTouchEvent(android.view.MotionEvent event, MapView mapView)
You can prevent all(!) other Touch-related events from happening! By default does nothing (return false).
void ZoomEvent event)
Called when a map is zoomed.
boolean runOnFirstFix(java.lang.Runnable runnable) 
void setDirectionArrowBitmap(android.graphics.Bitmap bitmap) 
void setDirectionArrowHotspot(android.graphics.PointF point) 
void setDrawAccuracyEnabled(boolean drawAccuracyEnabled)
If enabled, an accuracy circle will be drawn around your current position.
protected void GpsLocationProvider myLocationProvider) 
void setOverlayCircleColor(int newColor) 
void setPersonBitmap(android.graphics.Bitmap bitmap) 
void setPersonHotspot(android.graphics.PointF point) 
void setRequiredZoom(float zoomLevel) 
void UserLocationOverlay.TrackingMode mode) 

Methods inherited from class com.mapbox.mapboxsdk.overlay.SafeDrawOverlay

setUseSafeCanvas

Methods inherited from class com.mapbox.mapboxsdk.overlay.Overlay

setOverlayIndex

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

mMapView

protected final MapView mMapView

mContext

protected final android.content.Context mContext

mMyLocationProvider

public GpsLocationProvider mMyLocationProvider

Constructor Detail

UserLocationOverlay

public UserLocationOverlay(GpsLocationProvider myLocationProvider,
                   MapView mapView,
                   int arrowId,
                   int personId)

UserLocationOverlay

public UserLocationOverlay(GpsLocationProvider myLocationProvider,
                   MapView mapView)

Method Detail

setDirectionArrowBitmap

public void setDirectionArrowBitmap(android.graphics.Bitmap bitmap)

setPersonBitmap

public void setPersonBitmap(android.graphics.Bitmap bitmap)

setDirectionArrowHotspot

public void setDirectionArrowHotspot(android.graphics.PointF point)

setPersonHotspot

public void setPersonHotspot(android.graphics.PointF point)

setOverlayCircleColor

public void setOverlayCircleColor(int newColor)

onDetach

public void onDetach(MapView mapView)
Description copied from class: Overlay
Override to perform clean up of resources before shutdown. By default does nothing.
Overrides:
Overlay

setDrawAccuracyEnabled

public void setDrawAccuracyEnabled(boolean drawAccuracyEnabled)
If enabled, an accuracy circle will be drawn around your current position.
Parameters:
drawAccuracyEnabled - whether the accuracy circle will be enabled

isDrawAccuracyEnabled

public boolean isDrawAccuracyEnabled()
If enabled, an accuracy circle will be drawn around your current position.
Returns:
true if enabled, false otherwise

getMyLocationProvider

public GpsLocationProvider getMyLocationProvider()

setMyLocationProvider

protected void setMyLocationProvider(GpsLocationProvider myLocationProvider)

drawMyLocation

protected void drawMyLocation(ISafeCanvas canvas,
                  MapView mapView,
                  android.location.Location lastFix)

getPositionOnScreen

public android.graphics.PointF getPositionOnScreen(Projection projection,
                                          android.graphics.PointF reuse)

getDrawingPositionOnScreen

public android.graphics.PointF getDrawingPositionOnScreen(Projection projection,
                                                 android.location.Location lastFix,
                                                 android.graphics.PointF reuse)

getDrawingBounds

protected android.graphics.RectF getDrawingBounds(Projection projection,
                                      android.location.Location lastFix,
                                      android.graphics.RectF reuse)

getDrawingBounds

protected android.graphics.RectF getDrawingBounds(android.graphics.PointF positionOnScreen,
                                      android.location.Location lastFix,
                                      android.graphics.RectF reuse)

getMyLocationMapDrawingBounds

protected android.graphics.RectF getMyLocationMapDrawingBounds(MapView mv,
                                                   android.location.Location lastFix,
                                                   android.graphics.RectF reuse)

drawSafe

protected void drawSafe(ISafeCanvas canvas,
            MapView mapView,
            boolean shadow)
Specified by:
SafeDrawOverlay

onSnapToItem

public boolean onSnapToItem(int x,
                   int y,
                   android.graphics.Point snapPoint,
                   MapView mapView)
Description copied from interface: Overlay.Snappable
Checks to see if the given x and y are close enough to an item resulting in snapping the current action (e.g. zoom) to the item.
Specified by:
Overlay.Snappable
Parameters:
x - The x in screen coordinates.
y - The y in screen coordinates.
snapPoint - To be filled with the the interesting point (in screen coordinates) that is closest to the given x and y. Can be untouched if not snapping.
mapView - The MapView that is requesting the snap. Use MapView.getProjection() to convert between on-screen pixels and latitude/longitude pairs.
Returns:
Whether or not to snap to the interesting point.

onTouchEvent

public boolean onTouchEvent(android.view.MotionEvent event,
                   MapView mapView)
Description copied from class: Overlay
You can prevent all(!) other Touch-related events from happening! By default does nothing (return false). If you handled the Event, return true, otherwise return false. If you returned true none of the following Overlays or the underlying MapView has the chance to handle this event.
Overrides:
Overlay

getMyLocation

public LatLng getMyLocation()
Return a LatLng of the last known location, or null if not known.

getLastFix

public android.location.Location getLastFix()

enableFollowLocation

public void enableFollowLocation()
Enables "follow" functionality. The map will center on your current location and automatically scroll as you move. Scrolling the map in the UI will disable.

disableFollowLocation

public void disableFollowLocation()
Disables "follow" functionality.

setTrackingMode

public void setTrackingMode(UserLocationOverlay.TrackingMode mode)

setRequiredZoom

public void setRequiredZoom(float zoomLevel)

getTrackingMode

public UserLocationOverlay.TrackingMode getTrackingMode()

isFollowLocationEnabled

public boolean isFollowLocationEnabled()
If enabled, the map will center on your current location and automatically scroll as you move. Scrolling the map in the UI will disable.
Returns:
true if enabled, false otherwise

onLocationChanged

public void onLocationChanged(android.location.Location location,
                     GpsLocationProvider source)

enableMyLocation

public boolean enableMyLocation(GpsLocationProvider myLocationProvider)

goToMyPosition

public boolean goToMyPosition(boolean animated)

enableMyLocation

public boolean enableMyLocation()
Enable receiving location updates from the provided GpsLocationProvider and show your location on the maps. You will likely want to call enableMyLocation() from your Activity's Activity.onResume() method, to enable the features of this overlay. Remember to call the corresponding disableMyLocation() in your Activity's Activity.onPause() method to turn off updates when in the background.

disableMyLocation

public void disableMyLocation()
Disable location updates

isMyLocationEnabled

public boolean isMyLocationEnabled()
If enabled, the map is receiving location updates and drawing your location on the map.
Returns:
true if enabled, false otherwise

runOnFirstFix

public boolean runOnFirstFix(java.lang.Runnable runnable)

onScroll

public void onScroll(ScrollEvent event)
Description copied from interface: MapListener
Called when a map is scrolled.
Specified by:
MapListener

onZoom

public void onZoom(ZoomEvent event)
Description copied from interface: MapListener
Called when a map is zoomed.
Specified by:
MapListener

onRotate

public void onRotate(RotateEvent event)
Description copied from interface: MapListener
Called when a map is rotated.
Specified by:
MapListener

UserLocationOverlay.TrackingMode

java.lang.Object java.lang.Enum<UserLocationOverlay.TrackingMode> com.mapbox.mapboxsdk.overlay.UserLocationOverlay.TrackingMode
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<UserLocationOverlay.TrackingMode>
Enclosing class:
UserLocationOverlay
public static enum UserLocationOverlay.TrackingMode
extends java.lang.Enum<UserLocationOverlay.TrackingMode>

Enum Constant Summary

Enum Constants 
Enum Constant and Description
FOLLOW 
FOLLOW_BEARING 
NONE 

Method Summary

Methods 
Modifier and Type Method and Description
static UserLocationOverlay.TrackingMode valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
static UserLocationOverlay.TrackingMode[] values()
Returns an array containing the constants of this enum type, in the order they are declared.

Methods inherited from class java.lang.Enum

clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf

Methods inherited from class java.lang.Object

getClass, notify, notifyAll, wait, wait, wait

Enum Constant Detail

NONE

public static final UserLocationOverlay.TrackingMode NONE

FOLLOW

public static final UserLocationOverlay.TrackingMode FOLLOW

FOLLOW_BEARING

public static final UserLocationOverlay.TrackingMode FOLLOW_BEARING

Method Detail

values

public static UserLocationOverlay.TrackingMode[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (UserLocationOverlay.TrackingMode c : UserLocationOverlay.TrackingMode.values())
    System.out.println(c);
Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static UserLocationOverlay.TrackingMode valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

TileLayerConstants

All Known Implementing Classes:
WebSourceTileLayer
public interface TileLayerConstants
This class contains constants used by the tile provider.

Field Summary

Fields 
Modifier and Type Field and Description
static int CACHE_MAPTILECOUNT_DEFAULT
Initial tile cache size.
static int CACHE_MAPTILEDISKSIZE_DEFAULT 
static boolean DEBUG_TILE_PROVIDERS 
static int DEFAULT_TILE_SIZE 
static int MAXIMUM_ZOOMLEVEL
Maximum Zoom Level - we use Integers to store zoom levels so overflow happens at 2^32 - 1, but we also have a tile size that is typically 2^8, so (32-1)-8-1 = 22
static int MINIMUM_ZOOMLEVEL
Minimum Zoom Level
static int NUMBER_OF_TILE_DOWNLOAD_THREADS
number of tile download threads, conforming to OSM policy: http://wiki.openstreetmap.org/wiki/Tile_usage_policy
static int RETINA_TILE_SIZE 
static int TILE_DOWNLOAD_MAXIMUM_QUEUE_SIZE 
static BoundingBox WORLD_BOUNDING_BOX 

Field Detail

DEBUG_TILE_PROVIDERS

static final boolean DEBUG_TILE_PROVIDERS
See Also:
Constant Field Values

WORLD_BOUNDING_BOX

static final BoundingBox WORLD_BOUNDING_BOX

MINIMUM_ZOOMLEVEL

static final int MINIMUM_ZOOMLEVEL
Minimum Zoom Level
See Also:
Constant Field Values

MAXIMUM_ZOOMLEVEL

static final int MAXIMUM_ZOOMLEVEL
Maximum Zoom Level - we use Integers to store zoom levels so overflow happens at 2^32 - 1, but we also have a tile size that is typically 2^8, so (32-1)-8-1 = 22
See Also:
Constant Field Values

DEFAULT_TILE_SIZE

static final int DEFAULT_TILE_SIZE
See Also:
Constant Field Values

RETINA_TILE_SIZE

static final int RETINA_TILE_SIZE
See Also:
Constant Field Values

CACHE_MAPTILECOUNT_DEFAULT

static final int CACHE_MAPTILECOUNT_DEFAULT
Initial tile cache size. The size will be increased as required by calling LRUMapTileCache.ensureCapacity(int) The tile cache will always be at least 3x3.
See Also:
Constant Field Values

CACHE_MAPTILEDISKSIZE_DEFAULT

static final int CACHE_MAPTILEDISKSIZE_DEFAULT
See Also:
Constant Field Values

NUMBER_OF_TILE_DOWNLOAD_THREADS

static final int NUMBER_OF_TILE_DOWNLOAD_THREADS
number of tile download threads, conforming to OSM policy: http://wiki.openstreetmap.org/wiki/Tile_usage_policy
See Also:
Constant Field Values

TILE_DOWNLOAD_MAXIMUM_QUEUE_SIZE

static final int TILE_DOWNLOAD_MAXIMUM_QUEUE_SIZE
See Also:
Constant Field Values

IMapTileProviderCallback

All Known Implementing Classes:
OfflineMapTileProvider
public interface IMapTileProviderCallback

Method Summary

Methods 
Modifier and Type Method and Description
void MapTileRequestState aState, android.graphics.drawable.Drawable aDrawable)
The map tile request has completed.
void MapTileRequestState aState, CacheableBitmapDrawable aDrawable)
The map tile request has produced an expired tile.
void MapTileRequestState aState)
The map tile request has failed.
boolean useDataConnection()
Returns true if the network connection should be used, false if not.

Method Detail

mapTileRequestCompleted

void mapTileRequestCompleted(MapTileRequestState aState,
                           android.graphics.drawable.Drawable aDrawable)
The map tile request has completed.
Parameters:
aState - a state object
aDrawable - a drawable

mapTileRequestFailed

void mapTileRequestFailed(MapTileRequestState aState)
The map tile request has failed.
Parameters:
aState - a state object

mapTileRequestExpiredTile

void mapTileRequestExpiredTile(MapTileRequestState aState,
                             CacheableBitmapDrawable aDrawable)
The map tile request has produced an expired tile.
Parameters:
aState - a state object

useDataConnection

boolean useDataConnection()
Returns true if the network connection should be used, false if not.
Returns:
true if data connection should be used, false otherwise

IRegisterReceiver

All Known Implementing Classes:
SimpleRegisterReceiver
public interface IRegisterReceiver

Method Summary

Methods 
Modifier and Type Method and Description
android.content.Intent registerReceiver(android.content.BroadcastReceiver receiver, android.content.IntentFilter filter) 
void unregisterReceiver(android.content.BroadcastReceiver receiver) 

Method Detail

registerReceiver

android.content.Intent registerReceiver(android.content.BroadcastReceiver receiver,
                                      android.content.IntentFilter filter)

unregisterReceiver

void unregisterReceiver(android.content.BroadcastReceiver receiver)

MapTile

java.lang.Object com.mapbox.mapboxsdk.tileprovider.MapTile
public class MapTile
extends java.lang.Object
A map tile is distributed using the observer pattern. The tile is delivered by a tile provider (i.e. a descendant of MapTileModuleLayerBase or MapTileLayerBase to a consumer of tiles (e.g. descendant of TilesOverlay). Tiles are typically images (e.g. png or jpeg).

Field Summary

Fields 
Modifier and Type Field and Description
static int MAPTILE_FAIL_ID 
static int MAPTILE_SUCCESS_ID 

Constructor Summary

Constructors 
Constructor and Description
MapTile(int az, int ax, int ay) 
MapTile(java.lang.String aCacheKey, int az, int ax, int ay) 

Method Summary

Methods 
Modifier and Type Method and Description
boolean equals(java.lang.Object obj) 
java.lang.String getCacheKey() 
java.lang.String getPath() 
android.graphics.Rect getTileRect() 
int getX() 
int getY() 
int getZ() 
int hashCode() 
void setTileRect(android.graphics.Rect rect) 
java.lang.String toString() 

Methods inherited from class java.lang.Object

clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Field Detail

MAPTILE_SUCCESS_ID

public static final int MAPTILE_SUCCESS_ID
See Also:
Constant Field Values

MAPTILE_FAIL_ID

public static final int MAPTILE_FAIL_ID
See Also:
Constant Field Values

Constructor Detail

MapTile

public MapTile(int az,
       int ax,
       int ay)

MapTile

public MapTile(java.lang.String aCacheKey,
       int az,
       int ax,
       int ay)

Method Detail

getZ

public int getZ()

getX

public int getX()

getY

public int getY()

getPath

public java.lang.String getPath()

getCacheKey

public java.lang.String getCacheKey()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

setTileRect

public void setTileRect(android.graphics.Rect rect)

getTileRect

public final android.graphics.Rect getTileRect()

MapTileCache

java.lang.Object com.mapbox.mapboxsdk.tileprovider.MapTileCache
All Implemented Interfaces:
TileLayerConstants
public class MapTileCache
extends java.lang.Object
implements TileLayerConstants
A wrapper around a BitmapLruCache that stores tiles on disk in order to improve performance and provide offline content.

Field Summary

Fields 
Modifier and Type Field and Description
protected static BitmapLruCache sCachedTiles 

Fields inherited from interface com.mapbox.mapboxsdk.tileprovider.constants.TileLayerConstants

WORLD_BOUNDING_BOX

Constructor Summary

Constructors 
Constructor and Description
MapTileCache(android.content.Context aContext) 
MapTileCache(android.content.Context aContext, int aMaximumCacheSize) 

Method Summary

Methods 
Modifier and Type Method and Description
boolean MapTile aTile) 
boolean MapTile aTile) 
CacheableBitmapDrawable createCacheableBitmapDrawable(android.graphics.Bitmap bitmap, MapTile aTile) 
android.graphics.Bitmap BitmapLruCache.InputStreamProvider ip, android.graphics.BitmapFactory.Options opts) 
android.graphics.Bitmap decodeBitmap(byte[] data, android.graphics.BitmapFactory.Options opts) 
android.graphics.Bitmap getBitmapFromRemoved(int width, int height) 
protected BitmapLruCache getCache()
Get the BitmapLruCache that belongs to this tile cache, creating it first if there isn't one yet.
java.lang.String MapTile aTile)
Computes a prefixed key for a tile.
static java.io.File getDiskCacheDir(android.content.Context context, java.lang.String uniqueName)
Creates a unique subdirectory of the designated app cache directory.
CacheableBitmapDrawable MapTile aTile) 
CacheableBitmapDrawable MapTile aTile) 
CacheableBitmapDrawable MapTile aTile) 
boolean isDiskCacheEnabled() 
void purgeDiskCache() 
void purgeMemoryCache() 
CacheableBitmapDrawable MapTile aTile, android.graphics.drawable.Drawable aDrawable) 
CacheableBitmapDrawable MapTile aTile, android.graphics.Bitmap bitmap) 
CacheableBitmapDrawable MapTile aTile, android.graphics.drawable.Drawable aDrawable) 
CacheableBitmapDrawable MapTile aTile, android.graphics.Bitmap aBitmap) 
CacheableBitmapDrawable MapTile aTile, android.graphics.drawable.Drawable aDrawable) 
CacheableBitmapDrawable MapTile aTile, java.io.InputStream inputStream, android.graphics.BitmapFactory.Options decodeOpts) 
void MapTile aTile) 
void MapTile aTile) 
void setDiskCacheEnabled(boolean enabled) 

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

sCachedTiles

protected static BitmapLruCache sCachedTiles

Constructor Detail

MapTileCache

public MapTileCache(android.content.Context aContext)

MapTileCache

public MapTileCache(android.content.Context aContext,
            int aMaximumCacheSize)

Method Detail

getCache

protected BitmapLruCache getCache()
Get the BitmapLruCache that belongs to this tile cache, creating it first if there isn't one yet.
Returns:
BitmapLruCache the cache

getCacheKey

public java.lang.String getCacheKey(MapTile aTile)
Computes a prefixed key for a tile.
Parameters:
aTile - the tile
Returns:
the key

getMapTile

public CacheableBitmapDrawable getMapTile(MapTile aTile)

getMapTileFromMemory

public CacheableBitmapDrawable getMapTileFromMemory(MapTile aTile)

getMapTileFromDisk

public CacheableBitmapDrawable getMapTileFromDisk(MapTile aTile)

putTileStream

public CacheableBitmapDrawable putTileStream(MapTile aTile,
                                    java.io.InputStream inputStream,
                                    android.graphics.BitmapFactory.Options decodeOpts)

putTileBitmap

public CacheableBitmapDrawable putTileBitmap(MapTile aTile,
                                    android.graphics.Bitmap bitmap)

putTile

public CacheableBitmapDrawable putTile(MapTile aTile,
                              android.graphics.drawable.Drawable aDrawable)

putTileInMemoryCache

public CacheableBitmapDrawable putTileInMemoryCache(MapTile aTile,
                                           android.graphics.Bitmap aBitmap)

putTileInMemoryCache

public CacheableBitmapDrawable putTileInMemoryCache(MapTile aTile,
                                           android.graphics.drawable.Drawable aDrawable)

putTileInDiskCache

public CacheableBitmapDrawable putTileInDiskCache(MapTile aTile,
                                         android.graphics.drawable.Drawable aDrawable)

containsTile

public boolean containsTile(MapTile aTile)

containsTileInDiskCache

public boolean containsTileInDiskCache(MapTile aTile)

removeTile

public void removeTile(MapTile aTile)

removeTileFromMemory

public void removeTileFromMemory(MapTile aTile)

purgeMemoryCache

public void purgeMemoryCache()

purgeDiskCache

public void purgeDiskCache()

createCacheableBitmapDrawable

public CacheableBitmapDrawable createCacheableBitmapDrawable(android.graphics.Bitmap bitmap,
                                                    MapTile aTile)

getBitmapFromRemoved

public android.graphics.Bitmap getBitmapFromRemoved(int width,
                                           int height)

decodeBitmap

public android.graphics.Bitmap decodeBitmap(byte[] data,
                                   android.graphics.BitmapFactory.Options opts)

decodeBitmap

public android.graphics.Bitmap decodeBitmap(BitmapLruCache.InputStreamProvider ip,
                                   android.graphics.BitmapFactory.Options opts)

getDiskCacheDir

public static java.io.File getDiskCacheDir(android.content.Context context,
                           java.lang.String uniqueName)
Creates a unique subdirectory of the designated app cache directory. Tries to use external but if not mounted, falls back on internal storage.

setDiskCacheEnabled

public void setDiskCacheEnabled(boolean enabled)

isDiskCacheEnabled

public boolean isDiskCacheEnabled()

MapTileLayerArray

java.lang.Object com.mapbox.mapboxsdk.tileprovider.MapTileLayerBase com.mapbox.mapboxsdk.tileprovider.MapTileLayerArray
All Implemented Interfaces:
IMapTileProviderCallback
Direct Known Subclasses:
MapTileLayerBasic
public class MapTileLayerArray
extends MapTileLayerBase
This top-level tile provider allows a consumer to provide an array of modular asynchronous tile providers to be used to obtain map tiles. When a tile is requested, the MapTileCache (synchronously) and returns the tile if available. If not, then the MapTileLayerArray returns null and sends the tile request through the asynchronous tile request chain. Each asynchronous tile provider returns success/failure to the MapTileLayerArray. If successful, the MapTileLayerArray passes the result to the base class. If failed, then the next asynchronous tile provider is called in the chain. If there are no more asynchronous tile providers in the chain, then the failure result is passed to the base class. The MapTileLayerArray provides a mechanism so that only one unique tile-request can be in the map tile request chain at a time.

Field Summary

Fields 
Modifier and Type Field and Description
protected NetworkAvailabilityCheck mNetworkAvailabilityCheck 
protected java.util.List<MapTileModuleLayerBase> mTileProviderList 
protected java.util.List<MapTile> mUnaccessibleTiles 
protected java.util.HashMap<MapTileRequestState> mWorking 

Fields inherited from class com.mapbox.mapboxsdk.tileprovider.MapTileLayerBase

mTileCache

Fields inherited from interface com.mapbox.mapboxsdk.tileprovider.constants.TileLayerConstants

WORLD_BOUNDING_BOX

Constructor Summary

Constructors 
Modifier Constructor and Description
protected MapTileLayerArray(android.content.Context context, ITileLayer pTileSource, IRegisterReceiver pRegisterReceiver)
Creates an MapTileLayerArray with no tile providers.
  MapTileLayerArray(android.content.Context context, ITileLayer pTileSource, IRegisterReceiver aRegisterReceiver, MapTileModuleLayerBase[] pTileProviderArray)
Creates an MapTileLayerArray with the specified tile providers.

Method Summary

Methods 
Modifier and Type Method and Description
void detach() 
protected MapTileModuleLayerBase MapTileRequestState aState)
We want to not use a provider that doesn't exist anymore in the chain, and we want to not use a provider that requires a data connection when one is not available.
BoundingBox getBoundingBox()
Get the tile provider bounding box.
LatLng getCenterCoordinate()
Get the tile provider center.
float getCenterZoom()
Get the tile provider suggested starting zoom.
android.graphics.drawable.Drawable MapTile pTile, boolean allowRemote)
Attempts to get a Drawable that represents a MapTile.
float getMaximumZoomLevel()
Get the maximum zoom level this tile provider can provide.
float getMinimumZoomLevel()
Gets the minimum zoom level this tile provider can provide
boolean MapTileModuleLayerBase provider) 
int getTileSizePixels()
Get the tile size in pixels this tile provider provides.
boolean hasNoSource() 
void MapTileRequestState aState, android.graphics.drawable.Drawable aDrawable)
Called by implementation class methods indicating that they have completed the request as best it can.
void MapTileRequestState aState, CacheableBitmapDrawable aDrawable)
Called by implementation class methods indicating that they have produced an expired result that can be used but better results may be delivered later.
void MapTileRequestState aState)
Called by implementation class methods indicating that they have failed to retrieve the requested map tile.
void ITileLayer aTileSource)
Sets the tile source for this tile provider.

Methods inherited from class com.mapbox.mapboxsdk.tileprovider.MapTileLayerBase

useDataConnection

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

mWorking

protected final java.util.HashMap<MapTileRequestState> mWorking

mTileProviderList

protected final java.util.List<MapTileModuleLayerBase> mTileProviderList

mUnaccessibleTiles

protected final java.util.List<MapTile> mUnaccessibleTiles

mNetworkAvailabilityCheck

protected final NetworkAvailabilityCheck mNetworkAvailabilityCheck

Constructor Detail

MapTileLayerArray

protected MapTileLayerArray(android.content.Context context,
                 ITileLayer pTileSource,
                 IRegisterReceiver pRegisterReceiver)
Creates an MapTileLayerArray with no tile providers.
Parameters:
pRegisterReceiver - a IRegisterReceiver

MapTileLayerArray

public MapTileLayerArray(android.content.Context context,
                 ITileLayer pTileSource,
                 IRegisterReceiver aRegisterReceiver,
                 MapTileModuleLayerBase[] pTileProviderArray)
Creates an MapTileLayerArray with the specified tile providers.
Parameters:
aRegisterReceiver - a MapTileModuleLayerBase

Method Detail

detach

public void detach()
Specified by:
MapTileLayerBase

getMapTile

public android.graphics.drawable.Drawable getMapTile(MapTile pTile,
                                            boolean allowRemote)
Description copied from class: MapTileLayerBase
Attempts to get a Drawable that represents a MapTile. If the tile is not immediately available this will return null and attempt to get the tile from known tile sources for subsequent future requests. Note that this may return a CacheableBitmapDrawable in which case you should follow proper handling procedures for using that Drawable or it may reused while you are working with it.
Specified by:
MapTileLayerBase
See Also:
CacheableBitmapDrawable

mapTileRequestCompleted

public void mapTileRequestCompleted(MapTileRequestState aState,
                           android.graphics.drawable.Drawable aDrawable)
Description copied from class: MapTileLayerBase
Called by implementation class methods indicating that they have completed the request as best it can. The tile is added to the cache, and a MAPTILE_SUCCESS_ID message is sent.
Specified by:
IMapTileProviderCallback
Overrides:
MapTileLayerBase
Parameters:
aState - the map tile request state object
aDrawable - the Drawable of the map tile

mapTileRequestFailed

public void mapTileRequestFailed(MapTileRequestState aState)
Description copied from class: MapTileLayerBase
Called by implementation class methods indicating that they have failed to retrieve the requested map tile. a MAPTILE_FAIL_ID message is sent.
Specified by:
IMapTileProviderCallback
Overrides:
MapTileLayerBase
Parameters:
aState - the map tile request state object

mapTileRequestExpiredTile

public void mapTileRequestExpiredTile(MapTileRequestState aState,
                             CacheableBitmapDrawable aDrawable)
Description copied from class: MapTileLayerBase
Called by implementation class methods indicating that they have produced an expired result that can be used but better results may be delivered later. The tile is added to the cache, and a MAPTILE_SUCCESS_ID message is sent.
Specified by:
IMapTileProviderCallback
Overrides:
MapTileLayerBase
Parameters:
aState - the map tile request state object
aDrawable - the Drawable of the map tile

findNextAppropriateProvider

protected MapTileRequestState aState)
We want to not use a provider that doesn't exist anymore in the chain, and we want to not use a provider that requires a data connection when one is not available.

getProviderExists

public boolean getProviderExists(MapTileModuleLayerBase provider)

getMinimumZoomLevel

public float getMinimumZoomLevel()
Description copied from class: MapTileLayerBase
Gets the minimum zoom level this tile provider can provide
Overrides:
MapTileLayerBase
Returns:
the minimum zoom level

getMaximumZoomLevel

public float getMaximumZoomLevel()
Description copied from class: MapTileLayerBase
Get the maximum zoom level this tile provider can provide.
Overrides:
MapTileLayerBase
Returns:
the maximum zoom level

setTileSource

public void setTileSource(ITileLayer aTileSource)
Description copied from class: MapTileLayerBase
Sets the tile source for this tile provider.
Overrides:
MapTileLayerBase
Parameters:
aTileSource - the tile source

hasNoSource

public boolean hasNoSource()
Overrides:
MapTileLayerBase

getBoundingBox

public BoundingBox getBoundingBox()
Description copied from class: MapTileLayerBase
Get the tile provider bounding box.
Overrides:
MapTileLayerBase
Returns:
the tile source bounding box

getCenterCoordinate

public LatLng getCenterCoordinate()
Description copied from class: MapTileLayerBase
Get the tile provider center.
Overrides:
MapTileLayerBase
Returns:
the tile source center

getCenterZoom

public float getCenterZoom()
Description copied from class: MapTileLayerBase
Get the tile provider suggested starting zoom.
Overrides:
MapTileLayerBase
Returns:
the tile suggested starting zoom

getTileSizePixels

public int getTileSizePixels()
Description copied from class: MapTileLayerBase
Get the tile size in pixels this tile provider provides.
Overrides:
MapTileLayerBase
Returns:
the tile size in pixels

MapTileLayerBase

java.lang.Object com.mapbox.mapboxsdk.tileprovider.MapTileLayerBase
All Implemented Interfaces:
IMapTileProviderCallback
Direct Known Subclasses:
OfflineMapTileProvider
public abstract class MapTileLayerBase
extends java.lang.Object
implements TileLayerConstants
This is an abstract class. The tile provider is responsible for:
    determining if a map tile is available, notifying the client, via a callback handler see MapTile for an overview of how tiles are served by this provider.

Field Summary

Fields 
Modifier and Type Field and Description
protected android.content.Context context 
protected java.lang.String mCacheKey 
protected MapTileCache mTileCache 

Fields inherited from interface com.mapbox.mapboxsdk.tileprovider.constants.TileLayerConstants

WORLD_BOUNDING_BOX

Constructor Summary

Constructors 
Constructor and Description
MapTileLayerBase(android.content.Context aContext, ITileLayer pTileSource) 
MapTileLayerBase(android.content.Context aContext, ITileLayer pTileSource, android.os.Handler pDownloadFinishedListener) 

Method Summary

Methods 
Modifier and Type Method and Description
void clearTileDiskCache() 
void clearTileMemoryCache() 
CacheableBitmapDrawable createCacheableBitmapDrawable(android.graphics.Bitmap bitmap, MapTile aTile) 
MapTileCache createTileCache(android.content.Context aContext)
Creates a MapTileCache to be used to cache tiles in memory.
abstract void detach() 
android.graphics.Bitmap getBitmapFromRemoved(int width, int height) 
BoundingBox getBoundingBox()
Get the tile provider bounding box.
java.lang.String getCacheKey()
Gets the cache key for that layer
LatLng getCenterCoordinate()
Get the tile provider center.
float getCenterZoom()
Get the tile provider suggested starting zoom.
abstract android.graphics.drawable.Drawable MapTile pTile, boolean allowRemote)
Attempts to get a Drawable that represents a MapTile.
CacheableBitmapDrawable MapTile pTile) 
float getMaximumZoomLevel()
Get the maximum zoom level this tile provider can provide.
float getMinimumZoomLevel()
Gets the minimum zoom level this tile provider can provide
int getTileSizePixels()
Get the tile size in pixels this tile provider provides.
ITileLayer getTileSource()
Gets the tile source for this tile provider.
boolean hasNoSource() 
void MapTileRequestState pState, android.graphics.drawable.Drawable pDrawable)
Called by implementation class methods indicating that they have completed the request as best it can.
void MapTileRequestState pState, CacheableBitmapDrawable pDrawable)
Called by implementation class methods indicating that they have produced an expired result that can be used but better results may be delivered later.
void MapTileRequestState pState)
Called by implementation class methods indicating that they have failed to retrieve the requested map tile.
void memoryCacheNeedsMoreMemory(int numberOfTiles) 
void MapTile pTile, android.graphics.Bitmap bitmap) 
protected void MapTileRequestState pState, android.graphics.drawable.Drawable pDrawable) 
protected void MapTileRequestState pState) 
void MapTile aTile)
If a given MapTile is present in this cache, remove it from memory.
void setDiskCacheEnabled(boolean enabled) 
void setTileRequestCompleteHandler(android.os.Handler handler) 
void ITileLayer pTileSource)
Sets the tile source for this tile provider.
void setUseDataConnection(boolean pMode)
Set whether to use the network connection if it's available.
boolean useDataConnection()
Whether to use the network connection if it's available.

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

context

protected android.content.Context context

mTileCache

protected final MapTileCache mTileCache

mCacheKey

protected java.lang.String mCacheKey

Constructor Detail

MapTileLayerBase

public MapTileLayerBase(android.content.Context aContext,
                ITileLayer pTileSource)

MapTileLayerBase

public MapTileLayerBase(android.content.Context aContext,
                ITileLayer pTileSource,
                android.os.Handler pDownloadFinishedListener)

Method Detail

getMapTile

public abstract android.graphics.drawable.Drawable getMapTile(MapTile pTile,
                                            boolean allowRemote)
Attempts to get a Drawable that represents a MapTile. If the tile is not immediately available this will return null and attempt to get the tile from known tile sources for subsequent future requests. Note that this may return a CacheableBitmapDrawable in which case you should follow proper handling procedures for using that Drawable or it may reused while you are working with it.
See Also:
CacheableBitmapDrawable

detach

public abstract void detach()

getMinimumZoomLevel

public float getMinimumZoomLevel()
Gets the minimum zoom level this tile provider can provide
Returns:
the minimum zoom level

getMaximumZoomLevel

public float getMaximumZoomLevel()
Get the maximum zoom level this tile provider can provide.
Returns:
the maximum zoom level

getTileSizePixels

public int getTileSizePixels()
Get the tile size in pixels this tile provider provides.
Returns:
the tile size in pixels

getBoundingBox

public BoundingBox getBoundingBox()
Get the tile provider bounding box.
Returns:
the tile source bounding box

getCenterCoordinate

public LatLng getCenterCoordinate()
Get the tile provider center.
Returns:
the tile source center

getCenterZoom

public float getCenterZoom()
Get the tile provider suggested starting zoom.
Returns:
the tile suggested starting zoom

setTileSource

public void setTileSource(ITileLayer pTileSource)
Sets the tile source for this tile provider.
Parameters:
pTileSource - the tile source

getTileSource

public ITileLayer getTileSource()
Gets the tile source for this tile provider.
Returns:
the tile source

getCacheKey

public java.lang.String getCacheKey()
Gets the cache key for that layer
Returns:
the cache key

createTileCache

public MapTileCache createTileCache(android.content.Context aContext)
Creates a MapTileCache to be used to cache tiles in memory.

mapTileRequestCompleted

public void mapTileRequestCompleted(MapTileRequestState pState,
                           android.graphics.drawable.Drawable pDrawable)
Called by implementation class methods indicating that they have completed the request as best it can. The tile is added to the cache, and a MAPTILE_SUCCESS_ID message is sent.
Specified by:
IMapTileProviderCallback
Parameters:
pState - the map tile request state object
pDrawable - the Drawable of the map tile

mapTileRequestFailed

public void mapTileRequestFailed(MapTileRequestState pState)
Called by implementation class methods indicating that they have failed to retrieve the requested map tile. a MAPTILE_FAIL_ID message is sent.
Specified by:
IMapTileProviderCallback
Parameters:
pState - the map tile request state object

mapTileRequestExpiredTile

public void mapTileRequestExpiredTile(MapTileRequestState pState,
                             CacheableBitmapDrawable pDrawable)
Called by implementation class methods indicating that they have produced an expired result that can be used but better results may be delivered later. The tile is added to the cache, and a MAPTILE_SUCCESS_ID message is sent.
Specified by:
IMapTileProviderCallback
Parameters:
pState - the map tile request state object
pDrawable - the Drawable of the map tile

putTileIntoCache

protected void putTileIntoCache(MapTileRequestState pState,
                    android.graphics.drawable.Drawable pDrawable)

removeTileFromCache

protected void removeTileFromCache(MapTileRequestState pState)

putExpiredTileIntoCache

public void putExpiredTileIntoCache(MapTile pTile,
                           android.graphics.Bitmap bitmap)

setTileRequestCompleteHandler

public void setTileRequestCompleteHandler(android.os.Handler handler)

clearTileMemoryCache

public void clearTileMemoryCache()

memoryCacheNeedsMoreMemory

public void memoryCacheNeedsMoreMemory(int numberOfTiles)

clearTileDiskCache

public void clearTileDiskCache()

setDiskCacheEnabled

public void setDiskCacheEnabled(boolean enabled)

useDataConnection

public boolean useDataConnection()
Whether to use the network connection if it's available.
Specified by:
IMapTileProviderCallback
Returns:
true if data connection should be used, false otherwise

setUseDataConnection

public void setUseDataConnection(boolean pMode)
Set whether to use the network connection if it's available.
Parameters:
pMode - if true use the network connection if it's available. if false don't use the network connection even if it's available.

hasNoSource

public boolean hasNoSource()

getMapTileFromMemory

public CacheableBitmapDrawable getMapTileFromMemory(MapTile pTile)

createCacheableBitmapDrawable

public CacheableBitmapDrawable createCacheableBitmapDrawable(android.graphics.Bitmap bitmap,
                                                    MapTile aTile)

getBitmapFromRemoved

public android.graphics.Bitmap getBitmapFromRemoved(int width,
                                           int height)

removeTileFromMemory

public void removeTileFromMemory(MapTile aTile)
If a given MapTile is present in this cache, remove it from memory.
Parameters:
aTile -

MapTileLayerBasic

java.lang.Object com.mapbox.mapboxsdk.tileprovider.MapTileLayerBase com.mapbox.mapboxsdk.tileprovider.MapTileLayerArray com.mapbox.mapboxsdk.tileprovider.MapTileLayerBasic
All Implemented Interfaces:
IMapTileProviderCallback
public class MapTileLayerBasic
extends MapTileLayerArray
implements IMapTileProviderCallback
A base class for tile layers to built, this is a simple collection of tile sources.

Field Summary

Fields inherited from class com.mapbox.mapboxsdk.tileprovider.MapTileLayerArray

mWorking

Fields inherited from class com.mapbox.mapboxsdk.tileprovider.MapTileLayerBase

mTileCache

Fields inherited from interface com.mapbox.mapboxsdk.tileprovider.constants.TileLayerConstants

WORLD_BOUNDING_BOX

Constructor Summary

Constructors 
Constructor and Description
MapTileLayerBasic(android.content.Context pContext, ITileLayer pTileSource, MapView mapView) 

Method Summary

Methods 
Modifier and Type Method and Description
void ITileLayer pTileSource) 
void ITileLayer pTileSource, int index) 
void removeTileSource(int index) 
void ITileLayer pTileSource) 
void ITileLayer aTileSource)
Sets the tile source for this tile provider.
void ITileLayer[] aTileSources) 

Methods inherited from class com.mapbox.mapboxsdk.tileprovider.MapTileLayerArray

mapTileRequestFailed

Methods inherited from class com.mapbox.mapboxsdk.tileprovider.MapTileLayerBase

useDataConnection

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Methods inherited from interface com.mapbox.mapboxsdk.tileprovider.IMapTileProviderCallback

useDataConnection

Constructor Detail

MapTileLayerBasic

public MapTileLayerBasic(android.content.Context pContext,
                 ITileLayer pTileSource,
                 MapView mapView)
Parameters:
pContext -
pTileSource -
mapView -

Method Detail

setTileSource

public void setTileSource(ITileLayer aTileSource)
Description copied from class: MapTileLayerBase
Sets the tile source for this tile provider.
Overrides:
MapTileLayerArray
Parameters:
aTileSource - the tile source

setTileSources

public void setTileSources(ITileLayer[] aTileSources)

addTileSource

public void addTileSource(ITileLayer pTileSource)

addTileSource

public void addTileSource(ITileLayer pTileSource,
                 int index)

removeTileSource

public void removeTileSource(int index)

removeTileSource

public void removeTileSource(ITileLayer pTileSource)

MapTileRequestState

java.lang.Object com.mapbox.mapboxsdk.tileprovider.MapTileRequestState
public class MapTileRequestState
extends java.lang.Object
Track the status of a single map tile given a list of providers that could change its state by loading, caching, or disposing it.

Constructor Summary

Constructors 
Constructor and Description
MapTile mapTile, MapTileModuleLayerBase[] providers, IMapTileProviderCallback callback)
Initialize a new state to keep track of a map tile

Method Summary

Methods 
Modifier and Type Method and Description
IMapTileProviderCallback getCallback()
Get the assigned callback
MapTile getMapTile()
Get the map tile this class owns
MapTileModuleLayerBase getNextProvider() 

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

MapTileRequestState

public MapTileRequestState(MapTile mapTile,
                   MapTileModuleLayerBase[] providers,
                   IMapTileProviderCallback callback)
Initialize a new state to keep track of a map tile

Method Detail

getMapTile

public MapTile getMapTile()
Get the map tile this class owns
Returns:
this map tile

getCallback

public IMapTileProviderCallback getCallback()
Get the assigned callback
Returns:
the assigned callback

getNextProvider

public MapTileModuleLayerBase getNextProvider()

ConfigurablePriorityThreadFactory

java.lang.Object com.mapbox.mapboxsdk.tileprovider.modules.ConfigurablePriorityThreadFactory
All Implemented Interfaces:
java.util.concurrent.ThreadFactory
public class ConfigurablePriorityThreadFactory
extends java.lang.Object
implements java.util.concurrent.ThreadFactory

Constructor Summary

Constructors 
Constructor and Description
ConfigurablePriorityThreadFactory(int pPriority, java.lang.String pName) 

Method Summary

Methods 
Modifier and Type Method and Description
java.lang.Thread newThread(java.lang.Runnable pRunnable) 

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ConfigurablePriorityThreadFactory

public ConfigurablePriorityThreadFactory(int pPriority,
                                 java.lang.String pName)

Method Detail

newThread

public java.lang.Thread newThread(java.lang.Runnable pRunnable)
Specified by:
newThread in interface java.util.concurrent.ThreadFactory

IArchiveFile

All Known Implementing Classes:
MBTilesFileArchive
public interface IArchiveFile

Method Summary

Methods 
Modifier and Type Method and Description
java.io.InputStream ITileLayer tileSource, MapTile tile)
Get the input stream for the requested tile.

Method Detail

getInputStream

java.io.InputStream getInputStream(ITileLayer tileSource,
                                 MapTile tile)
Get the input stream for the requested tile.
Returns:
the input stream, or null if the archive doesn't contain an entry for the requested tile

MapTileDownloader

java.lang.Object com.mapbox.mapboxsdk.tileprovider.modules.MapTileModuleLayerBase com.mapbox.mapboxsdk.tileprovider.modules.MapTileDownloader
All Implemented Interfaces:
TileLayerConstants
public class MapTileDownloader
extends MapTileModuleLayerBase
The MapTileDownloader loads tiles from an HTTP server.

Nested Class Summary

Nested Classes 
Modifier and Type Class and Description
protected class  MapTileDownloader.TileLoader 

Nested classes/interfaces inherited from class com.mapbox.mapboxsdk.tileprovider.modules.MapTileModuleLayerBase

MapTileModuleLayerBase.CantContinueException

Field Summary

Fields inherited from class com.mapbox.mapboxsdk.tileprovider.modules.MapTileModuleLayerBase

mWorking

Fields inherited from interface com.mapbox.mapboxsdk.tileprovider.constants.TileLayerConstants

WORLD_BOUNDING_BOX

Constructor Summary

Constructors 
Constructor and Description
ITileLayer pTileSource, MapTileCache pTileCache, NetworkAvailabilityCheck pNetworkAvailabilityCheck, MapView mapView) 

Method Summary

Methods 
Modifier and Type Method and Description
BoundingBox getBoundingBox()
Get the tile provider bounding box.
MapTileCache getCache() 
java.lang.String getCacheKey() 
LatLng getCenterCoordinate()
Get the tile provider center.
float getCenterZoom()
Get the tile provider suggested starting zoom.
float getMaximumZoomLevel()
Gets the maximum zoom level this tile provider can provide
float getMinimumZoomLevel()
Gets the minimum zoom level this tile provider can provide
protected java.lang.String getName()
Gets the human-friendly name assigned to this tile provider.
protected java.lang.String getThreadGroupName()
Gets the name assigned to the thread for this provider.
TileLoadedListener getTileLoadedListener() 
protected java.lang.Runnable getTileLoader()
It is expected that the implementation will construct an internal member which internally implements a MapTileModuleLayerBase.TileLoader.
int getTileSizePixels()
Get the tile provider size in pixels.
TilesLoadedListener getTilesLoadedListener() 
ITileLayer getTileSource() 
boolean getUsesDataConnection()
Returns true if implementation uses a data connection, false otherwise.
boolean isNetworkAvailable() 
void ITileLayer tileSource)
Sets the tile source for this tile provider.

Methods inherited from class com.mapbox.mapboxsdk.tileprovider.modules.MapTileModuleLayerBase

popFirstPending

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

MapTileDownloader

public MapTileDownloader(ITileLayer pTileSource,
                 MapTileCache pTileCache,
                 NetworkAvailabilityCheck pNetworkAvailabilityCheck,
                 MapView mapView)

Method Detail

getTileSource

public ITileLayer getTileSource()
Specified by:
MapTileModuleLayerBase

getCache

public MapTileCache getCache()

isNetworkAvailable

public boolean isNetworkAvailable()

getTilesLoadedListener

public TilesLoadedListener getTilesLoadedListener()

getTileLoadedListener

public TileLoadedListener getTileLoadedListener()

getUsesDataConnection

public boolean getUsesDataConnection()
Description copied from class: MapTileModuleLayerBase
Returns true if implementation uses a data connection, false otherwise. This value is used to determine if this provider should be skipped if there is no data connection.
Specified by:
MapTileModuleLayerBase
Returns:
true if implementation uses a data connection, false otherwise

getName

protected java.lang.String getName()
Description copied from class: MapTileModuleLayerBase
Gets the human-friendly name assigned to this tile provider.
Specified by:
MapTileModuleLayerBase
Returns:
the thread name

getThreadGroupName

protected java.lang.String getThreadGroupName()
Description copied from class: MapTileModuleLayerBase
Gets the name assigned to the thread for this provider.
Specified by:
MapTileModuleLayerBase
Returns:
the thread name

getTileLoader

protected java.lang.Runnable getTileLoader()
Description copied from class: MapTileModuleLayerBase
It is expected that the implementation will construct an internal member which internally implements a MapTileModuleLayerBase.TileLoader. This method is expected to return a that internal member to methods of the parent methods.
Specified by:
MapTileModuleLayerBase
Returns:
the internal member of this tile provider.

getMinimumZoomLevel

public float getMinimumZoomLevel()
Description copied from class: MapTileModuleLayerBase
Gets the minimum zoom level this tile provider can provide
Specified by:
MapTileModuleLayerBase
Returns:
the minimum zoom level

getMaximumZoomLevel

public float getMaximumZoomLevel()
Description copied from class: MapTileModuleLayerBase
Gets the maximum zoom level this tile provider can provide
Specified by:
MapTileModuleLayerBase
Returns:
the maximum zoom level

getBoundingBox

public BoundingBox getBoundingBox()
Description copied from class: MapTileModuleLayerBase
Get the tile provider bounding box.
Specified by:
MapTileModuleLayerBase
Returns:
the tile source bounding box

getCenterCoordinate

public LatLng getCenterCoordinate()
Description copied from class: MapTileModuleLayerBase
Get the tile provider center.
Specified by:
MapTileModuleLayerBase
Returns:
the tile source center

getCenterZoom

public float getCenterZoom()
Description copied from class: MapTileModuleLayerBase
Get the tile provider suggested starting zoom.
Specified by:
MapTileModuleLayerBase
Returns:
the tile suggested starting zoom

getTileSizePixels

public int getTileSizePixels()
Description copied from class: MapTileModuleLayerBase
Get the tile provider size in pixels.
Specified by:
MapTileModuleLayerBase
Returns:
the tile size in pixels

setTileSource

public void setTileSource(ITileLayer tileSource)
Description copied from class: MapTileModuleLayerBase
Sets the tile source for this tile provider.
Specified by:
MapTileModuleLayerBase
Parameters:
tileSource - the tile source

getCacheKey

public java.lang.String getCacheKey()
Specified by:
MapTileModuleLayerBase

MapTileDownloader.TileLoader

java.lang.Object com.mapbox.mapboxsdk.tileprovider.modules.MapTileModuleLayerBase.TileLoader com.mapbox.mapboxsdk.tileprovider.modules.MapTileDownloader.TileLoader
All Implemented Interfaces:
java.lang.Runnable
Enclosing class:
MapTileDownloader
protected class MapTileDownloader.TileLoader
extends MapTileModuleLayerBase.TileLoader

Constructor Summary

Constructors 
Modifier Constructor and Description
protected MapTileDownloader.TileLoader() 

Method Summary

Methods 
Modifier and Type Method and Description
android.graphics.drawable.Drawable MapTileRequestState aState)
Load the requested tile.

Methods inherited from class com.mapbox.mapboxsdk.tileprovider.modules.MapTileModuleLayerBase.TileLoader

tileLoadedFailed

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

MapTileDownloader.TileLoader

protected MapTileDownloader.TileLoader()

Method Detail

loadTile

public android.graphics.drawable.Drawable loadTile(MapTileRequestState aState)
                                            throws MapTileModuleLayerBase.CantContinueException
Description copied from class: MapTileModuleLayerBase.TileLoader
Load the requested tile.
Specified by:
MapTileModuleLayerBase.TileLoader
Returns:
the tile if it was loaded successfully, or null if failed to load and other tile providers need to be called
Throws:
MapTileModuleLayerBase.CantContinueException

MapTileModuleLayerBase.CantContinueException

java.lang.Object java.lang.Throwable java.lang.Exception com.mapbox.mapboxsdk.tileprovider.modules.MapTileModuleLayerBase.CantContinueException
All Implemented Interfaces:
java.io.Serializable
Enclosing class:
MapTileModuleLayerBase
public class MapTileModuleLayerBase.CantContinueException
extends java.lang.Exception
Thrown by a tile provider module in TileLoader.loadTile() to signal that it can no longer function properly. This will typically clear the pending queue.
See Also:
Serialized Form

Constructor Summary

Constructors 
Constructor and Description
MapTileModuleLayerBase.CantContinueException(java.lang.String pDetailMessage) 
MapTileModuleLayerBase.CantContinueException(java.lang.Throwable pThrowable) 

Method Summary

Methods inherited from class java.lang.Throwable

addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

MapTileModuleLayerBase.CantContinueException

public MapTileModuleLayerBase.CantContinueException(java.lang.String pDetailMessage)

MapTileModuleLayerBase.CantContinueException

public MapTileModuleLayerBase.CantContinueException(java.lang.Throwable pThrowable)

MapTileModuleLayerBase

java.lang.Object com.mapbox.mapboxsdk.tileprovider.modules.MapTileModuleLayerBase
All Implemented Interfaces:
TileLayerConstants
Direct Known Subclasses:
MapTileDownloader
public abstract class MapTileModuleLayerBase
extends java.lang.Object
implements TileLayerConstants
An abstract base class for modular tile providers

Nested Class Summary

Nested Classes 
Modifier and Type Class and Description
class  MapTileModuleLayerBase.CantContinueException
Thrown by a tile provider module in TileLoader.loadTile() to signal that it can no longer function properly.
protected class  MapTileModuleLayerBase.TileLoader
Load the requested tile.

Field Summary

Fields 
Modifier and Type Field and Description
protected java.util.LinkedHashMap<MapTileRequestState> mPending 
protected java.lang.Object mQueueLockObject 
protected java.util.HashMap<MapTileRequestState> mWorking 

Fields inherited from interface com.mapbox.mapboxsdk.tileprovider.constants.TileLayerConstants

WORLD_BOUNDING_BOX

Constructor Summary

Constructors 
Constructor and Description
MapTileModuleLayerBase(int pThreadPoolSize, int pPendingQueueSize)
Initialize a new tile provider, given a thread pool and a pending queue size.

Method Summary

Methods 
Modifier and Type Method and Description
protected void clearQueue()
Clears both pending and working queues.
void detach()
Detach, we're shutting down - Stops all workers.
abstract BoundingBox getBoundingBox()
Get the tile provider bounding box.
abstract java.lang.String getCacheKey() 
abstract LatLng getCenterCoordinate()
Get the tile provider center.
abstract float getCenterZoom()
Get the tile provider suggested starting zoom.
abstract float getMaximumZoomLevel()
Gets the maximum zoom level this tile provider can provide
abstract float getMinimumZoomLevel()
Gets the minimum zoom level this tile provider can provide
protected abstract java.lang.String getName()
Gets the human-friendly name assigned to this tile provider.
protected abstract java.lang.String getThreadGroupName()
Gets the name assigned to the thread for this provider.
protected abstract java.lang.Runnable getTileLoader()
It is expected that the implementation will construct an internal member which internally implements a MapTileModuleLayerBase.TileLoader.
abstract int getTileSizePixels()
Get the tile provider size in pixels.
abstract ITileLayer getTileSource() 
abstract boolean getUsesDataConnection()
Returns true if implementation uses a data connection, false otherwise.
void MapTileRequestState pState)
Loads a map tile asynchronously, adding it to the queue and calling getTileLoader.
MapTileRequestState popFirstPending() 
abstract void ITileLayer tileSource)
Sets the tile source for this tile provider.

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

mQueueLockObject

protected final java.lang.Object mQueueLockObject

mWorking

protected final java.util.HashMap<MapTileRequestState> mWorking

mPending

protected final java.util.LinkedHashMap<MapTileRequestState> mPending

Constructor Detail

MapTileModuleLayerBase

public MapTileModuleLayerBase(int pThreadPoolSize,
                      int pPendingQueueSize)
Initialize a new tile provider, given a thread pool and a pending queue size. The pending queue size must be larger than or equal to the thread pool size.

Method Detail

getName

protected abstract java.lang.String getName()
Gets the human-friendly name assigned to this tile provider.
Returns:
the thread name

getThreadGroupName

protected abstract java.lang.String getThreadGroupName()
Gets the name assigned to the thread for this provider.
Returns:
the thread name

getTileLoader

protected abstract java.lang.Runnable getTileLoader()
It is expected that the implementation will construct an internal member which internally implements a MapTileModuleLayerBase.TileLoader. This method is expected to return a that internal member to methods of the parent methods.
Returns:
the internal member of this tile provider.

getUsesDataConnection

public abstract boolean getUsesDataConnection()
Returns true if implementation uses a data connection, false otherwise. This value is used to determine if this provider should be skipped if there is no data connection.
Returns:
true if implementation uses a data connection, false otherwise

getMinimumZoomLevel

public abstract float getMinimumZoomLevel()
Gets the minimum zoom level this tile provider can provide
Returns:
the minimum zoom level

getMaximumZoomLevel

public abstract float getMaximumZoomLevel()
Gets the maximum zoom level this tile provider can provide
Returns:
the maximum zoom level

getBoundingBox

public abstract BoundingBox getBoundingBox()
Get the tile provider bounding box.
Returns:
the tile source bounding box

getCenterCoordinate

public abstract LatLng getCenterCoordinate()
Get the tile provider center.
Returns:
the tile source center

getCenterZoom

public abstract float getCenterZoom()
Get the tile provider suggested starting zoom.
Returns:
the tile suggested starting zoom

getTileSizePixels

public abstract int getTileSizePixels()
Get the tile provider size in pixels.
Returns:
the tile size in pixels

setTileSource

public abstract void setTileSource(ITileLayer tileSource)
Sets the tile source for this tile provider.
Parameters:
tileSource - the tile source

getTileSource

public abstract ITileLayer getTileSource()

getCacheKey

public abstract java.lang.String getCacheKey()

popFirstPending

public MapTileRequestState popFirstPending()

loadMapTileAsync

public void loadMapTileAsync(MapTileRequestState pState)
Loads a map tile asynchronously, adding it to the queue and calling getTileLoader.

clearQueue

protected void clearQueue()
Clears both pending and working queues.

detach

public void detach()
Detach, we're shutting down - Stops all workers.

MapTileModuleLayerBase.TileLoader

java.lang.Object com.mapbox.mapboxsdk.tileprovider.modules.MapTileModuleLayerBase.TileLoader
All Implemented Interfaces:
java.lang.Runnable
Direct Known Subclasses:
MapTileDownloader.TileLoader
Enclosing class:
MapTileModuleLayerBase
protected abstract class MapTileModuleLayerBase.TileLoader
extends java.lang.Object
implements java.lang.Runnable
Load the requested tile. An abstract internal class whose objects are used by worker threads to acquire tiles from servers. It processes tiles from the 'pending' set to the 'working' set as they become available. The key unimplemented method is 'loadTile'.

Constructor Summary

Constructors 
Modifier Constructor and Description
protected MapTileModuleLayerBase.TileLoader() 

Method Summary

Methods 
Modifier and Type Method and Description
protected abstract android.graphics.drawable.Drawable MapTileRequestState pState)
Load the requested tile.
protected MapTileRequestState nextTile() 
protected void onTileLoaderInit() 
protected void onTileLoaderShutdown() 
void run()
This is a functor class of type Runnable.
protected void MapTileRequestState pState, android.graphics.drawable.Drawable pDrawable)
A tile has loaded.
protected void MapTileRequestState pState, CacheableBitmapDrawable pDrawable)
A tile has loaded but it's expired.
protected void MapTileRequestState pState) 

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

MapTileModuleLayerBase.TileLoader

protected MapTileModuleLayerBase.TileLoader()

Method Detail

loadTile

protected abstract android.graphics.drawable.Drawable loadTile(MapTileRequestState pState)
                                                        throws MapTileModuleLayerBase.CantContinueException
Load the requested tile.
Returns:
the tile if it was loaded successfully, or null if failed to load and other tile providers need to be called
Throws:
MapTileModuleLayerBase.CantContinueException

onTileLoaderInit

protected void onTileLoaderInit()

onTileLoaderShutdown

protected void onTileLoaderShutdown()

nextTile

protected MapTileRequestState nextTile()

tileLoaded

protected void tileLoaded(MapTileRequestState pState,
              android.graphics.drawable.Drawable pDrawable)
A tile has loaded.

tileLoadedExpired

protected void tileLoadedExpired(MapTileRequestState pState,
                     CacheableBitmapDrawable pDrawable)
A tile has loaded but it's expired. Return it and send request to next provider.

tileLoadedFailed

protected void tileLoadedFailed(MapTileRequestState pState)

run

public void run()
This is a functor class of type Runnable. The run method is the encapsulated function.
Specified by:
run in interface java.lang.Runnable

MBTilesFileArchive

java.lang.Object com.mapbox.mapboxsdk.tileprovider.modules.MBTilesFileArchive
All Implemented Interfaces:
IArchiveFile
public class MBTilesFileArchive
extends java.lang.Object
implements IArchiveFile
An access layer to the MBTiles format. This is useful for offline tiles that one would pre-package with an app.

Field Summary

Fields 
Modifier and Type Field and Description
static java.lang.String COL_TILES_TILE_DATA 
static java.lang.String COL_VALUE 
static java.lang.String TABLE_METADATA 
static java.lang.String TABLE_TILES 

Constructor Summary

Constructors 
Constructor and Description
MBTilesFileArchive(android.database.sqlite.SQLiteDatabase pDatabase) 

Method Summary

Methods 
Modifier and Type Method and Description
void close() 
java.lang.String getAttribution() 
BoundingBox getBounds() 
LatLng getCenter() 
static MBTilesFileArchive getDatabaseFileArchive(java.io.File pFile) 
java.lang.String getDescription() 
java.io.InputStream ITileLayer pTileSource, MapTile pTile)
Get the input stream for the requested tile.
float getMaxZoomLevel() 
float getMinZoomLevel() 
java.lang.String getName() 
java.lang.String getType() 
java.lang.String getVersion() 
java.lang.String toString() 

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail

TABLE_TILES

public static final java.lang.String TABLE_TILES
See Also:
Constant Field Values

TABLE_METADATA

public static final java.lang.String TABLE_METADATA
See Also:
Constant Field Values

COL_TILES_TILE_DATA

public static final java.lang.String COL_TILES_TILE_DATA
See Also:
Constant Field Values

COL_VALUE

public static final java.lang.String COL_VALUE
See Also:
Constant Field Values

Constructor Detail

MBTilesFileArchive

public MBTilesFileArchive(android.database.sqlite.SQLiteDatabase pDatabase)

Method Detail

getDatabaseFileArchive

public static MBTilesFileArchive getDatabaseFileArchive(java.io.File pFile)
                                                 throws android.database.sqlite.SQLiteException
Throws:
android.database.sqlite.SQLiteException

getInputStream

public java.io.InputStream getInputStream(ITileLayer pTileSource,
                                 MapTile pTile)
Description copied from interface: IArchiveFile
Get the input stream for the requested tile.
Specified by:
IArchiveFile
Returns:
the input stream, or null if the archive doesn't contain an entry for the requested tile

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getMinZoomLevel

public float getMinZoomLevel()

getMaxZoomLevel

public float getMaxZoomLevel()

getName

public java.lang.String getName()

getType

public java.lang.String getType()

getVersion

public java.lang.String getVersion()

getDescription

public java.lang.String getDescription()

getAttribution

public java.lang.String getAttribution()

getBounds

public BoundingBox getBounds()

getCenter

public LatLng getCenter()

close

public void close()

NetworkAvailabilityCheck

java.lang.Object com.mapbox.mapboxsdk.tileprovider.modules.NetworkAvailabilityCheck
public class NetworkAvailabilityCheck
extends java.lang.Object
A straightforward network check implementation. NOTE: Requires android.permission.ACCESS_NETWORK_STATE and android.permission.ACCESS_WIFI_STATE (?) and android.permission.INTERNET (?)

Constructor Summary

Constructors 
Constructor and Description
NetworkAvailabilityCheck(android.content.Context aContext) 

Method Summary

Methods 
Modifier and Type Method and Description
boolean getCellularDataNetworkAvailable() 
boolean getNetworkAvailable() 
boolean getRouteToPathExists(int hostAddress) 
boolean getWiFiNetworkAvailable() 

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

NetworkAvailabilityCheck

public NetworkAvailabilityCheck(android.content.Context aContext)

Method Detail

getNetworkAvailable

public boolean getNetworkAvailable()

getWiFiNetworkAvailable

public boolean getWiFiNetworkAvailable()

getCellularDataNetworkAvailable

public boolean getCellularDataNetworkAvailable()

getRouteToPathExists

public boolean getRouteToPathExists(int hostAddress)

BingTileLayer

java.lang.Object com.mapbox.mapboxsdk.tileprovider.tilesource.TileLayer com.mapbox.mapboxsdk.tileprovider.tilesource.WebSourceTileLayer com.mapbox.mapboxsdk.tileprovider.tilesource.BingTileLayer
All Implemented Interfaces:
MapViewConstants
public class BingTileLayer
extends WebSourceTileLayer

Nested Class Summary

Nested classes/interfaces inherited from interface com.mapbox.mapboxsdk.constants.MapboxConstants

MapboxConstants.RasterImageQuality

Field Summary

Fields 
Modifier and Type Field and Description
static java.lang.String IMAGERYSET_AERIAL 
static java.lang.String IMAGERYSET_AERIALWITHLABELS 
static java.lang.String IMAGERYSET_ROAD 
static java.lang.String TAG 

Fields inherited from class com.mapbox.mapboxsdk.tileprovider.tilesource.WebSourceTileLayer

mEnableSSL

Fields inherited from class com.mapbox.mapboxsdk.tileprovider.tilesource.TileLayer

mUrl

Fields inherited from interface com.mapbox.mapboxsdk.constants.MapboxConstants

USER_AGENT

Fields inherited from interface com.mapbox.mapboxsdk.tileprovider.constants.TileLayerConstants

WORLD_BOUNDING_BOX

Fields inherited from interface com.mapbox.mapboxsdk.views.util.constants.MapViewConstants

DEFAULT_PIN_ANCHOR

Constructor Summary

Constructors 
Constructor and Description
BingTileLayer(java.lang.String key) 

Method Summary

Methods 
Modifier and Type Method and Description
java.lang.String getBingMapKey() 
java.lang.String getCacheKey()
Get the cache key used for the disk cache
java.lang.String getStyle() 
java.lang.String MapTile aTile, boolean hdpi)
Get a single Tile URL for a single tile.
TileLayer setStyle(java.lang.String style) 

Methods inherited from class com.mapbox.mapboxsdk.tileprovider.tilesource.WebSourceTileLayer

setURL

Methods inherited from class com.mapbox.mapboxsdk.tileprovider.tilesource.TileLayer

setName

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

TAG

public static java.lang.String TAG

IMAGERYSET_AERIAL

public static final java.lang.String IMAGERYSET_AERIAL
See Also:
Constant Field Values

IMAGERYSET_AERIALWITHLABELS

public static final java.lang.String IMAGERYSET_AERIALWITHLABELS
See Also:
Constant Field Values

IMAGERYSET_ROAD

public static final java.lang.String IMAGERYSET_ROAD
See Also:
Constant Field Values

Constructor Detail

BingTileLayer

public BingTileLayer(java.lang.String key)

Method Detail

getTileURL

public java.lang.String getTileURL(MapTile aTile,
                          boolean hdpi)
Description copied from class: WebSourceTileLayer
Get a single Tile URL for a single tile.
Overrides:
WebSourceTileLayer
Parameters:
aTile - a map tile
hdpi - a boolean that indicates whether the tile should be at 2x or retina size
Returns:
a list of tile URLs

getCacheKey

public java.lang.String getCacheKey()
Description copied from interface: ITileLayer
Get the cache key used for the disk cache
Specified by:
ITileLayer
Overrides:
TileLayer
Returns:
the cache key

getBingMapKey

public java.lang.String getBingMapKey()

getStyle

public java.lang.String getStyle()

setStyle

public TileLayer setStyle(java.lang.String style)

ITileLayer

All Known Implementing Classes:
WebSourceTileLayer
public interface ITileLayer

Method Summary

Methods 
Modifier and Type Method and Description
void detach() 
java.lang.String getAttribution()
Get the tile source attribution
BoundingBox getBoundingBox()
Get the tile source bounding box.
java.lang.String getCacheKey()
Get the cache key used for the disk cache
LatLng getCenterCoordinate()
Get the tile source center.
float getCenterZoom()
Get the tile source suggested starting zoom.
java.lang.String getDescription()
Get the tile source description
android.graphics.drawable.Drawable MapTileDownloader downloader, MapTile aTile, boolean hdpi)
Get a rendered Drawable from the specified Tile.
java.lang.String getLegend()
Get the tile source legend
float getMaximumZoomLevel()
Get the maximum zoom level this tile source can provide.
float getMinimumZoomLevel()
Get the minimum zoom level this tile source can provide.
java.lang.String getName()
Get the tile source short name
int getTileSizePixels()
Get the tile size in pixels this tile source provides.
TileLayer setURL(java.lang.String aUrl)
Set the current tile url template used in this layer

Method Detail

detach

void detach()

getDrawableFromTile

android.graphics.drawable.Drawable getDrawableFromTile(MapTileDownloader downloader,
                                                     MapTile aTile,
                                                     boolean hdpi)
Get a rendered Drawable from the specified Tile.
Parameters:
downloader - reference to the downloader asking for the tile
aTile - the tile requested
hdpi - is hdpi requested?
Returns:
the rendered Drawable

setURL

TileLayer setURL(java.lang.String aUrl)
Set the current tile url template used in this layer
Returns:
the tile layer

getMinimumZoomLevel

float getMinimumZoomLevel()
Get the minimum zoom level this tile source can provide.
Returns:
the minimum zoom level

getMaximumZoomLevel

float getMaximumZoomLevel()
Get the maximum zoom level this tile source can provide.
Returns:
the maximum zoom level

getTileSizePixels

int getTileSizePixels()
Get the tile size in pixels this tile source provides.
Returns:
the tile size in pixels

getBoundingBox

BoundingBox getBoundingBox()
Get the tile source bounding box.
Returns:
the tile source bounding box

getCenterCoordinate

LatLng getCenterCoordinate()
Get the tile source center.
Returns:
the tile source center

getCenterZoom

float getCenterZoom()
Get the tile source suggested starting zoom.
Returns:
the tile suggested starting zoom

getName

java.lang.String getName()
Get the tile source short name
Returns:
the short name

getDescription

java.lang.String getDescription()
Get the tile source description
Returns:
the short description

getAttribution

java.lang.String getAttribution()
Get the tile source attribution
Returns:
the short attribution

getLegend

java.lang.String getLegend()
Get the tile source legend
Returns:
the legend

getCacheKey

java.lang.String getCacheKey()
Get the cache key used for the disk cache
Returns:
the cache key

MapboxTileLayer

java.lang.Object com.mapbox.mapboxsdk.tileprovider.tilesource.TileLayer com.mapbox.mapboxsdk.tileprovider.tilesource.WebSourceTileLayer com.mapbox.mapboxsdk.tileprovider.tilesource.TileJsonTileLayer com.mapbox.mapboxsdk.tileprovider.tilesource.MapboxTileLayer
All Implemented Interfaces:
MapViewConstants
public class MapboxTileLayer
extends TileJsonTileLayer
implements MapboxConstants
A convenience class to initialize tile layers that use Mapbox services. Underneath, this initializes a WebSourceTileLayer, but provides conveniences for retina tiles, initialization by ID, and loading over SSL.

Nested Class Summary

Nested classes/interfaces inherited from interface com.mapbox.mapboxsdk.constants.MapboxConstants

MapboxConstants.RasterImageQuality

Field Summary

Fields inherited from class com.mapbox.mapboxsdk.tileprovider.tilesource.WebSourceTileLayer

mEnableSSL

Fields inherited from class com.mapbox.mapboxsdk.tileprovider.tilesource.TileLayer

mUrl

Fields inherited from interface com.mapbox.mapboxsdk.views.util.constants.MapViewConstants

DEFAULT_PIN_ANCHOR

Fields inherited from interface com.mapbox.mapboxsdk.constants.MapboxConstants

USER_AGENT

Fields inherited from interface com.mapbox.mapboxsdk.tileprovider.constants.TileLayerConstants

WORLD_BOUNDING_BOX

Constructor Summary

Constructors 
Constructor and Description
MapboxTileLayer(java.lang.String mapId)
Initialize a new tile layer, directed at a hosted Mapbox tilesource.
MapboxTileLayer(java.lang.String mapId, boolean enableSSL) 

Method Summary

Methods 
Modifier and Type Method and Description
protected java.lang.String getBrandedJSONURL() 
java.lang.String getCacheKey()
Get the cache key used for the disk cache
protected void initialize(java.lang.String pId, java.lang.String aUrl, boolean enableSSL) 
TileLayer setURL(java.lang.String aUrl)
Sets the layer's tile URL template string.

Methods inherited from class com.mapbox.mapboxsdk.tileprovider.tilesource.TileJsonTileLayer

setTileJSON

Methods inherited from class com.mapbox.mapboxsdk.tileprovider.tilesource.WebSourceTileLayer

parseUrlForTile

Methods inherited from class com.mapbox.mapboxsdk.tileprovider.tilesource.TileLayer

setName

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

MapboxTileLayer

public MapboxTileLayer(java.lang.String mapId)
Initialize a new tile layer, directed at a hosted Mapbox tilesource.
Parameters:
mapId - a valid mapid, of the form account.map

MapboxTileLayer

public MapboxTileLayer(java.lang.String mapId,
               boolean enableSSL)

Method Detail

initialize

protected void initialize(java.lang.String pId,
              java.lang.String aUrl,
              boolean enableSSL)
Overrides:
WebSourceTileLayer

setURL

public TileLayer setURL(java.lang.String aUrl)
Description copied from class: TileLayer
Sets the layer's tile URL template string.
Specified by:
ITileLayer
Overrides:
WebSourceTileLayer
Returns:
the tile layer

getBrandedJSONURL

protected java.lang.String getBrandedJSONURL()
Overrides:
TileJsonTileLayer

getCacheKey

public java.lang.String getCacheKey()
Description copied from interface: ITileLayer
Get the cache key used for the disk cache
Specified by:
ITileLayer
Overrides:
TileLayer
Returns:
the cache key

MBTilesLayer

java.lang.Object com.mapbox.mapboxsdk.tileprovider.tilesource.TileLayer com.mapbox.mapboxsdk.tileprovider.tilesource.MBTilesLayer
All Implemented Interfaces:
MapViewConstants
public class MBTilesLayer
extends TileLayer
implements MapboxConstants
A layer that pulls resources from an MBTiles file. Used for offline map tiles, like those generated by TileMill.

Nested Class Summary

Nested classes/interfaces inherited from interface com.mapbox.mapboxsdk.constants.MapboxConstants

MapboxConstants.RasterImageQuality

Field Summary

Fields inherited from class com.mapbox.mapboxsdk.tileprovider.tilesource.TileLayer

mUrl

Fields inherited from interface com.mapbox.mapboxsdk.views.util.constants.MapViewConstants

DEFAULT_PIN_ANCHOR

Fields inherited from interface com.mapbox.mapboxsdk.constants.MapboxConstants

USER_AGENT

Fields inherited from interface com.mapbox.mapboxsdk.tileprovider.constants.TileLayerConstants

WORLD_BOUNDING_BOX

Constructor Summary

Constructors 
Constructor and Description
MBTilesLayer(android.content.Context context, java.lang.String url)
Initialize a new tile layer, represented by a MBTiles file.
MBTilesLayer(java.io.File file)
Initialize a new tile layer, represented by a MBTiles file.
MBTilesLayer(android.database.sqlite.SQLiteDatabase db)
Initialize a new tile layer, represented by a Database file.
MBTilesLayer(java.lang.String url)
Initialize a new tile layer, represented by a MBTiles file.

Method Summary

Methods 
Modifier and Type Method and Description
void detach() 
CacheableBitmapDrawable MapTileDownloader downloader, MapTile aTile, boolean hdpi)
Get a rendered Drawable from the specified Tile.

Methods inherited from class com.mapbox.mapboxsdk.tileprovider.tilesource.TileLayer

setURL

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

MBTilesLayer

public MBTilesLayer(android.content.Context context,
            java.lang.String url)
Initialize a new tile layer, represented by a MBTiles file.
Parameters:
url - path to a MBTiles file
context - the graphics drawing context

MBTilesLayer

public MBTilesLayer(java.lang.String url)
Initialize a new tile layer, represented by a MBTiles file. This constructor does need a context but as a consequence won't look for an asset mbtiles
Parameters:
url - path to a MBTiles file

MBTilesLayer

public MBTilesLayer(java.io.File file)
Initialize a new tile layer, represented by a MBTiles file.
Parameters:
file - a MBTiles file

MBTilesLayer

public MBTilesLayer(android.database.sqlite.SQLiteDatabase db)
Initialize a new tile layer, represented by a Database file.
Parameters:
db - a database used as the MBTiles source

Method Detail

detach

public void detach()
Specified by:
ITileLayer
Overrides:
TileLayer

getDrawableFromTile

public CacheableBitmapDrawable getDrawableFromTile(MapTileDownloader downloader,
                                          MapTile aTile,
                                          boolean hdpi)
Description copied from interface: ITileLayer
Get a rendered Drawable from the specified Tile.
Specified by:
ITileLayer
Overrides:
TileLayer
Parameters:
downloader - reference to the downloader asking for the tile
aTile - the tile requested
hdpi - is hdpi requested?
Returns:
the rendered Drawable

TileJsonTileLayer

java.lang.Object com.mapbox.mapboxsdk.tileprovider.tilesource.TileLayer com.mapbox.mapboxsdk.tileprovider.tilesource.WebSourceTileLayer com.mapbox.mapboxsdk.tileprovider.tilesource.TileJsonTileLayer
All Implemented Interfaces:
MapViewConstants
Direct Known Subclasses:
MapboxTileLayer
public class TileJsonTileLayer
extends WebSourceTileLayer
A type of tile layer that loads tiles from the internet and metadata about itself with the TileJSON standard.

Nested Class Summary

Nested classes/interfaces inherited from interface com.mapbox.mapboxsdk.constants.MapboxConstants

MapboxConstants.RasterImageQuality

Field Summary

Fields inherited from class com.mapbox.mapboxsdk.tileprovider.tilesource.WebSourceTileLayer

mEnableSSL

Fields inherited from class com.mapbox.mapboxsdk.tileprovider.tilesource.TileLayer

mUrl

Fields inherited from interface com.mapbox.mapboxsdk.constants.MapboxConstants

USER_AGENT

Fields inherited from interface com.mapbox.mapboxsdk.tileprovider.constants.TileLayerConstants

WORLD_BOUNDING_BOX

Fields inherited from interface com.mapbox.mapboxsdk.views.util.constants.MapViewConstants

DEFAULT_PIN_ANCHOR

Constructor Summary

Constructors 
Constructor and Description
TileJsonTileLayer(java.lang.String pId, java.lang.String url, boolean enableSSL) 

Method Summary

Methods 
Modifier and Type Method and Description
protected java.lang.String getBrandedJSONURL() 
org.json.JSONObject getTileJSON() 
void setTileJSON(org.json.JSONObject aTileJSON) 

Methods inherited from class com.mapbox.mapboxsdk.tileprovider.tilesource.WebSourceTileLayer

setURL

Methods inherited from class com.mapbox.mapboxsdk.tileprovider.tilesource.TileLayer

setName

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

TileJsonTileLayer

public TileJsonTileLayer(java.lang.String pId,
                 java.lang.String url,
                 boolean enableSSL)

Method Detail

getTileJSON

public org.json.JSONObject getTileJSON()

setTileJSON

public void setTileJSON(org.json.JSONObject aTileJSON)

getBrandedJSONURL

protected java.lang.String getBrandedJSONURL()

TileLayer

java.lang.Object com.mapbox.mapboxsdk.tileprovider.tilesource.TileLayer
All Implemented Interfaces:
MapViewConstants
Direct Known Subclasses:
WebSourceTileLayer
public class TileLayer
extends java.lang.Object
implements MapViewConstants

Field Summary

Fields 
Modifier and Type Field and Description
protected java.lang.String mAttribution 
protected BoundingBox mBoundingBox 
protected java.lang.String mCacheKey 
protected LatLng mCenter 
protected java.lang.String mDescription 
protected java.lang.String mLegend 
protected float mMaximumZoomLevel 
protected float mMinimumZoomLevel 
protected java.lang.String mName 
protected java.lang.String mUrl 

Fields inherited from interface com.mapbox.mapboxsdk.tileprovider.constants.TileLayerConstants

WORLD_BOUNDING_BOX

Fields inherited from interface com.mapbox.mapboxsdk.views.util.constants.MapViewConstants

DEFAULT_PIN_ANCHOR

Constructor Summary

Constructors 
Constructor and Description
TileLayer(java.lang.String pId, java.lang.String aUrl) 

Method Summary

Methods 
Modifier and Type Method and Description
void detach() 
java.lang.String getAttribution()
Get the tile source attribution
BoundingBox getBoundingBox()
Get the tile source bounding box.
java.lang.String getCacheKey()
Get the cache key used for the disk cache
LatLng getCenterCoordinate()
Get the tile source center.
float getCenterZoom()
Get the tile source suggested starting zoom.
java.lang.String getDescription()
Get the tile source description
android.graphics.drawable.Drawable MapTileDownloader downloader, MapTile aTile, boolean hdpi)
Get a rendered Drawable from the specified Tile.
java.lang.String getLegend()
Get the tile source legend
float getMaximumZoomLevel()
Get the maximum zoom level this tile source can provide.
float getMinimumZoomLevel()
Get the minimum zoom level this tile source can provide.
java.lang.String getName()
Get the tile source short name
int getTileSizePixels()
Get the tile size in pixels this tile source provides.
TileLayer setAttribution(java.lang.String aAttribution)
Sets the layer's attribution string.
TileLayer setDescription(java.lang.String aDescription)
Sets the layer's description string.
TileLayer setMaximumZoomLevel(float aMaximumZoomLevel)
Sets the layer's minimum zoom level.
TileLayer setMinimumZoomLevel(float aMinimumZoomLevel)
Sets the layer's minimum zoom level.
TileLayer setName(java.lang.String aName)
Sets the layer's name.
TileLayer setURL(java.lang.String aUrl)
Sets the layer's tile URL template string.

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

mUrl

protected java.lang.String mUrl

mCacheKey

protected java.lang.String mCacheKey

mName

protected java.lang.String mName

mDescription

protected java.lang.String mDescription

mAttribution

protected java.lang.String mAttribution

mLegend

protected java.lang.String mLegend

mMinimumZoomLevel

protected float mMinimumZoomLevel

mMaximumZoomLevel

protected float mMaximumZoomLevel

mBoundingBox

protected BoundingBox mBoundingBox

mCenter

protected LatLng mCenter

Constructor Detail

TileLayer

public TileLayer(java.lang.String pId,
         java.lang.String aUrl)

Method Detail

setURL

public TileLayer setURL(java.lang.String aUrl)
Sets the layer's tile URL template string.
Specified by:
ITileLayer
Returns:
the tile layer

setAttribution

public TileLayer setAttribution(java.lang.String aAttribution)
Sets the layer's attribution string.

setDescription

public TileLayer setDescription(java.lang.String aDescription)
Sets the layer's description string.

setName

public TileLayer setName(java.lang.String aName)
Sets the layer's name.

setMinimumZoomLevel

public TileLayer setMinimumZoomLevel(float aMinimumZoomLevel)
Sets the layer's minimum zoom level.

setMaximumZoomLevel

public TileLayer setMaximumZoomLevel(float aMaximumZoomLevel)
Sets the layer's minimum zoom level.

getDrawableFromTile

public android.graphics.drawable.Drawable getDrawableFromTile(MapTileDownloader downloader,
                                                     MapTile aTile,
                                                     boolean hdpi)
Description copied from interface: ITileLayer
Get a rendered Drawable from the specified Tile.
Specified by:
ITileLayer
Parameters:
downloader - reference to the downloader asking for the tile
aTile - the tile requested
hdpi - is hdpi requested?
Returns:
the rendered Drawable

detach

public void detach()
Specified by:
ITileLayer

getMinimumZoomLevel

public float getMinimumZoomLevel()
Description copied from interface: ITileLayer
Get the minimum zoom level this tile source can provide.
Specified by:
ITileLayer
Returns:
the minimum zoom level

getMaximumZoomLevel

public float getMaximumZoomLevel()
Description copied from interface: ITileLayer
Get the maximum zoom level this tile source can provide.
Specified by:
ITileLayer
Returns:
the maximum zoom level

getTileSizePixels

public int getTileSizePixels()
Description copied from interface: ITileLayer
Get the tile size in pixels this tile source provides.
Specified by:
ITileLayer
Returns:
the tile size in pixels

getCacheKey

public java.lang.String getCacheKey()
Description copied from interface: ITileLayer
Get the cache key used for the disk cache
Specified by:
ITileLayer
Returns:
the cache key

getBoundingBox

public BoundingBox getBoundingBox()
Description copied from interface: ITileLayer
Get the tile source bounding box.
Specified by:
ITileLayer
Returns:
the tile source bounding box

getCenterCoordinate

public LatLng getCenterCoordinate()
Description copied from interface: ITileLayer
Get the tile source center.
Specified by:
ITileLayer
Returns:
the tile source center

getCenterZoom

public float getCenterZoom()
Description copied from interface: ITileLayer
Get the tile source suggested starting zoom.
Specified by:
ITileLayer
Returns:
the tile suggested starting zoom

getName

public java.lang.String getName()
Description copied from interface: ITileLayer
Get the tile source short name
Specified by:
ITileLayer
Returns:
the short name

getDescription

public java.lang.String getDescription()
Description copied from interface: ITileLayer
Get the tile source description
Specified by:
ITileLayer
Returns:
the short description

getAttribution

public java.lang.String getAttribution()
Description copied from interface: ITileLayer
Get the tile source attribution
Specified by:
ITileLayer
Returns:
the short attribution

getLegend

public java.lang.String getLegend()
Description copied from interface: ITileLayer
Get the tile source legend
Specified by:
ITileLayer
Returns:
the legend

TileMillLayer

java.lang.Object com.mapbox.mapboxsdk.tileprovider.tilesource.TileLayer com.mapbox.mapboxsdk.tileprovider.tilesource.WebSourceTileLayer com.mapbox.mapboxsdk.tileprovider.tilesource.TileMillLayer
All Implemented Interfaces:
MapViewConstants
public class TileMillLayer
extends WebSourceTileLayer
implements MapboxConstants

Nested Class Summary

Nested classes/interfaces inherited from interface com.mapbox.mapboxsdk.constants.MapboxConstants

MapboxConstants.RasterImageQuality

Field Summary

Fields inherited from class com.mapbox.mapboxsdk.tileprovider.tilesource.WebSourceTileLayer

mEnableSSL

Fields inherited from class com.mapbox.mapboxsdk.tileprovider.tilesource.TileLayer

mUrl

Fields inherited from interface com.mapbox.mapboxsdk.constants.MapboxConstants

USER_AGENT

Fields inherited from interface com.mapbox.mapboxsdk.tileprovider.constants.TileLayerConstants

WORLD_BOUNDING_BOX

Fields inherited from interface com.mapbox.mapboxsdk.views.util.constants.MapViewConstants

DEFAULT_PIN_ANCHOR

Constructor Summary

Constructors 
Constructor and Description
TileMillLayer(java.lang.String pMap) 
TileMillLayer(java.lang.String pHost, java.lang.String pMap) 
TileMillLayer(java.lang.String pHost, java.lang.String pMap, float pMinZoom, float pMaxZoom) 

Method Summary

Methods 
Modifier and Type Method and Description
java.lang.String MapTile aTile, boolean hdpi)
Get a single Tile URL for a single tile.
TileLayer setURL(java.lang.String aUrl)
Sets the layer's tile URL template string.

Methods inherited from class com.mapbox.mapboxsdk.tileprovider.tilesource.WebSourceTileLayer

parseUrlForTile

Methods inherited from class com.mapbox.mapboxsdk.tileprovider.tilesource.TileLayer

setName

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

TileMillLayer

public TileMillLayer(java.lang.String pHost,
             java.lang.String pMap,
             float pMinZoom,
             float pMaxZoom)

TileMillLayer

public TileMillLayer(java.lang.String pHost,
             java.lang.String pMap)

TileMillLayer

public TileMillLayer(java.lang.String pMap)

Method Detail

setURL

public TileLayer setURL(java.lang.String aUrl)
Description copied from class: TileLayer
Sets the layer's tile URL template string.
Specified by:
ITileLayer
Overrides:
WebSourceTileLayer
Returns:
the tile layer

getTileURL

public java.lang.String getTileURL(MapTile aTile,
                          boolean hdpi)
Description copied from class: WebSourceTileLayer
Get a single Tile URL for a single tile.
Overrides:
WebSourceTileLayer
Parameters:
aTile - a map tile
hdpi - a boolean that indicates whether the tile should be at 2x or retina size
Returns:
a list of tile URLs

WebSourceTileLayer

java.lang.Object com.mapbox.mapboxsdk.tileprovider.tilesource.TileLayer com.mapbox.mapboxsdk.tileprovider.tilesource.WebSourceTileLayer
All Implemented Interfaces:
MapViewConstants
Direct Known Subclasses:
TileMillLayer
public class WebSourceTileLayer
extends TileLayer
implements MapboxConstants
An implementation of TileLayer that pulls tiles from the internet.

Nested Class Summary

Nested classes/interfaces inherited from interface com.mapbox.mapboxsdk.constants.MapboxConstants

MapboxConstants.RasterImageQuality

Field Summary

Fields 
Modifier and Type Field and Description
protected boolean mEnableSSL 

Fields inherited from class com.mapbox.mapboxsdk.tileprovider.tilesource.TileLayer

mUrl

Fields inherited from interface com.mapbox.mapboxsdk.constants.MapboxConstants

USER_AGENT

Fields inherited from interface com.mapbox.mapboxsdk.tileprovider.constants.TileLayerConstants

WORLD_BOUNDING_BOX

Fields inherited from interface com.mapbox.mapboxsdk.views.util.constants.MapViewConstants

DEFAULT_PIN_ANCHOR

Constructor Summary

Constructors 
Constructor and Description
WebSourceTileLayer(java.lang.String pId, java.lang.String url) 
WebSourceTileLayer(java.lang.String pId, java.lang.String url, boolean enableSSL) 

Method Summary

Methods 
Modifier and Type Method and Description
android.graphics.Bitmap MapTile mapTile, java.lang.String url, MapTileCache aCache)
Requests and returns a bitmap object from a given URL, using aCache to decode it.
CacheableBitmapDrawable MapTileDownloader downloader, MapTile aTile, boolean hdpi)
Get a rendered Drawable from the specified Tile.
java.lang.String MapTile aTile, boolean hdpi)
Get a single Tile URL for a single tile.
java.lang.String[] MapTile aTile, boolean hdpi)
Gets a list of Tile URLs used by this layer for a specific tile.
protected void initialize(java.lang.String pId, java.lang.String aUrl, boolean enableSSL) 
protected java.lang.String parseUrlForTile(java.lang.String url, MapTile aTile, boolean hdpi) 
TileLayer setURL(java.lang.String aUrl)
Sets the layer's tile URL template string.

Methods inherited from class com.mapbox.mapboxsdk.tileprovider.tilesource.TileLayer

setName

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

mEnableSSL

protected boolean mEnableSSL

Constructor Detail

WebSourceTileLayer

public WebSourceTileLayer(java.lang.String pId,
                  java.lang.String url)

WebSourceTileLayer

public WebSourceTileLayer(java.lang.String pId,
                  java.lang.String url,
                  boolean enableSSL)

Method Detail

setURL

public TileLayer setURL(java.lang.String aUrl)
Description copied from class: TileLayer
Sets the layer's tile URL template string.
Specified by:
ITileLayer
Overrides:
TileLayer
Returns:
the tile layer

initialize

protected void initialize(java.lang.String pId,
              java.lang.String aUrl,
              boolean enableSSL)

getTileURLs

public java.lang.String[] getTileURLs(MapTile aTile,
                             boolean hdpi)
Gets a list of Tile URLs used by this layer for a specific tile.
Parameters:
aTile - a map tile
hdpi - a boolean that indicates whether the tile should be at 2x or retina size
Returns:
a list of tile URLS

getTileURL

public java.lang.String getTileURL(MapTile aTile,
                          boolean hdpi)
Get a single Tile URL for a single tile.
Parameters:
aTile - a map tile
hdpi - a boolean that indicates whether the tile should be at 2x or retina size
Returns:
a list of tile URLs

parseUrlForTile

protected java.lang.String parseUrlForTile(java.lang.String url,
                               MapTile aTile,
                               boolean hdpi)

getDrawableFromTile

public CacheableBitmapDrawable getDrawableFromTile(MapTileDownloader downloader,
                                          MapTile aTile,
                                          boolean hdpi)
Description copied from interface: ITileLayer
Get a rendered Drawable from the specified Tile.
Specified by:
ITileLayer
Overrides:
TileLayer
Parameters:
downloader - reference to the downloader asking for the tile
aTile - the tile requested
hdpi - is hdpi requested?
Returns:
the rendered Drawable

getBitmapFromURL

public android.graphics.Bitmap getBitmapFromURL(MapTile mapTile,
                                       java.lang.String url,
                                       MapTileCache aCache)
Requests and returns a bitmap object from a given URL, using aCache to decode it.
Parameters:
mapTile - MapTile
url - the map tile url. should refer to a valid bitmap resource.
aCache - a cache, an instance of MapTileCache
Returns:
the tile if valid, otherwise null

LowMemoryException

java.lang.Object java.lang.Throwable java.lang.Exception com.mapbox.mapboxsdk.tileprovider.util.LowMemoryException
All Implemented Interfaces:
java.io.Serializable
public final class LowMemoryException
extends java.lang.Exception
See Also:
Serialized Form

Constructor Summary

Constructors 
Constructor and Description
LowMemoryException(java.lang.String pDetailMessage) 
LowMemoryException(java.lang.Throwable pThrowable) 

Method Summary

Methods inherited from class java.lang.Throwable

addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

LowMemoryException

public LowMemoryException(java.lang.String pDetailMessage)

LowMemoryException

public LowMemoryException(java.lang.Throwable pThrowable)

SimpleInvalidationHandler

java.lang.Object android.os.Handler com.mapbox.mapboxsdk.tileprovider.util.SimpleInvalidationHandler
public class SimpleInvalidationHandler
extends android.os.Handler

Nested Class Summary

Nested classes/interfaces inherited from class android.os.Handler

android.os.Handler.Callback

Constructor Summary

Constructors 
Constructor and Description
MapView pView) 

Method Summary

Methods 
Modifier and Type Method and Description
void handleMessage(android.os.Message msg) 

Methods inherited from class android.os.Handler

dispatchMessage, dump, getLooper, getMessageName, hasMessages, hasMessages, obtainMessage, obtainMessage, obtainMessage, obtainMessage, obtainMessage, post, postAtFrontOfQueue, postAtTime, postAtTime, postDelayed, removeCallbacks, removeCallbacks, removeCallbacksAndMessages, removeMessages, removeMessages, sendEmptyMessage, sendEmptyMessageAtTime, sendEmptyMessageDelayed, sendMessage, sendMessageAtFrontOfQueue, sendMessageAtTime, sendMessageDelayed, toString

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

SimpleInvalidationHandler

public SimpleInvalidationHandler(MapView pView)

Method Detail

handleMessage

public void handleMessage(android.os.Message msg)
Overrides:
handleMessage in class android.os.Handler

SimpleRegisterReceiver

java.lang.Object com.mapbox.mapboxsdk.tileprovider.util.SimpleRegisterReceiver
All Implemented Interfaces:
IRegisterReceiver
public class SimpleRegisterReceiver
extends java.lang.Object
implements IRegisterReceiver

Constructor Summary

Constructors 
Constructor and Description
SimpleRegisterReceiver(android.content.Context pContext) 

Method Summary

Methods 
Modifier and Type Method and Description
android.content.Intent registerReceiver(android.content.BroadcastReceiver aReceiver, android.content.IntentFilter aFilter) 
void unregisterReceiver(android.content.BroadcastReceiver aReceiver) 

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SimpleRegisterReceiver

public SimpleRegisterReceiver(android.content.Context pContext)

Method Detail

registerReceiver

public android.content.Intent registerReceiver(android.content.BroadcastReceiver aReceiver,
                                      android.content.IntentFilter aFilter)
Specified by:
IRegisterReceiver

unregisterReceiver

public void unregisterReceiver(android.content.BroadcastReceiver aReceiver)
Specified by:
IRegisterReceiver

StreamUtils

java.lang.Object com.mapbox.mapboxsdk.tileprovider.util.StreamUtils
public class StreamUtils
extends java.lang.Object

Field Summary

Fields 
Modifier and Type Field and Description
static int IO_BUFFER_SIZE 

Method Summary

Methods 
Modifier and Type Method and Description
static void closeStream(java.io.Closeable stream)
Closes the specified stream.
static long copy(java.io.InputStream in, java.io.OutputStream out)
Copy the content of the input stream into the output stream, using a temporary byte array buffer whose size is defined by IO_BUFFER_SIZE.

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

IO_BUFFER_SIZE

public static final int IO_BUFFER_SIZE
See Also:
Constant Field Values

Method Detail

copy

public static long copy(java.io.InputStream in,
        java.io.OutputStream out)
                 throws java.io.IOException
Copy the content of the input stream into the output stream, using a temporary byte array buffer whose size is defined by IO_BUFFER_SIZE.
Parameters:
in - The input stream to copy from.
out - The output stream to copy to.
Returns:
the total length copied
Throws:
java.io.IOException - If any error occurs during the copy.

closeStream

public static void closeStream(java.io.Closeable stream)
Closes the specified stream.
Parameters:
stream - The stream to close.

AppUtils

java.lang.Object com.mapbox.mapboxsdk.util.AppUtils
public class AppUtils
extends java.lang.Object

Constructor Summary

Constructors 
Constructor and Description
AppUtils() 

Method Summary

Methods 
Modifier and Type Method and Description
static boolean isRunningOn2xOrGreaterScreen(android.content.Context context) 
static boolean runningOnMainThread() 

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AppUtils

public AppUtils()

Method Detail

runningOnMainThread

public static boolean runningOnMainThread()

isRunningOn2xOrGreaterScreen

public static boolean isRunningOn2xOrGreaterScreen(android.content.Context context)

BitmapUtils

java.lang.Object com.mapbox.mapboxsdk.util.BitmapUtils
public class BitmapUtils
extends java.lang.Object

Field Summary

Fields 
Modifier and Type Field and Description
static int[] EXPIRED 

Constructor Summary

Constructors 
Constructor and Description
BitmapUtils() 

Method Summary

Methods 
Modifier and Type Method and Description
static int calculateMemoryCacheSize(android.content.Context context) 
static android.graphics.BitmapFactory.Options getBitmapOptions(android.util.DisplayMetrics mDisplayMetrics) 
static boolean isCacheDrawableExpired(android.graphics.drawable.Drawable drawable) 
static void CacheableBitmapDrawable drawable) 

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

EXPIRED

public static final int[] EXPIRED

Constructor Detail

BitmapUtils

public BitmapUtils()

Method Detail

getBitmapOptions

public static android.graphics.BitmapFactory.Options getBitmapOptions(android.util.DisplayMetrics mDisplayMetrics)

isCacheDrawableExpired

public static boolean isCacheDrawableExpired(android.graphics.drawable.Drawable drawable)

setCacheDrawableExpired

public static void setCacheDrawableExpired(CacheableBitmapDrawable drawable)

calculateMemoryCacheSize

public static int calculateMemoryCacheSize(android.content.Context context)

UtilConstants

java.lang.Object com.mapbox.mapboxsdk.util.constants.UtilConstants
public class UtilConstants
extends java.lang.Object

Field Summary

Fields 
Modifier and Type Field and Description
static boolean DEBUGMODE 
static long GPS_WAIT_TIME
The time we wait after the last gps location before using a non-gps location.

Constructor Summary

Constructors 
Constructor and Description
UtilConstants() 

Method Summary

Methods 
Modifier and Type Method and Description
static void setDebugMode(boolean value) 

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

GPS_WAIT_TIME

public static final long GPS_WAIT_TIME
The time we wait after the last gps location before using a non-gps location.
See Also:
Constant Field Values

DEBUGMODE

public static boolean DEBUGMODE

Constructor Detail

UtilConstants

public UtilConstants()

Method Detail

setDebugMode

public static void setDebugMode(boolean value)

DataLoadingUtils

java.lang.Object com.mapbox.mapboxsdk.util.DataLoadingUtils
public class DataLoadingUtils
extends java.lang.Object

Constructor Summary

Constructors 
Constructor and Description
DataLoadingUtils() 

Method Summary

Methods 
Modifier and Type Method and Description
static java.util.ArrayList<java.lang.Object> FeatureCollection featureCollection, Icon markerIcon)
Converts GeoJSON objects into Mapbox SDK UI Objects
static FeatureCollection loadGeoJSONFromAssets(android.content.Context context, java.lang.String fileName)
Load GeoJSON from URL (in synchronous manner) and return GeoJSON FeatureCollection
static FeatureCollection loadGeoJSONFromUrl(java.lang.String url)
Load GeoJSON from URL (in synchronous manner) and return GeoJSON FeatureCollection
static java.lang.String readAll(java.io.Reader rd) 

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

DataLoadingUtils

public DataLoadingUtils()

Method Detail

loadGeoJSONFromUrl

public static FeatureCollection loadGeoJSONFromUrl(java.lang.String url)
                                            throws java.io.IOException,
                                                   org.json.JSONException
Load GeoJSON from URL (in synchronous manner) and return GeoJSON FeatureCollection
Parameters:
url - URL of GeoJSON data
Returns:
Remote GeoJSON parsed into Library objects
Throws:
java.io.IOException
org.json.JSONException

loadGeoJSONFromAssets

public static FeatureCollection loadGeoJSONFromAssets(android.content.Context context,
                                      java.lang.String fileName)
                                               throws java.io.IOException,
                                                      org.json.JSONException
Load GeoJSON from URL (in synchronous manner) and return GeoJSON FeatureCollection
Parameters:
context - Application's Context
fileName - Name of file in assets directory
Returns:
Local GeoJSON file parsed into Library objects
Throws:
java.io.IOException
org.json.JSONException

readAll

public static java.lang.String readAll(java.io.Reader rd)
                                throws java.io.IOException
Throws:
java.io.IOException

createUIObjectsFromGeoJSONObjects

public static java.util.ArrayList<java.lang.Object> createUIObjectsFromGeoJSONObjects(FeatureCollection featureCollection,
                                                                      Icon markerIcon)
                                                                               throws org.json.JSONException
Converts GeoJSON objects into Mapbox SDK UI Objects
Parameters:
featureCollection - Parsed GeoJSON Objects
markerIcon - Optional Icon to use for markers
Returns:
Collection of Mapbox SDK UI Objects
Throws:
org.json.JSONException

GeometryMath

java.lang.Object com.mapbox.mapboxsdk.util.GeometryMath
public class GeometryMath
extends java.lang.Object

Field Summary

Fields 
Modifier and Type Field and Description
static double DEG2RAD 
static double RAD2DEG 

Constructor Summary

Constructors 
Constructor and Description
GeometryMath() 

Method Summary

Methods 
Modifier and Type Method and Description
static android.graphics.Rect getBoundingBoxForRotatedRectangle(android.graphics.Rect rect, float centerX, float centerY, float angle, android.graphics.Rect reuse) 
static int getNextSquareNumberAbove(float factor)
Calculates i.e.
static float leftShift(float value, float multiplier)
simulate a binary left shift of a number without using bit operations.
static int mod(int number, int modulus) 
static android.graphics.Point reusable(android.graphics.Point reuse) 
static android.graphics.PointF reusable(android.graphics.PointF reuse) 
static android.graphics.Rect reusable(android.graphics.Rect reuse) 
static android.graphics.RectF reusable(android.graphics.RectF reuse) 
static float rightShift(float value, float multiplier)
simulate a binary right shift of a number without using bit operations.
static android.graphics.PointF rotatePoint(float centerX, float centerY, android.graphics.PointF point, float angle, android.graphics.PointF reuse) 
static android.graphics.Rect viewPortRect(float zoomLevel, Projection projection, android.graphics.Rect reuse) 
static android.graphics.Rect Projection projection, android.graphics.Rect reuse) 
static android.graphics.Rect viewPortRectForTileDrawing(float zoomLevel, Projection projection, android.graphics.Rect reuse) 
static android.graphics.Rect Projection projection, android.graphics.Rect reuse) 

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

DEG2RAD

public static final double DEG2RAD
See Also:
Constant Field Values

RAD2DEG

public static final double RAD2DEG
See Also:
Constant Field Values

Constructor Detail

GeometryMath

public GeometryMath()

Method Detail

getBoundingBoxForRotatedRectangle

public static final android.graphics.Rect getBoundingBoxForRotatedRectangle(android.graphics.Rect rect,
                                                      float centerX,
                                                      float centerY,
                                                      float angle,
                                                      android.graphics.Rect reuse)

reusable

public static final android.graphics.PointF reusable(android.graphics.PointF reuse)

reusable

public static final android.graphics.Point reusable(android.graphics.Point reuse)

reusable

public static final android.graphics.RectF reusable(android.graphics.RectF reuse)

reusable

public static final android.graphics.Rect reusable(android.graphics.Rect reuse)

rotatePoint

public static android.graphics.PointF rotatePoint(float centerX,
                                  float centerY,
                                  android.graphics.PointF point,
                                  float angle,
                                  android.graphics.PointF reuse)

getNextSquareNumberAbove

public static int getNextSquareNumberAbove(float factor)
Calculates i.e. the increase of zoomlevel needed when the visible latitude needs to be bigger by factor.

Assert.assertEquals(1, getNextSquareNumberAbove(1.1f)); Assert.assertEquals(2, getNextSquareNumberAbove(2.1f)); Assert.assertEquals(2, getNextSquareNumberAbove(3.9f)); Assert.assertEquals(3, getNextSquareNumberAbove(4.1f)); Assert.assertEquals(3, getNextSquareNumberAbove(7.9f)); Assert.assertEquals(4, getNextSquareNumberAbove(8.1f)); Assert.assertEquals(5, getNextSquareNumberAbove(16.1f));

Assert.assertEquals(-1, - getNextSquareNumberAbove(1 / 0.4f) + 1); Assert.assertEquals(-2, - getNextSquareNumberAbove(1 / 0.24f) + 1);

mod

public static int mod(int number,
      int modulus)

leftShift

public static float leftShift(float value,
              float multiplier)
simulate a binary left shift of a number without using bit operations.
Parameters:
value -
multiplier -
Returns:

rightShift

public static float rightShift(float value,
               float multiplier)
simulate a binary right shift of a number without using bit operations.
Parameters:
value -
multiplier -
Returns:

viewPortRect

public static android.graphics.Rect viewPortRect(float zoomLevel,
                                 Projection projection,
                                 android.graphics.Rect reuse)

viewPortRectForTileDrawing

public static android.graphics.Rect viewPortRectForTileDrawing(float zoomLevel,
                                               Projection projection,
                                               android.graphics.Rect reuse)

viewPortRect

public static android.graphics.Rect viewPortRect(Projection projection,
                                 android.graphics.Rect reuse)

viewPortRectForTileDrawing

public static android.graphics.Rect viewPortRectForTileDrawing(Projection projection,
                                               android.graphics.Rect reuse)

GeoUtils

java.lang.Object com.mapbox.mapboxsdk.util.GeoUtils
public class GeoUtils
extends java.lang.Object

Constructor Summary

Constructors 
Constructor and Description
GeoUtils() 

Method Summary

Methods 
Modifier and Type Method and Description
static BoundingBox LatLng> coordinates, java.lang.Double padding)
Build a BoundingBox for a List of LatLng

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

GeoUtils

public GeoUtils()

Method Detail

findBoundingBoxForGivenLocations

public static LatLng> coordinates,
                                           java.lang.Double padding)
Build a BoundingBox for a List of LatLng
Parameters:
coordinates - List of coordinates
padding - Option padding. Recommended 0.01. Send in null to have no padding applied
Returns:
BoundingBox containing the given List of LatLng

MapboxUtils

java.lang.Object com.mapbox.mapboxsdk.util.MapboxUtils
All Implemented Interfaces:
MapboxConstants
public class MapboxUtils
extends java.lang.Object
implements MapboxConstants

Nested Class Summary

Nested classes/interfaces inherited from interface com.mapbox.mapboxsdk.constants.MapboxConstants

MapboxConstants.RasterImageQuality

Field Summary

Fields inherited from interface com.mapbox.mapboxsdk.constants.MapboxConstants

USER_AGENT

Constructor Summary

Constructors 
Constructor and Description
MapboxUtils() 

Method Summary

Methods 
Modifier and Type Method and Description
static java.lang.String getAccessToken() 
static java.lang.String getMapTileURL(android.content.Context context, java.lang.String mapID, int zoom, int x, int y, MapboxConstants.RasterImageQuality imageQuality) 
static java.lang.String ILatLng latLng, int zoom)
Build a UTFGrid string for given Coordinate and Zoom Level
static java.lang.String markerIconURL(android.content.Context context, java.lang.String size, java.lang.String symbol, java.lang.String color) 
static java.lang.String MapboxConstants.RasterImageQuality imageQuality) 
static void setAccessToken(java.lang.String accessToken) 

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

MapboxUtils

public MapboxUtils()

Method Detail

getAccessToken

public static java.lang.String getAccessToken()

setAccessToken

public static void setAccessToken(java.lang.String accessToken)

qualityExtensionForImageQuality

public static java.lang.String qualityExtensionForImageQuality(MapboxConstants.RasterImageQuality imageQuality)

markerIconURL

public static java.lang.String markerIconURL(android.content.Context context,
                             java.lang.String size,
                             java.lang.String symbol,
                             java.lang.String color)

getMapTileURL

public static java.lang.String getMapTileURL(android.content.Context context,
                             java.lang.String mapID,
                             int zoom,
                             int x,
                             int y,
                             MapboxConstants.RasterImageQuality imageQuality)

getUTFGridString

public static java.lang.String getUTFGridString(ILatLng latLng,
                                int zoom)
Build a UTFGrid string for given Coordinate and Zoom Level
Parameters:
latLng - Geo Coordinate
zoom - Zoom Level
Returns:
UTFGrid String (z/x/y)

NetworkLocationIgnorer

java.lang.Object com.mapbox.mapboxsdk.util.NetworkLocationIgnorer
public class NetworkLocationIgnorer
extends java.lang.Object
A class to check whether we want to use a location. If there are multiple location providers, i.e. network and GPS, then you want to ignore network locations shortly after a GPS location because you will get another GPS location soon.

Constructor Summary

Constructors 
Constructor and Description
NetworkLocationIgnorer() 

Method Summary

Methods 
Modifier and Type Method and Description
boolean shouldIgnore(java.lang.String pProvider, long pTime)
Whether we should ignore this location.

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

NetworkLocationIgnorer

public NetworkLocationIgnorer()

Method Detail

shouldIgnore

public boolean shouldIgnore(java.lang.String pProvider,
                   long pTime)
Whether we should ignore this location.
Parameters:
pProvider - the provider that provided the location
pTime - the time of the location
Returns:
true if we should ignore this location, false if not

NetworkUtils

java.lang.Object com.mapbox.mapboxsdk.util.NetworkUtils
public class NetworkUtils
extends java.lang.Object

Constructor Summary

Constructors 
Constructor and Description
NetworkUtils() 

Method Summary

Methods 
Modifier and Type Method and Description
static Cache getCache(java.io.File cacheDir, int maxSize) 
static java.net.HttpURLConnection getHttpURLConnection(java.net.URL url) 
static java.net.HttpURLConnection getHttpURLConnection(java.net.URL url, Cache cache) 
static java.net.HttpURLConnection getHttpURLConnection(java.net.URL url, Cache cache, javax.net.ssl.SSLSocketFactory sslSocketFactory) 
static boolean isNetworkAvailable(android.content.Context context) 

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

NetworkUtils

public NetworkUtils()

Method Detail

isNetworkAvailable

public static boolean isNetworkAvailable(android.content.Context context)

getHttpURLConnection

public static java.net.HttpURLConnection getHttpURLConnection(java.net.URL url)

getHttpURLConnection

public static java.net.HttpURLConnection getHttpURLConnection(java.net.URL url,
                                              Cache cache)

getHttpURLConnection

public static java.net.HttpURLConnection getHttpURLConnection(java.net.URL url,
                                              Cache cache,
                                              javax.net.ssl.SSLSocketFactory sslSocketFactory)

getCache

public static Cache getCache(java.io.File cacheDir,
             int maxSize)
                      throws java.io.IOException
Throws:
java.io.IOException

TileLooper

java.lang.Object com.mapbox.mapboxsdk.util.TileLooper
public abstract class TileLooper
extends java.lang.Object
A class that will loop around all the map tiles in the given viewport.

Field Summary

Fields 
Modifier and Type Field and Description
protected android.graphics.Point center 
protected java.util.List<CacheableBitmapDrawable> mBeingUsedDrawables 
protected android.graphics.Point mLowerRight 
protected android.graphics.Point mUpperLeft 

Constructor Summary

Constructors 
Constructor and Description
TileLooper() 

Method Summary

Methods 
Modifier and Type Method and Description
void finalizeLoop() 
abstract void handleTile(android.graphics.Canvas pCanvas, java.lang.String pCacheKey, int pTileSizePx, MapTile pTile, int pX, int pY, android.graphics.Rect pClipRect) 
abstract void initializeLoop(float pZoomLevel, int pTileSizePx) 
int loop(android.graphics.Canvas pCanvas, java.lang.String pCacheKey, float pZoomLevel, int pTileSizePx, android.graphics.Rect pViewPort, android.graphics.Rect pClipRect) 

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

mUpperLeft

protected final android.graphics.Point mUpperLeft

mLowerRight

protected final android.graphics.Point mLowerRight

center

protected final android.graphics.Point center

mBeingUsedDrawables

protected java.util.List<CacheableBitmapDrawable> mBeingUsedDrawables

Constructor Detail

TileLooper

public TileLooper()

Method Detail

loop

public final int loop(android.graphics.Canvas pCanvas,
       java.lang.String pCacheKey,
       float pZoomLevel,
       int pTileSizePx,
       android.graphics.Rect pViewPort,
       android.graphics.Rect pClipRect)

initializeLoop

public abstract void initializeLoop(float pZoomLevel,
                  int pTileSizePx)

handleTile

public abstract void handleTile(android.graphics.Canvas pCanvas,
              java.lang.String pCacheKey,
              int pTileSizePx,
              MapTile pTile,
              int pX,
              int pY,
              android.graphics.Rect pClipRect)

finalizeLoop

public void finalizeLoop()

InfoWindow

java.lang.Object com.mapbox.mapboxsdk.views.InfoWindow
public class InfoWindow
extends java.lang.Object
A tooltip view

Field Summary

Fields 
Modifier and Type Field and Description
protected android.view.View mView 

Constructor Summary

Constructors 
Constructor and Description
InfoWindow(int layoutResId, MapView mapView) 
InfoWindow(android.view.View view, MapView mapView) 

Method Summary

Methods 
Modifier and Type Method and Description
InfoWindow close()
Close this InfoWindow if it is visible, otherwise don't do anything.
Marker getBoundMarker() 
MapView getMapView()
Returns the mapView this InfoWindow is bound to
android.view.View getView()
Returns the Android view.
void onClose() 
void Marker overlayItem)
Constructs the view that is displayed when the InfoWindow opens.
InfoWindow Marker object, LatLng position, int offsetX, int offsetY)
open the window at the specified position.
InfoWindow Marker aBoundMarker) 
void setOnTouchListener(android.view.View.OnTouchListener listener)
Use to override default touch events handling on InfoWindow (ie, close automatically)

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

mView

protected android.view.View mView

Constructor Detail

InfoWindow

public InfoWindow(int layoutResId,
          MapView mapView)

InfoWindow

public InfoWindow(android.view.View view,
          MapView mapView)

Method Detail

open

public Marker object,
              LatLng position,
              int offsetX,
              int offsetY)
open the window at the specified position.
Parameters:
object - the graphical object on which is hooked the view
position - to place the window on the map
offsetX - (&offsetY) the offset of the view to the position, in pixels. This allows to offset the view from the object position.
Returns:
this infowindow

close

public InfoWindow close()
Close this InfoWindow if it is visible, otherwise don't do anything.
Returns:
this info window

getView

public android.view.View getView()
Returns the Android view. This allows to set its content.
Returns:
the Android view

getMapView

public MapView getMapView()
Returns the mapView this InfoWindow is bound to
Returns:
the mapView

onOpen

public void onOpen(Marker overlayItem)
Constructs the view that is displayed when the InfoWindow opens. This retrieves data from overlayItem and shows it in the tooltip.
Parameters:
overlayItem - the tapped overlay item

onClose

public void onClose()

setBoundMarker

public Marker aBoundMarker)

getBoundMarker

public Marker getBoundMarker()

setOnTouchListener

public void setOnTouchListener(android.view.View.OnTouchListener listener)
Use to override default touch events handling on InfoWindow (ie, close automatically)
Parameters:
listener - New View.OnTouchListener to use

MapController

java.lang.Object com.mapbox.mapboxsdk.views.MapController
All Implemented Interfaces:
MapViewConstants
public class MapController
extends java.lang.Object
implements MapViewConstants

Nested Class Summary

Nested Classes 
Modifier and Type Class and Description
class  MapController.PointEvaluator 

Field Summary

Fields 
Modifier and Type Field and Description
protected MapView mMapView 

Fields inherited from interface com.mapbox.mapboxsdk.views.util.constants.MapViewConstants

DEFAULT_PIN_ANCHOR

Constructor Summary

Constructors 
Constructor and Description
MapView mapView)
Constructor

Method Summary

Methods 
Modifier and Type Method and Description
protected void aboutToStartAnimation(float screenX, float screenY) 
protected void ILatLng latlong) 
protected void ILatLng latlong, android.graphics.PointF mapCoords) 
protected void aboutToStartAnimation(android.graphics.PointF mapCoords) 
boolean ILatLng point) 
boolean ILatLng point, boolean userAction)
Start animating the map towards the given point.
boolean currentlyInUserAction() 
boolean ILatLng point, android.graphics.PointF delta)
Go to a given point (not animated)
void mapViewLayedOut()
Called when the mapView is layed out for the first time if action were triggered before we had to wait because we didn't have any projection
void offsetDeltaScroll(float x, float y) 
void onAnimationEnd() 
protected void onAnimationStart() 
void panBy(float x, float y, boolean userAction) 
void panBy(int x, int y) 
void ILatLng latlng)
Set the map view to the given center.
void ILatLng latlng, android.graphics.PointF decale) 
void setCurrentlyInUserAction(boolean value) 
MapView setZoom(float zoomlevel) 
MapView setZoom(float zoomlevel, boolean userAction) 
MapView setZoom(float zoomlevel, ILatLng latlong, boolean userAction) 
MapView setZoomAnimated(float zoomlevel) 
MapView setZoomAnimated(float zoomlevel, ILatLng latlong, boolean userAction) 
boolean setZoomAnimated(float zoomlevel, ILatLng latlong, boolean move, boolean userAction) 
boolean setZoomAnimated(float zoomlevel, ILatLng latlong, boolean move, boolean userAction, Animator.AnimatorListener listener) 
void stopAnimation(boolean jumpToTarget)
Stops a running animation.
void stopPanning() 
boolean zoomIn() 
boolean zoomIn(boolean userAction)
Zoom in by one zoom level.
boolean ILatLng latlong) 
boolean ILatLng latlong, boolean userAction) 
boolean zoomOut() 
boolean zoomOut(boolean userAction)
Zoom out by one zoom level.
boolean ILatLng latlong) 
boolean ILatLng latlong, boolean userAction) 

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

mMapView

protected final MapView mMapView

Constructor Detail

MapController

public MapController(MapView mapView)
Constructor
Parameters:
mapView - MapView to be controlled

Method Detail

currentlyInUserAction

public boolean currentlyInUserAction()

setCurrentlyInUserAction

public void setCurrentlyInUserAction(boolean value)

aboutToStartAnimation

protected void aboutToStartAnimation(ILatLng latlong,
                         android.graphics.PointF mapCoords)

aboutToStartAnimation

protected void aboutToStartAnimation(ILatLng latlong)

aboutToStartAnimation

protected void aboutToStartAnimation(android.graphics.PointF mapCoords)

aboutToStartAnimation

protected void aboutToStartAnimation(float screenX,
                         float screenY)

animateTo

public boolean animateTo(ILatLng point,
                boolean userAction)
Start animating the map towards the given point.

animateTo

public boolean animateTo(ILatLng point)

goTo

public boolean goTo(ILatLng point,
           android.graphics.PointF delta)
Go to a given point (not animated)

panBy

public void panBy(float x,
         float y,
         boolean userAction)

offsetDeltaScroll

public void offsetDeltaScroll(float x,
                     float y)

panBy

public void panBy(int x,
         int y)

setCenter

public void setCenter(ILatLng latlng)
Set the map view to the given center. There will be no animation.

setCenter

public void setCenter(ILatLng latlng,
             android.graphics.PointF decale)

stopPanning

public void stopPanning()

stopAnimation

public void stopAnimation(boolean jumpToTarget)
Stops a running animation.

setZoomAnimated

public boolean setZoomAnimated(float zoomlevel,
                      ILatLng latlong,
                      boolean move,
                      boolean userAction)

setZoomAnimated

public boolean setZoomAnimated(float zoomlevel,
                      ILatLng latlong,
                      boolean move,
                      boolean userAction,
                      Animator.AnimatorListener listener)

setZoom

public MapView setZoom(float zoomlevel)

setZoom

public MapView setZoom(float zoomlevel,
              ILatLng latlong,
              boolean userAction)

setZoom

public MapView setZoom(float zoomlevel,
              boolean userAction)

setZoomAnimated

public MapView setZoomAnimated(float zoomlevel)

setZoomAnimated

public MapView setZoomAnimated(float zoomlevel,
                      ILatLng latlong,
                      boolean userAction)

zoomIn

public boolean zoomIn(boolean userAction)
Zoom in by one zoom level.

zoomIn

public boolean zoomIn()

zoomInAbout

public boolean zoomInAbout(ILatLng latlong,
                  boolean userAction)

zoomInAbout

public boolean zoomInAbout(ILatLng latlong)

zoomOut

public boolean zoomOut(boolean userAction)
Zoom out by one zoom level.

zoomOut

public boolean zoomOut()

zoomOutAbout

public boolean zoomOutAbout(ILatLng latlong,
                   boolean userAction)

zoomOutAbout

public boolean zoomOutAbout(ILatLng latlong)

onAnimationStart

protected void onAnimationStart()

onAnimationEnd

public void onAnimationEnd()

mapViewLayedOut

public void mapViewLayedOut()
Called when the mapView is layed out for the first time if action were triggered before we had to wait because we didn't have any projection

MapController.PointEvaluator

java.lang.Object com.mapbox.mapboxsdk.views.MapController.PointEvaluator
Enclosing class:
MapController
public class MapController.PointEvaluator
extends java.lang.Object

Constructor Summary

Constructors 
Constructor and Description
MapController.PointEvaluator() 

Method Summary

Methods 
Modifier and Type Method and Description
android.graphics.PointF evaluate(float fraction, android.graphics.PointF startValue, android.graphics.PointF endValue) 

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

MapController.PointEvaluator

public MapController.PointEvaluator()

Method Detail

evaluate

public android.graphics.PointF evaluate(float fraction,
                               android.graphics.PointF startValue,
                               android.graphics.PointF endValue)

MapView

java.lang.Object android.view.View android.view.ViewGroup com.mapbox.mapboxsdk.views.MapView
All Implemented Interfaces:
android.graphics.drawable.Drawable.Callback, android.view.accessibility.AccessibilityEventSource, android.view.KeyEvent.Callback, android.view.ViewManager, android.view.ViewParent, MapViewConstants
public class MapView
extends android.view.ViewGroup
implements MapboxConstants
The MapView class manages all of the content and state of a single map, including layers, markers, and interaction code.

Nested Class Summary

Nested Classes 
Modifier and Type Class and Description
static class  MapView.LayoutParams
Per-child layout information associated with OpenStreetMapView.

Nested classes/interfaces inherited from class android.view.ViewGroup

android.view.ViewGroup.MarginLayoutParams, android.view.ViewGroup.OnHierarchyChangeListener

Nested classes/interfaces inherited from class android.view.View

android.view.View.AccessibilityDelegate, android.view.View.BaseSavedState, android.view.View.DragShadowBuilder, android.view.View.MeasureSpec, android.view.View.OnApplyWindowInsetsListener, android.view.View.OnAttachStateChangeListener, android.view.View.OnClickListener, android.view.View.OnCreateContextMenuListener, android.view.View.OnDragListener, android.view.View.OnFocusChangeListener, android.view.View.OnGenericMotionListener, android.view.View.OnHoverListener, android.view.View.OnKeyListener, android.view.View.OnLayoutChangeListener, android.view.View.OnLongClickListener, android.view.View.OnSystemUiVisibilityChangeListener, android.view.View.OnTouchListener

Nested classes/interfaces inherited from interface com.mapbox.mapboxsdk.constants.MapboxConstants

MapboxConstants.RasterImageQuality

Field Summary

Fields 
Modifier and Type Field and Description
protected android.graphics.Matrix mInvTransformMatrix 
protected boolean mIsFlinging 
protected java.util.List<MapListener> mListeners 
protected boolean mMapRotationEnabled 
protected float mMultiTouchScale 
protected android.graphics.PointF mMultiTouchScalePoint 
protected OnMapOrientationChangeListener mOnMapOrientationChangeListener 
protected float mRequestedMinimumZoomLevel 
protected RotateGestureDetector mRotateGestureDetector 
protected android.view.ScaleGestureDetector mScaleGestureDetector 
protected BoundingBox mScrollableAreaBoundingBox 
protected android.graphics.RectF mScrollableAreaLimit 
protected android.widget.Scroller mScroller
Handles map scrolling
protected android.graphics.RectF mTempRect 
protected MapTileLayerBase mTileProvider 

Fields inherited from class android.view.ViewGroup

CLIP_TO_PADDING_MASK, FOCUS_AFTER_DESCENDANTS, FOCUS_BEFORE_DESCENDANTS, FOCUS_BLOCK_DESCENDANTS, LAYOUT_MODE_CLIP_BOUNDS, LAYOUT_MODE_OPTICAL_BOUNDS, PERSISTENT_ALL_CACHES, PERSISTENT_ANIMATION_CACHE, PERSISTENT_NO_CACHE, PERSISTENT_SCROLLING_CACHE

Fields inherited from class android.view.View

ACCESSIBILITY_LIVE_REGION_ASSERTIVE, ACCESSIBILITY_LIVE_REGION_NONE, ACCESSIBILITY_LIVE_REGION_POLITE, ALPHA, DRAWING_CACHE_QUALITY_AUTO, DRAWING_CACHE_QUALITY_HIGH, DRAWING_CACHE_QUALITY_LOW, EMPTY_STATE_SET, ENABLED_FOCUSED_SELECTED_STATE_SET, ENABLED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, ENABLED_FOCUSED_STATE_SET, ENABLED_FOCUSED_WINDOW_FOCUSED_STATE_SET, ENABLED_SELECTED_STATE_SET, ENABLED_SELECTED_WINDOW_FOCUSED_STATE_SET, ENABLED_STATE_SET, ENABLED_WINDOW_FOCUSED_STATE_SET, FIND_VIEWS_WITH_CONTENT_DESCRIPTION, FIND_VIEWS_WITH_TEXT, FOCUS_BACKWARD, FOCUS_DOWN, FOCUS_FORWARD, FOCUS_LEFT, FOCUS_RIGHT, FOCUS_UP, FOCUSABLES_ALL, FOCUSABLES_TOUCH_MODE, FOCUSED_SELECTED_STATE_SET, FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, FOCUSED_STATE_SET, FOCUSED_WINDOW_FOCUSED_STATE_SET, GONE, HAPTIC_FEEDBACK_ENABLED, IMPORTANT_FOR_ACCESSIBILITY_AUTO, IMPORTANT_FOR_ACCESSIBILITY_NO, IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS, IMPORTANT_FOR_ACCESSIBILITY_YES, INVISIBLE, KEEP_SCREEN_ON, LAYER_TYPE_HARDWARE, LAYER_TYPE_NONE, LAYER_TYPE_SOFTWARE, LAYOUT_DIRECTION_INHERIT, LAYOUT_DIRECTION_LOCALE, LAYOUT_DIRECTION_LTR, LAYOUT_DIRECTION_RTL, MEASURED_HEIGHT_STATE_SHIFT, MEASURED_SIZE_MASK, MEASURED_STATE_MASK, MEASURED_STATE_TOO_SMALL, NO_ID, OVER_SCROLL_ALWAYS, OVER_SCROLL_IF_CONTENT_SCROLLS, OVER_SCROLL_NEVER, PRESSED_ENABLED_FOCUSED_SELECTED_STATE_SET, PRESSED_ENABLED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_ENABLED_FOCUSED_STATE_SET, PRESSED_ENABLED_FOCUSED_WINDOW_FOCUSED_STATE_SET, PRESSED_ENABLED_SELECTED_STATE_SET, PRESSED_ENABLED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_ENABLED_STATE_SET, PRESSED_ENABLED_WINDOW_FOCUSED_STATE_SET, PRESSED_FOCUSED_SELECTED_STATE_SET, PRESSED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_FOCUSED_STATE_SET, PRESSED_FOCUSED_WINDOW_FOCUSED_STATE_SET, PRESSED_SELECTED_STATE_SET, PRESSED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_STATE_SET, PRESSED_WINDOW_FOCUSED_STATE_SET, ROTATION, ROTATION_X, ROTATION_Y, SCALE_X, SCALE_Y, SCREEN_STATE_OFF, SCREEN_STATE_ON, SCROLL_AXIS_HORIZONTAL, SCROLL_AXIS_NONE, SCROLL_AXIS_VERTICAL, SCROLLBAR_POSITION_DEFAULT, SCROLLBAR_POSITION_LEFT, SCROLLBAR_POSITION_RIGHT, SCROLLBARS_INSIDE_INSET, SCROLLBARS_INSIDE_OVERLAY, SCROLLBARS_OUTSIDE_INSET, SCROLLBARS_OUTSIDE_OVERLAY, SELECTED_STATE_SET, SELECTED_WINDOW_FOCUSED_STATE_SET, SOUND_EFFECTS_ENABLED, STATUS_BAR_HIDDEN, STATUS_BAR_VISIBLE, SYSTEM_UI_FLAG_FULLSCREEN, SYSTEM_UI_FLAG_HIDE_NAVIGATION, SYSTEM_UI_FLAG_IMMERSIVE, SYSTEM_UI_FLAG_IMMERSIVE_STICKY, SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN, SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION, SYSTEM_UI_FLAG_LAYOUT_STABLE, SYSTEM_UI_FLAG_LOW_PROFILE, SYSTEM_UI_FLAG_VISIBLE, SYSTEM_UI_LAYOUT_FLAGS, TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_GRAVITY, TEXT_ALIGNMENT_INHERIT, TEXT_ALIGNMENT_TEXT_END, TEXT_ALIGNMENT_TEXT_START, TEXT_ALIGNMENT_VIEW_END, TEXT_ALIGNMENT_VIEW_START, TEXT_DIRECTION_ANY_RTL, TEXT_DIRECTION_FIRST_STRONG, TEXT_DIRECTION_INHERIT, TEXT_DIRECTION_LOCALE, TEXT_DIRECTION_LTR, TEXT_DIRECTION_RTL, TRANSLATION_X, TRANSLATION_Y, TRANSLATION_Z, VIEW_LOG_TAG, VISIBLE, WINDOW_FOCUSED_STATE_SET, X, Y, Z

Fields inherited from interface com.mapbox.mapboxsdk.views.util.constants.MapViewConstants

DEFAULT_PIN_ANCHOR

Fields inherited from interface com.mapbox.mapboxsdk.constants.MapboxConstants

USER_AGENT

Constructor Summary

Constructors 
Modifier Constructor and Description
  MapView(android.content.Context aContext) 
  MapView(android.content.Context aContext, android.util.AttributeSet attrs) 
protected MapView(android.content.Context aContext, int tileSizePixels, MapTileLayerBase aTileProvider) 
protected MapView(android.content.Context aContext, int tileSizePixels, MapTileLayerBase tileProvider, android.os.Handler tileRequestCompleteHandler, android.util.AttributeSet attrs)
Constructor for XML layout calls.

Method Summary

Methods 
Modifier and Type Method and Description
void ItemizedOverlay itemizedOverlay)
Adds a new ItemizedOverlay to the MapView
void MapListener listener)
Add a new MapListener that observes changes in this map.
Marker Marker marker)
Adds a marker to the default marker overlay.
void Overlay overlay)
Add an overlay to this map.
void ITileLayer aTileSource) 
void ITileLayer aTileSource, int index) 
boolean canGoTo(float x, float y)
Returns if the map can go to a specified point (in map coordinates)
boolean ILatLng point)
Returns if the map can go to a specified geo point
protected boolean canZoomIn()
Determine whether the map is at its maximum zoom
protected boolean canZoomOut()
Determine whether the map is at its minimum zoom
protected boolean checkLayoutParams(android.view.ViewGroup.LayoutParams p) 
void clear()
Remove all markers from the map's display.
protected void clearAnimatedZoom(float value) 
void closeCurrentTooltip()
Close the currently-displayed tooltip, if any.
void computeScroll() 
protected android.view.ViewGroup.LayoutParams generateDefaultLayoutParams()
Returns a set of layout parameters with a width of ViewGroup.LayoutParams.WRAP_CONTENT, a height of ViewGroup.LayoutParams.WRAP_CONTENT at the LatLng (0, 0) align with MapViewLayouts.BOTTOM_CENTER.
android.view.ViewGroup.LayoutParams generateLayoutParams(android.util.AttributeSet attrs) 
protected android.view.ViewGroup.LayoutParams generateLayoutParams(android.view.ViewGroup.LayoutParams p) 
protected float getAnimatedZoom() 
BoundingBox getBoundingBox()
Returns the current bounding box of the map.
BoundingBox getBoundingBoxInternal() 
LatLng getCenter()
Get centerpoint of the phone as latitude and longitude.
float getClampedZoomLevel(float zoom) 
MapController getController()
Returns the map's controller
InfoWindow getCurrentTooltip()
Get the current tooltip of this map if there is one being displayed.
android.graphics.Rect getIntrinsicScreenRect(android.graphics.Rect reuse) 
android.graphics.Matrix getInversedTransformMatrix() 
java.util.ArrayList<ItemizedIconOverlay> getItemizedOverlays()
Get all itemized overlays on the map as an ArrayList.
float getMapOrientation()
Gets the current angle of rotation of the map
TilesOverlay getMapOverlay()
Returns the map's overlay
float getMaxZoomLevel()
Get the maximum allowed zoom level for the maps.
float getMinZoomLevel()
Get the minimum allowed zoom level for the maps.
OnMapOrientationChangeListener getOnMapOrientationChangeListener()
Gets the mapView onMapOrientationChangeListener
OverlayManager getOverlayManager() 
java.util.List<Overlay> getOverlays()
You can add/remove/reorder your Overlays using the List of Overlay.
Projection getProjection()
Get a projection for converting between screen-pixel coordinates and latitude/longitude coordinates.
float getScale() 
android.graphics.PointF getScalePoint() 
BoundingBox getScrollableAreaBoundingBox()
Returns the map current scrollable bounding box
android.graphics.RectF getScrollableAreaLimit()
Returns the map current scrollable bounding limit int map PX
android.widget.Scroller getScroller()
Returns the map's scroller
android.graphics.PointF getScrollPoint() 
TileLoadedListener getTileLoadedListener() 
MapTileLayerBase getTileProvider() 
android.os.Handler getTileRequestCompleteHandler() 
TilesLoadedListener getTilesLoadedListener() 
LatLng getUserLocation()
Get the user location overlay if created
boolean getUserLocationEnabled()
Show or hide the user location overlay
UserLocationOverlay getUserLocationOverlay()
Get the user location overlay if created
UserLocationOverlay.TrackingMode getUserLocationTrackingMode()
get the user location tracking mode
float getZoomLevel()
Get the current ZoomLevel for the map tiles.
float getZoomLevel(boolean aPending)
Get the current ZoomLevel for the map tiles.
void goToUserLocation(boolean animated)
Go to user location
void invalidateMapCoordinates(android.graphics.Rect dirty) 
void invalidateMapCoordinates(android.graphics.RectF dirty) 
protected boolean isAnimatedZoomSet() 
boolean isAnimating()
Determines if maps are animating a zoom operation.
boolean isLayedOut()
Returns true if the view has been layed out
boolean isMapRotationEnabled()
Gets whether the current map rotation feature is enabled or not default: disabled
boolean isUserLocationVisible() 
boolean isUsingSafeCanvas()
Returns true if the safe drawing canvas is being used.
void loadFromGeoJSONURL(java.lang.String URL)
Load and parse a GeoJSON file at a given URL
boolean ILatLng p) 
void onDetach() 
protected void onDetachedFromWindow() 
protected void onDraw(android.graphics.Canvas c) 
boolean onKeyDown(int keyCode, android.view.KeyEvent event) 
boolean onKeyUp(int keyCode, android.view.KeyEvent event) 
protected void onLayout(boolean changed, int l, int t, int r, int b) 
void ILatLng p) 
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) 
protected void onSizeChanged(int w, int h, int oldw, int oldh) 
void ILatLng p) 
boolean onTouchEvent(android.view.MotionEvent event) 
boolean onTrackballEvent(android.view.MotionEvent event) 
MapView panBy(int x, int y)
Pan the map by a given number of pixels in the x and y dimensions.
FeatureCollection parseFromGeoJSONURL(java.lang.String url)
Parse a GeoJSON file at a given URL
void MapListener listener)
Remove a listener object that observed changes in this map.
void Marker marker)
Remove a marker from the map's display.
void Overlay overlay)
Remove an overlay from displaying in this map and invalidates the map to trigger a redraw.
void removeTileSource(int index) 
void ITileLayer aTileSource) 
void scrollBy(double x, double y) 
void scrollTo(double x, double y) 
void scrollTo(int x, int y) 
void Marker marker)
Select a marker, showing a tooltip if the marker has content that would appear within it.
void setAccessToken(java.lang.String accessToken)
Set Mapbox Access Token for this MapView.
protected void setAnimatedZoom(float value) 
void setBackgroundColor(int pColor) 
MapView ILatLng aCenter)
Set the centerpoint of the map view, given a latitude and longitude position.
MapView ILatLng aCenter, boolean userAction) 
MapView setConstraintRegionFit(boolean value)
Sets whether the scrollable area limit should take the view ratio into account (keeping the same ratio as the screen) If yes you will be able to zoom out to see the whole area whatever the screen ratio.
static void setDebugMode(boolean value) 
void setDiskCacheEnabled(boolean enabled)
Enable or disable the diskCache
protected void setIsAnimating(boolean value) 
void setMapOrientation(float degrees)
Set the rotation of the map, in degrees.
void setMapRotationEnabled(boolean enable)
Sets whether to enable or disable the map rotation features default: disabled
void MapViewListener listener) 
void setMaxZoomLevel(float zoomLevel)
Set the maximum allowed zoom level, or pass null to use the maximum zoom level from the tile provider.
void setMinZoomLevel(float zoomLevel)
Set the minimum allowed zoom level, or pass null to use the minimum zoom level from the tile provider.
void OnMapOrientationChangeListener l)
Gets the mapView onMapOrientationChangeListener
void TileLoadedListener aTileLoadedListener) 
void TilesLoadedListener aTilesLoadedListener) 
MapView setScale(float scale) 
void setScalePoint(android.graphics.PointF point) 
void BoundingBox boundingBox)
Set the map to limit it's scrollable view to the specified BoundingBox.
void setScrollPoint(android.graphics.PointF point) 
void ITileLayer aTileSource)
Set the tile source of this map as a single source, and trigger an update.
void ITileLayer[] value)
Set the tile source of this map as an array of tile layers, which will be presented on top of each other.
void setUseDataConnection(boolean aMode)
Set whether to use the network connection if it's available.
MapView setUserLocationEnabled(boolean value)
Show or hide the user location overlay
MapView setUserLocationRequiredZoom(float zoomLevel)
Set the user location tracking zoom level
MapView UserLocationOverlay.TrackingMode mode)
Set the user location tracking mode
void setUseSafeCanvas(boolean useSafeCanvas)
Sets whether the safe drawing canvas is being used.
MapView setZoom(float aZoomLevel) 
protected MapView setZoomInternal(float aZoomLevel) 
protected MapView setZoomInternal(float aZoomLevel, ILatLng center, android.graphics.PointF decale) 
boolean ILatLng p) 
java.lang.String toString() 
void updateScrollableAreaLimit()
Everytime we update the zoom or the view size we must re compute the real scrollable area limit in pixels
void updateScrollDuringAnimation() 
boolean useDataConnection()
Whether to use the network connection if it's available.
boolean zoomIn()
Zoom in by one zoom level.
boolean ILatLng point) 
boolean ILatLng point, boolean userAction) 
boolean zoomOut()
Zoom out by one zoom level.
boolean ILatLng point) 
boolean ILatLng point, boolean userAction) 
MapView BoundingBox boundingBox)
Zoom the map to enclose the specified bounding box, as closely as possible.
MapView BoundingBox boundingBox, boolean regionFit)
Zoom the map to enclose the specified bounding box, as closely as possible.
MapView BoundingBox boundingBox, boolean regionFit, boolean animated)
Zoom the map to enclose the specified bounding box, as closely as possible.
MapView BoundingBox boundingBox, boolean regionFit, boolean animated, boolean roundedZoom)
Zoom the map to enclose the specified bounding box, as closely as possible.
MapView BoundingBox boundingBox, boolean regionFit, boolean animated, boolean roundedZoom, boolean userAction)
Zoom the map to enclose the specified bounding box, as closely as possible.

Methods inherited from class android.view.ViewGroup

addChildrenForAccessibility, addFocusables, addStatesFromChildren, addTouchables, addView, addView, addView, addView, addView, addViewInLayout, addViewInLayout, attachLayoutAnimationParameters, attachViewToParent, bringChildToFront, canAnimate, childDrawableStateChanged, childHasTransientStateChanged, cleanupLayoutState, clearChildFocus, clearDisappearingChildren, clearFocus, debug, detachAllViewsFromParent, detachViewFromParent, detachViewFromParent, detachViewsFromParent, dispatchApplyWindowInsets, dispatchConfigurationChanged, dispatchDisplayHint, dispatchDragEvent, dispatchDraw, dispatchFreezeSelfOnly, dispatchGenericFocusedEvent, dispatchGenericPointerEvent, dispatchHoverEvent, dispatchKeyEvent, dispatchKeyEventPreIme, dispatchKeyShortcutEvent, dispatchRestoreInstanceState, dispatchSaveInstanceState, dispatchSetActivated, dispatchSetPressed, dispatchSetSelected, dispatchSystemUiVisibilityChanged, dispatchThawSelfOnly, dispatchTouchEvent, dispatchTrackballEvent, dispatchUnhandledMove, dispatchVisibilityChanged, dispatchWindowFocusChanged, dispatchWindowSystemUiVisiblityChanged, dispatchWindowVisibilityChanged, drawableHotspotChanged, drawableStateChanged, drawChild, endViewTransition, findFocus, findViewsWithText, focusableViewAvailable, focusSearch, gatherTransparentRegion, getChildAt, getChildCount, getChildDrawingOrder, getChildMeasureSpec, getChildStaticTransformation, getChildVisibleRect, getClipChildren, getClipToPadding, getDescendantFocusability, getFocusedChild, getLayoutAnimation, getLayoutAnimationListener, getLayoutMode, getLayoutTransition, getNestedScrollAxes, getOverlay, getPersistentDrawingCache, getTouchscreenBlocksFocus, hasFocus, hasFocusable, hasTransientState, indexOfChild, invalidateChild, invalidateChildInParent, isAlwaysDrawnWithCacheEnabled, isAnimationCacheEnabled, isChildrenDrawingOrderEnabled, isChildrenDrawnWithCacheEnabled, isMotionEventSplittingEnabled, isTransitionGroup, jumpDrawablesToCurrentState, layout, measureChild, measureChildren, measureChildWithMargins, notifySubtreeAccessibilityStateChanged, offsetDescendantRectToMyCoords, offsetRectIntoDescendantCoords, onAnimationEnd, onAnimationStart, onAttachedToWindow, onCreateDrawableState, onInterceptHoverEvent, onInterceptTouchEvent, onNestedFling, onNestedPreFling, onNestedPreScroll, onNestedScroll, onNestedScrollAccepted, onRequestFocusInDescendants, onRequestSendAccessibilityEvent, onStartNestedScroll, onStopNestedScroll, recomputeViewAttributes, removeAllViews, removeAllViewsInLayout, removeDetachedView, removeView, removeViewAt, removeViewInLayout, removeViews, removeViewsInLayout, requestChildFocus, requestChildRectangleOnScreen, requestDisallowInterceptTouchEvent, requestFocus, requestSendAccessibilityEvent, requestTransparentRegion, scheduleLayoutAnimation, setAddStatesFromChildren, setAlwaysDrawnWithCacheEnabled, setAnimationCacheEnabled, setChildrenDrawingCacheEnabled, setChildrenDrawingOrderEnabled, setChildrenDrawnWithCacheEnabled, setClipChildren, setClipToPadding, setDescendantFocusability, setLayoutAnimation, setLayoutAnimationListener, setLayoutMode, setLayoutTransition, setMotionEventSplittingEnabled, setOnHierarchyChangeListener, setPersistentDrawingCache, setStaticTransformationsEnabled, setTouchscreenBlocksFocus, setTransitionGroup, shouldDelayChildPressedState, showContextMenuForChild, startActionModeForChild, startLayoutAnimation, startViewTransition, updateViewLayout

Methods inherited from class android.view.View

addFocusables, addOnAttachStateChangeListener, addOnLayoutChangeListener, animate, announceForAccessibility, awakenScrollBars, awakenScrollBars, awakenScrollBars, bringToFront, buildDrawingCache, buildDrawingCache, buildLayer, callOnClick, cancelLongPress, cancelPendingInputEvents, canResolveLayoutDirection, canResolveTextAlignment, canResolveTextDirection, canScrollHorizontally, canScrollVertically, checkInputConnectionProxy, clearAnimation, combineMeasuredStates, computeHorizontalScrollExtent, computeHorizontalScrollOffset, computeHorizontalScrollRange, computeSystemWindowInsets, computeVerticalScrollExtent, computeVerticalScrollOffset, computeVerticalScrollRange, createAccessibilityNodeInfo, createContextMenu, destroyDrawingCache, dispatchGenericMotionEvent, dispatchNestedFling, dispatchNestedPreFling, dispatchNestedPreScroll, dispatchNestedScroll, dispatchPopulateAccessibilityEvent, draw, findViewById, findViewWithTag, fitSystemWindows, focusSearch, forceLayout, generateViewId, getAccessibilityLiveRegion, getAccessibilityNodeProvider, getAlpha, getAnimation, getApplicationWindowToken, getBackground, getBackgroundTintList, getBackgroundTintMode, getBaseline, getBottom, getBottomFadingEdgeStrength, getBottomPaddingOffset, getCameraDistance, getClipBounds, getClipToOutline, getContentDescription, getContext, getContextMenuInfo, getDefaultSize, getDisplay, getDrawableState, getDrawingCache, getDrawingCache, getDrawingCacheBackgroundColor, getDrawingCacheQuality, getDrawingRect, getDrawingTime, getElevation, getFilterTouchesWhenObscured, getFitsSystemWindows, getFocusables, getFocusedRect, getGlobalVisibleRect, getGlobalVisibleRect, getHandler, getHeight, getHitRect, getHorizontalFadingEdgeLength, getHorizontalScrollbarHeight, getId, getImportantForAccessibility, getKeepScreenOn, getKeyDispatcherState, getLabelFor, getLayerType, getLayoutDirection, getLayoutParams, getLeft, getLeftFadingEdgeStrength, getLeftPaddingOffset, getLocalVisibleRect, getLocationInWindow, getLocationOnScreen, getMatrix, getMeasuredHeight, getMeasuredHeightAndState, getMeasuredState, getMeasuredWidth, getMeasuredWidthAndState, getMinimumHeight, getMinimumWidth, getNextFocusDownId, getNextFocusForwardId, getNextFocusLeftId, getNextFocusRightId, getNextFocusUpId, getOnFocusChangeListener, getOutlineProvider, getOverScrollMode, getPaddingBottom, getPaddingEnd, getPaddingLeft, getPaddingRight, getPaddingStart, getPaddingTop, getParent, getParentForAccessibility, getPivotX, getPivotY, getResources, getRight, getRightFadingEdgeStrength, getRightPaddingOffset, getRootView, getRotation, getRotationX, getRotationY, getScaleX, getScaleY, getScrollBarDefaultDelayBeforeFade, getScrollBarFadeDuration, getScrollBarSize, getScrollBarStyle, getScrollX, getScrollY, getSolidColor, getStateListAnimator, getSuggestedMinimumHeight, getSuggestedMinimumWidth, getSystemUiVisibility, getTag, getTag, getTextAlignment, getTextDirection, getTop, getTopFadingEdgeStrength, getTopPaddingOffset, getTouchables, getTouchDelegate, getTransitionName, getTranslationX, getTranslationY, getTranslationZ, getVerticalFadingEdgeLength, getVerticalScrollbarPosition, getVerticalScrollbarWidth, getViewTreeObserver, getVisibility, getWidth, getWindowAttachCount, getWindowId, getWindowSystemUiVisibility, getWindowToken, getWindowVisibility, getWindowVisibleDisplayFrame, getX, getY, getZ, hasNestedScrollingParent, hasOnClickListeners, hasOverlappingRendering, hasWindowFocus, inflate, invalidate, invalidate, invalidate, invalidateDrawable, invalidateOutline, isAccessibilityFocused, isActivated, isAttachedToWindow, isClickable, isDirty, isDrawingCacheEnabled, isDuplicateParentStateEnabled, isEnabled, isFocusable, isFocusableInTouchMode, isFocused, isHapticFeedbackEnabled, isHardwareAccelerated, isHorizontalFadingEdgeEnabled, isHorizontalScrollBarEnabled, isHovered, isImportantForAccessibility, isInEditMode, isInLayout, isInTouchMode, isLaidOut, isLayoutDirectionResolved, isLayoutRequested, isLongClickable, isNestedScrollingEnabled, isOpaque, isPaddingOffsetRequired, isPaddingRelative, isPressed, isSaveEnabled, isSaveFromParentEnabled, isScrollbarFadingEnabled, isScrollContainer, isSelected, isShown, isSoundEffectsEnabled, isTextAlignmentResolved, isTextDirectionResolved, isVerticalFadingEdgeEnabled, isVerticalScrollBarEnabled, measure, mergeDrawableStates, offsetLeftAndRight, offsetTopAndBottom, onApplyWindowInsets, onCancelPendingInputEvents, onCheckIsTextEditor, onConfigurationChanged, onCreateContextMenu, onCreateInputConnection, onDisplayHint, onDragEvent, onDrawScrollBars, onFilterTouchEventForSecurity, onFinishInflate, onFinishTemporaryDetach, onFocusChanged, onGenericMotionEvent, onHoverChanged, onHoverEvent, onInitializeAccessibilityEvent, onInitializeAccessibilityNodeInfo, onKeyLongPress, onKeyMultiple, onKeyPreIme, onKeyShortcut, onOverScrolled, onPopulateAccessibilityEvent, onRestoreInstanceState, onRtlPropertiesChanged, onSaveInstanceState, onScreenStateChanged, onScrollChanged, onSetAlpha, onStartTemporaryDetach, onVisibilityChanged, onWindowFocusChanged, onWindowSystemUiVisibilityChanged, onWindowVisibilityChanged, overScrollBy, performAccessibilityAction, performClick, performHapticFeedback, performHapticFeedback, performLongClick, playSoundEffect, post, postDelayed, postInvalidate, postInvalidate, postInvalidateDelayed, postInvalidateDelayed, postInvalidateOnAnimation, postInvalidateOnAnimation, postOnAnimation, postOnAnimationDelayed, refreshDrawableState, removeCallbacks, removeOnAttachStateChangeListener, removeOnLayoutChangeListener, requestApplyInsets, requestFitSystemWindows, requestFocus, requestFocus, requestFocusFromTouch, requestLayout, requestRectangleOnScreen, requestRectangleOnScreen, requestUnbufferedDispatch, resolveSize, resolveSizeAndState, restoreHierarchyState, saveHierarchyState, scheduleDrawable, scrollBy, sendAccessibilityEvent, sendAccessibilityEventUnchecked, setAccessibilityDelegate, setAccessibilityLiveRegion, setActivated, setAlpha, setAnimation, setBackground, setBackgroundDrawable, setBackgroundResource, setBackgroundTintList, setBackgroundTintMode, setBottom, setCameraDistance, setClickable, setClipBounds, setClipToOutline, setContentDescription, setDrawingCacheBackgroundColor, setDrawingCacheEnabled, setDrawingCacheQuality, setDuplicateParentStateEnabled, setElevation, setEnabled, setFadingEdgeLength, setFilterTouchesWhenObscured, setFitsSystemWindows, setFocusable, setFocusableInTouchMode, setHapticFeedbackEnabled, setHasTransientState, setHorizontalFadingEdgeEnabled, setHorizontalScrollBarEnabled, setHovered, setId, setImportantForAccessibility, setKeepScreenOn, setLabelFor, setLayerPaint, setLayerType, setLayoutDirection, setLayoutParams, setLeft, setLongClickable, setMeasuredDimension, setMinimumHeight, setMinimumWidth, setNestedScrollingEnabled, setNextFocusDownId, setNextFocusForwardId, setNextFocusLeftId, setNextFocusRightId, setNextFocusUpId, setOnApplyWindowInsetsListener, setOnClickListener, setOnCreateContextMenuListener, setOnDragListener, setOnFocusChangeListener, setOnGenericMotionListener, setOnHoverListener, setOnKeyListener, setOnLongClickListener, setOnSystemUiVisibilityChangeListener, setOnTouchListener, setOutlineProvider, setOverScrollMode, setPadding, setPaddingRelative, setPivotX, setPivotY, setPressed, setRight, setRotation, setRotationX, setRotationY, setSaveEnabled, setSaveFromParentEnabled, setScaleX, setScaleY, setScrollBarDefaultDelayBeforeFade, setScrollBarFadeDuration, setScrollbarFadingEnabled, setScrollBarSize, setScrollBarStyle, setScrollContainer, setScrollX, setScrollY, setSelected, setSoundEffectsEnabled, setStateListAnimator, setSystemUiVisibility, setTag, setTag, setTextAlignment, setTextDirection, setTop, setTouchDelegate, setTransitionName, setTranslationX, setTranslationY, setTranslationZ, setVerticalFadingEdgeEnabled, setVerticalScrollBarEnabled, setVerticalScrollbarPosition, setVisibility, setWillNotCacheDrawing, setWillNotDraw, setX, setY, setZ, showContextMenu, startActionMode, startAnimation, startDrag, startNestedScroll, stopNestedScroll, unscheduleDrawable, unscheduleDrawable, verifyDrawable, willNotCacheDrawing, willNotDraw

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Methods inherited from interface android.view.ViewParent

canResolveLayoutDirection, canResolveTextAlignment, canResolveTextDirection, createContextMenu, getLayoutDirection, getParent, getParentForAccessibility, getTextAlignment, getTextDirection, isLayoutDirectionResolved, isLayoutRequested, isTextAlignmentResolved, isTextDirectionResolved, requestFitSystemWindows, requestLayout

Field Detail

mRequestedMinimumZoomLevel

protected float mRequestedMinimumZoomLevel

mScroller

protected final android.widget.Scroller mScroller
Handles map scrolling

mIsFlinging

protected boolean mIsFlinging

mScaleGestureDetector

protected android.view.ScaleGestureDetector mScaleGestureDetector

mRotateGestureDetector

protected RotateGestureDetector mRotateGestureDetector

mMapRotationEnabled

protected boolean mMapRotationEnabled

mOnMapOrientationChangeListener

protected OnMapOrientationChangeListener mOnMapOrientationChangeListener

mMultiTouchScale

protected float mMultiTouchScale

mMultiTouchScalePoint

protected android.graphics.PointF mMultiTouchScalePoint

mInvTransformMatrix

protected android.graphics.Matrix mInvTransformMatrix

mListeners

protected java.util.List<MapListener> mListeners

mScrollableAreaBoundingBox

protected BoundingBox mScrollableAreaBoundingBox

mScrollableAreaLimit

protected android.graphics.RectF mScrollableAreaLimit

mTempRect

protected android.graphics.RectF mTempRect

mTileProvider

protected final MapTileLayerBase mTileProvider

Constructor Detail

MapView

protected MapView(android.content.Context aContext,
       int tileSizePixels,
       MapTileLayerBase tileProvider,
       android.os.Handler tileRequestCompleteHandler,
       android.util.AttributeSet attrs)
Constructor for XML layout calls. Should not be used programmatically.
Parameters:
aContext - A copy of the app context
attrs - An AttributeSet object to get extra info from the XML, such as mapbox id or type of baselayer

MapView

public MapView(android.content.Context aContext)

MapView

public MapView(android.content.Context aContext,
       android.util.AttributeSet attrs)

MapView

protected MapView(android.content.Context aContext,
       int tileSizePixels,
       MapTileLayerBase aTileProvider)

Method Detail

addListener

public void addListener(MapListener listener)
Add a new MapListener that observes changes in this map.
Parameters:
listener -

removeListener

public void removeListener(MapListener listener)
Remove a listener object that observed changes in this map.
Parameters:
listener -

addOverlay

public void addOverlay(Overlay overlay)
Add an overlay to this map. If the overlay is already included, does nothing. After adding the overlay, invalidates the map to redraw it.
Parameters:
overlay -

removeOverlay

public void removeOverlay(Overlay overlay)
Remove an overlay from displaying in this map and invalidates the map to trigger a redraw.
Parameters:
overlay -

setAccessToken

public void setAccessToken(java.lang.String accessToken)
Set Mapbox Access Token for this MapView.
Parameters:
accessToken - String
See Also:
https://www.mapbox.com/developers/api/#access-tokens

setTileSource

public void setTileSource(ITileLayer[] value)
Set the tile source of this map as an array of tile layers, which will be presented on top of each other.
Parameters:
value -

setTileSource

public void setTileSource(ITileLayer aTileSource)
Set the tile source of this map as a single source, and trigger an update.
Parameters:
aTileSource -

addTileSource

public void addTileSource(ITileLayer aTileSource)

addTileSource

public void addTileSource(ITileLayer aTileSource,
                 int index)

removeTileSource

public void removeTileSource(ITileLayer aTileSource)

removeTileSource

public void removeTileSource(int index)

addMarker

public Marker marker)
Adds a marker to the default marker overlay.
Parameters:
marker - the marker object to be added
Returns:
the marker object

removeMarker

public void removeMarker(Marker marker)
Remove a marker from the map's display.

clear

public void clear()
Remove all markers from the map's display.

selectMarker

public void selectMarker(Marker marker)
Select a marker, showing a tooltip if the marker has content that would appear within it.

addItemizedOverlay

public void addItemizedOverlay(ItemizedOverlay itemizedOverlay)
Adds a new ItemizedOverlay to the MapView
Parameters:
itemizedOverlay - the itemized overlay

getItemizedOverlays

public java.util.ArrayList<ItemizedIconOverlay> getItemizedOverlays()
Get all itemized overlays on the map as an ArrayList.
Returns:

loadFromGeoJSONURL

public void loadFromGeoJSONURL(java.lang.String URL)
Load and parse a GeoJSON file at a given URL
Parameters:
URL - the URL from which to load the GeoJSON file

parseFromGeoJSONURL

public FeatureCollection parseFromGeoJSONURL(java.lang.String url)
                                      throws java.io.IOException,
                                             org.json.JSONException
Parse a GeoJSON file at a given URL
Parameters:
url - The URL of GeoJSON string to parse
Returns:
FeatureCollection Parsed GeoJSON
Throws:
java.io.IOException
org.json.JSONException

closeCurrentTooltip

public void closeCurrentTooltip()
Close the currently-displayed tooltip, if any.

getCurrentTooltip

public InfoWindow getCurrentTooltip()
Get the current tooltip of this map if there is one being displayed.
Returns:

singleTapUpHelper

public boolean singleTapUpHelper(ILatLng p)
Specified by:
MapEventsReceiver
Parameters:
p - the position where the event occurred.
Returns:
whether the event action is triggered or not

longPressHelper

public boolean longPressHelper(ILatLng p)
Specified by:
MapEventsReceiver
Parameters:
p - the position where the event occurred.
Returns:
whether the event action is triggered or not

onLongPress

public void onLongPress(ILatLng p)

onTap

public void onTap(ILatLng p)

getController

public MapController getController()
Returns the map's controller

getMapOverlay

public TilesOverlay getMapOverlay()
Returns the map's overlay

getOverlays

public java.util.List<Overlay> getOverlays()
You can add/remove/reorder your Overlays using the List of Overlay. The first (index 0) Overlay gets drawn first, the one with the highest as the last one.

getOverlayManager

public OverlayManager getOverlayManager()

getTileProvider

public MapTileLayerBase getTileProvider()

getScroller

public android.widget.Scroller getScroller()
Returns the map's scroller

getTileRequestCompleteHandler

public android.os.Handler getTileRequestCompleteHandler()

getBoundingBoxInternal

public BoundingBox getBoundingBoxInternal()

getBoundingBox

public BoundingBox getBoundingBox()
Returns the current bounding box of the map.

getCenter

public LatLng getCenter()
Get centerpoint of the phone as latitude and longitude.
Returns:
centerpoint

getIntrinsicScreenRect

public android.graphics.Rect getIntrinsicScreenRect(android.graphics.Rect reuse)

getProjection

public Projection getProjection()
Get a projection for converting between screen-pixel coordinates and latitude/longitude coordinates. You should not hold on to this object for more than one draw, since the projection of the map could change.
Returns:
The Projection of the map in its current state. You should not hold on to this object for more than one draw, since the projection of the map could change.

setCenter

public ILatLng aCenter)
Set the centerpoint of the map view, given a latitude and longitude position.
Returns:
the map view, for chaining

setCenter

public ILatLng aCenter,
                boolean userAction)

panBy

public MapView panBy(int x,
            int y)
Pan the map by a given number of pixels in the x and y dimensions.

setScale

public MapView setScale(float scale)

getScale

public float getScale()

getInversedTransformMatrix

public final android.graphics.Matrix getInversedTransformMatrix()

setZoom

public MapView setZoom(float aZoomLevel)
Parameters:
aZoomLevel - the zoom level bound by the tile source
Returns:
the map view, for chaining

setZoomInternal

protected MapView setZoomInternal(float aZoomLevel)

setZoomInternal

protected MapView setZoomInternal(float aZoomLevel,
                      ILatLng center,
                      android.graphics.PointF decale)

zoomToBoundingBox

public BoundingBox boundingBox,
                        boolean regionFit,
                        boolean animated,
                        boolean roundedZoom,
                        boolean userAction)
Zoom the map to enclose the specified bounding box, as closely as possible.
Parameters:
boundingBox - the box to compute the zoom for
regionFit - if true computed zoom will make sure the whole box is visible
animated - if true the zoom will be animated
roundedZoom - if true the required zoom will be rounded (for better graphics)
userAction - set to true if it comes from a userAction
Returns:
the map view, for chaining

zoomToBoundingBox

public BoundingBox boundingBox,
                        boolean regionFit,
                        boolean animated,
                        boolean roundedZoom)
Zoom the map to enclose the specified bounding box, as closely as possible.
Parameters:
boundingBox - the box to compute the zoom for
regionFit - if true computed zoom will make sure the whole box is visible
animated - if true the zoom will be animated
roundedZoom - if true the required zoom will be rounded (for better graphics)
Returns:
the map view, for chaining

zoomToBoundingBox

public BoundingBox boundingBox,
                        boolean regionFit,
                        boolean animated)
Zoom the map to enclose the specified bounding box, as closely as possible.
Parameters:
boundingBox - the box to compute the zoom for
regionFit - if true computed zoom will make sure the whole box is visible
animated - if true the zoom will be animated
Returns:
the map view, for chaining

zoomToBoundingBox

public BoundingBox boundingBox,
                        boolean regionFit)
Zoom the map to enclose the specified bounding box, as closely as possible.
Parameters:
boundingBox - the box to compute the zoom for
regionFit - if true computed zoom will make sure the whole box is visible
Returns:
the map view, for chaining

zoomToBoundingBox

public BoundingBox boundingBox)
Zoom the map to enclose the specified bounding box, as closely as possible.
Parameters:
boundingBox - the box to compute the zoom for
Returns:
the map view, for chaining

getClampedZoomLevel

public float getClampedZoomLevel(float zoom)

getZoomLevel

public float getZoomLevel()
Get the current ZoomLevel for the map tiles.
Returns:
the current ZoomLevel between 0 (equator) and 18/19(closest), depending on the tile source chosen.

getAnimatedZoom

protected float getAnimatedZoom()

setAnimatedZoom

protected void setAnimatedZoom(float value)

clearAnimatedZoom

protected void clearAnimatedZoom(float value)

isAnimatedZoomSet

protected boolean isAnimatedZoomSet()

getZoomLevel

public float getZoomLevel(boolean aPending)
Get the current ZoomLevel for the map tiles.
Parameters:
aPending - if true and we're animating then return the zoom level that we're animating towards, otherwise return the current zoom level
Returns:
the zoom level

getMinZoomLevel

public float getMinZoomLevel()
Get the minimum allowed zoom level for the maps.

getMaxZoomLevel

public float getMaxZoomLevel()
Get the maximum allowed zoom level for the maps.

setMinZoomLevel

public void setMinZoomLevel(float zoomLevel)
Set the minimum allowed zoom level, or pass null to use the minimum zoom level from the tile provider.

setMaxZoomLevel

public void setMaxZoomLevel(float zoomLevel)
Set the maximum allowed zoom level, or pass null to use the maximum zoom level from the tile provider.