Skip to content

Commit

Permalink
Speed up that snappable node viewing
Browse files Browse the repository at this point in the history
  • Loading branch information
dabreegster committed Jun 27, 2024
1 parent 1a16c0e commit a453144
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
6 changes: 3 additions & 3 deletions web/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 3 additions & 5 deletions web/src/common/snapper/SnapPolygonControls.svelte
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
<script lang="ts">
import type { FeatureCollection } from "geojson";
import { RouteTool } from "route-snapper-ts";
import { undoLength, showAllNodes, showAllNodesGj } from "./stores";
export let route_tool: RouteTool;
function loadNodes(show: boolean) {
// TODO Different API for just the nodes
let gj: FeatureCollection = JSON.parse(route_tool.inner.debugRenderGraph());
gj.features = gj.features.filter((f) => f.geometry.type == "Point");
$showAllNodesGj = gj;
if (show && $showAllNodesGj.features.length == 0) {
$showAllNodesGj = JSON.parse(route_tool.inner.debugSnappableNodes());
}
}
$: loadNodes($showAllNodes);
</script>
Expand Down

0 comments on commit a453144

Please sign in to comment.