ここでGoogleプレイスのオートコンプリート機能をテストしています。
https://developers.google.com/maps/documentation/javascript/examples/places-autocomplete
場所の緯度と経度を取得したいのですが、問題が発生しています。次のコードを使用する場合:
var place = autocomplete.getPlace();
console.log(place.geometry.location);
私はこれを返します:
このような情報ウィンドウで使用すると、次のようになります。
infowindow.setContent('
<div><strong>' + place.name + '</strong><br>' + place.geometry.location);
place.geometry.location
次に、次のように表示されます。
(53.539834、-113.49402099999998)
私がやりたいのは、latとlngを別々に取得することです。place.geometry.location.lat
動作しません。他に何をすべきかわからない。