I'm here but where is the store?

Martin Schray informed about a MapPoint web service wrapper.  The wrapper helps reduce the learning curve of using the MapPoint Web Services and provides an easy way to get up and working almost instantly.  No need to install MapPoint also, you just need an Internet connection!  The download contains 2 sample projects in c# and Visual Basic.Net.

The wrapper code can do 3 things currently:

  1. Find a location and render a map of that location (address)
  2. Find two locations and render a route map (e.g. map between two locations with route highlighted) 
  3. Find two locations and list the directions for that route (e.g. actual directions for getting between two locations)

Here is a small code sample.

try
{
    MapPointWebServiceHelper helper = 
        MapPointWebServiceHelper.GetInstance("5200", "ned68Fe");

    if (!string.IsNullOrEmpty(txtAddress.Text))
    {
        Location loc = helper.FindLocation(txtAddress.Text);

        if (loc != null) // location not null
        {
            Image theMap = 
                helper.GetMap(loc, pbMap.Width, pbMap.Height, 4.0);
            pbMap.Image = theMap;
        }
    }
}
catch (Exception ex)
{
    MessageBox.Show(ex.Message, "Exception");
}

Tag:

Follow the discussion

  • Oops, something didn't work.

    Getting subscription
    Subscribe to this conversation
    Unsubscribing
    Subscribing

Comments closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums, or Contact Us and let us know.