get_map not passing the API key (HTTP status was '403 Forbidden')

后端 未结 4 861
别跟我提以往
别跟我提以往 2020-11-28 12:27

I have been facing this issue in the get_map() function (ggmap library) in R.

My code was running without the need to specify an API key

4条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-28 13:07

    Just to add to Roman Abashin's answer (I can't comment, unfortunately): As per '?get_map()', the 'api_key =' argument doesn't work for Google maps. You'll need to use the 'register_google()' function, but as of 03/10/18, it's only in the development version of ggmap, which you can get like so:

    devtools::install_github("dkahle/ggmap", ref = "tidyup")
    

    Then you'll also need to enable billing on your Google account, though the first 100,000 maps you use each month should be free, see here: https://cloud.google.com/maps-platform/pricing/sheet/ for details.

    (tips drawn from here: https://github.com/dkahle/ggmap/issues/51)

提交回复
热议问题