Hello,
Here is what i’m trying to achieve:
Multiple persons use the app and are connected to eachother through facebook.
Now each person is on a different position and is seeing the other persons on their position located on the map.
I already made it that you can see yourself on the map with a marker. Now i want it to connect eachother to a database/session or something similar so that each person their locations is updated and shown to the other persons.
This is the sample code that i have now:
– Create a native map view
local myMap = native.newMapView( 20, 20, 280, 360 )
myMap.x = display.contentCenterX
local attempts = 0
local locationText = display.newText( "Locatie: ", 0, 400, native.systemFont, 16 )
locationText.anchorY = 0
locationText.x = display.contentCenterX
local function locationHandler( event )
local currentLocation = myMap:getUserLocation()
if ( currentLocation.errorCode or ( currentLocation.latitude == 0 and currentLocation.longitude == 0 ) ) then
locationText.text = currentLocation.errorMessage
attempts = attempts + 1
if ( attempts > 50 ) then
native.showAlert( “Geen GPS signaal”, “Het lukt niet om te synchroniseren met GPS.”, { “Oke” } )
else
timer.performWithDelay( 2000, locationHandler )
end
else
locationText.text = "Huidige locatie: " … currentLocation.latitude … “,” … currentLocation.longitude
myMap:setCenter( currentLocation.latitude, currentLocation.longitude )
myMap:addMarker( currentLocation.latitude, currentLocation.longitude )
end
end
locationHandler()
Thanks for any help or tips!