Created
June 27, 2016 17:30
-
-
Save rwoloszyn/5e755eff47085f101c8c0ec97d8755cd to your computer and use it in GitHub Desktop.
Place control in top of ZoomControl in Leaflet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
map.zoomControl.removeFrom(map); | |
// create the control | |
var autoZoomCheckbox = L.control({position: 'topleft'}); | |
autoZoomCheckbox.onAdd = function (map) { | |
var div = L.DomUtil.create('div', 'command'); | |
div.innerHTML = '<form><input id="command" type="checkbox"/>Auto fit bounds</form>'; | |
return div; | |
}; | |
autoZoomCheckbox.addTo(map); | |
map.zoomControl.addTo(map); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment