Closed tim-salabim closed 7 years ago
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....
Happy to work on this. Just let me know.
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
this should be fixed via 9f35a9ebf76d2064fd90ae62578a096a8359f723
Thanks!!!! Verified working on my end.
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 defaultexpandLimits
(or similar) to initiate the view.