Try this
map = new GMap2(document.getElementById("map"),{size:new GSize
(300,400)});

Ralph


On Jun 23, 6:21 pm, jfl <[email protected]> wrote:
> Hi, I don't usually post questions here but I have searched the forums
> of the world without any success.  I hope somebody can help me.
>
> Basically I am using the AjaxControlToolkit TabControl Version
> 3.0.30512  (http://www.asp.net/AJAX/AjaxControlToolkit/Samples/Tabs/
> Tabs.aspx)
>
> On the first tab I have a Google Map and some text on the second tab.
>
> The map works fine until I click on the 2nd tab and then on the
> first.  When I return to the first tab the map displays fine but as
> soon as I click on the map I get the error: "'$e.j' is null or not an
> object".  This only happens in IE7 - I have tried FireFox and Safari
> and it works fine in there.
>
> I have read posts about calling map.checkResize() and I have
> implemented that, but still I get the error.  For reference, here is
> my code:
>
> Thanks in advance!
> jfl
>
> <%@ Page Language="C#" AutoEventWireup="true"
> CodeFile="tabtest.aspx.cs" Inherits="tabtest" %>
> <%@ Register assembly="AjaxControlToolkit"
> namespace="AjaxControlToolkit" tagprefix="ajaxToolkit" %>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
> <html xmlns="http://www.w3.org/1999/xhtml";>
> <head runat="server">
>     <script src="http://maps.google.com/maps?
> file=api&v=2&key=ABQIAAAAxsB8RAu7fB9FCe6JY-
> IalRT2yXp_ZAY8_ufC3CFXhHIE1NvwkxRD2wU8srXubu2ecWGoASyQh8iHxQ&sensor=false"
> type="text/javascript"></script>
>     <title></title>
>     <script type="text/javascript">
>         var map;
>
>         function initialize() {
>             if (GBrowserIsCompatible()) {
>                 map = new GMap2(document.getElementById
> ("map_canvas"));
>                 if (map) {
>                     map.setCenter(new GLatLng(-28.071980301779845,
> 27.3779296875), 5);
>                     map.setUIToDefault();
>                 }
>             }
>         }
>
>         function mapCheckResize() {
>             if (map) {
>                 map.checkResize();
>             }
>         }
>     </script>
> </head>
> <body onload="initialize()" onunload="GUnload()">
>     <form id="form1" runat="server">
>         <asp:ScriptManager ID="ScriptManager1" runat="server">
>         </asp:ScriptManager>
>         <ajaxToolkit:TabContainer ID="TabContainer1" runat="server"
>             ActiveTabIndex="0"
>             OnClientActiveTabChanged="mapCheckResize">
>             <ajaxToolkit:TabPanel ID="TabPanel1" runat="server"
> HeaderText="TabPanel1">
>             <ContentTemplate>
>                 <div id="map_canvas" style="width: 300px; height:
> 300px;"></div>
>             </ContentTemplate>
>             </ajaxToolkit:TabPanel>
>             <ajaxToolkit:TabPanel ID="TabPanel2" runat="server"
> HeaderText="TabPanel2">
>             <ContentTemplate>
>                 Some content here...
>             </ContentTemplate>
>             </ajaxToolkit:TabPanel>
>         </ajaxToolkit:TabContainer>
>     </form>
> </body>
> </html>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to