Suspend drawing map

chupax
01-09-2007, 01:54 PM
Hello,

Is it possible to suspend the drawing of a map?
My application is the following. I have a map with all my vehicles on it (pushpins). Now it should also be possible to show only the vehicles of specific departments. When I change the department I do the following. I delete all the current pushpins and add all the new ones. The problem with this is that each pushpin is drawn seperatly + the most important and actually the biggest problem, is that there is a zoom to each pushpin. Ofcourse I already checked that I haven't programmed a zoom.
Many thanks in advance.

Paul Larson
01-10-2007, 01:06 PM
1) What method are you using to add the pushpins? You are probably calling a geocode method (FindResults/FindAddressResults/GetLocation) over an iteration by looping or For..Next. You'll gain a lot of speed by first writing the new vehicle locations to a temporary file, and then using a bulk import (i.e. DataSets.ImportData) method to add them to the map. After the import you can iterate through the returned dataset to set pushpin properties such as BalloonState, etc.

2) You can minimize the mappoint windowstate during the pushpin drawing to avoid successive wm_paints.

3) Adding a pushpin does NOT actualy force/generate a ZoomTo, Union or GoTo. It must be somewhere in your code. However, using the DataSets.Import will make this point moot anyway.

HTH
Paul

chupax
01-10-2007, 01:18 PM
I think I found the problem. In my code I do a findnearby of each pushpin to get the address. Is there another way to get the address of the pushpin without zooming?

Paul Larson
01-10-2007, 01:27 PM
Unfortunately, all the methods I've found for reverse-geocoding in MapPoint do require a zoom/goto call. You could offload this portion to a second instance of mappoint (non-visible) and then pass the results back to your own instance.

chupax
01-10-2007, 01:43 PM
OK that might work.
I'll try it tomorrow.
THX

 
Web mp2kmag.com
mapforums.com