Why doesnt version 5 of mapcontrol support the ShowDisambiguationDialog method.
Hi,
I am using version 5 of the map control for my desktop application. Based on this sample WinFormsEarthV2 i was able to get started plotting on the maps based on the address entered by the user.
<
scriptsrc="http://dev.virtualearth.net/mapcontrol/v5/mapcontrol.js"></script>Here is the sample code.
<
script>var map;
function OnPageLoad()
{
map =new VEMap('myMap');
map.DisambiguationCallback = disambigCall;
map.ShowDisambiguationDialog(true);
map.ShowMessageBox = false;
map.LoadMap();
}
function disambigCall(e)
{
var results="More than one location was returned. Please select the location you were looking for:<br>";
for (x=0; x<e.length; x++)
{
results+="<a href='javascript:map.Find(\""+e[x].ID+"\");'>"+e[x].ID+"</a><br>";
}
document.getElementById('resultDiv').innerHTML=results;
}
function DoFind(what,where)
{
map.Find(what, where);
}
</
script>But the script never works properly. What exactly is required to get this disambiguation dialog box working. Note that i would like the default dialog box to show the various locations and then allow the user to select the closest city in USA.
Also whether i set this property map.ShowDisambiguationDialog(true); to either true or false (the callback function is also provided) there seems to be no difference in the functioning. As a result i am getting the error dialog box "No results were found". But when searching the websitehttp://maps.live.com, it is able to give a closest match to the street that i enter and spells it out in a new different way. Why is this so and how can i implement the same feature in my desktop application.
Also when using this function
function DoFind(what,where)
{
map.Find(what, where);
}
i hard code the value of where to a particular city of usa for eg
map.Find(parameter1,"New York City"), it may or may not give all the results pertaining to New York City. Can any one tell the right value to use for the where clause for various cities of usa.
finally what is the difference between using these 2 scripts. both do not support the same set of functions.
<script src="http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=5"></script>
<script src="http://dev.virtualearth.net/mapcontrol/v5/mapcontrol.js"></script>
Thanks.
Rajesh

