dkahle / dkahle/ggmap

qmplot not returning correct map type

Open
#281 13 comments 3 reactions 0 assignees View on GitHub
Dominant language
R
Stars
778
Forks
234
PR merge metrics
No merged PRs in 30d

Description

When using qmplot(), the `maptype` variable seems to be ignored. See the below example. `maptype` is set to `toner-lite` but it appears to be using `terrain` instead.

Probably unrelated, but for comparison, `ggmap(get_stamenmap())` seems to work fine.

```r
ggmap(get_stamenmap(c(left = -86.817417, bottom = 36.133247, right = -86.793141, top = 36.153650), zoom = 15, maptype = "toner-lines"))
```

Below is the example that gives an error. It should be `toner-lite` but it is downloading `terrain` instead. I tried `toner` as well, but it gave the same results.

``` r
library(ggmap)
#> Loading required package: ggplot2
#> Registered S3 methods overwritten by 'ggplot2':
#> method from
#> [.quosures rlang
#> c.quosures rlang
#> print.quosures rlang
#> Google's Terms of Service: https://cloud.google.com/maps-platform/terms/.
#> Please cite ggmap if you use it! See citation("ggmap") for details.
test <- data.frame('id' = c('0001','0002','0003'), 'latitude' = c(36.11768, 36.15525, 36.12812), 'longitude' = c(-86.72005, -86.73721, -86.77464))
qmplot(longitude, latitude, data = test, maptype = "toner-lite", color = I("red"))
#> Using zoom = 14...
#> Source : http://tile.stamen.com/terrain/14/4242/6424.png
#> Source : http://tile.stamen.com/terrain/14/4243/6424.png
#> Source : http://tile.stamen.com/terrain/14/4244/6424.png
#> Source : http://tile.stamen.com/terrain/14/4245/6424.png
#> Source : http://tile.stamen.com/terrain/14/4242/6425.png
#> Source : http://tile.stamen.com/terrain/14/4243/6425.png
#> Source : http://tile.stamen.com/terrain/14/4244/6425.png
#> Source : http://tile.stamen.com/terrain/14/4245/6425.png
#> Source : http://tile.stamen.com/terrain/14/4242/6426.png
#> Source : http://tile.stamen.com/terrain/14/4243/6426.png
#> Source : http://tile.stamen.com/terrain/14/4244/6426.png
#> Source : http://tile.stamen.com/terrain/14/4245/6426.png
#> Source : http://tile.stamen.com/terrain/14/4242/6427.png
#> Source : http://tile.stamen.com/terrain/14/4243/6427.png
#> Source : http://tile.stamen.com/terrain/14/4244/6427.png
#> Source : http://tile.stamen.com/terrain/14/4245/6427.png
```

![](https://i.imgur.com/jqWZIMz.png)

Created on 2019-05-01 by the [reprex package](https://reprex.tidyverse.org) (v0.2.1)

Session info

``` r
sessionInfo()
#> R version 3.6.0 (2019-04-26)
#> Platform: x86_64-w64-mingw32/x64 (64-bit)
#> Running under: Windows 10 x64 (build 17134)
#>
#> Matrix products: default
#>
#> locale:
#> [1] LC_COLLATE=English_United States.1252
#> [2] LC_CTYPE=English_United States.1252
#> [3] LC_MONETARY=English_United States.1252
#> [4] LC_NUMERIC=C
#> [5] LC_TIME=English_United States.1252
#>
#> attached base packages:
#> [1] stats graphics grDevices utils datasets methods base
#>
#> other attached packages:
#> [1] ggmap_3.0.0 ggplot2_3.1.1
#>
#> loaded via a namespace (and not attached):
#> [1] Rcpp_1.0.1 pillar_1.3.1 compiler_3.6.0
#> [4] plyr_1.8.4 highr_0.8 bitops_1.0-6
#> [7] tools_3.6.0 digest_0.6.18 evaluate_0.13
#> [10] tibble_2.1.1 gtable_0.3.0 pkgconfig_2.0.2
#> [13] png_0.1-7 rlang_0.3.4 curl_3.3
#> [16] yaml_2.2.0 xfun_0.6 xml2_1.2.0
#> [19] withr_2.1.2 dplyr_0.8.0.1 stringr_1.4.0
#> [22] httr_1.4.0 knitr_1.22 RgoogleMaps_1.4.3
#> [25] grid_3.6.0 tidyselect_0.2.5 glue_1.3.1
#> [28] R6_2.4.0 jpeg_0.1-8 rmarkdown_1.12
#> [31] tidyr_0.8.3 purrr_0.3.2 magrittr_1.5
#> [34] scales_1.0.0 htmltools_0.3.6 assertthat_0.2.1
#> [37] mime_0.6 colorspace_1.4-1 labeling_0.3
#> [40] stringi_1.4.3 lazyeval_0.2.2 munsell_0.5.0
#> [43] rjson_0.2.20 crayon_1.3.4
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.