0
Android 용지도 및 위치 정보 데모 용 모노를 사용 중입니다. 질문이 있습니다.Android 용 모노 추가지도에 추가 포인터
특정 위도와 경도 지점에서 현재지도에 '마커'를 배치하는 데 도움이 될 수 있습니까? 또한 각 '마커'를 클릭 할 때 일부 코드를 실행할 수 있습니까?
감사합니다.
Android 용지도 및 위치 정보 데모 용 모노를 사용 중입니다. 질문이 있습니다.Android 용 모노 추가지도에 추가 포인터
특정 위도와 경도 지점에서 현재지도에 '마커'를 배치하는 데 도움이 될 수 있습니까? 또한 각 '마커'를 클릭 할 때 일부 코드를 실행할 수 있습니까?
감사합니다.
지도 오버레이를 추가해야합니다. Here 당신은 그런 ItemizedOverlay
class MonkeyItemizedOverlay: ItemizedOverlay
{
List<OverlayItem> _items;
Context context;
public MonkeyItemizedOverlay (Drawable monkey, Context context) : base(monkey)
{
this.context = context;
// populate some sample location data for the overlay items
_items = new List<OverlayItem>{
new OverlayItem (new GeoPoint ((int)40.741773E6,
(int)-74.004986E6), null, null),
new OverlayItem (new GeoPoint ((int)41.051696E6,
(int)-73.545667E6), null, null),
new OverlayItem (new GeoPoint ((int)41.311197E6,
(int)-72.902646E6), null, null)
};
BoundCenterBottom(monkey);
Populate();
}
}
을 구현하면 클릭 기능 재정의 OnTap에서는 (INT)
protected override bool OnTap(int index)
{
var item = _items[index];
Toast.MakeText(context, index.ToString(), ToastLength.Short).Show();
return true;
}
감사를 추가 할 경우이
처럼 사용할 수있는 튜토리얼
입니다 . 마커를 클릭 할 때 코드를 실행하는 방법은 무엇입니까? – user1690531
당신은 단순히지도보기에 직접 http://docs.xamarin.com/Android/Guides/Platform_Features/Maps_and_Location/Part_2_-_Maps_API#MapView_as_a_view_container –
을 버튼을 추가 또는 내가 대답 한 경우 OnTap에서는 (INT) ItemizedOverlay –