I am currently exploring the world of maps. I am now looking to develop a method that will update my push pin if there is already one present.
Firstly, I attempted to use setLocation(newLocation) but unfortunately, it seems like my client side code wasn't even executed (I suspect there might be a syntax error, though Chrome did not report any errors).
Next, I tried to research how to delete the existing pin and create a new one, but I couldn't find any helpful resources on http://msdn.microsoft.com/en-us/library/gg427610.aspx. Perhaps I need to refine my search strategies.
If anyone could offer some guidance on how to relocate a push pin and also how to remove one, I would greatly appreciate it. Thank you in advance!
var loc = new Microsoft.Maps.Location(lat, lon);
var pin = new Microsoft.Maps.Pushpin(loc);
Edit: partial solution provided
To remove a push pin:
if (pin != null)
{
map.entities.remove(pin)
}