Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My base map was created using hard-coded template variables. I am using the leaflet tilelayer.wms constructor and including the url like so:

url: "http://localhost:8080/geoserver/sf/wmsservice=WMS&version=1.1.0&request=GetMap&layers=sf:archsites&styles=&bbox=589851.4376666048,4914490.882968263,608346.4603107043,4926501.8980334345&width=512&height=332&srs=EPSG:26713",

so I'm grabbing a wms layer from geoserver and I'm trying to make it display in my leaflet base map, but I don't think I have to actually go about creating a feature group. I think the url could possibly be simply:


but then that would mean I need to structure the layer property which I am also unsure how to do so correctly. I think essentially I want to satisfy the GetCapability, GetMap, and GetFeatureInfo requests using leaflet's API. And I think this is possible to do by utilizing only the layer group methods and the tilelayer methods. In addition I don't want to have to utilize onclick to retrieve the GetFeatureInfo because essentially I am adding in data programmatically.

I've seen examples utilizing the onClick eventlistener to do this, but I'd like it to be a toggle under the layer controls for visibility as it still is an overlay. So essentially I'd like to have a controls based listener as opposed to onclick.

share|improve this question

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.