Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

VEMap.GetMapView Method

You are not viewing the latest version of the AJAX control. Bing Maps AJAX V7 is the recommended JavaScript control for Bing Maps. If you need this documentation, it is available in as a CHM or PDF download.

Returns the current map view object as a VELatLongRectangle Class object.


A VELatLongRectangle Class object that represents the current map view.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">

      <script type="text/javascript" src="http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.3"></script>

      <script type="text/javascript">
         var map = null;
         var clickEvent = null;
         function GetMap()
            map = new VEMap('myMap');

            map.AttachEvent("onclick", GetMapView);
            map.AttachEvent("onendpan", GetMapView);
            map.AttachEvent("onendzoom", GetMapView);
            map.AttachEvent("oninitmode", GetMapView);
         function GetMapView()
            view = map.GetMapView();
            topleft = view.TopLeftLatLong;
            bottomright = view.BottomRightLatLong;
            topright = view.TopRightLatLong;
            bottomleft = view.BottomLeftLatLong;
            info = "TopLeftLatLong: " + topleft + "<br/>";
            info += "BottomRightLatLong: " + bottomright + "<br/>";
            info += "TopRightLatLong: " + topright + " (3D mode only)<br/>";
            info += "BottomLeftLatLong: " + bottomleft + " (3D mode only)";
            infoDiv.innerHTML = info;
   <body onload="GetMap();" style="font-family:Arial">
      <div id='myMap' style="position:relative; width:400px; height:400px;"></div>
      <div id="infoDiv"></div>

© 2015 Microsoft