开发者

Comment of removing overlay items and the condition check

开发者 https://www.devze.com 2023-03-01 09:37 出处:网络
What to do if i want to R开发者_开发知识库emove an overlay item under a condition if my location on gps is equal to the overlay item longitude & latitude , so how this condition should be written

What to do if i want to R开发者_开发知识库emove an overlay item under a condition if my location on gps is equal to the overlay item longitude & latitude , so how this condition should be written ?!

Other Question : Due to the un accuracy of the gps i need to add delta " this delta is like to make a square around the overlay item because if my position is near the area of the over lay item so what suppose to be the delta cant never be int or float what it should be ?


You'd need to loop through your overlays when you get an updated position and see if any of them are at the same spot and remove it. Just look at the current position and the position of the overlay.


To your other question: You will always have two LatLon pairs if you loop thru your overlays - the one from GPS and the one from your spot. Just use the static method Location.distanceBetween() to find the distance between these pairs. You can query every Location for it's accuracy in meters with getAccuracy(). Take these values into account.

0

精彩评论

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