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:
parent
c74edcb8c0
commit
7957523c3c
21 changed files with 49 additions and 51 deletions
|
|
@ -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))
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue