Windows Phone 7 中带有地理定位服务的邮政编码
我想从 Windows Phone 7 获取当前用户位置的邮政编码。通过 GeoLocation 服务,我能够获取纬度和经度,并且在 Bing 地图 API 的帮助下,我能够获取所有其他信息(例如城市、州)邮政编码(邮政编码)除外。对于美国,邮政编码字段为空。有什么办法可以获取邮政编码吗?我的应用程序限制如下。
- 我们不能使用 BingMap API/Web 服务以外的任何其他服务来获取 ZipCode。
- 我们仅支持美国作为位置。因此,如果该解决方案仅适用于美国。没关系。
I want to get the Zip-Code for current user location from Windows Phone 7. From GeoLocation service I am able to get latitude and longitude and with the help of Bing map API I am able to get all other information (Like City, State) except zipcode (Postal code). For United States the PostalCode field is blank. Is there any way of getting the ZipCode? My application limitations are following.
- We cannot use any other service than BingMap API/Web service to get the ZipCode.
- We only support US as location. So if the solution works only for US. It is ok.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
以下是您需要的(Bing 地图 REST API):
http://msdn.microsoft .com/en-us/library/ff701710.aspx
请注意,在响应中(假设您正确构建了请求),有一个 PostalCode 实体。
Here is what you need (Bing Maps REST API):
http://msdn.microsoft.com/en-us/library/ff701710.aspx
Notice that in the response (given that you built the request properly), there is a PostalCode entity.
无法保证您会获得每个纬度的邮政编码。即使在美国境内也是如此。他们不是这样分配的。
您需要重新思考/重新评估您在这方面的要求。
也不能保证您能够走另一条路。并非所有邮政编码都与物理位置相关,有些邮政编码甚至跨越州界。
You cannot be guaranteed that you'll get a zip/postal code for every single latitude. Even within the US. They're not allocated that way.
You'll need to rethink/reevaluate your requirements in this area.
You also can't be guaranteed to be able to go the other way either. Not all postcodes relate to physical locations and a few even cross state boundaries.