StartGeoLocation() does not work on Safari
Posted: Wed Nov 21, 2018 5:27 pm
Does not work on Safari/iPhone: the Browser dont ask me, to allow the geolocation..
You can try it here:
http://h2717740.stratoserver.net/app/geo/index1.html
or with an Map:
http://h2717740.stratoserver.net/app/geo/index.html
You can try it here:
http://h2717740.stratoserver.net/app/geo/index1.html
or with an Map:
http://h2717740.stratoserver.net/app/geo/index.html
Code: Select all
Enumeration
#Window
#Button
#Link
EndEnumeration
Procedure TimerEvent()
Static x.d, y.d
Protected flags
If x <> GeolocationLatitude()
x = GeolocationLatitude()
flags = #True
EndIf
If y <> GeolocationLongitude()
y = GeolocationLongitude()
flags = #True
EndIf
If flags = #True
Debug "GeolocationTime: " + GeolocationTime()
Debug "GeolocationLatitude: " + GeolocationLatitude()
Debug "GeolocationLongitude: " + GeolocationLongitude()
Debug "----"
EndIf
EndProcedure
Procedure Start_Locating()
Static flags = #False
If flags = #False
flags = #True
Debug "StartGeolocation()"
StartGeolocation()
SetGadgetText(#Button, "Stop")
AddWindowTimer(0, 0, 1000)
BindEvent(#PB_Event_Timer, @TimerEvent(), 0, 0)
Else
flags = #False
StopGeolocation()
Debug "StoppGeolocation()"
SetGadgetText(#Button, "Start again")
RemoveWindowTimer(0, 0)
UnbindEvent(#PB_Event_Timer, @TimerEvent())
EndIf
EndProcedure
Procedure Main()
OpenWindow(#Window, #PB_Ignore, #PB_Ignore, 500, 500, "GeoLocation", #PB_Window_ScreenCentered | #PB_Window_SizeGadget)
ButtonGadget (#Button, 0, WindowHeight(#Window) - 20, WindowWidth(#Window)/2, 20, "Start Locating..")
BindGadgetEvent(#Button, @Start_Locating(), #PB_EventType_LeftClick)
TextGadget (#Link, WindowWidth(#Window)/2, WindowHeight(#Window) - 20, WindowWidth(#Window)/2, 20, "")
SetGadgetText (#Link, ~"<a href = \"#\" button onclick=\"f_start_locating()\">Try it from here It</a>")
EndProcedure
Main()