Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I'm using Mapbox, which is based on Leaflet.js to generate my maps. I'm trying to add a layer group to my map. But every time I call .addTo(map), I get

Uncaught TypeError: Object [object Object] has no method 'on' 

My code is as follows:

map = L.mapbox.map("map", "dannyvaughton.map-lmwtrr8k").setView([54.4, 0.43], 14)
markers = new L.LayerGroup().addTo(map)

Thanks.

share|improve this question

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.