开发者

Android: How to detect if users if within distance of GeoPoint on MapVIew

开发者 https://www.devze.com 2023-01-16 20:03 出处:网络
I have an application with a map and an ItemizedOverlay, and need to determine if t开发者_JS百科he user is within a certain distance of a GeoPoint on the ItemizedOverlay. If thats the case then start

I have an application with a map and an ItemizedOverlay, and need to determine if t开发者_JS百科he user is within a certain distance of a GeoPoint on the ItemizedOverlay. If thats the case then start a new Activity..

How do I approach this?


It sounds like you have various things you need to do, I would break it down into the following

  1. Obtain the users GeoPoint, have a look at this API it might be useful
  2. Determine the distance between the users GeoPoint and any other given GeoPoint, I found this article which explains how to calculate distances, its worth a read
  3. If the distance meets a particular requirement, then start a new activity, for this I would suggest to read up on Intents/Lifecycle. You could create a new intent and use startActivity(intent); which would start another activity, you can read more here
0

精彩评论

暂无评论...
验证码 换一张
取 消