Skip to content

Commit dd233f1

Browse files
authored
Merge pull request #251 from fieldsoftheworld/review
Changes proposed in the review meeting
2 parents 6662a23 + 2690404 commit dd233f1

10 files changed

Lines changed: 123 additions & 219 deletions

File tree

src/components/GlobalDataPanel.vue

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import type { PlaceResult } from '../composables/useAreaOfInterest'
66
import useNotifier from '../composables/useNotifier'
77
import { transformExtent } from 'ol/proj'
88
import GeocodingSearch from './GeocodingSearch.vue'
9+
import MapLegend from './MapLegend.vue'
910
1011
const { settings } = useSettings()
1112
const { map } = useMap()
@@ -31,7 +32,7 @@ const handleLocationSelected = (place: PlaceResult) => {
3132
for 2024-2025. They were computed using the model <strong>FTW v3: CC-BY, B7</strong>.
3233
</v-alert>
3334

34-
<v-row class="d-flex justify-center w-100 mx-auto">
35+
<v-row class="d-flex justify-center w-100 mx-auto mb-0">
3536
<v-col>
3637
<h3 class="group">Location</h3>
3738
<GeocodingSearch @location-selected="handleLocationSelected" />
@@ -40,12 +41,6 @@ const handleLocationSelected = (place: PlaceResult) => {
4041
<v-radio label="2024" :value="2024"></v-radio>
4142
<v-radio label="2025" :value="2025"></v-radio>
4243
</v-radio-group>
43-
<h3 class="group">Overviews</h3>
44-
<v-radio-group v-model="settings.aggregate" density="compact" hide-details inline>
45-
<v-radio label="Field Area" value="area"></v-radio>
46-
<v-radio label="Confidence" value="confidence"></v-radio>
47-
</v-radio-group>
48-
4944
<h3 class="group">Confidence Threshold: {{ (settings.threshold * 100).toFixed(0) }}%</h3>
5045
<v-slider
5146
v-model.number="settings.threshold"
@@ -57,17 +52,24 @@ const handleLocationSelected = (place: PlaceResult) => {
5752
thumb-color="teal"
5853
hide-details
5954
/>
55+
<h3 class="group legend">Legend</h3>
56+
<MapLegend />
6057
</v-col>
6158
</v-row>
6259
</div>
6360
</template>
6461

6562
<style scoped>
6663
.group {
67-
margin: 0.5rem -0.5rem;
64+
margin: 1rem -0.5rem 0.5rem;
6865
font-weight: 500;
6966
font-size: 1.1rem;
7067
}
68+
.group.legend {
69+
margin-top: 1rem;
70+
border-top: 1px solid rgba(136, 136, 136, 0.65);
71+
padding-top: 1rem;
72+
}
7173
:deep(.v-selection-control-group--inline) {
7274
gap: 1rem;
7375
}

src/components/MapComponent.vue

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<script setup lang="ts">
22
import { ref, onMounted } from 'vue'
33
import { Map, View } from 'ol'
4+
import { ScaleLine } from 'ol/control'
45
import DataCabinet from './DataCabinet.vue'
56
import GlobalFeedbackWidget from './GlobalFeedbackWidget.vue'
6-
import MapLegend from './MapLegend.vue'
77
import ProcessingResults from './ProcessingResults.vue'
88
import PropertiesDisplay from './PropertiesDisplay.vue'
99
import createLabelLayer from '../layers/Label-Layer'
@@ -89,6 +89,8 @@ onMounted(async () => {
8989
updateLayers()
9090
9191
addMapClickHandler(map.value as Map, areaValues.value)
92+
// Add scale bar
93+
map.value.addControl(new ScaleLine())
9294
// Setup permalink functionality
9395
setupPermalink(map)
9496
}
@@ -114,8 +116,6 @@ defineExpose({
114116
/>
115117

116118
<GlobalFeedbackWidget v-if="map && settings.mode === 'global'" />
117-
118-
<MapLegend />
119119
</div>
120120

121121
<!-- Properties Box -->
@@ -227,6 +227,17 @@ defineExpose({
227227
overflow-y: auto;
228228
}
229229
230+
:deep(.ol-zoom),
231+
:deep(.ol-attribution),
232+
:deep(.ol-scale-line) {
233+
--ol-background-color: black;
234+
--ol-accent-background-color: #333333;
235+
--ol-subtle-background-color: rgba(128, 128, 128, 0.25);
236+
--ol-partial-background-color: rgba(0, 0, 0, 0.75);
237+
--ol-foreground-color: #eeeeee;
238+
--ol-subtle-foreground-color: #aaaaaa;
239+
}
240+
230241
:deep(.ol-zoom) {
231242
top: unset;
232243
right: unset;
@@ -235,41 +246,31 @@ defineExpose({
235246
z-index: 10000;
236247
}
237248
238-
:deep(.ol-attribution) {
249+
:deep(.ol-scale-line) {
239250
top: unset;
240251
right: unset;
241252
bottom: 1rem;
242-
left: calc(2rem + 10px);
253+
left: 3rem;
254+
z-index: 2000;
255+
}
256+
257+
:deep(.ol-attribution) {
258+
top: unset;
259+
right: unset;
260+
bottom: calc(4rem);
261+
left: 1rem;
243262
z-index: 10000;
244263
flex-direction: row;
245-
max-width: 90vw;
264+
max-width: 30vw;
246265
align-items: end;
266+
text-align: left;
247267
}
248268
249269
:deep(.ol-attribution button) {
250270
order: -1;
251271
}
252272
253-
:deep(.ol-zoom button),
254-
:deep(.ol-attribution button) {
255-
background-color: rgba(0, 0, 0, 0.8);
256-
color: #fff;
257-
}
258-
259-
:deep(.ol-zoom button:hover),
260-
:deep(.ol-attribution button:hover) {
261-
background-color: rgba(0, 0, 0, 1);
262-
color: #fff;
263-
}
264-
265273
:deep(.ol-attribution ul) {
266-
color: #000;
267274
font-size: 0.875rem;
268-
text-shadow: none;
269-
}
270-
271-
:deep(.ol-attribution ul li a) {
272-
color: #000;
273-
text-decoration: underline;
274275
}
275276
</style>

0 commit comments

Comments
 (0)