Wasn't it Rossko who wrote:

>What you might be able to do is position a similar but unconstrained 
>div off-screen, put a copy of the directions text into it and let it 
>grow, and then measure the height.

The technique works in principle. That's how the API determines the size 
of the contents that you pass to an info window. After you've measured 
the contents and created a suitable container div on your page, you can 
then .appendChild() the measured div to the container div, rather than 
needing to recreate it.

Two things to watch out for:

1. You do need to allow the browser time to render the off-screen div 
before you measure it. The API does this by using a setTimeout of zero 
milliseconds between creating the div and measuring it.

2. Make sure that attaching the div to your page doesn't cause it to 
inherit CSS that changes the layout.

-- 
http://econym.org.uk/gmap
The Blackpool Community Church Javascript Team


--~--~---------~--~----~------------~-------~--~----~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to