0
在我的Windows商店應用,使用im一個bings地圖,和IM嘗試添加一個圖釘與圖像 這樣做,即時通訊做這段代碼圖釘的設置位置 - BingMaps
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/[email protected]", UriKind.RelativeOrAbsolute);
pinImage.Width = 20;
pinImage.Height = 30;
pinImage.Source = bitmapImage;
pushpinLayer.Children.Add(pinImage);
它添加圖釘圖像,但它出現在地圖的左上角,我不知道如何設置其位置以使用localtion變量:\
Ahhhh,好吧,現在我明白了,這是有道理的,謝謝:) – Ric