Last active
March 17, 2021 01:59
-
-
Save codigoconjuan/85944ed9b79082b4c77bb08229934432 to your computer and use it in GitHub Desktop.
Crear Mapa Leaflet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.addEventListener('DOMContentLoaded', () => { | |
const lat = 20.666332695977; | |
const lng = -103.392177745699; | |
const mapa = L.map('mapa').setView([lat, lng], 16); | |
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { | |
attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors' | |
}).addTo(mapa); | |
let marker; | |
// agregar el pin | |
marker = new L.marker([lat, lng]).addTo(mapa); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment