我通常使用ggmap
在简单的城市地图上绘制点。今天我遇到了一个新错误,禁止我使用函数get_map()
。
#get API key @ https://developers.google.com/places/web-service/get-api-key
key<-"AIzaSyCYgKKt2fn7Crt-V6Hnc5aw5lSfy7XLQ-Y"
register_google(key = key)
atw<- get_map(location=c(-88.68,42.14), zoom=10, scale=2)
我不确定问题出在哪里。我尝试了一个新的API密钥,但没有成功。有任何建议吗?
错误信息如下:
无法打开网址'https://maps.googleapis.com/maps/api/staticmap?center=42.14,-88.68&zoom=10&size=640x640&scale=2&maptype=terrain&language=en-EN&key=AIzaSyCYgKKt2fn7Crt-V6Hnc5aw5lSfy7XLQ-Y':HTTP状态为'403 Forbidden'。在download.file(url, destfile = destfile, quiet = !messaging, mode = "wb")中出现错误:无法打开URL 'https://maps.googleapis.com/maps/api/staticmap?center=42.14,-88.68&zoom=10&size=640x640&scale=2&maptype=terrain&language=en-EN&key=AIzaSyCYgKKt2fn7Crt-V6Hnc5aw5lSfy7XLQ-Y'