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

feat: YETI 2023 updates #3727

Merged
merged 31 commits into from
Dec 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
89e2fab
Fix counter's style to match other icons
iamvdo Apr 18, 2023
7c43872
Better style for IconLayer's icons
iamvdo Apr 18, 2023
5648ba2
New layout
iamvdo Apr 18, 2023
ab881ca
Better styles and a11y of forms elements
iamvdo Apr 18, 2023
a0cbb3a
Panel should be position:relative
iamvdo Apr 18, 2023
f95e69f
Remove layers switcher selector
iamvdo Apr 18, 2023
79312ad
Tabs with icons
iamvdo Apr 18, 2023
a14b6d9
Move map layers on their own components
iamvdo Apr 18, 2023
506e2df
Use map layers inside AreaLayer
iamvdo Apr 18, 2023
3a117a2
Refactor YetiLayer (prepare for new tab)
iamvdo Apr 19, 2023
d0494d9
Add new Layers tab (layers selector)
iamvdo Apr 19, 2023
b541c7c
Add toast when click on old layers icon from map
iamvdo Apr 19, 2023
5e81f96
Set maxZoom to 16 for IGN maps
iamvdo Apr 19, 2023
6f48ada
Fix: strokes should always be on top
iamvdo Nov 13, 2023
080358c
Remove "Force elevations" option
iamvdo Nov 13, 2023
bb3f3a3
Move yetiData/yetiExtent to Yetix
iamvdo Nov 14, 2023
ecc17c7
Move all layer selectors on their own component
iamvdo Nov 14, 2023
8b1682c
Move legends on their own components
iamvdo Nov 17, 2023
501177f
Set hovered style for icon layers
iamvdo Nov 17, 2023
7620150
Set hovered style for bulletins layer
iamvdo Nov 17, 2023
a4c1732
Add Winter hiking routes layer
iamvdo Nov 20, 2023
cdae513
Use SVG paths instead of texts for avalanche bulletin icons
iamvdo Nov 20, 2023
5af98da
Disable animation on tiles load (performance)
iamvdo Nov 20, 2023
514b9ae
Move drawingMode on its own component
iamvdo Nov 21, 2023
99a960e
Rename drawingMode to editMode
iamvdo Nov 21, 2023
9367d0a
Add geolocation button on map
iamvdo Nov 21, 2023
76ccc3a
Do not allow clicks on smaller zoom for avalanche bulletins
iamvdo Nov 21, 2023
865e67d
Disable rotation on map
iamvdo Nov 21, 2023
a7e842d
Fixes for Safari
iamvdo Nov 23, 2023
14e30c1
Add Data Avalanche
ShirleyBJ Mar 31, 2023
b2856da
Fix lint
iamvdo Nov 28, 2023
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
Binary file added src/assets/img/yeti/layers/at.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/img/yeti/layers/atortho.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/img/yeti/layers/avalanche.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/img/yeti/layers/data-avalanche.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/img/yeti/layers/esri.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/img/yeti/layers/flowcapt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/img/yeti/layers/icgc.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/img/yeti/layers/icgcortho.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/img/yeti/layers/ign.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/img/yeti/layers/ignes.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/img/yeti/layers/ignesortho.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/img/yeti/layers/ignortho.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/img/yeti/layers/ignslopes.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/img/yeti/layers/nivose.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/img/yeti/layers/opentopomap.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/img/yeti/layers/romma.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/img/yeti/layers/swisstopo.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/img/yeti/layers/swisstopoortho.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/img/yeti/layers/swisstoposlopes.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/img/yeti/layers/winter-route.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/img/yeti/layers/yeti-extent.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/img/yeti/layers/yeti-risk.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/img/yeti/legends/winter-route-icon1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/img/yeti/legends/winter-route-icon2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 11 additions & 6 deletions src/components/yeti/Counter.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<span class="yeti-counter" :class="{ 'has-background-primary': isPrimary }">
<slot />
<span><slot /></span>
</span>
</template>

Expand All @@ -20,17 +20,22 @@ export default {
.yeti-counter {
display: inline-block;
width: 1.1rem;
height: 1.1rem;
vertical-align: 0.1rem;
min-width: 1em;
height: 1em;
line-height: 1em;
margin-left: 0.25rem;
padding: 0 0.25rem;
background: $grey-lighter;
color: $grey-darker;
border-radius: 50%;
font-size: 0.72em;
border-radius: 1em;
font-weight: normal;
text-align: center;
span {
font-size: 0.72em;
vertical-align: 0.125em;
}
&.has-background-primary {
color: $white;
}
Expand Down
64 changes: 64 additions & 0 deletions src/components/yeti/EditModeButton.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<template>
<div class="ol-control ol-control-edit-mode" :class="{ 'is-primary': editMode }">
<div class="ol-control-edit-mode-inner">
<input-checkbox @input="onEditMode" :value="editMode" :disabled="validSimplifyTolerance">
<span v-translate :title="$gettext('Enable drawing and editing features on map')">Edit mode</span>
</input-checkbox>
</div>
</div>
</template>

<script>
import Yetix from '@/components/yeti/Yetix';
export default {
computed: {
editMode() {
return Yetix.editMode;
},
validSimplifyTolerance() {
return Yetix.validSimplifyTolerance;
},
},
methods: {
onEditMode() {
Yetix.setEditMode(!this.editMode);
},
},
};
</script>

<style scoped lang="scss">
@import '@/assets/sass/variables';
.ol-control-edit-mode {
padding: 0 !important;
&.is-primary {
box-shadow: none;
}
.ol-control-edit-mode-inner {
padding: 0.3rem 0.25rem 0.2rem;
border-radius: 4px;
background: $white;
white-space: nowrap;
}
&.is-primary .ol-control-edit-mode-inner {
background: $grey-dark;
color: $white;
}
}
</style>

<style lang="scss">
.yeti-app {
.ol-control-edit-mode {
.is-checkradio[type='checkbox'] + label {
font-size: 0.93em;
margin-right: 0;
}
}
}
</style>
67 changes: 22 additions & 45 deletions src/components/yeti/ElevationProfile.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,35 +9,29 @@
<input-checkbox v-model="interpolate" class="mt-2">
<span v-translate>Add more points</span>
</input-checkbox>
<div v-if="interpolate" class="control-subpanel">
<label for="inputInterpolate" v-translate>Distance</label>
<input
id="inputInterpolate"
class="input is-small input-interpolate ml-2"
type="number"
min="5"
step="5"
v-model.number="interpolateValue"
/>
<info inline class="ml-0 pl-0" v-if="atLeastOneLineChunkHasTooMuchPoints">
<span v-translate key="1">Too much points</span>
</info>
<info inline class="ml-0 pl-0" v-if="interpolateValueInvalid">
<span v-translate key="2">Invalid value</span>
<div v-if="interpolate">
<div class="control-subpanel">
<label for="inputInterpolate" v-translate>Distance</label>
<input
id="inputInterpolate"
class="input is-small input-interpolate ml-2"
type="number"
min="5"
step="5"
v-model.number="interpolateValue"
/>
<info inline class="ml-0 pl-0" v-if="atLeastOneLineChunkHasTooMuchPoints">
<span v-translate key="1">Too much points</span>
</info>
<info inline class="ml-0 pl-0" v-if="interpolateValueInvalid">
<span v-translate key="2">Invalid value</span>
</info>
</div>
<info type="help" class="column">
<p v-translate>Will generate new points along route, at regular interval, defined by distance in meters</p>
</info>
</div>
<info type="help" class="column">
<p v-translate>Will generate new points along route, at regular interval, defined by distance in meters</p>
</info>
</div>
<div>
<input-checkbox v-model="override" class="mt-2">
<span v-translate>Force elevations</span>
</input-checkbox>
</div>
<info type="help" class="column">
<p v-translate>If checked, all elevations will be recomputed and current values will be lost</p>
</info>
</div>
<div class="is-flex is-justify-content-end is-align-items-center">
<info inline v-if="routeIntersectsYetiAreas">
Expand Down Expand Up @@ -81,7 +75,6 @@ export default {
loading: false,
interpolate: false,
interpolateValue: 50,
override: false,
i18n_: {
elevation_legend: this.$gettext('Elevation (m)'),
distance_legend: this.$gettext('Distance (km)'),
Expand All @@ -90,9 +83,6 @@ export default {
actionDisabled: this.$gettext('Action is disabled. You must confirm simplified geometry first.'),
fromApi: this.$gettext('One or more route could not be processed:'),
interpolateValue: this.$gettext('Interpolate value should be a number > 0'),
overrideElevation: this.$gettext(
'Features already have elevations. Enable "Force elevations" if you want to override them.'
),
tooMuchPoints: this.$gettext(
'One or more line chunks will generate more than 3000 points. Adjust distance to generate less points.'
),
Expand All @@ -109,13 +99,6 @@ export default {
validSimplifyTolerance() {
return Yetix.validSimplifyTolerance;
},
atLeastOneFeatureHas3D() {
let features = this.features.filter((feature) => {
let coords = feature.getGeometry().getCoordinates();
return !coords.some((coord) => coord.length >= 3 && coord[2] !== 0);
});
return features.length === 0;
},
atLeastOneLineChunkHasTooMuchPoints() {
if (this.interpolateValueInvalid) {
return false;
Expand Down Expand Up @@ -185,18 +168,12 @@ export default {
if (this.interpolateValueInvalid) {
return window.alert(this.errors.interpolateValue);
}
if (!this.override && this.atLeastOneFeatureHas3D) {
return window.alert(this.errors.overrideElevation);
}
// start loading
this.loading = true;
// and defer (next cycle)
setTimeout(() => {
if (this.override) {
// when elevation is forced, start by removing all elevations
this.removeAllElevations();
}
// start by removing all elevations
this.removeAllElevations();
// interpolateValue is 5 meters min, or 0 if not checked
let interpolateValue = this.interpolate ? Math.max(MIN_INTERPOLATE_VALUE, this.interpolateValue) : 0;
Expand Down
Loading
Loading