Customisable map aria label

This commit is contained in:
James Lyne 2021-05-26 21:13:54 +01:00
parent cc5b1afb3e
commit 9813054264
5 changed files with 10 additions and 2 deletions

View File

@ -109,6 +109,7 @@
contextMenuCopyLink: 'Copy link to here', contextMenuCopyLink: 'Copy link to here',
contextMenuCenterHere: 'Center here', contextMenuCenterHere: 'Center here',
toggleTitle: 'Click to toggle this section', toggleTitle: 'Click to toggle this section',
mapTitle: 'Map - Use the arrow keys to pan the map'
} }
}; };
</script> </script>

View File

@ -96,6 +96,7 @@ function buildMessagesConfig(response: any): LiveAtlasMessageConfig {
contextMenuCopyLink: liveAtlasMessages.contextMenuCopyLink || '', contextMenuCopyLink: liveAtlasMessages.contextMenuCopyLink || '',
contextMenuCenterHere: liveAtlasMessages.contextMenuCenterHere || '', contextMenuCenterHere: liveAtlasMessages.contextMenuCenterHere || '',
toggleTitle: liveAtlasMessages.toggleTitle || '', toggleTitle: liveAtlasMessages.toggleTitle || '',
mapTitle: liveAtlasMessages.mapTitle || '',
} }
} }

View File

@ -15,7 +15,7 @@
--> -->
<template> <template>
<div class="map" :style="{backgroundColor: mapBackground }" v-bind="$attrs" aria-label="Map"> <div class="map" :style="{backgroundColor: mapBackground }" v-bind="$attrs" :aria-label="mapTitle">
<MapLayer v-for="[name, map] in maps" :key="name" :map="map" :name="name" :leaflet="leaflet"></MapLayer> <MapLayer v-for="[name, map] in maps" :key="name" :map="map" :name="name" :leaflet="leaflet"></MapLayer>
<PlayersLayer v-if="playerMarkersEnabled" :leaflet="leaflet"></PlayersLayer> <PlayersLayer v-if="playerMarkersEnabled" :leaflet="leaflet"></PlayersLayer>
<MarkerSetLayer v-for="[name, markerSet] in markerSets" :key="name" :markerSet="markerSet" :leaflet="leaflet"></MarkerSetLayer> <MarkerSetLayer v-for="[name, markerSet] in markerSets" :key="name" :markerSet="markerSet" :leaflet="leaflet"></MarkerSetLayer>
@ -86,7 +86,9 @@ export default defineComponent({
//Location and zoom to pan to upon next projection change //Location and zoom to pan to upon next projection change
scheduledPan = ref<Coordinate|null>(null), scheduledPan = ref<Coordinate|null>(null),
scheduledZoom = ref<number|null>(null); scheduledZoom = ref<number|null>(null),
mapTitle = computed(() => store.state.messages.mapTitle);
return { return {
leaflet, leaflet,
@ -111,6 +113,8 @@ export default defineComponent({
scheduledPan, scheduledPan,
scheduledZoom, scheduledZoom,
mapTitle
} }
}, },

1
src/index.d.ts vendored
View File

@ -64,6 +64,7 @@ interface LiveAtlasMessageConfig {
contextMenuCopyLink: string; contextMenuCopyLink: string;
contextMenuCenterHere: string; contextMenuCenterHere: string;
toggleTitle: string; toggleTitle: string;
mapTitle: string;
} }
export type LiveAtlasUIElement = 'chat' | 'players' | 'maps' | 'settings'; export type LiveAtlasUIElement = 'chat' | 'players' | 'maps' | 'settings';

View File

@ -131,6 +131,7 @@ export const state: State = {
contextMenuCopyLink: '', contextMenuCopyLink: '',
contextMenuCenterHere: '', contextMenuCenterHere: '',
toggleTitle: '', toggleTitle: '',
mapTitle: '',
}, },
loggedIn: false, loggedIn: false,