Javascript 如何使用InfoWindow在google地图上显示电话、网站和URL的信息?
使用下面的GoogleMapAPI示例代码,我正在尝试创建我的GoogleMap应用程序。但是,当我搜索餐厅并点击地图上的标记时,我看不到电话、网站的信息,也无法访问url。显示信息的解决方案是什么 这是我提到的示例代码 这是我正在写的代码。Javascript 如何使用InfoWindow在google地图上显示电话、网站和URL的信息?,javascript,google-maps-api-3,google-maps-markers,Javascript,Google Maps Api 3,Google Maps Markers,使用下面的GoogleMapAPI示例代码,我正在尝试创建我的GoogleMap应用程序。但是,当我搜索餐厅并点击地图上的标记时,我看不到电话、网站的信息,也无法访问url。显示信息的解决方案是什么 这是我提到的示例代码 这是我正在写的代码。 方法textSearch()的响应没有某个地方的电话、网站或url,您需要调用其他getDetails(place\u id)来获取该数据 例如: var places = new google.maps.places.PlacesService(m
方法textSearch()的响应没有某个地方的电话、网站或url,您需要调用其他getDetails(place\u id)来获取该数据 例如:
var places = new google.maps.places.PlacesService(map);
places.getDetails({placeId: marker.placeResult.place_id},
function(place, status) {
if (status !== google.maps.places.PlacesServiceStatus.OK) {
return;
}
infoWindow.open(map, marker);
//place object has the information about phone, webste...
buildIWContent(place);
});
谢谢你的回答!解决了的!