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

Zoom to display all points

This is a discussion on Zoom to display all points within the Development forums, part of the MapPoint Desktop Discussion category; Hi, I am programming in c# using mappoint. I got some "locations" and I would like that my map fits ...

  1. #1
    zanifu is offline Junior Member White Belt
    Join Date
    Dec 2008
    Posts
    4

    Zoom to display all points

    Hi,

    I am programming in c# using mappoint. I got some "locations" and I would like that my map fits to this locations.

    Someone may help me plz.

    ps: sorry for my bad english (I'm french).

    Zanifu.

  2. #2
    Mattys Consulting's Avatar
    Mattys Consulting is offline Senior Member Black Belt
    Join Date
    Dec 2002
    Posts
    1,040

    Re: Zoom to display all points

    zanifu,

    Create an array of locations and use objMap.Union(Array)

    Mike Mattys

  3. #3
    zanifu is offline Junior Member White Belt
    Join Date
    Dec 2008
    Posts
    4

    Re: Zoom to display all points

    Hi

    Thanks a lot.
    I would like to zoom out only when a point go out of the map.
    How I detect that the point is out of the map?

    Zanifu.

  4. #4
    Mattys Consulting's Avatar
    Mattys Consulting is offline Senior Member Black Belt
    Join Date
    Dec 2002
    Posts
    1,040

    Re: Zoom to display all points

    I haven't tried this ...

    [On Error Resume Next (Try...Catch)]

    Get the location of the pin from the dataset
    and then LocationToX - you will get an error
    if it is not on the screen.

    Mike Mattys

  5. #5
    zanifu is offline Junior Member White Belt
    Join Date
    Dec 2008
    Posts
    4

    Re: Zoom to display all points

    Hi,

    Thanks for the answer.
    I picked the border lat and long to compare to my points.
    Code:
    double maxLat = map.XYToLocation(0, 0).Latitude;
    double minLat = map.XYToLocation(map.Width, map.Height).Latitude;
    double maxLong = map.XYToLocation(map.Width, map.Height).Longitude;
    double minLong = map.XYToLocation(0, 0).Longitude;
    
    foreach(MapPoint.Location location in locations)
    {
      if (location.Latitude < minLat) { resize = true; }
      if (location.Latitude > maxLat) { resize = true; }
      if (location.Longitude < minLong) { resize = true; }
      if (location.Longitude > maxLong) { resize = true; }
    }

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. How to display multiple points on the Map
    By Naveen in forum MapPoint Desktop Discussion
    Replies: 3
    Last Post: 11-03-2008, 04:13 AM
  2. display multiple points on the Map
    By Naveen in forum Development
    Replies: 0
    Last Post: 10-31-2008, 11:32 AM
  3. Simple way to display data points & assoc information
    By Steve in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 09-01-2008, 09:09 AM
  4. Displaying several points on one map using C#
    By MD2000 in forum MapPoint Desktop Discussion
    Replies: 3
    Last Post: 02-17-2005, 10:14 AM
  5. Zoom In and Zoom Out event detection
    By victorf in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 10-22-2003, 01:56 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 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127