3

I have a MapBox.js map with several layers here . I would like to be able to use TileMill's teaser and full interactivity on a few of the layers, but I have only been able to accomplish this for a single layer. How can I have interactivty for multiple layers in this map? The code for the map is here. I saw an example from MapBox.js but I don't know exactly how to implement it into my HTML code.

2
+50

I see you have enabled interactivity on your map by the line:

map.gridControl.options.follow = true;

...but have not used any grid layers at all.

Include the following lines below all declarations:

var gridlayer1 = L.mapbox.gridLayer('slugis.ii9na2o6').addTo(map);
map.addControl(L.mapbox.gridControl(gridlayer1));

I had the same problem where my clicks wouldn't open the desired pop-ups and I solved this way.

  • Thank you that is exactly what I was looking for! The bounty is yours! – cbunn Jul 11 '14 at 17:54

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.