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
try this
symbol = new SimpleFillSymbol(SimpleFillSymbol.STYLE_NONE, new SimpleLineSymbol(SimpleLineSymbol.STYLE_DASHDOT, new Color([255,0,0]), 2), new Color([255,255,0,0.25]));
this symbol will give you something like this
It seems to be working correctly with the Simple Fill sample. In the sandbox, if you make this change to the code, the polygons are symbolized with a diagonal cross hatching.
var defaultSym = new SimpleFillSymbol({ outline: { color: "red", width: 0.5 }, style: "diagonal-cross" });
David,
Are you attempting this in a SceneView? If so, then you will see the behavior you're describing. Notice the note for known limitations in the documentation for the style property in SimpleFillSymbol - SimpleFillSymbol | API Reference | ArcGIS API for JavaScript 4.0
If working in a SceneView, then I recommend you use a FillSymbol3DLayer inside a PolygonSymbol3D although it still doesn't yet support styles other than a solid fill.
The working cross style in MapView - JS Bin - Collaborative JavaScript Debugging
But if you do the same in a SceneView - JS Bin - Collaborative JavaScript Debugging Then it doesn't work.
We are using a MapView. I was also able to create a correct SimpleFillSymbol in a purely JS environment. We are, however, working on an Angular2 application, where the ESRI JS API is loaded as a bower dependency. I am not sure if this plays a role or not.
Thanks for Clarifying, David. Could you share a code snippet or live sample of your app?