xaml – 如何将图钉添加到Windows Phone 8.1地图控件?
我一直在寻找有关如何执行此任务的示例,但我找不到明确的任务.有人可以指出我正确的方向.我迷路了…
编辑/更新: 我已设法按照以下示例添加一些标记: 但是,正如MSDN文档所述,
无论如何,我都需要展示一些东西,几乎不可能找到一个关于如何执行这个简单任务的简单例子!我必须说我使用最新的Maps sdk,而不是之前的8.0. 解决方法
我能够使用以下代码完成它
public void AddPushpin(BasicGeoposition location,string text) { var pin = new Grid() { Width = 50,Height = 50,Margin = new Windows.UI.Xaml.Thickness(-12) }; pin.Children.Add(new Ellipse() { Fill = new SolidColorBrush(Colors.DodgerBlue),Stroke = new SolidColorBrush(Colors.White),StrokeThickness = 3,Width = 50,Height = 50 }); pin.Children.Add(new TextBlock() { Text = text,FontSize = 12,Foreground = new SolidColorBrush(Colors.White),HorizontalAlignment = Windows.UI.Xaml.HorizontalAlignment.Center,VerticalAlignment = Windows.UI.Xaml.VerticalAlignment.Center }); MapControl.SetLocation(pin,new Geopoint(location)); Map_MainMap.Children.Add(pin); } (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |