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

How to access to an array of pushpins that were added ?

This is a discussion on How to access to an array of pushpins that were added ? within the MapPoint Desktop Discussion forums, part of the Map Forums category; Hi I have an application that : 1- displays a map 2- retrieves coordinates from a remote application 3- add ...

  1. #1
    Jaba is offline Junior Member Yellow Belt
    Join Date
    Jan 2005
    Posts
    21

    How to access to an array of pushpins that were added ?

    Hi

    I have an application that :

    1- displays a map
    2- retrieves coordinates from a remote application
    3- add these coordinates on a map as pushpins

    I would like to know if there's a way to access to these pushpins with an array ? I need to show the label of a selected pushpin only and I need to access to an array of all the pushpins that were added to the map...

    Is that possible ?

  2. #2
    Winwaed's Avatar
    Winwaed is offline Mapping-Tools.com Black Belt
    Join Date
    Feb 2004
    Location
    Irving,Texas
    Posts
    1,859
    Blog Entries
    60
    Yes, they're stored as "pushpin sets". You can have multiple pushpinsets, but you have probably added your pushpins to the default "My Pushpins".
    This in turn is a "Recordset". If you look up "Recordset" in the help it will show you how to access them.

    Eg. to get the names of the pushpins in VB6, I have the following code:
    Code:
    ' pushpinset,  dsidx is an index that is passed in
    ' you could query oMap.DataSets until you find the required pushpinset
    Dim oDS As MapPoint.DataSets
    Set oDS = oMap.DataSets
    Dim thisDS As MapPoint.DataSet
    Set thisDS = oDS.Item(dsidx)
            
    ' loop over each pushpin, saving the name
            
    Dim oRS As MapPoint.Recordset
    Set oRS = thisDS.QueryAllRecords()
            
    Dim n As Long
    n = thisDS.RecordCount
            
    ReDim SrcNameArray(n) As String
            
    oRS.MoveFirst
    Dim ii As Integer
    ii = 0
    Do While Not oRS.EOF
             ii = ii + 1
             Set pp = oRS.Pushpin
             SrcNameArray(ii) = pp.Name
             oRS.MoveNext
    Loop

    The above is an extra of a program I have - I've taken out some extra code to keep things simple and easier to understand what is happening.
    Combined with the help that comes with MapPoint, it should get you going!


    Richard
    Winwaed Software Technology LLC
    http://www.winwaed.com
    See http://www.mapping-tools.com for MapPoint Tools

  3. #3
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002
    Posts
    5,137
    Thank you... But I work in C#...

    Anyway I've found an alternative but very specific to my code (using ID in a listbox...) so posting the source wouldn't be helpful for anyone...

    Anyway your source could help me because I work on many projects

    Thanks!!!

  4. #4
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433
    Quote Originally Posted by Jaba-
    I've found an alternative
    Possible that your alternative way can benefit other. If you like to post code snippets it should be very welcome !

  5. #5
    Jaba is offline Junior Member Yellow Belt
    Join Date
    Jan 2005
    Posts
    21
    I won't post the code because there are many parts... and these are very specific to my source code... But I can describe how to do :

    The purpose is to add pushpins on a map and access them individually without using datasets

    1- Add many pushpins on the control with AddPushpin() function
    1b- For each added pushpin, add a value in a listbox
    1c- The value in the listbox must be unique and must also be assigned to the PushPin.Name property

    2- When the user need to find a pushpin, he must click on a value in the listbox and then we search for the clicked pushpin by FindPushpin(ClickedValueInList) function

    Thats'all folks

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Filtering pushpins..Updating MapPoint by Microsoft Access
    By Rodde in forum MapPoint Desktop Discussion
    Replies: 4
    Last Post: 11-18-2005, 05:22 AM
  2. UpdateLink / PushPins / Access DB / HELP!!!
    By SeanMcGinty in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 12-13-2004, 06:31 PM
  3. Access Pushpins
    By johnnyo in forum MapPoint Desktop Discussion
    Replies: 4
    Last Post: 01-08-2004, 07:15 AM
  4. Adding pushpins and viewing map from access project
    By Dazzer in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 11-07-2003, 06:09 AM
  5. Using MP2002 I've added some pushpins to a map via....
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 07-18-2001, 02:01 PM

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 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 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96