phpでプログラムを作っているのですが、javascriptでjsonの読み方がわからず困っています。
google map apiでリバースジオコーディングして、住所を表示したいです。
jsonの読み方がわからないので、jsonのURLを表示させていますが、パースして住所を表示させるにはどうすればいいでしょうか。
よろしくお願いいたします。
// 現在地を取得 navigator.geolocation.getCurrentPosition( // 取得成功した場合 function(position) { var url='https://maps.googleapis.com/maps/api/geocode/json?latlng='; url +=position.coords.latitude +','+ position.coords.longitude; url +='&key=AIzaSyBqI9AOw5LnYolt4s5bqdiVlqCTTk18v-U'; document.getElementById('location').innerHTML = url; } ); </script> 現在地は:<div id="location"></div>
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/04/01 07:03