Closed tomroh closed 3 years ago
numPal <- colorNumeric('viridis', quakes$depth) symbols <- makeSizeIcons( values = exp(quakes$mag), shape = 'plus', color = 'black', baseSize = 10, fillColor = numPal(quakes$depth), opacity = .5 ) leaflet() %>% addTiles() %>% addMarkers(data = quakes, icon = icons(iconUrl = symbols), lat = ~lat, lng = ~long) %>% addLegendSize( values = quakes$mag, baseSize = 10, color = 'black', fillColor = 'black', title = 'Magnitude', shape = 'plus', orientation = 'horizontal', opacity = .5, fillOpacity = .3, breaks = 5) %>% addLegendNumeric(pal = numPal, values = quakes$depth, title = 'Depth')
Use colorValues argument with a palette function.
d1ee8082c99925970e9156608c0690f01130e213