dkahle / ggmap

A package for plotting maps in R with ggplot2
766 stars 231 forks source link

Lines not commented out in CRAN #292

Open 13am opened 4 years ago

13am commented 4 years ago

https://github.com/dkahle/ggmap/blob/37a86724bcf651ec0ef4be72db46d3ac2a03963a/R/get_map.R#L164

This line is not commented out in the CRAN package version, so user's get the "terrain" maptype regardless of what they asked for.

13am commented 4 years ago

Hmm weird, tried to reproduce this myself and for whatever reason, I now have a different version of the code. Can't really explain what happened, maybe something to do with importing libraries in different order?

13am commented 4 years ago

Got ggmap version 3.0.0 fresh from CRAN, and can now replicate the issue. In get_map, the lines 71 to 81 are

    if (is.numeric(location) && length(location) == 4) {
        location_type <- "bbox"
        location_stop <- FALSE
        source <- "stamen"
        maptype <- "terrain"

which prevents the user from getting anything but the "terrain" maptype from stamen.