Select to view content in your preferred language

SimpleFillSymbol does not work

3545
6
06-14-2016 12:57 AM
DavidNascimento
Deactivated User
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
6 Replies
PanagiotisPapadopoulos
Esri Regular Contributor

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]));

0 Kudos
PanagiotisPapadopoulos
Esri Regular Contributor

this symbol will give you something like this

Capture.PNG

0 Kudos
KenBuja
MVP Esteemed Contributor

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"
});
0 Kudos
KristianEkenes
Esri Regular Contributor

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.

0 Kudos
DavidNascimento
Deactivated User

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.

0 Kudos
KristianEkenes
Esri Regular Contributor

Thanks for Clarifying, David. Could you share a code snippet or live sample of your app?

0 Kudos