|
7 | 7 | } from "geojson";
|
8 | 8 | import type { MapMouseEvent } from "maplibre-gl";
|
9 | 9 | import { onDestroy } from "svelte";
|
10 |
| - import { GeoJSON, SymbolLayer, type LayerClickInfo } from "svelte-maplibre"; |
11 |
| - import { layerId, notNull, Popup } from "../common"; |
| 10 | + import { type LayerClickInfo } from "svelte-maplibre"; |
| 11 | + import { notNull, Popup } from "../common"; |
12 | 12 | import ManageSavefiles from "../ManageSavefiles.svelte";
|
13 | 13 | import RenderNeighbourhood from "../RenderNeighbourhood.svelte";
|
14 | 14 | import SplitComponent from "../SplitComponent.svelte";
|
15 | 15 | import { app, map, mode, mutationCounter } from "../stores";
|
16 | 16 | import ChangeModalFilter from "./ChangeModalFilter.svelte";
|
17 | 17 | import FreehandLine from "./FreehandLine.svelte";
|
| 18 | + import ModalFilterLayer from "../ModalFilterLayer.svelte"; |
18 | 19 |
|
19 | 20 | // Caller is responsible for doing app.setCurrentNeighbourhood
|
20 | 21 |
|
|
27 | 28 | let boundary: Feature<Polygon> | null;
|
28 | 29 |
|
29 | 30 | let gjInput: FeatureCollection;
|
30 |
| - let modalFilterGj: FeatureCollection; |
31 | 31 | $: rerender($mutationCounter);
|
32 | 32 |
|
33 | 33 | function rerender(_x: number) {
|
|
40 | 40 | undoLength = gjInput.undo_length;
|
41 | 41 | // @ts-ignore These foreign members exist
|
42 | 42 | redoLength = gjInput.redo_length;
|
43 |
| -
|
44 |
| - modalFilterGj = JSON.parse($app!.renderModalFilters()); |
45 | 43 | }
|
46 | 44 |
|
47 | 45 | $: if (addingFilter) {
|
|
218 | 216 | </Popup>
|
219 | 217 | </div>
|
220 | 218 | </RenderNeighbourhood>
|
221 |
| - <GeoJSON data={modalFilterGj} generateId> |
222 |
| - <SymbolLayer |
223 |
| - {...layerId("modal-filters")} |
224 |
| - layout={{ |
225 |
| - "icon-image": ["get", "filter_kind"], |
226 |
| - "icon-allow-overlap": true, |
227 |
| - "icon-size": 0.1, |
228 |
| - }} |
229 |
| - on:click={deleteFilter} |
230 |
| - > |
231 |
| - <Popup openOn="hover">Click to delete</Popup> |
232 |
| - </SymbolLayer> |
233 |
| - </GeoJSON> |
| 219 | + <ModalFilterLayer on:click={deleteFilter}> |
| 220 | + <Popup openOn="hover">Click to delete</Popup> |
| 221 | + </ModalFilterLayer> |
234 | 222 | {#if addingMultipleFilters}
|
235 | 223 | <FreehandLine map={notNull($map)} on:done={gotFreehandLine} />
|
236 | 224 | {/if}
|
|
0 commit comments