datadiversitylab / BarrioMap

https://viz.datascience.arizona.edu/barriomap/
MIT License
0 stars 1 forks source link

Review zoom snap functionality in leaflet #16

Closed cromanpa94 closed 1 year ago

cromanpa94 commented 1 year ago

It seems some of the zoom levels will be non-integers. I'd recommend reviewing the documentation in this link and considering implementing some of the functions discussed therein directly in the app: https://leafletjs.com/examples/zoom-levels/

cromanpa94 commented 1 year ago

For instance, we will have to adjust the zoomSnap and scales arguments for the map to be at a particular scale given the pixels, page size, etc.

leafletOptions(zoomControl = FALSE, 
                                 zoomSnap = 0.01,
                                 crs = leafletCRS(
                                    scales = 1
                                  )
                                 )
cromanpa94 commented 1 year ago

An initial implementation can be reviewed in this commit: https://github.com/cromanpa94/OSM.sf.shiny/commit/88621ebe42dda05cbca43a0024da23f692a9cfb7. Note that this implementation follows the information in this website https://leafletjs.com/examples/zoom-levels/ AND the equations in the following one: https://wiki.openstreetmap.org/wiki/Zoom_levels.

cromanpa94 commented 1 year ago

@rog-SARTHAK please check why the map lags so much when you change the zoom level or moves the map to another location.

cromanpa94 commented 1 year ago

@rog-SARTHAK suggested adding a reaction (button).

rog-SARTHAK commented 1 year ago

Added reactive value coordinates to server and button in UI to set coordinates in commit 8b3f7cb

This will prevent latitude longitude fields to glitch when user is manually entering values

NOTE: We now have to reopen ticket #11 "Fix the starting coordinates"