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

Drawing a large number of pushpins

This is a discussion on Drawing a large number of pushpins within the MapPoint Desktop Discussion forums, part of the Map Forums category; Hi, i'm using a faunction to draw a set of pushpins in this way: Code: foreach(DataRow dr in DataSet.Rows) { ...

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

    Lightbulb Drawing a large number of pushpins

    Hi,
    i'm using a faunction to draw a set of pushpins in this way:

    Code:
     foreach(DataRow dr in DataSet.Rows)
    {
    
         MapPoint.Location loc = this.mMap.GetLocation(Lat, Lon, 1);
         MapPoint.Pushpin pushpin = this.mMap.AddPushpin(loc,"");
         pushpin.Name = Name;
         pushpin.MoveTo(SP);
    }
    SP is a MapPoint.Dataset i use it so user after drawing can simply make some operations on the entire DataSet.

    The problem is that this drawing can be operated on large numbers of pushpins (7000-20000) and the time to wait is very long.
    Someone have solved this problem in other ways?

    Regards,
    Gianmaria

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

    Re: Drawing a large number of pushpins

    Hi Gianmaria,

    Look for pages with importdata on this site.
    Here's one ImportData

    Mike Mattys

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

    Re: Drawing a large number of pushpins

    Hi Mike,
    thanks for your answer. I've already used this importi way.. creating a CVS file.. it works fine but dont fit my needs. Every Pushpin i have to draw have a name and a custom symbol too.

    Any idea?

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

    Re: Drawing a large number of pushpins

    No. I have to wait for the code loop through all pins, too.
    Another one for the wish-list ...

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

    Re: Drawing a large number of pushpins

    Hi,

    what if you just draw the pushpins in view ? It will take some calculations but not impossible...

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

    Re: Drawing a large number of pushpins

    In view? You mean that when i change the zoom i draw something else or clear some other?

  7. #7
    Eric Frost's Avatar
    Eric Frost is offline Administrator Black Belt
    Join Date
    Jul 1992
    Posts
    5,094
    Blog Entries
    4

    Re: Drawing a large number of pushpins

    Yes, it is this exactly. You could do it with a COM Add-in that would read all the data into a dataset. The COM Add-in would trigger whenever this is a map view change event. Above a certain Altitude it would not draw anything.

    You need to get the lat/lons of the corners of the currently visible map. Then query and say any lat/lons that fall in the extents of the map should be displayed.

    Note that since the earth is a sphere, it's not flat so the longitude (X coordinate) or the lower left will not be the same as the upper left. So for longitude, use whichever one is higher (or lower depending on your hemisphere).

    Do I have this right? What am I missing? I think it shouldn't take more than four hours to figure out and program.. the first thing I'm not sure of off the top of my head is how to get the coordinates of the corners but I seem to remember there being a solution posted for this.

    hope this gives you some ideas!
    Eric

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

    Re: Drawing a large number of pushpins

    Nice. I will try to code and will post it after doing, maybe this ca be usefull for someothers.

    Txs
    Gianmaria

  9. #9
    Eric Frost's Avatar
    Eric Frost is offline Administrator Black Belt
    Join Date
    Jul 1992
    Posts
    5,094
    Blog Entries
    4

    Re: Drawing a large number of pushpins

    Cool good luck - let us know if you run into any problems.

    Eric

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Hello. We currently have large-format printing ca....
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 09-14-2010, 09:49 AM
  2. Printing a large Map?!?!?!
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 6
    Last Post: 10-24-2007, 11:05 AM
  3. Load/Render large number of pushpins
    By Varrus in forum MapPoint Desktop Discussion
    Replies: 4
    Last Post: 04-27-2007, 03:40 PM
  4. number of pushpins of mappoint
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 08-05-2004, 03:59 PM
  5. Max number of Pushpins / Your suggestion?
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 4
    Last Post: 05-20-2004, 07:33 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