Codea location function

I am trying to get the hang of how the location variable works, and it seems I am doing something wrong, as the location is not changing.

function setup()

    location.enable()

end


function draw()

    print (location.available())
    print (location.latitude)

end

@alexNaumov You’ll probable have to move a lot to get the values to change. I’ve never really tried it though. Instead of using print, try text. See below.

EDIT: I’m not sure where location gets the information from.

function setup()
    location.enable()
    print (location.available())
end

function draw()
    background(0)
    fill(255)
    text("latitude  "..location.latitude,200,500)
    text("longitude  "..location.longitude,200,450)
end

Doesn.t it use wifi or something similar to get its info?

Ok, figured it out! The accuracy is about 65 m to one side, so in my iPad.s point of view I am not moving, really.

On devices with built in gps that would be a lot more accurate, without gps the iPad uses a combination of cell tower (on 3/4G models) and wifi access points along with (potentially) data from the motion coprocessor to determine its position.

When you disable WiFi you see “Location services requires Wireless” under the enable button. Location uses latitude and longitude, if you think of the entire earth I think it’s like 35 X 20 Squares, don’t even try to move!