绘制香港地图

时间:2018-04-05 14:26:25

标签: r ggplot2 ggmap

我想使用R绘制香港底图的地图,但失败了。下面是代码,错误R返回:

library(ggmap)
library(ggplot2)

map <- get_map(location = "Hong Kong", zoom = 10, scale = 2, maptype = "roadmap", 
               source = "google", force = ifelse(source == "google", TRUE, TRUE), 
               messaging = FALSE, urlonly = FALSE, filename = "ggmapTemp", 
               crop = TRUE, color = "color", language = "en-EN", api_key)
  

data.frame中的错误(ll.lat = ll [1],ll.lon = ll [2],ur.lat = ur [1],ur.lon = ur [2]):参数意味着数字不同行:0,1另外:警告消息:地理编码失败,状态为OVER_QUERY_LIMIT,location =&#34;香港&#34;

以上编码适用于台湾,中国和国家,不知道为何香港失败。

1 个答案:

答案 0 :(得分:1)

截至2018年10月,getmap()仅适用于已注册并激活计费功能的Google Maps API密钥以及经度/纬度坐标。

在此处查看more info and a step-by-step tutorial