La constante javascript POSITION_UNAVAILABLE de l'objet PositionError spécifie que la position n'a pas pu être déterminée.
Exemple de code :
function PositionCallback( oPosition ){ //oPosition est un Objet Position } function PositionErrorCallback( oPositionError ){ //oPositionError est un Objet PositionError switch(oPositionError.code) { case oPositionError.TIMEOUT: break; case oPositionError.PERMISSION_DENIED: break; case oPositionError.POSITION_UNAVAILABLE: break; case oPositionError.UNKNOWN_ERROR: break; } } } var oGeolocation = navigator.geolocation; oGeolocation.getCurrentPosition( PositionCallback, PositionErrorCallback ); //ou var id = oGeolocation.watchPosition( PositionCallback, PositionErrorCallback);
Valeur retournée de POSITION_UNAVAILABLE
Valeur retournée
La constante javascript POSITION_UNAVAILABLE de l'objet PositionError un nombre entier égal à 2.
Menu de la page PositionError.POSITION_UNAVAILABLE