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()
|
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)
Create an
Icon using the resource ID of a Bitmap image. |
static IconFactory |
getInstance(Context context) |
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(@NonNull Context context)
public Icon fromBitmap(@NonNull Bitmap bitmap)
Icon
from a given Bitmap image.bitmap
- image used for creating the Icon.Icon
using the given Bitmap image.public Icon fromResource(@DrawableRes int resourceId)
Icon
using the resource ID of a Bitmap image.resourceId
- The resource ID of a Bitmap image.Icon
that was loaded from the asset or null
if failed to load.public Icon defaultMarkerView()
Icon
using the default marker icon used for MarkerView
.Icon
with the default MarkerView
icon.public Icon fromAsset(@NonNull String assetName)
Icon
using the name of a Bitmap image in the assets directory.assetName
- The name of a Bitmap image in the assets directory.Icon
that was loaded from the asset or null
if failed to load.public Icon fromPath(@NonNull String absolutePath)
Icon
using the absolute file path of a Bitmap image.absolutePath
- The absolute path of the Bitmap image.Icon
that was loaded from the absolute path or null
if failed to
load.public Icon fromFile(@NonNull String fileName)
Icon
using the name of a Bitmap image file located in the internal storage.
In particular, this calls Context.openFileInput(String)
.fileName
- The name of the Bitmap image file.Icon
that was loaded from the asset or null
if failed to load.© 2015–2017 Mapbox. All rights reserved.