VEException Class

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.

Contains the exception information for the map control.

Public Properties

Name Description

VEException.source Property

The source object that caused the exception. Property

The name of the exception.

VEException.message Property

A text description of the exception.


An exception returned from Bing Maps will always contain a value for the message property. The source and name properties may have values, or may be null or undefined.

If you want to handle VEMap object errors, use the VEMap.onerror Event.


<!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 shape = null;
         var pinCenter = null; 
         function GetMap()
               map = new VEMap('myMap');

               // Add a pushpin using the wrong type 'VEShapeType.Pin'
               //  instead of 'VEShapeType.Pushpin'
               pinCenter = new VELatLong(45.01188,-111.06687);
               shape = new VEShape(VEShapeType.Pin, pinCenter);

                //This block will catch VE JavaScript exceptions
                alert("The following exception has occurred: " + + ", " + ex.message);
   <body onload="GetMap();">
      <div id='myMap' style="position:relative; width:600px; height:400px;"></div>