knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
library(mapselector) library(tidyverse) library(sf) library(leaflet) library(rcartocolor) data("CERQ") # leaflet can make attractive colour palattes. interp_pal <- leaflet::colorFactor(rcartocolor::carto_pal(12,"Prism"), domain = CERQ$NOM_PROV_N) ## as a demo, make me a map leaflet(CERQ) %>% addTiles() %>% # Affichage du fond de carte addPolygons(color = "darkblue", # couleur des limites des polygones weight = 1, smoothFactor = 0.5, layerId = ~NOM_PROV_N, fillColor = ~interp_pal(NOM_PROV_N), # couleur du remplissage des polygones fillOpacity = 0.7, highlightOptions = highlightOptions(color = "white", weight = 4, # fillOpacity = 0., bringToFront = TRUE) )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.