Crear contenedor
# Crear contenedor
contenedor <- leaflet()
contenedor
Crear Mapa Base - Open Street Map
# Crear Mapa Base - Open Street Map
mapa_base <- leaflet() %>%
addTiles()
mapa_base
Lat - Lng - Marcador - Círculo
# Ubicación - Latitud - Longitud - Marcadores - Círculo
# Palacio Nacional de La República Dominicana 18.47474559888523, -69.89787861615132
palacio_nacional <- leaflet() %>%
addTiles() %>%
addMarkers(lat=18.47474559888523,lng=-69.89787861615132) %>%
addCircleMarkers(lat=18.47474559888523,lng=-69.89787861615132,color="orange",radius=40)
palacio_nacional
MiniMapa - Logo
# MiniMapa - Logo
# Palacio Nacional de La República Dominicana 18.47474559888523, -69.89787861615132
img <-"https://www.r-project.org/logo/Rlogo.svg"
palacio_nacional <- leaflet() %>%
addTiles() %>%
leafem::addLogo(img,url="https://cran.r-project.org/",position="topright",width=25,height=25) %>%
addMarkers(lat=18.47474559888523,lng=-69.89787861615132) %>%
addCircleMarkers(lat=18.47474559888523,lng=-69.89787861615132,color="orange",radius=40) %>%
addMiniMap(position="bottomleft",toggleDisplay=TRUE)
palacio_nacional
Múltiples Marcadores - Caso I
# Múltiples Marcadores
cent_hist <- data.frame(lugar=c("Iglesia Nuestra Señora de La Merced","Convento Regina Angelorum","Puerta de la Misericordia"),latitud=c(18.47416921486365,18.471116404923126,18.468775880481004), longitud=c(-69.88824745014279,-69.8871531089362,-69.89011426748678), color=c("orange","blue","purple"))
centro_historico <- leaflet(data=cent_hist) %>%
addTiles() %>%
addMarkers(lat=~latitud,lng=~longitud) %>%
addCircleMarkers(lat=~latitud,lng=~longitud,color=~color,radius=30) %>%
addMiniMap(position="bottomleft",toggleDisplay=TRUE)
centro_historico
Múltiples Marcadores - Caso II
puntos <- read.csv("F:/DISCO3/Documents/python_folium/puntos_dom.txt")
puntos_frame <- data.frame(puntos)
centro_historico <- leaflet(data=puntos_frame) %>%
addTiles() %>%
addMarkers(lat=~latitud,lng=~longitud) %>%
addCircleMarkers(lat=~latitud,lng=~longitud,color=~color,rad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