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" "">
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">

      <script type="text/javascript" src=""></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>