Sets up a listener that will be called whenever the current location changes.
A function that will be called when the location changes