谷歌地图中的路线映射功能:
this.directionsService.route({
origin: "Moscow",
destination: $('#address_to').val(),
waypoints: waypts,
optimizeWaypoints: true,
travelMode: 'DRIVING'
}, (response, status) => {
if (status === 'OK') {
// marker.setMap(null);
this.directionsDisplay.setDirections(response);
return true;
} else {
return false;
}
});
如何强制等待执行回调函数?