I would like the user to add several pins to a map to represent tents or people using map1_Hold event. How can I do this and store each dropped pin location on a cloud later(windows azure)?
Asked
Active
Viewed 485 times
0
-
Can you be more specific in your requirements. Are you wanting to add a pin each time someone taps a location? What have you tried? There are lots of ways to store information online. Again be more specific in your actual requirments and explain what you've tried. – Matt Lacey Mar 14 '12 at 13:45
-
1I'm pretty sure you cannot use a pin to represent a tent. This would fail certification for sure. – ColinE Mar 14 '12 at 14:20
1 Answers
0
To drop pins on a map you can do the following: (here map
comes from my .xaml page where map is the name of the Map: <my:Map Name="map" ...
Setting up the event handler
map.Hold += new EventHandler<GestureEventArgs>(dropPin_Hold);
and the actual event handler:
void dropPin_Hold(object sender, GestureEventArgs e)
{
// drop a pin at the Held location
GeoCoordinate pinLocation = new GeoCoordinate();
// gets the dropped position
pinLocation = map.ViewportPointToLocation(e.GetPosition(map));
newLocation = new Pushpin() { Location = pinLocation, Name = "Tent's name" Content = "new tent" };
map.Children.Add(newLocation);
// save the newLocation however you want
}
Multiple holds will result in multiple pins being displayed on the map.
You might also want to check out map.Tap

pseudosudo
- 1,962
- 1
- 19
- 30
-
-
I am currently saving user pin to xml but am having trouble retrieving this location info on restart. – mhSligo Apr 05 '12 at 18:13