close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Google map v3 hidden tabbed panels not centering

Thread began 2/23/2012 4:06 pm by kimholt436260 | Last modified 2/29/2012 1:15 pm by kimholt436260 | 6898 views | 7 replies

kimholt436260

Google map v3 hidden tabbed panels not centering

Hiya,
I am trying to put a different google map on each tab of a tabbed panel. The map on the default page works fine but the ones on other tabs appear only in the top left of the container div. From what I have read this is due to the hidden container divs having a size(0,0) so the google map centres in the top left and doesn't resize when the tab is activated.

I realise this is a known bug and a lot of people seem to have fixed it in version 2, but not version 3 google maps. Unfortunately none of the fixes seem to have worked for me. I think the code fixes might work but I'm sure sure where to insert them into the javascript?

I'm hoping someone could help me work out what code to put where to get the google maps on the hidden tabbed panels to either resize when the tab is activated, or be made permanetly the correct size?

Code below:

(header)
<script type="text/javascript">

function initDexGoogleMap(canvas, width, w_unit, height, h_unit, latitude, longitude, p_zoom, p_mapType, p_navControl, p_navStyle, p_navPosition, p_mapTypeC, p_mapTypeCStyle, p_mapTypeCPosition, p_scaleC, p_scaleCPosition, p_draggable, p_disableDoubleClickZoom, p_keyboardShortcuts, p_trafficL, p_bikeL, p_panoramio )

{document.write('<div id="'+canvas+'"></div>');

document.getElementById(canvas).style.width = width + w_unit; document.getElementById(canvas).style.height = height + h_unit;

var latlng = new google.maps.LatLng(latitude,longitude);
var myOptions = {zoom: p_zoom, center: latlng, navigationControl: p_navControl, navigationControlOptions: {style: p_navStyle, position: p_navPosition}, mapTypeControl: p_mapTypeC, mapTypeControlOptions: {style: p_mapTypeCStyle, position: p_mapTypeCPosition}, scaleControl: p_scaleC, scaleControlOptions:
{position: p_scaleCPosition}, mapTypeId: p_mapType, draggable: p_draggable, disableDoubleClickZoom: p_disableDoubleClickZoom, keyboardShortcuts: p_keyboardShortcuts};

var map = new google.maps.Map(document.getElementById(canvas), myOptions);

(Body)

<div id="DEX_GContainer0">
<script type="text/javascript">var my_DEX_GContainer0 = initDexGoogleMap
("DEX_GContainer0","450","px","450","px",51.5313695, -0.1031838,16,google.maps.MapTypeId.ROADMAP,true,google.maps.
NavigationControlStyle.DEFAULT,google.maps.ControlPosition.TOP_LEFT,true,google.maps.MapTypeControlStyle.DEFAULT,google.maps.ControlPosition.TOP_RIGHT,true,google.maps.ControlPosition.BOTTOM_LEFT,true,false,true,false,false,false); addMarker(my_DEX_GContainer0,51.5313695,-0.1031838,false,"Fitness%20First","","","click","");
</script>
</div>

Thanks!

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...