EricaStar


Can someone tell me how to turn off or alter the dialog that pops up when multiple destination addresses fit a request in driving directions. To get a better understanding, please go to http://www.starone-intranet.com/schmidt/directions.aspx.

I know how to do it when using FindLocation, but it doesn't seem to work the same way when using GetRoute. Thanks.





Re: VEMap Disambiguation

Keith Kinnan


The v3/v4 APIs do not officially support overriding the Driving Directions Amiguation dialog. However, you can "unofficially" do it with the following method:

//assuming you have a VEMap instance called "map"

if (map._dm)
{
map._dm.Disambiguate = function(type,locs)
{
//insert custom code here
var s="";
for( var i=0; i < locs.length; ++i )
{
var loc=locs[ i];
s+=loc.name + "\n";
s+=loc.latitude + "\n";
s+=loc.longitude + "\n\n";
}
alert(s);
}
}

This is an unsupported override - so use at own risk because it is not guaranteed to work properly in future versions of the APIs. It has been a common request to have better customization control for the ambiguation dialogs, so we hope to address this in a future version.






Re: VEMap Disambiguation

Derek Chan

Thanks Keith, just to clarify for all, the lightbulb Idea inside Keith's provided code actually means '[ i ]' (taking out the spaces inbetween and quotes)







Re: VEMap Disambiguation

Keith Kinnan

Thanks Derek - I went ahead and added an extra space in the code sample to get rid of the lightbulb icon