Gmaps显示灰色区域,直到屏幕调整大小

时间:2017-01-13 19:00:29

标签: javascript google-maps

当模态加载时,地图部分显示为灰色但在调整大小窗口时会显示,但在重新加载页面时会再次消失。

here is how the map is visible

f($("#google_ptm_map").length > 0){
        var gPTMCords = new google.maps.LatLng(29.867865, 77.891575);
        var gPTMOptions = {zoom: 16,center: gPTMCords, mapTypeId: google.maps.MapTypeId.ROADMAP}    
        var gPTM = new google.maps.Map(document.getElementById("google_ptm_map"), gPTMOptions);        

        var cords = new google.maps.LatLng(29.864865, 77.896575);
        var marker = new google.maps.Marker({position: cords, map: gPTM, title: "Marker 1"});    

}

            <div id="google_ptm_map" style="width: 100%; height: 200px;"></div>

0 个答案:

没有答案