API_console_key error for GetMap.bbox

Good morning,
I have an error message while using the function "GetMap.bbox".
I want to specify my API key using "API_console_key" (see below) but there is this error message :

map <- GetMap.bbox(c(min_long, max_long),c(min_lat, max_lat), destfile = "test2.png", maptype="satellite", API_console_key = Sys.getenv("AIzaSyCt1Wxxxxxxxxx"))
PlotOnStaticMap(map)

error message :
[1] "API key provided"
Error in download.file(urlStr, destfile, mode = "wb", quiet = TRUE) : **
** impossible d'ouvrir l'URL 'https://maps.googleapis.com/maps/api/staticmap?center=43.47227765,-1.00097345&zoom=15&size=640x640&maptype=satellite&format=png32&sensor=true&key='

De plus : Warning message:
In download.file(urlStr, destfile, mode = "wb", quiet = TRUE) :
** cannot open URL 'https://maps.googleapis.com/maps/api/staticmap?center=43.47227765,-1.00097345&zoom=15&size=640x640&maptype=satellite&format=png32&sensor=true&key=': HTTP status was '403 Forbidden'**

Can you help me please ?. Thank you very much and have a nice day.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.