[OpenLayers-Users] sld_body with WMS
wolfsnipes
wolfsnipes at gmail.com
Wed May 28 15:55:20 EDT 2008
Actually I solved it after looking closer at the SLD specification - the
<NamedLayer> tag in the SLD has to specify the layer to query. duh.
-w
wolfsnipes wrote:
>
> hi, I need to implement dynamic map colouring client-side with
> javascript with sld_body in the layer declaration. The concept is
> that different polygons can be highlighted (well, shaded red or
> something) based on input from a dropdown list or form or something.
> I'm using OpenLayers with Geoserver 1.6.1.
>
> what I have so far is..
>
> var mysld = '<StyledLayerDescriptor version ="1.0.0" ...>...xml stuff
> here...</StyledLayerDescriptor>';
>
> var myLayer = new OpenLayers.Layer.WMS("MyLayer", "/geoserver/wms",
> {
> height: '362',
> width: '800',
> layers: 'trsiLayers',
> sld_body: mysld,
> srs: 'EPSG:4326',
> format: 'image/png'
> },
> {singleTile: true}
> );
>
> after this, I get a blank map with no complaints from IE. The SLD
> itself should be fine as it's tested in Geoserver and works fine, it's
> just when I write it in the web page that it doesn't render a map. If
> the sld_body is commented out everything shows up. And please don't
> point me to any existing posts unless you KNOW it is a good one.
>
> thanks,
>
> Daniel
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>
>
--
View this message in context: http://www.nabble.com/sld_body-with-WMS-tp17516355p17520740.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
More information about the Users
mailing list