|
Thanks velio & axeman10001,
Your solution got me going again.
But , I think the information provided on http://googlemap.artembg.com/map/InTabPanel.aspx is
not right (atleast in latest version 4.1).
I foun that
<script type="text/javascript">
function refreshMap() {
var map = <%= GoogleMap1.ClientID %>;
map.checkResize();
}
</script>
infact should be :
<script type="text/javascript">
function refreshMap() {
var map = <%= GoogleMap1.ID %>;
map.checkResize();
}
</script>
After doing above mentioned change I still found the map is repositioned as the center of map moves to left top corner (as of today this problem is still there on http://googlemap.artembg.com/map/InTabPanel.aspx)
but thanks to code by axeman10001 that
solved this problem. So the final code that code for me is as follows:
<ajaxToolkit:TabContainer ID="tcResult" runat="server" Width="545px" OnClientActiveTabChanged="refreshMap">
<ajaxToolkit:TabPanel ID="tpListView" runat="server" HeaderText="List View">
<ContentTemplate>
Some text ...
</ContentTemplate>
</ajaxToolkit:TabPanel>
<ajaxToolkit:TabPanel ID="tpMapView" runat="server" HeaderText="Map View">
<ContentTemplate>
<artem:GoogleMap ID="GoogleMap1" runat="server" Width="525px" Height="300px" BorderStyle="Solid" BorderColor="#999999" BorderWidth="1" />
</ContentTemplate>
</ajaxToolkit:TabPanel>
</ajaxToolkit:TabContainer>
<script type="text/javascript">
function refreshMap()
{
var map = <%= GoogleMap1.ID %>; var newLat = map.GMap.getCenter().lat();
var newLng = map.GMap.getCenter().lng();
var newZoom = map.GMap.getZoom();
map.checkResize();
map.GMap.setCenter(new GLatLng(newLat,newLng), newZoom);
}
</script>
|