M.plugin("location").current({ on: function( result ) { if ( result.coords ) { alert( JSON.stringify(result.coords) ); } else { alert( 'Getting GPS coords is failed' ); } } });
M.plugin("location").current({ timeout: 3000, maximumAge: 5000, enableHighAccuracy: false, on: function( result ) { if ( result.status === 'NS' ) { alert('This Location Plugin is not supported'); } else if ( result.status !== 'SUCCESS' ) { if ( result.message ) { alert( result.status + ":" + result.message ); } else { alert( 'Getting GPS coords is failed' ); } } else { if ( result.coords ) { alert( JSON.stringify(result.coords) ); } else { alert( 'It cann\'t get GPS Coords.' ); } } } });