Skip to content

Commit

Permalink
Reorder some browse layers
Browse files Browse the repository at this point in the history
  • Loading branch information
dabreegster committed Oct 24, 2024
1 parent 80f35a6 commit 4c62b08
Show file tree
Hide file tree
Showing 2 changed files with 98 additions and 92 deletions.
38 changes: 26 additions & 12 deletions src/lib/browse/LayerControls.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,15 @@
</script>

<div bind:this={$controls}>
<SchemesLayer />
<CollapsibleCard label="Trip generators">
<CheckboxGroup small>
<EducationLayerControl />
<HospitalsLayerControl />
<SportsSpacesLayerControl />
<RailwayStationsLayerControl />
</CheckboxGroup>
<CollapsibleCard label="Schemes" open>
<SchemesLayer />
{#if appVersion() == "Private (development)"}
<CheckboxGroup small>
<ProblemsLayerControl />
</CheckboxGroup>
{/if}
</CollapsibleCard>

<CollapsibleCard label="Existing infrastructure">
<CheckboxGroup small>
<CyclePathsLayerControl />
Expand All @@ -92,13 +92,24 @@
<CrossingsLayerControl />
</CheckboxGroup>
</CollapsibleCard>

<CollapsibleCard label="Trip generators">
<CheckboxGroup small>
<EducationLayerControl />
<HospitalsLayerControl />
<SportsSpacesLayerControl />
</CheckboxGroup>
</CollapsibleCard>

<CollapsibleCard label="Public transport">
<CheckboxGroup small>
<BusRoutesLayerControl />
<TramsLayerControl />
<BusStopsLayerControl />
<TramsLayerControl />
<RailwayStationsLayerControl />
</CheckboxGroup>
</CollapsibleCard>

<CollapsibleCard label="Boundaries">
<CheckboxGroup small>
<ParliamentaryConstituenciesLayerControl />
Expand All @@ -108,32 +119,35 @@
<LocalPlanningAuthoritiesLayerControl />
</CheckboxGroup>
</CollapsibleCard>

<CollapsibleCard label="Census">
<CheckboxGroup small>
<CensusOutputAreaLayerControl />
<ImdLayerControl />
</CheckboxGroup>
</CollapsibleCard>
<CollapsibleCard label="Other">

<CollapsibleCard label="ATE Assessment">
<CheckboxGroup small>
<PctLayerControl />
<VehicleCountsLayerControl />
<Stats19LayerControl />
<PctLayerControl />
<GradientsLayerControl />
{#if appVersion() == "Private (development)"}
<RoadWidthsLayerControl />
<PavementWidthsLayerControl />
<RoadSpeedsLayerControl />
<ProblemsLayerControl />
{/if}
<PollutionLayerControl />
<RoadNoiseLayerControl />
</CheckboxGroup>
</CollapsibleCard>

<CollapsibleCard label="Tools">
<StreetViewTool {cfg} map={$map} bind:enabled={streetviewEnabled} />
<LineMeasureTool />
</CollapsibleCard>

<BaselayerSwitcher disabled={!$interactiveMapLayersEnabled} />
</div>

Expand Down
152 changes: 72 additions & 80 deletions src/lib/browse/schemes/SchemesLayer.svelte
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
<script lang="ts">
import {
CollapsibleCard,
ErrorMessage,
FileInput,
Select,
CheckboxGroup,
} from "govuk-svelte";
import { ErrorMessage, FileInput, Select, CheckboxGroup } from "govuk-svelte";
import { appVersion, Legend, WarningIcon } from "lib/common";
import LoadRemoteSchemeData from "./LoadRemoteSchemeData.svelte";
import { setupSchemes } from "./data";
Expand Down Expand Up @@ -83,86 +77,84 @@
}
</script>

<CollapsibleCard label="Schemes" open>
{#if appVersion() == "Private (development)"}
<LoadRemoteSchemeData {loadFile} />
{/if}
{#if appVersion() == "Private (development)"}
<LoadRemoteSchemeData {loadFile} />
{/if}

<CheckboxGroup small>
{#if $atfSchemes.size > 0}
<LayerControl name={atfName} title={atfTitle} bind:show={$atfShow}>
<span slot="help">
<p>
<WarningIcon text="Scheme data caveats" />Please note there are data
quality caveats for all scheme data:
</p>
<ul>
{#each $atfSchemesGj.notes ?? [] as note}
<li><p>{note}</p></li>
{/each}
</ul>
</span>
<CheckboxGroup small>
{#if $atfSchemes.size > 0}
<LayerControl name={atfName} title={atfTitle} bind:show={$atfShow}>
<span slot="help">
<p>
<WarningIcon text="Scheme data caveats" />Please note there are data
quality caveats for all scheme data:
</p>
<ul>
{#each $atfSchemesGj.notes ?? [] as note}
<li><p>{note}</p></li>
{/each}
</ul>
</span>

<div slot="controls" style="border: 1px solid black; padding: 8px;">
<Filters
source="ATF"
bind:schemesGj={$atfSchemesGj}
bind:schemes={$atfSchemes}
bind:filterSchemeText={$filterAtfSchemeText}
bind:filterInterventionText={$filterAtfInterventionText}
/>
<div slot="controls" style="border: 1px solid black; padding: 8px;">
<Filters
source="ATF"
bind:schemesGj={$atfSchemesGj}
bind:schemes={$atfSchemes}
bind:filterSchemeText={$filterAtfSchemeText}
bind:filterInterventionText={$filterAtfInterventionText}
/>

<Select
label="Colour interventions"
choices={[
["fundingProgramme", "By funding programme"],
["interventionType", "By intervention type"],
["currentMilestone", "By current milestone"],
]}
bind:value={atfStyle}
/>
<Legend rows={atfLegend} />
</div>
</LayerControl>
{/if}
<Select
label="Colour interventions"
choices={[
["fundingProgramme", "By funding programme"],
["interventionType", "By intervention type"],
["currentMilestone", "By current milestone"],
]}
bind:value={atfStyle}
/>
<Legend rows={atfLegend} />
</div>
</LayerControl>
{/if}

{#if $lcwipSchemes.size > 0}
<LayerControl name={lcwipName} title={lcwipTitle} bind:show={$lcwipShow}>
<span slot="help">
<p>
<WarningIcon text="Scheme data caveats" />Please note there are data
quality caveats for all scheme data:
</p>
<ul>
{#each $lcwipSchemesGj.notes ?? [] as note}
<li><p>{note}</p></li>
{/each}
</ul>
</span>
{#if $lcwipSchemes.size > 0}
<LayerControl name={lcwipName} title={lcwipTitle} bind:show={$lcwipShow}>
<span slot="help">
<p>
<WarningIcon text="Scheme data caveats" />Please note there are data
quality caveats for all scheme data:
</p>
<ul>
{#each $lcwipSchemesGj.notes ?? [] as note}
<li><p>{note}</p></li>
{/each}
</ul>
</span>

<div slot="controls" style="border: 1px solid black; padding: 8px;">
<Filters
source="LCWIP"
bind:schemesGj={$lcwipSchemesGj}
bind:schemes={$lcwipSchemes}
bind:filterSchemeText={$filterLcwipSchemeText}
bind:filterInterventionText={$filterLcwipInterventionText}
/>
<div slot="controls" style="border: 1px solid black; padding: 8px;">
<Filters
source="LCWIP"
bind:schemesGj={$lcwipSchemesGj}
bind:schemes={$lcwipSchemes}
bind:filterSchemeText={$filterLcwipSchemeText}
bind:filterInterventionText={$filterLcwipInterventionText}
/>

<Select
label="Colour interventions"
choices={[["interventionType", "By intervention type"]]}
bind:value={lcwipStyle}
/>
<Legend rows={lcwipLegend} />
</div>
</LayerControl>
{/if}
</CheckboxGroup>
<Select
label="Colour interventions"
choices={[["interventionType", "By intervention type"]]}
bind:value={lcwipStyle}
/>
<Legend rows={lcwipLegend} />
</div>
</LayerControl>
{/if}
</CheckboxGroup>

<FileInput label="Load schemes from GeoJSON" onLoad={loadFile} />
<ErrorMessage {errorMessage} />
</CollapsibleCard>
<FileInput label="Load schemes from GeoJSON" onLoad={loadFile} />
<ErrorMessage {errorMessage} />

<InterventionLayer
source="atf"
Expand Down

0 comments on commit 4c62b08

Please sign in to comment.