Pankaj Gupta
Pankaj Gupta

Reputation: 37

create & delete polgon on map then unable to redraw polygon

http://www.geocodezip.com/v3_SO_hidePolyline.html

This is the url, when we create a polygon (then polygon become there with black boundary) and delete that by clicking on delete button then i am not able to draw polygon again with black boundary

Upvotes: 0

Views: 57

Answers (1)

Anto Jurković
Anto Jurković

Reputation: 11258

Function deleteMarkers() calls clearMarkers() which set map for polyline to null. So function deleteMarkers() could be changed to:

function deleteMarkers() {
    clearMarkers();
    poly.setPath([]);

    poly.setMap(map); 

    markers = new Array();
    pathroute = new Array();
}

so map is set back for polyline.

Upvotes: 1

Related Questions