SimpleFillSymbol style does not work

3289
4
06-11-2016 04:07 AM
DavidNascimento
New Contributor

Whenever I try to set a style other than 'solid' on a SimpleFillSymbol, the geometry gets rendered empty, with only the outline being drawn. Is this a known issue? I couldn't find any similar posts on this forum.

Best regards,

David

Tags (2)
0 Kudos
4 Replies
FC_Basson
MVP Regular Contributor

How are you setting the style of the graphic?  See SimpleFillSymbol | API Reference | ArcGIS API for JavaScript

So for example, this works:

var graphic = map.graphics.graphics[0];  // first graphic of map graphics list (assuming it is a polygon)
graphic.symbol.setStyle(esri.symbol.SimpleFillSymbol.STYLE_HORIZONTAL);
map.graphics.redraw();
0 Kudos
DavidNascimento
New Contributor

We are using JSAPI 4.0 and developing in Typescript. We tried setting the value in the constructor, afterwards, with and without specifying color - the result is the same. Nothing is rendered unless the style is 'solid'.

0 Kudos
FC_Basson
MVP Regular Contributor

Oh sorry.  Test the following on the Esri sample (Get started with graphics - 4.0 ) and it works:

polygonGraphic.symbol.style = "diagonal-cross"
0 Kudos
FC_Basson
MVP Regular Contributor

The description says thath the property is not supported for 3D SceneViews: SimpleFillSymbol | API Reference | ArcGIS API for JavaScript 4.0

0 Kudos