public class

PictureMarkerSymbol

extends MarkerSymbol
java.lang.Object
   ↳ com.esri.core.symbol.MarkerSymbol
     ↳ com.esri.core.symbol.PictureMarkerSymbol

Class Overview

Used to draw points and multipoints on the graphics layer using an image. The image can be either a Drawable object or an image referenced by URL.

Summary

Constants
String TYPE The Constant TYPE.
Public Constructors
PictureMarkerSymbol(JsonNode node)
Instantiates an object of PictureMarkerSymbol from a JsonNode.
PictureMarkerSymbol(Context context, Drawable drawable)
If you have multiple drawables to support different screen sizes and densities, use this constructor to instantiate a PictureMarkerSymbol to make image size the same across different devices.
PictureMarkerSymbol(Drawable drawable)
Instantiates a PictureMarkerSymbol with a Drawable image.
PictureMarkerSymbol(PictureMarkerSymbol symbol)
The Constructor.
PictureMarkerSymbol()
This constructor is intended for use prior to calling ERROR(/#setUrl()) and one of the fetchDrawable() methods.
PictureMarkerSymbol(String pictureUrl)
Public Methods
Symbol copy()
boolean equals(Object obj)
Drawable fetchDrawable()
Fetches the Drawable synchronously from the service.
Future<Drawable> fetchDrawable(CallbackListener<Drawable> callback)
Fetches the Drawable asynchronously from the service.
Drawable getDrawable()
Returns the Drawable of the PictureMarkerSymbol.
String getUrl()
Returns the URL from which the Drawable can be fetched.
int hashCode()
void setUrl(String pictureUrl)
Sets the URL that ERROR(/#fetchDrawable(String)) and ERROR(/#fetchDrawable(String, CallbackListener)) will fetch the Drawable from.
String toJson()
Protected Methods
static float getDensityDPI(Context context)
[Expand]
Inherited Methods
From class com.esri.core.symbol.MarkerSymbol
From class java.lang.Object
From interface com.esri.core.symbol.Symbol

Constants

public static final String TYPE

The Constant TYPE.

Constant Value: "esriPMS"

Public Constructors

public PictureMarkerSymbol (JsonNode node)

Instantiates an object of PictureMarkerSymbol from a JsonNode.

Parameters
node JsonNode: the PictureMarkerSymbol node.
Throws
Exception the exception

public PictureMarkerSymbol (Context context, Drawable drawable)

If you have multiple drawables to support different screen sizes and densities, use this constructor to instantiate a PictureMarkerSymbol to make image size the same across different devices.

Parameters
context Context: application context.
drawable Drawable: the image.

public PictureMarkerSymbol (Drawable drawable)

Instantiates a PictureMarkerSymbol with a Drawable image.

Parameters
drawable Drawable: the image.

public PictureMarkerSymbol (PictureMarkerSymbol symbol)

The Constructor.

Parameters
symbol PictureMarkerSymbol: the symbol

public PictureMarkerSymbol ()

This constructor is intended for use prior to calling ERROR(/#setUrl()) and one of the fetchDrawable() methods.

public PictureMarkerSymbol (String pictureUrl)

This constructor is deprecated.
in 10.2.5, use PictureMarkerSymbol(), setUrl(String) and either ERROR(/#fetchDrawable(String)) or ERROR(/#fetchDrawable(String, CallbackListener)) instead

Instantiates a PictureMarkerSymbol with a URL of an image. Performs a network request on the current thread, so you must not call this from the UI thread.

Parameters
pictureUrl String: the image URL.
Throws
IOException the IO exception

Public Methods

public Symbol copy ()

Returns
Symbol
Throws
Exception

public boolean equals (Object obj)

Parameters
obj Object
Returns
boolean

public Drawable fetchDrawable ()

Fetches the Drawable synchronously from the service. The URL from which to fetch it must have previously been set by PictureMarkerSymbol(JsonNode) or setUrl(String). On successful completion the Drawable is stored within this object and can be retrieved without fetching it again by calling getDrawable(). Performs a network request on the current thread, so do not call this from the UI thread.

Returns
Drawable the Drawable
Throws
IllegalStateException if the URL has not been set
IOException if an error occurs during the fetch

public Future<Drawable> fetchDrawable (CallbackListener<Drawable> callback)

Fetches the Drawable asynchronously from the service. The URL from which to fetch it must have previously been set by PictureMarkerSymbol(JsonNode) or setUrl(String). On successful completion the Drawable is stored within this object and can be retrieved without fetching it again by calling getDrawable().

Parameters
callback CallbackListener: the callback that fires when the Drawable has been fetched or an error occurred
Returns
Future<Drawable> a Future that allows cancellation of the async request as well as retrieving the Drawable result

public Drawable getDrawable ()

Returns the Drawable of the PictureMarkerSymbol.

Returns
Drawable the drawable

public String getUrl ()

Returns the URL from which the Drawable can be fetched. This URL may be set by PictureMarkerSymbol(JsonNode) or setUrl(String).

Returns
String the URL for the Drawable, or null if none has been set

public int hashCode ()

Returns
int

public void setUrl (String pictureUrl)

Sets the URL that ERROR(/#fetchDrawable(String)) and ERROR(/#fetchDrawable(String, CallbackListener)) will fetch the Drawable from.

Parameters
pictureUrl String: the URL from which to fetch the Drawable

public String toJson ()

Returns
String
Throws
Exception

Protected Methods

protected static float getDensityDPI (Context context)

Parameters
context Context
Returns
float