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

get_map not returning satellite map when location specified as extents #287

Open
Stirling-Soil opened this issue Sep 4, 2019 · 4 comments

Comments

@Stirling-Soil
Copy link

I can get get_map to return a satellite map when specifying the maps location by a centroid i.e. location = c(Longitude, Latitude) , however, when I specify the location as a bounding box (i.e. location = c(left, bottom, right,top), it returns a terrain image not a satellite. In both examples I have specified maptype = "satellite". Is someone able to please shed some light on this issue?

@dpprdan
Copy link

dpprdan commented Sep 5, 2019

It is not exactly clear to me, what you are trying to do and how you are doing it. Please note however that Google Map uses a center/zoom specification, which may be the reason why the satellite images are not shown when you specify a bbox.

If this does not solve your issue, yet, please include a minimal reproducible example (AKA a reprex). If you've never heard of a reprex before, start by reading https://www.tidyverse.org/help/#reprex.

@bbolker
Copy link

bbolker commented Nov 28, 2019

As I comment in my answer to this StackOverflow question, which essentially raises the same issue, there is some (to me) odd code in get_map() that automatically and silently sets source to "stamen" and map_type to "terrain" if the location is specified as a bounding box ...

@bbolker
Copy link

bbolker commented Nov 28, 2019

PS this seems to be fixed in the development version: https://github.com/dkahle/ggmap/blob/master/R/get_map.R#L160-L164 . It was changed in 12d4678 (12 Feb 2019, just after the current CRAN version was released [5 Feb 2019])

@pconwell
Copy link

pconwell commented Jan 2, 2020

@bbolker maybe I'm overlooking something simple, but installing the version from github (devtools::install_github("dkahle/ggmap")) does not seem to fix the issue. I checked to make sure I'm installing from master, and that master has commit 12d4678 included.

So, like I said, unless I'm overlooking something, the dev version does not appear to fix this?

EDIT: Yes, I was overlooking something stupid. I forgot to reload the library after installing from github. Do'h! You appear to be correct that the error was added in 771a71b and fixed in 12d4678, but has not been updated on CRAN yet.

Anyone who stumbles across this in the future, you need to uninstall your ggmap from CRAN and install the ggmap from github:

remove.packages("ggmap")
devtools::install_github("dkahle/ggmap")

And remember to reload the library after you reinstall it!

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

4 participants