【问题标题】:Reverse Geocode From Marker Click从标记单击反向地理编码
【发布时间】:2011-12-10 02:17:59
【问题描述】:

我想知道是否有人可以帮助我。

我已经整理了this 页面,它允许用户查看地图标记。

虽然我想在页面上包含反向地理编码功能,但我遇到了问题。

当用户点击地图标记时,我希望能够使用 lat 和 lng 坐标(已经保存在 mySQL 数据库中)填充两个文本字段,自动执行反向 goeocode 并将地址添加到“地址”文本字段。

我可以填充 lat 和 lng 文本字段,但无法使用反向地理编码。我检查了 JS Fiddle 中的 Javascript,那里似乎没有问题,而且我也一直在查看 Gabriel Svennerberg 的文章,但我找不到哪里出错了。

有人可以看看这个,让我知道我哪里出错了吗?

非常感谢

【问题讨论】:

    标签: javascript google-maps-api-3 reverse-geocoding


    【解决方案1】:

    您的点击事件似乎没有调用您的 reversegeocode() 函数。您可能希望将其更改为:

    google.maps.event.addListener(marker, "click", function() {
                document.getElementById('dateoftrip').value = this.formdateoftrip;
                document.getElementById('findcategory').value = this.formfindcategory; 
                document.getElementById('finddescription').value = this.formfinddescription;
                document.getElementById('findosgb36lat').value = this.formfindosgb36lat;
                document.getElementById('findosgb36lon').value = this.formfindosgb36lon;
                reversegeocode();
                }); 
    

    【讨论】:

    • 非常感谢您花时间回复我的帖子和解决方案。亲切的问候
    猜你喜欢
    • 1970-01-01
    • 2014-04-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-10-31
    • 1970-01-01
    相关资源
    最近更新 更多