android-如何检查位置在特殊区域? [英] android-How to check location is in special area?
本文介绍了android-如何检查位置在特殊区域?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在我的android应用中使用谷歌地图在特定区域。例如在特殊的国家。
更新:
<例如如何检查我是否在新德里市 您可以尝试使用
LatLngBounds 和 LatLngBounds.contains()
私人LatLngBounds NewDelhi =新LatLngBounds(您的特殊区域SE LatLng,NE LatLng);
if(NewDelhi.contains(your location LatLng))
//做某事
I want to use google map in my android app in specific area. for example in special country. How can I check that my current location is in that place?
updates:
for example how to check that I am in New Delhi city
解决方案 You can try using LatLngBounds
and LatLngBounds.contains()
private LatLngBounds NewDelhi = new LatLngBounds(your special area SE LatLng , NE LatLng );
if(NewDelhi.contains(your location LatLng))
//Do something
这篇关于android-如何检查位置在特殊区域?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文