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

Displaying a label with each pushpin

This is a discussion on Displaying a label with each pushpin within the MapPoint Desktop Discussion forums, part of the Map Forums category; Greetings, I'm having a hard time getting any label to display with a pushpin. I CAN get the baloons to ...

  1. #1
    BobFromBoston is offline Senior Member Green Belt
    Join Date
    Jul 2005
    Posts
    128

    Displaying a label with each pushpin

    Greetings,

    I'm having a hard time getting any label to display with a pushpin. I CAN get the baloons to display, but those have a Windows Close box on them. And I find it annoying for MapPoint to serially number each pushpin, 1,2,3, and on.

    Is there a way to override this automatic behavior and for me to define what the label will say?

    Thanks.

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

    Can you please explain what exacly the problem is ? I do not understeand (my native language is not english), but in my balloons it displayes exacly what I want. I do not understeand the eniummeration you tell us.

    If you have trouble with the 'x' button to close the balloons then you can eventually redesplay them if a positsion is upgraded. but you have to tell wht you wants.

  3. #3
    BobFromBoston is offline Senior Member Green Belt
    Join Date
    Jul 2005
    Posts
    128

    Balloons will be good enough

    Hi,

    I was trying to find a different way to display test about a pushpin location, but I decided the balloons will work for me. They are easy to work with and will dispay what I want. The real problem I have is that when I display a route, MapPoint displays the waypoints, which are problematic for me.

    I use the same base station (a pizza shop) as the start and end point for lots of routes (pizza delivery runs), which means that MapPoint will need to draw each waypoint number associated with the base station. You know how MP draws the waypoints if the driver departs the base, makes two deliveries, and comes home again? The base station gets a waypoint of 1 AND 4. If I have three delivery runs to show at the same time, and if one run is a single, one run is a double, and another run is a triple, the base station will have waypoints numbered 1,3,4,5, which is very confusing for someone to look at. I'd rather suppress waypoing labels, but don't know how.

    Anybody know how to suppress it?

    Thanks,
    Bob

  4. #4
    Mohamed is offline Member Green Belt
    Join Date
    Mar 2005
    Posts
    97
    Hi,

    I think the idea is not to delete the waypoint numbers ( I think it is not possible ), but to REORDER them programmatically.

    The other idea is to delete the Route after each calculation and let
    a pushPin or Text in each Waypoint.

    For the first idea, you can see this example and see how to do it.


    Code:
    Sub ReorderSecondStop()
    
      Dim objApp As New MapPoint.Application
      Dim objMap As MapPoint.Map
      Dim objRoute As MapPoint.Route
    
      'Set up the application
      Set objMap = objApp.ActiveMap
      Set objRoute = objMap.ActiveRoute
      objApp.Visible = True
      objApp.UserControl = True
    
    
      'Add two waypoints
      objRoute.Waypoints.Add objMap.FindResults("Seattle, WA").Item(1)
      objRoute.Waypoints.Add objMap.FindResults("Redmond, WA").Item(1)
    
    
      'Make second waypoint the start point
      objRoute.Waypoints.Item(2).Reorder geoMoveToTop
    
    ' The other values are  // See the help file for more explanations
    ' geoMoveDown,  3 
    ' geoMoveToBottom 1  
    ' geoMoveToTop 0  
    ' geoMoveUp 2  
    
      End Sub

    Regards

  5. #5
    marktherob2001 is offline Junior Member White Belt
    Join Date
    Feb 2007
    Posts
    5

    Thumbs down Re: Displaying a label with each pushpin

    The following code is run from EXCEL and creates a map from columns in a spreadsheet. As below. I would like to take the second column Drop Number (strloca) and put it in the label ahead of the address line. Only the address shows up there. I haven’t been able to get this to work. I think it’s in the add waypoint function that I need to do this. Do you have any suggestions ?

    Regards Mark





    Dim oApp As MapPoint.Application

    Private Sub CommandButton1_Click()

    On Error Resume Next

    Dim strLoc As String
    Dim strLoca As String
    Dim strLocb As String
    Dim strLocd As String
    Dim strLoc1 As String
    Dim strLoc2 As String
    Dim strLoc3 As String
    Dim rowptr As Integer

    rowptr = 1


    Set oApp = CreateObject("MapPoint.Application.NA.13")



    oApp.Visible = True
    Set objMap = oApp.NewMap()

    'code goes here to add to route

    Dim objRoute As MapPoint.Route
    Set objRoute = objMap.ActiveRoute

    ' get data from row in excel

    Do
    strLoc0 = Worksheets("Sheet1").Cells(rowptr, 1)
    strLoca = Worksheets("Sheet1").Cells(rowptr, 2)
    strLocb = Worksheets("Sheet1").Cells(rowptr, 4)
    strLoc1 = Worksheets("Sheet1").Cells(rowptr, 5)
    strLoc2 = Worksheets("Sheet1").Cells(rowptr, 6)
    strLoc3 = Worksheets("Sheet1").Cells(rowptr, 7)



    If (strLoc0 <> “”) Then

    ' skip header row

    If (strLoc0 <> "Route key") Then

    ' concatenate data into a string if there is data

    strLoc = strLoc1 + "," & strLoc2 + "," & strLoc3

    ' concatenate drop and Name for pushpin

    strLocd = strLoca + "," & strLocb

    objRoute.Waypoints.Add objMap.FindResults(strLoc).Item(1)

    'add pushpin

    Set objLoc = objMap.FindAddressResults( _
    Worksheets("Sheet1").Cells(rowptr, 5), _
    Worksheets("Sheet1").Cells(rowptr, 6), _
    Worksheets("Sheet1").Cells(rowptr, 7))(1)

    objMap.AddPushpin objLoc, strLocd

    End If

    End If
    rowptr = rowptr + 1
    Loop While (strLoc0 <> “”)


    objRoute.Calculate


    'Zoom to the route



    End Sub


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

    Re: Displaying a label with each pushpin

    Hi,

    I'm not sure I understeand what you mean. Do you wants to give a name to a waypoint that it has to display ? Then this is how you do:

    Code:
    objRoute.Waypoints.Add(location, name)

    Can you next time put your code into [ code] [ /code] tags (without the spaces) please ?

  7. #7
    marktherob2001 is offline Junior Member White Belt
    Join Date
    Feb 2007
    Posts
    5

    Re: Displaying a label with each pushpin

    That is exactly what I needed. Many thanks.



    Regards Mark

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Label Waypoints
    By MD2000 in forum MapPoint Desktop Discussion
    Replies: 10
    Last Post: 11-07-2006, 03:57 AM
  2. Displaying a Tool Tip when hovering over a pushpin
    By BobFromBoston in forum MapPoint Desktop Discussion
    Replies: 4
    Last Post: 03-18-2006, 04:17 AM
  3. Displaying Balloon on Pushpin
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 11
    Last Post: 01-31-2005, 03:53 PM
  4. Working with Baloons & Name (label)
    By Anonymous in forum Wish List
    Replies: 2
    Last Post: 11-26-2002, 06:07 AM
  5. specify label to all the objects of a layer
    By Anonymous in forum Wish List
    Replies: 0
    Last Post: 08-28-2002, 08:22 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 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