Skip to content

Commit

Permalink
show prob for bottom sheet
Browse files Browse the repository at this point in the history
  • Loading branch information
devincowan committed Feb 24, 2024
1 parent 0957a9a commit 83470dc
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 20 deletions.
9 changes: 3 additions & 6 deletions frontend/src/components/TheBottomSheet.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<template>
<v-bottom-sheet v-model="show" inset>
<v-bottom-sheet v-model="props.show" inset>
<v-card class="text-center" height="100%">
<v-card-text>
<v-btn @click="show = null">
<v-btn @click="props.show = null">
close
</v-btn>

Expand All @@ -18,11 +18,8 @@
</v-bottom-sheet>
</template>
<script setup>
import { ref } from 'vue'
import ChartVis from "@/components/ChartVis.vue";
defineProps(['sheetObject'])
let show = ref(true)
let props = defineProps(['sheetObject', 'show'])
const data = {
labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
Expand Down
36 changes: 22 additions & 14 deletions frontend/src/components/TheLeafletMap.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div id="mapContainer"></div>
<TheBottomSheet :sheetObject="swotData" />
<TheBottomSheet :sheetObject="swotData" :show="showSheet" />
</template>

<script setup>
Expand All @@ -22,6 +22,7 @@ const modelsStore = useModelsStore();
const alertStore = useAlertStore();
let swotData = ref(null)
let showSheet = ref(false)
const modelAction = modelsStore.$onAction(
({
Expand Down Expand Up @@ -191,19 +192,26 @@ onMounted(() => {
}
const searchParams = new URLSearchParams(params)
let query = url + '?' + searchParams.toString()
let result = await fetch(query, {
method: 'GET',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
})
console.log(result)
let json = await result.json()
swotData.value = json
console.log("json", json)
console.log("features", json.results.geojson.features)
alert(JSON.stringify(json))
showSheet.value = true
swotData.value = `Loading data for reach ${e.layer.feature.properties.reach_id} from ${url}`
try {
let result = await fetch(query, {
method: 'GET',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
})
let json = await result.json()
swotData.value = json
console.log(result)
console.log("json", json)
console.log("features", json.results.geojson.features)
} catch (e) {
console.error("Error fetching data", e)
alert(`Error fetching swot data: ${e}`)
showSheet.value = false
}
});
// add nodes layer to map
Expand Down

0 comments on commit 83470dc

Please sign in to comment.