Skip to content

Commit

Permalink
LocationsLayer: added ui.map.showLocationNames to DefaultUserSettings…
Browse files Browse the repository at this point in the history
….json to switch the location names on and off
  • Loading branch information
MatTolladay authored and wkramer committed Jun 12, 2024
1 parent 62a4a35 commit 95abb3d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/assets/DefaultUserSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@
"value": true,
"group": "Datum"
},
{
"id": "ui.map.showLocationNames",
"type": "boolean",
"label": "Show location names",
"value": true,
"group": "UI"
},
{
"id": "ui.theme",
"type": "oneOfMultiple",
Expand Down
7 changes: 7 additions & 0 deletions src/components/wms/LocationsLayer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
:paint="paintCircleSpecification"
/>
<mgl-symbol-layer
v-if="showNames"
:layer-id="locationsTextLayerId"
:layout="layoutTextSpecification"
:paint="paintTextSpecification"
Expand All @@ -38,6 +39,12 @@ import { watch, onBeforeUnmount, computed } from 'vue'
import { onBeforeMount } from 'vue'
import { addLocationIconsToMap } from '@/lib/location-icons'
import { useDark } from '@vueuse/core'
import { useUserSettingsStore } from '@/stores/userSettings'
const settings = useUserSettingsStore()
const showNames = computed(() => {
return settings.get('ui.map.showLocationNames')?.value
})
interface Props {
locationsGeoJson: FeatureCollection<Geometry, Location>
Expand Down

0 comments on commit 95abb3d

Please sign in to comment.