MCPcopy Create free account
hub / github.com/Open-Bootcamp/JavaScript-Basico / initMap

Function initMap

sesion-17-maps/index.js:3–23  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1let marker, map;
2
3function initMap() {
4 // console.log("Inicializando mapa")
5 const posicion = {
6 lat: -25.363,
7 lng: 131.044
8 }
9
10 map = new google.maps.Map(document.getElementById("map"), {
11 zoom: 4,
12 center: posicion
13 })
14
15 marker = new google.maps.Marker({
16 position: posicion,
17 map,
18 title: "Posición Inicial"
19 })
20 // Obtener la geolocalización
21 // marker.setPosition({ lat, lng })
22 geoPosiciona()
23}
24
25function geoPosiciona() {
26 if (navigator.geolocation) {

Callers

nothing calls this directly

Calls 1

geoPosicionaFunction · 0.85

Tested by

no test coverage detected