-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
synchronize postrender for streetview tests
- Loading branch information
Showing
5 changed files
with
68 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,54 @@ | ||
<script setup lang="ts"> | ||
import { ref, Ref } from 'vue' | ||
import { watch, ref, Ref } from 'vue' | ||
import { useTranslation } from 'i18next-vue' | ||
import { storeToRefs } from 'pinia' | ||
import { useInfoStore } from '@/stores/info.store' | ||
import useMap from '@/composables/map/map.composable' | ||
import useStreetView from '@/composables/map/street-view.composable' | ||
const { t } = useTranslation() | ||
const { isStreetviewActive, noDataAtLocation } = storeToRefs(useInfoStore()) | ||
const { isStreetviewActive, streetViewLoading, noDataAtLocation } = storeToRefs( | ||
useInfoStore() | ||
) | ||
const streetviewDiv: Ref<HTMLElement | null> = ref(null) | ||
// launch streetView listeners | ||
useStreetView(streetviewDiv) | ||
const map = useMap().getOlMap() | ||
watch(streetViewLoading, streetViewLoading => { | ||
if (streetViewLoading) { | ||
map.getViewport().style.cursor = 'wait' | ||
} else { | ||
map.getViewport().style.cursor = '' | ||
} | ||
}) | ||
</script> | ||
|
||
<template> | ||
<div | ||
class="grid before:content-streetview before:col-start-1 before:row-start-1" | ||
v-show="isStreetviewActive && noDataAtLocation" | ||
data-cy="streetviewNoData" | ||
> | ||
<span class="col-start-1 row-start-1 text-white py-[15px]"> | ||
{{ t("Il n'y a pas de panorama google disponible à cet endroit") }} | ||
</span> | ||
</div> | ||
<div | ||
ref="streetviewDiv" | ||
class="h-[500px]" | ||
v-show="isStreetviewActive && !noDataAtLocation" | ||
> | ||
Streetview Container | ||
<div class="grid"> | ||
<div | ||
class="grid col-start-1 row-start-1 before:content-streetview before:col-start-1 before:row-start-1" | ||
v-show="isStreetviewActive && noDataAtLocation" | ||
data-cy="streetviewNoData" | ||
> | ||
<span class="col-start-1 row-start-1 text-white py-[15px]"> | ||
{{ t("Il n'y a pas de panorama google disponible à cet endroit") }} | ||
</span> | ||
</div> | ||
<div | ||
data-cy="streetviewLoading" | ||
v-show="streetViewLoading" | ||
class="col-start-1 row-start-1 lux-loader" | ||
></div> | ||
<div | ||
ref="streetviewDiv" | ||
class="h-[500px] col-start-1 row-start-1" | ||
v-show="isStreetviewActive && !noDataAtLocation" | ||
> | ||
Streetview Container | ||
</div> | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters