MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




addpushpin - need help to get started

This is a discussion on addpushpin - need help to get started within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; I've only been programming for about 2 years but have done quite a bit of work with another map ocx, ...


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

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 12-17-2005
Junior Member
White Belt
 
Join Date: Dec 2005
Posts: 10
addpushpin - need help to get started

I've only been programming for about 2 years but have done quite a bit of work with another map ocx, however, I can't seem to get started with Mappoint. I am using MP2004 & VB6.
I am looking for someone to give me the 'simplest' example possible of adding a pushpin, based upon lat an lon (using the MappointControl1.control). This will be very much appreciated if I could see how to just only open a form and plot a single location (without all the other partial code snippets involved.

assume lat 26.10000 lon -81.10000
and fill in the form load event..........

Private Sub Form_Load()

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
  #2 (permalink)  
Old 12-17-2005
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,122
Hi,

Very simple

Code:
            double lat= 26.10000;
            double lon = -81.10000;
            Location loc = mp.ActiveMap.GetLocation(lat, lon, 1);
            Pushpin pp = mp.ActiveMap.AddPushpin(loc, "");
            loc.GoTo();
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 12-18-2005
Junior Member
White Belt
 
Join Date: Dec 2005
Posts: 10
Quote:
Originally Posted by Wilfried
Hi,

Very simple

Code:
            double lat= 26.10000;
            double lon = -81.10000;
            Location loc = mp.ActiveMap.GetLocation(lat, lon, 1);
            Pushpin pp = mp.ActiveMap.AddPushpin(loc, "");
            loc.GoTo();

Wilfried - Hi. Actually, what I was looking for was just the simplest (standalone) example of what would work, if I was to paste the example in the form load event. Just so that I can see that it works. and how the map control, location and pushpin objects are referenced. The above code looks good and easy to understand, but won't, by itself plot the pushpin.
Example:

Private Sub Form_Load()
...
...

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
  #4 (permalink)  
Old 12-18-2005
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,122
Hi,

I'm not sure I understeand your question. I tryed the code in a simple project and it works. So I dont understeand the prolbem. Can uou clarify what you means ?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5 (permalink)  
Old 12-18-2005
Junior Member
White Belt
 
Join Date: Dec 2005
Posts: 10
Quote:
Originally Posted by Wilfried
Hi,

I'm not sure I understeand your question. I tryed the code in a simple project and it works. So I dont understeand the prolbem. Can uou clarify what you means ?
Yes. I apologize, I didn't explain myself very well the first time. Since I'm using the MapControl< I was hoping to see how someone would reference the map control, loc obj and pp obj properly, etc. so that the above code would run. I thought if I could see everything inside the form load event, I would be able to understand better.
------------------------------------------------------
Private Sub Form_Load()
Mappointcontrol1.NewMap geoMapNorthAmerica

... <--------- ' whatever references are necessary for loc, pp,
... <---------- ' so that the code following with plot a pushpin


double lat= 26.10000;
double lon = -81.10000;
Location loc = mp.ActiveMap.GetLocation(lat, lon, 1);
Pushpin pp = mp.ActiveMap.AddPushpin(loc, "");
loc.GoTo();


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
  #6 (permalink)  
Old 12-19-2005
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,122
Hi,

I see. Whell the example I have given mp is the name of my MappointControl. So except loading the map what you already do nothing special to iniitalize. Does this answer your question ?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7 (permalink)  
Old 12-19-2005
Junior Member
White Belt
 
Join Date: Dec 2005
Posts: 10
Quote:
Originally Posted by Wilfried
Hi,

I see. Whell the example I have given mp is the name of my MappointControl. So except loading the map what you already do nothing special to iniitalize. Does this answer your question ?

Got it! Thanks for your patience!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8 (permalink)  
Old 12-19-2005
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,122
hi,


glad it work for you
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, started


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
Developing with MapPoint and Excel - Getting Started Eric Frost MP2K Magazine Articles 15 10-08-2008 01:14 PM
Getting Started with the Virtual Earth Map Control Eric Frost MP2K Magazine Articles 0 08-02-2005 04:39 PM
Getting Started with VB6 and MapPoint 2004 takk MapPoint 2006/2009 Discussion 3 12-08-2004 03:20 PM
AddPushPin Anonymous MapPoint 2006/2009 Discussion 0 03-01-2004 11:41 AM
addPushpin nringdahl MapPoint 2006/2009 Discussion 1 01-27-2004 10:09 AM


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


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