Google Maps API V3 - only showing a blank map when using the geocoder

前端 未结 1 604
野趣味
野趣味 2020-12-02 03:17

So I have some javascript that uses the google maps API V3 and uses the geocoder to obtain co ordinates from an address and display a map at those coordinates. It was workin

相关标签:
1条回答
  • 2020-12-02 03:55

    You are using undocumented properties:

    var center = results[0].geometry.location.Xa - 0.0062;
    var centerCoord = new google.maps.LatLng(center, results[0].geometry.location.Ya);
    

    (geometry.Xa, geometry.Ya)

    That is guaranteed to fail at some point when the version of the API changes.

    Use the documented properties (geometry.lat(), geometry.lng())

    0 讨论(0)
提交回复
热议问题