您好,我对R中的Leaflet库有疑问。Leaflet中的Map是一张很长的水平纸,可以反复看到世界。问题是,当我在澳大利亚附近标记东西时,尽管我们在澳大利亚的地图(下图)上可以看到3次,但它仅在一个地方标记了它。可以重复制作此地图,例如当我在地图上标记波兰时,波兰会在出现的任何地方被标记吗?
下面的代码(来自图书馆网页的示例):
leaflet() %>% addTiles() %>%
addMarkers(data=quakes, clusterOptions = markerClusterOptions(), clusterId = "quakesCluster") %>%
addEasyButton(
easyButton(
states = list(
easyButtonState(
stateName="unfrozen-markers",
icon="ion-toggle",
title="Freeze Clusters",
onClick = JS("
function(btn, map) {
var clusterManager =
map.layerManager.getLayer('cluster', 'quakesCluster');
clusterManager.freezeAtZoom();
btn.state('frozen-markers');
}")
),
easyButtonState(
stateName="frozen-markers",
icon="ion-toggle-filled",
title="UnFreeze Clusters",
onClick = JS("
function(btn, map) {
var clusterManager =
map.layerManager.getLayer('cluster', 'quakesCluster');
clusterManager.unfreeze();
btn.state('unfrozen-markers');
}")
)
)
)
)