domoritz/leaflet-locatecontrol — pull request #71 by thirstyfish (2014-06-12 05:14:15+00:00)
Title: New remainActive option and new onClick hook.

I've added two new options that might be useful to others as well:

Option | Type | Description
:--- | :--- | :---
`remainActive` | *boolean* | Should the locate control remain active on click even if the user's location is in view
`onClick` | *function* | Event hook, called when the user clicks on the locate control

My use case that I needed this functionality for is the following:

I want users to be able to locate themselves on the map,and also be able to adjust the position of the marker (but not the circle) after they have been located. If the locate control button is clicked again, it moves the marker back to its' original position (hence the `onClick` hook) and does not deactivate the control even if it's in view (hence the `remainActive` option).

This use case is illustrated in this jsfiddle, where I linked in my fork of the leaflet-locatecontrol:
http://jsfiddle.net/LhGEW/

Cheers