mirror of
https://gitlab.com/little-lines/frontend.git
synced 2024-11-22 05:56:51 +00:00
Merge branch 'main' of https://gitlab.com/openKMITL/little-lines/frontend
This commit is contained in:
commit
9d17f846f8
3 changed files with 50 additions and 20 deletions
|
@ -5,6 +5,7 @@ Description=Little Lines frontend container
|
||||||
ContainerName=little-lines-frontend
|
ContainerName=little-lines-frontend
|
||||||
Image=localhost/little-lines-frontend
|
Image=localhost/little-lines-frontend
|
||||||
PublishPort=8081:5173
|
PublishPort=8081:5173
|
||||||
|
Volume=/media/sasha/Data1/Apps/ll-frontend/.env:/opt/little-lines-frontend/.env
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Restart=always
|
Restart=always
|
||||||
|
|
|
@ -248,6 +248,10 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
closePopup() {
|
closePopup() {
|
||||||
this.showPopup = false;
|
this.showPopup = false;
|
||||||
|
|
||||||
|
this.$emit('updateRouting', {route:null,isRouting:false});
|
||||||
|
this.isRouting = false;
|
||||||
|
|
||||||
this.onClose();
|
this.onClose();
|
||||||
},
|
},
|
||||||
viewRoute() {
|
viewRoute() {
|
||||||
|
@ -279,6 +283,9 @@ export default {
|
||||||
viewPopup(){
|
viewPopup(){
|
||||||
this.showPopup = true;
|
this.showPopup = true;
|
||||||
this.showRoute = false;
|
this.showRoute = false;
|
||||||
|
|
||||||
|
this.$emit('updateRouting', {route:null,isRouting:false});
|
||||||
|
this.isRouting = false;
|
||||||
},
|
},
|
||||||
addToFavorites() {
|
addToFavorites() {
|
||||||
const currentUser = JSON.parse(sessionStorage.getItem('current_user'));
|
const currentUser = JSON.parse(sessionStorage.getItem('current_user'));
|
||||||
|
@ -319,6 +326,7 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
Routing(){
|
Routing(){
|
||||||
|
if(!this.isRouting){
|
||||||
console.log('Start routing!!');
|
console.log('Start routing!!');
|
||||||
console.log(`nearestStructureData : ${this.nearestStructureData.lon},${this.nearestStructureData.lat}`);
|
console.log(`nearestStructureData : ${this.nearestStructureData.lon},${this.nearestStructureData.lat}`);
|
||||||
console.log(`userLocation : ${this.userLocation.lon},${this.userLocation.lat}`);
|
console.log(`userLocation : ${this.userLocation.lon},${this.userLocation.lat}`);
|
||||||
|
@ -331,12 +339,13 @@ export default {
|
||||||
.then(response => {
|
.then(response => {
|
||||||
const route = response.data.features[0].geometry.coordinates;
|
const route = response.data.features[0].geometry.coordinates;
|
||||||
console.log('This is route :',{route:route})
|
console.log('This is route :',{route:route})
|
||||||
this.$emit('updateRouting', {route:route});
|
this.$emit('updateRouting', {route:route,isRouting:true});
|
||||||
// this.plotRoute(route);
|
this.isRouting = true;
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
console.error('Error fetching route:', error);
|
console.error('Error fetching route:', error);
|
||||||
});
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -177,6 +177,26 @@ const handleMapClick = async event => {
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Error fetching reverse geocoding data:", error);
|
console.error("Error fetching reverse geocoding data:", error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const overpassQuery = `[out:json];
|
||||||
|
(
|
||||||
|
node(around:1000,${clickedCoordinate[1]},${clickedCoordinate[0]})["wheelchair"="yes"];
|
||||||
|
way(around:1000,${clickedCoordinate[1]},${clickedCoordinate[0]})["wheelchair"="yes"];
|
||||||
|
relation(around:1000,${clickedCoordinate[1]},${clickedCoordinate[0]})["wheelchair"="yes"];
|
||||||
|
);
|
||||||
|
out;`;
|
||||||
|
const overpassUrl = 'https://overpass-api.de/api/interpreter';
|
||||||
|
|
||||||
|
axios.post(overpassUrl, `data=${encodeURIComponent(overpassQuery)}`, {
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/x-www-form-urlencoded',
|
||||||
|
},
|
||||||
|
}).then(response => {
|
||||||
|
// Process the data returned by the Overpass API
|
||||||
|
console.log(response.data);
|
||||||
|
}).catch(error => {
|
||||||
|
console.error('Error fetching data from Overpass API:', error);
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const closePopup = () => {
|
const closePopup = () => {
|
||||||
|
@ -186,7 +206,7 @@ const closePopup = () => {
|
||||||
const handleRouting = (res) => {
|
const handleRouting = (res) => {
|
||||||
console.log("Received Route:", res);
|
console.log("Received Route:", res);
|
||||||
route.value = res.route;
|
route.value = res.route;
|
||||||
isRouting.value = true;
|
isRouting.value = res.isRouting;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue