Compare commits

..

No commits in common. "142f8bbe6adf26a51133a32a97dfb98f9430c426" and "dd90c2670fc45db013cd7ad4b99a84948f12d31b" have entirely different histories.

6 changed files with 2 additions and 74 deletions

View File

@ -19,7 +19,6 @@ import trips from './trips/index.js';
import dot_cams from './dot-cams/index.js';
import survey_markers from './survey-markers/index.js';
import tjx from './tjx/index.js';
import minnesotaAdventureTrails from './minnesota-adventure-trails/index.js';
const layerCategories = [
{ // Base maps
@ -91,7 +90,6 @@ const layerCategories = [
},
]
},
minnesotaAdventureTrails,
survey_markers,
dot_cams,
trips,

View File

@ -1,2 +0,0 @@
*.kmz
routes.js

View File

@ -1,28 +0,0 @@
#!/bin/sh
# SEMAT: https://www.google.com/maps/d/u/0/viewer?mid=1fd5DwCNSTNyd2ijSa3FcKTXfn85wFD8
# NEMAT: https://www.google.com/maps/d/u/0/viewer?mid=19EWOYHcIlO9HX3Xwc6peFxMwdhsEt78
# NCMAT: https://www.google.com/maps/d/u/0/viewer?mid=1qtnoqH2w_E4QT8rDYStKw_S1TWI-cRw
cd $(dirname $0)
for file in *.kmz; do
zcat "$file" | ogr2ogr -f GeoJSON "$(basename "$file" .kmz).geojson" /vsistdin/ -skipfailures
done
# hack hack hack
truncate -s 0 routes.js
i=0
for file in ./*.geojson; do
echo "import _file$i from '$file?url';" >> routes.js
i=$((i+1))
done
echo >> routes.js
echo "export default {" >> routes.js
i=0
for file in ./*.geojson; do
basename=$(basename "$file" .geojson)
echo " \"$basename\": _file$i," >> routes.js
i=$((i+1))
done
echo "};" >> routes.js

View File

@ -1,40 +0,0 @@
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 data from './routes.js';
const trails = {
name: "Minnesota Adventure Trails",
details: `<a href="https://minnesotaadventuretrails.com/">https://minnesotaadventuretrails.com/</a>`,
layers: [],
};
for (let [chain, url] of Object.entries(data)) {
const colors = '0,0,0';
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),
})
});
},
});
trails.layers.push({
name: chain,
layer: vectorLayer,
});
}
trails.layers.sort((a, b) => a.name > b.name ? 1 : -1); // Names are always unique
export default trails;

View File

@ -16,7 +16,7 @@ const visitedStatesLists = {
'IL',
'IN',
'KS',
'KY',
// 'KY',
'LA',
'MA',
'MD',

View File

@ -4,7 +4,7 @@ export default () => {
// https://stackoverflow.com/a/71162041/3814663
const commitDate = childProcess.execSync('git log -1 --format=%cI').toString().trimEnd();
const commitHash = childProcess.execSync('git rev-parse HEAD').toString().trimEnd();
const fileDates = childProcess.execSync(`find . -iname '*.geojson' -not -path './dist/*' -exec ls -lh {} +`).toString().trimEnd();
const fileDates = childProcess.execSync(`find . -iname '*.geojson' -not -path './dist/*' | xargs ls -lh`).toString().trimEnd();
process.env.VITE_GIT_COMMIT_DATE = commitDate;
process.env.VITE_GIT_COMMIT_HASH = commitHash;
process.env.VITE_FILE_DATES = fileDates;