VEMap.ShowDisambiguationDialog 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.

Specifies whether the default disambiguation dialog is displayed when multiple results are returned from a location query using the VEMap.GetDirections Method.

VEMap.ShowDisambiguationDialog(showDialog);

Parameters

Parameter Description

showDialog

A Boolean value. True enables the disambiguation dialog; false disables it.

Remarks

By default, the disambiguation dialog is displayed whenever the map control returns more than one result from a location search. This dialog enables the user to select the correct location from the list of returned results. By disabling this dialog, the first location will always be chosen.

Example

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://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="https://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.3"></script>

      <script type="text/javascript">
         var map = null;
         var Seattle = new VELatLong(47.64, -122.23);

         function GetMap()
         {
            map = new VEMap('myMap');
            map.LoadMap(Seattle, 10);

            map.ShowDisambiguationDialog(true);
         }

         function GetRoute()
         {
            map.GetDirections(["Seattle, WA", "Kirkland"]);
         }
      </script>
   </head>
   <body onload="GetMap();">
      <h3>Get the Route from Seattle to Kirkland</h3>
      <p>&nbsp;</p>
      <div id='myMap' style="position:relative; width:600px; height:400px;"></div>

      <input id="getroute" type="button" value="Get Route" onclick="GetRoute();"/>
   </body>
</html>