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

Zoom to Waypoint

This is a discussion on Zoom to Waypoint within the MapPoint Desktop Discussion forums, part of the Map Forums category; having a problem zooming to a waypoint. I have a route setup but cannot figure out how to zoom to ...

  1. #1
    BobIDEAS is offline Junior Member White Belt
    Join Date
    Jan 2003

    Zoom to Waypoint

    having a problem zooming to a waypoint. I have a route setup but cannot figure out how to zoom to a specified waypoint.

    also - zoom to route. this is an option in the EXE but i cannot find out how to do in code.

    using VB.NET with MP2K

    thanks in advance.

  2. #2
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002

    Zoom to Waypoint

    To zoom to a single waypoint, try the following untested code:

        mpApp.ActiveMap.Altitude = 10 ' Or whatever
    To zoom to multiple waypoints:
    mpApp.ActiveMap.Union(wp1, wp2, wp3).GoTo

  3. #3
    Gryffyn is offline Junior Member White Belt
    Join Date
    May 2004

    Proper Altitude Calculation and finding points within radius

    I just got done a little project and wanted to share something I figured out in case it helps other people who might have similar issues.

    Tasks: Given a point, find all pushpins within XX miles radius of that point. Also draw a circle showing the search area and zoom the image to show the full circle.

    Assuming you've already plotted your pushpins, gotten the Location Object for your search point and determined what radius you want to use. Here's how you do each step:

    ' Set altitude/zoom
    ' Notes: This was determined by trial and error but seems to work great
    objMap.Altitude = Round(radius + (radius * 3.25))
    ' Draw circle
    ' Notes: Ok, is MS just confused?  They say 'radius' but they must mean 
    ' X diameter and Y diameter.  So we multiple radius by 2
    objMap.Shapes.AddShape geoShapeOval, objORGLoc, radius * 2, radius * 2
    ' Find all pushpins within the circle
    ' Notes: objORGLoc is my 'origin location', the point I'm searching from
    ' orig_org is the name of the origin, the IF statement makes sure to
    ' exclude the pushpin for the origin location
    ' I also draw a line from origin to the pushpin to make it more visible
    Set objRecords = objMap.DataSets.Item(1).QueryCircle(objORGLoc, radius)
    Do While Not objRecords.EOF
        If objRecords.Pushpin.Name <> orig_org Then
            lngCount = lngCount + 1
            i = lngCount + 24
            Range&#40;"A" & i&#41;.Value = objRecords.Pushpin.Name
            Range&#40;"B" & i&#41;.Value = Round&#40;objORGLoc.DistanceTo&#40;objRecords.Pushpin.Location&#41;&#41;
            Set objLine = objMap.Shapes.AddLine&#40;objORGLoc, objRecords.Pushpin.Location&#41;
            objLine.Line.Weight = 1
            objLine.Line.ForeColor = vbBlue
            'objLine.ZOrder geoSendBehindRoads
            objLine.Line.EndArrowhead = False
        End If

    I thought with the radius/diameter mixup and the trial and error on the altitude calculation, that this information might be helpful to someone.

  4. #4
    Gryffyn is offline Junior Member White Belt
    Join Date
    May 2004
    Ok, I found another article that says that the zoom/altitude setting varies by screen size and resolution. Here's an article MS published on how to get the accurate zoom no matter what resolution or screen size:


    For reference, the application I was using was an Excel spreadsheet with MP embedded. A pretty small little box containing mappoint (too lazy to measure pixels right now, but it spans from A4 to F20 approx with roughly default Excel cell sizes... yeah, I'm being seriously lazy here, just aiming for a ballpark # to share with you guys).


Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Geocoordinates from a waypoint
    By chpw in forum MapPoint Desktop Discussion
    Replies: 6
    Last Post: 04-05-2006, 10:53 AM
  2. address from waypoint
    By starbuck in forum MapPoint Desktop Discussion
    Replies: 7
    Last Post: 11-18-2003, 09:04 AM
  3. Put a waypoint!
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 11-14-2003, 10:44 AM
  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. Route Waypoint Name
    By Vic in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 10-03-2002, 04:00 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