osmtile 中的 openmap NullPointerException 错误无法获取图块

openmap NullPointerException Error in osmtile could not obtain tile

我正在尝试绘制地图的一个小矩形:

library(OpenStreetMap)

upper_left  <- c(47.413, 8.551);
lower_right <- c(47.417, 8.556);

map_osm  <- openmap(upper_left, lower_right, type = 'osm' );
plot(map_osm );

当我 运行 那个时,openmap 函数给我错误 osmtile(x%%nX, y, zoom, type) 错误:无法获取图块: 540 298 10.

OpenStreetMap 的文档似乎表明我需要添加一个 API 密钥。但是,我不确定我会怎么做(因为我使用 type='osm',而不是 type = url),而且我也不清楚我从哪里得到这样的 API 密钥。

java.lang.NullPointerException 和后面的 R-error (Error in osmtile(...)) 似乎来自旧版本的 OpenStreetMap

通过将OpenStreetMap更新到最新版本(当前为0.3.4),错误消失,OP的示例代码应该可以正常工作,而不需要API 键。