I am trying to add a wms tile layer overlay over a wfs tile layer which I added to a map object. When I tried to simply add a layer on top of my current setView for my map object it overwrote the first layer's and all the GUI I added was gone. How do I add a wms tile layer overlay?

  • How did you add the new layer? Please post your code. – Devdatta Tengshe Nov 21 '12 at 3:05
  • I cannot accommodate all the code as it is multiple model/view files associated with a wfs base layer added to a map object. I thought that I could simply use the addLayer method on that map object. – Carl Carlson Nov 21 '12 at 14:09
  • Are you sure the problem is not in the way you have created the multiple model/views? To debug just try making a simple map on one html page with two WMS tiled services and see if it works. – Devdatta Tengshe Nov 21 '12 at 14:32

Have a look at the example on this page: http://leafletjs.com/examples/layers-control.html

It is definitely possible to add more than one tiled layer, like they have done. They are using L.TileLayer in this example, but you can use multiple L.TileLayer.WMS instead.

  • right I know that is possible, I've tried it. I'm just wondering if I add a wms layer to a map with a base map wfs layer I need to create another view file as my wfs map layer doesn't separate the modeling from the map object file. – Carl Carlson Nov 21 '12 at 16:20
  • 1
    Unless you post your MVC code, It will be very difficult to see what the problem is. – Devdatta Tengshe Nov 21 '12 at 16:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.