@defra/forms-engine-plugin 4.14.4 → 4.16.0

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.
Files changed (56) hide show
  1. package/.public/assets-manifest.json +10 -1
  2. package/.public/javascripts/im-search-plugin.min.js +2 -0
  3. package/.public/javascripts/im-search-plugin.min.js.map +1 -0
  4. package/.public/javascripts/shared.min.js +1 -1
  5. package/.public/javascripts/shared.min.js.map +1 -1
  6. package/.public/javascripts/vendor/@defra.min.js +2 -0
  7. package/.public/javascripts/vendor/@defra.min.js.map +1 -0
  8. package/.public/javascripts/vendor/maplibre-gl.min.js +3 -0
  9. package/.public/javascripts/vendor/maplibre-gl.min.js.LICENSE.txt +4 -0
  10. package/.public/javascripts/vendor/maplibre-gl.min.js.map +1 -0
  11. package/.public/javascripts/vendor/preact.min.js +2 -0
  12. package/.public/javascripts/vendor/preact.min.js.map +1 -0
  13. package/.public/stylesheets/application.min.css +1 -1
  14. package/.public/stylesheets/application.min.css.map +1 -1
  15. package/.server/client/javascripts/geospatial-map.js +9 -4
  16. package/.server/client/javascripts/geospatial-map.js.map +1 -1
  17. package/.server/client/javascripts/map.js +18 -12
  18. package/.server/client/javascripts/map.js.map +1 -1
  19. package/.server/client/stylesheets/_prose.scss +19 -0
  20. package/.server/client/stylesheets/shared.scss +7 -0
  21. package/.server/server/forms/simple-form.yaml +19 -0
  22. package/.server/server/plugins/engine/components/NotificationBanner.d.ts +56 -0
  23. package/.server/server/plugins/engine/components/NotificationBanner.js +28 -0
  24. package/.server/server/plugins/engine/components/NotificationBanner.js.map +1 -0
  25. package/.server/server/plugins/engine/components/helpers/components.d.ts +1 -1
  26. package/.server/server/plugins/engine/components/helpers/components.js +3 -0
  27. package/.server/server/plugins/engine/components/helpers/components.js.map +1 -1
  28. package/.server/server/plugins/engine/components/index.d.ts +1 -0
  29. package/.server/server/plugins/engine/components/index.js +1 -0
  30. package/.server/server/plugins/engine/components/index.js.map +1 -1
  31. package/.server/server/plugins/engine/views/components/notificationbanner.html +15 -0
  32. package/.server/server/plugins/map/routes/index.d.ts +1 -2
  33. package/.server/server/plugins/map/routes/index.js +2 -32
  34. package/.server/server/plugins/map/routes/index.js.map +1 -1
  35. package/.server/server/plugins/map/service.d.ts +0 -7
  36. package/.server/server/plugins/map/service.js +0 -12
  37. package/.server/server/plugins/map/service.js.map +1 -1
  38. package/.server/server/plugins/map/service.test.js +0 -43
  39. package/.server/server/plugins/map/service.test.js.map +1 -1
  40. package/.server/server/plugins/nunjucks/filters/field.d.ts +1 -1
  41. package/package.json +2 -1
  42. package/src/client/javascripts/geospatial-map.js +9 -5
  43. package/src/client/javascripts/map.js +18 -13
  44. package/src/client/stylesheets/_prose.scss +19 -0
  45. package/src/client/stylesheets/shared.scss +7 -0
  46. package/src/server/forms/simple-form.yaml +19 -0
  47. package/src/server/plugins/engine/components/NotificationBanner.ts +32 -0
  48. package/src/server/plugins/engine/components/helpers/components.ts +5 -0
  49. package/src/server/plugins/engine/components/index.ts +1 -0
  50. package/src/server/plugins/engine/views/components/notificationbanner.html +15 -0
  51. package/src/server/plugins/map/routes/index.js +1 -37
  52. package/src/server/plugins/map/service.js +0 -13
  53. package/.server/server/plugins/map/test/__stubs__/nearest.d.ts +0 -37
  54. package/.server/server/plugins/map/test/__stubs__/nearest.js +0 -38
  55. package/.server/server/plugins/map/test/__stubs__/nearest.js.map +0 -1
  56. package/src/server/plugins/map/test/__stubs__/nearest.js +0 -46
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defra/forms-engine-plugin",
3
- "version": "4.14.4",
3
+ "version": "4.16.0",
4
4
  "description": "Defra forms engine",
5
5
  "type": "module",
6
6
  "files": [
@@ -130,6 +130,7 @@
130
130
  "joi": "^17.13.3",
131
131
  "liquidjs": "^10.24.0",
132
132
  "lodash": "^4.17.21",
133
+ "maplibre-gl": "^5.24.0",
133
134
  "marked": "^15.0.12",
134
135
  "nunjucks": "^3.2.4",
135
136
  "obscenity": "^0.4.5",
@@ -1,3 +1,9 @@
1
+ // @ts-expect-error - no types
2
+ import createDatasetsPlugin from '@defra/interactive-map/plugins/datasets'
3
+ // @ts-expect-error - no types
4
+ import { maplibreLayerAdapter } from '@defra/interactive-map/plugins/datasets/adapters/maplibre'
5
+ // @ts-expect-error - no types
6
+ import createDrawPlugin from '@defra/interactive-map/plugins/draw-ml'
1
7
  import { bbox } from '@turf/bbox'
2
8
 
3
9
  import {
@@ -151,9 +157,6 @@ export function getBoundingBox(geojson) {
151
157
  * @param {number} index - the 0-based index
152
158
  */
153
159
  export function processGeospatial(config, geospatial, index) {
154
- // @ts-expect-error - Defra namespace currently comes from UMD support files
155
- const defra = window.defra
156
-
157
160
  if (!(geospatial instanceof HTMLDivElement)) {
158
161
  return
159
162
  }
@@ -166,14 +169,15 @@ export function processGeospatial(config, geospatial, index) {
166
169
  const { listEl, mapId } = createContainers(geospatialInput, index)
167
170
  const geojson = getGeoJSON(geospatialInput)
168
171
  const bounds = geojson.features.length ? getBoundingBox(geojson) : undefined
169
- const drawPlugin = defra.drawMLPlugin()
172
+ const drawPlugin = createDrawPlugin()
170
173
  const plugins = [drawPlugin]
171
174
  const country = geospatial.dataset.country
172
175
 
173
176
  if (country) {
174
177
  // Add the country bounds as a dataset plugin to show the valid area on the map
175
178
  // and provide feedback to the user when they add features outside of the bounds.
176
- const datasetsPlugin = defra.datasetsMaplibrePlugin({
179
+ const datasetsPlugin = createDatasetsPlugin({
180
+ layerAdapter: maplibreLayerAdapter,
177
181
  datasets: [
178
182
  {
179
183
  id: 'invalid-area',
@@ -1,3 +1,15 @@
1
+ // @ts-expect-error - no types
2
+ import InteractiveMap from '@defra/interactive-map'
3
+ // @ts-expect-error - no types
4
+ import createInteractPlugin from '@defra/interactive-map/plugins/interact'
5
+ // @ts-expect-error - no types
6
+ import createMapStylesPlugin from '@defra/interactive-map/plugins/map-styles'
7
+ // @ts-expect-error - no types
8
+ import createScaleBarPlugin from '@defra/interactive-map/plugins/scale-bar'
9
+ // @ts-expect-error - no types
10
+ import createSearchPlugin from '@defra/interactive-map/plugins/search'
11
+ // @ts-expect-error - no types
12
+ import maplibreProvider from '@defra/interactive-map/providers/maplibre'
1
13
  import { centroid } from '@turf/centroid'
2
14
  // @ts-expect-error - no types
3
15
  import OsGridRef, { LatLon } from 'geodesy/osgridref.js'
@@ -249,24 +261,17 @@ export function makeTileRequestTransformer(apiPath) {
249
261
  export function createMap(mapId, initConfig, mapsConfig) {
250
262
  const { assetPath, apiPath, data = defaultData } = mapsConfig
251
263
  const logoAltText = 'Ordnance survey logo'
252
-
253
- // @ts-expect-error - Defra namespace currently comes from UMD support files
254
- const defra = window.defra
255
-
256
- const interactPlugin = defra.interactPlugin({
264
+ const interactPlugin = createInteractPlugin({
257
265
  markerColor: { outdoor: '#ff0000', dark: '#00ff00' },
258
266
  interactionModes: ['placeMarker'],
259
267
  multiSelect: false
260
268
  })
261
269
 
262
270
  /** @type {InteractiveMap} */
263
- const map = new defra.InteractiveMap(mapId, {
271
+ const map = new InteractiveMap(mapId, {
264
272
  enableFullscreen: true,
265
273
  autoColorScheme: false,
266
- mapProvider: defra.maplibreProvider(),
267
- reverseGeocodeProvider: defra.openNamesProvider({
268
- url: `${apiPath}/reverse-geocode-proxy?easting={easting}&northing={northing}`
269
- }),
274
+ mapProvider: maplibreProvider(),
270
275
  behaviour: 'inline',
271
276
  minZoom: 6,
272
277
  maxZoom: 18,
@@ -275,7 +280,7 @@ export function createMap(mapId, initConfig, mapsConfig) {
275
280
  transformRequest: makeTileRequestTransformer(apiPath),
276
281
  ...initConfig,
277
282
  plugins: [
278
- defra.mapStylesPlugin({
283
+ createMapStylesPlugin({
279
284
  mapStyles: [
280
285
  {
281
286
  id: 'outdoor',
@@ -319,12 +324,12 @@ export function createMap(mapId, initConfig, mapsConfig) {
319
324
  ]
320
325
  }),
321
326
  interactPlugin,
322
- defra.searchPlugin({
327
+ createSearchPlugin({
323
328
  osNamesURL: `${apiPath}/geocode-proxy?query={query}`,
324
329
  width: '300px',
325
330
  showMarker: false
326
331
  }),
327
- defra.scaleBarPlugin({
332
+ createScaleBarPlugin({
328
333
  units: 'metric'
329
334
  }),
330
335
  ...(initConfig.plugins ?? [])
@@ -54,3 +54,22 @@
54
54
  @extend %govuk-section-break--xl;
55
55
  }
56
56
  }
57
+
58
+ .govuk-notification-banner__content {
59
+ .app-prose-scope > :last-child {
60
+ margin-bottom: 0;
61
+ }
62
+ }
63
+
64
+ // GOV.UK Frontend does not expose placeholder selectors for these — class selectors are the only option.
65
+ .app-prose-notification-banner-scope {
66
+ p {
67
+ // stylelint-disable-next-line scss/at-extend-no-missing-placeholder
68
+ @extend .govuk-notification-banner__heading;
69
+ }
70
+
71
+ a {
72
+ // stylelint-disable-next-line scss/at-extend-no-missing-placeholder
73
+ @extend .govuk-notification-banner__link;
74
+ }
75
+ }
@@ -4,6 +4,13 @@
4
4
  @use "summary-list";
5
5
  @use "location-fields";
6
6
 
7
+ @use "@defra/interactive-map/css" as core;
8
+ @use "@defra/interactive-map/plugins/interact/css" as interact;
9
+ @use "@defra/interactive-map/plugins/map-styles/css" as mapStyles;
10
+ @use "@defra/interactive-map/plugins/search/css" as search;
11
+ @use "@defra/interactive-map/plugins/scale-bar/css" as scaleBar;
12
+ @use "@defra/interactive-map/plugins/draw-ml/css" as drawMl;
13
+
7
14
  // Use default GDS Transport font for autocomplete
8
15
  .autocomplete__hint,
9
16
  .autocomplete__input,
@@ -78,6 +78,25 @@ pages:
78
78
  id: '00738799-3489-4ab2-a57b-542eecb31bfa'
79
79
  next: []
80
80
  id: da0fbdb4-a2de-4650-be16-9ba552af135f
81
+ - title: ''
82
+ path: '/notification-demo'
83
+ components:
84
+ - type: NotificationBanner
85
+ title: Important
86
+ name: notificationImportant
87
+ content: 'Contact us if you need [help with your application](https://www.defra.gov.uk).'
88
+ options:
89
+ heading: There may be a delay in processing your application.
90
+ id: ca6b6590-1608-49f4-82f9-9d92e38e66ea
91
+ - type: NotificationBanner
92
+ title: Success
93
+ name: notificationSuccess
94
+ content: 'Your application has been submitted.'
95
+ options:
96
+ type: success
97
+ id: b6960f4b-d771-4956-9c9b-17da5c603062
98
+ next: []
99
+ id: be4b4b86-514c-43bb-8cdc-f9aed6155924
81
100
  - id: 449a45f6-4541-4a46-91bd-8b8931b07b50
82
101
  title: ''
83
102
  path: '/summary'
@@ -0,0 +1,32 @@
1
+ import { type NotificationBannerComponent } from '@defra/forms-model'
2
+
3
+ import { ComponentBase } from './ComponentBase.js'
4
+
5
+ export class NotificationBanner extends ComponentBase {
6
+ declare options: NotificationBannerComponent['options']
7
+ content: NotificationBannerComponent['content']
8
+
9
+ constructor(
10
+ def: NotificationBannerComponent,
11
+ props: ConstructorParameters<typeof ComponentBase>[1]
12
+ ) {
13
+ super(def, props)
14
+
15
+ const { content, options } = def
16
+
17
+ this.content = content
18
+ this.options = options
19
+ }
20
+
21
+ getViewModel() {
22
+ const { content, title, viewModel } = this
23
+
24
+ return {
25
+ ...viewModel,
26
+ titleHtml: title,
27
+ content,
28
+ heading: this.options.heading,
29
+ type: this.options.type
30
+ }
31
+ }
32
+ }
@@ -46,6 +46,7 @@ export type Guidance =
46
46
  | InstanceType<typeof Components.Markdown>
47
47
  | InstanceType<typeof Components.InsetText>
48
48
  | InstanceType<typeof Components.List>
49
+ | InstanceType<typeof Components.NotificationBanner>
49
50
 
50
51
  // List component instances only
51
52
  export type ListField = InstanceType<
@@ -134,6 +135,10 @@ export function createComponent(
134
135
  component = new Components.Markdown(def, options)
135
136
  break
136
137
 
138
+ case ComponentType.NotificationBanner:
139
+ component = new Components.NotificationBanner(def, options)
140
+ break
141
+
137
142
  case ComponentType.MultilineTextField:
138
143
  component = new Components.MultilineTextField(def, options)
139
144
  break
@@ -15,6 +15,7 @@ export { Html } from './Html.js'
15
15
  export { InsetText } from './InsetText.js'
16
16
  export { List } from './List.js'
17
17
  export { Markdown } from './Markdown.js'
18
+ export { NotificationBanner } from './NotificationBanner.js'
18
19
  export { MonthYearField } from './MonthYearField.js'
19
20
  export { MultilineTextField } from './MultilineTextField.js'
20
21
  export { NumberField } from './NumberField.js'
@@ -0,0 +1,15 @@
1
+ {% from "govuk/components/notification-banner/macro.njk" import govukNotificationBanner %}
2
+
3
+ {% macro NotificationBanner(component) %}
4
+ {%- set bannerHtml -%}
5
+ {%- if component.model.heading -%}
6
+ <div class="app-prose-notification-banner-scope">{{ component.model.heading | markdown | safe }}</div>
7
+ {%- endif -%}
8
+ <div class="app-prose-scope">{{ component.model.content | markdown | safe }}</div>
9
+ {%- endset -%}
10
+ {{ govukNotificationBanner({
11
+ titleHtml: component.model.titleHtml,
12
+ html: bannerHtml,
13
+ type: component.model.type
14
+ }) }}
15
+ {% endmacro %}
@@ -6,7 +6,7 @@ import { StatusCodes } from 'http-status-codes'
6
6
  import Joi from 'joi'
7
7
 
8
8
  import { getAccessToken } from './get-os-token.js'
9
- import { find, nearest } from '../service.js'
9
+ import { find } from '../service.js'
10
10
  import {
11
11
  get,
12
12
  request as httpRequest
@@ -34,7 +34,6 @@ export function getRoutes(options) {
34
34
  mapProxyRoute(options),
35
35
  tileProxyRoute(options),
36
36
  geocodeProxyRoute(options),
37
- reverseGeocodeProxyRoute(options),
38
37
  getGeospatialCountries()
39
38
  ]
40
39
  }
@@ -156,41 +155,6 @@ function geocodeProxyRoute(options) {
156
155
  }
157
156
  }
158
157
 
159
- /**
160
- * Proxies ordnance survey reverse geocode requests from the front end to api.os.uk
161
- * Used to find name from easting and northing points.
162
- * N.B this endpoint is currently not used by the front end but will be soon in "maps V2"
163
- * @param {MapConfiguration} options - the map options
164
- * @returns {ServerRoute<MapReverseGeocodeGetRequestRefs>}
165
- */
166
- function reverseGeocodeProxyRoute(options) {
167
- return {
168
- method: 'GET',
169
- path: '/api/reverse-geocode-proxy',
170
- async handler(request, _h) {
171
- const { query } = request
172
- const data = await nearest(
173
- query.easting,
174
- query.northing,
175
- options.ordnanceSurveyApiKey
176
- )
177
-
178
- return data
179
- },
180
- options: {
181
- auth: false,
182
- validate: {
183
- query: Joi.object()
184
- .keys({
185
- easting: Joi.number().required(),
186
- northing: Joi.number().required()
187
- })
188
- .required()
189
- }
190
- }
191
- }
192
- }
193
-
194
158
  /**
195
159
  * Resource routes to return sprites and glyphs
196
160
  * @returns {ServerRoute<MapProxyGetRequestRefs>}
@@ -67,19 +67,6 @@ export async function find(query, apiKey) {
67
67
  return getData(url, endpoint)
68
68
  }
69
69
 
70
- /**
71
- * OS names search nearest by E/N
72
- * @param {number} easting - the easting
73
- * @param {number} northing - the northing
74
- * @param {string} apiKey - the OS api key
75
- */
76
- export async function nearest(easting, northing, apiKey) {
77
- const endpoint = 'nearest'
78
- const url = `https://api.os.uk/search/names/v1/nearest?key=${apiKey}&point=${easting},${northing}&radius=1000&fq=local_type:Airfield%20local_type:Airport%20local_type:Bus_Station%20local_type:Chemical_Works%20local_type:City%20local_type:Coach_Station%20local_type:Electricity_Distribution%20local_type:Electricity_Production%20local_type:Further_Education%20local_type:Gas_Distribution_or_Storage%20local_type:Hamlet%20local_type:Harbour%20local_type:Helicopter_Station%20local_type:Heliport%20local_type:Higher_or_University_Education%20local_type:Hill_Or_Mountain%20local_type:Hospice%20local_type:Hospital%20local_type:Medical_Care_Accommodation%20local_type:Named_Road%20local_type:Non_State_Primary_Education%20local_type:Non_State_Secondary_Education%20local_type:Other_Settlement%20local_type:Passenger_Ferry_Terminal%20local_type:Port_Consisting_of_Docks_and_Nautical_Berthing%20local_type:Postcode%20local_type:Primary_Education%20local_type:Railway_Station%20local_type:Road_User_Services%20local_type:Secondary_Education%20local_type:Section_Of_Named_Road%20local_type:Section_Of_Numbered_Road%20local_type:Special_Needs_Education%20local_type:Suburban_Area%20local_type:Town%20local_type:Urban_Greenspace%20local_type:Vehicular_Ferry_Terminal%20local_type:Vehicular_Rail_Terminal%20local_type:Village%20local_type:Waterfall%20`
79
-
80
- return getData(url, endpoint)
81
- }
82
-
83
70
  /**
84
71
  * @import { OsNamesFindResponse, OsNamesFindResult } from './types.js'
85
72
  */
@@ -1,37 +0,0 @@
1
- export namespace result {
2
- namespace header {
3
- let uri: string;
4
- let query: string;
5
- let format: string;
6
- let maxresults: number;
7
- let offset: number;
8
- let totalresults: number;
9
- let filter: string;
10
- }
11
- let results: {
12
- GAZETTEER_ENTRY: {
13
- ID: string;
14
- NAMES_URI: string;
15
- NAME1: string;
16
- TYPE: string;
17
- LOCAL_TYPE: string;
18
- GEOMETRY_X: number;
19
- GEOMETRY_Y: number;
20
- MOST_DETAIL_VIEW_RES: number;
21
- LEAST_DETAIL_VIEW_RES: number;
22
- POPULATED_PLACE: string;
23
- POPULATED_PLACE_URI: string;
24
- POPULATED_PLACE_TYPE: string;
25
- DISTRICT_BOROUGH: string;
26
- DISTRICT_BOROUGH_URI: string;
27
- DISTRICT_BOROUGH_TYPE: string;
28
- COUNTY_UNITARY: string;
29
- COUNTY_UNITARY_URI: string;
30
- COUNTY_UNITARY_TYPE: string;
31
- REGION: string;
32
- REGION_URI: string;
33
- COUNTRY: string;
34
- COUNTRY_URI: string;
35
- };
36
- }[];
37
- }
@@ -1,38 +0,0 @@
1
- export const result = {
2
- header: {
3
- uri: 'https://api.os.uk/search/names/v1/nearest?point=523065%2C185795&radius=1000&fq=local_type%3AAirfield%20local_type%3AAirport%20local_type%3ABus_Station%20local_type%3AChemical_Works%20local_type%3ACity%20local_type%3ACoach_Station%20local_type%3AElectricity_Distribution%20local_type%3AElectricity_Production%20local_type%3AFurther_Education%20local_type%3AGas_Distribution_or_Storage%20local_type%3AHamlet%20local_type%3AHarbour%20local_type%3AHelicopter_Station%20local_type%3AHeliport%20local_type%3AHigher_or_University_Education%20local_type%3AHill_Or_Mountain%20local_type%3AHospice%20local_type%3AHospital%20local_type%3AMedical_Care_Accommodation%20local_type%3ANamed_Road%20local_type%3ANon_State_Primary_Education%20local_type%3ANon_State_Secondary_Education%20local_type%3AOther_Settlement%20local_type%3APassenger_Ferry_Terminal%20local_type%3APort_Consisting_of_Docks_and_Nautical_Berthing%20local_type%3APostcode%20local_type%3APrimary_Education%20local_type%3ARailway_Station%20local_type%3ARoad_User_Services%20local_type%3ASecondary_Education%20local_type%3ASection_Of_Named_Road%20local_type%3ASection_Of_Numbered_Road%20local_type%3ASpecial_Needs_Education%20local_type%3ASuburban_Area%20local_type%3ATown%20local_type%3AUrban_Greenspace%20local_type%3AVehicular_Ferry_Terminal%20local_type%3AVehicular_Rail_Terminal%20local_type%3AVillage%20local_type%3AWaterfall%20',
4
- query: 'point=523065,185795 radius=1000',
5
- format: 'JSON',
6
- maxresults: 1,
7
- offset: 0,
8
- totalresults: 1,
9
- filter: 'fq=local_type:Airfield local_type:Airport local_type:Bus_Station local_type:Chemical_Works local_type:City local_type:Coach_Station local_type:Electricity_Distribution local_type:Electricity_Production local_type:Further_Education local_type:Gas_Distribution_or_Storage local_type:Hamlet local_type:Harbour local_type:Helicopter_Station local_type:Heliport local_type:Higher_or_University_Education local_type:Hill_Or_Mountain local_type:Hospice local_type:Hospital local_type:Medical_Care_Accommodation local_type:Named_Road local_type:Non_State_Primary_Education local_type:Non_State_Secondary_Education local_type:Other_Settlement local_type:Passenger_Ferry_Terminal local_type:Port_Consisting_of_Docks_and_Nautical_Berthing local_type:Postcode local_type:Primary_Education local_type:Railway_Station local_type:Road_User_Services local_type:Secondary_Education local_type:Section_Of_Named_Road local_type:Section_Of_Numbered_Road local_type:Special_Needs_Education local_type:Suburban_Area local_type:Town local_type:Urban_Greenspace local_type:Vehicular_Ferry_Terminal local_type:Vehicular_Rail_Terminal local_type:Village local_type:Waterfall'
10
- },
11
- results: [{
12
- GAZETTEER_ENTRY: {
13
- ID: 'NW26XE',
14
- NAMES_URI: 'http://data.ordnancesurvey.co.uk/id/postcodeunit/NW26XE',
15
- NAME1: 'NW2 6XE',
16
- TYPE: 'other',
17
- LOCAL_TYPE: 'Postcode',
18
- GEOMETRY_X: 523065,
19
- GEOMETRY_Y: 185795,
20
- MOST_DETAIL_VIEW_RES: 3500,
21
- LEAST_DETAIL_VIEW_RES: 18000,
22
- POPULATED_PLACE: 'London',
23
- POPULATED_PLACE_URI: 'http://data.ordnancesurvey.co.uk/id/4000000074813508',
24
- POPULATED_PLACE_TYPE: 'http://www.ordnancesurvey.co.uk/xml/codelists/localtype.xml#city',
25
- DISTRICT_BOROUGH: 'Brent',
26
- DISTRICT_BOROUGH_URI: 'http://data.ordnancesurvey.co.uk/id/7000000000011447',
27
- DISTRICT_BOROUGH_TYPE: 'http://data.ordnancesurvey.co.uk/ontology/admingeo/LondonBorough',
28
- COUNTY_UNITARY: 'Greater London',
29
- COUNTY_UNITARY_URI: 'http://data.ordnancesurvey.co.uk/id/7000000000041441',
30
- COUNTY_UNITARY_TYPE: 'http://data.ordnancesurvey.co.uk/ontology/admingeo/GreaterLondonAuthority',
31
- REGION: 'London',
32
- REGION_URI: 'http://data.ordnancesurvey.co.uk/id/7000000000041428',
33
- COUNTRY: 'England',
34
- COUNTRY_URI: 'http://data.ordnancesurvey.co.uk/id/country/england'
35
- }
36
- }]
37
- };
38
- //# sourceMappingURL=nearest.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"nearest.js","names":["result","header","uri","query","format","maxresults","offset","totalresults","filter","results","GAZETTEER_ENTRY","ID","NAMES_URI","NAME1","TYPE","LOCAL_TYPE","GEOMETRY_X","GEOMETRY_Y","MOST_DETAIL_VIEW_RES","LEAST_DETAIL_VIEW_RES","POPULATED_PLACE","POPULATED_PLACE_URI","POPULATED_PLACE_TYPE","DISTRICT_BOROUGH","DISTRICT_BOROUGH_URI","DISTRICT_BOROUGH_TYPE","COUNTY_UNITARY","COUNTY_UNITARY_URI","COUNTY_UNITARY_TYPE","REGION","REGION_URI","COUNTRY","COUNTRY_URI"],"sources":["../../../../../../src/server/plugins/map/test/__stubs__/nearest.js"],"sourcesContent":["export const result = {\n header: {\n uri: 'https://api.os.uk/search/names/v1/nearest?point=523065%2C185795&radius=1000&fq=local_type%3AAirfield%20local_type%3AAirport%20local_type%3ABus_Station%20local_type%3AChemical_Works%20local_type%3ACity%20local_type%3ACoach_Station%20local_type%3AElectricity_Distribution%20local_type%3AElectricity_Production%20local_type%3AFurther_Education%20local_type%3AGas_Distribution_or_Storage%20local_type%3AHamlet%20local_type%3AHarbour%20local_type%3AHelicopter_Station%20local_type%3AHeliport%20local_type%3AHigher_or_University_Education%20local_type%3AHill_Or_Mountain%20local_type%3AHospice%20local_type%3AHospital%20local_type%3AMedical_Care_Accommodation%20local_type%3ANamed_Road%20local_type%3ANon_State_Primary_Education%20local_type%3ANon_State_Secondary_Education%20local_type%3AOther_Settlement%20local_type%3APassenger_Ferry_Terminal%20local_type%3APort_Consisting_of_Docks_and_Nautical_Berthing%20local_type%3APostcode%20local_type%3APrimary_Education%20local_type%3ARailway_Station%20local_type%3ARoad_User_Services%20local_type%3ASecondary_Education%20local_type%3ASection_Of_Named_Road%20local_type%3ASection_Of_Numbered_Road%20local_type%3ASpecial_Needs_Education%20local_type%3ASuburban_Area%20local_type%3ATown%20local_type%3AUrban_Greenspace%20local_type%3AVehicular_Ferry_Terminal%20local_type%3AVehicular_Rail_Terminal%20local_type%3AVillage%20local_type%3AWaterfall%20',\n query: 'point=523065,185795 radius=1000',\n format: 'JSON',\n maxresults: 1,\n offset: 0,\n totalresults: 1,\n filter:\n 'fq=local_type:Airfield local_type:Airport local_type:Bus_Station local_type:Chemical_Works local_type:City local_type:Coach_Station local_type:Electricity_Distribution local_type:Electricity_Production local_type:Further_Education local_type:Gas_Distribution_or_Storage local_type:Hamlet local_type:Harbour local_type:Helicopter_Station local_type:Heliport local_type:Higher_or_University_Education local_type:Hill_Or_Mountain local_type:Hospice local_type:Hospital local_type:Medical_Care_Accommodation local_type:Named_Road local_type:Non_State_Primary_Education local_type:Non_State_Secondary_Education local_type:Other_Settlement local_type:Passenger_Ferry_Terminal local_type:Port_Consisting_of_Docks_and_Nautical_Berthing local_type:Postcode local_type:Primary_Education local_type:Railway_Station local_type:Road_User_Services local_type:Secondary_Education local_type:Section_Of_Named_Road local_type:Section_Of_Numbered_Road local_type:Special_Needs_Education local_type:Suburban_Area local_type:Town local_type:Urban_Greenspace local_type:Vehicular_Ferry_Terminal local_type:Vehicular_Rail_Terminal local_type:Village local_type:Waterfall'\n },\n results: [\n {\n GAZETTEER_ENTRY: {\n ID: 'NW26XE',\n NAMES_URI: 'http://data.ordnancesurvey.co.uk/id/postcodeunit/NW26XE',\n NAME1: 'NW2 6XE',\n TYPE: 'other',\n LOCAL_TYPE: 'Postcode',\n GEOMETRY_X: 523065,\n GEOMETRY_Y: 185795,\n MOST_DETAIL_VIEW_RES: 3500,\n LEAST_DETAIL_VIEW_RES: 18000,\n POPULATED_PLACE: 'London',\n POPULATED_PLACE_URI:\n 'http://data.ordnancesurvey.co.uk/id/4000000074813508',\n POPULATED_PLACE_TYPE:\n 'http://www.ordnancesurvey.co.uk/xml/codelists/localtype.xml#city',\n DISTRICT_BOROUGH: 'Brent',\n DISTRICT_BOROUGH_URI:\n 'http://data.ordnancesurvey.co.uk/id/7000000000011447',\n DISTRICT_BOROUGH_TYPE:\n 'http://data.ordnancesurvey.co.uk/ontology/admingeo/LondonBorough',\n COUNTY_UNITARY: 'Greater London',\n COUNTY_UNITARY_URI:\n 'http://data.ordnancesurvey.co.uk/id/7000000000041441',\n COUNTY_UNITARY_TYPE:\n 'http://data.ordnancesurvey.co.uk/ontology/admingeo/GreaterLondonAuthority',\n REGION: 'London',\n REGION_URI: 'http://data.ordnancesurvey.co.uk/id/7000000000041428',\n COUNTRY: 'England',\n COUNTRY_URI: 'http://data.ordnancesurvey.co.uk/id/country/england'\n }\n }\n ]\n}\n"],"mappings":"AAAA,OAAO,MAAMA,MAAM,GAAG;EACpBC,MAAM,EAAE;IACNC,GAAG,EAAE,22CAA22C;IACh3CC,KAAK,EAAE,iCAAiC;IACxCC,MAAM,EAAE,MAAM;IACdC,UAAU,EAAE,CAAC;IACbC,MAAM,EAAE,CAAC;IACTC,YAAY,EAAE,CAAC;IACfC,MAAM,EACJ;EACJ,CAAC;EACDC,OAAO,EAAE,CACP;IACEC,eAAe,EAAE;MACfC,EAAE,EAAE,QAAQ;MACZC,SAAS,EAAE,yDAAyD;MACpEC,KAAK,EAAE,SAAS;MAChBC,IAAI,EAAE,OAAO;MACbC,UAAU,EAAE,UAAU;MACtBC,UAAU,EAAE,MAAM;MAClBC,UAAU,EAAE,MAAM;MAClBC,oBAAoB,EAAE,IAAI;MAC1BC,qBAAqB,EAAE,KAAK;MAC5BC,eAAe,EAAE,QAAQ;MACzBC,mBAAmB,EACjB,sDAAsD;MACxDC,oBAAoB,EAClB,kEAAkE;MACpEC,gBAAgB,EAAE,OAAO;MACzBC,oBAAoB,EAClB,sDAAsD;MACxDC,qBAAqB,EACnB,kEAAkE;MACpEC,cAAc,EAAE,gBAAgB;MAChCC,kBAAkB,EAChB,sDAAsD;MACxDC,mBAAmB,EACjB,2EAA2E;MAC7EC,MAAM,EAAE,QAAQ;MAChBC,UAAU,EAAE,sDAAsD;MAClEC,OAAO,EAAE,SAAS;MAClBC,WAAW,EAAE;IACf;EACF,CAAC;AAEL,CAAC","ignoreList":[]}
@@ -1,46 +0,0 @@
1
- export const result = {
2
- header: {
3
- uri: 'https://api.os.uk/search/names/v1/nearest?point=523065%2C185795&radius=1000&fq=local_type%3AAirfield%20local_type%3AAirport%20local_type%3ABus_Station%20local_type%3AChemical_Works%20local_type%3ACity%20local_type%3ACoach_Station%20local_type%3AElectricity_Distribution%20local_type%3AElectricity_Production%20local_type%3AFurther_Education%20local_type%3AGas_Distribution_or_Storage%20local_type%3AHamlet%20local_type%3AHarbour%20local_type%3AHelicopter_Station%20local_type%3AHeliport%20local_type%3AHigher_or_University_Education%20local_type%3AHill_Or_Mountain%20local_type%3AHospice%20local_type%3AHospital%20local_type%3AMedical_Care_Accommodation%20local_type%3ANamed_Road%20local_type%3ANon_State_Primary_Education%20local_type%3ANon_State_Secondary_Education%20local_type%3AOther_Settlement%20local_type%3APassenger_Ferry_Terminal%20local_type%3APort_Consisting_of_Docks_and_Nautical_Berthing%20local_type%3APostcode%20local_type%3APrimary_Education%20local_type%3ARailway_Station%20local_type%3ARoad_User_Services%20local_type%3ASecondary_Education%20local_type%3ASection_Of_Named_Road%20local_type%3ASection_Of_Numbered_Road%20local_type%3ASpecial_Needs_Education%20local_type%3ASuburban_Area%20local_type%3ATown%20local_type%3AUrban_Greenspace%20local_type%3AVehicular_Ferry_Terminal%20local_type%3AVehicular_Rail_Terminal%20local_type%3AVillage%20local_type%3AWaterfall%20',
4
- query: 'point=523065,185795 radius=1000',
5
- format: 'JSON',
6
- maxresults: 1,
7
- offset: 0,
8
- totalresults: 1,
9
- filter:
10
- 'fq=local_type:Airfield local_type:Airport local_type:Bus_Station local_type:Chemical_Works local_type:City local_type:Coach_Station local_type:Electricity_Distribution local_type:Electricity_Production local_type:Further_Education local_type:Gas_Distribution_or_Storage local_type:Hamlet local_type:Harbour local_type:Helicopter_Station local_type:Heliport local_type:Higher_or_University_Education local_type:Hill_Or_Mountain local_type:Hospice local_type:Hospital local_type:Medical_Care_Accommodation local_type:Named_Road local_type:Non_State_Primary_Education local_type:Non_State_Secondary_Education local_type:Other_Settlement local_type:Passenger_Ferry_Terminal local_type:Port_Consisting_of_Docks_and_Nautical_Berthing local_type:Postcode local_type:Primary_Education local_type:Railway_Station local_type:Road_User_Services local_type:Secondary_Education local_type:Section_Of_Named_Road local_type:Section_Of_Numbered_Road local_type:Special_Needs_Education local_type:Suburban_Area local_type:Town local_type:Urban_Greenspace local_type:Vehicular_Ferry_Terminal local_type:Vehicular_Rail_Terminal local_type:Village local_type:Waterfall'
11
- },
12
- results: [
13
- {
14
- GAZETTEER_ENTRY: {
15
- ID: 'NW26XE',
16
- NAMES_URI: 'http://data.ordnancesurvey.co.uk/id/postcodeunit/NW26XE',
17
- NAME1: 'NW2 6XE',
18
- TYPE: 'other',
19
- LOCAL_TYPE: 'Postcode',
20
- GEOMETRY_X: 523065,
21
- GEOMETRY_Y: 185795,
22
- MOST_DETAIL_VIEW_RES: 3500,
23
- LEAST_DETAIL_VIEW_RES: 18000,
24
- POPULATED_PLACE: 'London',
25
- POPULATED_PLACE_URI:
26
- 'http://data.ordnancesurvey.co.uk/id/4000000074813508',
27
- POPULATED_PLACE_TYPE:
28
- 'http://www.ordnancesurvey.co.uk/xml/codelists/localtype.xml#city',
29
- DISTRICT_BOROUGH: 'Brent',
30
- DISTRICT_BOROUGH_URI:
31
- 'http://data.ordnancesurvey.co.uk/id/7000000000011447',
32
- DISTRICT_BOROUGH_TYPE:
33
- 'http://data.ordnancesurvey.co.uk/ontology/admingeo/LondonBorough',
34
- COUNTY_UNITARY: 'Greater London',
35
- COUNTY_UNITARY_URI:
36
- 'http://data.ordnancesurvey.co.uk/id/7000000000041441',
37
- COUNTY_UNITARY_TYPE:
38
- 'http://data.ordnancesurvey.co.uk/ontology/admingeo/GreaterLondonAuthority',
39
- REGION: 'London',
40
- REGION_URI: 'http://data.ordnancesurvey.co.uk/id/7000000000041428',
41
- COUNTRY: 'England',
42
- COUNTRY_URI: 'http://data.ordnancesurvey.co.uk/id/country/england'
43
- }
44
- }
45
- ]
46
- }