如果您访问我的网站,您会看到我安装了 Google Local Search API。 基本上,它通过 javascript 访问 Google 并执行搜索。
有人搜索某些内容并点击其中一个结果后,我该如何提醒该地址? (现在, map 上弹出了一些窗台信息白框。我不想那样。我只想提醒地址)
最佳答案
改变
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);
};
关于javascript - 我如何修改我的 javascript 代码来提醒这个?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4664473/