locked
Replace MapPoint w/ Bing RRS feed

  • Question

  • 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 code

    Jason.MapPoint.

    Address myAddress = new Address();

     

    string strAddress = string.Empty;

     

     

    if (!string.IsNullOrEmpty(txtStreetName.Text))//FxCop Change
     

    strAddress = 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;

    }

     

    }

     

    Monday, December 12, 2011 7:38 PM

Answers

  • 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
    Thursday, December 15, 2011 11:19 AM
    Moderator