2/15/2013

Android で現在地を Geolocation API で取得できないとき

ちょっとハマったので。
デスクトップの Chrome でも iPhone でも取得できた Geolocation API での現在地が、何故か Android では取得できずにエラーになりました。何故だ何故だと 2 時間ぐらいハマった挙げ句の結果を記しておきます。

<script src="http://maps.google.com/maps/api/js?sensor=true"></script>
これを読み込ませましょう...。

navigator.geolocation.getCurrentPosition(success, error, {enableHighAccuracy: true})
あと、「enableHighAccuracy: true」もお忘れなく...。

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.