Virtual Earth Map Control SDK, version 6.2
VEMap.GetImageryMetadata Method

Returns information about the requested imagery, including imagery date stamps. This method requires that a valid token has been set using the VEMap.SetClientToken Method.

VEMap.GetImageryMetadata(callback, options);

Parameter Description

callback

The name of the function to call when results are returned. The function must accept a VEImageryMetadata Class object. Required.

options

A VEImageryMetadataOptions Class object specifying the imagery for which information is returned. Optional.

Returns a VEImageryMetadata Class to the callback function.

If the options parameter is not specified, then the GetImageryMetadata method returns information about the current map view.

The GetImageryMetadata method is supported for VEMapStyle.Aerial and VEMapStyle.Hybrid.

In order to retrieve imagery metadata, use the VEMap.SetClientToken Method to set a valid token before calling the GetImageryMetadata method.

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

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

      <script type="text/javascript">
         var map     = null;         

         function GetMap()
         {  

            map = new VEMap('myMap');

            //A token is required to retrieve imagery metadata
            map.SetClientToken("MyValidVEToken");

            map.LoadMap();

            map.SetMapStyle(VEMapStyle.Aerial);

         }

         
         // Get imagery meta data of the current map
         function GetMetadata()
         {

            map.GetImageryMetadata(MetadataCallback, null);
         }

         function MetadataCallback(metaData)
         {
            alert("Imagery date range: " + metaData.DateRangeStart + " - " + metaData.DateRangeEnd);
         }

      </script>
   </head>
   <body onload="GetMap();">
      <div id='myMap' style="position:relative; width:600px; height:400px;"></div>
      <input type="button" onclick="GetMetadata();" value="Get Imagery Metadata"/>
   </body>
</html>

Navigation

VEMap Methods
 GetImageryMetadata Method
      Send     
Click to Rate and Give Feedback
Page view tracker