Replace MapPoint w/ Bing
-
segunda-feira, 12 de dezembro de 2011 19:38
I have to replace our MapPoint with Bing Maps. I have reviewed the online instructions but I can't get past the first part of the code.
My code fails on this line:
myFindResults = mapService.FindService.FindAddress(findAddressSpec);
I can't find the correct Bing code to use.
private void btnAddress_Click(object sender, System.EventArgs e){
#region New codeJason.MapPoint.
Address myAddress = new Address();
string strAddress = string.Empty;
if (!string.IsNullOrEmpty(txtStreetName.Text))//FxCop ChangestrAddress = txtStreetName.Text;
myAddress.AddressLine = strAddress;
myAddress.PrimaryCity = txtAddressCity.Text;
myAddress.Subdivision = ddlAddressState.SelectedItem.Text;
myAddress.PostalCode = txtAddressZip.Text;
FindOptions myFindOptions = new FindOptions();myFindOptions.ThresholdScore = 0;
// Set up the specification object
FindAddressSpecification findAddressSpec = new FindAddressSpecification();findAddressSpec.InputAddress = myAddress;
findAddressSpec.Options = myFindOptions;
findAddressSpec.DataSourceName =
"MapPoint.NA";
FindResults myFindResults;mapService =
new MapPointService();myFindResults = mapService.FindService.FindAddress(findAddressSpec);
#endregion
BindData(myFindResults);
if (dgdAddressDetails.Rows.Count > 0){
FormatGrid();
}
else{
dgdAddressDetails.Columns.Clear();
FACESNET.CommonFramework.UserControls.
UserControlHandler.GetMessagebox(this.Page).SetMessagebox("Faces", BwCoError.GetErrorUserMessage(185), MessageBoxImageType.Error, MessageBoxButtons.OK);}
this.Show();
this.Visible = true;}
}
Todas as Respostas
-
quinta-feira, 15 de dezembro de 2011 11:19Moderador
Migrating off of MapPoint requires removing all MapPoint code and replacing with Bing Maps code. These services are completely different in terms of methods names so simply replacing a service reference is not enough. Detailed documentation on how to migrate off of MapPoint is available here: http://microsoft.com/maps/MapPoint.aspx
http://rbrundritt.wordpress.com- Sugerido como Resposta Richard_BrundrittMicrosoft Employee, Moderator quinta-feira, 15 de dezembro de 2011 17:08
- Marcado como Resposta Richard_BrundrittMicrosoft Employee, Moderator quinta-feira, 5 de janeiro de 2012 18:37

