Discussion Forums  >  Maps, Device Location, Tracking

Replies: 2    Views: 111

mjharris
Aspiring developer
Profile
Posts: 19
Reg: May 23, 2013
Boulder
3,440
05/28/13 01:55 PM (11 years ago)

How to organize list by how close each list item is to user

Hi there, I am using the BTA Design Menu to show a list of local places to eat. Is there a way to organize the list so the closest restaurant is list item 1 and the furthest is the last list item, etc... Thanks for any help, Max
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
05/28/13 02:34 PM (11 years ago)
If you can obtain the geo coordinates of the destinations, you can calculate distance between current location and 'possible' location, and sort it by distance. This of course, will require modification of the plugin. This is the base source code (iOS) that I'm using... CLLocation *locA = [[CLLocation alloc] initWithLatitude:lat1 longitude:long1]; CLLocation *locB = [[CLLocation alloc] initWithLatitude:lat2 longitude:long2]; CLLocationDistance distance = [locA distanceFromLocation:locB]; [locA release]; [locB release]; Hope this helps! Cheers! -- Smug It almost sounds like you're working on a similar item to NickRick... https://www.buzztouch.com/forum/thread.php?fid=02850869548DD12E229D546&tid=02850869548DD12E229D546
 
mjharris
Aspiring developer
Profile
Posts: 19
Reg: May 23, 2013
Boulder
3,440
like
05/30/13 12:13 PM (11 years ago)
Hey thanks Smug. What file do I need to calculate this in. I just read through my configuration JSON. I also read through the NickRick link you posted. Im pretty new to this and hope it isn't too hard. Could you guide me a little bit more? I really appreciate your help! Thanks, Max
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.