How do you remove the Bing Disambiguation Dialog via API call?
- by Justin Dearing
I am integrating bing maps into a web page. I am calling the GetDirections() method of my VEMap option. and setting the VERouteOptions.ShowDisambiguation property to true when I call VEMap.GetDirections(). So sometimes I get the following dialog:
The problem is sometimes the user will enter a second set of directions into my form, and dialog remains. I've done the following to attempt to correct it:
// In case the disambiguation dialog a.k.a "" is present from a previous direction search
var disambiguationDialogElement = $('#myMap_veplacelistpanel')[0];
if (typeof (disambiguationDialogElement) == "object") {
map.DeleteControl(disambiguationDialogElement);
}
It seems to work, but it feels like a suboptomial approach. Is there a better way to do it?