Re: Centering Infowindow
On Jul 13, 1:17 pm, ShaneMcC <shanemccs...@gmail.com> wrote:
> It works but.... now there is another problem.
> It seems to glitch and pan the map in the wrong direction if you have
> zoomed to a town level, and then click a sidebar link.
>
> You can have a look at the functionality and see what I mean on this
> temporary link:
I can't find a sidebar like Mike's on that link though. Yours just has
categories. And there's an error when zooming, "load is not defined"
because there isn't a function called "load". An error in a zoom
handler disrupts marker replotting and tile loading. And you're using
extInfoWindows, which may behave differently to ordinary infoWindows.
Where is the code you are **actually** having difficulty with?
Assuming you are actually using ordinary infoWindows, what you may
need to do is to ensure that the map manipulation is queued correctly.
It sounds like the setCenter isn't finished before the openInfoWindow
attempts to do its stuff. Something like the following, perhaps, but I
can't test it because your page is still a secret. Using a zero delay
is sufficient to ensure operations are in different timeslices.
GEvent.addListener(marker, "click", function() {
map.setCenter(marker.getLatLng());
setTimeout(marker.openInfoWindowHtml(html),0);
});
Hint: if you don't want to publish a temporary url to your page for
posterity, use tinyurl or shrinkalink or something to hide it from
searching.
--
You received this message because you are subscribed to the Google Groups "Google Maps API" group.
To post to this group, send email to google-maps-api@googlegroups.com.
To unsubscribe from this group, send email to google-maps-api+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-maps-api?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home