library(leaflet)
library(sf)
library(ggplot2)
library(leafsync)
ggplot(estados)+
  geom_sf()

leaflet(estados) %>%
  addPolygons(color = "darkblue", weight = 2, smoothFactor = 0.5, opacity = 0.4, fillOpacity = 0.4, fillColor = "red", highlightOptions = highlightOptions(color = "yellow", weight = 4,
      bringToFront = TRUE), label = estados$NOMGEO, labelOptions = labelOptions(noHide = F, direction = "bottom",
      style = list(
        "color" = "black",
        "font-family" = "serif",
        "font-style" = "italic",
        "box-shadow" = "3px 3px rgba(0,0,0,0.25)",
        "font-size" = "15px",
        "border-color" = "rgba(0,0,0,0.5)")))%>%
   addTiles()
m1 = leaflet(estados) %>%
addTiles() %>%
addPolygons(color = "darkred", weight = 1, smoothFactor = 0.5, opacity = 0.4, fillOpacity = 0.4, fillColor = "red", highlightOptions = highlightOptions(color = "yellow", weight = 2,
      bringToFront = TRUE), label = estados$NOMGEO, labelOptions = labelOptions(noHide = F, direction = "bottom",
      style = list(
        "color" = "black",
        "font-family" = "serif",
        "font-style" = "italic",
        "box-shadow" = "3px 3px rgba(0,0,0,0.25)",
        "font-size" = "15px",
        "border-color" = "rgba(0,0,0,0.5)")))

m2 = leaflet(estados) %>%
addTiles() %>%
addPolygons(color = "darkblue", weight = 1, smoothFactor = 0.5, opacity = 0.4, fillOpacity = 0.4, fillColor = "blue")
#sync(m1, m2)
#sync(m1, m2, no.initial.sync = TRUE)