mirror of
https://gitlab.com/little-lines/frontend.git
synced 2024-11-24 22:06:53 +00:00
implement stop routing
This commit is contained in:
parent
eeccb24a92
commit
760d868dc2
2 changed files with 30 additions and 21 deletions
|
@ -243,7 +243,7 @@ export default {
|
|||
showRoute: false,
|
||||
userLocation: null,
|
||||
isLocationRequested: false,
|
||||
|
||||
isRouting: false,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
|
@ -262,6 +262,10 @@ export default {
|
|||
methods: {
|
||||
closePopup() {
|
||||
this.showPopup = false;
|
||||
|
||||
this.$emit('updateRouting', {route:null,isRouting:false});
|
||||
this.isRouting = false;
|
||||
|
||||
this.onClose();
|
||||
},
|
||||
viewRoute() {
|
||||
|
@ -293,6 +297,9 @@ export default {
|
|||
viewPopup(){
|
||||
this.showPopup = true;
|
||||
this.showRoute = false;
|
||||
|
||||
this.$emit('updateRouting', {route:null,isRouting:false});
|
||||
this.isRouting = false;
|
||||
},
|
||||
addToFavorites() {
|
||||
const currentUser = JSON.parse(sessionStorage.getItem('current_user'));
|
||||
|
@ -333,6 +340,7 @@ export default {
|
|||
}
|
||||
},
|
||||
Routing(){
|
||||
if(!this.isRouting){
|
||||
console.log('Start routing!!');
|
||||
console.log(`nearestStructureData : ${this.nearestStructureData.lon},${this.nearestStructureData.lat}`);
|
||||
console.log(`userLocation : ${this.userLocation.lon},${this.userLocation.lat}`);
|
||||
|
@ -345,12 +353,13 @@ export default {
|
|||
.then(response => {
|
||||
const route = response.data.features[0].geometry.coordinates;
|
||||
console.log('This is route :',{route:route})
|
||||
this.$emit('updateRouting', {route:route});
|
||||
// this.plotRoute(route);
|
||||
this.$emit('updateRouting', {route:route,isRouting:true});
|
||||
this.isRouting = true;
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Error fetching route:', error);
|
||||
});
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
|
|
|
@ -189,7 +189,7 @@ const closePopup = () => {
|
|||
const handleRouting = (res) => {
|
||||
console.log("Received Route:", res);
|
||||
route.value = res.route;
|
||||
isRouting.value = true;
|
||||
isRouting.value = res.isRouting;
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue