Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
27 changes: 19 additions & 8 deletions examples/iceberg/components/IcebergMap.vue
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
<template>
<div :class="$style['language-chooser']">
<div :class="$style['action-bar']">
<button class="kern-btn kern-btn--secondary" @click="switchLanguage">
<span class="kern-icon kern-icon--flag" />
<span class="kern-label">{{
language === 'de' ? 'Switch to English' : 'Zu Deutsch wechseln'
}}</span>
</button>
<button
class="kern-btn kern-btn--secondary"
@click="splitScreen = !splitScreen"
>
<span class="kern-icon kern-icon--splitscreen-left" />
<span class="kern-label">{{
splitScreen ? 'Exit split screen' : 'Enter split screen'
}}</span>
</button>
</div>
<polar-map
v-if="store.serviceRegister.length"
ref="map"
:class="{ [$style['split-screen']]: splitScreen }"
:map-configuration="store.mapConfiguration"
:service-register="store.serviceRegister"
/>
Expand All @@ -29,6 +39,7 @@ import { useIcebergStore } from '../stores/iceberg'
const store = useIcebergStore()

const language = ref('de')
const splitScreen = ref(false)

const map = useTemplateRef<typeof PolarContainer>('map')
watch(map, (map) => {
Expand Down Expand Up @@ -70,16 +81,16 @@ function switchLanguage() {

<style scoped>
@import url('@polar/polar/polar.css');

polar-map {
display: block;
width: 100%;
height: 20em;
}
</style>

<style module>
.language-chooser {
.action-bar {
display: flex;
gap: 1em;
margin-bottom: 1em;
}

.split-screen {
width: 50%;
}
</style>
12 changes: 4 additions & 8 deletions examples/snowbox/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@
margin: 0.2em 0;
}

/* directly related to POLAR - something like this must be
* available for map client to render in (see core docs for
* more details on requirements) */
#language-switcher {
outline: solid black;
}

.snowbox {
display: block;
width: 100vw;
max-width: calc(100% + 64px);
height: var(--map-height);
Expand All @@ -55,10 +55,6 @@
left: -32px;
outline: solid var(--eigengrau);
}

#language-switcher {
outline: solid black;
}
</style>
</head>

Expand Down
14 changes: 11 additions & 3 deletions src/core/components/PolarContainer.ce.vue
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
resizeObserver.observe(polarWrapper.value as Element)
updateClientDimensions()

// FIXME: Improve types for lightElement

Check warning on line 110 in src/core/components/PolarContainer.ce.vue

View workflow job for this annotation

GitHub Actions / lint

Unexpected 'fixme' comment: 'FIXME: Improve types for lightElement'
// This is necessary for making `getStore` work
;(mainStore.lightElement as { store?: unknown }).store = useCoreStore()
})
Expand All @@ -129,12 +129,20 @@
--brand-color-c: v-bind('mainStore.configuration.theme?.brandColor?.c');
--brand-color-h: v-bind('mainStore.configuration.theme?.brandColor?.h');
}

@layer polar-map {
:host {
display: block;
width: 100%;
height: 30em;
}
}
</style>

<style scoped>
.polar-wrapper {
position: absolute;
height: inherit;
width: inherit;
position: relative;
height: 100%;
width: 100%;
}
</style>
Loading