52 lines
923 B
Vue
52 lines
923 B
Vue
<template>
|
|
<main>
|
|
<div id="map-container">
|
|
<Map map-key="main" @loaded="loaded" />
|
|
<Transition>
|
|
<div id="map-loading" v-if="!mapReady">Loading</div>
|
|
</Transition>
|
|
</div>
|
|
<slot />
|
|
</main>
|
|
</template>
|
|
|
|
<style scoped lang="css">
|
|
main {
|
|
display: grid;
|
|
grid-template-columns: 400px 1fr;
|
|
grid-template-areas: "sidebar map";
|
|
height: 100%;
|
|
}
|
|
#map-container {
|
|
position: relative;
|
|
height: 100%;
|
|
}
|
|
|
|
#map-loading {
|
|
height: 100%;
|
|
width: 100%;
|
|
position: absolute;
|
|
top: 0;
|
|
background: white;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
}
|
|
.v-enter-active,
|
|
.v-leave-active {
|
|
transition: opacity 0.5s ease;
|
|
}
|
|
|
|
.v-enter-from,
|
|
.v-leave-to {
|
|
opacity: 0;
|
|
}
|
|
</style>
|
|
|
|
<script setup lang="ts">
|
|
const mapReady = ref(false);
|
|
function loaded() {
|
|
mapReady.value = true;
|
|
}
|
|
</script>
|