public final class

BitmapDescriptorFactory

extends Object
java.lang.Object
   ↳ com.google.android.gms.maps.model.BitmapDescriptorFactory

Class Overview

Used to create a definition of an image, used for marker icons and ground overlays.

Prior to using any methods from this class, you must do one of the following to ensure that this class is initialized:

Summary

Constants
float HUE_AZURE
float HUE_BLUE
float HUE_CYAN
float HUE_GREEN
float HUE_MAGENTA
float HUE_ORANGE
float HUE_RED
float HUE_ROSE
float HUE_VIOLET
float HUE_YELLOW
Public Methods
static BitmapDescriptor defaultMarker()
Creates a bitmap descriptor that refers to the default marker image.
static BitmapDescriptor defaultMarker(float hue)
Creates a bitmap descriptor that refers to a colorization of the default marker image.
static BitmapDescriptor fromAsset(String assetName)
Creates a BitmapDescriptor using the name of an image in the assets directory.
static BitmapDescriptor fromBitmap(Bitmap image)
Creates a bitmap descriptor from a given image.
static BitmapDescriptor fromFile(String path)
Creates a BitmapDescriptor using the path to an image file.
static BitmapDescriptor fromResource(int resourceId)
Creates a BitmapDescriptor using the resource id of an image.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final float HUE_AZURE

Constant Value: 210.0

public static final float HUE_BLUE

Constant Value: 240.0

public static final float HUE_CYAN

Constant Value: 180.0

public static final float HUE_GREEN

Constant Value: 120.0

public static final float HUE_MAGENTA

Constant Value: 300.0

public static final float HUE_ORANGE

Constant Value: 30.0

public static final float HUE_RED

Constant Value: 0.0

public static final float HUE_ROSE

Constant Value: 330.0

public static final float HUE_VIOLET

Constant Value: 270.0

public static final float HUE_YELLOW

Constant Value: 60.0

Public Methods

public static BitmapDescriptor defaultMarker ()

Creates a bitmap descriptor that refers to the default marker image.

public static BitmapDescriptor defaultMarker (float hue)

Creates a bitmap descriptor that refers to a colorization of the default marker image. For convenience, there is a predefined set of hue values. See example HUE_YELLOW.

Parameters
hue The hue of the marker. Value must be greater or equal to 0 and less than 360.

public static BitmapDescriptor fromAsset (String assetName)

Creates a BitmapDescriptor using the name of an image in the assets directory.

Parameters
assetName The name of an image in the assets directory.
Returns
  • the BitmapDescriptor that was loaded from the asset or null if failed to load.

public static BitmapDescriptor fromBitmap (Bitmap image)

Creates a bitmap descriptor from a given image.

public static BitmapDescriptor fromFile (String path)

Creates a BitmapDescriptor using the path to an image file.

Parameters
path The path to the image file.
Returns
  • the BitmapDescriptor that was loaded from the asset or null if failed to load.

public static BitmapDescriptor fromResource (int resourceId)

Creates a BitmapDescriptor using the resource id of an image.

Parameters
resourceId The resource id of an image.
Returns
  • the BitmapDescriptor that was loaded from the asset or null if failed to load.
No examples for this method.
Frequently called with: [Clear]
Portions of this page are reproduced from work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License. The original page is available here.