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
Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16

Pushpin Names

This is a discussion on Pushpin Names within the MapPoint Desktop Discussion forums, part of the Map Forums category; sorry - that was me, not guest....

  1. #11
    Mudrover is offline Junior Member Yellow Belt
    Join Date
    Jan 2005
    Posts
    13
    sorry - that was me, not guest.

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

    Just use 'FindPushPin(name)' to return the pushpin wiht the name

  3. #13
    Mudrover is offline Junior Member Yellow Belt
    Join Date
    Jan 2005
    Posts
    13
    I did that and that works great, if I knew every pushpin name, in each set, which I don't or wont.

    I was trying to query each set and have then names in a list box, each time the application loads, because I may update the map from time to time and the names may change or more pushpins maybe added.

    Working off of memory I'm doing this..

    Code:
    Dim objDataSet As MapPointCtl.DataSet
    Dim objRecordSet As MapPointCtl.Recordset
    
    Set objDataSet = objMap.DataSets("Market 2303")
    Set objRecordSet = objDataSet.QueryAllRecords
    Market 2303, being one of my pushpin sets. Does this properly query my pushpin set?

    Then I think the rest of my code is garbage.

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

  5. #15
    Mudrover is offline Junior Member Yellow Belt
    Join Date
    Jan 2005
    Posts
    13
    Okay, looking around here and scratching my head, I came up with this. Here's what I have to populate my list box, and it works great.

    Code:
    Public Sub Market1()
    Dim objMap As MapPointCtl.Map
    Set objMap = MappointControl1.ActiveMap
    Dim objDataSet As MapPointCtl.DataSet
    Dim objRecordset As MapPointCtl.Recordset
    Set objDataSet = objMap.DataSets("Market 2303")
    Set objRecordset = objDataSet.QueryAllRecords
    Do While Not objRecordset.EOF
     If InStr(1, objRecordset.Pushpin.Name, "", vbTextCompare) Then
        List1.AddItem objRecordset.Pushpin.Name
     End If
    objRecordset.MoveNext
    Loop
    End Sub
    But here's what I have when I click on the pushpin name, its not working..


    Code:
    Private Sub List1_Click()
    Dim objMap As MapPointCtl.Map
    Set objMap = MappointControl1.ActiveMap
    Dim objLoc As MapPointCtl.Location
       Set objLoc = objMap.GetLocation(List1.Index)
    objLoc.GoTo
    End Sub

    Is that "getlocation" supposed to be "findpushpin" ?

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

    You add pushpin names to your listbox, so you have to find the pushpin by name when you click on the listbox. Something like this:

    Code:
        PushPin PP = MP.ActiveMap.FindPushpin(TheName);
        if (PP != null)
            PP.GoTo();
    Alternatively you can get the Location from the pushpin and use this (but this is driving around):

    Code:
        PushPin PP = MP.ActiveMap.FindPushpin(TheName);
        if (PP != null) {
            Location Loc = PP.Location;
            Loc.Goto();
        }
    Another alternative is that you hold an array of pushpins, or an array of structure that hold a location object and a pushpin name. Then you control the 'finding' yourself. It is probably faster also.

Page 2 of 2 FirstFirst 12

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Street Names etc...
    By Milo in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 04-27-2005, 03:16 PM
  2. Show All Names in Set
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 12-11-2003, 10:28 AM
  3. street names
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 06-04-2003, 07:49 AM
  4. Is there a way of getting rid of all the names of ....
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 07-24-2001, 03:10 AM
  5. Also, can I delete the state names and city names ....
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 08-29-2000, 01:57 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