Closed ajhodges closed 11 years ago
Good point! I've added a zoomControl option. It is difficult to find a non-default zoom control in Leaflet, and no events are currently emitted when controls are added, so this might be the best we can do for now.
I've added an example of how to use this, too. Let me know if it works out.
Works great! Thank you. Nice work.
Hey, I like the idea of putting the loading indicator in the zoom control. The issue that I am having is that because I want my zoom control positioned in the top right corner, I have to set zoomControl=false; in the map initialization, and then add the control later.
i.e.
This breaks your code since you are checking map.zoomControl, which doesn't reflect whether the zoomControl has been added or not, just if it was initialized.
Also, your code requires the zoomControl to be added to the map prior to the Loading control... this might be something to note in the readme. Or is there some way you could have the Loading control hook in to leaflet so it can tell when a zoom control is added? I don't know much about the internal workings of leaflet.