Class MapImageFactory

java.lang.Object
com.here.sdk.mapview.MapImageFactory

public class MapImageFactory extends Object
Convenience factory class for loading marker resources from various sources.
  • Method Details

    • fromResource

      public static MapImage fromResource(android.content.res.Resources resources, int resourceID)
      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 resources
      resourceID - 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 file
      width - preferred width
      height - preferred height
      Returns:
      map image representing specified image resource
      Throws:
      InstantiationErrorException - if dimension are invalid or path is empty.
    • fromBitmap

      public static MapImage fromBitmap(@NonNull android.graphics.Bitmap bitmap)
      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