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

I need to add additional overlay layers to be controlled by the controls within the leaflet map boundaries, but the code utilizes a leaflet-custom.js file. I am assuming it handles the event and triggers creating DOM elements for the overlay but I cannot verify as the custom file is a minified file so I don't know what configurations were made.

When I add my wms tile layers to the controls the wms tile layers do not display as a result of 403 errors with the Forbidden message, the urls are all modified, and the type changes from images/pngs/jpegs to text/html.

Therefore is there any way to programmatically add geolocation with with the events?

share|improve this question
up vote 0 down vote accepted

Your two problems seem like they might be unrelated. A 403 response is usually a permissions problem. Either the web server process doesn't have permissions access the resource, or the you are not providing the correct credentials upon request. Can you give details about your WMS server?

The addControl() method simply extends the L.Control class which only inherits a few positional methods and attributes. The rest is really up to you. You have to provide the controls, both graphically and programmatically, and script the listeners. Any event resulting from a user action needs to be handles by you whether that is calling a new layer or simply navigating to a new page.

The L.Control.Layer class provides a basic, but full handling of events. You simply need to give it an dictionary object with the layers that you want to present user controls and it will handle providing the controls and listening for user actions. Layer Example/Tutorial

I have noticed you can been struggling with this custom module for a while? Do you know why it was custom built? What are your goals? Could it not be easier to just start from scratch than fighting with a 'black-box' for hours?

Any any case if you think you need to use this custom module see this question about possible getting the module in human-readable format.

share|improve this answer
Its geoserver. And what is happening is the wamp server folder name in which my map is being hosted is being concatenated to the url which I am pulling from localhost in which geoserver is being hosted. As far as the controls graphically, the sort of layer checkbox was added because the map already had graphics that I could pull from. – Carl Carlson Nov 27 '12 at 21:51
As far as why it was custom built, not really its an internal project that I was assigned to take over and there wasn't much documentation provided. In any case my goal is to add wms tile layers on top of a wfs base map and have the ability to toggle the wms layers on/off. I don't think I can start from scratch considering much of the wfs base map code had already been written to render correctly and apparently the design was modular. – Carl Carlson Nov 27 '12 at 21:52
Hmm, I am afraid I haven't got much experience with Apache on Windows. But it is adding a directory that you are not requesting (ex. Request URI in your code: /gisdata/WMSRequest?blah=blah; but the actual request is /somefolder/gisdata/WMSRequest?blah=blah Is that right? And it is giving a 403, I would have thought that would have been a 404. – RomaH Nov 27 '12 at 22:53
yes, that is what is occurring. – Carl Carlson Nov 28 '12 at 14:05

Your Answer


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

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