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

Just wondering how MapPoint knows when a poly is closed.

This is a discussion on Just wondering how MapPoint knows when a poly is closed. within the MapPoint Desktop Discussion forums, part of the Map Forums category; Hey folks- happy holidays. Everything is working, but I'm just curious... Using Mappoint control and AddPolyline - When the user ...

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

    Just wondering how MapPoint knows when a poly is closed.

    Hey folks-

    happy holidays.

    Everything is working, but I'm just curious...

    Using Mappoint control and AddPolyline -

    When the user right clicks 'Close Curve'

    and I save my vertices data ? then reload the shape ?

    even though the last set of coords lat/lon is NOT the same as the first ?

    it redraws just fine

    yet

    technically, the way I USED to close the poly for the user was through a button where I set the last coord pair lat lon values equal to the first lat lon pair in the poly, without doubt closing it.

    So, I'm just puzzled, how does MapPoint know the poly is closed when and only when you use Close Curve yet there is no apparent evident marker in the vertice data to suggest the last pair = the first pair values.

    Seems if I create a poly manually, setting last equal to first - all is well - and yet
    close curve through mappoint right click also works too

    anyone know how MapPoint knows a poly shape object is closed ?

    Tim Miltz

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

    Re: Just wondering how MapPoint knows when a poly is closed.

    Hi Tim,

    I don't see any way, so I'll make a guess:

    Win32 API function CreatePolygonRgn with no fill might supply the last
    set of coordinates no matter where the 'break' in the line is.

    Mike Mattys

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

    Re: Just wondering how MapPoint knows when a poly is closed.

    Hey there Mike,

    Ah, I see your point there.

    I was using the Mappoint object model in this case, so that I could

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

    Hey, I was incorrect to post this. I have since realized MP will close the poly TO the first pair of coords in my location object array, this is what I was missing.

    Sorry on the confusion folks, I screwed up on recognizing my question was in error, without doubt no correct answer could follow.

    I also realize now that if I want to provide the user with a dedicated 'close poly' button for example, I need NOT add a final pair of coords lat/lon equal to the first pair coords.

    Just checked indeed the AddPolyline does close it automatically.

    Oh well, sorry folks, hope this thread doesn't consume anyones time that need not ponder this. AddPolyline DOES close the poly- was just my methodology that was in error.

    Tim

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Re-open Is user drawn freeform Poly Closed thread
    By tfmiltz in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 11-09-2007, 12:58 PM
  2. Custom Poly Line segment Delete trapping
    By tfmiltz in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 10-23-2007, 09:02 PM
  3. MapPoint Gets closed on its own
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 11
    Last Post: 01-09-2005, 04:52 AM
  4. I was wondering if Mappoint 2002 had an API that I....
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 05-22-2002, 01:58 PM
  5. Hello, I'm wondering if there is a way to include....
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 09-04-2001, 11:52 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