Class: PictureMarkerSymbolE-mail This Topic Printable Version Give Us Feedback

Description

Marker symbols are used to draw points and multipoints on the graphics layer. PictureMarkerSymbol uses an image as a marker.

Class hierarchy

esri.symbol.Symbol
  |_ esri.symbol.MarkerSymbol
        |_ esri.symbol.PictureMarkerSymbol

Constructor

Constructor Description
esri.symbol.PictureMarkerSymbol(json) Creates a new PictureMarkerSymbol object using a JSON object.
esri.symbol.PictureMarkerSymbol(url, width, height) Creates a new PictureMarkerSymbol object.

Properties

Property Type Description
height Number Height of the image in pixels.
url String URL of the image.
width Number Width of the image in pixels.

Methods

Method Return Value Description
setHeight(height) PictureMarkerSymbol Sets the height of the image for display. The height can be larger or smaller than the actual width of the image. As the image gets larger, it will become more pixellated.
setUrl(url) PictureMarkerSymbol Sets the URL where the image is located.
setWidth(width) PictureMarkerSymbol Sets the width of the image for display. The width can be larger or smaller than the actual width of the image. As the image gets larger, it will become more pixellated.
Constructor Detail

esri.symbol.PictureMarkerSymbol(json)

Creates a new PictureMarkerSymbol object using a JSON object.
Parameters:
<Object> json Required JSON object representing the PictureMarkerSymbol.

esri.symbol.PictureMarkerSymbol(url, width, height)

Creates a new PictureMarkerSymbol object.
Parameters:
<String> url Required URL of the image.
<Number> width Required Width of the image in pixels. The default value is the actual width of the image.
<Number> height Required Height of the image in pixels. The default value is the actual height of the image.
Code snippets:

Example 1

new esri.symbol.PictureMarkerSymbol('http://www.esri.com/graphics/aexicon.jpg', 51, 51);

Example 2

new esri.symbol.PictureMarkerSymbol('/images/diamond.png', 25, 25);
Properties Detail

<Number> height

Height of the image in pixels.

<String> url

URL of the image.

<Number> width

Width of the image in pixels.
Methods Detail

setHeight(height)

Sets the height of the image for display. The height can be larger or smaller than the actual width of the image. As the image gets larger, it will become more pixellated.
Return value: PictureMarkerSymbol
Input Parameters:
<Number> height Required Height of marker in pixels.

setUrl(url)

Sets the URL where the image is located.
Return value: PictureMarkerSymbol
Input Parameters:
<String> url Required URL location of marker image.

setWidth(width)

Sets the width of the image for display. The width can be larger or smaller than the actual width of the image. As the image gets larger, it will become more pixellated.
Return value: PictureMarkerSymbol
Input Parameters:
<Number> width Required Width of marker in pixels.