Added a function that fires when a pinpoint is clicked.