2016-04-14 75 views

回答

1

如果創建使用Bing地圖SDK可以通過首先抓住地圖的中心位置,將所述位置成像素座標偏移地圖的中心一個Windows商店應用(視窗8/8.1)。應用偏移的像素座標,然後將像素轉換回位置,並使用該位置設置地圖中心。下面是一個代碼示例:

//Convert the center location of the map into a pixel value. 
Point centerPixel; 
myMap.TryLocationToPixel(myMap.Center, out centerPixel); 

//Apply an offset to the pixel value. 
centerPixel.X += [offset value]; 
centerPixel.Y += [offset value]; 

//Convert pixel coordinate back into location object. 
Location center; 
myMap.TryPixelToLocation(centerPixel, out center); 

//Center the map using the offset value. 
myMap.Center = center; 

所有這一切說,我會建議爲Windows 10,而不是Windows 8系統的Windows 10開發已經超過了Windows 8的市場份額中,有一個全新的Bing地圖控制權內置於Windows 10 SDK。下面是一些文檔:https://msdn.microsoft.com/en-us/library/windows/apps/xaml/dn642089.aspx

+0

我希望我能爲Windows開發10,但我們正在與Windows 8.1安裝瞄準LOB設備。我發現在MSDN上的搜索點到Windows 10個樣品/例子/與令牌非深層鏈接到Windows 8版本的教程,有時Windows 8的版本甚至不似乎是在網站上... – Brendan

相關問題