Rate this script:  I Love it  /   I Hate it

Deletion of a marker with a button on the Info Window


Code


// insert code here..

HTML stuff
  <span id='deleteMarker' onclick="delete_marker($('marker').value)">Delete</span>


// here we are first copying over the points to a temp array and then doing the stuff. Else we get a recursive error !!
  redraw_map: function() {
    pointz = Object.extend([], points)
    mapper.clean_map()
    mapper.addPointsToMap(pointz)
  },


//global function
function delete_marker(id) {
  markers = markers.without(markers[id])
  points = points.without(points[id])
  mapper.redraw_map()
}

 

 

 
Deletion of a marker with a button on the Info Window scripts | Deletion of a marker with a button on the Info Window snippet | Deletion of a marker with a button on the Info Window example | Deletion of a marker with a button on the Info Window tutorial | Deletion of a marker with a button on the Info Window code