I am having a similar problem in both IE6 and IE7. The center of the map shows up in the upper left hand corner. I am developing a portlet for IBM WebSphere Portal which contains the Google Map. Essentially I don't have direct access to the <head> or <body> section of the page. I am trying to add both my own JS and the Google Map JS dynamically to the <head>, but then I get a Product Key error from Google (even though it is on the same server). Here is my code:
<script type="text/javascript" djConfig="parseOnLoad: true" src="< %=request.getContextPath()%>/javascript/dojo/dojo.js"></script> <script src="http://maps.google.com/maps? file=api&v=2&key=".....key here....." type="text/javascript"></script> <div id="map" style="width: 500px; height: 300px"></div> <script type="text/javascript"> var headSection = document.getElementsByTagName("head"); var sc2= document.createElement("script"); sc2.setAttribute("src","<%=request.getContextPath()%>/javascript/ map.js"); sc2.setAttribute("type","text/javascript"); headSection[0].appendChild(sc2); dojo.addOnload=initialize(); </script> Initialize is the function which creates my map- the map shows up perfectly fine and centered in FF, but in IE the center is positioned in the upper left corner. Any ideas how/where I should be placing my code ? On Oct 22, 3:21 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On Oct 22, 10:47 am, Matis Masters <[EMAIL PROTECTED]> wrote:> Hi everyone, i > am having a problem with IE. In FF, and Chrome the maps > > looks fine after looking for any postcode, for example "90210", but in > > IE it doesn't show the right center of the maps. I found out that the > > problem is that the map images are not well positioned on IE, they > > stare some pixels up and to the left. so because of that the maps > > isn't displaying well... Here is the link. > > > I think it could be something regarding the styles or something. > > >http://shopping.netsuite.com/s.nl/c.332655/it.I/id.1/.f > > Your code is inside the DOM (inside a table), IE doesn't handle that > well, either move it to the end (just before the </body> tag) or put > it in the head and execute it using the body onload function. > > -- Larry --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
