I solved my problem. I was initializing some global variables for the controls that would allow me to dynamically change them later: var oCtlSmallMap = new GSmallMapControl(); var oCtlLargeMap = new GLargeMapControl(); var oCtlSmallZoom = new GSmallZoomControl(); var oCtlLargeMap3D = new GLargeMapControl3D(); var oCtlSmallZoom3D = new GSmallZoomControl3D(); var oCtlScale = new GScaleControl(); var oCtlMapType = new GMapTypeControl(); var oCtlMenuMapType = new GMenuMapTypeControl(); var oCtlHierMapType = new GHierarchicalMapTypeControl(); var oCtlOverviewMap = new GOverviewMapControl(); var oCtlNavLabel = new GNavLabelControl();
I then changed this declare but not initialize the variables, e.g., var oCtlSmallMap; I changed this to set the variable when I initialized the map. Apparently this was causing some issue with one of the controls. When I changed it back, all was good again. On Jun 29, 7:23 am, Mikla <[email protected]> wrote: > I am using ajaxToolkit TabPanels... I it appears you are right. The > problem only occurs if I change to another tab and then come back to > the "Map" tab. I have the following code (with a call to the > javascript function "refreshMyMap") that I thought would prevent the > problem but it does not appear to be working. > > <ajaxToolkit:TabContainer ID="TabContainer1" runat="server" > ActiveTabIndex="0" BackColor="DarkGray" > BorderColor="AliceBlue" > OnClientActiveTabChanged="refreshMyMap"> > <ajaxToolkit:TabPanel ID="TabPanel2" runat="server" > HeaderText="Map" BackColor="Black"> > <ContentTemplate> > <asp:Panel ID="Panel1" runat="server" > BackColor="Black" ForeColor="Yellow" Height="100%" > Width="100%"> > > function refreshMyMap() { > //var map = GoogleMap1; > var newLat = map.getCenter().lat(); > var newLng = map.getCenter().lng(); > var newZoom = map.getZoom(); > map.checkResize(); > map.setCenter(new GLatLng(newLat, newLng), newZoom); > > } > > On Jun 29, 1:24 am, Martin <[email protected]> wrote: > > > > > That sounds to me like the behaviour you get when you hide a map > > container and then show it but don't use the GMap2 checkResize() > > method. > > The map thinks it's the wrong size. > > >http://code.google.com/apis/maps/documentation/javascript/v2/referenc... > > > Are you showing and hiding your map? > > > Martin. > > > On 29 June, 03:39, Mikla <[email protected]> wrote: > > > > Has anyone seen a behavior that when you click or doubleclick on a > > > marker, the map moves such that the marker just clicked moves off the > > > top of the map window (by just a little bit), no matter what the zoom > > > level is? > > > > I can't give a link since this is on my development server and there > > > is far too much code to post here... I was just hoping someone has > > > experienced this before. > > > > Funny thing is, it was working yesterday and I only made a few > > > changes. I backed out the changes and it still acts this way. I also > > > reloaded a previous version of the code that I swear worked fine, and > > > it still does this. > > > > Thanks.- Hide quoted text - > > > - Show quoted text -- Hide quoted text - > > - Show quoted text - -- 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.
