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
Properties
| 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
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
Height of the image in pixels.
Width of the image in pixels.
The offset on the x-axis in pixels.
Default value: 0
Scale factor in x direction.
Default value: 1
The offset on the y-axis in pixels.
Default value: 0
Scale factor in y direction.
Default value: 1
Methods Detail
Sets the height of the symbol.
Input Parameters:
|
<Number> height |
Required |
Height in pixels. |
Sets the symbol offset.
Input Parameters:
|
<Number> x |
Required |
Offset in x direction in pixels. |
|
<Number> y |
Required |
Offset in y direction in pixels. |
Sets the URL to the location of the symbol.
Input Parameters:
|
<String> url |
Required |
URL string. |
Sets the width of the symbol.
Input Parameters:
|
<Number> width |
Required |
Width in pixels. |
Sets the scale factor in x direction.
of the symbol.
Input Parameters:
|
<Number> scale |
Required |
Scale factor in x direction. |
Sets the scale factor in y direction.
Input Parameters:
|
<Number> scale |
Required |
Scale factor in y direction. |