-1

How do I add an adress to be displayed on the map, using this API from google. Insted of using the embed option?

 <script>
      function myMap(){

        var mapCanvas = document.getElementById("map");
        var mapOptions = {
          center: new google.maps.LatLng(51.5, -0.2), zoom:15
        };
        var map = new google.maps.Map(mapCanvas, mapOptions);
      }
 </script>

 <script src="https://maps.googleapis.com/maps/api/js?key=my_key">
 </script>
  • possible duplicate of [Using Address Instead Of Longitude And Latitude With Google Maps API](http://stackoverflow.com/questions/15925980/using-address-instead-of-longitude-and-latitude-with-google-maps-api) – geocodezip Mar 10 '17 at 19:40

1 Answers1

0

Is this what you want?

 <script>   
function initialize() {
var map = new google.maps.Map(document.getElementById('map'), {
zoom: 12,
center: { lat: yourLAT, lng: yourLNG }
});
</script>
<script src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=initialize"async defer></script>                                                                                   

     <body> 
     <div id="map"></div>
     </body>
Ruben
  • 199
  • 2
  • 17