@opensystemslab/map 1.0.0-alpha.5 → 1.0.0-alpha.7

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 CHANGED
@@ -2,26 +2,30 @@
2
2
 
3
3
  [![npm @opensystemslab/map](https://img.shields.io/npm/v/@opensystemslab/map?style=flat-square)](http://npm.im/@opensystemslab/map)
4
4
 
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/).
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://docs.os.uk/os-apis).
6
6
 
7
- ***Web map***
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
  ![chrome-capture-2022-7-16-map](https://user-images.githubusercontent.com/5132349/184860750-bf7514db-7cab-4f9c-aa32-791099ecd6cc.gif)
12
12
 
13
- ***Postcode search***
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
- ***Address autocomplete***
17
+ **_Address autocomplete_**
18
18
 
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.
19
+ `<address-autocomplete />` fetches addresses in a given UK postcode using the [OS Places API](https://docs.os.uk/os-apis/accessing-os-apis/os-places-api/technical-specification/postcode) 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
 
21
21
  These web components can be used independently or together following GOV.UK's [Address lookup](https://design-system.service.gov.uk/patterns/addresses/) design pattern.
22
22
 
23
23
  ![chrome-capture-2022-7-16 (1)](https://user-images.githubusercontent.com/5132349/184858819-133bc7fa-7f48-4a2a-a416-b612febcce58.gif)
24
24
 
25
+ **_Geocode autocomplete_**
26
+
27
+ `<geocode-autocomplete />` is a web component that provides an autocomplete input for searching locations using the [OS Places API](https://docs.os.uk/os-apis/accessing-os-apis/os-places-api/technical-specification/find). It displays likely matches in a dropdown. When a location is selected, it dispatches an event with the OS record.
28
+
25
29
  ## Documentation & examples
26
30
 
27
31
  - Interactive web component docs [oslmap.netlify.app](https://oslmap.netlify.app)
@@ -31,13 +35,14 @@ Find these components in the wild, including what we're learning through public
31
35
 
32
36
  ## Bring your own API keys
33
37
 
34
- Different features rely on different APIs - namely from Ordnance Survey and Mapbox.
38
+ Different features rely on different APIs - namely from Ordnance Survey and Mapbox.
35
39
 
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.
40
+ 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
41
 
38
42
  Address autocomplete utilises the OS Places API.
39
43
 
40
44
  For the map:
45
+
41
46
  - The `basemap` prop defaults to `"OSVectorTile"` which requires the OS Vector Tiles API
42
47
  - Basemap `"OSRaster"` uses the OS Maps API
43
48
  - Basemap `"MapboxSatellite"` requires a Mapbox Access Token with with scope `style:read`
@@ -45,9 +50,10 @@ For the map:
45
50
  - `clickFeatures` requires the OS Features API
46
51
 
47
52
  When using Ordnance Survey APIs:
53
+
48
54
  - Update the `osCopyright` attribution prop with your license number
49
55
  - Configure an optional `osProxyEndpoint` to avoid exposing your keys (set this instead of `osApiKey`)
50
- - ** We are not currently supporting a similar proxy for Mapbox because access tokens can be restricted to specific URLs via your account
56
+ - \*\* We are not currently supporting a similar proxy for Mapbox because access tokens can be restricted to specific URLs via your account
51
57
 
52
58
  ## Running locally
53
59
 
@@ -75,6 +81,7 @@ We use [Pitsby](https://pitsby.com/) for documenting our web components. It's si
75
81
  We publish this package via [NPM](https://www.npmjs.com/package/@opensystemslab/map).
76
82
 
77
83
  To create a new release:
84
+
78
85
  1. Open a new PR against `main` which bumps the package.json "version" & creates a CHANGELOG.md entry, request code review & merge on approval
79
86
  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)
80
87
  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)
@@ -1,6 +1,7 @@
1
- import { A as s, M as a, P as r } from "./index-B7jZERBa.mjs";
1
+ import { A as s, G as a, M as t, P as c } from "./index-9wQ1_2xo.mjs";
2
2
  export {
3
3
  s as AddressAutocomplete,
4
- a as MyMap,
5
- r as PostcodeSearch
4
+ a as GeocodeAutocomplete,
5
+ t as MyMap,
6
+ c as PostcodeSearch
6
7
  };