Skip to content

Commit a44a118

Browse files
committed
Merge branch 'develop' into feature/map-legend|OIT-477
2 parents fd5cff8 + 2276005 commit a44a118

File tree

203 files changed

+113599
-60929
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

203 files changed

+113599
-60929
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ node_modules
66
/.svelte-kit
77
/build
88
/dist
9+
/docs
910

1011
# OS
1112
.DS_Store

README.md

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,42 @@ npm install @communitiesuk/svelte-component-library@latest
3434
To ensure GOV.UK styles are applied correctly, add this script tag to your `app.html` file in the body section:
3535

3636
```html
37-
3837
<script>
39-
document.body.className +=
40-
" js-enabled" +
41-
("noModule" in HTMLScriptElement.prototype
42-
? " govuk-frontend-supported"
43-
: "");
38+
document.body.className +=
39+
" js-enabled" +
40+
("noModule" in HTMLScriptElement.prototype
41+
? " govuk-frontend-supported"
42+
: "");
4443
</script>
4544
```
4645

4746
This is required because the GOV.UK Frontend CSS checks the document body for JavaScript availability to progressively enhance components.
4847

48+
### GOV.UK Rebranded Styles (Optional)
49+
50+
To use the refreshed GOV.UK brand (launched June 2025), add the `govuk-template--rebranded` class to your `app.html` body element:
51+
52+
```html
53+
<body class="govuk-template--rebranded">
54+
<!-- Your app content -->
55+
</body>
56+
```
57+
58+
**When to use rebrand:**
59+
60+
- **Global CSS styles**: The `govuk-template--rebranded` class on `<body>` automatically applies rebranded styles to all components
61+
- **Component markup**: Some components (like Footer and Header) have a `rebrand` prop that controls whether they show additional rebranded markup elements (like the crown logo). The rebrand prop is set to true by default on all relavent componets - you can specify false should you want to keep the old markup and assets.
62+
- **Assets**: Rebranded components will use updated assets (logos, icons) from the `/assets/rebrand/` folder
63+
64+
**Example with rebranded Footer:**
65+
66+
```javascript
67+
import { Footer } from "@communitiesuk/svelte-component-library";
68+
69+
// Use rebrand=true to show the crown logo at top of footer
70+
<Footer rebrand={true} />;
71+
```
72+
4973
### Importing Components
5074

5175
Import components directly from the package:

docs/TilesMaking.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Introduction
2+
3+
This will guide on how to turn geojson to pdf tiles which can be used with the map conpomenet. These instrutions are for Mac OS
4+
5+
# Steps
6+
7+
1. Get valid geojson. It should looks something like this
8+
9+
```json
10+
{
11+
"type": "FeatureCollection",
12+
"features": [
13+
{
14+
"type": "Feature",
15+
"properties": { "name": "Sample Point" },
16+
"geometry": {
17+
"type": "Point",
18+
"coordinates": [-0.1257, 51.5085]
19+
}
20+
}
21+
]
22+
}
23+
```
24+
25+
At this stage geographic dataa can be added so it can be visulised without need futher external jsons. Hoever if you
26+
27+
2. Convert Geojson to .mbTiles
28+
29+
Install home brew
30+
31+
Install tippe cannoe
32+
33+
run tippe cannoe
34+
35+
3. Convert .mbTiles to .pbf
36+
37+
install mbtiles
38+
39+
```python
40+
pip install mbtiles
41+
```

docs/TilesServer.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Tile server
2+
3+
Set up tile-server to serve the tiles locally
4+
5+
Make a server.cjs file that looks like this:
6+
7+
```javascript
8+
const express = require("express");
9+
const path = require("path");
10+
const fs = require("fs");
11+
const mime = require("mime-types");
12+
const cors = require("cors");
13+
14+
const app = express();
15+
const PORT = 8080;
16+
const TILE_DIR = path.join(__dirname, "tiles-with-imd-data"); // your z/x/y.pbf folder
17+
18+
app.use(cors()); // Enables CORS for all routes
19+
20+
// Set correct headers for .pbf files
21+
app.get("/:z/:x/:y.pbf", (req, res) => {
22+
const { z, x, y } = req.params;
23+
const tilePath = path.join(TILE_DIR, z, x, `${y}.pbf`);
24+
25+
if (!fs.existsSync(tilePath)) {
26+
return res.status(404).send("Tile not found");
27+
}
28+
res.setHeader("Access-Control-Allow-Origin", "*");
29+
res.setHeader("Content-Type", "application/x-protobuf");
30+
res.setHeader("Content-Encoding", "gzip");
31+
32+
fs.createReadStream(tilePath).pipe(res);
33+
});
34+
35+
// Optional: serve an index or static frontend here
36+
37+
app.listen(PORT, () => {
38+
console.log(`Tile server running at http://localhost:${PORT}/`);
39+
});
40+
```
41+
42+
Then from the terminal run:
43+
44+
```console
45+
node server.cjs
46+
```

0 commit comments

Comments
 (0)