Export (0) Print
Expand All

VEMap.GetVersion 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 version of the map control.


VEMap.GetVersion();

A string of the current map version.

Bb412418.note(en-us,MSDN.10).gifNote:
You use the GetVersion method with the VEMap object itself, not an instance of the object. This is because every instance of the VEMap object on a page will be the same version.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
   <head>
      <title></title>
      <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;
         
         function GetMap()
         {
            map = new VEMap('myMap');
            map.LoadMap();
         }   

         function GetInfo()
         {  
            // VEMap.GetTop returns the position of the top edge of the map control, in pixels.
            // VEMap.GetLeft returns the position of the left edge of the map control, in pixels.
            // These units are defined using standard DHTML markup.
            // See the style attribute for the <div> element 'myMap'.
            var info = 'The top edge of the map on the Web page is at pixel: '+ map.GetTop() + "\n";
            info += 'The left edge of the map on the Web page is at pixel: '+ map.GetLeft() + "\n";
            info += 'The latitude,longitude at the center of the map is: '+ map.GetCenter() + "\n";
            info += 'The current zoom level of the map is: '+ map.GetZoomLevel() + "\n";
            info += 'The map control version is: '+ VEMap.GetVersion() + "\n";            
            alert(info);
         }
      </script>
   </head>
   <body onload="GetMap();">
      <div id='myMap' style="position:relative; width:400px; height:400px; top:25px; left:25px"></div>
      <INPUT id="getinfo" style="position:relative" type="button" value="Get Info" onclick="GetInfo();">
   </body>
</html>

Show:
© 2014 Microsoft