Description Usage Arguments Examples
Simple function like addTiles()
1 2 3 4 |
dat |
a data.frame contain regions and values |
mapName |
mapName for loading, eg. 'china', 'city', ... |
namevar |
show which feature is chosen for name variable |
valuevar |
show which featue is chosen for value variable |
palette |
The colors or color function that values will be mapped to, see RColorBrewer::display.brewer.all() |
colorMethod |
set one of the coloe mapping in c("numeric", "bin", "quantile", "Factor") |
na.color |
The color to return for NA values. Note that na.color=NA is valid. |
popup |
a character vector of the HTML content for the popups (you are recommended to escape the text using htmlEscape() for security reasons) |
stroke |
whether to draw stroke along the path (e.g. the borders of polygons or circles) |
smoothFactor |
how much to simplify the polyline on each zoom level (more means better performance and less accurate representation) |
weight |
stroke width in pixels |
fillOpacity |
fill opacity |
legendTitle |
legend title |
tileType |
function to define tile like amap or leaflet::addTiles |
... |
other paramter pass to the color mapping function |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | dat = data.frame(name = regionNames("china"),
value = runif(34))
geojsonMap(dat,"china")
dat$value2 = cut(dat$value, c(0, 0.25, 0.5, 1))
geojsonMap(dat,"china",
namevar = ~name,
valuevar = ~value2,
palette="Reds",
colorMethod="factor")
geojsonMap(dat,"china",
namevar = ~name,
valuevar = ~value2,
palette = topo.colors(3),
colorMethod="factor")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.