【发布时间】:2012-02-28 17:07:35
【问题描述】:
我注意到在 FF4 中我可以使用地理定位对象 position.address.postalCode 查找邮政编码。
在 FF10 上进行测试时,我注意到 position.address 始终为空,而我仍然可以毫无问题地使用 position.coords 来查找经度或纬度。
有人可以告诉我是否有简单的方法可以在 FF10 中使用位置对象找出邮政编码?
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(findClosestAgencies);
}
function findClosestAgencies(position) {
alert("postalCode:" + position.address.postalCode);
alert("latitude:" + position.coords.latitude);
}
我的代码:
谢谢
【问题讨论】:
-
请提供您的代码示例,该示例无法正常工作...
-
此代码在 FF10 中无效。 position.address 为空 [Break On This Error] alert(position.address.postalCode);
标签: google-maps-api-3 geolocation position javascript