-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace with a new private hosted layer of criticals and policy confl…
…icts
- Loading branch information
1 parent
092edf8
commit f3511b1
Showing
3 changed files
with
119 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
<script lang="ts"> | ||
import { | ||
HelpButton, | ||
Popup, | ||
privateResourceBaseUrl, | ||
Legend, | ||
} from "lib/common"; | ||
import { Checkbox } from "govuk-svelte"; | ||
import { layerId, constructMatchExpression } from "lib/maplibre"; | ||
import { CircleLayer, GeoJSON } from "svelte-maplibre"; | ||
import { showHideLayer } from "../url"; | ||
let name = "problems"; | ||
let show = showHideLayer(name); | ||
// Display full details in a certain order | ||
let keys = [ | ||
"Issue ID", | ||
"Proposed ID", | ||
"Scheme ID", | ||
"Date Logged", | ||
"Inspector", | ||
"Street Location", | ||
"Code", | ||
"Issue Description", | ||
"External Inspectorate Comment for LA", | ||
"Issue Stage", | ||
"Resolved by Design", | ||
"Design Review Status", | ||
"Date of Resolution", | ||
"Design Resolution", | ||
]; | ||
let legend: [string, string][] = [ | ||
["Outstanding", "red"], | ||
["Pending", "yellow"], | ||
["Resolved", "green"], | ||
["Not Applicable", "grey"], | ||
["No Resolution Planned", "black"], | ||
]; | ||
</script> | ||
|
||
<Checkbox bind:checked={$show}> | ||
Problems | ||
<span slot="right"> | ||
<HelpButton> | ||
<p> | ||
Critical issues and policy conflicts from the DA Log. This is internally | ||
collected data. | ||
</p> | ||
<p>This layer is manually copied from a copy of the DA Log. The data is recent as of 10 June 2024.</p> | ||
</HelpButton> | ||
</span> | ||
</Checkbox> | ||
{#if show} | ||
<Legend rows={legend} /> | ||
{/if} | ||
|
||
<GeoJSON data={`${privateResourceBaseUrl()}/v1/problems.geojson.gz`}> | ||
<CircleLayer | ||
{...layerId(name)} | ||
paint={{ | ||
"circle-color": constructMatchExpression( | ||
["get", "Design Review Status"], | ||
Object.fromEntries(legend), | ||
"cyan", | ||
), | ||
"circle-opacity": 0.9, | ||
"circle-radius": [ | ||
"interpolate", | ||
["linear"], | ||
["zoom"], | ||
1, | ||
2, | ||
8, | ||
3, | ||
13, | ||
15, | ||
], | ||
"circle-stroke-color": "black", | ||
"circle-stroke-width": 0.1, | ||
}} | ||
layout={{ | ||
visibility: $show ? "visible" : "none", | ||
}} | ||
hoverCursor="pointer" | ||
eventsIfTopMost | ||
> | ||
<Popup openOn="hover" let:props> | ||
<h2>{props["Issue ID"]} - {props["Code"]}</h2> | ||
<p>{props["Issue Stage"]}</p> | ||
</Popup> | ||
|
||
<Popup openOn="click" popupClass="border-popup" let:props> | ||
<div style="max-width: 30vw; max-height: 60vh; overflow: auto;"> | ||
{#each keys as key} | ||
<p> | ||
{key}: | ||
<b>{props[key]}</b> | ||
</p> | ||
{/each} | ||
</div> | ||
</Popup> | ||
</CircleLayer> | ||
</GeoJSON> | ||
|
||
<style> | ||
:global(.border-popup .maplibregl-popup-content) { | ||
border: 1px solid black; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters