Change style for WMS layer

908 views
Skip to first unread message

HWK

unread,
Aug 20, 2013, 7:54:27 AM8/20/13
to leafl...@googlegroups.com
Hi, with leaflet 0.6 how do I change the default style for a WMS layer?

Diego Guidi

unread,
Aug 20, 2013, 8:36:55 AM8/20/13
to leafl...@googlegroups.com
you shouls add the STYLES parameter to the layer options
http://leafletjs.com/reference.html#tilelayer-wms

Diego Guidi


On Tue, Aug 20, 2013 at 1:54 PM, HWK <haavard.k...@gmail.com> wrote:
> Hi, with leaflet 0.6 how do I change the default style for a WMS layer?
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "Leaflet" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to leaflet-js+...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

Håvard Wahl Kongsgård

unread,
Aug 20, 2013, 8:39:01 AM8/20/13
to leafl...@googlegroups.com
Yes, I have tried that styles: 'other_style_than_default' but this has no effect.



You received this message because you are subscribed to a topic in the Google Groups "Leaflet" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/leaflet-js/CfGKkBeAzJA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to leaflet-js+...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.



--
Håvard Wahl Kongsgård
Data Scientist
Faculty of Medicine &
Department of Mathematical Sciences
NTNU

http://havard.dbkeeping.com/

Diego Guidi

unread,
Aug 20, 2013, 8:46:00 AM8/20/13
to leafl...@googlegroups.com
you see the http parameter in the request?
are you sure that the style is correctly configured in the WMS server
that you're using?

Diego Guidi

Håvard Wahl Kongsgård

unread,
Aug 20, 2013, 9:06:54 AM8/20/13
to leafl...@googlegroups.com
in the url for tiles the STYLES=& (or default) , so maybe a bug?


Diego Guidi

unread,
Aug 20, 2013, 9:34:50 AM8/20/13
to leafl...@googlegroups.com
this is my code and it works as expected
try your code with latest version: http://leafletjs.com/download.html

wms = L.tileLayer.wms(url, {
service: 'WMS',
version: '1.3.0',
layers: 'TBL_LinesItems,TBL_LinesObject_VIEW,TBL_NodeCad_VIEW',
styles: 'TBL_LinesItems,TBL_LinesObject_VIEW,TBL_NodeCad_VIEW',
format: 'image/png',
transparent: true
});
wms.addTo(map);


Diego Guidi


On Tue, Aug 20, 2013 at 3:06 PM, Håvard Wahl Kongsgård

Håvard Wahl Kongsgård

unread,
Aug 20, 2013, 9:40:16 AM8/20/13
to leafl...@googlegroups.com
thanks, just my mistake used gwc instead of pure WMS
Reply all
Reply to author
Forward
0 new messages