Welcome to MapForums!

Register, sign in, or use Facebook Connect above to join in and participate in the forum.

When you are signed in, this message, the ads in this row, and the red-underlined link ads all go away.

Subscribe to receive our newsletter.
Subscribe Unsubscribe
Results 1 to 8 of 8

addpushpin - need help to get started

This is a discussion on addpushpin - need help to get started within the MapPoint Desktop 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, ...

  1. #1
    BWard is offline 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

  2. #2
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433
    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();

  3. #3
    BWard is offline 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

  4. #4
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433
    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 ?

  5. #5
    BWard is offline 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

  6. #6
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433
    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 ?

  7. #7
    BWard is offline 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!

  8. #8
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Developing with MapPoint and Excel - Getting Started
    By Eric Frost in forum MP2K Magazine Articles
    Replies: 19
    Last Post: 11-22-2010, 10:18 PM
  2. Getting Started with VB6 and MapPoint 2004
    By takk in forum MapPoint Desktop Discussion
    Replies: 5
    Last Post: 08-17-2010, 06:34 PM
  3. Getting Started with the Virtual Earth Map Control
    By Eric Frost in forum MP2K Magazine Articles
    Replies: 0
    Last Post: 08-02-2005, 04:39 PM
  4. AddPushPin
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 03-01-2004, 11:41 AM
  5. addPushpin
    By nringdahl in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 01-27-2004, 10:09 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


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