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

后端 未结 4 831
别跟我提以往
别跟我提以往 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 12:44

    I don't know the direct resolution to the ggmap issue, but if you're happy to work with an interactive map rather than a static one you can use my googelway library

    library(googleway)
    
    set_key("GOOGLE_MAP_KEY")
    
    lat <- c(4,41) #India lat boundaries
    lon <- c(68,99) #India long boundaries
    center = c(mean(lat), mean(lon))
    
    google_map(location = center, zoom = 6)
    

提交回复
热议问题