Welcome to MapForums!

When you are signed in, this message, the ads in this row, and the red-underlined link ads all go away.

Get direction from point a to point b???

This is a discussion on Get direction from point a to point b??? within the MapPoint Desktop Discussion forums, part of the Map Forums category; I am trying to mimick some functionality that GeoMap provides. You can set a home location and a destination and ...

1. Junior Member White Belt
Join Date
Jul 2005
Posts
6

Get direction from point a to point b???

I am trying to mimick some functionality that GeoMap provides. You can set a home location and a destination and GeoMap will display a small icon with two small dots on it. This allows the user to establish the general direction of point 'b' to point 'a'. You can then click on the icon to get a full map. Is there a way to do this in MapPoint 2004? If I could at least get MapPoint to give me a direction (North, south, etc...) then I could set the appropriate icon.

Thanks

2. Senior Member Black Belt
Join Date
Nov 2004
Location
Belgium
Posts
2,433
Hi Jonathan,

You do not mean a route planning, just the direction in degrees from point a to point b, is that correct ?

Further you can do what you want to do in OnBeforeClick event handler. There you know the x,y coordinates of where the user has clicked and can do the calculation and display.

3. Junior Member White Belt
Join Date
Jul 2005
Posts
6

I'm talking about a literal direction (North, South, etc...

I figured out how to plan a route, but I still haven't figured out how to extract a literal direciton. I need to use the direction from point a to point b to decide what Icon to display on the screen.

Thanks,
Jonathan

4. Junior Member White Belt
Join Date
Jul 2005
Posts
6

Calculating degrees...

So if I can get the Longitude and Latitude of each location, then I should be able to calculate the + or - degrees from point a to point b and derive a compass direction from that?

Has anyone done this before?
Thanks.

5. Junior Member White Belt
Join Date
Jun 2005
Posts
4

Routing should give you the direction

I think if you tell MapPoint to route from 1 location to another it will also give you the direction you need to go:

oRoute.Calculate

From that you should be able to pick up if your going North VS South or East VS West, etc.

Hope it helps.

6. Junior Member White Belt
Join Date
Jul 2005
Posts
6

I'll give that a try...

Thanks.
Jon

7. Junior Member White Belt
Join Date
Jun 2005
Posts
4

Re: Routing should give you the direction

Originally Posted by Goldwings98SE
I think if you tell MapPoint to route from 1 location to another it will also give you the direction you need to go:

oRoute.Calculate

From that you should be able to pick up if your going North VS South or East VS West, etc.

Hope it helps.

I probably should have described it better.
I put my plotted pins on the map in an array. Then I just calculate the driving directions with the oRoute.Calculate method. Then the results from the oRoute.Calculate is easily put to a flex grid. It should provide the info you need to get the direction of travel.

8. Senior Member Black Belt
Join Date
Nov 2004
Location
Belgium
Posts
2,433

Re: Calculating degrees...

Hi,

Originally Posted by jonknapek
So if I can get the Longitude and Latitude of each location, then I should be able to calculate the + or - degrees from point a to point b and derive a compass direction from that?
If you means the direction (like a compass) from point a to poiint b then Yes several times. Do you wants code example from i t?