【发布时间】:2019-03-10 15:01:00
【问题描述】:
我想在使用 Xamarin.Forms.Maps 在地图上单击时添加一个新图钉。 经过搜索,我发现我必须使用TKCustomMap插件..但它没有显示在地图上..只是空白区域 这是我的代码
double lit = 2.394;// double.Parse(Center.CenterLocationX);
double longt = 43.2352;// double.Parse(Center.CenterLocationY);
TK.CustomMap.Position position = new TK.CustomMap.Position(lit, longt);
TK.CustomMap.MapSpan span = TK.CustomMap.MapSpan.FromCenterAndRadius(position, TK.CustomMap.Distance.FromMiles(0.5));
TK.CustomMap.TKCustomMap map = new TK.CustomMap.TKCustomMap(span);
map.IsShowingUser = true;
map.MapType = TK.CustomMap.MapType.Street;
TK.CustomMap.TKCustomMapPin pin = new TK.CustomMap.TKCustomMapPin()
{
//Address = "Test",
//Label = "Test",
Position = position,
IsDraggable = true
//Type = PinType.SearchResult
};
map.MapClicked += (x, y) =>
{
SharedTools.MakeToast("Clicked");
};
//map.Pins.Add(pin);
map.Pins = new List<TK.CustomMap.TKCustomMapPin>() { pin };
map.MoveToMapRegion(span);
layout.Content = map;
我想解决这个问题,或者想在点击时添加图钉
【问题讨论】:
标签: c# xamarin.forms maps