Parsing Google Geo API (Reverse Geocoding) with jQuery

前端 未结 4 1718
闹比i
闹比i 2020-12-21 11:43

I\'m sure I\'m not the only one, but I cannot parse/return anything when jQuery takes a request to lookup an address when the data being requested is the latitude

4条回答
  •  难免孤独
    2020-12-21 12:10

    try use $.getJSON to get the result

    Example

    var latlng = "40.06125658,-7.745361328";
    var url = "https://maps.googleapis.com/maps/api/geocode/json?latlng=" + latlng + "&sensor=false";
    $.getJSON(url, function (data) {
        for(var i=0;i

提交回复
热议问题