Hi guys, I am starting to play with Corona and I need to develop a function that allows people to find (for example) the closest pharmacy. Considering I have the current location and a list with all lat/long of pharmacies around the world in my database, how could I discover the "nearest" one? Can I calculate it inside Corona or should I call the Google Map API to do it? Any examples or links with more info?
Thanks,
Alex
Hi,
The only missing or pending function in corona would be the support of MapKit framework to allow you to make and show annotation on it regarding your pharmacies.
Up now, the only similar way to show them on a map is by using webpopup by calling google map with all of its parameters to show annotations into the map, but preserving the ability to stay inside your CORONA application.
The Geolocation sample code already provided by Ansca staff, only call the external safari browser in you phone to redirect the call to google map URL. This method lacks the ability to return to your CORONA app as it is not running anymore when you launch safari. That's the reason why MapKit framework support was requested as desired support in CORONA next release.
Regards,
Flavio
My above explanation is related to in case you wish to show pharmacies locations in the map.
The rest of the functionality is performed according to Eric comment.
Flavio.
Corona can return your GPS location. I guess you'd do a search on your table of all pharmacies and compute the nearest one by distance.