0

I am trying to add multiple polygons to a map by touch click, but I can only add one. If I click on the screen to create, it fills the new coordinate in the previous polygon.

 map1.setOnMapClickListener(new GoogleMap.OnMapClickListener() {
    @Override
    public void onMapClick(LatLng latLng) {
        coorNoGo.add(latLng);
        PolygonOptions polygonOptions = new PolygonOptions();
        polygonOptions.fillColor(Color.RED);
        polygonOptions.addAll(coorNoGo);
        Polygon NoGo = map1.addPolygon((polygonOptions));

    }
});
phts
  • 3,819
  • 1
  • 17
  • 31
volonte volonte
  • 111
  • 1
  • 7

0 Answers0