MapImageFactory (API Reference)
Package com.here.sdk.mapview
Class MapImageFactory
java.lang.Object
com.here.sdk.mapview.MapImageFactory
Convenience factory class for loading marker resources from various sources.
-
Method Summary
Modifier and TypeMethodDescriptionstatic MapImagefromBitmap(android.graphics.Bitmap bitmap) Creates a map image from a supplied Bitmap.static MapImageCreates a map image from a specified SVG Tiny or PNG file path.static MapImagefromResource(android.content.res.Resources resources, int resourceID) Loads a map image from a specified bitmap resource ID.
-
Method Details
-
fromResource
Loads a map image from a specified bitmap resource ID. As usual on Android, the PNG format is preferred. Vector drawables are not supported.- Parameters:
resources- the application's resourcesresourceID- resource ID for the bitmap image to load- Returns:
- map image representing specified image resource
-
fromFile
public static MapImage fromFile(@NonNull String filePath, int width, int height) throws InstantiationErrorException Creates a map image from a specified SVG Tiny or PNG file path. Trying to load data not compliant to SVG Tiny or PNG might result in undefined behavior. This method needs read storage permission to be granted.- Parameters:
filePath- the path pointing to SVG Tiny filewidth- preferred widthheight- preferred height- Returns:
- map image representing specified image resource
- Throws:
InstantiationErrorException- if dimension are invalid or path is empty.
-
fromBitmap
Creates a map image from a supplied Bitmap.- Parameters:
bitmap- the bitmap image to use for creating the marker resource- Returns:
- map image representing specified image resource
-