Skip to content

Commit

Permalink
views: MissionPlanning: Fix map position check
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
  • Loading branch information
patrickelectric authored and rafaellehmkuhl committed Apr 5, 2024
1 parent b4365ef commit f6d4dcc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/views/MissionPlanningView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,10 @@ onMounted(async () => {
planningMap.value.on('moveend', () => {
if (planningMap.value === undefined) return
mapCenter.value = [planningMap.value?.getCenter().lat, planningMap.value?.getCenter().lng] ?? mapCenter.value
let { lat, lng } = planningMap.value.getCenter()
if (lat && lng) {
mapCenter.value = [lat, lng]
}
})
planningMap.value.on('zoomend', () => {
if (planningMap.value === undefined) return
Expand Down

0 comments on commit f6d4dcc

Please sign in to comment.