MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




Different results from ActiveX Control and API

This is a discussion on Different results from ActiveX Control and API within the Development forums, part of the MapPoint 2006/2009 Discussion category; Hi! I have two different applications one test-application that displays a map and another one that is just a server ...


Go Back   MapPoint Forums > Map Forums > MapPoint 2006/2009 Discussion > Development

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read
  5 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 10-30-2007
Junior Member
Yellow Belt
 
Join Date: Sep 2007
Posts: 16
Different results from ActiveX Control and API

Hi!
I have two different applications one test-application that displays a map and another one that is just a server application.
Both have worked fine for a long time but recently I got a complaint for a calculated distance.

When I run my server application I get approx: 9.75 km.
Using the test-application I get approx: 15.7 km which seems much better.

The positions are:
Start Lat: 59.2686233333333
Long: 18.019825

Stop Lat: 59.3085966666667
Long: 18.2301466666667

Im using MapPoint 2006 (Europe)
The code for the server application looks like:

Map map = MapPointApp.ActiveMap;
map.ActiveRoute.Clear(); //clear the route if one exists
Route route = map.ActiveRoute;
route.Waypoints.Add(fromLocation, "Start");
route.Waypoints.Add(toLocation, "End");
route.Calculate();
return route.Distance;


And the code for the test-application looks like:

axMappointControl1.ActiveMap.ActiveRoute.Clear(); //clear the route if one exists
Route oRoute = axMappointControl1.ActiveMap.ActiveRoute;
oRoute.Waypoints.Add(FromLocation, "Start");
oRoute.Waypoints.Add(ToLocation, "End");
oRoute.Calculate();
axMappointControl1.ItineraryVisible = false; //hide the directions pane
MessageBox.Show(oRoute.Distance + " km");

Any help would be appreciated / Michael
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 10-30-2007
Senior Member
Blue Belt
 
Join Date: Dec 2002
Posts: 217
Re: Different results from ActiveX Control and API

Michael,

I plotted the route and got all highway 16.x km
Are the "Preferred" settings different on the machines?

Mike Mattys
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 10-31-2007
Junior Member
Yellow Belt
 
Join Date: Sep 2007
Posts: 16
Re: Different results from ActiveX Control and API

Hi Mike!
I'm not sure whatt settings you're referring to, but when I tried to figure out what was happening I ran both applications on the same machine.

When you say "plotted the route" I assume that you used the ActiveX control. So it seems that using that you get almost the same result as I do.

It's the other result when I'm using the "Microsoft MapPoint 13.0 Object Library (Europe)" that I get the strange distance.

Regards / Michael
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4 (permalink)  
Old 11-01-2007
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,055
Re: Different results from ActiveX Control and API

Hi,

Possible the default preferred settings are different using the object model versus the activeX control. You have to set them in both of the programs the same.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5 (permalink)  
Old 11-08-2007
Junior Member
Yellow Belt
 
Join Date: Sep 2007
Posts: 16
Re: Different results from ActiveX Control and API

Hi!
Now I understand that I misunderstood the first reply

How do I check/set default preferred settings?

Thanks in advance / Michael
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6 (permalink)  
Old 11-08-2007
Junior Member
Yellow Belt
 
Join Date: Sep 2007
Posts: 16
Re: Different results from ActiveX Control and API

Can this problem in any way have anything to do with the fact that I upgraded fråm version 2004 to 2006?

Regards / Michael
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7 (permalink)  
Old 11-08-2007
Eric Frost's Avatar
Senior Member
Black Belt
 
Join Date: Jul 1992
Posts: 2,303
Blog Entries: 1
Re: Different results from ActiveX Control and API

Is MapPoint 2004 still installed? Maybe when you run the ActiveX it is still opening MapPoint 2004.

Eric
__________________
~ Now taking orders for MapPoint 2009 ~
~
~ Upgrade to MapForums Plus membership ~
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8 (permalink)  
Old 11-08-2007
Junior Member
Yellow Belt
 
Join Date: Sep 2007
Posts: 16
Re: Different results from ActiveX Control and API

Hi!
No I deinstalled 2004 before installing 2006 and after reading your post I also searched my harddrive to make sure there was no old version of MappointControl.ocx laying around.

Regards / Michael
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #9 (permalink)  
Old 11-08-2007
Eric Frost's Avatar
Senior Member
Black Belt
 
Join Date: Jul 1992
Posts: 2,303
Blog Entries: 1
DriverProfile

Quote:
Originally Posted by micnik View Post
How do I check/set default preferred settings?
Check in the Help file, there is the PreferredRoads property of the DriverProfile object. Also, there are methods to reset the roads and PreferredSpeeds:

DriverProfile object

The DriverProfile object contains preferences for generating routes, such as travel time, methods for determining route costs, preferred roads, and so on. This object is invalidated after the map is closed.

Methods

ResetPreferredRoads
ResetSpeeds
__________________
~ Now taking orders for MapPoint 2009 ~
~
~ Upgrade to MapForums Plus membership ~
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #10 (permalink)  
Old 11-08-2007
Junior Member
Yellow Belt
 
Join Date: Sep 2007
Posts: 16
Re: Different results from ActiveX Control and API

Thanks a lot!
I'll try it out and see what I can find.

Regards / Michael
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply


LinkBacks (?)
LinkBack to this Thread: http://www.mapforums.com/different-results-activex-control-api-6657.html

Posted By For Type Date
Apple Blog » Blog Archive » Different results from ActiveX Control and API This thread Pingback 11-05-2007 04:57 PM
Create 3D Map Video - Win a Free Zune from Microsoft - MapPoint News - MP2K Magazine This thread Refback 11-05-2007 06:48 AM
Merging Multiple Routes - MapPoint Articles - MP2K Magazine This thread Refback 11-04-2007 04:15 PM
Determing Whether A Point Is Located Inside Polygon - MapPoint Articles - MP2K Magazine This thread Refback 11-02-2007 07:43 AM
Programming MapPoint via .NET - MapPoint Articles - MP2K Magazine This thread Refback 11-02-2007 07:38 AM

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
Error using ActiveX control in VB 6 bgower MapPoint 2006/2009 Discussion 2 09-16-2005 08:40 AM
Re: Keyboard control in mappoint activex control djcapslock MapPoint 2006/2009 Discussion 1 03-10-2005 10:16 AM
mappoint ActiveX control 9.0 Anonymous MapPoint 2006/2009 Discussion 1 10-21-2004 06:22 AM
ActiveX Control Anonymous MapPoint 2006/2009 Discussion 3 09-04-2002 05:44 PM


All times are GMT -5. The time now is 01:38 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
MP2K Magazine
Visitor Map

Cheap flights to Athens
Book cheap flights to Athens on Holiday Hypermarket and you can book some great value accommodation too! Check it out online.

Online Travel Agent
Travel Counsellors is a Queen's Award winning online Travel Agent. Book your travel online with one of our agents.

Flights Canada
Our search results will show you a selection of airlines, travel agents and tour operators offering cheap flights to Canada. See for yourself who has the cheapest deals.

Holidays to Dominican Republic
Holidays to Dominican Republic offer a wealth of natural beauty and magnificent views. Come alive in the splendor of the Dominican Republic!

Holidays
For bargain holidays to destinations including Mexico, South Africa, India and more, visit ULookUBook online today. Check out our free travel guides to help you make an informed decision for your holidays.

Cheap Travel
For cheap travel options, visit Travel.co.uk and explore the benefits of our comparison site.

Holidays in Sharm el Sheikh
Need booking info on holidays in Sharm el Sheikh? Visit On The Beach for more information!


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51