public final class IconFactory extends Object
icon is used to display bitmaps on top of the map using Marker
and MarkerView
.
Icon
Modifier and Type | Field and Description |
---|---|
static Bitmap |
ICON_MARKERVIEW_BITMAP |
static String |
ICON_MARKERVIEW_ID |
Modifier and Type | Method and Description |
---|---|
Icon |
defaultMarker()
Provides an icon using the default marker icon used for
Marker . |
Icon |
defaultMarkerView()
Provides an icon using the default marker icon used for
MarkerView . |
Icon |
fromAsset(String assetName)
Creates an Icon using the name of a Bitmap image in the assets directory.
|
Icon |
fromBitmap(Bitmap bitmap)
Creates an icon from a given Bitmap image.
|
Icon |
fromFile(String fileName)
Create an Icon using the name of a Bitmap image file located in the internal storage.
|
Icon |
fromPath(String absolutePath)
Creates an Icon using the absolute file path of a Bitmap image.
|
Icon |
fromResource(int resourceId)
Creates an icon using the resource ID of a Bitmap image.
|
static IconFactory |
getInstance(Context context)
Get a single instance of IconFactory.
|
static Icon |
recreate(String iconId,
Bitmap bitmap)
Create an Icon using a previously created icon identifier along with a provided Bitmap.
|
public static final Bitmap ICON_MARKERVIEW_BITMAP
public static final String ICON_MARKERVIEW_ID
public static IconFactory getInstance(Context context)
context
- the context to derive the application context frompublic Icon fromBitmap(Bitmap bitmap)
bitmap
- image used for creating the Icon.public Icon fromResource(int resourceId)
resourceId
- The resource ID of a Bitmap image.null
if failed to load.public Icon defaultMarker()
Marker
.Marker
icon.public Icon defaultMarkerView()
MarkerView
.MarkerView
icon.public Icon fromAsset(String assetName)
assetName
- The name of a Bitmap image in the assets directory.public Icon fromPath(String absolutePath)
absolutePath
- The absolute path of the Bitmap image.public Icon fromFile(String fileName)
fileName
- The name of the Bitmap image file.public static Icon recreate(String iconId, Bitmap bitmap)
iconId
- The Icon identifier you'd like to recreate.bitmap
- a Bitmap used to replace the current one.© 2015–2018 Mapbox. All rights reserved.