http://geodit.com:8000/test
If you go to my site, you'll see that you I installed Google Local Search API. Basically, it hits Google via javascript and performs a search.
开发者_如何学编程After someone searches something and clicks on one of the results, how can I alert the address? (right now, some sill info white box pops up on the map. I don't want that. i just want to alert the address)
Change the
LocalResult.prototype.select = function() {
unselectMarkers();
this.selected_ = true;
this.highlight(true);
gInfoWindow.setContent(this.html(true));
gInfoWindow.open(gMap, this.marker());
};
to
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);
};
精彩评论