Bing Map WP7에 사용자가 여러 개의 별도의 핀을 떨어 뜨릴 수 있습니까?
-
13-12-2019 - |
문제
사용자가 MAP1_HOLD 이벤트를 사용하는 텐트 나 사람들을 나타내는지도에 여러 개의 핀을 추가하기를 원합니다. 나중에 클라우드 (Windows Azure)에 각 드롭 된 PIN 위치를 어떻게 저장할 수 있습니까?
해결책
지도에 핀을 삭제하려면 다음을 수행 할 수 있습니다. (여기서 map
가 내 .xaml 페이지에서 제공됩니다. 여기서지도는지도 이름입니다. 맵 : <my:Map Name="map" ...
이벤트 핸들러 설정
map.Hold += new EventHandler<GestureEventArgs>(dropPin_Hold);
.
및 실제 이벤트 핸들러 :
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
}
.
여러 개의 핀이지도에 여러 개의 핀이 표시됩니다.
Map.Tap
을 확인하고자 할 수도 있습니다.제휴하지 않습니다 StackOverflow