Solar2DTux icon indicating copy to clipboard operation
Solar2DTux copied to clipboard

Simulator doesn't show dummy GPS reading

Open qwebltd opened this issue 4 years ago • 1 comments

Not sure if this really qualifies as a bug, but the Windows sim shows a dummy GPS reading when using location event listeners ( https://docs.coronalabs.com/api/event/location/index.html ). Currently Solar2DTux doesn't seem to do this.

qwebltd avatar Dec 29 '20 11:12 qwebltd

Ok, as I am very curious, I've tested what you're talking about and yes, this is a valid bug.

What happens is that the location event is not being called through Runtime event dispatcher for some reason. If you run this code on the Simulator you can see what I'm talking about:

local gps = function (event)
    print("Location is being called on Runtime")
end
Runtime:addEventListener("location", gps)

The print never occurs, at least on the simulator (on Linux), because the gps function is never called.

Now, the Solar2D Doc advises to check if the platform supports gps location by calling the function system.hasEventSource( "location" ). Guess what happens? It returns true, meaning the simulator should have support, when it currently doesn't.

That's the bug, basically. Carlos HR.

carlHR avatar Jan 07 '21 04:01 carlHR