It seems like in version 3, the OverlayView.draw() method is not
called "every time" when the map center changed. To show this, I have
added a 'counter' at the bottom of the page that will increment every
time OverlayView.draw() is called (in version 2, it's GOverlay.redraw
()).
Is this a bug in the API? Or am I doing something wrong?
Susannah (Google Employee)
unread,
Sep 29, 2009, 9:09:24 PM9/29/09
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
You can force your Overlay to be redrawn when the center changes by
adding this code to your onAdd method:
var overlay = this;
google.maps.event.addListener(overlay.getMap(), 'center_changed',
function() {
overlay.draw();
});
Note that this has potential to make dragging sluggish on some
browsers. For this reason, we only trigger draw when the result from
fromLatLngToDivPixel would change.