|
1 | 1 | <script lang="ts">
|
2 | 2 | import type { Feature } from "geojson";
|
3 |
| - import { FillLayer, GeoJSON, hoverStateFilter, Popup } from "svelte-maplibre"; |
4 |
| - import { notNull } from "./common"; |
| 3 | + import { FillLayer, GeoJSON, hoverStateFilter } from "svelte-maplibre"; |
| 4 | + import { notNull, Popup } from "./common"; |
5 | 5 | import ManageSavefiles from "./ManageSavefiles.svelte";
|
6 | 6 | import ModalFilterLayer from "./ModalFilterLayer.svelte";
|
7 | 7 | import SplitComponent from "./SplitComponent.svelte";
|
8 | 8 | import { app, mode } from "./stores";
|
9 | 9 |
|
10 | 10 | // Note we do this to trigger a refresh when loading stuff
|
11 |
| - $: gj = JSON.parse(notNull($app).toSavefile()); |
| 11 | + $: gj = JSON.parse($app!.toSavefile()); |
12 | 12 | $: boundaryNames = gj.features
|
13 |
| - .filter((f: Feature) => notNull(f.properties).kind == "boundary") |
14 |
| - .map((f: Feature) => notNull(f.properties).name); |
| 13 | + .filter((f: Feature) => f.properties!.kind == "boundary") |
| 14 | + .map((f: Feature) => f.properties!.name); |
15 | 15 |
|
16 | 16 | function pickNeighbourhood(name: string) {
|
17 | 17 | $app!.setCurrentNeighbourhood(name);
|
|
20 | 20 |
|
21 | 21 | function deleteNeighbourhood(name: string) {
|
22 | 22 | $app!.deleteNeighbourhoodBoundary(name);
|
23 |
| - gj = JSON.parse(notNull($app).toSavefile()); |
| 23 | + gj = JSON.parse($app!.toSavefile()); |
24 | 24 | }
|
25 | 25 |
|
26 | 26 | function newBoundary() {
|
|
90 | 90 | pickNeighbourhood(notNull(e.detail.features[0].properties).name)}
|
91 | 91 | hoverCursor="pointer"
|
92 | 92 | >
|
93 |
| - <Popup openOn="hover" let:data> |
94 |
| - <p>{notNull(data).properties.name}</p> |
| 93 | + <Popup openOn="hover" let:props> |
| 94 | + <p>{props.name}</p> |
95 | 95 | </Popup>
|
96 | 96 | </FillLayer>
|
97 | 97 | <ModalFilterLayer />
|
|
0 commit comments