Select to view content in your preferred language

Picture Fill Symbol URL?

6622
14
Jump to solution
01-22-2015 10:24 AM
DavidColey
Frequent Contributor

Hi-

Does anyone know the url(s) for picture fill symbols?

Thanks

David

0 Kudos
1 Solution

Accepted Solutions
KenBuja
MVP Esteemed Contributor

Take a look a this discussion that goes into why you can't apply a color to the different fill patterns.

The hatch patterns cannot be altered via the api because they are images.

Only STYLE_SOLID will use the color provided. STYLE_SOLID and STYLE_NULL are the only "pure" esri/symbol/SimpleFillSymbol(s).

All the other fill options like STYLE_BACKWARD_DIAGONAL, are actually esri/symbol/PictureFillSymbol(s), which use images that are included in the api http://js.arcgis.com/3.7/js/esri/images/symbol/sfs/vertical.png.

The solution, work-around or what have you is to use esri/symbol/PictureFillSymbol with your own custom images.

View solution in original post

14 Replies
TimWitt2
MVP Alum
0 Kudos
DavidColey
Frequent Contributor

Thanks Tim-

No, I mean the picture fill symbols  -  colored hatching, mangrove etc

0 Kudos
TimWitt2
MVP Alum

I think you are stuck with what is available here SimpleFillSymbol | API Reference | ArcGIS API for JavaScript

0 Kudos
DavidColey
Frequent Contributor

Sorry, little more info - the sample:

Add graphics to a map | ArcGIS API for JavaScript

contains:

// fill symbol used for extent, polygon and freehand polygon, use a picture fill symbol
       
// the images folder contains additional fill images, other options: sand.png, swamp.png or stiple.png
     

 var fillSymbol = new PictureFillSymbol(
          "images/mangrove.png",
          new SimpleLineSymbol(
            SimpleLineSymbol.STYLE_SOLID,
            new Color('#000'), 
            1
          ), 
          42, 
          42
        );

and since url is part of the constructor, I was wondering if  "images/mangrove.png", is local or is that being pulled in from the full api or maybe from the rest api?

0 Kudos
TimWitt2
MVP Alum

David,

I see, that is a local png. What you would need is, get those png's and then host them locally.

Tim

0 Kudos
DavidColey
Frequent Contributor

Hmm, thanks that's what I thought too, but wasn't sure.  Desktop accesses them from

C:\Program Files (x86)\ArcGIS\Desktop10.3\Styles\Pictures here as bmp's.  Maybe a better question is:

How can I render the hatch or diagonal fill symbol lines when set as a simple fill symbol style?  The fill symbol lines don't seem to be taking on the color set for the fill symbol, they remain black....

David

0 Kudos
TimWitt2
MVP Alum

You mean the fills from the constant table here?

SimpleFillSymbol | API Reference | ArcGIS API for JavaScript

0 Kudos
DavidColey
Frequent Contributor

Yes, exactly

0 Kudos
TimWitt2
MVP Alum

You can change the color of your mesh.

var sfs = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID,
 
new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_DASHDOT,
 
new esri.Color([255,0,0]), 2),new esri.Color([255,255,0,0.25]));

look at this example: the first color changes the outline color and the second color changes your mesh color.

0 Kudos