@trailstash/ultra 3.3.4 → 3.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.gitlab-ci.yml CHANGED
@@ -1,8 +1,10 @@
1
1
  pages:
2
- image: node:18
2
+ image: node:20
3
3
  script:
4
- - apt update && apt install -y mkdocs-material
4
+ - apt update && apt install -y mkdocs-material jq moreutils
5
5
  - npm ci
6
+ # Update version
7
+ - jq ".version = \"$(git describe --tags --dirty | sed -e 's/^v//')\"" package.json | sponge package.json
6
8
  - npm run build
7
9
  - npm run build:examples-docs
8
10
  - npm run build:maplibre-examples-docs
@@ -13,3 +15,11 @@ pages:
13
15
  - public
14
16
  only:
15
17
  - main
18
+ - tags
19
+ npm:
20
+ image: node:20
21
+ script:
22
+ - npm version from-git --no-git-tag-version
23
+ - npm publish
24
+ only:
25
+ - tags
package/Examples/index.md CHANGED
@@ -1,7 +1,6 @@
1
1
  # Overview
2
2
 
3
- These examples highlight capabilities and differences unique to Overpass Ultra such as it's styling
4
- capabilities, non-OSM data capabilities, etc.
3
+ These examples highlight Ultra's capabilities.
5
4
 
6
5
  For examples of how to author OverpassQL queries, please reference the abundance of documentation
7
6
  on the [OSM Wiki](https://wiki.openstreetmap.org) and elsewhere.
package/README.md CHANGED
@@ -1,45 +1,28 @@
1
- # Introduction
1
+ # Ultra
2
2
 
3
- Ultra is a web-application made to simplify making maps with [MapLibre GL
3
+ Ultra (née Overpass Ultra) is a web-application made to simplify making maps with [MapLibre GL
4
4
  JS](https://maplibre.org).
5
5
 
6
- ## Deployments
7
-
8
- - Production version - [overpass-ultra.us](https://overpass-ultra.us) <small>([config](https://gitlab.com/trailstash/overpass-ultra/-/blob/main/config.js))</small>
9
- - Development Version - [ultra.trailsta.sh](https://ultra.trailsta.sh) <small>([config](https://gitlab.com/trailstash/ultra/-/blob/main/config.js))</small>
6
+ - Stable version - [overpass-ultra.us](https://overpass-ultra.us) <small>([config](https://gitlab.com/trailstash/overpass-ultra/-/blob/main/config.js))</small>
7
+ - Latest version - [ultra.trailsta.sh](https://ultra.trailsta.sh) <small>([config](https://gitlab.com/trailstash/ultra/-/blob/main/config.js))</small>
10
8
  - OHM version - [ohm.overpass-ultra.us](https://ohm.overpass-ultra.us) <small>([config](https://gitlab.com/trailstash/ohm-ultra/-/blob/main/config.js))</small>
11
9
 
12
10
  ## Documentation
13
11
 
14
- The documentation for Ultra is available at <a target="_blank" href="/docs/">/docs</a>.
15
-
16
- ## Configuration
17
-
18
- Various aspects of Ultra, such as styling, can be
19
- configured via [YAML front-matter](/docs/yaml).
12
+ The documentation for Ultra is available at <a target="_blank" href="https://overpass-ultra.us/docs/">overpass-ultra.us/docs</a>.
20
13
 
21
- ## Overpass Queries
14
+ ### Configuration
22
15
 
23
- Overpass API allows to query for OSM data by your own search criteria. For this purpose, it has a
24
- specifically crafted query language: [Overpass
25
- QL](https://wiki.openstreetmap.org/wiki/Overpass_API/Overpass_QL)
16
+ Various aspects of Ultra, such as styling, can be configured via [YAML
17
+ front-matter](https://overpass-ultra.us/docs/yaml).
26
18
 
27
- In addition to regular Overpass API queries one can use `{{bbox}}` to specify the bounding box
28
- coordinates of the current map view.
29
-
30
- ## Styling
19
+ ### Styling
31
20
 
32
21
  Ultra supports styling using an
33
22
  [extended](/docs/style#ultra-maplibre-styles) version of the the [MapLibre
34
23
  Style Spec](https://maplibre.org/maplibre-style-spec/).
35
24
 
36
- See the [Styling](/docs/style) section for more information.
37
-
38
- ## About
39
-
40
- Ultra is built by Daniel Schep.
41
-
42
- You can contact me on [Mastodon](https://mapstodon.space/@trailstash).
25
+ See the [Styling](https://overpass-ultra.us/docs/style) section for more information.
43
26
 
44
27
  ## Feedback, Bug Reports, Feature Requests
45
28
 
@@ -49,7 +32,14 @@ experimental.
49
32
  If you would like to report a bug or provide other feedback, please do so in the project's
50
33
  [Issue Tracker](https://gitlab.com/trailstash/ultra/-/issues).
51
34
 
52
- ## Source Code</h4>
35
+ ## Development
36
+
37
+ ```
38
+ npm install
39
+ npm start # for a Development server listening at http://localhost:8000
40
+ npm run build # for a build in ./dist
41
+ ```
42
+
43
+ ## License
53
44
 
54
- The [source code](https://gitlab.com/trailstash/ultra) of this application is released under the
55
- [MIT license](https://gitlab.com/trailstash/ultra/-/blob/master/LICENSE).
45
+ **Ultra** is licensed under the [MIT license](https://gitlab.com/trailstash/ultra/-/blob/master/LICENSE).
@@ -44,7 +44,7 @@ export class DownloadButton extends HTMLElement {
44
44
  const blob = new Blob([json], { type: "octet/stream" });
45
45
  const url = window.URL.createObjectURL(blob);
46
46
 
47
- const link = h("a", { download: "overpass.geojson", href: url });
47
+ const link = h("a", { download: "ultra.geojson", href: url });
48
48
 
49
49
  // this is necessary as link.click() does not work on the latest firefox
50
50
  link.dispatchEvent(
@@ -6,18 +6,85 @@ import { toQueryParams } from "../lib/queryParams.js";
6
6
  import { version } from "../package.json";
7
7
  import { version as maplibreVersion } from "maplibre-gl/package.json";
8
8
  import { version as osmtogeojsonVersion } from "osmtogeojson/package.json";
9
- import readme from "../README.md";
9
+
10
+ const help = `# Introduction
11
+
12
+ Ultra (née Overpass Ultra) is a web-application made to simplify making maps with [MapLibre GL
13
+ JS](https://maplibre.org).
14
+
15
+ It can easily visualize the following file/query types:
16
+
17
+ * [GeoJSON](https://geojson.org/)
18
+ * [KML](https://developers.google.com/kml/documentation/kml_tut)
19
+ * [GPX](https://www.topografix.com/gpx.asp)
20
+ * [TCX](https://en.wikipedia.org/wiki/Training_Center_XML)
21
+ * [OverpassQL](https://wiki.openstreetmap.org/wiki/Overpass_API/Overpass_QL)
22
+ * [Overpass XML](https://wiki.openstreetmap.org/wiki/Overpass_API/Language_Guide)
23
+ * [OSM XML](https://wiki.openstreetmap.org/wiki/OSM_XML)
24
+ * [OSM JSON](https://wiki.openstreetmap.org/wiki/OSM_JSON)
25
+
26
+ ## Documentation
27
+
28
+ Full documentation for Ultra is available at ${window.location.origin}/docs
29
+
30
+ ## Configuration
31
+
32
+ Various aspects of Ultra, such as styling, can be
33
+ configured via [YAML front-matter](/docs/yaml).
34
+
35
+ ## Query Bounds
36
+
37
+ The following shortcuts are available to parameterize your queries:
38
+
39
+ | shortcut | description |
40
+ | -------- | ----------- |
41
+ | \`{{bbox}}\` | The map's bounds in the format expected by [https://overpass-api.de](Overpass) |
42
+ | \`{{south}}\` | The Southern Latitude of the map's bounds |
43
+ | \`{{north}}\` | The Northern Latitude of the map's bounds |
44
+ | \`{{east}}\` | The Eastern Longitude of the map's bounds |
45
+ | \`{{west}}\` | The Western Longitude of the map's bounds |
46
+
47
+ ## Styling
48
+
49
+ Ultra supports styling using an extended version of the the
50
+ [MapLibre Style Spec](https://maplibre.org/maplibre-style-spec/).
51
+
52
+ See the [Styling](/docs/style) section for more information.
53
+
54
+ ## About
55
+
56
+ Ultra is built by Daniel Schep.
57
+
58
+ You can contact me on [Mastodon](https://mapstodon.space/@trailstash).
59
+
60
+ ## Feedback, Bug Reports, Feature Requests
61
+
62
+ While Ultra has been in development for a while, it should still be considered
63
+ experimental.
64
+
65
+ If you would like to report a bug or provide other feedback, please do so in the project's
66
+ [Issue Tracker](https://gitlab.com/trailstash/ultra/-/issues).
67
+
68
+ ## Source Code</h4>
69
+
70
+ The [source code](https://gitlab.com/trailstash/ultra) of this application is released under the
71
+ [MIT license](https://gitlab.com/trailstash/ultra/-/blob/main/LICENSE).
72
+ `;
10
73
 
11
74
  export class HelpModal extends HTMLElement {
75
+ static defaults = {
76
+ help,
77
+ };
12
78
  constructor() {
13
79
  super();
14
- this.help = readme;
80
+ this.help = HelpModal.defaults.help;
81
+ this.styles = [];
15
82
  }
16
83
 
17
84
  connectedCallback() {
18
85
  const shadow = this.attachShadow({ mode: "open" });
19
86
 
20
- const readmeHTML = marked
87
+ const helpHTML = marked
21
88
  .parse(this.help)
22
89
  .replace(/<\/h3>/g, "</h5>")
23
90
  .replace(/<h3>/g, "<h5>")
@@ -26,11 +93,21 @@ export class HelpModal extends HTMLElement {
26
93
  .replace(/<\/h1>/g, "</h3>")
27
94
  .replace(/<h1>/g, "<h3>");
28
95
 
96
+ let stylesHTML = "";
97
+ if (this.styles.length > 0) {
98
+ stylesHTML = `<div><h4>Style & Tile Providers</h4><ul>`;
99
+ for (const style of this.styles) {
100
+ stylesHTML += `<li>${style[2]}</li>`;
101
+ }
102
+ stylesHTML += `</ul></div>`;
103
+ }
104
+
29
105
  const div = h(
30
106
  "div",
31
107
  { style: "padding: 0 8px 8px;max-width:800px;", slot: "modal-content" },
32
108
  `
33
- ${readmeHTML}
109
+ ${helpHTML}
110
+ ${stylesHTML}
34
111
  <div>
35
112
  <h4>Software &amp; Libraries</h4>
36
113
  <ul>
@@ -1,3 +1,4 @@
1
+ import DOMPurify from "dompurify";
1
2
  import { Liquid } from "liquidjs";
2
3
  import { h, t } from "../lib/dom.js";
3
4
  import { normalizeCSS } from "../lib/normalize.js";
@@ -50,7 +51,7 @@ export class MapPopup extends HTMLElement {
50
51
  this.template,
51
52
  this.contextBuilder(f),
52
53
  );
53
- div.appendChild(h("div", {}, html));
54
+ div.appendChild(h("div", {}, DOMPurify.sanitize(html)));
54
55
  }
55
56
  shadow.appendChild(div);
56
57
  }
@@ -4,10 +4,25 @@ import { normalizeCSS } from "../lib/normalize.js";
4
4
 
5
5
  const style = `margin: 10px 0; display: block; width: 100%; text-align: left;`;
6
6
 
7
+ const styles = [
8
+ [
9
+ "Natural Earth Vector",
10
+ "https://trailstash.github.io/naturalearthtiles/maps/natural_earth.vector.json",
11
+ `<a href="https://github.com/trailstash/naturalearthtiles">TrailStash</a>`,
12
+ ],
13
+ [
14
+ "MapLibre Demo Tiles",
15
+ "https://demotiles.maplibre.org/style.json",
16
+ `<a href="https://github.com/maplibre/demotiles">MapLibre</a>`,
17
+ ],
18
+ ];
19
+
7
20
  export class StylePicker extends HTMLElement {
21
+ static defaults = { styles };
22
+
8
23
  constructor() {
9
24
  super();
10
- this.styles = [];
25
+ this.styles = StylePicker.defaults.styles;
11
26
  }
12
27
 
13
28
  connectedCallback() {
@@ -16,6 +16,8 @@ import {
16
16
  queryFromStorage,
17
17
  } from "../lib/localStorage.js";
18
18
  import { UltraMap } from "./ultra-map.js";
19
+ import { HelpModal } from "./help-modal.js";
20
+ import { StylePicker } from "./style-picker.js";
19
21
 
20
22
  const style = new CSSStyleSheet();
21
23
  style.replaceSync(`
@@ -85,7 +87,7 @@ export class UltraIDE extends HTMLElement {
85
87
  autoRun = false;
86
88
  query = "";
87
89
  settings = {};
88
- styles = [];
90
+ styles;
89
91
  help;
90
92
 
91
93
  static MAP_INIT_SETTINGS = [
@@ -127,8 +129,13 @@ export class UltraIDE extends HTMLElement {
127
129
  h("run-button"),
128
130
  h("download-button"),
129
131
  h("share-button"),
130
- h("style-picker", { styles: this.styles }),
131
- h("help-modal", this.help ? { help: this.help } : {}),
132
+ h("style-picker", {
133
+ styles: this.styles || StylePicker.defaults.styles,
134
+ }),
135
+ h("help-modal", {
136
+ help: this.help || HelpModal.defaults.help,
137
+ styles: this.styles || StylePicker.defaults.styles,
138
+ }),
132
139
  ),
133
140
  ),
134
141
  );
@@ -41,7 +41,8 @@ export class UltraMap extends HTMLElement {
41
41
  type: "auto",
42
42
  query: "",
43
43
  server: null,
44
- mapStyle: "https://demotiles.maplibre.org/style.json",
44
+ mapStyle:
45
+ "https://trailstash.github.io/naturalearthtiles/maps/natural_earth.vector.json",
45
46
  popupTemplate: null,
46
47
  querySources: ["ultra"],
47
48
  options: {},
@@ -169,7 +170,7 @@ export class UltraMap extends HTMLElement {
169
170
  document.title = this.title;
170
171
  }
171
172
  if (this.icon) {
172
- document.querySelector('[rel=icon]').href = this.icon;
173
+ document.querySelector("[rel=icon]").href = this.icon;
173
174
  }
174
175
  if (this.description) {
175
176
  // TODO?
package/docs/index.md CHANGED
@@ -1,39 +1,44 @@
1
1
  # Introduction
2
2
 
3
- Ultra is a web-application made to simplify making maps with [MapLibre GL
3
+ Ultra (née Overpass Ultra) is a web-application made to simplify making maps with [MapLibre GL
4
4
  JS](https://maplibre.org).
5
5
 
6
- ## Deployments
6
+ ![](./assets/screenshot.png)
7
7
 
8
- - Production version - [overpass-ultra.us](https://overpass-ultra.us) <small>([config](https://gitlab.com/trailstash/overpass-ultra/-/blob/main/config.js))</small>
9
- - Development Version - [ultra.trailsta.sh](https://ultra.trailsta.sh) <small>([config](https://gitlab.com/trailstash/ultra/-/blob/main/config.js))</small>
10
- - OHM version - [ohm.overpass-ultra.us](https://ohm.overpass-ultra.us) <small>([config](https://gitlab.com/trailstash/ohm-ultra/-/blob/main/config.js))</small>
8
+ It can easily visualize the following file/query types:
11
9
 
12
- ## Documentation
13
-
14
- The documentation for Ultra is available at <a target="_blank" href="/docs/">/docs</a>.
10
+ * [GeoJSON](https://geojson.org/)
11
+ * [KML](https://developers.google.com/kml/documentation/kml_tut)
12
+ * [GPX](https://www.topografix.com/gpx.asp)
13
+ * [TCX](https://en.wikipedia.org/wiki/Training_Center_XML)
14
+ * [OverpassQL](https://wiki.openstreetmap.org/wiki/Overpass_API/Overpass_QL)
15
+ * [Overpass XML](https://wiki.openstreetmap.org/wiki/Overpass_API/Language_Guide)
16
+ * [OSM XML](https://wiki.openstreetmap.org/wiki/OSM_XML)
17
+ * [OSM JSON](https://wiki.openstreetmap.org/wiki/OSM_JSON)
15
18
 
16
19
  ## Configuration
17
20
 
18
21
  Various aspects of Ultra, such as styling, can be
19
- configured via [YAML front-matter](/docs/yaml).
22
+ configured via [YAML front-matter](./yaml.md).
20
23
 
21
- ## Overpass Queries
24
+ ## Query Bounds
22
25
 
23
- Overpass API allows to query for OSM data by your own search criteria. For this purpose, it has a
24
- specifically crafted query language: [Overpass
25
- QL](https://wiki.openstreetmap.org/wiki/Overpass_API/Overpass_QL)
26
+ The following shortcuts are available to parameterize your queries:
26
27
 
27
- In addition to regular Overpass API queries one can use `{{bbox}}` to specify the bounding box
28
- coordinates of the current map view.
28
+ | shortcut | description |
29
+ | -------- | ----------- |
30
+ | `{{bbox}}` | The map's bounds in the format expected by [Overpass](https://overpass-api.de) |
31
+ | `{{south}}` | The Southern Latitude of the map's bounds |
32
+ | `{{north}}` | The Northern Latitude of the map's bounds |
33
+ | `{{east}}` | The Eastern Longitude of the map's bounds |
34
+ | `{{west}}` | The Western Longitude of the map's bounds |
29
35
 
30
36
  ## Styling
31
37
 
32
- Ultra supports styling using an
33
- [extended](/docs/style#ultra-maplibre-styles) version of the the [MapLibre
34
- Style Spec](https://maplibre.org/maplibre-style-spec/).
38
+ Ultra supports styling using an extended version of the the
39
+ [MapLibre Style Spec](https://maplibre.org/maplibre-style-spec/).
35
40
 
36
- See the [Styling](/docs/style) section for more information.
41
+ See the [Styling](./style.md) section for more information.
37
42
 
38
43
  ## About
39
44
 
@@ -1,8 +1,9 @@
1
- In order to allow for querying Overpass with the extents of the MapLibre viewport, Overpass Ultra
1
+ In order to allow for querying Overpass with the extents of the MapLibre viewport, Ultra
2
2
  replaces any occurences of `{{bbox}}` in the query with the bounding box in the format expected by
3
3
  the Overpass API.
4
4
 
5
5
  For example:
6
+
6
7
  ```
7
8
  [bbox:{{bbox}}];
8
9
  nwr[shop];
@@ -10,12 +11,13 @@ out center;
10
11
  ```
11
12
 
12
13
  ### Other formats
14
+
13
15
  If you need to specify the coordinates in a different order, you can use the following shortcuts
14
16
  for the min and max of both lattitude and longitude:
15
17
 
16
- * `{{south}}`
17
- * `{{north}}`
18
- * `{{east}}`
19
- * `{{west}}`
18
+ - `{{south}}`
19
+ - `{{north}}`
20
+ - `{{east}}`
21
+ - `{{west}}`
20
22
 
21
23
  [Example](./Examples/alt-bbox-format.md)
package/docs/style.md CHANGED
@@ -1,20 +1,20 @@
1
1
  # Styling
2
2
 
3
- The MapLibre styling can be attached to a query written in the Overpass-QL query language via the
4
- `style:` key of the [YAML front-matter](./yaml.md).
3
+ The MapLibre styling can be attached to a query via the `style:` key of the [YAML
4
+ front-matter](./yaml.md).
5
5
 
6
6
  ```
7
7
  ---
8
8
  style: ... your MapLibre style here ...
9
9
  ---
10
- ... your overpass query here ...
10
+ ... your query here ...
11
11
  ```
12
12
 
13
13
  The value of the style: key can contain:
14
14
 
15
- * a URL to a MapLibre style
16
- * a full MapLibre style object
17
- * a Ultra MapLibre style
15
+ - a URL to a MapLibre style
16
+ - a full MapLibre style object
17
+ - a Ultra MapLibre style
18
18
 
19
19
  ## Ultra MapLibre styles
20
20
 
@@ -58,12 +58,14 @@ nwr[shop]({{bbox}}); out center;
58
58
  ```
59
59
 
60
60
  ### Layer `source` & `id`
61
+
61
62
  In the above examples, the layer definitions are lacking both source and layers keys.
62
63
 
63
64
  Layers don't need to specify an ID, and if the source is not specified, it will be set to to the
64
65
  source containting the query results.
65
66
 
66
67
  ### Automatic `paint` and `layer` keys
68
+
67
69
  In order to reduce the mental overhead of remember what keys are
68
70
  [`paint`](https://maplibre.org/maplibre-style-spec/layers/#paint) options and which are
69
71
  [`layout`](https://maplibre.org/maplibre-style-spec/layers/#layout) options, Ultra will
@@ -82,11 +84,13 @@ nwr[shop]({{bbox}}); out center;
82
84
  ```
83
85
 
84
86
  ### Sandwiching layers
85
- In order to place your layers below existing style layers, you can use the `beforeLayerId:` key.
87
+
88
+ In order to place your layers below existing style layers, you can use the `beforeLayerId:` key.
86
89
 
87
90
  [Example](./Examples/bike-infra.md)
88
91
 
89
92
  ## PNG sprites via HTTPS
93
+
90
94
  In order to facilitate adding icons to the map that don't exist in the basemap's
91
95
  [sprites](),
92
96
  if `icon-image` is set to an HTTPS URL to a PNG image, Ultra will automatically download
@@ -95,6 +99,7 @@ it and add it to the Map's images.
95
99
  [Example](./MapLibre-Examples/add-image.md)
96
100
 
97
101
  ## Bundled Sprites
102
+
98
103
  In order to simplify the creation of POI maps, Ultra bundles the
99
104
  [Maki](https://github.com/mapbox/maki) and [Temaki](https://github.com/rapideditor/temaki) sprites
100
105
  and adds them to your style as [SDFs](https://docs.mapbox.com/help/troubleshooting/using-recolorable-images-in-mapbox-maps/)
@@ -115,6 +120,7 @@ style:
115
120
  ```
116
121
 
117
122
  ## Fallback fontstack
123
+
118
124
  Since not all MapLibre styles have the same
119
125
  [glyphs](https://maplibre.org/maplibre-style-spec/glyphs/), Ultra will default to using
120
126
  Noto Sans Regular if the speficied(or default) fontstack is not available.
@@ -6,7 +6,7 @@ You use the following query string parameters as a hash to instruct Ultra to set
6
6
 
7
7
  This sets the query to the given string.
8
8
 
9
- Example: [http://overpass-ultra.us/#query=node%5B%22amenity%22%3D%22drinking_water%22%5D(%7B%7Bbbox%7D%7D)%3B%0Aout%3B](http://overpass-ultra.us/#query=node%5B%22amenity%22%3D%22drinking_water%22%5D(%7B%7Bbbox%7D%7D)%3B%0Aout%3B)
9
+ Example: [http://overpass-ultra.us/#query=node%5B%22amenity%22%3D%22drinking_water%22%5D(%7B%7Bbbox%7D%7D)%3B%0Aout%3B](<http://overpass-ultra.us/#query=node%5B%22amenity%22%3D%22drinking_water%22%5D(%7B%7Bbbox%7D%7D)%3B%0Aout%3B>)
10
10
 
11
11
  ### Loading Gists
12
12
 
@@ -36,10 +36,10 @@ Example: [http://overpass-ultra.us/#m=14.64/-33.8842/151.2077](http://overpass-u
36
36
 
37
37
  Runs the query immediately after startup.
38
38
 
39
- Example: [http://overpass-ultra.us/#run&query=node%5B%22amenity%22%3D%22drinking_water%22%5D(%7B%7Bbbox%7D%7D)%3B%0Aout%3B&m=14.64/-33.8842/151.2077](http://overpass-ultra.us/#run&query=node%5B%22amenity%22%3D%22drinking_water%22%5D(%7B%7Bbbox%7D%7D)%3B%0Aout%3B&m=14.64/-33.8842/151.2077)
39
+ Example: [http://overpass-ultra.us/#run&query=node%5B%22amenity%22%3D%22drinking_water%22%5D(%7B%7Bbbox%7D%7D)%3B%0Aout%3B&m=14.64/-33.8842/151.2077](<http://overpass-ultra.us/#run&query=node%5B%22amenity%22%3D%22drinking_water%22%5D(%7B%7Bbbox%7D%7D)%3B%0Aout%3B&m=14.64/-33.8842/151.2077>)
40
40
 
41
41
  ## `map`
42
42
 
43
43
  Runs the query as a customizable interactive map.
44
44
 
45
- Example: [http://overpass-ultra.us/#map&query=node%5B%22amenity%22%3D%22drinking_water%22%5D(%7B%7Bbbox%7D%7D)%3B%0Aout%3B&m=14.64/-33.8842/151.2077 ](http://overpass-ultra.us/#map&query=node%5B%22amenity%22%3D%22drinking_water%22%5D(%7B%7Bbbox%7D%7D)%3B%0Aout%3B&m=14.64/-33.8842/151.2077 )
45
+ Example: [http://overpass-ultra.us/#map&query=node%5B%22amenity%22%3D%22drinking_water%22%5D(%7B%7Bbbox%7D%7D)%3B%0Aout%3B&m=14.64/-33.8842/151.2077 ](<http://overpass-ultra.us/#map&query=node%5B%22amenity%22%3D%22drinking_water%22%5D(%7B%7Bbbox%7D%7D)%3B%0Aout%3B&m=14.64/-33.8842/151.2077>)
package/docs/yaml.md CHANGED
@@ -7,7 +7,8 @@ The real power of Ultra lies in it's easy configuration of MapLibre with the a q
7
7
 
8
8
  Customize the MapLibre style. See [Styling](./style.md) for more information.
9
9
 
10
- Example:
10
+ Example:
11
+
11
12
  ```
12
13
  ---
13
14
  style: https://example.com/style.json
@@ -18,7 +19,8 @@ style: https://example.com/style.json
18
19
 
19
20
  Use a different Overpass API server.
20
21
 
21
- Example:
22
+ Example:
23
+
22
24
  ```
23
25
  ---
24
26
  server: https://overpass.private.coffee/api/
@@ -45,92 +47,114 @@ Specify the type of source in the query.
45
47
  **Default:** `auto`
46
48
 
47
49
  ### `auto`
50
+
48
51
  Automatically detects and chooses the right query provider out of the following:
49
- * `overpass`
50
- * `osmWebsite`
51
- * `osmWiki`
52
- * `geojson`
53
- * `osmxml`
54
- * `osmjson`
55
- * `kml`
56
- * `gpx`
57
- * `tcx`
52
+
53
+ - `overpass`
54
+ - `osmWebsite`
55
+ - `osmWiki`
56
+ - `geojson`
57
+ - `osmxml`
58
+ - `osmjson`
59
+ - `kml`
60
+ - `gpx`
61
+ - `tcx`
58
62
 
59
63
  See each provider for how it is auto-detected
60
64
 
61
65
  ### `overpass`
66
+
62
67
  An [Overpass QL](https://wiki.openstreetmap.org/wiki/Overpass_API/Overpass_QL) query. Results
63
68
  converted into a [GeoJSON source](https://maplibre.org/maplibre-style-spec/sources/#geojson) with
64
69
  [`osmtogeojson`](https://github.com/tyrasd/osmtogeojson).
65
70
 
66
71
  Detected if:
67
- * Parses as XML and the top level tag is `osm-script`
68
- * Matches one of the regexes defined [here](https://gitlab.com/trailstash/ultra/-/blob/main/lib/queryProviders/overpass.js#L11-34)
72
+
73
+ - Parses as XML and the top level tag is `osm-script`
74
+ - Matches one of the regexes defined [here](https://gitlab.com/trailstash/ultra/-/blob/main/lib/queryProviders/overpass.js#L11-34)
69
75
 
70
76
  ### `osmWebsite`
77
+
71
78
  Parses a URL to an node/way/relation on `osm.org` and fetches that element using an Overpass query
72
79
  using `out geom;`
73
80
 
74
81
  Detected if:
75
- * A URL on osm.org starting with node/way/relation
82
+
83
+ - A URL on osm.org starting with node/way/relation
76
84
 
77
85
  ### `osmWiki`
86
+
78
87
  Perform an Overpass query using `nwr` and `out geom;` for an OSM wiki URL starting with `Tag:` or
79
88
  `Key:`
80
89
 
81
90
  Detected if:
82
- * A URL to the OSM wiki starting with `Tag:` or `Key:`
91
+
92
+ - A URL to the OSM wiki starting with `Tag:` or `Key:`
83
93
 
84
94
  ### `osmxml`
95
+
85
96
  An [OSM XML](https://wiki.openstreetmap.org/wiki/OSM_XML) document or a URL to one. Converted into
86
97
  a [GeoJSON source](https://maplibre.org/maplibre-style-spec/sources/#geojson) with
87
98
  [`osmtogeojson`](https://github.com/tyrasd/osmtogeojson).
88
99
 
89
100
  Detected if:
90
- * Parses as XML and the top level tag is `osm`
91
- * Parses as a URL and the path matches that of an `node/:id`, `way/:id/full`, or
92
- `relation/:id/full` OSM API route
101
+
102
+ - Parses as XML and the top level tag is `osm`
103
+ - Parses as a URL and the path matches that of an `node/:id`, `way/:id/full`, or
104
+ `relation/:id/full` OSM API route
93
105
 
94
106
  ### `osmjson`
107
+
95
108
  An [OSM JSON](https://wiki.openstreetmap.org/wiki/OSM_JSON) document or a URL to one. Converted
96
109
  into a [GeoJSON source](https://maplibre.org/maplibre-style-spec/sources/#geojson) with
97
110
  [`osmtogeojson`](https://github.com/tyrasd/osmtogeojson).
98
111
 
99
112
  Detected if:
100
- * Parses as JSON and contains a `version` key containing the value `0.6` at the top level.
101
- * Parses as a URL and the path matches that of an `node/:id`, `way/:id/full`, or
102
- `relation/:id/full` OSM API route
113
+
114
+ - Parses as JSON and contains a `version` key containing the value `0.6` at the top level.
115
+ - Parses as a URL and the path matches that of an `node/:id`, `way/:id/full`, or
116
+ `relation/:id/full` OSM API route
103
117
 
104
118
  ### `geojson`
119
+
105
120
  A JSON-encoded GeoJSON object or a URL to a GeoJSON file.
106
121
 
107
122
  Detected if:
108
- * Parses as JSON and contains a `type` with a valid GeoJSON type.
123
+
124
+ - Parses as JSON and contains a `type` with a valid GeoJSON type.
109
125
 
110
126
  ### `kml`
127
+
111
128
  A KML file or URL to a KML file.
112
129
 
113
130
  Detected if
114
- * Parses as XML and contains a top level `kml` tag
131
+
132
+ - Parses as XML and contains a top level `kml` tag
115
133
 
116
134
  ### `gpx`
135
+
117
136
  A GPX file or URL to a GPX file.
118
137
 
119
138
  Detected if
120
- * Parses as XML and contains a top level `gpx` tag
139
+
140
+ - Parses as XML and contains a top level `gpx` tag
121
141
 
122
142
  ### `tcx`
143
+
123
144
  A TCX file or URL to a TCX file.
124
145
 
125
146
  Detected if
126
- * Parses as XML and contains a top level `tcx` tag
147
+
148
+ - Parses as XML and contains a top level `tcx` tag
127
149
 
128
150
  ### `raster`
151
+
129
152
  A line delimited list of [tile URLs](https://maplibre.org/maplibre-style-spec/sources/#tiles_1) for
130
153
  a [raster source](https://maplibre.org/maplibre-style-spec/sources/#raster) or a [TileJSON
131
154
  url](https://maplibre.org/maplibre-style-spec/sources/#url_1)
132
155
 
133
156
  ### `vector`
157
+
134
158
  A line delimited list of [tile URLs](https://maplibre.org/maplibre-style-spec/sources/#tiles_2) for
135
159
  a [vector source](https://maplibre.org/maplibre-style-spec/sources/#vector) or a [TileJSON
136
160
  url](https://maplibre.org/maplibre-style-spec/sources/#url_2)
@@ -152,13 +176,15 @@ options:
152
176
  ```
153
177
 
154
178
  ## `controls`
179
+
155
180
  When an Ultra query is run in "interactive map" mode, you can specify controls to be added to the map with the `controls` key
156
- in the YAML-front matter. The key should contain a list of objects. Each object must specify a `type` key containing the
181
+ in the YAML-front matter. The key should contain a list of objects. Each object must specify a `type` key containing the
157
182
  name of a control present in MapLibre. It can optionally contain an `options` key who's contents are passed to the
158
183
  control's constructor and a `position` key that is passed to
159
184
  [`map.addControl`](https://maplibre.org/maplibre-gl-js/docs/API/classes/Map/#addcontrol).
160
185
 
161
186
  For example, to add a NavigationControl to your map:
187
+
162
188
  ```
163
189
  ---
164
190
  controls:
@@ -117,7 +117,6 @@ export const osmWebsite = {
117
117
  const [type, id] = urlMatch.slice(1);
118
118
  return overpass.source(`${type}(${id});out geom;`, controller, {
119
119
  server,
120
- bounds,
121
120
  });
122
121
  } else {
123
122
  throw new Error(`Don't know how to load ${query}`);
@@ -156,7 +155,7 @@ out geom;`,
156
155
  throw new Error(`Don't know how to load ${query}`);
157
156
  }
158
157
 
159
- return overpass.source(query, controller, { server, bounds });
158
+ return overpass.source(overpassQuery, controller, { server });
160
159
  },
161
160
  detect: function (query, bounds) {
162
161
  if (!query.startsWith("https://wiki.openstreetmap.org/wiki/")) {
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "3.3.4",
6
+ "version": "3.4.1",
7
7
  "description": "A web based tool for making MapLibre GL maps with data from sources such as Overpass, GeoJSON, GPX, KML, TCX, etc",
8
8
  "main": "index.js",
9
9
  "scripts": {
@@ -58,6 +58,9 @@
58
58
  "@trailstash/maplibre-component": "^1.0.1",
59
59
  "@turf/bbox": "^7.1.0",
60
60
  "deep-equal": "^2.2.3",
61
+ "dompurify": "^3.1.7",
62
+ "esbuild": "^0.24.0",
63
+ "esbuild-plugin-copy": "^2.1.1",
61
64
  "liquidjs": "^10.17.0",
62
65
  "lodash.pick": "^4.4.0",
63
66
  "lz-string": "^1.5.0",
@@ -66,9 +69,7 @@
66
69
  "normalize.css": "^8.0.1",
67
70
  "osmtogeojson": "^3.0.0-beta.5",
68
71
  "pmtiles": "^3.2.0",
69
- "yaml": "^2.5.1",
70
- "esbuild": "^0.24.0",
71
- "esbuild-plugin-copy": "^2.1.1"
72
+ "yaml": "^2.5.1"
72
73
  },
73
74
  "peerDependencies": {
74
75
  "@maplibre/maplibre-gl-style-spec": "20.x"
package/.kids.ultra.swn DELETED
Binary file
package/.kids.ultra.swo DELETED
Binary file
package/.swp DELETED
Binary file
package/cli/.build.js.swo DELETED
Binary file
Binary file
Binary file
File without changes