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

Wrong computation of zoom level (when location is bbox and zoom is 'auto') #93

Open
lalstef opened this issue May 3, 2016 · 1 comment
Labels

Comments

@lalstef
Copy link

lalstef commented May 3, 2016

Long story short

Briefly, this line https://github.com/dkahle/ggmap/blob/master/R/get_map.R#L178, should read

zoom <- min(zoomlon, zoomlat)

instead of

zoom <- max(zoomlon, zoomlat)

Problem

I'm plotting trips on Google Maps as base map. Trips' bboxes are sometimes 'squares' and sometimes 'rectangles'. When they are 'squares' most of the time, zoomlon = zoomlat and the whole trip is plotted.
But when they are 'rectangles', sometimes zoomlon != zoomlat. For the trip to be fully plotted, and not cropped, the min zoom needs to be taken, not the max zoom.

I took that part of code that computes the zoom, changed the line to min(zoomlon, zoomlat) and fed the computed zoom to get_map() and that solved my issue.

@metanoid
Copy link

metanoid commented Jan 8, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants