Skip to content

Commit

Permalink
BGDIINF_SB-2981: Only show cesium-compass on desktop
Browse files Browse the repository at this point in the history
  • Loading branch information
fredj committed Jul 11, 2023
1 parent ae7c7ce commit eaa9c0a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/modules/map/components/cesium/CesiumMap.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div id="cesium" ref="map" data-cy="cesium"></div>
<cesium-compass ref="compass"></cesium-compass>
<cesium-compass v-show="isDesktopMode" ref="compass"></cesium-compass>
<slot />
</template>
<script>
Expand All @@ -14,6 +14,7 @@ import {
RequestScheduler,
} from 'cesium'
import { addSwisstopoWMTSLayer } from './utils/imageryLayerUtils'
import { UIModes } from '@/store/modules/ui.store'
import { mapGetters, mapState } from 'vuex'
import { TERRAIN_URL } from './constants'
import { IS_TESTING_WITH_CYPRESS } from '@/config'
Expand All @@ -31,8 +32,12 @@ export default {
rotation: (state) => state.position.rotation,
center: (state) => state.position.center,
is3DActive: (state) => state.ui.showIn3d,
uiMode: (state) => state.ui.mode,
}),
...mapGetters(['centerEpsg4326', 'resolution', 'hasDevSiteWarning']),
isDesktopMode() {
return this.uiMode === UIModes.DESKTOP
},
},
beforeCreate() {
// Global variable required for Cesium and point to the URL where four static directories (see vite.config) are served
Expand Down

0 comments on commit eaa9c0a

Please sign in to comment.