Skip to content

Commit fe2ba32

Browse files
committed
maprva ultra!
1 parent b947688 commit fe2ba32

4 files changed

Lines changed: 152 additions & 170 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Deploy to Github Pages
2+
on:
3+
push:
4+
branches: ["main"]
5+
# Allows you to run this workflow manually from the Actions tab
6+
workflow_dispatch:
7+
8+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
9+
permissions:
10+
contents: read
11+
pages: write
12+
id-token: write
13+
14+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
15+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
16+
concurrency:
17+
group: "pages"
18+
cancel-in-progress: false
19+
20+
jobs:
21+
deploy:
22+
environment:
23+
name: github-pages
24+
url: ${{ steps.deployment.outputs.page_url }}
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@v4
29+
- uses: actions/setup-node@v4
30+
with:
31+
node-version: 22
32+
- name: Install mkdocs
33+
run: apt install -y mkdocs-material
34+
- name: Install build deps
35+
run: npm i
36+
- name: Build
37+
run: |
38+
npm run build
39+
npm run --prefix node_modules/@trailstash/ultra build:examples-docs
40+
npm run --prefix node_modules/@trailstash/ultra build:maplibre-examples-docs
41+
npm run --prefix node_modules/@trailstash/ultra build:docs
42+
cp -r node_modules/@trailstash/ultra/dist/docs dist/.
43+
- name: Upload artifact
44+
uses: actions/upload-pages-artifact@v3
45+
with:
46+
path: dist
47+
- name: Deploy to GitHub Pages
48+
id: deployment
49+
uses: actions/deploy-pages@v4

.gitlab-ci.yml

Lines changed: 0 additions & 16 deletions
This file was deleted.

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
# Overpass Ultra config
1+
# MapRVA Ultra config
22

3-
This repo contains the [Ultra](https://gitlab.com/trailstash/ultra) & GitLab Pages
4-
[config](./config.js) for [ohm.overpass-ultra.us](https://ohm.overpass-ultra.us)
3+
This repo contains custom [config](./config.js) for [Ultra](https://gitlab.com/trailstash/ultra).
4+
5+
It customizes Ultra to:
6+
7+
* Use MapRVA's Virginia-only Overpass Server: `overpass.maprva.org`
8+
* Use styles from MapRVA's style server: `styles.maprva.org`

config.mjs

Lines changed: 96 additions & 151 deletions
Original file line numberDiff line numberDiff line change
@@ -1,177 +1,122 @@
1+
import AutoProvider from "@trailstash/ultra/lib/queryProviders/auto.js";
12
import overpass from "@trailstash/ultra/lib/queryProviders/overpass.js";
2-
import sparql from "@trailstash/ultra/lib/queryProviders/sparql.js";
3+
import { all } from "@trailstash/ultra/lib/queryProviders/index.js";
34

4-
const mapStyle = "https://www.openhistoricalmap.org/map-styles/main/main.json";
5+
const mapStyle = "https://styles.maprva.org/openmaptiles-osm.json";
56
const query = `/*
67
This is an example Overpass query.
78
Try it out by pressing the Run button above!
89
*/
9-
nwr["amenity"="theatre"]["start_date"](if:
10-
t["start_date"] < "1976" &&
11-
(!is_tag("end_date") || t["end_date"] >= "1975"));
12-
13-
out geom;
14-
`;
15-
16-
const popupTemplate = `
17-
<h2>
18-
{{ type }}
19-
<a href="https://openhistoricalmap.org/{{ type }}/{{ id }}" target="_blank">{{ id }}</a>
20-
<a href="https://openhistoricalmap.org/edit?{{ type }}={{ id }}" target="_blank">✏️</a>
21-
</h2>
22-
<h3>Tags</h3>
23-
{%- for tag in tags %}
24-
{%- if tag[0] contains "website" %}
25-
<code>{{ tag[0] }} = <a href="{{ tag[1] }}" target="_blank">{{ tag[1] }}</a></code>
26-
{%- elsif tag[0] contains "wikidata" %}
27-
<code>{{ tag[0] }} = <a href="https://wikidata.org/wiki/{{ tag[1] }}" target="_blank">{{ tag[1] }}</a></code>
28-
{%- elsif tag[0] contains "wikipedia" %}
29-
{% assign lang = tag[1] | split: ":" | first %}
30-
<code>{{ tag[0] }} = <a href="https://{{ lang }}.wikipedia.org/wiki/{{ tag[1] | replace_first: lang, "" | replace_first: ":", "" }}" target="_blank">{{ tag[1] }}</a></code>
31-
{%- else %}
32-
<code>{{ tag[0] }} = {{ tag[1] }}</code>
33-
{%- endif %}
34-
<br>
35-
{%- endfor %}
36-
{%- if meta %}
37-
<h3>Meta</h3>
38-
{%- for tag in meta %}
39-
{%- if tag[0] == "changeset" %}
40-
<code>{{ tag[0] }} = <a href="https://openhistoricalmap.org/changeset/{{ tag[1] }}" target="_blank">{{ tag[1] }}</a></code>
41-
{%- elsif tag[0] == "user" %}
42-
<code>{{ tag[0] }} = <a href="https://openhistoricalmap.org/user/{{ tag[1] }}" target="_blank">{{ tag[1] }}</a></code>
43-
{%- else %}
44-
<code>{{ tag[0] }} = {{ tag[1] }}</code>
45-
{%- endif %}
46-
<br>
47-
{%- endfor %}
48-
{%- endif %}
49-
{%- if coordinates %}
50-
<h3>Coordinates</h3>
51-
<a href="geo://{{coordinates[1]}},{{coordinates[0]}}">{{coordinates[1] | round: 6 }} / {{coordinates[0] | round: 6 }}</a> <small>(lat/lon)</small>
52-
{%- endif %}
53-
`;
54-
55-
const help = `
56-
# Introduction
57-
58-
This is an [OpenHistoricalMap](https://openhistoricalmap.org)-specific deployment of
59-
[Ultra](https://gitlab.com/trailstash/ultra) a web-application made to simplify making maps with
60-
[MapLibre GL JS](https://maplibre.org). It can load [OpenHistoricalMap](https://openhistoricalmap.org) data
61-
from the [Overpass API](https://overpass-api.de/).
62-
63-
## Documentation
64-
65-
The documentation for Ultra is available at <a target="_blank" href="https://overpass-ultra.us/docs/">overpass-ultra.us/docs</a>
66-
67-
## Overpass Queries
68-
69-
The Overpass API allows you to query for OHM data by your own search criteria. For this purpose, it
70-
has a specifically crafted query language: [Overpass
71-
QL](https://wiki.openstreetmap.org/wiki/Overpass_API/Overpass_QL)
72-
73-
In addition to regular Overpass API queries one can use \`{{bbox}}\` to specify the bounding box
74-
coordinates of the current map view.
75-
76-
## Configuration
77-
78-
Various aspects of Ultra, such as styling and the Overpass API server to use, can be
79-
configured via [YAML front-matter](https://overpass-ultra.us/docs/yaml).
80-
81-
## Styling
82-
83-
Ultra supports styling using an
84-
[extended](https://overpass-ultra.us/docs/style#ultra-maplibre-styles) version of the the [MapLibre
85-
Style Spec](https://maplibre.org/maplibre-style-spec/).
86-
87-
88-
See the [Styling](https://overpass-ultra.us/docs/style) section for more information.
89-
90-
## About
91-
92-
Ultra is built by Daniel Schep.
93-
94-
You can contact me on [Mastodon](https://mapstodon.space/@trailstash).
95-
96-
## Feedback, Bug Reports, Feature Requests
97-
98-
While Ultra has been in development for a while, it should still be considered experimental.
99-
100-
If you would like to report a bug or provide other feedback, please do so in the project's
101-
[Issue Tracker](https://gitlab.com/trailstash/ultra/-/issues).
102-
103-
## Source Code</h4>
104-
105-
The [source code](https://gitlab.com/trailstash/ultra) of this application is released under the
106-
[MIT license](https://gitlab.com/trailstash/overpass-ultra/-/blob/master/LICENSE).
107-
`;
10+
[bbox:{{bbox}}];
11+
(
12+
way[highway=path];
13+
way[highway=footway];
14+
way[highway=cycleway];
15+
way[highway=steps];
16+
);
17+
out geom;`;
18+
19+
20+
const customAll = {
21+
...all,
22+
overpass: {
23+
...overpass,
24+
source: async function (query, controller, { server }) {
25+
if (!server) {
26+
server = "https://overpass.maprva.org/api";
27+
}
28+
return overpass.source(query, controller, { server });
29+
},
30+
},
31+
};
10832

10933
const settings = {
110-
type: "overpass",
34+
type: "auto",
11135
mapStyle,
11236
queryProviders: {
113-
overpass: {
114-
...overpass,
115-
source: async function (query, controller, { server }) {
116-
if (!server) {
117-
server = "https://overpass-api.openhistoricalmap.org/api";
118-
}
119-
const src = await overpass.source(query, controller, { server });
120-
delete src.attribution;
121-
return src;
122-
},
123-
popupTemplate,
124-
},
125-
sparql,
37+
auto: new AutoProvider(customAll),
38+
...customAll,
12639
},
12740
};
12841

42+
const omtAttribution = '<a target="_blank" href="https://openmaptiles.org">OpenMapTiles</a> (Tiles by <a target="_blank" href="https://tiles.openstreetmap.us/">OSM US</a>)';
43+
const styles = [
44+
[
45+
`OSM OpenMapTiles`,
46+
"https://styles.maprva.org/openmaptiles-osm.json",
47+
omtAttribution,
48+
],
49+
[
50+
`OSM Liberty`,
51+
"https://styles.maprva.org/osm-liberty.json",
52+
omtAttribution,
53+
],
54+
[
55+
`OSM Bright`,
56+
"https://styles.maprva.org/osm-bright.json",
57+
omtAttribution,
58+
],
59+
[
60+
`Positron`,
61+
"https://styles.maprva.org/positron.json",
62+
omtAttribution,
63+
],
64+
[
65+
`Dark Matter`,
66+
"https://styles.maprva.org/dark-matter.json",
67+
omtAttribution,
68+
],
69+
[
70+
`MapTiler Basic`,
71+
"https://styles.maprva.org/maptiler-basic.json",
72+
omtAttribution,
73+
],
74+
[
75+
`MapTiler 3D`,
76+
"https://styles.maprva.org/maptiler-3d.json",
77+
omtAttribution,
78+
],
79+
[
80+
`Toner`,
81+
"https://styles.maprva.org/maptiler-toner.json",
82+
omtAttribution,
83+
],
84+
[
85+
`Fiord Color`,
86+
"https://styles.maprva.org/fiord-color.json",
87+
omtAttribution,
88+
],
89+
[
90+
`Virginia Base Mapping Program`,
91+
"https://styles.maprva.org/vgin-vbmp-imagery-latest.json",
92+
`Imagery`,
93+
],
94+
[
95+
`Henrico Aerial Imagery`,
96+
"https://styles.maprva.org/henrico-aerial-imagery-latest.json",
97+
`Imagery`,
98+
],
99+
[
100+
`Esri World Imagery`,
101+
"https://styles.maprva.org/henrico-aerial-imagery-latest.json",
102+
`Imagery`,
103+
],
104+
];
105+
106+
129107
export const defaultMode = "ide";
130108
export const modes = {
131109
ide: {
132110
query,
133-
help,
134-
styles: [
135-
[
136-
"Historic",
137-
mapStyle,
138-
'<a href="https://openhistoricalmap.org">OpenHistoricalMap</a>',
139-
],
140-
[
141-
"Rail",
142-
"https://www.openhistoricalmap.org/map-styles/rail/rail.json",
143-
'<a href="https://openhistoricalmap.org">OpenHistoricalMap</a>',
144-
],
145-
[
146-
"Woodblock",
147-
"https://www.openhistoricalmap.org/map-styles/woodblock/woodblock.json",
148-
'<a href="https://openhistoricalmap.org">OpenHistoricalMap</a>',
149-
],
150-
[
151-
"Japanese Scroll",
152-
"https://www.openhistoricalmap.org/map-styles/japanese_scroll/ohm-japanese-scroll-map.json",
153-
'<a href="https://openhistoricalmap.org">OpenHistoricalMap</a>',
154-
],
155-
[
156-
"OSM OpenMapTiles",
157-
"https://styles.trailsta.sh/openmaptiles-osm.json",
158-
'<a href="https://openfreemap.org">OpenFreeMap</a>',
159-
],
160-
],
111+
styles,
161112
settings: {
162113
...settings,
163-
title: "OHM Ultra",
164-
url: "https://ohm.overpass-ultra.us",
114+
title: "MapRVA Ultra",
115+
url: "https://ultra.maprva.org",
165116
options: {
166-
zoom: 13,
167-
center: [-73.9803, 40.7412],
168117
attributionControl: {
169118
customAttribution: "",
170119
},
171-
maxBounds: [
172-
[-179.999999999, -85.051129],
173-
[179.999999999, 85.051129],
174-
],
175120
},
176121
},
177122
},

0 commit comments

Comments
 (0)