Styling a feature layer with CSS

2440
0
12-24-2014 06:19 AM
TyroneLigon
Occasional Contributor

Apologizing in advance for not being able to post code...I have a feature layer initialized from an empty feature collection. Based on user input I query a map service, retrieve a country geometry from the map server, and add it to the feature layer. I want to use CSS to style the feature using an animation.

In the CSS styling examples on GeoNet the feature layers are created by URL (or in one case from a CSV file) and already have features when they are added to the map. My feature layer is initialized with "styling: false", data attributes set to attributes being returned from the map server, and I have path statements in my CSS file. Styling is applied during the "graphics-draw" event; I put a break point in Firebug to make sure all the graphics in the layer are being passed through the function and that their attributes are described correctly. I also tried setting a class name on the feature layer and defining a CSS path with no attribute parameter.

I can't figure out why it isn't working, which is why I wonder if the way my feature layer is implemented doesn't lend itself to CSS styling.

0 Kudos
0 Replies