Hey, i want to use function myMap:requestLocation I tried using event.latitude and event.longtitude in LocationHandler as marker myMap:addMarker. Function addMarker works well. But titles of markers don’t match. It’s in random order.
Code
myMap:requestLocation(markerTable[1].adres , mapLocationPharmacyHandler )
myMap:requestLocation(markerTable[2].adres , mapLocationPharmacyHandler )
myMap:requestLocation(markerTable[3].adres , mapLocationPharmacyHandler )
Handler: (locationNumber=1 it is global variable and set before use of myMap:requestLocation)
local mapLocationPharmacyHandler = function( event )
if event.isError then
native.showAlert( "Error "…locationNumber, event.errorMessage, { “OK” } )
locationNumber = locationNumber + 1
return false
else
– In title and subtitle i don’t have set variable number, “…”…number - this working
myMap:addMarker( event.latitude, event.longitude, { title=markerTable[locationNumber].adres, subtitle="Nr. "…locationNumber } )
locationNumber = locationNumber+1
return true
end
end