Skip to content

Instantly share code, notes, and snippets.

@sshopov
Created March 12, 2014 05:09
Show Gist options
  • Save sshopov/9501216 to your computer and use it in GitHub Desktop.
Save sshopov/9501216 to your computer and use it in GitHub Desktop.
Adds a locate me button between the + and - zoom buttons. When clicked it zooms to the user's current location. Requires jquery, leaflet and font awesome CSS http://fortawesome.github.io/Font-Awesome/icons
$('.leaflet-control-zoom-in').after('<a onclick="map.locate({setView:true, zoomLevel:18})" href="#"><i class="fa fa-male"></i></a>');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment