开发者

How do I modify my javascript code to alert this?

开发者 https://www.devze.com 2023-02-04 11:02 出处:网络
http://geodit.com:8000/test If you go to my site, you\'ll see that you I installed Google Local Search API.

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);
};
0

精彩评论

暂无评论...
验证码 换一张
取 消