Last active
October 24, 2020 16:12
-
-
Save addiversitas/924df1e335f2db8cfb8c3414f894cb7f to your computer and use it in GitHub Desktop.
markers map
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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