我正在尝试使用 ggmap 从谷歌地图调用地图。示例代码:
get_googlemap(center = c(lon = -56.67, lat = 51.47), zoom = 8, size = c(640, 640), scale = 2,
format = "png8", maptype = "satellite")
Run Code Online (Sandbox Code Playgroud)
但是,这会返回以下错误:
来源:https : //maps.googleapis.com/maps/api/staticmap?center= 24.8,-81.7 &zoom=8&size=640x640&scale=4&maptype=satellite& key=(已删除发布键)
Error in aperm.default(map, c(2, 1, 3)) :
invalid first argument, must be an array
In addition: Warning message:
In get_googlemap(center = c(lon = -81.7, lat = 24.8), zoom = 8, :
HTTP 400 Bad Request
Run Code Online (Sandbox Code Playgroud)
我查看了人们遇到类似问题的线程。在对 API 密钥和限制进行一些摆弄之后,它们似乎得到了解决。在这种情况下,我做了以下事情: