JürgenB: google Maps, RemoveOverlay funktioniert nicht

Beitrag lesen

Hallo stiller,

var polygon = new GPolygon(Cpoints, strokeColor, strokeWidth, strokeOpacity, fillColor, fillOpacity);
      lumkreis = map.addOverlay(polygon);

map.removeOverlay(lumkreis);

die Referenz auf das Polygon steckt in polygon und nicht in lumkreis, daher removest du nicht das richtige. versuch mal

lumkreis  = new GPolygon(Cpoints, strokeColor, strokeWidth, strokeOpacity, fillColor, fillOpacity);
       map.addOverlay(lumkreis);

map.removeOverlay(lumkreis);

Gruß, Jürgen