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

Custom Poly Line segment Delete trapping

This is a discussion on Custom Poly Line segment Delete trapping within the MapPoint Desktop Discussion forums, part of the Map Forums category; Hello fellow MapPoint Developers/Users... I wanted to allow the user to create a custom polygon and then fire QueryPolygon method ...

  1. #1
    tfmiltz is offline Member Green Belt
    Join Date
    Feb 2005
    Posts
    52

    Custom Poly Line segment Delete trapping

    Hello fellow MapPoint Developers/Users...


    I wanted to allow the user to create a custom polygon and then fire QueryPolygon method - no problem.

    However, I'm using the MapPoint Control. There is no 'freeform' selection built into the control, so I built my own solution with

    Set oCurrentShape(lPointCnt) = _
    MappointControl1.ActiveMap.Shapes.AddLine(oLocatio nLast, oLocations(lPointCnt))

    setting oLocation each new segment, and in finality on close (which I automatically close the poly if the user clicks within 0.0005 of the first pushpin/pt) I redraw everything as one big solid polygon (I name it immediatly after, this makes it easy to reference multiple poly's on a map) using

    Set oCurrentShapeFinal = MappointControl1.ActiveMap.Shapes.AddPolyline(oLoc ations)

    The problem is this... If a user right clicks - the ONE method that is listed is 'Add' (ok you can see total area too). I can indeed capture right click to know that I need to bump up my array of lat/lon's to insert the new point. BUT, if the user presses DELETE ?

    I see no way to detect the keypress with the MapPointControl.

    Was wondering if anyone knew of a means to do this, even low level OS.

    I do have a backup plan, it's more expensive though, and that is to literally redraw the entire poly each time a SelectionChange event occurs, and grab the actual poly from me.MappointControl1.ActiveMap.Shapes.item(i).Verti ces

    where i is a generic enumeration I've been usuing.

    Then redraw it- again though, this backup plan may not work if Vertices is not updated AFTER SelectionChange event.

    So, does anyone know of a means to detect the keypress event ?

    I did see Wilfried's solution to detect SelectionChange for Pushpin, but I am not sure how I can detect deletion of line segment.

    Reason being, I need to update my array of pts, AND I need to auto-connect the adjacent pts of the segment that was deleted to 'fill in' what is missing.

    Any thoughts welcome no doubt.

    Thanks in advance

    Tim Miltz

    p.s. Add Custom Poly for query functionality is a powerful feature of MapPoint, and there isn't a lot built in for the MapPointControl from what I see, let me know if you are seeking to do this, I can catch you up on methodologies I've found that work.

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

    Re: Custom Poly Line segment Delete trapping

    Hi,

    Make a transparent panel, drop it on the MP control and dock it to fill. Then the panel will receive all keyboard and mouse event. In those events you can do with the MP control whatever you like and you have full control over it.

  3. #3
    tfmiltz is offline Member Green Belt
    Join Date
    Feb 2005
    Posts
    52

    Re: Custom Poly Line segment Delete trapping

    Thankyou for your time and insights into this Wilfried, I see you are a strong supporting member of this community here.

    I am using vb6 currently. I see panels are part of .net.

    I will explore something similar. But I follow your thinking here.

    Also, to any readers who may have seen my post above, I have since learned I do not need to use MappointControl1.ActiveMap.Shapes.AddLine as I was to build my custom poly from user click event. I did realize I can use the .AddPolyLine from the start and inherit all the functionality from the right click menu with MapPointControl regarding Add / Delete segment.

    Figuring out the geo-spatial code is a lot of fun I will add, but it's highly dependent on the community I find here. So, thanks everyone who spends time here in the MapPoint 2006 Discussion forums, it's invaluable.

    <heh> Now to see if I can typcecast Vertices in vb6 to get my contents ! There is ALWAYS a way I say. </heh>

    Tim Miltz

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Programmatically delete Imported Custom Symbols
    By Kevin_Williams in forum MapPoint Desktop Discussion
    Replies: 5
    Last Post: 02-09-2007, 01:07 PM
  2. how to get region from a route segment
    By paragon in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 09-24-2005, 03:09 PM
  3. Trapping Bad Routes in VB6
    By Winwaed in forum MapPoint Desktop Discussion
    Replies: 4
    Last Post: 10-18-2004, 05:02 PM
  4. Geocoding - find what street segment I am on...
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 03-31-2004, 12:16 AM
  5. As I draw a line and then a pushpin on that line, ....
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 07-16-2002, 09:35 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