I have a database of coordinates and want to display the coordinates close to the user's location on a mergMK map in a LiveCode iOS app.
1 Answers
This question was asked in a private support context, however, I think the answer may be useful to others so I'm posting it here. I am the author of the mergMK external for LiveCode.
This answer is only going to cover the iteration of the query and adding the annotation. If you need details on the SQL query to get the coordinates within range of the user then look here.
Because I don't have any code to work with I'm going to assume you have a latitude,longitude and title column selected in your query. Also I'm assuming there is a unique id column and I will use that to create a script local variable that you may want to use to later delete the annotations and/or handle some of the messages that mergExt sends for annotation interactions. I'm assuming you have executed your query and the query id is in the tQuery variable.
repeat for revNumberOfRecords(tQuery)
put revDatabaseColumnNamed(tQuery,"latitude") into tLat
put revDatabaseColumnNamed(tQuery,"longitude") into tLong
put revDatabaseColumnNamed(tQuery,"title") into tTitle
put revDatabaseColumnNamed(tQuery,"id") into tID
put mergMKAddAnnotation((tLat,tLong),tTitle) into sAnnotationIDA[tID]
end repeat

- 1
- 1

- 2,380
- 1
- 21
- 25