The container with width:100%, height: 100% is the one inserted by the Maps API. Our own container has style="width: 220px; height: 250px;"
I believe the problem is this: The HTML is first inserted into the page using Javascript, then the map is loaded, and THEN the popup is shown. When I first insert the HTML, show the popup and finally load the map, it's shown correctly. When the element is hidden when the map is inserted into it, the size is not calculated correctly. I think this used to work? It should be possible to detect the size of an element while it's hidden. PoC: <html> <head> <script type="text/javascript" src="http://maps.google.com/maps/api/js? sensor=false"></script> <script type="text/javascript"> function initialize() { var myLatlng = new google.maps.LatLng(-34.397, 150.644); var myOptions = { zoom: 8, center: myLatlng, mapTypeId: google.maps.MapTypeId.ROADMAP } var map = new google.maps.Map(document.getElementById ("map_canvas"), myOptions); document.getElementById("container").style.display = "block"; } </script> </head> <body style="margin:0px; padding:0px;" onload="initialize()"> <div id="container" style="display: none"> <div id="map_canvas" style="width:230px; height:230px"></div> </div> </body> </html> On Jan 20, 12:36 pm, Ben Appleton <[email protected]> wrote: > On Wed, Jan 20, 2010 at 10:26 PM, Marijn <[email protected]> wrote: > > I've sent some login information for testing, Ben. > > Thanks, that worked for me. It appears that your map's container has width: > 100%, height: 100%. However when the API loaded and checked the container's > size, clientWidth and clientHeight both returned 0. We're looking into > changed in this release that might have caused this. > > Meanwhile if you need a quick fix, you could set the size of your map's > container to a fixed width and height in pixels. > > > > > The problem seems to be related to CSS styling. We're showing the map > > in a div that is layed over other content. When I remove the class > > that causes this effect (so that it's shown inline), the tiles are > > loaded correctly. I'll try to figure out what exact property causes > > this (likely some positioning or z-index). > > > So it might be some error on our side, although it must be related to > > some change in the new Google Maps version because we did not release > > any new code and suddenly it started giving problems in both > > live,staging and dev this morning. > > > -- > > You received this message because you are subscribed to the Google Groups > > "Google Maps JavaScript API v3" group. > > To post to this group, send email to > > [email protected]. > > To unsubscribe from this group, send email to > > [email protected]<google-maps-js-api-v3%2B > > [email protected]> > > . > > For more options, visit this group at > >http://groups.google.com/group/google-maps-js-api-v3?hl=en.
-- You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.
