angular - ปัญหาการโยน Waypoint เมื่อใช้ agm-direction ใน Ionic
ฉันกำลังใช้ AGM Direction และฉันกำลังเจอปัญหานี้ใน Visual Studio Code:
Type '{ location: { lat: number; lng: number; }; }[]' is not assignable to type 'DirectionsWaypoint[]'.
Type '{ location: { lat: number; lng: number; }; }' is not assignable to type 'DirectionsWaypoint'.
Types of property 'location' are incompatible.
Type '{ lat: number; lng: number; }' is not assignable to type 'string | Place | LatLng'.
Type '{ lat: number; lng: number; }' is missing the following properties from type 'LatLng': equals, toUrlValue, toJSON
จุดทางยังคงแสดงอยู่และมันยังใช้งานได้ แต่บุคลิกที่เข้มงวดของฉันไม่ชอบเห็นเส้นใต้สีแดง ฉันไม่แน่ใจว่าจะกำจัดมันได้อย่างไร จะขอบคุณมากถ้าได้รับความช่วยเหลือ
โค้ดในไฟล์ typescript:
waypoints = [
{location: { lat: -25.913330, lng: 28.185640 }},
{location: { lat: -25.869650, lng: 28.217950 }}
];
โค้ดในไฟล์ HTML:
<agm-direction [origin]="origin" [destination]="destination" [waypoints]="waypoints"></agm-direction>
ข้อผิดพลาดปรากฏใต้ [waypoints]