Output
Usage
The DirectionsResult
object will emit when sending a directions request.
@Output() onChange: EventEmitter<any> = new EventEmitter<any>()
@Output() onResponse: EventEmitter<any> = new EventEmitter<any>()
@Output() sendInfoWindow: EventEmitter<InfoWindow> = new EventEmitter<InfoWindow>();
@Output() status: EventEmitter<string> = new EventEmitter<string>();
Example
⭐️ onChange
<agm-direction ... (onChange)="onChange($event)"></agm-direction>
public onChange(event: any){
console.log(event);
// You can do anything.
}
⭐️ onResponse
<agm-direction ... (onResponse)="onResponse($event)"></agm-direction>
public onResponse(event: any){
console.log(event);
// You can do anything.
}
⭐️ sendInfoWindow
Only one infoWindow to be open at one time in multiple directions.
See Multiple directions one infoWindow
<agm-direction ... [infoWindow]="infoWindow" (sendInfoWindow)="obtainInfowindow($event)"></agm-direction>
import { InfoWindow } from '@agm/core/services/google-maps-types' // option
public infoWindow: InfoWindow = undefined
public obtainInfowindow(window: InfoWindow) {
this.infoWindow = window
}
⭐️ status
Status of Directions Query.
<agm-direction ... (status)="getStatus($event)"></agm-direction>
public getStatus(status: any){
console.log(status);
}