@trailstash/ultra 6.1.0 → 6.1.2
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.
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Style by opening_date
|
|
3
|
+
description: Use a javascript transform and custom style to show if shops are currently open
|
|
4
|
+
options:
|
|
5
|
+
zoom: 15
|
|
6
|
+
center: [-77.481242, 37.553525]
|
|
7
|
+
style:
|
|
8
|
+
layers:
|
|
9
|
+
- type: symbol
|
|
10
|
+
icon-image: maki:shop
|
|
11
|
+
icon-halo-color: white
|
|
12
|
+
icon-halo-width: 2
|
|
13
|
+
icon-size: 0.5
|
|
14
|
+
icon-overlap: always
|
|
15
|
+
icon-color:
|
|
16
|
+
- match
|
|
17
|
+
- [get, open]
|
|
18
|
+
- open
|
|
19
|
+
- green
|
|
20
|
+
- close
|
|
21
|
+
- red
|
|
22
|
+
- unknown
|
|
23
|
+
- grey
|
|
24
|
+
- black
|
|
25
|
+
transform: |
|
|
26
|
+
import opening_hours from "https://esm.sh/opening_hours";
|
|
27
|
+
export default (data) => {
|
|
28
|
+
data.features = data.features.map((f) => {
|
|
29
|
+
try {
|
|
30
|
+
const oh = new opening_hours(f.properties.opening_hours);
|
|
31
|
+
f.properties.open = oh.getStateString();
|
|
32
|
+
} catch {}
|
|
33
|
+
return f;
|
|
34
|
+
});
|
|
35
|
+
return data;
|
|
36
|
+
};
|
|
37
|
+
---
|
|
38
|
+
[out:json][bbox:{{bbox}}];
|
|
39
|
+
nwr[shop];
|
|
40
|
+
out center;
|
|
Binary file
|
package/docs/open-with-ultra.md
CHANGED
|
@@ -44,7 +44,7 @@ const code = () => {
|
|
|
44
44
|
);
|
|
45
45
|
}
|
|
46
46
|
window.location = `${origin}/#${search.toString()}`;
|
|
47
|
-
} else if (window.location.host === "qlever.cs.uni-freiburg.de") {
|
|
47
|
+
} else if (window.location.host === "qlever.cs.uni-freiburg.de" || window.location.host === "qlever.dev") {
|
|
48
48
|
const search = new URLSearchParams();
|
|
49
49
|
search.set("query", `---\ntype: sparql\nserver: https://qlever.cs.uni-freiburg.de/api/${document.querySelector("#backend-slug").textContent}\n---\n${document.querySelector(".CodeMirror").CodeMirror.getValue()}`);
|
|
50
50
|
window.location = `${origin}/#${search.toString()}`;
|
package/docs/yaml.md
CHANGED
|
@@ -75,6 +75,7 @@ Automatically detects and chooses the right query provider out of the following:
|
|
|
75
75
|
- `osmWiki`
|
|
76
76
|
- `taginfo`
|
|
77
77
|
- `dsv`
|
|
78
|
+
- `javascript`
|
|
78
79
|
|
|
79
80
|
See each provider for how it is auto-detected
|
|
80
81
|
|
|
@@ -268,6 +269,11 @@ results are modified to have the same structure as [overpass](#overpass)
|
|
|
268
269
|
API](https://github.com/woodpeck/postpass-ops) &
|
|
269
270
|
[Schema](https://github.com/woodpeck/postpass-ops/blob/main/SCHEMA.md)
|
|
270
271
|
|
|
272
|
+
### `javascript`
|
|
273
|
+
|
|
274
|
+
A javascript module that exports a `source` function (can be `async`) that returns a
|
|
275
|
+
[MapLibre source](https://maplibre.org/maplibre-style-spec/sources/) object.
|
|
276
|
+
|
|
271
277
|
## `options`
|
|
272
278
|
|
|
273
279
|
When an Ultra query is run in "interactive map" mode, you can specify the
|
|
@@ -15,7 +15,7 @@ export const popupTemplate = `
|
|
|
15
15
|
`;
|
|
16
16
|
|
|
17
17
|
const SOPHOX = "https://sophox.org/sparql";
|
|
18
|
-
const QLEVER_ROOT = "https://qlever.
|
|
18
|
+
const QLEVER_ROOT = "https://qlever.dev/api/";
|
|
19
19
|
|
|
20
20
|
const OSM_SERVERS = new Set([
|
|
21
21
|
new URL("osm-planet", QLEVER_ROOT).toString(),
|
package/package.json
CHANGED