public final class

BitmapDescriptorFactory

extends Object
java.lang.Object
   ↳ com.amazon.geo.mapsv2.model.BitmapDescriptorFactory

Class Overview

Contains methods for creating BitmapDescriptor objects from different sources. The bitmaps can then be used as Marker icons.

You can create a BitmapDescriptor that just changes the color of the default marker icon, or you can use a custom image.

To assign a BitmapDescriptor to a marker, use icon(BitmapDescriptor).

Before you can use the methods in this class, the map must be initialized. If you call these methods before obtaining an AmazonMap object, you must initialize the map first by calling initialize(Context).

Summary

Constants
float HUE_AZURE Azure hue.
float HUE_BLUE Blue hue.
float HUE_CYAN Cyan hue.
float HUE_GREEN Green hue.
float HUE_MAGENTA Magenta hue.
float HUE_ORANGE Orange hue.
float HUE_RED Red hue.
float HUE_ROSE Rose hue.
float HUE_VIOLET Violet hue.
float HUE_YELLOW Yellow hue.
Public Methods
static BitmapDescriptor defaultMarker()
Creates a bitmap descriptor for the default Marker image.
static BitmapDescriptor defaultMarker(float hue)
Creates a bitmap descriptor for the default Marker image using the specified color.
static BitmapDescriptor fromAsset(String assetName)
Creates a bitmap descriptor from the specified image in the assets directory.
static BitmapDescriptor fromBitmap(Bitmap image)
Creates a bitmap descriptor from the specified in-memory Bitmap.
static BitmapDescriptor fromFile(String fileName)
Creates a bitmap descriptor from a private (package-specific) file.
static BitmapDescriptor fromPath(String absolutePath)
Creates a bitmap descriptor from a file in internal storage, such as the SD card.
static BitmapDescriptor fromResource(int resourceId)
Creates a bitmap descriptor from an image resource id.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final float HUE_AZURE

Azure hue. Constant value 210.0.

Constant Value: 210.0

public static final float HUE_BLUE

Blue hue. Constant value 240.0.

Constant Value: 240.0

public static final float HUE_CYAN

Cyan hue. Constant value 180.0.

Constant Value: 180.0

public static final float HUE_GREEN

Green hue. Constant value 120.0.

Constant Value: 120.0

public static final float HUE_MAGENTA

Magenta hue. Constant value 300.0.

Constant Value: 300.0

public static final float HUE_ORANGE

Orange hue. Constant value 30.0.

Constant Value: 30.0

public static final float HUE_RED

Red hue. Constant value 0.0.

Constant Value: 0.0

public static final float HUE_ROSE

Rose hue. Constant value 330.0.

Constant Value: 330.0

public static final float HUE_VIOLET

Violet hue. Constant value 270.0.

Constant Value: 270.0

public static final float HUE_YELLOW

Yellow hue. Constant value 60.0.

Constant Value: 60.0

Public Methods

public static BitmapDescriptor defaultMarker ()

Creates a bitmap descriptor for the default Marker image.

Returns
  • The new BitmapDescriptor.

public static BitmapDescriptor defaultMarker (float hue)

Creates a bitmap descriptor for the default Marker image using the specified color.

Parameters
hue The color to use for the image. Must be a number greater than or equal to 0 and less than 360. Note that this specifies a color in HSV color space with S and V of 1.0.
Returns
  • The new BitmapDescriptor.

public static BitmapDescriptor fromAsset (String assetName)

Creates a bitmap descriptor from the specified image in the assets directory. Returns null if the asset fails to load.

Parameters
assetName The name of the asset.
Returns
  • The new BitmapDescriptor created from the asset or null if the asset failed to load.

public static BitmapDescriptor fromBitmap (Bitmap image)

Creates a bitmap descriptor from the specified in-memory Bitmap.

Parameters
image The in-memory Bitmap.
Returns
  • The new BitmapDescriptor created from the Bitmap.

public static BitmapDescriptor fromFile (String fileName)

Creates a bitmap descriptor from a private (package-specific) file.

Parameters
fileName The name of the file. Note that this must not contain a path.
Returns
  • The new BitmapDescriptor created from the private file, or null if the file failed to load.

public static BitmapDescriptor fromPath (String absolutePath)

Creates a bitmap descriptor from a file in internal storage, such as the SD card.

Parameters
absolutePath The absolute path to the file.
Returns
  • The new BitmapDescriptor created from the file, or null if the file failed to load.

public static BitmapDescriptor fromResource (int resourceId)

Creates a bitmap descriptor from an image resource id. Throws an IllegalArgumentException for bad resource ids (<0).

Parameters
resourceId The resource id of the image.
Returns
  • The new BitmapDescriptor created from the image, or null if the resource failed to load.