Created
June 27, 2016 17:19
-
-
Save rwoloszyn/e894c3105842a541e659f327292af9ca to your computer and use it in GitHub Desktop.
Add checkbox as control in leaflet map
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
// 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"/>Automatic fit to bounds</form>'; | |
return div; | |
}; | |
autoZoomCheckbox.addTo(map); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment