Created
December 14, 2013 03:40
-
-
Save thequbit/7955419 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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