Google maps angular 2.maps.places无地图

Google maps angular 2.maps.places无地图,google-maps,angular,google-maps-api-3,ionic2,Google Maps,Angular,Google Maps Api 3,Ionic2,我正在尝试使用place_id获取地点详细信息,而无需地图画布。对api本身进行“http.get”调用似乎不起作用,而是被迫使用google maps的角度实现 当前堆栈位于: let service = new google.maps.places.PlacesService(map); 最后通过查看jquery示例找到了答案。通过使用一个虚拟的domdiv,这是一个非常简单的过程 document.createElement('div') 例如,要使用getUrl方法获取与“photos

我正在尝试使用place_id获取地点详细信息,而无需地图画布。对api本身进行“http.get”调用似乎不起作用,而是被迫使用google maps的角度实现

当前堆栈位于:

let service = new google.maps.places.PlacesService(map);

最后通过查看jquery示例找到了答案。通过使用一个虚拟的domdiv,这是一个非常简单的过程

document.createElement('div')

例如,要使用getUrl方法获取与“photos”对象数组上的place just循环相关联的照片,请参见下面的(使用所需的大小):

place.photos[1].getUrl({'maxWidth':100,'maxHeight':100})

其他可用的属性在这里

  let service = new google.maps.places.PlacesService(document.createElement('div'));
  service.getDetails({ placeId: placeId}, function(place, status){              
    console.log(JSON.stringify(place));
  });