Distribute data with layers instead of data/ dir

This was originally done to make the gitignoring easier, but ended up
being somewhat more complex when trying to include files, so they're
moving out closer to the point of use.
This commit is contained in:
Chandler Swift 2023-07-25 19:12:30 -05:00
parent c74edcb8c0
commit 7957523c3c
Signed by: chandlerswift
GPG key ID: A851D929D52FB93F
21 changed files with 49 additions and 51 deletions

View file

@ -93,5 +93,5 @@ geojson = {
"features": arenas,
}
with open("nhl-arenas-data.geojson", "w") as f:
with open("data.geojson", "w") as f:
f.write(json.dumps(geojson))

View file

@ -4,13 +4,13 @@ import GeoJSON from 'ol/format/GeoJSON.js';
import {Style, Stroke, Circle, Fill} from 'ol/style.js';
import arenaURL from '/data/nhl-arenas-data.geojson?url'; // TODO: remove `?url`?
import url from './data.geojson?url'; // TODO: remove `?url`?
import visitedArenas from './visited.js'
const vectorLayer = new VectorLayer({
source: new VectorSource({
url: arenaURL,
url: url,
format: new GeoJSON,
}),
// TODO: use '✓' and '✗' (or maybe '✔' and '✘') (from https://en.wikipedia.org/wiki/List_of_Unicode_characters#Dingbats)