Skip to content

Commit

Permalink
feat: improve controls visibility when sidebar is open
Browse files Browse the repository at this point in the history
  • Loading branch information
amoncaldas committed Aug 4, 2021
1 parent 1550460 commit af4dfbd
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
14 changes: 10 additions & 4 deletions src/fragments/map-view/MapView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@
:id="constants.mapViewElementId"
ref="map"
class="map-view"
:class="{'low-resolution': $lowResolution, 'extra-low-resolution': $xlResolution, 'click-to-pick': clickToPickActive, 'hide-controls': !showControls}"
:class="{
'low-resolution': $lowResolution,
'extra-low-resolution': $xlResolution,
'embedded': $store.getters.embed,
'click-to-pick': clickToPickActive,
'hide-controls': !showControls
}"
@click.right="mapRightClick"
@zoomend="zoomed"
@baselayerchange="baseLayerChanged"
Expand Down Expand Up @@ -139,15 +145,15 @@
<extra-info-highlight v-if="extraInfo" @closed="extraInfo = null" @beforeOpen="isAltitudeModalOpen = false" :extra-info="extraInfo" :polyline-data="activeRouteData.geometry.coordinates"/>

<l-height-graph v-if="isAltitudeModalOpen" @closed="closeAltitudeInfo" lg8 sm11 :data="localMapViewDataRawData" :options="lHeightGraphOptions"/>
<my-location v-if="supportsMyLocationBtn && !isAltitudeModalOpen" class="my-location-btn" :active="myLocationActive" @updateLocation="updateMyLocation"></my-location>
<img class="over-brand" v-if="showBrand" src="@/assets/img/heigit-and-hd-uni.png" :alt="$t('global.brand')" :title="$t('global.brand')">
<my-location v-if="showMyLocationControl" class="my-location-btn" :active="myLocationActive" @updateLocation="updateMyLocation"></my-location>
<img class="over-brand" v-if="showBrand && showControls" src="@/assets/img/heigit-and-hd-uni.png" :alt="$t('global.brand')" :title="$t('global.brand')">

<!-- the container below might be used to to programmatically add controls/components -->
<div ref="customMapControlsContainer" style="z-index: 501" class="custom-controls" ></div>
</l-map>
<v-btn v-if="$store.getters.embed" small :title="$t('mapView.viewOnORS')" class="view-on-ors" target="_blank" :href="nonEmbedUrl" > {{$t('mapView.viewOnORS')}} <v-icon right small >open_in_new</v-icon> </v-btn>
<map-right-click v-if="!$store.getters.embed" :map-view-data="mapViewData" @closed="clickLatlng = null" @rightClickEvent="handleRightClickEvent"></map-right-click>
<map-left-click :current-zoom="zoom" @closed="clickLatlng = null" @directionsToPoint="directionsToPoint"></map-left-click>
<map-left-click :style="{display:showControls ? '' : 'none'}" :current-zoom="zoom" @closed="clickLatlng = null" @directionsToPoint="directionsToPoint"></map-left-click>

<div v-if="$store.getters.mapSettings.accessibleModeActive">
<v-btn fab small @click="moveMapCenter('left')" :title="$t('mapView.moveMapPositionToLeft')" class="move-map-arrow left do-not-trigger-close-bottom-nav" > <v-icon large color="primary" >arrow_back</v-icon> </v-btn>
Expand Down
6 changes: 5 additions & 1 deletion src/fragments/map-view/map-view-leaflet.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@
margin-top: 70px;
}

.map-view.extra-low-resolution >>> .leaflet-top.leaflet-right {
.map-view.extra-low-resolution:not(.embedded) >>> .leaflet-top.leaflet-right {
margin-top: 70px;
}

.map-view.hide-controls >>> .leaflet-top.leaflet-right {
display: none;
}

.map-view.extra-low-resolution.hide-controls >>> .leaflet-control-attribution {
display: none;
}
Expand Down
4 changes: 4 additions & 0 deletions src/fragments/map-view/map-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,10 @@ export default {
}
},
computed: {

showMyLocationControl () {
return this.supportsMyLocationBtn && !this.isAltitudeModalOpen && this.showControls
},
/**
* Determines if the my location btn is available
* @returns {Boolean}
Expand Down

0 comments on commit af4dfbd

Please sign in to comment.