MapPoint Forums

MapForums

Community of MapPoint and Virtual Earth Users and Developers




AddPushpin

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 ...


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 08-19-2002
Junior Member
White Belt
 
Join Date: Aug 2002
Posts: 3
AddPushpin

I have an array with 3 columns and 100 rows. The first column is name, 2nd is latitude and 3rd is longitude.

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
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 08-19-2002
John Meyer's Avatar
Senior Member
Blue Belt
 
Join Date: Jul 2002
Posts: 479
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 08-19-2002
Junior Member
White Belt
 
Join Date: Aug 2002
Posts: 11
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4 (permalink)  
Old 08-20-2002
Junior Member
White Belt
 
Join Date: Aug 2002
Posts: 3
Thank you

These code samples of you, John and Amanuel, will help me out!


Greetings,
Monique Vrolijk
__________________
Regards,
Monique
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
addpushpin


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


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

Algarve Holiday
Portuguese all year round sunshine is some of what awaits you if you choose the Algarve holiday option through UlookUbook!



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