-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
style raster data + add combined sand+soil option
- Loading branch information
1 parent
0d8c85d
commit 4bd2d6a
Showing
4 changed files
with
88 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
<template> | ||
<BaseMap> | ||
<template v-slot="{ map, mapReady }"> | ||
<RasterSource | ||
:id="rasterSourceId" | ||
tiles-url="https://plotine-vacs.s3.us-east-2.amazonaws.com/carbon-tiles/{z}/{x}/{y}.png" | ||
:map="map" | ||
:map-ready="mapReady" | ||
/> | ||
<SoilCarbonLayer | ||
id="soil-carbon" | ||
:map="map" | ||
:map-ready="mapReady" | ||
:source-id="rasterSourceId" | ||
/> | ||
<RasterSource | ||
:id="rasterSourceId2" | ||
tiles-url="https://plotine-vacs.s3.us-east-2.amazonaws.com/sand-tiles/{z}/{x}/{y}.png" | ||
:map="map" | ||
:map-ready="mapReady" | ||
/> | ||
<SandLayer id="sand" :map="map" :map-ready="mapReady" :source-id="rasterSourceId2" /> | ||
<GridSource :id="sourceId" :map="map" :mapReady="mapReady" /> | ||
<GridOverlay | ||
id="grid-layer-1" | ||
:color-column="selectedColumn" | ||
:color-column-extent="selectedColumnExtent" | ||
:color-column-quintiles="selectedColumnQuintiles" | ||
:color-diverging="true" | ||
:sourceId="sourceId" | ||
:map="map" | ||
:mapReady="mapReady" | ||
/> | ||
</template> | ||
</BaseMap> | ||
</template> | ||
|
||
<script setup> | ||
import { computed } from 'vue' | ||
import { storeToRefs } from 'pinia' | ||
import BaseMap from '@/components/BaseMap.vue' | ||
import { useFiltersStore } from '@/stores/filters' | ||
import { useCropYieldsStore } from '@/stores/cropYields' | ||
import GridSource from './GridSource.vue' | ||
import GridOverlay from './GridOverlay.vue' | ||
import RasterSource from './RasterSource.vue' | ||
import SoilCarbonLayer from './SoilCarbonLayer.vue' | ||
import SandLayer from './SandLayer.vue' | ||
const sourceId = 'cropGrid' | ||
const rasterSourceId = 'soilCarbonSource' | ||
const rasterSourceId2 = 'sandSource' | ||
const cropYieldsStore = useCropYieldsStore() | ||
const filtersStore = useFiltersStore() | ||
const { selectedCrop, selectedMetric, selectedModel } = storeToRefs(filtersStore) | ||
const selectedColumn = computed(() => { | ||
if (!selectedMetric.value || !selectedCrop.value || !selectedModel.value) { | ||
return null | ||
} | ||
return [selectedMetric.value, selectedCrop.value, selectedModel.value].join('_') | ||
}) | ||
const selectedColumnExtent = computed(() => { | ||
if (!selectedColumn.value) return null | ||
return cropYieldsStore.getExtent(selectedColumn.value) | ||
}) | ||
const selectedColumnQuintiles = computed(() => { | ||
if (!selectedColumn.value) return null | ||
return cropYieldsStore.getQuintiles(selectedColumn.value) | ||
}) | ||
</script> | ||
|
||
<style scoped></style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters