【发布时间】:2011-01-12 01:09:29
【问题描述】:
如果您访问我的网站,您会看到我安装了 Google Local Search API。 基本上,它通过 javascript 访问 Google 并执行搜索。
有人搜索某项内容并点击其中一个结果后,我如何提醒该地址? (现在,地图上会弹出一些门槛信息白框,我不要,我只想提醒地址)
【问题讨论】:
标签: javascript jquery css templates google-maps
如果您访问我的网站,您会看到我安装了 Google Local Search API。 基本上,它通过 javascript 访问 Google 并执行搜索。
有人搜索某项内容并点击其中一个结果后,我如何提醒该地址? (现在,地图上会弹出一些门槛信息白框,我不要,我只想提醒地址)
【问题讨论】:
标签: javascript jquery css templates google-maps
改变
LocalResult.prototype.select = function() {
unselectMarkers();
this.selected_ = true;
this.highlight(true);
gInfoWindow.setContent(this.html(true));
gInfoWindow.open(gMap, this.marker());
};
到
LocalResult.prototype.select = function() {
unselectMarkers();
this.selected_ = true;
this.highlight(true);
var msg = 'Address\n\t';
msg += this.result_.addressLines.join('\n\t');
msg += '\nCity\n\t';
msg += this.result_.city;
msg += '\nCountry\n\t';
msg += this.result_.country;
alert(msg);
};
【讨论】:
this 对象引用 LocalResult 时,我使用了 firebug 来检查它。 (在上述函数中使用console.log(this))