getsmap / smap-responsive

A JavaScript framework for simple creation of web maps with responsive design supporting a range of different browsers and devices
GNU General Public License v3.0
14 stars 12 forks source link

External style reference? #226

Open jakelund opened 8 years ago

jakelund commented 8 years ago

Is it possible to add an external style reference (.sld file) in options for init: "L.TileLayer.WMS"?

johanlahti commented 8 years ago

I haven't tried it myself, but isn't it possible to use this option: http://leafletjs.com/reference.html#tilelayer-wms-styles? If possible, then you can just add it as an option to the L.TileLayer.WMS in the smap-responsive config file. If not, we have to implement this by adding the parameter to the URL ourselves before the request happens.

johanlahti commented 8 years ago

It should be possible to use the option sld: "http://link-to-my-sld/style.sld" or sld_body: "<xml… />"

Please share your tips/issues if you find out something more about it.

jakelund commented 8 years ago

Seems anything i define with "styles" or "sld" doesn't get included in the wms request. Seems some tweaking to the request is necessary.

johanlahti commented 8 years ago

I didn't notice I was trying this out using our custom layer implemention L.NonTiledLayer.WMS were it works (at least the request works correctly). I have just now committed a change to include sld and sld_body if provided in the options of L.TileLayer.WMS also. Please update your code and try again.