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

Pushpins in current view

This is a discussion on Pushpins in current view within the MapPoint Desktop Discussion forums, part of the Map Forums category; Hello, Is there an easy way to get all the pushpins in the current map view? (Mappoint 2004) Now I ...

  1. #1
    vanDijk is offline Junior Member White Belt
    Join Date
    Nov 2007
    Posts
    4

    Pushpins in current view

    Hello,

    Is there an easy way to get all the pushpins in the current map view? (Mappoint 2004)

    Now I have the following solution:

    MapPoint.Location[] locations = new MapPoint.Location[5];
    locations[0] = myMap.XYToLocation(myMap.Left, myMap.Top);
    locations[2] = myMap.XYToLocation(myMap.Left, myMap.Height);
    locations[4] = myMap.XYToLocation(myMap.Width, myMap.Height);
    locations[6] = myMap.XYToLocation(myMap.Width, myMap.Top);
    locations[8] = myMap.XYToLocation(myMap.Left, myMap.Top);

    and then a do a QueryPolygon on my dataset.

    Is there another (better/easier) way to do this?

    Thanks


  2. #2
    tfmiltz is offline Member Green Belt
    Join Date
    Feb 2005
    Posts
    52

    Cool Re: Pushpins in current view

    Not sure if you are are working in vb6 or what lang.

    Or with Dataset

    but perhaps the following will help bring further insight:

    The useful bit I found in a similar pursuit was the QueryAllRecords

    I've got some other non-relevant info here (some might say more than less !) just ignore that though.

    'For each pushpin, output the lat/lon and symbol lines.
    For Each objDataSet In m_objMap.DataSets
    Set objRecordset = objDataSet.QueryAllRecords
    objRecordset.MoveFirst
    Do Until objRecordset.EOF
    CalcPos m_objMap, objRecordset.Pushpin.Location, dblLat, dblLon
    m_colMIFLines.Add "Point " & CStr(Round(dblLon, 6)) & " " & CStr(Round(dblLat, 6)) & vbCrLf
    m_colMIFLines.Add " Symbol (44,13395711,10)" & vbCrLf
    strnote = ""
    'Add information in the balloon and note fields to the data to be written.
    For Each objField In objRecordset.Fields
    If objField.VisibleInBalloon Then
    strnote = strnote & objField.Name & ": " & CStr(objField.Value) & "> "
    End If
    Next
    If Len(strnote) >= 2 Then
    strnote = left$(strnote, (Len(strnote) - 2))
    End If
    If objRecordset.Pushpin.Note <> "" Then
    strnote = strnote & IIf(strnote <> "", "> Note: ", "") & objRecordset.Pushpin.Note
    End If

    'Add a data line to the mid file, including the pushpin data and symbol.
    m_colMIDLines.Add Chr$(34) & objRecordset.Pushpin.Name & Chr$(34) & "," & CStr(m_lObjectCount) & "," & objRecordset.Pushpin.Symbol & ",0," & Chr$(34) & left$(strnote, 255) & Chr$(34) & vbCrLf

    'Update the object count.
    ' frmSpatialDataImport.lblRecordCount.Caption = "Shape Count: " & m_lObjectCount
    DoEvents
    m_lObjectCount = m_lObjectCount + 1
    objRecordset.MoveNext
    Loop
    Next


    Tim Miltz
    Last edited by tfmiltz; 11-02-2007 at 03:47 AM. Reason: didn't sign

  3. #3
    vanDijk is offline Junior Member White Belt
    Join Date
    Nov 2007
    Posts
    4

    Re: Pushpins in current view

    Thanks for your reply.
    I am working in C# .Net.
    To explain further, my goal is to get only the PushPins visible in the current view.
    I have a MapPoint dataset containing al the puspins that are placed on the map. Now I want a subset of this dataset containing only that pushpins that are visible in the current view of the map.

    E. van Dijk

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

    Re: Pushpins in current view

    Hi,

    Then calculate lat/long of the 4 corners of the map in view and you can easy calculate wht is in view or not

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Stop Users from Deleting or Cutting Pushpins from map view
    By Yazzy in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 05-26-2005, 02:56 PM
  2. Saving current view of map
    By radiusdude in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 04-05-2005, 07:36 AM
  3. Getting current GPS coordinates in VB6
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 06-10-2004, 05:09 PM
  4. get longitude/latidude of current view programmaticly
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 03-10-2004, 04:45 PM
  5. Is it possible to expand upon the current 255 push....
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 04-16-2002, 09:32 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