Instead of using alerts, I suggest using "console.log(message)" - it works with the development tools in all major browsers. Use firebug for FireFox.
Chad Killingsworth On Jun 10, 8:41 am, Pil <[email protected]> wrote: > What you're trying to do will definitely freeze the browser because > there will be too many alerts. Only one such event handler will freeze > the browser, but you're registering two of them > > Try to use Firebug or to use a div as resize reporter > > google.maps.event.addListener(map, "resize", function() { > document.getElementById("report").innerHTML = 'map resized'; > }); > > On Jun 10, 10:44 am, Kurteknikk <[email protected]> wrote: > > > > > Hi friends, > > > I'm using google maps api v3 and i'm trying to listen for the resize > > event but i just can't get it working. Is this code correct ? Btw > > mapCanvas is the real div's name so that is 100% correct. And map > > obviously is a public variable containing the current map. > > > This is the code i'm talking about: > > > //Trigger the resize event when map's div is resized > > var mapDiv = document.getElementById('mapCanvas'); > > google.maps.event.addDomListener(mapDiv, 'resize', function(){ > > alert('div resize'); > > google.maps.event.trigger(map,'resize'); > > }); > > > google.maps.event.addListener(map, "resize", function() { > > alert('resize'); > > }); -- 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.
