How can i get nearest user within range

googlemaps

#1

Hi everyone,

I am trying on of the the module of my app. where i need to get the nearest dealer to the user.

when dealer registers, he enter’s his base location and then app gives him option saying how long you can go to deliver the order?
if he says 10 kms from my current location then this dealer should be visible to all users around him (within 10 kms)

similarly,
user can expand his search and can opt to view dealers 15 km around him…

I have tried it with storing lat and long of user But i dont know how can i see if user’s current location falls in any of dealer’s delivery range?
and if i go with this approach, how can i get range defined for dealer?

Any suggestions please?