dotMobimobiThinkingmobiForgemobiReadyDeviceAtlasgoMobi

Posted by yukuza 1 year 33 weeks ago

pic
 yukuza
mobiForge Newbie
Posts: 8
Joined: 2 years ago
[offline]

Hello everybody,

I got a big Problem, since I've updated my iPhone 3GS to iOS4. I am using the W3C geolocation API Specification to get a current Position within my Webapp. Just using this sort of JavaScript code:

function locate(event)
{
navigator.geolocation.getCurrentPosition (gotPosition);
}
 
function gotPosition (position)
{
        currentlatitude = position.coords.latitude;
        currentlongitude = position.coords.longitude;
}

Still with iPhone OS 3.1.3 this worked perfektly and my function updatet the Position everytime I clicked on that corresponding Button.

Now, since iOS4, it seems, the API isn't getting the right Position. The Problem is, that it once get's a Position but doesn't updates this, after executing the function again. It always just shows the same old latitude and longitude, I received before. I also tried the parameter "maximumAge:1", but it still doesn't change.
I estimate, it takes me a geographical movement from about 100 or more meters, to update the position again. So it seems, maybe the API is just registering the change of a cell. And this it not what it should.

The other thing is, that "Maps" is getting always the right Position. And after I've received the right Position from Maps, my Applicatoin is still getting that right Position, but also for one time, and this one isn't changing then anymore. This is very annoying and it crashes the hole functionality of my Webapp.

Hopefully anybody can help me with this.

Posted by idbar 1 year ago

pic
 idbar
mobiForge Newbie
Posts: 2
Joined: 1 year ago
[offline]

I was wondering the same too. It appears as if the Safari API was crippled, only to present data from the assisted location, which never returns accuracy values smaller than 500.

Just as you claimed, GoogleMaps (and I'm assuming any other application) has access to the GPS data, but not the web API, which appears to use cached information that is only reliable soon after you closed the maps. Its accuracy returns to 500 soon after you close the application.

Posted by idbar 1 year ago

pic
 idbar
mobiForge Newbie
Posts: 2
Joined: 1 year ago
[offline]

I realized that this only happens when the WiFi is OFF. Perhaps they disable the constant updates over 3G?

Posted by yukuza 1 year ago

pic
 yukuza
mobiForge Newbie
Posts: 8
Joined: 2 years ago
[offline]

I found out that it can be fixed, by setting the Parameter enableHighAccuracy:true. Try this and tell me, if it works, mine does.