Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[udig-devel] Applying a style to layer from an SLD file

Hi,
 
Can someone please give some example code of loading a StyleDescriptor from a file then 
applying the style to a layer of the map? I currently have 3 layers on a map and I want each to have
a different style. I'm able to load the different styles from the SLD file using the SLDParser object.
The problem comes when I try to apply them to the layers. This is currently being tested within a 
simple tool. This bit of code gives me problems:
 
getContext().getMapLayers().get(0).getStyleBlackBoard().put(SLDContent.ID,style);
 
I'm not sure if this is the correct way to apply a style to a layer. I'd appreciate if someone could
point me in the right direction.  
 
Regards,
Jonathan
 

Back to the top