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

Zooming to a fixed number

This is a discussion on Zooming to a fixed number within the MapPoint Desktop Discussion forums, part of the Map Forums category; Can I programmingly zoom the map to a fixed nymber such 1:25000? I see there is a slidebar for zooming. ...

  1. #1
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002
    Posts
    5,137

    Zooming to a fixed number

    Can I programmingly zoom the map to a fixed nymber such 1:25000?
    I see there is a slidebar for zooming. But how to do it in code?

  2. #2
    jdwhytie is offline Member Yellow Belt
    Join Date
    Jun 2004
    Posts
    37
    Use the altitude property.
    Returns or sets the altitude of the current map view, in GeoUnits (miles or kilometers). Lower altitudes zoom closer to the map, showing a smaller area with more detail. Higher altitudes zoom out from the map, showing a larger area with less detail. Read/write Double.
    Example
    Code:
      Sub ZoomInBySettingAltitude()
    
      Dim objApp As New MapPoint.Application
    
      'Set up the application
      objApp.Visible = True
      objApp.UserControl = True
    
      'Zoom in by setting the map altitude
      objApp.ActiveMap.Altitude = 10
    
      End Sub
    [/quote]

  3. #3
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002
    Posts
    5,137

    Thank you

    But what is the relationship between pixelSize and Altitude? Is there a formula between them?

  4. #4
    jdwhytie is offline Member Yellow Belt
    Join Date
    Jun 2004
    Posts
    37
    I'm not sure if there is some sort of formula or what, in the help file under PixelSize I found:
    The scale is never uniform across the screen, especially for flat maps. As the altitude is lower, the scale is more uniform.
    What is it that you are trying to do?

  5. #5
    Winwaed's Avatar
    Winwaed is offline Mapping-Tools.com Black Belt
    Join Date
    Feb 2004
    Location
    Irving,Texas
    Posts
    1,807
    Blog Entries
    52
    MS have written up some code about how to convert "zoom to show X miles width" to altitude:

    http://support.microsoft.com/?kbid=297348

    They require screen size and resolution.
    Also note the aspect ratio calculation.


    I preferred to use a rule-of-thumb calculation which seems to work pretty well.


    Richard
    Winwaed Software Technology LLC
    http://www.winwaed.com
    See http://www.mapping-tools.com for MapPoint Tools

  6. #6
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002
    Posts
    5,137

  7. #7
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002
    Posts
    5,137

    Great

    Winwaed offers is just what I want.

    Thank you again.

    Chester

  8. #8
    Gryffyn is offline Junior Member White Belt
    Join Date
    May 2004
    Posts
    9
    Hmm.. that's odd. I'll have to play with MS's stuff sometime.

    I just created a tool that programatically finds all the pushpins within a certain radius of a location, draws a circle showing the radius searched and zooms to emcompass the circle drawn.

    You can find my complete writeup at:
    http://www.mp2kmag.com/mappoint/disc...?p=10457#10457

    Basically, the altitude calculation I came up with was:

    objMap.Altitude = Round(radius + (radius * 3.25))

    Seems a lot simpler than MS's monitor size and all that. But maybe their thing makes sense. I havn't tested mine on multiple monitor sizes. If this information is useful and as accurate as MS's info, it can save you a lot of gobbledegook code.

    -TG

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Glitch in GPS Magic Fixed
    By P_Hairy in forum News and Announcements
    Replies: 0
    Last Post: 10-10-2005, 07:49 AM
  2. FIXED: Type Mismatch in DisplayDataMap
    By gavin in forum MapPoint Desktop Discussion
    Replies: 5
    Last Post: 08-22-2005, 03:50 AM
  3. Zooming question
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 3
    Last Post: 09-29-2003, 04:41 PM
  4. Zooming Mappoint with VB6
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 07-23-2003, 01:52 PM
  5. geoShowByZoomLevel - Not zooming?
    By mikechayes in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 02-13-2003, 02:45 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 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81