我地图那个页面是用 iframe调用的
<iframe frameborder="0" marginheight="0" marginwidth="0" scrolling="no" width="600" height="300" src=".html"></iframe>
.html就是地图的页面

解决方案 »

  1.   

    我地图那个页面是用 iframe调用的
    <iframe frameborder="0" marginheight="0" marginwidth="0" scrolling="no" width="600" height="300" src=".html"></iframe>
    .html就是地图的页面
    你还是先试试不用弹窗 。地图能显示吗
      

  2.   


    我地图单个页面是能显示的 可是做成弹窗 就不能显示了  这个是地图页面<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
    <head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
    <title>地图</title>
    <style>
                #preview{
                    
                    width: 600px;
                    height: 300px;
                    font-family: Arial, Helvetica, sans-serif,"宋体";
                }
                #map_container{
                    height: 300px;
                }
                #float_search_bar{
                    z-index: 2012;
                    position: absolute;
                    width: 480px;
                    height: 31px;
                    background: url("http://dev.baidu.com/wiki/static/map/tuan/images/search_bar.png") repeat-x;
                    background-position: 0 -21px;
                    padding: 3px 0 0 10px;
                }
                #float_search_bar label, #float_search_bar span{
                    color: #0787cb;
                    font-size: 14px;
                }
                #float_search_bar input{
                    width: 180px;
                    height: 16px;
                    margin-top: 1px;
                }
                #float_search_bar input:focus{
                    outline: none;
                }
                #float_search_bar button{
                    border: 0;
                    color: white;
                    width: 77px;
                    height: 20px;
                    background: url("http://dev.baidu.com/wiki/static/map/tuan/images/search_bar.png") no-repeat;
                    background-position: 0 0;
                    margin-right: 5px;
                    cursor: pointer;
                }
            </style>
    </head>
    <body>
    <div id="preview">
            <div id="float_search_bar">
                <label>区域:</label>
                <input type="text" id="keyword" />
                <button id="search_button"><span>查找</span></button>
                <span>点击地图或标注获取坐标</span>
            </div>
            <div id="map_container"></div>
        </div>
        <div style="margin-top: 4px;"><input id="longitude" name="longitude"><input id="latitude" name="latitude"></div>
        
        <script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=76E9FE0AA1Bef919352dd1f37240e1a3"></script>
        <script type="text/javascript">
            function getUrlParas(){
                var hash = location.hash,
                    para = {},
                    tParas = hash.substr(1).split("&");
                for(var p in tParas){
                    if(tParas.hasOwnProperty(p)){
                        var obj = tParas[p].split("=");
                        para[obj[0]] = obj[1];
                    }
                }
                return para;
            }
            var para = getUrlParas(),
                center = para.address?decodeURIComponent(para.address) : "厦门市",
                city = para.city?decodeURIComponent(para.city) : "厦门市";
        
            document.getElementById("keyword").value = center;
        
            var er_trick = false;
            var map = new BMap.Map("map_container");
            map.enableScrollWheelZoom();
        
            var er = new BMap.Marker(new BMap.Point(118.1001, 24.476358), {
                enableMassClear: false,
                raiseOnDrag: true
     });
            er.enableDragging();
            map.addOverlay(er);
        
            map.addEventListener("click", function(e){
                if(!(e.overlay)){
                    map.clearOverlays();
                    er.show();
                    er.setPosition(e.point);
                    setResult(e.point.lng, e.point.lat);
                }
            });
            er.addEventListener("dragend", function(e){
                setResult(e.point.lng, e.point.lat);
            });
        
            var local = new BMap.LocalSearch(map, {
                renderOptions:{map: map},
     pageCapacity: 1
            });
            local.setSearchCompleteCallback(function(results){
                if(local.getStatus() !== BMAP_STATUS_SUCCESS){
                    alert("无结果");
                } else {
         er.hide();
     }
            });
            local.setMarkersSetCallback(function(pois){
                for(var i=pois.length; i--; ){
                    var er = pois[i].er;
                    er.addEventListener("click", function(e){
                        er_trick = true;
                        var pos = this.getPosition();
                        setResult(pos.lng, pos.lat);
                    });
                }
            });
        
            window.onload = function(){
                local.search(center);
                document.getElementById("search_button").onclick = function(){
                    local.search(document.getElementById("keyword").value);
                };
                document.getElementById("keyword").onkeyup = function(e){
                    var me = this;
                    e = e || window.event;
                    var keycode = e.keyCode;
                    if(keycode === 13){
                        local.search(document.getElementById("keyword").value);
                    }
                };
            };
            function a(){
                document.getElementById("float_search_bar").style.display = "none";
            }
            
            /*
             * setResult : 定义得到标注经纬度后的操作
             * 请修改此函数以满足您的需求
             * lng: 标注的经度
             * lat: 标注的纬度
             */
            function setResult(lng, lat){
                document.getElementById("longitude").value = lng;
                document.getElementById("latitude").value = lat;
            }
       </script>
    </body>
    </html>
      

  3.   

     <iframe frameborder="0" marginheight="0" marginwidth="0" scrolling="no" width="600" height="300" src=".html"></iframe>这里的src路径对吗 
    这两个html在同一个文件夹下吗
      

  4.   

    <body onload="load()">
       <iframe frameborder="0" marginheight="0" marginwidth="0" scrolling="no" width="600" height="300" src="ditu.html"></iframe>
    </body>
    </html>
    你只用iframe加载试试可以吗  我试了一下可以
      

  5.   

    能不能把完整的demo发给我看看
      

  6.   

    我的意思你先别用弹出 ,用个iframe直接加载一下那个帝都页面。<body onload="load()"><iframe frameborder="0" marginheight="0" marginwidth="0" scrolling="no" width="600" height="300" src="ditu.html"></iframe></body>只用这个