I'm here but where is the store?

Sign in to queue

Description

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:

C4FNews

The Discussion

Add Your 2 Cents