2
我在尋找修復重疊標籤時使用R功能leaflet :: addMarkers。單張標籤重疊修復 - 宣傳單:: addMarkers
long <- c(147.768, 147.768, 147.768,147.768, 147.768, 147.768)
lat <- c(-36.852, -36.852, -36.852,-36.852, -36.852, -36.852)
label <- c('long label1', 'long label2', 'long label3','long label4', 'long label5', 'long label6')
markers <- data.frame(lat,long,label)
leaflet() %>%
addTiles() %>% # Add default OpenStreetMap map tiles
addMarkers(lng=markers$long, lat= markers$lat,
popup="The birthplace of R",
label = markers$label,
labelOptions = labelOptions(noHide = T, direction = 'auto'),
clusterOptions = markerClusterOptions()
)
我覺得OP(和我)正在尋找的東西,如果他們碰巧重疊自動移動的標籤,類似於'ggrepel'(請參見http://博客。 revolutionanalytics.com/2016/01/avoid-overlapping-labels-in-ggplot2-charts.html) – JanLauGe