2011-10-26 37 views
0

在Windows Phone(芒果)我使用的是Microsoft.Phone.Controls.Maps。從字符串創建Lat + Long?

我目前有:

var _City = "Denver"; 
var _State = "Colorado"; 

而且我希望有一個圖釘:

var _Pushpin = new Pushpin(); 
_Pushpin.Location = new GeoCoordinate(); 
map1.Children.Add(_Pushpin); 
map1.Center = _Pushpin.Location; 

如何創建單獨從字符串正確會有地理座標?

更新與解決方案(使用Bing): http://blog.jerrynixon.com/2011/10/bing-maps-geocoding.html

enter image description here

回答

0

有一對夫婦的方式...

1)獲取Bing地圖API密鑰和調用到他們的網頁服務來獲得座標。 (see here for an example
2)有一個本地數據庫的城市/國家/座標查找。如果應用程序必須脫機運行,這可能是首選選項,但在這種情況下,您仍然無法看到地圖。

+0

結束使用Bing。易如反掌。 http://blog.jerrynixon.com/2011/10/bing-maps-geocoding.html –