Community of VE/MapPoint Users and Developers
This is a discussion on Flows in mappoint 02 or 04 (arrows depending on the size of within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Good Afternoon, I've got a small question. I am trying to show flows in Mappoint but I do not manage ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Flows in mappoint 02 or 04 (arrows depending on the size of I've got a small question. I am trying to show flows in Mappoint but I do not manage to do it. Anybody has got an idea how I could do that ? Ok I'll give an exemple. Let's say I've got this information in excel: - New York -> Atlanta 30 Tons - New York -> Chicago 75 Tons - Chicago -> Denver 10 Tons - Denver -> New York 20 Tons (In fact i've got Zip Codes) I would like nice arrows, and with a size depending on the tonnage. I am ready to use some code or code a bit. Or if I have to buy another software pliz tell me. Thanks a lot for your help Edouard |
| ||||
|
Hope this helps to get you started. Code: Dim objmap As MapPointCtl.Map
Set objmap = MappointControl1.ActiveMap
Dim aShape As MapPointCtl.Shape
Dim aPushpin As MapPointCtl.Pushpin
Dim bPushpin As MapPointCtl.Pushpin
Set aPushpin = objmap.AddPushpin(objmap.FindResults("New York, NY").Item(1))
Set bPushpin = objmap.AddPushpin(objmap.FindResults("Atlanta, GA").Item(1))
Set aShape = objmap.Shapes.AddLine(aPushpin.Location, bPushpin.Location)
aShape.Line.BeginArrowhead = False
aShape.Line.EndArrowhead = True
aShape.Line.Weight = 7
aShape.Line.ForeColor = vbBlue
Set aPushpin = objmap.AddPushpin(objmap.FindResults("Chicago, IL").Item(1))
Set bPushpin = objmap.AddPushpin(objmap.FindResults("Denver, CO").Item(1))
Set aShape = objmap.Shapes.AddLine(aPushpin.Location, bPushpin.Location)
aShape.Line.BeginArrowhead = False
aShape.Line.EndArrowhead = True
aShape.Line.Weight = 10
aShape.Line.ForeColor = vbGreen
Set aPushpin = objmap.AddPushpin(objmap.FindResults("Denver, CO").Item(1))
Set bPushpin = objmap.AddPushpin(objmap.FindResults("New York, NY").Item(1))
Set aShape = objmap.Shapes.AddLine(aPushpin.Location, bPushpin.Location)
aShape.Line.BeginArrowhead = False
aShape.Line.EndArrowhead = True
aShape.Line.Weight = 2
aShape.Line.ForeColor = vbRed
__________________ John http://www.support-pc.com Order MapPoint 2006 Here https://secure.mp2kmag.com/?refer=support-PC |
| ||||
|
I have not tried it in VBA but I think if you just change the way you declare the var's/setup the app it will work. Try this. Code: Dim objApp As MapPoint.Application
Dim objMap As MapPoint.Map
Dim aPushpin As MapPoint.Pushpin
Dim bPushpin As MapPoint.Pushpin
Dim aShape As MapPoint.Shape
Set objApp = CreateObject("Mappoint.Application")
Set objMap = objApp.NewMap
Set aPushpin = objmap.AddPushpin(objmap.FindResults("New York, NY").Item(1))
Set bPushpin = objmap.AddPushpin(objmap.FindResults("Atlanta, GA").Item(1))
Set aShape = objmap.Shapes.AddLine(aPushpin.Location, bPushpin.Location)
aShape.Line.BeginArrowhead = False
aShape.Line.EndArrowhead = True
aShape.Line.Weight = 7
aShape.Line.ForeColor = vbBlue
Set aPushpin = objmap.AddPushpin(objmap.FindResults("Chicago, IL").Item(1))
Set bPushpin = objmap.AddPushpin(objmap.FindResults("Denver, CO").Item(1))
Set aShape = objmap.Shapes.AddLine(aPushpin.Location, bPushpin.Location)
aShape.Line.BeginArrowhead = False
aShape.Line.EndArrowhead = True
aShape.Line.Weight = 10
aShape.Line.ForeColor = vbGreen
Set aPushpin = objmap.AddPushpin(objmap.FindResults("Denver, CO").Item(1))
Set bPushpin = objmap.AddPushpin(objmap.FindResults("New York, NY").Item(1))
Set aShape = objmap.Shapes.AddLine(aPushpin.Location, bPushpin.Location)
aShape.Line.BeginArrowhead = False
aShape.Line.EndArrowhead = True
aShape.Line.Weight = 2
aShape.Line.ForeColor = vbRed
__________________ John http://www.support-pc.com Order MapPoint 2006 Here https://secure.mp2kmag.com/?refer=support-PC |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| arrows disappear after zoom out | Gerhard Faber | MapPoint 2006/2009 Discussion | 4 | 01-27-2006 03:00 AM |
| joining recordsets with arrows (II) | Anonymous | MapPoint 2006/2009 Discussion | 0 | 10-28-2003 06:37 AM |
| joining recordsets with arrows | Anonymous | MapPoint 2006/2009 Discussion | 1 | 10-22-2003 07:54 AM |
| Need help with map scrolling arrows please! | Anonymous | MapPoint 2006/2009 Discussion | 2 | 09-09-2003 10:29 AM |
| Inserting Arrows | Anonymous | MapPoint 2006/2009 Discussion | 1 | 01-25-2003 05:36 AM |
Flights to Antalya
Book flights to Antalya with Holiday Hypermarket to take advantage of cheap flights. You can enjoy plenty of watersports and some stunning scenery.
Family Holidays
Family holidays, ski holidays, cruises, luxury holidays. Whatever your travel needs your personal Travel Counsellor can help.
Holidays to Cuba
Situated between Jamaica and the Bahamas, Cuba has a delightful tropical climate and warm, clear waters with beaches of white sand. Check for cheap holidays to Cuba.
Cuba Holidays
Cuba holidays offer an exciting cultural and wonderful culinary experience. Book with The Holiday Place for a great deal.
Greece
Greece covers a large area and as a result there is an abundance of things to do, see and taste. You can relax on a beach, visit ancient sites or make a trip to one of the islands like Corfu, Crete or Rhodes.
Air Travel
Interested in air travel? Search and compare millions of holidays, flights and hotels with our help at Travel.co.uk
Sharm Holidays
See beautiful Egyptian sites! Info on Sharm holidays, only at On The Beach.