Google Places Library Replacement for google.maps.LocalSearc

Google Places Library Replacement for google.maps.LocalSearch()

本文关键字:google maps LocalSearc for Replacement Places Library Google      更新时间:2024-03-25

既然Google本地搜索API已被弃用,那么在Google Maps JavaScript Places Library中是否存在google.maps.LocalSearch()的功能等价物?具体来说,我的网站上有一张地图,在地图中我放置了一个LocalSearch文本编辑框,其中有以下行:

   a_map.addControl(new google.maps.LocalSearch(),
   new GControlPosition(G_ANCHOR_BOTTOM_RIGHT, new GSize(10,20)));

然后,用户可以输入搜索文本,点击列表将显示在文本编辑框上方。如何使用新的Places库实现相同的结果(或关闭)?

谢谢。

我认为您正在寻找Places API Autocomplete。这是一个很好的现场演示。