Skip to content
Open
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
12 changes: 11 additions & 1 deletion components/cal/legend.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@
</div>
</div>

<!-- Administrative Boundaries -->
<div v-if="props.showAdminBoundaries && !props.hasData" class="cal-map-legend-section">
<div>
<div class="legend-item legend-marker-square" style="border:solid red 2px; background: transparent;" />
<div>Administrative Boundaries</div>
</div>
</div>

<!-- Geometry Style -->
<div v-if="props.hasData && (['Route', 'Stop'].includes(props.dataDisplayMode))" class="cal-map-legend-section">
<div>
Expand Down Expand Up @@ -79,7 +87,7 @@
</div>
</div>

<div v-if="!props.hasData && !props.displayEditBboxMode">
<div v-if="!props.hasData && !props.displayEditBboxMode && props.hasScenarioData">
<p class="legend-loading">
<o-loading
:active="true"
Expand All @@ -100,6 +108,8 @@ const props = defineProps<{
hasData: boolean
displayEditBboxMode?: boolean
hideUnmarked?: boolean
hasScenarioData: boolean
showAdminBoundaries?: boolean
}>()
</script>

Expand Down
12 changes: 12 additions & 0 deletions components/cal/map.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
:has-data="hasData"
:display-edit-bbox-mode="displayEditBboxMode"
:hide-unmarked="hideUnmarked"
:has-scenario-data="hasScenarioData"
:show-admin-boundaries="showAdminBoundaries"
/>

<cal-map-viewer-ts
Expand Down Expand Up @@ -542,6 +544,16 @@ const hasData = computed((): boolean => {
return !!(props.scenarioFilterResult?.stops.length || props.scenarioFilterResult?.routes.length)
})

// Is there scenario data loaded (regardless of whether it has stops/routes)?
const hasScenarioData = computed((): boolean => {
return !!props.scenarioFilterResult
})

// Are administrative boundaries selected?
const showAdminBoundaries = computed((): boolean => {
return props.censusGeographiesSelected && props.censusGeographiesSelected.length > 0
})

/////////////////
// Map events

Expand Down