Professional Documents
Culture Documents
Camera Position
Camera Position
Builder
public static final class CameraPosition.Builder extends Object
CameraPosition.Builder()
Creates an empty builder.
CameraPosition.Builder(CameraPosition previous)
CameraPosition
public final class CameraPosition extends AbstractSafeParcelable
implements ParcelableAn immutable class that aggregates all camera position
parameters such as location, zoom level, tilt angle, and bearing.
Use CameraPosition.Builder to construct a CameraPosition instance, which you
can then use in conjunction with CameraUpdateFactory
Field Summary
public final float bearing Direction that the camera is pointing in, in degrees clockwise from
north.
public final LatLng target The location that the camera is pointing at.
public final float tilt The angle, in degrees, of the camera angle from the nadir (directly
facing the Earth).
public final float zoom Zoom level near the center of the screen.
static CameraPosition.Builder builder(CameraPosition camera)
Creates a builder for a camera position, initialized to a given
position.
static CameraPosition.Builder builder()
Creates a builder for a camera position.
static CameraPosition createFromAttributes(Context context, AttributeSet attrs)
Creates a CameraPosition from the AttributeSet.
boolean equals(Object o)
final static CameraPosition fromLatLngZoom(LatLng target, float zoom)
Constructs a CameraPosition pointed for a particular target and
zoom level.
int hashCode()
String toString()
void writeToParcel(Parcel out, int flags)
Circle
public final class Circle extends Object
Center
Radius
Stroke Width
The width of the circle's outline in screen pixels. The width is constant and
independent of the camera's zoom level. The default value is 10.
Stroke Color
The color of the circle outline in ARGB format, the same format used by Color.
The default value is black (0xff000000).
Stroke pattern
Fill Color
The color of the circle fill in ARGB format, the same format used by Color. The
default value is transparent (0x00000000).
Z-Index
The order in which this tile overlay is drawn with respect to other overlays
(including GroundOverlays,TileOverlays, Polylines, and Polygons but
not Markers). An overlay with a larger z-index is drawn over overlays with
smaller z-indices. The order of overlays with the same z-index is arbitrary. The
default zIndex is 0.
Visibility
Indicates if the circle is visible or invisible, i.e., whether it is drawn on the map. An
invisible circle is not drawn, but retains all of its other properties. The default
is true, i.e., visible.
Tag
LatLng getCenter()
Returns the center as a LatLng.
int getFillColor()
Returns the fill color of this Circle.
String getId()
Gets this circle's id.
double getRadius()
Returns the circle's radius, in meters.
int getStrokeColor()
Returns the stroke color.
List<PatternItem> getStrokePattern()
Returns the stroke pattern of this circle's outline.
float getStrokeWidth()
Returns the stroke width.
Object getTag()
Gets the tag for the circle.
float getZIndex()
Returns the zIndex.
boolean isClickable()
Gets the clickability of the circle.
boolean isVisible()
Checks whether the circle is visible.
void remove()
Removes this circle from the map.
void setCenter(LatLng center)
Sets the center using a LatLng.
void setClickable(boolean clickable)
Sets the clickability of the circle.
void setFillColor(int color)
Sets the fill color.
void setRadius(double radius)
Sets the radius in meters.
void setStrokeColor(int color)
Sets the stroke color.
void setStrokePattern(List<PatternItem> pattern)
Sets the stroke pattern of the circle's outline.
void setStrokeWidth(float width)
Sets the stroke width.
void setTag(Object tag)
Sets the tag for the circle.
void setVisible(boolean visible)
Sets the visibility of the circle.
void setZIndex(float zIndex)
Sets the zIndex.
CircleOptions
public final class CircleOptions extends AbstractSafeParcelable
CircleOptions center(LatLng center)
Sets the center using a LatLng.
CircleOptions clickable(boolean clickable)
Specifies whether this circle is clickable.
CircleOptions fillColor(int color)
Sets the fill color.
LatLng getCenter()
Returns the center as a LatLng.
int getFillColor()
Returns the fill color.
double getRadius()
Returns the circle's radius, in meters.
int getStrokeColor()
Returns the stroke color.
List<PatternItem> getStrokePattern()
Returns the stroke pattern set in this CircleOptions object for the circle's
outline.
float getStrokeWidth()
Returns the stroke width.
float getZIndex()
Returns the zIndex.
boolean isClickable()
Gets the clickability setting for the circle.
boolean isVisible()
Checks whether the circle is visible.
CircleOptions radius(double radius)
Sets the radius in meters.
CircleOptions strokeColor(int color)
Sets the stroke color.
CircleOptions strokePattern(List<PatternItem> pattern)
Sets a stroke pattern for the circle's outline.
CircleOptions strokeWidth(float width)
Sets the stroke width.
CircleOptions visible(boolean visible)
Sets the visibility.
CircleOptions zIndex(float zIndex)
Sets the zIndex.
GroundOverlay
public final class GroundOverlay extends Object
A ground overlay is an image that is fixed to a map. A ground overlay has the following
properties:
Position
There are two ways to specify the position of the ground overlay:
Using a location: You must provide an image of the ground overlay, a LatLng to which
the anchor will be fixed and the width of the overlay (in meters). The anchor is, by
default, 50% from the top of the image and 50% from the left of the image. This can be
changed. You can optionally provide the height of the overlay (in meters). If you do not
provide the height of the overlay, it will be automatically calculated to preserve the
proportions of the image.
Using a Bounds: You must provide a LatLngBounds which will contain the image.
You must specify the position of the ground overlay before it is added to the map,
otherwise an IllegalArgumentException will be thrown when the ground overlay is
added to the map. Furthermore, you must only specify the position using one of these
methods in the GroundOverlayOptions object; otherwise
an IllegalStateException will be thrown when specifying using a second method.
Image
The image (as an BitmapDescriptor) to be used for this overlay. The image will be
scaled to fit the position provided. You must specify an image before adding the ground
overlay to the map; if not an IllegalArgumentException will be thrown when it is
added to the map.
Bearing
The amount that the image should be rotated in a clockwise direction. The center of the
rotation will be the image's anchor. This is optional and the default bearing is 0, i.e., the
image is aligned so that up is north.
zIndex
The order in which this ground overlay is drawn with respect to other overlays
(including Polylines and TileOverlays, but not Markers). An overlay with a larger
zIndex is drawn over overlays with smaller zIndexes. The order of overlays with the
same zIndex value is arbitrary. This is optional and the default zIndex is 0.
Transparency
Visibility
Indicates if the ground overlay is visible or invisible, i.e. whether it is drawn on the map.
An invisible ground overlay is not drawn, but retains all of its other properties. This is
optional and the default visibility is true, i.e., visible.
Clickability
If you want to handle events fired when the user clicks the ground overlay, set this
property to true. You can change this value at any time. The default is false. If this
property is set to true, your app will receive notifications to
the GoogleMap.OnGroundOverlayClickListener registered
through setOnGroundOverlayClickListener(GoogleMap.OnGroundOverlayCl
ickListener).
Tag
boolean equals(Object other)
Tests if this GroundOverlay is equal to another.
float getBearing()
Gets the bearing of the ground overlay in degrees clockwise from north.
LatLngBounds getBounds()
Gets the bounds for the ground overlay.
float getHeight()
Gets the height of the ground overlay.
String getId()
Gets this ground overlay's id.
LatLng getPosition()
Gets the location of the anchor point.
Object getTag()
Gets the tag for the circle.
float getTransparency()
Gets the transparency of this ground overlay.
float getWidth()
Gets the width of the ground overlay.
float getZIndex()
Gets the zIndex of this ground overlay.
int hashCode()
boolean isClickable()
Gets the clickability of the ground overlay.
boolean isVisible()
Gets the visibility of this ground overlay.
void remove()
Removes this ground overlay from the map.
void setBearing(float bearing)
Sets the bearing of the ground overlay (the direction that the vertical axis of the
ground overlay points) in degrees clockwise from north.
void setClickable(boolean clickable)
Sets the clickability of the ground overlay.
void setDimensions(float width, float height)
Sets the dimensions of the ground overlay.
void setDimensions(float width)
Sets the width of the ground overlay.
void setImage(BitmapDescriptor imageDescriptor)
Sets the image for the Ground Overlay.
void setPosition(LatLng latLng)
Sets the position of the ground overlay by changing the location of the anchor
point.
void setPositionFromBounds(LatLngBounds bounds)
Sets the position of the ground overlay by fitting it to the given LatLngBounds.
void setTag(Object tag)
Sets the tag for the ground overlay.
void setTransparency(float transparency)
Sets the transparency of this ground overlay.
void setVisible(boolean visible)
Sets the visibility of this ground overlay.
void setZIndex(float zIndex)
Sets the zIndex of this ground overlay.
GroundOverlayOptions
public final class GroundOverlayOptions extends AbstractSafeParcelable
Constant Summary
float NO_DIMENSION Flag for when no dimension is specified for the height.
Public Constructor Summary
GroundOverlayOptions()
Creates a new set of ground overlay options.
IndoorBuilding
public final class IndoorBuilding extends Object
Represents a building.
Two IndoorBuildings are .equal() if the physical building they represent is the same.
However, if a building's structural model changes, e.g., due to an update to Google's
building models, then an old IndoorBuilding object and a new IndoorBuilding object will
be .equal(), but might have different contents.
boolean equals(Object other)
Tests if this IndoorBuilding is equal to another.
int getActiveLevelIndex()
Gets the index in the list returned by getLevels() of the level that is
currently active in this building (default if no active level was previously set).
int getDefaultLevelIndex()
Gets the index in the list returned by getLevels() of the default level for
this building.
List<IndoorLevel> getLevels()
Gets the levels in the building.
int hashCode()
boolean isUnderground()
Returns true if the building is entirely underground.
IndoorLevel
public final class IndoorLevel extends Object
IndoorLevel objects are only equal by id. It is possible that may have different contents.
void activate()
Sets this level as the visible level in its building.
boolean equals(Object other)
Tests if this IndoorLevel is equal to another.
String getName()
Localized display name for the level, e.g.
String getShortName()
Localized short display name for the level, e.g.
int hashCode()
LatLngBounds
public final class LatLngBounds extends AbstractSafeParcelable
implements Parcelable
class LatLngBounds.Builder This is a builder that is able to create a minimum bound based on
a set of LatLng points.
Field Summary
LatLngBounds(LatLng southwest, LatLng northeast)
Creates a new bounds based on a southwest and a northeast corner.
static LatLngBounds.Builder builder()
Creates a new builder.
boolean contains(LatLng point)
Returns whether this contains the given LatLng.
static LatLngBounds createFromAttributes(Context context, AttributeSet attrs)
Creates a LatLngBounds from the AttributeSet.
boolean equals(Object o)
LatLng getCenter()
Returns the center of this LatLngBounds.
int hashCode()
LatLngBounds including(LatLng point)
Returns a new LatLngBounds that extends this LatLngBounds to
include the given LatLng.
String toString()
void writeToParcel(Parcel out, int flags)
Marker
public final class Marker extends Object
An icon placed at a particular point on the map's surface. A marker icon is drawn
oriented against the device's screen rather than the map's surface; i.e., it will not
necessarily change orientation due to map rotations, tilting, or zooming.
Alpha
Sets the opacity of the marker. Defaults to 1.0.
Anchor
The point on the image that will be placed at the LatLng position of the marker.
This defaults to 50% from the left of the image and at the bottom of the image.
Position
The LatLng value for the marker's position on the map. You can change this
value at any time if you want to move the marker.
Title
A text string that's displayed in an info window when the user taps the marker.
You can change this value at any time.
Snippet
Additional text that's displayed below the title. You can change this value at any
time.
Icon
A bitmap that's displayed for the marker. If the icon is left unset, a default icon is
displayed. You can specify an alternative coloring of the default icon
using defaultMarker(float).
Drag Status
If you want to allow the user to drag the marker, set this property to true. You
can change this value at any time. The default is false.
Visibility
By default, the marker is visible. To make the marker invisible, set this property
to false. You can change this value at any time.
Flat or Billboard
If the marker is flat against the map, it will remain stuck to the map as the camera
rotates and tilts but will still remain the same size as the camera zooms, unlike
a GroundOverlay. If the marker is a billboard, it will always be drawn facing the
camera and will rotate and tilt with the camera. The default is a billboard ( false)
Rotation
The rotation of the marker in degrees clockwise about the marker's anchor point.
The axis of rotation is perpendicular to the marker. A rotation of 0 corresponds to
the default position of the marker. When the marker is flat on the map, the default
position is North aligned and the rotation is such that the marker always remains
flat on the map. When the marker is a billboard, the default position is pointing up
and the rotation is such that the marker is always facing the camera. The default
value is 0.
zIndex
The draw order for the marker. The markers are drawn in order of the zIndex,
with the highest zIndex marker drawn on top. By setting the zIndex property for
each marker, you can control which tap target your user is most likely to hit. The
default value is 0.
Tag
boolean equals(Object other)
Tests if this Marker is equal to another.
float getAlpha()
Gets the alpha of the marker.
String getId()
Gets this marker's id.
LatLng getPosition()
Returns the position of the marker.
float getRotation()
Gets the rotation of the marker.
String getSnippet()
Gets the snippet of the marker.
Object getTag()
Gets the tag for the marker.
String getTitle()
Gets the title of the marker.
float getZIndex()
Returns the zIndex of the marker.
int hashCode()
void hideInfoWindow()
Hides the info window if it is shown from this marker.
boolean isDraggable()
Gets the draggability of the marker.
boolean isFlat()
Gets the flat setting of the Marker.
boolean isInfoWindowShown()
Returns whether the info window is currently shown above this marker.
boolean isVisible()
Gets the visibility setting of this marker.
void remove()
Removes this marker from the map.
void setAlpha(float alpha)
Sets the alpha (opacity) of the marker.
void setAnchor(float anchorU, float anchorV)
Sets the anchor point for the marker.
void setDraggable(boolean draggable)
Sets the draggability of the marker.
void setFlat(boolean flat)
Sets whether this marker should be flat against the map true or a billboard facing the
camera false.
void setIcon(BitmapDescriptor iconDescriptor)
Sets the icon for the marker.
void setInfoWindowAnchor(float anchorU, float anchorV)
Specifies the point in the marker image at which to anchor the info window when it is
displayed.
void setPosition(LatLng latlng)
Sets the location of the marker.
void setRotation(float rotation)
Sets the rotation of the marker in degrees clockwise about the marker's anchor point.
void setSnippet(String snippet)
Sets the snippet of the marker.
void setTag(Object tag)
Sets the tag for the marker.
void setTitle(String title)
Sets the title of the marker.
void setVisible(boolean visible)
Sets the visibility of this marker.
void setZIndex(float zIndex)
Sets the zIndex of the marker.
void showInfoWindow()
Shows the info window of this marker on the map, if this marker isVisible().
MarkerOptions
public final class MarkerOptions extends AbstractSafeParcelable