从字符串创建纬度+经度?
在 Windows Phone (mango) 中,我使用 Microsoft.Phone.Controls.Maps。
我目前有:
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
In Windows Phone (mango) I am using Microsoft.Phone.Controls.Maps.
I currently have:
var _City = "Denver";
var _State = "Colorado";
And I want a pushpin:
var _Pushpin = new Pushpin();
_Pushpin.Location = new GeoCoordinate();
map1.Children.Add(_Pushpin);
map1.Center = _Pushpin.Location;
How can I create the correct GeoCoordinate from the strings alone?
Update with solution (using Bing):
http://blog.jerrynixon.com/2011/10/bing-maps-geocoding.html
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有几种方法...
1) 获取 Bing 地图 API 密钥并调用其 Web 服务来获取坐标。 (请参阅此处的示例)
2)有一个可供查询的城市/州/坐标的本地数据库。如果应用程序必须离线运行,这可能是首选选项,尽管在这种情况下您无论如何也看不到地图。
There are a couple of ways...
1) Get a Bing Maps API key and call into their web services to get the coordinates. (see here for an example)
2) Have a local database of cities / states / coordinates to look up against. This is probably the preferred option if the app must run offline, although in that case you wouldn't see the maps anyway.