在我的angular10
应用程序中,我agm core
用来显示google maps
。
组件.html
<agm-map [latitude]="latitude" [longitude]="longitude">
<agm-direction *ngIf="source && dest" [origin]="source" [destination]="dest"></agm-direction>
</agm-map>
组件.ts
ngOnInit(){
// above code...
this.source = {
lat: +(this.bidlocation.pickup.lat),
lng: +(this.bidlocation.pickup.long)
};
this.dest = {
lat: +(this.bidlocation.dropOff.lat),
lng: +(this.bidlocation.dropOff.long)
}
}
现在map
正在显示并且direction
也在map
正确显示,但我正在接受error
这个console
InvalidValueError: in property origin: must set one of location, placeId or query