Packagecom.esri.ags.symbols
Classpublic class PictureMarkerSymbol
InheritancePictureMarkerSymbol Inheritance MarkerSymbol Inheritance Symbol Inheritance flash.events.EventDispatcher

Used to draw points and multipoints on the graphics layer using an image. The image format can be either JPG, GIF, PNG, SWF or SVG. While SVG images must be embedded within the application, all other image formats can be either embedded within the application or referenced by URL.

Note: As of version 2.0, you can also directly pass in a Bitmap or ByteArray as source.

View the examples

See also

About using JPG, GIF, and PNG with Flex
Live sample - Marker Symbols


Public Properties
 PropertyDefined By
 Inheritedangle : Number
The angle of the marker.
MarkerSymbol
  height : Number
Height of the symbol (in pixels).
PictureMarkerSymbol
  source : Object
Source of the image.
PictureMarkerSymbol
  width : Number
Width of the symbol (in pixels).
PictureMarkerSymbol
 Inheritedxoffset : Number
The offset on the x-axis in pixels.
MarkerSymbol
 Inheritedyoffset : Number
The offset on the y-axis in pixels.
MarkerSymbol
Public Methods
 MethodDefined By
  
PictureMarkerSymbol(source:Object = null, width:Number = 0, height:Number = 0, xoffset:Number = 0, yoffset:Number = 0, angle:Number = 0)
Creates a new PictureMarkerSymbol.
PictureMarkerSymbol
 Inherited
clear(sprite:Sprite):void
Clears the graphics that were drawn to the sprite object.
Symbol
 Inherited
createSwatch(width:Number = 50, height:Number = 50):UIComponent
Creates a swatch for a symbol which can be used in a legend.
Symbol
 Inherited
destroy(sprite:Sprite):void
Removes all the graphics that were drawn to the sprite object and resets its properties.
Symbol
 Inherited
draw(sprite:Sprite, geometry:Geometry, attributes:Object, map:Map):void
Draw the graphics on the sprite object.
Symbol
 Inherited
initialize(sprite:Sprite, geometry:Geometry, attributes:Object, map:Map):void
Initialize the sprite.
Symbol
Protected Methods
 MethodDefined By
 Inherited
Helper function to dispatch a change event.
Symbol
 Inherited
removeAllChildren(sprite:Sprite):void
Removes all children from the sprite object.
Symbol
 Inherited
toScreenX(map:Map, mapX:Number):Number
Converts the x-coordinate of map point to a screen point.
Symbol
 Inherited
toScreenY(map:Map, mapY:Number):Number
Converts the y-coordinate of map point to a screen point.
Symbol
Property Detail
heightproperty
height:Number

Height of the symbol (in pixels). If this symbol height is larger or smaller than the height of the actual image, then the symbol height will shrink or stretch accordingly.


Implementation
    public function get height():Number
    public function set height(value:Number):void
sourceproperty 
source:Object

Source of the image. The default is a blue pushpin.


Implementation
    public function get source():Object
    public function set source(value:Object):void
widthproperty 
width:Number

Width of the symbol (in pixels). If this symbol width is larger or smaller than the width of the actual image, then the symbol width will shrink or stretch accordingly.


Implementation
    public function get width():Number
    public function set width(value:Number):void
Constructor Detail
PictureMarkerSymbol()Constructor
public function PictureMarkerSymbol(source:Object = null, width:Number = 0, height:Number = 0, xoffset:Number = 0, yoffset:Number = 0, angle:Number = 0)

Creates a new PictureMarkerSymbol. Note that 'xoffset', 'yoffset' and 'angle' were added to the constructor in version 1.2.

Parameters
source:Object (default = null) — Source of the image.
 
width:Number (default = 0) — Width of the symbol in pixels.
 
height:Number (default = 0) — Height of the symbol in pixels.
 
xoffset:Number (default = 0) — The offset on the x-axis in pixels [added to constructor in version 1.2].
 
yoffset:Number (default = 0) — The offset on the y-axis in pixels [added to constructor in version 1.2].
 
angle:Number (default = 0) — The angle of the image [added to constructor in version 1.2].
Examples
MXML usage of PictureMarkerSymbol with embedded image:
 <esri:PictureMarkerSymbol id="pms_embedded" source="@Embed(source='assets/fire.gif')"/>
MXML usage of PictureMarkerSymbol using URL to image:
 <esri:PictureMarkerSymbol
     id="pms_by_url"
     source="http://help.arcgis.com/en/webapi/flex/samples/assets/warningsmall.gif"/>