public class

MarkerIconFactory

extends Object
java.lang.Object
   ↳ com.neomades.maps.overlay.MarkerIconFactory

Class Overview

This factory class creates MarkerIcons, that can be set on a Marker. If the same icon is to be used on multiple markers, use a single MarkerIcon instance to save memory.

Summary

Constants
int HUE_AZURE Azure color
int HUE_BLUE Blue color
int HUE_CYAN Cyan color
int HUE_GREEN Green color
int HUE_MAGENTA Magenta color
int HUE_ORANGE Orange color
int HUE_RED Red color
int HUE_ROSE Rose color
int HUE_VIOLET Violet color
int HUE_YELLOW Yellow color
Public Methods
static MarkerIcon defaultIcon(int hue)
Creates a MarkerIcon that has a default image, with the tint color given in parameter.
static MarkerIcon defaultIcon()
Creates a MarkerIcon that has a default image.
static MarkerIcon fromImage(Image image)
Creates a MarkerIcon from an image.
static MarkerIcon fromImage(int resID)
Creates a MarkerIcon using the resource ID of an image.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final int HUE_AZURE

Azure color

Constant Value: 210 (0x000000d2)

public static final int HUE_BLUE

Blue color

Constant Value: 240 (0x000000f0)

public static final int HUE_CYAN

Cyan color

Constant Value: 180 (0x000000b4)

public static final int HUE_GREEN

Green color

Constant Value: 120 (0x00000078)

public static final int HUE_MAGENTA

Magenta color

Constant Value: 300 (0x0000012c)

public static final int HUE_ORANGE

Orange color

Constant Value: 30 (0x0000001e)

public static final int HUE_RED

Red color

Constant Value: 0 (0x00000000)

public static final int HUE_ROSE

Rose color

Constant Value: 330 (0x0000014a)

public static final int HUE_VIOLET

Violet color

Constant Value: 270 (0x0000010e)

public static final int HUE_YELLOW

Yellow color

Constant Value: 60 (0x0000003c)

Public Methods

public static MarkerIcon defaultIcon (int hue)

Creates a MarkerIcon that has a default image, with the tint color given in parameter.

Cross Platform considerations

Below iOS 9, only HUE_RED, HUE_GREEN and HUE_VIOLET are supported. The other values are ignored (the default hue will be used).

Parameters
hue the hue to apply to the default marker. The value must be greater than 0 and less than 360
Returns
  • the new MarkerIcon
Throws
IllegalArgumentException if the hue parameter is negative or greater than 360

public static MarkerIcon defaultIcon ()

Creates a MarkerIcon that has a default image.

Returns
  • the new MarkerIcon

public static MarkerIcon fromImage (Image image)

Creates a MarkerIcon from an image. To create the MarkerIcon, some platforms may duplicate the original image in memory. So if the same image is to be used on multiple markers, use a single MarkerIcon instance to save memory.

Parameters
image the image to use (some implementations may clone it).
Returns
  • the new MarkerIcon
Throws
NullPointerException if the image parameter is null

public static MarkerIcon fromImage (int resID)

Creates a MarkerIcon using the resource ID of an image.

Parameters
resID the resource ID of the image to use
Returns
  • the new MarkerIcon
Throws
IllegalArgumentException if the resource ID parameter is invalid