I'm here but where is the store?

Published 08 June 07 10:50 AM | Coding4Fun 

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");
}
Filed under:

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

No Comments

Leave a Comment

(required) 
(optional)
(required) 
Page view tracker