Tag Info

New answers tagged

0

Is this what you mean? starting from your code in onMapClickAddMarker: markerList.push(marker); add this var marker_index = markerList.indexOf(marker); console.log("added marker_index: " + markerList.indexOf(marker) ); marker.myid = marker_index; marker.on('click', function(e) { console.log("Clicked marker with id: " + marker.myid); });



Top 50 recent answers are included