1

I am using geofence to draw on map. Below is my code:

ArrayList<LatLng> mGeofence = new ArrayList<LatLng>();
        for (int j = 0; j < path.getmPolygon().size(); j++) {
            mGeofence.add(path.getmPolygon().get(j));
        }
        if (mGeofence != null && path.getmPolygon().size() >= 3) {
            PolygonOptions polyoptions = new PolygonOptions();
            polyoptions.addAll(mGeofence).strokeColor(Color.BLUE).strokeWidth(8f);

            mMap.addPolygon(polyoptions);
        } else {
            System.out.println("Path Invalid Polygon");
        }

Google I/O session tells that geofence's limit is 100 session.

So my question is, What do you mean by 100 session ?

mMap.addPolygon(polyoptions);

Or

mGeofence.add(path.getmPolygon().get(j));
Lucifer
  • 29,392
  • 25
  • 90
  • 143
Dhrupal
  • 1,863
  • 1
  • 23
  • 38
  • Visit This [answer](http://stackoverflow.com/a/18920426/3330969) – Lucifer Mar 11 '14 at 12:10
  • @Kedarnath: I have reviewed it, but i have one confusion, which i have shown through my code.Can you please help me in that? – Dhrupal Mar 11 '14 at 12:42
  • 1
    Ok Dhrupal, I think 100 means by this `mGeofence.add(path.getmPolygon().get(j));` , Also you can run a for loop for 100 on each statement one by one and check your self. I am not sure as I havent done work on this. – Lucifer Mar 11 '14 at 12:44
  • @Kedarnath : Thnx. But what will heppan if i put more than 100 geofence in a map. Will it not drawn or drawn but not actually there. – Dhrupal Mar 12 '14 at 04:21
  • Good Morning, I guess it should draw, As I told you, I haventt tried this out, So I can not give you 100% accurate answer. – Lucifer Mar 12 '14 at 04:23

1 Answers1

3

Adding Polylines to the map has nothing to do with Geofencing. The limitation is imposed on the geofencing API.

MaciejGórski
  • 22,187
  • 7
  • 70
  • 94