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

Dataset rendering

This is a discussion on Dataset rendering within the MapPoint Desktop Discussion forums, part of the Map Forums category; Hi, i'm using this method to add pushpins from a DataTable... Code: foreach(DataRow dr in dt.Rows) { try { MapPoint.Pushpin ...

  1. #1
    Gianmaria is offline Member Yellow Belt
    Join Date
    Dec 2004
    Posts
    47

    Dataset rendering

    Hi,
    i'm using this method to add pushpins from a DataTable...

    Code:
    foreach(DataRow dr in dt.Rows)
    {
           try
           {	
              MapPoint.Pushpin pushpin = this.mMap.AddPushpin(this.mMap.GetLocation(lon,lat, "info");
              pushpin.Symbol = 49;
              pushpin.MoveTo(SP);
           }
           catch(System.Exception ex)
          {
    					
          }
    }
    
    //where SP is MapPoint.DataSet SP
    //and dt naturally is a DataTable from a .net DataSet


    but this have two problems... first it's slow for a number of pushpins very hight like 5000 or 10000.... and second some pushpins are not added to the SP dataset... so their look is not the one i select (symbol 49) but is a black pushpin) Later when i try to remove the dataset from the map this pushpin still remains.

    Any one have a better nethid for do the same???
    Any code i can watch to??

    my regards,
    gianmaria

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

    I dont think you can improve it for speed. Maybe dont move them to a new dataset, but do this afterwards, then the drawing of the pushpins will be somewhat faster.

    Or limit the amout of added pushpins to the view in the map (only draw the ones that are visible, but then you have to make a system to draw the other ones when the user pan or zoom).

    I have no idea wy some of them are not add to the dataset or have a wrong symbol

  3. #3
    Gianmaria is offline Member Yellow Belt
    Join Date
    Dec 2004
    Posts
    47
    Ok,
    the second problem is ok.. i just added an Applicatin.doEvents() after adding the pushpin to the dataset, it seemes that processing is too fast and some pushpin is not added in time.. strange but true.

    For first problem.. i dunno too.. it's really slow..

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

    Good that the latter problem is solven. But the question is that so regulary people complain that there are problemes adding 10000 pushpins to the map.

    I can not imagine theat there is 1 user complenning that pushpin nuber 7899 is not right displayed... you get my point ?

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Rendering graphics on top of the MapPoint Control
    By Anonymous in forum Development
    Replies: 2
    Last Post: 09-12-2007, 09:39 AM
  2. Optimize Custom Symbol Map Rendering Performance
    By gkirbo in forum MapPoint Desktop Discussion
    Replies: 21
    Last Post: 05-09-2006, 07:21 PM
  3. Refreshing a dataset
    By TACEC in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 10-21-2005, 01:08 PM
  4. Shapes and rendering speed!
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 02-02-2004, 05:16 AM
  5. Map Rendering
    By priyands in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 01-15-2004, 01:05 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