Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

How to delete or move Mappoint Pushpin

I have a piece of code that places a pushpin on a map based on the lat/lon I cam getting from a GPS device. What I want to now do is track by moving or delete/add the pushpin to the new loaction. Can someone tell me how to move or delete the previous pin? Below is what I am using to set the pushpin to start with.

Set objloc = objmap.GetLocation(SavLat, SavLon, 0)
Set objpin = objmap.AddPushpin(objloc, SavTruckId)
objpin.Symbol = objmap.Symbols(86)
objpin.Location.GoTo
objmap.DataSets.MoveTo

earlier in the code I did a

Set objmap = MappointControl1.NewMap(geoMapNorthAmerica)

this works but I can not figure out how to move the pin or delete the previous. Later I would like to show all point so I will need to leave the pin and keep adding new pins
Thanks
[846 byte] By [Don] at [2007-11-11 6:49:07]
# 1 Re: How to delete or move Mappoint Pushpin
Index you pins.
previous1 =Index - 1
move_or_delete_previous previous1, " move"

sub move_or_delete_previous(previous1%,movedelete$)

if movedelete= "move" then

End Sub
Log_in at 2007-11-11 17:27:53 >
# 2 Re: How to delete or move Mappoint Pushpin
I see what your doing but not sure how I would index the pins. Once I set the first pin when I get a new lat/lon I want to move the pin or delete it and reset it. Sorry to be dumb on this but I do not see it clearly enough to make this work. Thanks
Don at 2007-11-11 17:28:53 >
# 3 Re: How to delete or move Mappoint Pushpin
Set objloc = objmap.GetLocation(SavLat, SavLon, 0)
Set objpin = objmap.AddPushpin(objloc, SavTruckId)
objpin.Symbol = objmap.Symbols(86)
[
Index =Index + 1
objpin.Index = Index
or
objpin.Name = SavLat & SavLon (or (objpin.Name = :o Colorado))
]
objpin.Location.GoTo
objmap.DataSets.MoveTo
Log_in at 2007-11-11 17:29:51 >
# 4 Re: How to delete or move Mappoint Pushpin
When I try this the line objpin.Index = Index failes with the object does not support this method.
Don at 2007-11-11 17:30:56 >
# 5 Re: How to delete or move Mappoint Pushpin
I have the objpin.delete working now. I found all I had to do was do just that prior to setting it again. Can you tell me how to get the name to stay visible with the pin?
Don at 2007-11-11 17:31:57 >