MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




So how do i get it to calculate teh distance betwe....

This is a discussion on So how do i get it to calculate teh distance betwe.... within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; So how do i get it to calculate teh distance between two places on a form and return the distance ...


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

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read



Click here to register

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-19-2001
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
So how do i get it to calculate teh distance between two places on a form and return the distance and cost of travelling.
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 12-19-2001
Senior Member
Green Belt
 
Join Date: Aug 2002
Posts: 124
The simplest way is to add waypoints, calculate a route and then use the cost and distance properties of the route. For example, from the VB reference:


Dim objApp As New MapPoint.Application

Dim objMap As MapPoint.Map

Dim objRoute As MapPoint.Route


'Set up application

Set objMap = objApp.ActiveMap

Set objRoute = objMap.ActiveRoute

objApp.Visible = True

objApp.UserControl = True


'Add route stops and calculate the route

objRoute.Waypoints.Add objMap.FindResults("Seattle, WA").Item(1)

objRoute.Waypoints.Add objMap.FindResults("Redmond, WA").Item(1)

objRoute.Calculate


'Output the total length and cost of the route

MsgBox "The route distance is: " + CStr(objRoute.Distance)

MsgBox "Cost of route: $" + CStr(objRoute.Cost)


- Walt Cygan
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

Tags
betwe, calculate, distance, teh


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
How to calculate distance using Mappoint and VB digish MapPoint 2006/2009 Discussion 0 02-27-2004 04:40 PM
How to calculate distance between 2 location with vba ifc MapPoint 2006/2009 Discussion 1 02-25-2004 09:01 AM
how to calculate distance between 2 towns Anonymous MapPoint 2006/2009 Discussion 3 06-06-2003 03:51 PM
Can MapPoint calculate the distance and cost betwe.... Anonymous MapPoint 2006/2009 Discussion 1 12-19-2001 07:50 AM
I would like to calculate the distance from multip.... Anonymous MapPoint 2006/2009 Discussion 1 10-31-2001 04:39 AM


All times are GMT -5. The time now is 07:07 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


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 52 53 54 55