Geolocation on the PC [Solved]

Just starting out? Need help? Post your questions and find answers here.
User avatar
MrTAToad
Posts: 291
Joined: Sun Apr 20, 2014 11:43 am
Location: Chichester, England
Contact:

Geolocation on the PC [Solved]

Post by MrTAToad »

Does the geolocation set of commands support the PC as well ? The help file does say that a location should be found using an internet connection, but at the moment StartGeolocation fails...

Problem solved : The first call returns invalid values, but subsequent calls are correct!
User avatar
Peter
Posts: 1086
Joined: Mon Feb 24, 2014 10:17 pm
Location: 127.0.0.1:9080
Contact:

Re: Geolocation on the PC [Solved]

Post by Peter »

MrTAToad wrote:Does the geolocation set of commands support the PC as well ?
seems so:

Code: Select all

StartGeolocation()

Procedure TimerEvent()
  
  Debug "GeolocationTime: " + GeolocationTime()
  Debug "GeolocationLatitude: " + GeolocationLatitude()
  Debug "GeolocationLongitude: " + GeolocationLongitude()
  Debug "----"
  
EndProcedure

OpenWindow(0, 0, 0, 0, 0, "DummyWindow", #PB_Window_Invisible)

AddWindowTimer(0, 0, 1000)

BindEvent(#PB_Event_Timer, @TimerEvent(), 0, 0)
Of course you have to grant the access in your browser.

Greetings ... Peter
tj1010
Posts: 201
Joined: Wed May 27, 2015 1:36 pm
Contact:

Re: Geolocation on the PC [Solved]

Post by tj1010 »

it's opt-in on every platform and it's not unusual to see it disabled. Compass is actually super-rare even on modern devices. Google maps uses some algorithm with accelerometer for direction when there is no compass chip on devices.

You can check all of this with Cordova libraries. There are also different coordinate format standards.
User avatar
MrTAToad
Posts: 291
Joined: Sun Apr 20, 2014 11:43 am
Location: Chichester, England
Contact:

Re: Geolocation on the PC [Solved]

Post by MrTAToad »

It was the first reading that originally made me think something funny was going on...
Post Reply