Page 1 of 1

Geolocation on the PC [Solved]

Posted: Thu Jul 13, 2017 12:15 pm
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!

Re: Geolocation on the PC [Solved]

Posted: Thu Jul 13, 2017 12:36 pm
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

Re: Geolocation on the PC [Solved]

Posted: Thu Jul 13, 2017 2:37 pm
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.

Re: Geolocation on the PC [Solved]

Posted: Fri Jul 14, 2017 9:04 am
by MrTAToad
It was the first reading that originally made me think something funny was going on...