0

How to check if user in one of marker (from 10000 of markers), everytime user change location ? I know how to check with small of markers, i can check one by one with distanceTo, but how to check one by one from 10000 of marker and everytime if user moving ?

payloc91
  • 3,724
  • 1
  • 17
  • 45

1 Answers1

0

How long does it take to go through the list once? If you can manage that, then you could make a smaller list of markers with x meters of the user. Keep track of how far the user has moved, and once they get near or at x meters, recalculate the list. That depends on calculating the whole list now and then being a manageable operation.

Here are some other ideas about how to do it faster:

Query to get records based on Radius in SQLite?

calculate distance between a location and a list of locations

nasch
  • 5,330
  • 6
  • 31
  • 52