My Pushpins set has pushpins after using .MoveTo

TheHighHeat
02-07-2008, 04:57 PM
for (inti = 0; i < alPostalCodes.Count; i++)
{
string postalcode = alPostalCodes[i];
MapPoint.Locationlocation = null;
MapPoint.FindResultsfindrs = map.FindAddressResults(null, null, null, null, postalcode, country);
if (findrs == null || findrs.Count <= 0)
{
}
else
{
location = findrs.get_Item(refindex) asMapPoint.Location;
if (location != null)
{
oPin = map.AddPushpin(location, postalcode); oPin.MoveTo(oPPSet);
}
}
}

After this code gets done running I will have "My Pushpins" and the name of the custom pushpin set that I added, but My Pushpins should be empty and it's not, anyone have any ideas what's happening here? Thank you, Jamie

Wilfried
02-09-2008, 02:21 AM
Hi,

I don't think MoveTo does a delete also. So you have to delete it yourself.

TheHighHeat
02-11-2008, 11:04 AM
.MoveTo moves a pin from one set to another, so the set "My Pushpins" should be empty after a .MoveTo call, but for some reason sometimes it looks like the .MoveTo method isnt' called

Winwaed
02-12-2008, 08:58 AM
I agree "HighHeat".

I vaguely remember seeing something like this but it was a long time ago and I can't remember the details. iirc, it was a very small number - perhaps less than 5 out of every few hundred?

If it is a timing issue, you could add a small delay (not ideal), or try to split the add and the move into two loops?

Did you say this was an addin? If so, you're running in-thread, so timing isn't an issue in theory!

Richard

 
Web mp2kmag.com
mapforums.com