TECNOLOBO

No recuerdas tu codigo?
Se te olvido como se hace?

Aqui podras guardar lo que necesiten
Y cuando sea necesesario

Creado por julian gomez
iiiiii

Mapa google maps



Descripcion

Poner un mapa de gogole en tu web con la ubicación

javascript


<!DOCTYPE html>
<html>
  <head>
    <title>Simple Map</title>
    <meta name="viewport" content="initial-scale=1.0">
    <meta charset="utf-8">
    <style>
      /* Always set the map height explicitly to define the size of the div
       * element that contains the map. */
      #map {
        height: 100%;
      }
      /* Optional: Makes the sample page fill the window. */
      html, body {
        height: 100%;
        margin: 0;
        padding: 0;
      }
    </style>
  </head>
  <body>
    <div id="map" style="width: 200px; height: 200px"></div>
    <script>
      var map;
      var punto = {lat: 3.415164, lng: -76.496336};
      function initMap() {
        map = new google.maps.Map(document.getElementById('map'), {
          center: punto,
          zoom: 18,
        });

        var marker = new google.maps.Marker({map: map, position: punto});

      }


      //la funcion initMap se ejecuta automatiamente por un callback que llama la api de map en la url. para utilizar otr
      // es necesario eliminar el llamado en su url 

      // para crear un punto de marca en el mapa se utilizar marker de google maps pasandole las cordenadas

      // el div con el id map deve ya tener un tamaño especsifico antes de pintar el mapa para que se muestre correctamente

      // recuerde solicitar la clave key en maps para su app 
      

    </script>
    <script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDF_eOOEADSIQKphdwt7Lm_r5LpVXryqOs&callback=initMap" async defer></script>
  </body>
</html>