Add Trahan trip route

This commit is contained in:
Chandler Swift 2023-09-01 22:19:05 -05:00
parent 8017e4d88b
commit bd31c08c16
Signed by: chandlerswift
GPG key ID: A851D929D52FB93F
5 changed files with 91 additions and 0 deletions

View file

@ -0,0 +1,9 @@
#!/bin/sh
FROM="2023-08-24T12:45:00.000Z"
TO="2023-09-01T21:50:00.000Z"
URL="https://whereis.chandlerswift.com/api/0/locations?from=$FROM&to=$TO&format=geojson&user=chandler&device=oneplus6t"
curl --silent "$URL" \
| python "$(dirname $0)/../../../util/process_owntracks_geojson_to_line.py" \
> data.geojson

View file

@ -0,0 +1,26 @@
import VectorLayer from 'ol/layer/Vector';
import {Vector as VectorSource} from 'ol/source.js';
import GeoJSON from 'ol/format/GeoJSON.js';
import {Style, Stroke} from 'ol/style.js';
import url from './data.geojson?url'; // TODO: remove `?url`?
const colors = '135, 0, 226'; // Käthe says lavender
const vectorLayer = new VectorLayer({
source: new VectorSource({
url: url,
format: new GeoJSON,
}),
style: function(feature, resolution){
return new Style({
stroke: new Stroke({
color: `rgba(${colors},${Math.min(1, Math.pow(resolution/10, 1/4))})`,
width: 10/Math.pow(resolution, 1/4),
})
});
},
});
export default vectorLayer;