Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added oneshot callback (trigger, then stop) when location is found #343

Open
wants to merge 4 commits into
base: gh-pages
Choose a base branch
from

Conversation

valerino
Copy link

@valerino valerino commented Oct 3, 2023

No description provided.

src/L.Control.Locate.js Outdated Show resolved Hide resolved
src/L.Control.Locate.js Outdated Show resolved Hide resolved
src/L.Control.Locate.js Outdated Show resolved Hide resolved
src/L.Control.Locate.js Show resolved Hide resolved
@domoritz
Copy link
Owner

Thanks for the updates. Why is this functionality required to be inside the plugin rather than something controlled from the outside (by listening to location updates on the map and then calling stop on the plugin)?

@urb4nc4rl
Copy link

I'm not the OP but I also came here looking for this functionality.

In my case, I'm using React, and I'd like to have more fine-grained control over the panning/zoom when the user's location is found, panning to a viewRect which encompasses both their location and also a target marker for their destination.

Because leaflet-locatecontrol does not expose the native event, I'd need to add a second custom component inside <MapContainer> simply to hook into this event and pass it up to the parent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants