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

@ -52,7 +52,7 @@ geojson = {
"features": stores,
}
with open("menards-data.geojson", "w") as f:
with open("data.geojson", "w") as f:
f.write(json.dumps(geojson))
print(f"{len(menardses)} locations found")

View file

@ -5,18 +5,18 @@ import GeoJSON from 'ol/format/GeoJSON.js';
import {Style} from 'ol/style.js';
import Icon from 'ol/style/Icon.js';
import menardsURL from '/data/menards-data.geojson?url'; // TODO: remove `?url`?
import pinURL from './pin.svg?url'; // TODO: remove `?url`?
import url from './data.geojson?url'; // TODO: remove `?url`?
import pin from './pin.svg?url'; // TODO: remove `?url`?
const vectorLayer = new VectorLayer({
source: new VectorSource({
url: menardsURL,
url: url,
format: new GeoJSON,
}),
style: new Style({
image: new Icon({
anchor: [0.5, 1],
src: pinURL,
src: pin,
}),
}),
});