Why doesn't this work?

When I move (in real life) the rectangle should move but it doesn’t. Can someone please explain what I’m doing wrong

My Code:

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

function draw()
    
    background(0)
    fill(255)
   MyLatititude= location.latitude
    MyLongitude= location.longitude
    
    rect(MyLatititude, MyLongitude,200,200)


end`

@magicskillz Try running this code where you’ll see the latitude and longitude values with parameter watch. In order for you to see the rectangle move, you’re going to have to move hundreds of miles. If you don’t understand why, I suggest you do a google search for latitude and longitude and see how they translate to actual positions on Earth.

function setup()
    parameter.watch("MyLatititude")
    parameter.watch("MyLongitude")
    location.enable()
    print (location.available())
end

function draw()
    background(0)
    fill(255)
    MyLatititude= location.latitude
    MyLongitude= location.longitude
    rect(MyLatititude, MyLongitude,200,200)
end

@dave1707
Then how come this doesn’t work?

function setup()
    location.enable()
    print (location.available())
      MultiplyLatititude=100000
    MultiplyLongitude=1000000
end

function draw()

    
    background(0)
    fill(255)
   MyLatititude= location.latitude*MultiplyLatititude
    MyLongitude= location.longitude*MultiplyLongitude

    rect(MyLatititude/MultiplyLatititude, MyLongitude/MyLongitude,200,200)


end

It s doing exactly what you ask it to

Read your code carefully and you will see

@magicskillz I think it’s because you’re multiplying by a lot to increase the amount, but then dividing by that same amount for some reason.

@magicskillz You never said what type of iPad you’re using. Do you use a WiFi or cellular 3G/4G version. If you use a WiFi, you don’t have a GPS chip, so you’re location data comes from you’re internet provider. It doesn’t come from your iPad or router. If you show your location using Google maps, that’s the same latitude/longitude values you’ll get from Codea. So no matter how far you walk around with your iPad, your Lat/Lon values won’t change based on that. If you have cellular, then your values should change, but I’m not sure how accurate they’ll be over a short distance.

EDIT: When I do Google maps of where I live, it shows the location point in different places at different times. Sometimes it about 300’ from my house, other times it’s farther down the street.

Oh thanks though

Ps: Sorry for the dumb mistake

@magicskillz There are no dumb mistakes here. Your question will help others.