Embed Google Map into HTML page based on GPS coordinates

后端 未结 3 1489
傲寒
傲寒 2021-01-30 11:45

I have a PHP photo gallery that reads the GPS coordinates from images. I\'d like to modify it to use the coordinates and include a google map on the photo page. Is there a sim

3条回答
  •  醉酒成梦
    2021-01-30 12:16

    The following are a few examples that you may help you getting started:


    Using the Google Maps API v2:

    
     
    
       
     
    
       

    You simply need to change the latitude and longitude in the GMap2.setCenter() method. The last paramater is the zoom level.


    Using the Google Maps API v3:

    
     
    
       
     
    
       

    When using version 3 of the Maps API, you would need to pass your parameters as options to the google.maps.Map() constructor. The above example should be self explanatory.


    Using the Static Map API:

    
    

    The Static Map API, as luca suggested might be a very good idea.

    Simply pass the the latitude and longitude paramaters in an image tag, as in the example above. It would display the map below, directly rendered from Google:

    Using the Static Maps API


提交回复
热议问题