简体   繁体   English

每当用户更改Google Map Android中的位置时,如何检查用户是否处于标记之一(从10000个标记中)?

[英]How to check if user in one of marker (from 10000 of markers) everytime user change location in google map android?

How to check if user in one of marker (from 10000 of markers), everytime user change location ? 每次用户更改位置时,如何检查用户是否在一个标记中(从10000个标记中)? 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 ? 我知道如何使用小的标记进行检查,我可以使用distanceTo进行一一检查,但是如何从10000个标记中进行一一检查,以及用户每次移动时如何进行检查?

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. 如果可以管理,则可以使用x米的用户来制作较小的标记列表。 Keep track of how far the user has moved, and once they get near or at x meters, recalculate the list. 跟踪用户移动了多远,一旦他们靠近或到达了x米,请重新计算列表。 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? 在SQLite中查询以获取基于Radius的记录?

calculate distance between a location and a list of locations 计算位置与位置列表之间的距离

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM