Mapa

Row

Viajes de Jared

Row

Descripción del mapa

Sitios a los que me gustaría viajar.

Row

Referencias

  1. Google maps
---
title: "Lugares a donde me gustaría viajar"
author: "Vázquez Ocampo Jared Arfaxad"
output: 
  flexdashboard::flex_dashboard:
    orientation: rows
    vertical_layout: scroll
    fig_mobile: TRUE
    theme: cosmo
    social: menu
    source_code: embed
    navbar:
      - {title: "Crea tu propio mapa", href: "https://rstudio.cloud/project/2897129", align: right, icon: fa-map-marker}
      - {title: "INAE V, Economía UNAM", href: "http://www.economia.unam.mx/", align: right, icon: fa-school}
---

```{r global, include=FALSE}
library(leaflet)
library(leaflet.extras)
```

Mapa {data-icon="fa-map"}
=====================================

Row
-----------------------------------------------------------------------

### Viajes de Jared

```{r}
### Registramos la información de los lugares
lugar1 <- c(Nombre = "Observatorio de Ensenada", Giro = "Turístico", longitud = -115.8, latitud = 30.21)
lugar2 <- c(Nombre = "Cerro de la silla", Giro = "Turístico", longitud = -100.2, latitud = 25.6)
lugar3 <- c(Nombre = "Playas las Coloradas", Giro = "Turístico", longitud = -87.99, latitud = 21.608)
lugar4 <- c(Nombre = "Montealbán", Giro = "Turístico", longitud = -96.77, latitud = 17.0456)
lugar5 <- c(Nombre = "Yaxchilán", Giro = "Turístico", longitud = -90.9681, latitud = 16.8989)
lugar6 <- c(Nombre = "Teotihuacán", Giro = "Turístico", longitud = -98.8471, latitud = 19.6821)

### Creamos una tabla de datos con la información de los lugares
lugares <- data.frame(rbind(lugar1, lugar2, lugar3, lugar4, lugar5, lugar6))

### Nos aseguramos de que la latitud y longitud sean números
lugares$longitud <- as.numeric(lugares$longitud)
lugares$latitud <- as.numeric(lugares$latitud)

### Creamos el mapa
mapa <- leaflet(lugares) %>% setView(lng = -99.3, lat = 19.4, zoom = 5) %>% addTiles() %>% addMarkers(~longitud, ~latitud, popup = paste(sep = "
", "Nombre:", lugares$Nombre, "Giro:", lugares$Giro)) ### Agregamos el botón de reset y la barra de herramientas de dibujo al mapa mapa %>% addResetMapButton() %>% addDrawToolbar(editOptions = editToolbarOptions(selectedPathOptions = selectedPathOptions())) ### Imprimimos el mapa mapa ``` Row ----------------------------------------------------------------------- ### Descripción del mapa Sitios a los que me gustaría viajar. Row ----------------------------------------------------------------------- ### Referencias 1. Google maps