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

Clear Markers retains view #251

Open
dcooley opened this issue May 24, 2022 · 2 comments
Open

Clear Markers retains view #251

dcooley opened this issue May 24, 2022 · 2 comments

Comments

@dcooley
Copy link
Collaborator

dcooley commented May 24, 2022

For me, the first marker (let's say a house in Massachusetts) I add, the map will zoom to it, then I clear markers, then I add a second marker (let's say a house in California), the map will not zoom to that house, but will be on a zoom and extent that shows the first marker and the second (even though the markers were cleared). The map seems to remember the markers even if they are cleared

Originally posted by @kaheil in #130 (comment)


The underlying issue is, the clear_() methods should also remove / update the bounds to only the currently visible layers.

@dcooley
Copy link
Collaborator Author

dcooley commented May 24, 2022

@kaheil the immediate solution I think is to set add_markers(, ... , focus_layer = TRUE). Using focus_layer will re-center the map to only what's included in the data for this layer.

@kaheil
Copy link

kaheil commented May 25, 2022

@kaheil the immediate solution I think is to set add_markers(, ... , focus_layer = TRUE). Using focus_layer will re-center the map to only what's included in the data for this layer.

this fixed the issue! thanks so much!

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

No branches or pull requests

2 participants