I am trying to figure out how i can attach a click event to a google maps v3 compass.
I have created a function that re-draws markers on a map and want this to be fir开发者_C百科ed when the user click on the compass (arrows top left) of the google map.
I am working with google maps v3 and cant seem to find any way of doing this through the documentation.
Does anyone know how to do this?
Thanks in advance!
Click event of the compass is probably attached to the bounds_change event. Essentially, you are changing the bounds of the map.
You can listen to the center of the map changing:
google.maps.event.addListener(map, 'center_changed', function() {
// Call your function to redraw markers here.
});
精彩评论