【发布时间】:2014-02-06 17:19:16
【问题描述】:
在我的 Windows 商店应用程序中,我正在使用 bings 地图,并且正在尝试添加带有图像的图钉 为此,我正在做这段代码
Bing.Maps.Location center = new Bing.Maps.Location();
center.Latitude = 40.130066068147585;
center.Longitude = -8.338623046875;
Map.Center = center;
Map.ZoomLevel = 12D;
var pushpinLayer = new MapLayer();
pushpinLayer.Name = "PushPinLayer";
Map.Children.Add(pushpinLayer);
var location = new Location(40.130066068147585D, -8.338623046875D);
Image pinImage = new Image();
BitmapImage bitmapImage = new BitmapImage();
bitmapImage.UriSource = new Uri("ms-appx:///Assets/POI_Red_Ipad@2x.png", UriKind.RelativeOrAbsolute);
pinImage.Width = 20;
pinImage.Height = 30;
pinImage.Source = bitmapImage;
pushpinLayer.Children.Add(pinImage);
它添加了图钉图像,但它出现在地图的左上角,我不知道如何设置它的位置以使用 localtion 变量:\
【问题讨论】:
标签: c# xaml windows-store-apps bing-maps