Community of VE/MapPoint Users and Developers
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, ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| addpushpin - need help to get started 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 |
| |||
|
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();
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
| Quote:
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 |
| |||
|
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 ?
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
| Quote:
------------------------------------------------------ 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 |
| |||
|
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 ?
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
| Quote:
|
| |||
|
hi, glad it work for you
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
![]() |
| Tags |
| addpushpin, started |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| 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 |