Mobile Maps find closest points from local DB

Hi all-

Running version 10.

I have a local database that contains customers.  Id, Latitude, longitude, and other information. Is there a way to populate the map with the 20 customers that are closest to my location without having to loop through all the customers to find the distance between my location and the points then filtering to find the 20 closest?

Right now I run something server-side to find the distance then populate the local table but that takes forever


Hi Andrew,

You were already struggling with this some days ago.  Too bad that you still haven't found a way to make this work as fast as you like.  You ended last thread with saying that things magically started working faster, so the magic is gone ??

So regardless of whether your customers are in a local or a server database, for a simple straight forward logic there is little else you can do than go over each customer, calculate the distance, and only retain the 20 closest ones.

As I said before, your lack of performance probably doesn't come from making all the calculation but from you updating each customer record in the database after the calculation, are you still doing that ?

You say you are on 10, so I'm not sure you can open the oml as I made it on 11, so please see demo.  With 3000 customer records in the database, finding 20 closest takes about 1 second.  My Google map doesn't look good as I'm not using an API, but it still works for testing.

Good Luck,


Thanks for the help.  I have decided to populate all accounts with markers but only show a radius of x miles.  That way I let Google do all the work.