Can not control virtual earth map in the invisible view?

I am using vc to develop a program for microsoft virtual earth map,when I use dialog to display the map I can control the map by calling javascript function in the html, but when I use a invisible view to load the map, it seems that it can load the map, but when use the same javascript function to control the map, I can not get the map,my program in dialog and in the view are almost the same,please tell me why or suggest a method to control the map in the invisible view.

I appreciate your help.




Answer this question

Can not control virtual earth map in the invisible view?

  • Ggoogle

    I have the html as follows ,I can use the invisible view to load the map by GetMap function, but when I use javascript function to call GetMapByCordinate(x,y,zoom) to load the map, I can not get the map whicn I want . Maybe after calling GetMapByCordinate, I have to set the style or some property for the map

    Please tell me how to fix this problem. Thanks you very much.

    <html>
    <head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <script src="http://dev.virtualearth.net/mapcontrol/v3/mapcontrol.js"></script>
    <script>

    var map = null;
    var num=0;
    var x1=0, y1=0, n=0;

    function GetMap()
    {
    map = new VEMap('myMap');
    map.LoadMap(new VELatLong(37.41, -122.00), 10 ,'h' ,false); }

    }

    function GetMapByCordinate(x,y,zoom)
    {
    map = new VEMap('myMap');
    map.LoadMap(new VELatLong(x, y), zoom ,'h' ,false);

    }


    </script>
    </head>
    <body onload="GetMap();">
    <div id='myMap' style="position:relative; width:483px; height:382px;"></div>
    </body>
    </html>



  • NewToVba

    I have the following code in my program, I get the point of the Document as follows, I want to know if the document which I get from the program is the same as which you mentiond in the statement:document.getElementById('MapDiv').style.display= "none"

    CComQIPtr<IHTMLDocument2>m_pDoc;

    CWebBrowser2* m_pWebCtrl;

    m_pDoc=m_pWebCtrl->GetDocument();

    I appreciate your help.



  • Jay K

    I'm not sure why you are hidding the map. I assume you are tring to get access to the functionlaity behind it.

    I suspect you may come across all sorts of problems if the map is not visible. The best way to hide the map is to set its display style to "none", then to "block" to show it.

    document.getElementById('MapDiv').style.display= "none";

    John.



  • Can not control virtual earth map in the invisible view?