MapPoint Forums

MapForums

Community of VE/MapPoint 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

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #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


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 01:19 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

Family Ski Holidays France
Why not book family ski holidays in France? The diversity of French ski resorts are bound to have something to suit your family. Holiday Hypermarket will help you to finds great deals.

Cruise Travel Agent
Travel Counsellors is a leading Cruise Travel Agent. Visit the site to view details of your preferred Cruise Line.

Cape Town Flight
Book a Cape Town Flight for great value when you book through dealchecker.co.uk. It doesn't take long to find the latest great deals for you.

Barbados Holidays
Barbados holidays can be a wonderful break from the rat race or an exciting, action packed adventure. Plan the perfect holiday in Barbados.

Tunisia
Tunisia enjoys excellent weather, golden beaches and a beautiful blue sea. Moving away from the beach you will find a country that has a rich and varied past. Discover the secrets of history yourself by exploring all the ruins.

Travel
Before making a choice regarding travel, check out the amazing variety of options on Travel.co.uk.

Fuerteventura Holidays
Visit one of the closest Canary Islands to Africa! Book Fuerteventura holidays at On The Beach!


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