Эй, я новичок в ионике. Я хотел нарисовать путь между двумя маркерами (двумя точками), используя API Google Maps, но я заблокирован этим куском кода.
Хорошо, увидев много учебников, я не могу найти никакой документации о рисовании маршрутов, поскольку их хранилище github никогда не упоминало рисование маршрутов, я думаю, что это не поддерживается.
loadMap() {
let mapOptions: GoogleMapOptions = {
camera: {
target: {
lat: this.agence.latitude,
//43.0741904,
lng: this.agence.longitude,
//-89.3809802
},
zoom: 14,
tilt: 30
}
};
this.map = GoogleMaps.create('map', mapOptions);
let marker: Marker = this.map.addMarkerSync({
title: 'Radeema'+this.agence.nom,
icon: 'red',
animation: 'DROP',
position: {
lat: this.agence.latitude,
lng: this.agence.longitude
}
});
let positionMarker: Marker = this.map.addMarkerSync({
title: 'votre position',
icon: 'blue',
animation: 'DROP',
position: {
lat: this.latitude,
lng: this.longitude,
}
});
this.map.addMarker({
title: 'votre position',
icon: 'green',
animation: 'DROP',
position: {
lat: this.latitude,
lng: this.longitude,
}
})
let directionsService = new google.maps.DirectionsService;
let directionsDisplay = new google.maps.DirectionsRenderer;
directionsService.route({
origin:{"lat": this.latitude, "lng": this.longitude} ,
destination: {"lat": this.agence.latitude, "lng": this.agence.longitude},
travelMode: google.maps.TravelMode['DRIVING']
}, (res, status) => {
if(status == google.maps.DirectionsStatus.OK){
directionsDisplay.setDirections(res);
} else {
console.warn(status);
}
});
this.map.addPolyline({
points: [
{"lat": this.latitude, "lng": this.longitude},
{"lat": this.agence.latitude, "lng": this.agence.longitude},
],
'color' : '#fff51e',
'width': 10,
'geodesic': true
}); }
![enter image description here](https://i.stack.imgur.com/gwPP7.png)
что мне делать в этом случае я не могу понять источник ошибки