Community of MapPoint and Virtual Earth Users and Developers
This is a discussion on AddPushpin within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; I have an array with 3 columns and 100 rows. The first column is name, 2nd is latitude and 3rd ...
| |||||||
| Today's Posts | Twitter Feed | Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| AddPushpin I want to add pushpins to a map, with locations as above. How am I supposed to do that? Coding is in Visual Basic. Monique
__________________ Regards, Monique |
| ||||
|
Here is a little sample code that might help get you started. I'm using the Mappoint ActiveX control named MPC on my VB form. I'm creating a new map but you could get the activemap insted. Hope it helps. Dim arrData(99, 3) As String arrData(0, 0) = "BWI" arrData(0, 1) = 39.103 arrData(0, 2) = -76.401 arrData(1, 0) = "Duluth" arrData(1, 1) = 46.5033 arrData(1, 2) = -92.1125 Dim objmap As MapPointCtl.Map Set objmap = MPC.NewMap(geoMapNorthAmerica) For i = 0 To 99 If arrData(i, 0) = "" Then Exit Sub Set objLoc = MPC.ActiveMap.GetLocation(arrData(i, 1), arrData(i, 2), 1000) Set objPushpin = objmap.AddPushpin(objLoc, arrData(i, 0)) objPushpin.BalloonState = geoDisplayName Next
__________________ John http://www.support-pc.com Order MapPoint 2006 Here https://secure.mp2kmag.com/?refer=support-PC |
| |||
|
Instead of using a 3 column array i think it would be easy if you created your own datatype and declare an array of your datatype and fill your data in it. For example 1) create your own data type Type MPType Latitude as double Longitude as double Name as string end type 2) declare it dim x(100) as MPType 3) Fill it with your data x(0).Latitude=33.567 x(0).Longitude=33.567 x(0).Name="example" 4)find the locations and add a pushpins dim g_oApp as MapPoint.Application dim ppin as pushpin dim L as location dim i as integer while(i<100) Set L = g_oApp.ActiveMap.GetLocation(x(i).Latitude, x(i).Longitude) Set ppin = g_oApp.ActiveMap.AddPushpin(L,x(i).Name) ppin.Symbol = g_oApp.ActiveMap.Symbols(2) i=i+1 wend |
![]() |
| Tags |
| addpushpin |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| addpushpin - need help to get started | BWard | MapPoint 2006/2009 Discussion | 7 | 12-19-2005 02:15 PM |
| addpushpin problem | Anonymous | MapPoint 2006/2009 Discussion | 9 | 09-28-2004 09:12 AM |
| AddPushPin | Anonymous | MapPoint 2006/2009 Discussion | 0 | 03-01-2004 10:41 AM |
| addPushpin | nringdahl | MapPoint 2006/2009 Discussion | 1 | 01-27-2004 09:09 AM |
| AddPushpin with more data than Loc and name possible? | Anonymous | MapPoint 2006/2009 Discussion | 5 | 03-17-2003 06:11 PM |
Algarve Holiday
Portuguese all year round sunshine is some of what awaits you if you choose the Algarve holiday option through UlookUbook!