YnJin1010 / google-maps-utility-library-v3

Automatically exported from code.google.com/p/google-maps-utility-library-v3
Apache License 2.0
0 stars 0 forks source link

InfoBox div size and position undefined #314

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I'm trying to calculate the size and position of the div that gets created by 
InfoBox when infobox.open() is called, but it's seemingly undefined for the 
first 50-100ms after open is called. I've tried listening for the various 
InfoBox events (position_changed, content_changed, domready, etc.) and none of 
them have helped.

I'm not sure if this is a bug or a feature request, but it would be great if 
there was a way to know when we can safely check the div position and size, 
perhaps via a new InfoBox event like "opened"?

The only hack workaround I've been able to come up with is this:

    setTimeout(function ()
    {
        // Hopefully this is defined after waiting 100ms
        var infoBoxOffset = $(".infoBox").offset();
    },
    100);

Any ideas or recommendations?

Original issue reported on code.google.com by mtf...@gmail.com on 12 Aug 2014 at 2:22