そのような都市に通過する間に、私はGoogle MapsのAPIを打っています:緯度結果オブジェクトがGoogleマップのAPIから変更されたのはなぜですか?
今getWeather(results[0].geometry.bounds.R.R, results[0].geometry.bounds.j.j)
:
this.geoCode = function(city) {
var dfd = $q.defer();
var geocoder = new google.maps.Geocoder();
geocoder.geocode({'address': city},
function (results, status) {
console.log('map response: ', results);
cityObj.address = results[0].formatted_address;
getWeather(results[0].geometry.bounds.R.R, results[0].geometry.bounds.j.j)
.then(function(response) {
cityObj = response;
dfd.resolve(cityObj);
});
});
return dfd.promise;
};
わずか2週間前、私がすることによって結果オブジェクトから緯度/経度をアクセスしていました結果オブジェクトは次のようになります。
getWeather(results[0].geometry.bounds.H.H, results[0].geometry.bounds.j.j)
ご覧のとおり、RRオブジェクトからアクセスしてからHHオブジェクトにアクセスするまでの緯度は変わりません。これはgooglemapsが頻繁に行うものなのか分かりません。そうであれば、オブジェクト文字を絶えず変更せずに、コードを使用してデータを継続的に解析して緯度/経度を取得する方法はありますか?どんなフィードバックも高く評価されます。ありがとう
これを使用してlat、lngにアクセスできます。これは問題なく動作しています。 var latitude = results [0] .geometry.location.lat(); var経度=結果[0] .geometry.location.lng(); –
[Google Maps API V3 - ジオコーダを使用している場合にのみ空白の地図を表示する]の複製(http://stackoverflow.com/questions/13114797/google-maps-api-v3-only-showing-a-blank-map-ジオコーダー使用時) – geocodezip
[Google maps - 奇妙なジオメトリ。配置属性(G、K)]の複製(http://stackoverflow.com/questions/32614504/google-maps-weird-geometry-location-attributes -gk) – geocodezip