diff options
Diffstat (limited to 'app/navigation.qml')
-rw-r--r-- | app/navigation.qml | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/app/navigation.qml b/app/navigation.qml index a5d20ea..71763c2 100644 --- a/app/navigation.qml +++ b/app/navigation.qml @@ -483,6 +483,9 @@ ApplicationWindow { } function updatePositon() { + if (!routeModel.get(0)) + return; + if(pathcounter <= routeModel.get(0).path.length - 1){ // calculate distance var next_distance = calculateDistance(map.currentpostion.latitude, @@ -646,16 +649,14 @@ ApplicationWindow { function doSetWaypointsSlot(latitude,longitue,startFromCurrentPosition){ - if(btn_guidance.state !== "idle") - btn_guidance.discardWaypoints(startFromCurrentPosition); + btn_guidance.discardWaypoints(startFromCurrentPosition); if(btn_present_position.state === "Optional"){ map.center = map.currentpostion btn_present_position.state = "Flowing" } - if((btn_guidance.state !== "onGuide") && (btn_guidance.state !== "Routing")) - map.addDestination(QtPositioning.coordinate(latitude,longitue)) + map.addDestination(QtPositioning.coordinate(latitude,longitue)) } states: [ |