Skip to content

Commit

Permalink
Use a modern lib to draw freehand polygons for import
Browse files Browse the repository at this point in the history
  • Loading branch information
dabreegster committed Mar 17, 2024
1 parent 6e4f0f6 commit c37a31d
Show file tree
Hide file tree
Showing 5 changed files with 197 additions and 155 deletions.
267 changes: 162 additions & 105 deletions viewer/package-lock.json

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

2 changes: 1 addition & 1 deletion viewer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
"vite-plugin-wasm-pack": "0.1.11"
},
"dependencies": {
"@mapbox/mapbox-gl-draw": "^1.4.3",
"chart.js": "^4.4.2",
"chartjs-plugin-dragdata": "^2.2.5",
"maplibre-draw-polygon": "github:dabreegster/maplibre-draw-polygon",
"pmtiles": "^3.0.4",
"svelte-maplibre": "^0.8.1"
}
Expand Down
2 changes: 2 additions & 0 deletions viewer/src/EdgeCostApp.svelte
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<script lang="ts">
import { PolygonToolLayer } from "maplibre-draw-polygon";
import type { FeatureCollection } from "geojson";
import initLts from "lts";
import type {
Expand Down Expand Up @@ -314,6 +315,7 @@
</Popup>
</LineLayer>
</GeoJSON>
<PolygonToolLayer />
</MapLibre>
</div>
</Layout>
Expand Down
2 changes: 2 additions & 0 deletions viewer/src/InteractiveApp.svelte
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<script lang="ts">
import { PolygonToolLayer } from "maplibre-draw-polygon";
import type { FeatureCollection } from "geojson";
import initLts from "lts";
import type { Map as MapType } from "maplibre-gl";
Expand Down Expand Up @@ -157,6 +158,7 @@
<GeoJSON data={gj}>
<Layers {controls} />
</GeoJSON>
<PolygonToolLayer />
</MapLibre>
</div>
</Layout>
Expand Down

0 comments on commit c37a31d

Please sign in to comment.