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

Description

Fill symbols are used to draw polygon features on the graphics layer. PictureFillSymbol uses an image in a repeating pattern. In addition, the symbol can have an optional outline, which is defined by a line symbol.

Known limitation: PictureFillSymbol does not work correctly in FireFox 2.x. It does work correctly in Internet Explorer 6 and 7 and FireFox 3.x.

Class hierarchy

esri.symbol.Symbol
  |_ esri.symbol.FillSymbol
        |_ esri.symbol.PictureFillSymbol

Constructor

Constructor Description
esri.symbol.PictureFillSymbol(json) Creates a new PictureFillSymbol object using a JSON object.
esri.symbol.PictureFillSymbol(url, outline, width, height) Creates a new PictureFillSymbol 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.
xoffset Number The offset on the x-axis in pixels.
xscale Number Scale factor in x direction.
yoffset Number The offset on the y-axis in pixels.
yscale Number Scale factor in y direction.

Methods

Method Return Value Description
setHeight(height) PictureFillSymbol Sets the height of the symbol.
setOffset(x, y) PictureFillSymbol Sets the symbol offset.
setUrl(url) PictureFillSymbol Sets the URL to the location of the symbol.
setWidth(width) PictureFillSymbol Sets the width of the symbol.
setXScale(scale) PictureFillSymbol Sets the scale factor in x direction. of the symbol.
setYScale(scale) PictureFillSymbol Sets the scale factor in y direction.
Constructor Detail

esri.symbol.PictureFillSymbol(json)

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

esri.symbol.PictureFillSymbol(url, outline, width, height)

Creates a new PictureFillSymbol object.
Parameters:
<String> url Required URL of the image.
<SimpleLineSymbol> outline Required Outline of the symbol.
<Number> width Required Width of the image in pixels.
<Number> height Required Height of the image in pixels.
Code snippets:
var pfs = new esri.symbol.PictureFillSymbol('images/sand.png', 
  new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, 
  new dojo.Color('#000'), 1),
  42, 42);
Properties Detail

<Number> height

Height of the image in pixels.

<String> url

URL of the image.

<Number> width

Width of the image in pixels.

<Number> xoffset

The offset on the x-axis in pixels.
Default value: 0

<Number> xscale

Scale factor in x direction.
Default value: 1

<Number> yoffset

The offset on the y-axis in pixels.
Default value: 0

<Number> yscale

Scale factor in y direction.
Default value: 1
Methods Detail

setHeight(height)

Sets the height of the symbol.
Return value: PictureFillSymbol
Input Parameters:
<Number> height Required Height in pixels.

setOffset(x, y)

Sets the symbol offset.
Return value: PictureFillSymbol
Input Parameters:
<Number> x Required Offset in x direction in pixels.
<Number> y Required Offset in y direction in pixels.

setUrl(url)

Sets the URL to the location of the symbol.
Return value: PictureFillSymbol
Input Parameters:
<String> url Required URL string.

setWidth(width)

Sets the width of the symbol.
Return value: PictureFillSymbol
Input Parameters:
<Number> width Required Width in pixels.

setXScale(scale)

Sets the scale factor in x direction. of the symbol.
Return value: PictureFillSymbol
Input Parameters:
<Number> scale Required Scale factor in x direction.

setYScale(scale)

Sets the scale factor in y direction.
Return value: PictureFillSymbol
Input Parameters:
<Number> scale Required Scale factor in y direction.