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?
Asked
Active
Viewed 3,180 times
4
-
How is your area defined? Is it a polygon area or just a point with a radius? – whlk Apr 21 '15 at 08:37
-
YOu should be more specific. AS @Mannaz said, the answers will be more accurated if you say how is your area, or how did you defined. Polygon, circle..the area is in the same position on the map, or is a "screen area", etc – Shudy Apr 21 '15 at 08:56
3 Answers
4
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 .
-
bro! that is what i want!! In Google Maps API v3, there is a method same as contains(), and this is what i want – Huang Liang-Syun Apr 23 '15 at 05:44
0
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

Borja Alvarez
- 189
- 13
0
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
}
}

Ziem
- 6,579
- 8
- 53
- 86

Ahmad Sanie
- 3,678
- 2
- 21
- 56