Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Manual bbox entry option to search page #389

Open
wants to merge 24 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
4ca7a34
WIP: add param on submit and clear on reset
stephenkilbourn Oct 25, 2023
03efc9a
implement loading filter values from params
stephenkilbourn Nov 2, 2023
94318fb
check & show geospatial map based on url param
stephenkilbourn Nov 3, 2023
dcec953
overwrite defaults with url params
stephenkilbourn Nov 3, 2023
8d6af73
submit form on load if query params present
stephenkilbourn Nov 3, 2023
01bd9da
allow bbox input via text or map
stephenkilbourn Nov 9, 2023
1bdf78f
set datetime to date object array when reading query param string
stephenkilbourn Nov 9, 2023
c54484b
move bbox entry to component
stephenkilbourn Nov 9, 2023
71df2ed
fix linting error
stephenkilbourn Nov 9, 2023
cfc913d
add manual BBoxEntry Component to search
stephenkilbourn Nov 10, 2023
933adc4
switch to tabs
stephenkilbourn Nov 13, 2023
8068ac4
remove console log
stephenkilbourn Nov 13, 2023
caca3a4
move defaults to component, validate prop, remove unused style import
stephenkilbourn Nov 14, 2023
fb0683e
Update src/components/BBoxEntry.vue
stephenkilbourn Nov 14, 2023
5a96538
map tab to initialize with query.bbox and set areaselect to that bbox
stephenkilbourn Nov 23, 2023
a07190e
Merge branch 'manual-bbox-entry' of github.com:stephenkilbourn/stac-b…
stephenkilbourn Nov 23, 2023
3fc9e29
move bbox labels to locales
stephenkilbourn Jan 12, 2024
23866c3
update setInitialBounds to use leaflet bounds methods
stephenkilbourn Jan 12, 2024
f25404a
fix: lat, lon were swapped
stephenkilbourn Jan 12, 2024
75ddf39
remove unused watcher & default bbox value
stephenkilbourn Jan 12, 2024
fed9d9d
use setBBox() instead of $set()
stephenkilbourn Jan 12, 2024
5230e3b
no need to initialize _bbox
stephenkilbourn Jan 12, 2024
3f58ecb
ensure map is centered on bounds from Bbox entry before rendering
stephenkilbourn Jan 24, 2024
569b34f
round value from bounding box
stephenkilbourn Jan 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions src/components/BBoxEntry.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<b-form-input
id="sw_latitude"
@input="updateBBoxArray($event, 0)"
:value="bbox[0]"
:value="bboxArray[0]"
type="number"
no-wheel
step="any"
Expand All @@ -20,7 +20,7 @@
<b-form-input
id="sw_longitude"
@input="updateBBoxArray($event, 1)"
:value="bbox[1]"
:value="bboxArray[1]"
type="number"
no-wheel
step="any"
Expand All @@ -36,7 +36,7 @@
<b-form-input
id="ne_latitude"
@input="updateBBoxArray($event, 2)"
:value="bbox[2]"
:value="bboxArray[2]"
type="number"
no-wheel
step="any"
Expand All @@ -50,7 +50,7 @@
<b-form-input
id="ne_longitude"
@input="updateBBoxArray($event, 3)"
:value="bbox[3]"
:value="bboxArray[3]"
type="number"
no-wheel
step="any"
Expand All @@ -68,28 +68,28 @@ import { BFormInput, BFormGroup} from 'bootstrap-vue';

export default {
name: 'BBoxEntry',
components: {
components: {
BFormGroup,
BFormInput,
},
props: {
props: {
bbox: {
type: Array,
required: true
type: [Array, null],
default: () => ([-180, -80, 180, 80]),
validator(value) {
return value.length === 4 && value.every((e) => typeof e === 'number');
stephenkilbourn marked this conversation as resolved.
Show resolved Hide resolved
}
}
},
computed: {
bboxArray() {
return this.bbox || [-180, -80, 180, 80];
}
},
methods: {
updateBBoxArray($event, position) {
this.$emit('updateBBoxArray', $event, position);
}
}
},
};
</script>

<style lang="scss">
@import "../theme/variables.scss";

legend {
font-size: 1.3em
}
</style>
2 changes: 1 addition & 1 deletion src/components/SearchFilter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<Map class="mb-4" :stac="stac" selectBounds @bounds="setBBox" scrollWheelZoom />
</b-tab>
<b-tab v-model="bboxSelectionStyle" :title="$t('search.defineBbox.text')">
<BBoxEntry :bbox="query.bbox || [-180, -80, 180, 80]" @updateBBoxArray="updateBBoxArray" />
<BBoxEntry :bbox="query.bbox" @updateBBoxArray="updateBBoxArray" />
</b-tab>
</b-tabs>
</b-form-group>
Expand Down