I am trying to get the location of the user with geolocation HTML5. In the pc its works great, but in all my mobile devices (Samsung note, Samsung galaxy S4 And Iphone 6) its not working and not showing the error object.
this is my code:
function showPosition(position) {
var coor = position.coords.longitude+", "+position.coords.latitude;
alert(coor);
}
function errorPosition(error) {
alert(error);
}
function toggleGeolocation() {
navigator.geolocation.watchPosition(showPosition,errorPosition);
}
As i said, Its not working and its even not showing error. Its ask to get permission for geolocation and I click allow, and the gps is working, what can be the problem?? I am using Google chrome in all the devices.
Aucun commentaire:
Enregistrer un commentaire