MapPoint Forums

MapForums

Community of MapPoint and Virtual Earth Users and Developers




I am trying to write some code which mimicks the b....

This is a discussion on I am trying to write some code which mimicks the b.... within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; I am trying to write some code which mimicks the behaviour of clicking on a direction line in a calculated ...


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

Today's Posts Twitter Feed 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 11-24-2001
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
I am trying to write some code which mimicks the behaviour of clicking on a direction line in a calculated route, i.e. the map is zoomed to show a good view of this road segment in green, the turn is highlighted blue, a pushpin is placed at the turn location with the pop-up text being the turn instruction.

I have tried the following code:
Dim oMap As MapPoint.Map
Dim oRte As MapPoint.Route
Set oMap = GetObject(, "MapPoint.Application").ActiveMap
Set oRte = oMap.ActiveRoute

oRte.Waypoints.Add oMap.FindAddressResults(, "London", , ) (1)
oRte.Waypoints.Add oMap.FindAddressResults(, "Birmingham", , ) (1)
oRte.Calculate

Dim i As Integer
Dim loc As MapPoint.Location
For i = 1 to oRte.Directions.Count
loc := oRte.Directions.Item[i].Location
loc.GoTo
loc.Highlight = true
MsgBox "Here is a turn"
Next i

This runs, but the behaviour is not as expected. The locations returned display larger sections of the route, and is centered on what seems an arbitary point, there is no highlighting, and no pushpin.

Can anyone help with reproducing this behaviour.

Thanks Brian
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 11-24-2001
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
Try "oRte.Directions(i).Select".

For example:

Sub Test()
Dim oMap As MapPoint.Map
Dim oRte As MapPoint.Route
Set oMap = GetObject(, "MapPoint.Application").ActiveMap
Set oRte = oMap.ActiveRoute
oRte.Waypoints.Add oMap.FindResults("Seattle, Washington")(1)
oRte.Waypoints.Add oMap.FindResults("Tacoma, Washington")(1)
oRte.Calculate

oRte.Directions(2).Location.GoTo
oRte.Directions(2).Select

End Sub

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
code, mimicks, write


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
Using MapPoint to write to database strattonn MapPoint 2006/2009 Discussion 4 11-24-2003 09:51 PM
I am trying to write code that centers the map on .... Anonymous MapPoint 2006/2009 Discussion 1 06-19-2002 04:18 AM
I write an application that similar to find functi.... Anonymous MapPoint 2006/2009 Discussion 1 03-09-2002 10:48 PM
I'm trying to write a VB MapPoint app that assists.... Anonymous MapPoint 2006/2009 Discussion 1 08-26-2001 09:56 AM
I am attempting to write a com addin for mappoint .... Anonymous MapPoint 2006/2009 Discussion 1 03-14-2001 09:44 AM


All times are GMT -5. The time now is 12:00 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0 RC2
MP2K Magazine
Visitor Map

Dalaman Holiday
Enjoy a wonderfully peaceful Dalaman holiday... Book through UlookUbook and save!



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 56 57 58 59