-
-
Notifications
You must be signed in to change notification settings - Fork 37
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
Programmatically update the location of a marker that already exists #21
Comments
lets say I've dragged a marker to position X and you want to move it programmatically to position Y or something (without dragging it?) |
Yeah I wasn't very clear but that's what I mean. In my case, I want the user to be able to type an address to update the location of a marker, so I just need some way of programmatically updating the position of a marker. |
Interestingly enough, prior to the last couple of changes, you could kind of do this (as dragMarkers point internally was the same, however, this caused a problem where if you called setState it would reset the marker, so it was changed so that initState set up the point internally (var markerPoint in the code), so it would be preserved across setState). However, that also conflicted with my line_editor plugin, which was kind of annoying, so I was initially wondering about having 2 options, 1) it preserves state (see line 79 It maybe depends a bit on whether one wants to not preserve state at all (what do you want to happen with a setState call), or just dynamically update it adhoc (but preserve state apart from that), or preserve it all the time. Not sure if that's clear as mud! |
Either would certainly work, but I think that the current behavior where it preserves state is actually pretty valuable; it was also what I assumed the behavior would be from the start. I could definitely see having an option that lets you switch between the two, although it would be unfortunate to have to lose the preservation of state if you want to be able to update it. I was thinking, maybe there could be an optional Key parameter for |
As far as I can tell, you can't update the position of a marker that already exists. Is this correct?
If so, I'll try to implement it in a good way and make a PR.
The text was updated successfully, but these errors were encountered: