leafletCN
leafletCN copied to clipboard
Is it available if only display regional map?
Is it available if only display regional map? i.e. I wanna show china map in the graph without showing any other countries.
Just don't use addTiles()
or amap()
in leaflet
library(leaflet)
library(leafletCN)
dat = data.frame(regionNames("china"),
runif(34))
map = leafletGeo("china", dat)
pal <- colorNumeric(
palette = "Blues",
domain = map$value)
leaflet(map) %>%
# addTiles() %>%
addPolygons(stroke = TRUE,
smoothFactor = 1,
fillOpacity = 0.7,
weight = 1,
color = ~pal(value),
popup = ~htmltools::htmlEscape(popup)
) %>%
addLegend("bottomright", pal = pal, values = ~value,
title = "legendTitle",
labFormat = leaflet::labelFormat(prefix = ""),
opacity = 1)