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

zoom in on pushpin

This is a discussion on zoom in on pushpin within the MapPoint Desktop Discussion forums, part of the Map Forums category; Hi All I am using the following code to select a pushpin where mc1 = a ocx on the form. ...

  1. #1
    starbuck's Avatar
    starbuck is offline Member Green Belt
    Join Date
    Oct 2003
    Posts
    68

    zoom in on pushpin

    Hi All

    I am using the following code to select a pushpin where mc1 = a ocx on the form.

    Dim objPin As MapPoint.Pushpin

    Set objPin = mc1.ActiveMap.FindPushpin(veh_list)
    On Error GoTo er
    objPin.Select


    This works fine but what I also want to do is centre the map to the pin and then zoom in. Can anyone suggest the best way to do this

    Thanks in advance.

  2. #2
    Rainer is offline Junior Member White Belt
    Join Date
    Jan 2003
    Posts
    9
    Dim objPin As MapPoint.Pushpin

    Set objPin = mc1.ActiveMap.FindPushpin(veh_list)

    'try this:
    mc1.ActiveMap.DataSets.ZoomTo
    '-----------------------------------------------

    On Error GoTo er
    objPin.Select

  3. #3
    starbuck's Avatar
    starbuck is offline Member Green Belt
    Join Date
    Oct 2003
    Posts
    68

    zoom in on pushpin

    Hi Rainer
    Thanks for the reply, it works in that it centres on all the pins on the grid, I just want to zoom in on the highligted pin.

  4. #4
    Rainer is offline Junior Member White Belt
    Join Date
    Jan 2003
    Posts
    9
    Dim oRes As FindResults


    'Set objPin = mc1.ActiveMap.FindPushpin(veh_list)

    ' This will zoom the map to a particular pin
    ' (but maybe you won't like this yellow circle):
    Set oRes = mc1.ActiveMap.FindPushpin(veh_list).Location.FindN earby(0.1)
    ' i hope this helps -> greetings from germany
    'forget this:
    'mc1.ActiveMap.DataSets.ZoomTo
    '-----------------------------------------------

    On Error GoTo er
    objPin.Select

  5. #5
    Rainer is offline Junior Member White Belt
    Join Date
    Jan 2003
    Posts
    9
    'sorry for spamming again!
    ' the ultimate solution:

    Dim oLoc As Location
    Dim oPin As Pushpin
    Dim dbLat As Double
    Dim dbLon As Double


    Set oLoc = mc1.ActiveMap.FindPushpin(veh_list).Location
    Call CalcPos(mc1.ActiveMap, oLoc, dbLat, dbLon)
    mc1.ActiveMap.GetLocation(dbLat, dbLon, 0.1).GoTo

    'The CalcPos - routine you will find here: (Many thanks to Gilles!!!)
    'http://www.mp2kmag.com/articles.asp?ArticleID=13&key=extract.lat.lon

  6. #6
    starbuck's Avatar
    starbuck is offline Member Green Belt
    Join Date
    Oct 2003
    Posts
    68

    zoom in on pushpin

    Rainer, you are a star, many thanks bud.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Drawing / Zoom
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 04-04-2005, 07:59 AM
  2. Mappoint-ZOOM
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 10-28-2004, 08:56 AM
  3. Zoom to selection?
    By sthurlock in forum MapPoint Desktop Discussion
    Replies: 6
    Last Post: 12-10-2003, 07:53 PM
  4. Zoom In and Zoom Out event detection
    By victorf in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 10-22-2003, 01:56 AM
  5. Exclude a pushpin From Zoom
    By piazzat in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 09-05-2002, 10:12 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