Skip to content

Instantly share code, notes, and snippets.

@addiversitas
Last active October 24, 2020 16:12
Show Gist options
  • Save addiversitas/924df1e335f2db8cfb8c3414f894cb7f to your computer and use it in GitHub Desktop.
Save addiversitas/924df1e335f2db8cfb8c3414f894cb7f to your computer and use it in GitHub Desktop.
markers map
#create map with circle markers
leaflet(world_spdf) %>%
addTiles() %>%
setView(lat = 0, lng = 0, zoom=2) %>%
addCircleMarkers(lng = ~LON,
lat = ~LAT,
radius = ~log(Cases) * 2,
weight = 1,
opacity = 1,
color = ~ifelse(Cases > 0, "black", "transparent"),
fillColor = ~ifelse(Cases > 0, colorPalette(Cases), "transparent"),
fillOpacity = 0.8,
label = ~lapply(LabelText, htmltools::HTML)) %>%
addLegend(pal = colorPalette, values = covidData$Cumulative_cases, opacity=0.9, title = "Cases", position = "bottomleft")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment