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

MapPoint ActiveX-Control: Zoom Area

This is a discussion on MapPoint ActiveX-Control: Zoom Area within the MapPoint Desktop Discussion forums, part of the Map Forums category; Hi, i'm working with C# and the AxMapPointControl and want to realize the following problem: I draw several lines on ...

  1. #1
    suamikim is offline Junior Member White Belt
    Join Date
    Nov 2005
    Posts
    9

    MapPoint ActiveX-Control: Zoom Area

    Hi,

    i'm working with C# and the AxMapPointControl and want to realize the following problem:

    I draw several lines on my map at a stretch. After the drawing i add 2 Pushpins to the start- and end-position.

    Now i want to Zoom-In the wohl drawing (all Lines and the Start- and Stop-Pushpin). Unfortunately i don't know, how to do this. I've tried a little with the SelectedArea.SelectArea(...)-Method, but don't get pretty far with it.

    Hope, that anybody can help me!

    mike

    ps.: Wehre can i find a good help for the MapPoint Active-X-Control? I've searched the MSDN but can't find anything helpfull.

  2. #2
    suamikim is offline Junior Member White Belt
    Join Date
    Nov 2005
    Posts
    9
    Ok, after a little trial & error i've managed to select the area i want, but i don't know how to zoom into that area.

    To help you understand, what i want to do, i've made a little screenshot, of my program, after the painting an selecting:



    I know that the selected area is a little small, but it's just a test and it will be larger in real.

    So how can i zoom into that selected area programmatically?

    mike

    edit:

    Here is a little cut-out from my code:

    Code:
    top = minY - 10;
    height = Math.Max(20, maxY - minY + 20);
    left = minX - 10;
    width = Math.Max(20, maxX - minX + 20);
    
    activeMap.SelectedArea.SelectArea(top, left, width, height);
    Last edited by suamikim; 08-16-2006 at 11:37 AM.

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

    If you want to zoom to the whole fleet of pushpins you have then it is very simple, just like this:

    Code:
                object o = "My Pushpins";
                MapPoint.DataSet ds = MP.ActiveMap.DataSets.get_Item(ref o);
                ds.ZoomTo();
    if You want to select a part of your pushpins, then you can draw a shape, select the shape, query all pushpins in it, move the selection to another dataset, and also then use ZoomTo() to this dataset. But at this moment the pushpins are removed from the "My Pushpins" dataset.

    If the latter is what you want then I puzzle some code as example if you wants.

    Maybe there are other solutions as whell. this is the one from the top of my head

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

    Just thingking on something. To zoom to your area is probably very simple. Try this (not tested so could be syntax or other wierd errors in it):

    Code:
    top = minY - 10;
    height = Math.Max(20, maxY - minY + 20);
    left = minX - 10;
    width = Math.Max(20, maxX - minX + 20);
    SelectedArea area = activeMap.SelectedArea.SelectArea(top, left, width, height);
    Location loc = area.Location;
    loc.Goto();

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Re: Keyboard control in mappoint activex control
    By djcapslock in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 03-10-2005, 11:16 AM
  2. mappoint ActiveX control 9.0
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 10-21-2004, 07:22 AM
  3. How to restrict map area in ActiveX?
    By ErikS in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 07-26-2004, 01:34 PM
  4. I am using the MapPoint ActiveX control in a VB Ap....
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 08-24-2001, 07:35 AM
  5. How does one get the activeX mappoint control to d....
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 07-25-2001, 07:26 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 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96