4

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?

Huang Liang-Syun
  • 129
  • 1
  • 3
  • 10
  • 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 Answers3

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 .

Community
  • 1
  • 1
Ziem
  • 6,579
  • 8
  • 53
  • 86
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