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,889
  • 1
  • 19
  • 31
volonte volonte
  • 121
  • 1
  • 8

0 Answers0