I have seen some examples of this but they are not working for this situation.
What I need to be able to do is when I click on a marker get the index of that marker to write to the console. The reason I need this info is so that I can then go and later update the popup for this marker.
I have a JSBIN of this at http://jsbin.com/hepeli/4/edit?js,console,output
When you create a marker it makes a popup that displays an index, but this is actually just the length of an array that the markers are being pushed into.
When you click a marker with the delete tool it does write to console the index but I can't get it to do this when I just click on the marker.
console.log("added marker_index: " + markerList.indexOf(marker) );