Skip to content

Commit

Permalink
Let styles still be undefined in case there is no layerName
Browse files Browse the repository at this point in the history
  • Loading branch information
hvangeffen authored and wkramer committed Apr 30, 2024
1 parent 820d558 commit adf4ea0
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/components/spatialdisplay/SpatialDisplayComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ const isLoading = ref(false)
let debouncedSetLayerOptions!: () => void
const legendLayerName = ref(props.layerName)
const legendLayerStyles = ref<Style[]>([])
const legendLayerStyles = ref<Style[]>()
const settings = useUserSettingsStore()
const baseUrl = configManager.get('VITE_FEWS_WEBSERVICES_URL')
Expand Down Expand Up @@ -327,11 +327,15 @@ watch(
new Date(layer?.keywordList[0].forecastTime as string) ?? null
}
legendLayerName.value = props.layerName
legendLayerStyles.value = props.layerCapabilities?.styles ?? [
{
title: props.layerName,
},
]
legendLayerStyles.value = props.layerCapabilities?.styles
if (legendLayerStyles.value === undefined && props.layerName) {
legendLayerStyles.value = [
{
title: props.layerName,
},
]
}
if (layer?.elevation) {
const max = layer.elevation.upperValue ?? 0
const min = layer.elevation.lowerValue ?? 0
Expand Down

0 comments on commit adf4ea0

Please sign in to comment.