Help Needed for Updating Google Maps JavaScript API

Discussion in 'JavaScript' started by vahing, Sep 19, 2014.

  1. #1
    Hello,

    I am using https://developers.google.com/maps/documentation/javascrip/tutorial#MapOptions.

    Precisely this piece of code below is called from some pages of mine:

    <!DOCTYPE html>
    <html>
      <head>
        <style type="text/css">
          html, body, #map-canvas { height: 100%; margin: 0; padding: 0;}
        </style>
        <script type="text/javascript"
          src="https://maps.googleapis.com/maps/api/js?key=API_KEY">
        </script>
        <script type="text/javascript">
          function initialize() {
            var mapOptions = {
              center: { lat: -34.397, lng: 150.644},
              zoom: 8
            };
            var map = new google.maps.Map(document.getElementById('map-canvas'),
                mapOptions);
          }
          google.maps.event.addDomListener(window, 'load', initialize);
        </script>
      </head>
      <body>
    <div id="map-canvas"></div>
      </body>
    </html>
    PHP:
    With Google Maps JavaScript API v1 I was able to pass the parameters for a given location to the API for which I have longitude, latitude and zoom:

    <iframe src="/asset/include/googlemap.php?longitude=<?=$longitude;?>&amp;latitude=<?=$latitude;?>&amp;zoom=6" frameborder="0" width="290" height="290" scrolling="no" marginheight="0" marginwidth="0"></iframe>

    The above iframe no longers works with With Google Maps JavaScript API v3.

    Can someone help out with a new iframe or the like?

    Thanks,
    Mark

    Skype: markmu1965
     
    vahing, Sep 19, 2014 IP
  2. seductiveapps.com

    seductiveapps.com Active Member

    Messages:
    200
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    60
    #2
    bit of googling found me an answer at http://stackoverflow.com/questions/5100324/how-to-get-the-google-map-based-on-latitude-on-longitude


    see also
    https://developers.google.com/maps/articles/geocodingupgrade
    https://developers.google.com/maps/documentation/geocoding/#api_key
     
    seductiveapps.com, Nov 16, 2014 IP