问题
all. I am trying to check the point that user taps on the google map whether in specific area, does google map api v2 have any method that i can quick to use?
回答1:
You can use LatLngBounds. It has contains method which returns true when given LatLng is inside bounds. If you want to get current visible region I recommend reading: https://stackoverflow.com/a/14700745/759007 .
回答2:
You should use Location APIs
https://developer.android.com/google/play-services/location.html
Inside em, you can use:
http://developer.android.com/training/location/geofencing.html
Hope it helps you,
Regards
回答3:
yes you can using map.setOnMapClickListener
which will return the latlng
and you can use this where ever you need:
map.setOnMapClickListener(new OnMapClickListener() {
@Override
public void onMapClick(LatLng point) {
// your code
}
}
来源:https://stackoverflow.com/questions/29766962/google-map-v2-check-whether-the-point-contains-in-area