Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

navigator.geolocation.getCurrentPosition do not work in Firefox 30.0

I am using Firefox 30.0 (latest FF), and navigator.geolocation.getCurrentPosition is working in Chrome but not in this version of FF.

Here is my code:

if (navigator.geolocation) {
    navigator.geolocation.getCurrentPosition(GEOprocess, GEOdeclined);
}else{
    alert('Your browser sucks. Upgrade it.');
}

function GEOdeclined(error) {
    alert('Error: ' +error.message);
}

function GEOprocess(position) {
    alert('it works');
}

I am getting this error:

Error: Unknown error acquiring position

Note: It stopped working after upgrading Firefox to version 30.0

like image 469
user3244721 Avatar asked Jun 23 '14 05:06

user3244721


People also ask

What is navigator geolocation getCurrentPosition?

Description. The getCurrentPosition method retrieves the current geographic location of the device. The location is expressed as a set of geographic coordinates together with information about heading and speed. The location information is returned in a Position object.

What does geolocation getCurrentPosition return?

getCurrentPosition. Returns the device's current position as a [Position](Position/position. html) object.

What is geolocation maximumAge?

maximumAge. A positive long value indicating the maximum age in milliseconds of a possible cached position that is acceptable to return. If set to 0 , it means that the device cannot use a cached position and must attempt to retrieve the real current position.

What is navigator geolocation?

The Navigator. geolocation read-only property returns a Geolocation object that gives Web content access to the location of the device. This allows a Web site or app to offer customized results based on the user's location.


1 Answers

Now I'm using 47 Mozilla. I have tried everything, but all time this problem. BUT then I open about:config in my address bar, go geo.wifi.uri and changed its value to "https://location.services.mozilla.com/v1/geolocate?key=test". works!

like image 192
Vasyl Gutnyk Avatar answered Jan 01 '23 09:01

Vasyl Gutnyk