@opensystemslab/map 1.0.0-alpha.4 → 1.0.0-alpha.6
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/README.md +18 -6
- package/dist/component-lib.es.js +1 -1
- package/dist/component-lib.umd.js +141 -152
- package/dist/{html2canvas.esm-d2sM-0Wm.mjs → html2canvas.esm-DgdJBc_o.mjs} +1 -0
- package/dist/{index-0AQlXt5x.mjs → index-D01mRj0Z.mjs} +48073 -44477
- package/dist/index.es-DVcWaq6t.mjs +6636 -0
- package/dist/index.html +108 -111
- package/dist/map.css +1 -0
- package/dist/purify.es-DHbHSKL1.mjs +528 -0
- package/package.json +22 -20
- package/types/components/address-autocomplete/index.d.ts +1 -1
- package/types/components/my-map/drawing.d.ts +1 -1
- package/types/components/my-map/index.d.ts +4 -6
- package/types/components/my-map/layers.d.ts +3 -1
- package/types/components/my-map/os-features.d.ts +1 -1
- package/types/components/my-map/snapping.d.ts +4 -2
- package/dist/index.es-BSUWcQGl.mjs +0 -5614
- package/dist/purify.es-B7BPtUgm.mjs +0 -471
- package/dist/style.css +0 -1
package/README.md
CHANGED
@@ -4,17 +4,17 @@
|
|
4
4
|
|
5
5
|
A library of [Web Components](https://developer.mozilla.org/en-US/docs/Web/Web_Components) for tasks related to addresses and planning permission in the UK built with [Lit](https://lit.dev/), [Vite](https://vitejs.dev/), and [Ordnance Survey APIs](https://developer.ordnancesurvey.co.uk/).
|
6
6
|
|
7
|
-
|
7
|
+
**_Web map_**
|
8
8
|
|
9
9
|
`<my-map />` is an [OpenLayers](https://openlayers.org/)-powered map to support drawing and modifying red-line boundaries. Other supported modes include: highlighting an OS Feature that intersects with a given address point; clicking to select and merge multiple OS Features into a single boundary; and displaying static point or polygon data. Events are dispatched with the calculated area and geojson representation when you change your drawing.
|
10
10
|
|
11
11
|

|
12
12
|
|
13
|
-
|
13
|
+
**_Postcode search_**
|
14
14
|
|
15
15
|
`<postcode-search />` is a [GOV.UK-styled](https://frontend.design-system.service.gov.uk/) input that validates UK postcodes using these [utility methods](https://www.npmjs.com/package/postcode). When a postcode is validated, an event is dispatched containing the sanitized string.
|
16
16
|
|
17
|
-
|
17
|
+
**_Address autocomplete_**
|
18
18
|
|
19
19
|
`<address-autocomplete />` fetches addresses in a given UK postcode using the [OS Places API](https://developer.ordnancesurvey.co.uk/os-places-api) and displays them using GOV.UK's [accessible-autocomplete](https://github.com/alphagov/accessible-autocomplete) component. An event is dispatched with the OS record when you select an address.
|
20
20
|
|
@@ -31,13 +31,14 @@ Find these components in the wild, including what we're learning through public
|
|
31
31
|
|
32
32
|
## Bring your own API keys
|
33
33
|
|
34
|
-
Different features rely on different APIs - namely from Ordnance Survey and Mapbox.
|
34
|
+
Different features rely on different APIs - namely from Ordnance Survey and Mapbox.
|
35
35
|
|
36
|
-
You can set keys directly as props (eg `osApiKey`) on the applicable web components or
|
36
|
+
You can set keys directly as props (eg `osApiKey`) on the applicable web components or [use a proxy](https://github.com/theopensystemslab/map/blob/main/docs/how-to-use-a-proxy.md) to mask these secrets.
|
37
37
|
|
38
38
|
Address autocomplete utilises the OS Places API.
|
39
39
|
|
40
40
|
For the map:
|
41
|
+
|
41
42
|
- The `basemap` prop defaults to `"OSVectorTile"` which requires the OS Vector Tiles API
|
42
43
|
- Basemap `"OSRaster"` uses the OS Maps API
|
43
44
|
- Basemap `"MapboxSatellite"` requires a Mapbox Access Token with with scope `style:read`
|
@@ -45,9 +46,10 @@ For the map:
|
|
45
46
|
- `clickFeatures` requires the OS Features API
|
46
47
|
|
47
48
|
When using Ordnance Survey APIs:
|
49
|
+
|
48
50
|
- Update the `osCopyright` attribution prop with your license number
|
49
51
|
- Configure an optional `osProxyEndpoint` to avoid exposing your keys (set this instead of `osApiKey`)
|
50
|
-
-
|
52
|
+
- \*\* We are not currently supporting a similar proxy for Mapbox because access tokens can be restricted to specific URLs via your account
|
51
53
|
|
52
54
|
## Running locally
|
53
55
|
|
@@ -70,6 +72,16 @@ We use [Pitsby](https://pitsby.com/) for documenting our web components. It's si
|
|
70
72
|
- `pnpm run docs` starts Pitsby in watch mode for local development
|
71
73
|
- `pnpm run docsPublish` builds the site so Netlify can serve it from `pitsby/`
|
72
74
|
|
75
|
+
### Deployments
|
76
|
+
|
77
|
+
We publish this package via [NPM](https://www.npmjs.com/package/@opensystemslab/map).
|
78
|
+
|
79
|
+
To create a new release:
|
80
|
+
|
81
|
+
1. Open a new PR against `main` which bumps the package.json "version" & creates a CHANGELOG.md entry, request code review & merge on approval
|
82
|
+
1. Run `npm publish` or `npm publish --tag next` if making a pre-release (requires permissions to OSL team in NPM & access to 2-factor auth method)
|
83
|
+
1. [Draft a new release](https://github.com/theopensystemslab/map/releases) via GitHub web: tag should match version, automatically generate changenotes and link above PR, then "Publish" and set as latest version (or set as pre-release if you used `--tag next` in above command)
|
84
|
+
|
73
85
|
## License
|
74
86
|
|
75
87
|
This repository is licensed under the [Open Government License v3](http://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/).
|
package/dist/component-lib.es.js
CHANGED