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

Shapes.AddPolyline is very slow

This is a discussion on Shapes.AddPolyline is very slow within the MapPoint Desktop Discussion forums, part of the Map Forums category; I've inherited some code using mappoint. The code displays contour lines on the map using Shapes.AddPolyline, but it is very ...

  1. #1
    tdaffin is offline Junior Member White Belt
    Join Date
    Jan 2006
    Posts
    2

    Shapes.AddPolyline is very slow

    I've inherited some code using mappoint.

    The code displays contour lines on the map using Shapes.AddPolyline, but it is very slow!

    It appears that in the loop that adds all the lines, every time one is added the map has to redraw. I think that is what is taking all the time.

    I've experimented with setting the control invisible before adding the lines, and then making it visible afterwards, and that does make things faster (about 3x faster), but it is still very slow.

    Is there anything I can do to make this faster?

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

    I think so but it can be little tricky. Here some idea walking trough my brain at the moment:

    - Make a transparant form with exact size and position as the form where mappoint is sitting on and draw the lines on that form while it is also invisible. Then when ready set visible.

    - copy the map to clipboard and then copy it to some bitmap image sitting on a new form. Also while ivnisible draw the lines on that image, then set visible.

    - open a second map with exact same lat/lon/alt, set invisible, draw the lines, switch forms. Speed will be same as in yoru case but at least the screen would not flikker because setting the map temporary invisible.

    Maybe one of the idea's brings up better ones

  3. #3
    Winwaed's Avatar
    Winwaed is offline Mapping-Tools.com Black Belt
    Join Date
    Feb 2004
    Location
    Irving,Texas
    Posts
    1,859
    Blog Entries
    60
    Also try reducing the number of nodes (points) and/or number of shapes if possible. If found this led to a huge speed up for my GridImp product.

    This drew lots of squares with common edges and corners. By merging squares of the same colour, duplicated corners are removed - some completely. The speedup was greater than the <4x that you would expect.


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

  4. #4
    tdaffin is offline Junior Member White Belt
    Join Date
    Jan 2006
    Posts
    2
    Thank you all for your comments. My conclusion is that MapPoint isn't really suitable for this kind of usage.

    Basically, we need to be able to deal with a lot of very detailed contours very quickly.

  5. #5
    michele is offline Junior Member Yellow Belt
    Join Date
    Oct 2005
    Posts
    13
    MapPoint is very slow to draw polygons, so I draw polygons by myself with GDI on the gif of MapPoint map.

    If you want to use only MapPoint drawing functionallity, if i remember set map invisible and go to lat lon (0,0), and then, after drawing, I return to the correct position.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Addpolyline , Array , Visual Basic and Other languages
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 08-26-2004, 04:58 AM
  2. VB .NET is so slow!
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 07-28-2004, 04:17 AM
  3. moving through recordset is slow
    By stephenmillington in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 07-07-2004, 06:28 AM
  4. MP 2004 really slow with large custom territories
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 4
    Last Post: 02-04-2004, 07:21 AM
  5. addpolyline
    By Anonymous in forum Wish List
    Replies: 2
    Last Post: 04-25-2003, 04:50 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