Skip to content

Commit d57a1d6

Browse files
author
Martin Clarke
committed
Update theme example and docs
1 parent 214b4e7 commit d57a1d6

3 files changed

Lines changed: 57 additions & 65 deletions

File tree

SETUP.md

Lines changed: 17 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -75,50 +75,17 @@ are described below:
7575
| mapConfig | Defines the font-awesome-icon and colour | Used by leaflet as the feature marker |
7676

7777

78-
79-
80-
Example theme:
78+
Example theme
8179

8280
```javascript
8381

84-
const school = {
85-
Name: "schools",
86-
Title: "Example theme - Schools",
87-
Description: "An example OpenStreetMap theme, showing the location of schools.",
88-
Author: "Martin Clarke",
89-
AttributeTags: [],
90-
overpassQuery: `[out:json];\
91-
(way["amenity"~"(school)$"](around:5000,56.0019,-3.7893);\
92-
relation["amenity"~"(school)$"](around:5000,56.0019,-3.7893);\
93-
node["amenity"~"(school)$"](around:5000,56.0019,-3.7893););\
94-
out body;>;out skel qt;`,
95-
mapConfig: {
96-
mapIcon: "school",
97-
color: "blue"
98-
}
99-
};
100-
101-
export {
102-
school
103-
};
104-
105-
```
106-
107-
Example theme 2 - A more complicated theme example, with a defined list of AttributeTags
108-
109-
```javascript
110-
111-
let digiAccess = {
82+
const digiAccess = {
11283
Name: "digitalAccess",
11384
Title: "Digital Access",
114-
Headline: "Shows locations of places that provides access to digital Services",
115-
Description: "This theme shows locations that provide access to digital services. These include access to " +
85+
Headline: "Shows community locations that provides access to digital Services",
86+
Description: "This theme shows community locations that provide access to digital services. These include access to " +
11687
"printing facilities, access to computers for public use and Wifi / internet access",
11788
Author: "MartinClarke",
118-
OSMFeatures: ["ways", "nodes"],
119-
GeoTags: {
120-
"amenity": ["library", "community_centre"]
121-
},
12289
AttributeTags: [
12390
{ attributeName: "Internet Access",
12491
attributeTag: "internet_access",
@@ -180,8 +147,21 @@ AttributeTags: [
180147

181148
For more information on OSM tags and usage see [taginfo](https://taginfo.openstreetmap.org/)
182149

150+
The options for the AttributeTags definition is summarised below:
151+
152+
| Option | Description | Usage |
153+
| ------------- |:-------------| :-----|
154+
| attributeName | The name of the attribute | Attribute name is displayed in the feature popup |
155+
| attributeTag | The OpenStreetMap tag that describes the attribute | Used by the popup code to determine if attribute is displayed |
156+
| attributeValues | The OpenStreetMap values expected for the attributeTag | Used by the popup code to determine if attribute is displayed |
157+
| icon | The font-awesome icon to use for the attribute | Used by a popup of feature information |
158+
| iconColor | Defines color of the attribute icon | |
159+
160+
183161
## More on Overpass Queries
184162

185163
The query defined in the theme config is in OverPass QL format. This query language allows for a wide variety of
186164
query definitions. A comprehensive overview is given on this [OSM wiki](https://wiki.openstreetmap.org/wiki/Overpass_API/Overpass_QL)
187165

166+
# Other Customisation
167+
Individual css files for the various application components are stored along the component in the src/components folder.

src/config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { school, digiAccess } from "./themes/example";
1+
import { helpAdvice, digiAccess } from "./themes/example";
22

33
/* App config.
44
mapConfig stores options for Leaflet maps. tileLayer defines the provider
@@ -37,7 +37,7 @@ const mapConfig = {
3737
}
3838
};
3939

40-
const appThemes = [school, digiAccess];
40+
const appThemes = [helpAdvice, digiAccess];
4141

4242
export {
4343
mapConfig, appThemes, appConfig

src/themes/example.js

Lines changed: 38 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,51 @@
1-
const school = {
2-
Name: "schools",
3-
Title: "Example theme - Schools",
4-
Headline: "Shows locations of schools",
5-
Description: "An example OpenStreetMap theme, showing the location of schools.",
6-
Author: "Martin Clarke",
1+
const helpAdvice = {
2+
Name: "helpAdvice",
3+
Title: "Example Theme - Community Information and Advice ",
4+
Headline: "Shows locations of places where advice is provided",
5+
Description: "Shows community based help and advice offices",
6+
Author: "MartinClarke",
77
AttributeTags: [
8-
{ attributeName: "Internet Access",
9-
attributeTag: "internet_access",
10-
attributeValues: ["wlan", "yes", "terminal", "wifi", "service"],
11-
icon: "wifi"
12-
}
13-
],
8+
{ attributeName: "Citizens Advice",
9+
attributeTag: "social_facility",
10+
attributeValues: ["citizens_advice"],
11+
icon: "hands-helping"
12+
},
13+
{
14+
attributeName: "Financial Support",
15+
attributeTag: "social_facility",
16+
attributeValues: ["financial_services"],
17+
icon: "hands-helping"
18+
},
19+
{
20+
attributeName: "Family Support & Social Advice",
21+
attributeTag: "social_facility",
22+
attributeValues: ["advice_service"],
23+
icon: "users"
24+
},
25+
{
26+
attributeName: "Mental Health Support",
27+
attributeTag: "healthcare",
28+
attributeValues: ["mental_health"],
29+
icon:"hands-helping"
30+
},
31+
],
1432
overpassQuery: `[out:json];\
15-
(way["amenity"~"(school)$"](around:5000,56.0019,-3.7893);\
16-
relation["amenity"~"(school)$"](around:5000,56.0019,-3.7893);\
17-
node["amenity"~"(school)$"](around:5000,56.0019,-3.7893););\
33+
(way["amenity"="social_facility"][~"^(healthcare|social_facility)$"~"(financial_services|advice_service|mental_health|citizens_advice)$"](around:20000,56.0019,-3.7893);\
34+
node["amenity"="social_facility"][~"^(healthcare|social_facility)$"~"(financial_services|advice_service|mental_health|citizens_advice)$"](around:20000,56.0019,-3.7893););\
1835
out body;>;out skel qt;`,
1936
mapConfig: {
20-
mapIcon: "school",
21-
color: "blue"
37+
mapIcon: "hands-helping",
38+
color: "darkblue"
2239
}
2340
};
2441

25-
2642
const digiAccess = {
2743
Name: "digitalAccess",
28-
Title: "Digital Access",
29-
Headline: "Shows locations of places that provides access to digital Services",
30-
Description: "This theme shows locations that provide access to digital services. These include access to " +
44+
Title: "Example theme - Community Digital Access",
45+
Headline: "Shows community locations that provides access to digital Services",
46+
Description: "This theme shows community locations that provide access to digital services. These include access to " +
3147
"printing facilities, access to computers for public use and Wifi / internet access",
3248
Author: "MartinClarke",
33-
OSMFeatures: ["ways", "relations", "nodes"],
34-
GeoTags: {
35-
"amenity": ["library", "community_centre"]
36-
},
3749
AttributeTags: [
3850
{ attributeName: "Internet Access",
3951
attributeTag: "internet_access",
@@ -69,5 +81,5 @@ const digiAccess = {
6981
};
7082

7183
export {
72-
school, digiAccess
84+
helpAdvice, digiAccess
7385
};

0 commit comments

Comments
 (0)