Google Map V2 Check Whether The Point Contains In Area
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?
Solution 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 .
Solution 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
Solution 3:
yes you can using map.setOnMapClickListener
which will return the latlng
and you can use this where ever you need:
map.setOnMapClickListener(newOnMapClickListener() {
@OverridepublicvoidonMapClick(LatLng point) {
// your code
}
}
Post a Comment for "Google Map V2 Check Whether The Point Contains In Area"