Skip to content

Instantly share code, notes, and snippets.

@thequbit
Created December 14, 2013 03:40
Show Gist options
  • Save thequbit/7955419 to your computer and use it in GitHub Desktop.
Save thequbit/7955419 to your computer and use it in GitHub Desktop.
function plotCrime(coords,crimeID){
var marker = L.marker([coords[0], coords[1]]).addTo(map).on('click',function(){
generateCrimeData(marker.myId,coords);
marker.setIcon(highlightedIcon);
if(currentlyClicked == null){
currentlyClicked = marker;
console.log("The currently clicked marker: " + currentlyClicked);
}else{
currentlyClicked.setIcon(markerIcon);
console.log("Resetting to the default icon.");
}
});
marker.myId = crimeID;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment