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

editFeatures of only one point zooms in to zoom level 100 #35

Closed
tim-salabim opened this issue Jun 20, 2017 · 5 comments
Closed

editFeatures of only one point zooms in to zoom level 100 #35

tim-salabim opened this issue Jun 20, 2017 · 5 comments

Comments

@tim-salabim
Copy link
Member

editFeatures(breweries[1, ]) will zoom in to a zoom level of 100 in the initial view. This is, I assume, because zoom level 100 is the maxZoom defined in mapview (to enable scrolling past the default zoom of 18/19 to investigate whether a line may actually be a polygon - useful for sliver polygons). I think we need to use leaflet's default expandLimits (or similar) to initiate the view.

@tim-salabim
Copy link
Member Author

On further investigation I think this stems from these lines. We could leverage mapview:::createExtent (which is also used for setting the view of the homebutton. Thought this function could be enhanced a little as it zooms out too far at the moment for one point only. I will investigae in mapview....

@timelyportfolio
Copy link
Contributor

Happy to work on this. Just let me know.

@tim-salabim
Copy link
Member Author

If you could that would be great.
I think this is two-fold. mapview:::createExtent is a mapview function that mostly behaves like the default leaflet initial view but ever so often (e.g. for single points) doesn't. If we could get this behaving similar to how leaflet determines the initial view for features that would be very beneficial for both mapview and mapedit.
Note though, that there are instances in mapview where we need createExtent to mimic exactly st_bbox or raster::extent, i.e. in viewExtent

@tim-salabim
Copy link
Member Author

this should be fixed via 9f35a9e

@timelyportfolio
Copy link
Contributor

Thanks!!!! Verified working on my end.

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