Leaflet initial view helper
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
//Logs current map center and zoom level for use in map init options | |
//Use it to find that perfect intial view without having to use trial and error | |
map.on('dragend',getInit).on('zoomend',getInit); | |
function getInit() { | |
var c = map.getCenter(); | |
console.log('center: [' + c.lat + ',' + c.lng + '],\nzoom: ' + map.getZoom()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment