0
我的應用程序中有兩個帶Google地圖的動態選項卡...在創建選項卡時動態地Google Map也爲創建了canvas的div標籤初始化(Map函數調用)...我的問題,而我導航到標籤我打電話給顯示..它只顯示畫布.....我的地圖不顯示...如何在導航選項卡時調用Div的內容
我想顯示地圖內容與最後chebges在該地圖。 ....
我coidings低於...
$("#content").append("<div id='" + $(link).attr("value") + "_content' style='width:100%; height:100%'></div>");
var mid = $(link).attr("value")+"_content";
tab1map(mid);
地圖鱈魚荷蘭國際集團:
function tab1map(mid) {
alert("Inside "+mid+" Map");
var latlng = new google.maps.LatLng(-34.397, 150.644);
var myOptions = {
zoom: 8,
center: latlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById(mid),
myOptions);
$(mid).css("height","100%");
var marker = new google.maps.Marker({
position: latlng,
map: map,
title:"Hello World!"
});
}
標籤間進行導航:
$('#tabs a.tab').live('click', function() {
var tabName= $(this).attr("id");
var contentname = tabName+ "_content";
// hide all other tabs
$("#content div").hide();
$("#tabs li").removeClass("current");
// show current tab
$("#" + contentname).show();tab1map(contentname);
$(this).parent().addClass("current");
});