@trailstash/ultra 6.1.1 → 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/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
|
package/package.json
CHANGED