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
Page 1 of 2 12 LastLast
Results 1 to 10 of 12

MapPoint Map Refresh

This is a discussion on MapPoint Map Refresh within the MapPoint Desktop Discussion forums, part of the Map Forums category; Hello, I'm using VB6 and the Mappoint control to build a EXE that include some map functionalities. The problem is ...

  1. #1
    andreaplanet is offline Junior Member White Belt
    Join Date
    Jan 2005
    Posts
    2

    MapPoint Map Refresh

    Hello,

    I'm using VB6 and the Mappoint control to build a EXE that include some map functionalities. The problem is that when I add a pushpin or other items on the map then the map is updated at every code instruction. Is there a way to draw some items without updating the map at every instruction?

    Example of code
    Code:
    Set item = myMap.Shapes.AddLine(loc1,loc2)
    item.Line.ForeColor = intForeColor
    item.Line.EndArrowhead = True
    item.Line.Weight = 0
    When I run this code I see first the blackline, then the arrow, at last the weight.

    Same problem when creating pushpins. In this case first I see the pushpin icon then the car icon (myDataSet has Symbol=car)

    Code:
    Set item = myMap.AddPushpin(loc1, "MyName")
    item.MoveTo myDataSet
    Is there a way to run easily some code in the MapPoint thread? I think at every instruction there is the delay for the thread switch between my application and the hidden mappoint application.

    Thank you for any help

  2. #2
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002
    Posts
    5,137

    Datasets

    You want to use a Dataset to perform batch pushpin assignment.


    Tim Miltz

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

    Re: MapPoint Map Refresh

    Hi,

    Quote Originally Posted by andreaplanet
    The problem is that when I add a pushpin or other items on the map then the map is updated at every code instruction. Is there a way to draw some items without updating the map at every instruction?
    I think this is typical behaviour of MP2004. With MP2002 this was not the case. The updating slows down but for a user it 'seems' faster. I have search but did not found any property/method to disable it.

    Is there a way to run easily some code in the MapPoint thread? I think at every instruction there is the delay for the thread switch between my application and the hidden mappoint application.
    I'm pretty sure that all GUI updates happens in same main thread context. Also all method calls to MP are sync, if they should execute in a separate thread they would by async. However this is just a conclusion of me without knowing the deeper insights of mappoint. Someone will clarify if I'm wrong I hope

  4. #4
    andreaplanet is offline Junior Member White Belt
    Join Date
    Jan 2005
    Posts
    2

    Re: MapPoint Map Refresh

    Quote Originally Posted by Wilfried
    I'm pretty sure that all GUI updates happens in same main thread context. Also all method calls to MP are sync, if they should execute in a separate thread they would by async. However this is just a conclusion of me without knowing the deeper insights of mappoint. Someone will clarify if I'm wrong I hope
    Hi Wilfried,

    When you run the map there is a "hidden" process "MapPoint.exe", check the taskmanager, so there is some kind of interprocess comunication. And I fear that this happen at every instruction call. It's relatively fast, in other similar situations i realized a delay of some milliseconds for every instructions due to the necessary context switch between the two processes. I still not tried to add something like 10000 items but I fear that the process will be very slow.

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

    Yes, for each mappoint component you drop on a form a mappoint.exe instance is started in background. mapooint.exe is in this case a COM server for your application. Each method is sent to it and returns with the appropriate data.

    Of course this gives delays, and if you wants to drop honderds or more pushpins on your map you will have incredible delays. But these delays are not nececarly because the delay of interprocess.

    For a large amount of data is nececarly to study (or better trial and error) to see what the most gain gives in speed. Not very easy all the time

  6. #6
    discostu is offline Junior Member White Belt
    Join Date
    May 2005
    Posts
    9

    Re: Datasets

    Quote Originally Posted by tfmiltz
    You want to use a Dataset to perform batch pushpin assignment.


    Tim Miltz
    How would one do this? There doesn't seem to be any way to AddPushpin(...) to a DataSet. At least I haven't found it yet.

  7. #7
    Blackbird is offline Junior Member White Belt
    Join Date
    Nov 2006
    Posts
    4

    Re: MapPoint Map Refresh

    I have the exact same problem as Andreaplanet. Creating many pushpins at the same time takes very long because the addPushpin() method automatically refreshes the map.

    I need to disable the map auto-refresh.

  8. #8
    jlewis is offline Member Yellow Belt
    Join Date
    Apr 2006
    Posts
    33

    Re: MapPoint Map Refresh

    I had much the same problem using addPushpin for a whole bunch of pushpins. On my dev machine, adding about 3000 pushpins (from my db) used to take between 90 and 120 seconds.

    What I now do is to export my data into a CSV (with 3 columns - Latitude,Longitude,Name) and then use the ImportData method:-

    Dim ds As MapPoint.DataSet
    ds = Map.DataSets.ImportData(Filename)
    ds.Symbol = 1 [or whatever symbol you want]

    The same 3000 pushpins now take about 3 seconds to load!

    John
    John Lewis

  9. #9
    Blackbird is offline Junior Member White Belt
    Join Date
    Nov 2006
    Posts
    4

    Re: MapPoint Map Refresh

    Quote Originally Posted by jlewis View Post
    What I now do is to export my data into a CSV (with 3 columns - Latitude,Longitude,Name) and then use the ImportData method
    Seems a very good workaround to me, thanks.

    But disabling the auto-refresh would still be a better solution. Anyway, this workaround will be very useful, even though not the solution I was looking for.

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

    Re: MapPoint Map Refresh

    I wonder if it will speed it up if you make the Application not visible? (Set visible to False.)

    Eric

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. How can I refresh the data link from VB
    By flymoe in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 10-21-2004, 07:46 AM
  2. How to refresh a Map
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 01-03-2003, 04:42 PM
  3. Mappoint-Refresh linked data on a form load event ....
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 10-22-2001, 02:38 PM
  4. Is there a way to change the GPS refresh rate to l....
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 08-24-2001, 08:33 AM
  5. Is there any way to refresh just one PushPin Layer....
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 07-27-2001, 10:29 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