Looking for WMS with SLD sample

659
2
06-01-2011 10:34 AM
KyleDraganov
New Contributor
I don't see any working samples of requesting WMS layers with Style Layer Descriptors in the Flex API documentation. I am trying to apply my own SLD to an external WMS service. 

Has anyone done this successfully? If so, any samples in Flex would be appreciated.

Thanks.
Tags (2)
0 Kudos
2 Replies
SorinAndrei
New Contributor
Hi,

to use SLD with WMS layer you can do:

    myLayerWMS.proxyURL = "http://mySite.com/proxy.php";
    myLayerWMS.url = "http://myGisServer/services/myServce/MapServer/WMSServer?SLD=url_to_xml";

in proxy.php update the url and replace "STYLES=" with "STYLES=myStyleName"

myStyleName should be the same in xml file.

in the final url you should have something like:
http://myGisServer/services/myService/MapServer/WMSServer?BBOX=283800.83413922496%2C6313182.92637663...
0 Kudos
JasonCantrell
New Contributor III
I'm currently trying to get a WMSLayer to display a map layer with a style applied to it.  No one ever responded to this thread, so I wanted to see if anyone has used the method described above with success. 

Is the proxy totally necessary?  It seems like it's just there to insert the style name into the URL.  Does the ArcGIS api not provide any method for inserting the style name into the URL?  I see that "styleName" is an attribute of the WMSLayer component, but it doesn't seem to actually set the STYLES parameter within the generated map URL.  If "styleName" doesn't set the STYLE parameter, then what does it do?
0 Kudos