Geolocation APIのメモ
navigator.geolocation.getCurrentPosition
if (typeof navigator.geolocation.getCurrentPosition === 'function') { navigator.geolocation.getCurrentPosition( successCallback, errorCallback, options ); } |
[successCallback: Function]
callback successCallback = void (Position position);
position.coords position.timestamp // position.coords coords.accuracy; coords.altitude; coords.altitudeAccuracy; coords.heading; coords.latitude; coords.longitude; coords.speed; |
[errorCallback: Function]
callback errorCallback = void (PositionError positionError);
positionError.code case: 1 user do not share case: 2 unavailable case: 3 timeout case: 0 unknown |
[options: Object]
interface PositionOptions { attribute boolean enableHighAccuracy; attribute long timeout; attribute long maximumAge; }; |
【参考】
W3C: Geolocation API Specification
W3C: http://dev.w3.org/geo/api/spec-source.html#position-options
ピンバック: 超個人的メモ, JavaScript関連の投稿リンクをまとめておく « イナヅマTVログ