I am developing a site where I have a popup that displays a Google map, using the Google AJAX API. I have tested this in IE6, 7, Firefox 2, 3.
It works fine except in Internet Explorer 6 the map directions will not show up unless I have an alert after the function that sets the directions. If you look at the code snippet I have included where it says "This is a temporary solution" if I remove this condition and "alert" statement the map directions do not display (text or map route). I tried turning off the script compression in Web.config and tried a "setTimeout" function to avoid the alert and neither of them fixed this. The map and directions are both <div> and they are contained in a ModalPopupExtender. You can view the page at the link below, click on a province or in the tree to select a lab and then click "Directions to Lab" to see the popup. http://mntportal.cmc.ca/Locator.aspx I am using .NET 3.5 SP1 on IIS 6 and developing with VS 2008 <code> function UpdateMap() { if (GBrowserIsCompatible()) { GUnload(); map = new google.maps.Map2(document.getElementById ("map_canvas"), { "size": new GSize(350, 400) }); map.addControl(new GSmallMapControl()); //map.addControl(new GMapTypeControl()); var point = new GLatLng (google.loader.ClientLocation.latitude, google.loader.ClientLocation.longitude); map.setCenter(point, 11); document.getElementById("directions").innerHTML = ""; gdir = new GDirections(map, document.getElementById ("directions")); GEvent.addListener(gdir, "load", onGDirectionsLoad); GEvent.addListener(gdir, "error", handleErrors); var fromAddress = google.loader.ClientLocation.address.city + ", " + google.loader.ClientLocation.address.region + ", " + google.loader.ClientLocation.address.country; var toAddress = document.getElementById('<%= addressHidden.ClientID %>').value; setDirections(fromAddress, toAddress, "en_US"); // This is the temporary solution if (BrowserDetect.browser == "Explorer" && BrowserDetect.version == 6) { alert("The site has detected you are using Internet Explorer 6. It is recommended you upgrade to Internet Explorer 7 or later for compatibility."); } } else { alert("Your browser is not compatible with the directions feature."); } } function setDirections(fromAddress, toAddress, locale) { gdir.load("from: " + fromAddress + " to: " + toAddress); } </code> --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Maps API" 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-API?hl=en -~----------~----~----~----~------~----~------~--~---
