json with google geocoding api

后端 未结 2 982
日久生厌
日久生厌 2020-12-10 19:34

Here is code which gets latitude and longitute when entered a location.I believe that my code right according to my knowledge.but i get a blank page after entering a place.<

2条回答
  •  半阙折子戏
    2020-12-10 20:00

    In Google Maps Javascript V3 you can access the geocoding service using the google.maps.Geocoder class.

    var myAddressQuery = 'O. J. Brochs g 16a, Bergen';
    var geocoder = new google.maps.Geocoder(); 
    geocoder.geocode(
        { address : myAddressQuery, 
          region: 'no' 
        }, function(results, status){
          // result contains an array of hits.
    });
    

    https://developers.google.com/maps/documentation/javascript/examples/geocoding-simple

提交回复
热议问题