How do you remove the Bing Disambiguation Dialog via API call?

Posted by Justin Dearing on Stack Overflow See other posts from Stack Overflow or by Justin Dearing
Published on 2010-05-14T23:22:05Z Indexed on 2010/05/14 23:24 UTC
Read the original article Hit count: 184

Filed under:

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:

'Select A Location' 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?

© Stack Overflow or respective owner

Related posts about bing-api