Skip to content

Commit

Permalink
require node 14+.
Browse files Browse the repository at this point in the history
let's use node from docker.

using dotenv for secrets.

routing now uses mapbox routing api.

using fetch for fetching.
  • Loading branch information
arichnad committed Mar 13, 2024
1 parent 16a92f1 commit d680b7e
Show file tree
Hide file tree
Showing 14 changed files with 493 additions and 1,730 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
/build/
/node_modules/
/node/
.env
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
engine-strict=true
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@

## first time setup

* you need to set environment variable `CYCLEMAPS_MAPBOX_PUBLIC_ACCESS_TOKEN`
* `echo "CYCLEMAPS_MAPBOX_PUBLIC_ACCESS_TOKEN=$CYCLEMAPS_MAPBOX_PUBLIC_ACCESS_TOKEN" >.env`
* `./update.sh`
* `npm install`
* `docker run --user=$(id --user):$(id --group) --rm --volume=.:/home --workdir=/home -it node:18 npm install`
* `./build.sh`

## non server-side layers
Expand Down
2 changes: 1 addition & 1 deletion build-production.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
set -e #exit on failure

#first time: npm install
npm run build-production
docker run --user=$(id --user):$(id --group) --rm --volume=.:/home --workdir=/home -it node:18 npm run build-production

4 changes: 1 addition & 3 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

set -e #exit on failure

rm -rf dist/assets

#first time: npm install
npm run build
docker run --user=$(id --user):$(id --group) --rm --volume=.:/home --workdir=/home -it node:18 npm run build

2 changes: 1 addition & 1 deletion buttons.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"class": "layer",
"name": "sat",
"type": "raster",
"source": {"type": "raster", "tiles": ["https://api.mapbox.com/styles/v1/mapbox/satellite-v9/tiles/{z}/{x}/{y}?access_token=pk.eyJ1IjoiY3ljbGVtYXB1cyIsImEiOiJjanNhbHRlaGMwMGp2NDNqeG80Mzk2cmExIn0.0OBPtvf3KANeaA6QOCk1yw"]},
"source": {"type": "raster", "tiles": ["https://api.mapbox.com/styles/v1/mapbox/satellite-v9/tiles/{z}/{x}/{y}?access_token={CYCLEMAPS_MAPBOX_PUBLIC_ACCESS_TOKEN}"]},
"beforeId": "satellite-anchor"
},
{ "id": "weather", "class": "directory", "source": [
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions dist/cyclemaps.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>cyclemaps</title>
<link rel="stylesheet" type="text/css" href="dist/assets/cyclemaps-A78e9tiA.css" />
<link rel="stylesheet" type="text/css" href="dist/cyclemaps.css" />
<script type="module" src="dist/cyclemaps.js"></script>

<link rel="icon" href="sprite/bikeicon.png">
Expand Down
Loading

0 comments on commit d680b7e

Please sign in to comment.