I'm trying to add a button above my map that would show the current location of the user.
Basically i want to duplicate the functionality of the built in button but make a more obvious one.
Here's my code:
<script>
var map = L.mapbox.map('map', 'plisvb.hopljoko');
L.control.locate({
drawCircle: true, // controls whether a circle is drawn that shows the uncertainty about the location
setView: true, // automatically sets the map view to the user's location, enabled if `follow` is true
keepCurrentZoomLevel: false, // keep the current map zoom level when displaying the user's location. (if `false`, use maxZoom)
icon: 'icon-location', // `icon-locate` or `icon-direction`
iconLoading: 'icon-spinner animate-spin', // class for loading icon
circlePadding: [0, 0], // padding around accuracy circle, value is passed to setBounds
locateOptions: {
maxZoom: 15
},
strings: {
title: "Click to see your current location", // title of the locate control
popup: "Your current location", // text to appear if user clicks on circle
outsideMapBoundsMsg: "You seem located outside the boundaries of the map" // default message for onLocationOutsideMapBounds
}
}).addTo(map);
map.scrollWheelZoom.disable();
</script>
any ideas?