@defra/forms-engine-plugin 4.0.41 → 4.0.42
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/.public/javascripts/application.min.js +1 -1
- package/.public/javascripts/application.min.js.map +1 -1
- package/.public/javascripts/shared.min.js +1 -1
- package/.public/javascripts/shared.min.js.map +1 -1
- package/.public/stylesheets/application.min.css +2 -2
- package/.public/stylesheets/application.min.css.map +1 -1
- package/.server/client/javascripts/location-map.d.ts +93 -0
- package/.server/client/javascripts/location-map.js +745 -0
- package/.server/client/javascripts/location-map.js.map +1 -0
- package/.server/client/javascripts/shared.d.ts +4 -0
- package/.server/client/javascripts/shared.js +5 -0
- package/.server/client/javascripts/shared.js.map +1 -1
- package/.server/client/stylesheets/_location-fields.scss +11 -0
- package/.server/client/stylesheets/application.scss +0 -1
- package/.server/client/stylesheets/shared.scss +1 -0
- package/.server/config/index.js +1 -1
- package/.server/config/index.js.map +1 -1
- package/.server/server/plugins/engine/plugin.js +11 -0
- package/.server/server/plugins/engine/plugin.js.map +1 -1
- package/.server/server/plugins/engine/views/components/_location-field-base.html +1 -1
- package/.server/server/plugins/engine/views/components/osgridreffield.html +4 -2
- package/.server/server/plugins/map/index.d.ts +7 -0
- package/.server/server/plugins/map/index.js +20 -0
- package/.server/server/plugins/map/index.js.map +1 -0
- package/.server/server/plugins/map/routes/index.d.ts +20 -0
- package/.server/server/plugins/map/routes/index.js +128 -0
- package/.server/server/plugins/map/routes/index.js.map +1 -0
- package/.server/server/plugins/map/routes/vts/OS_VTS_3857/resources/sprites/dark.json +690 -0
- package/.server/server/plugins/map/routes/vts/OS_VTS_3857/resources/sprites/dark.png +0 -0
- package/.server/server/plugins/map/routes/vts/OS_VTS_3857/resources/sprites/dark@2x.json +690 -0
- package/.server/server/plugins/map/routes/vts/OS_VTS_3857/resources/sprites/dark@2x.png +0 -0
- package/.server/server/plugins/map/routes/vts/OS_VTS_3857/resources/sprites/greyscale.json +690 -0
- package/.server/server/plugins/map/routes/vts/OS_VTS_3857/resources/sprites/greyscale.png +0 -0
- package/.server/server/plugins/map/routes/vts/OS_VTS_3857/resources/sprites/greyscale@2x.json +690 -0
- package/.server/server/plugins/map/routes/vts/OS_VTS_3857/resources/sprites/greyscale@2x.png +0 -0
- package/.server/server/plugins/map/routes/vts/OS_VTS_3857/resources/sprites/sprite.json +690 -0
- package/.server/server/plugins/map/routes/vts/OS_VTS_3857/resources/sprites/sprite.png +0 -0
- package/.server/server/plugins/map/routes/vts/OS_VTS_3857/resources/sprites/sprite@2x.json +690 -0
- package/.server/server/plugins/map/routes/vts/OS_VTS_3857/resources/sprites/sprite@2x.png +0 -0
- package/.server/server/plugins/map/routes/vts/OS_VTS_3857_Black_and_White.json +7858 -0
- package/.server/server/plugins/map/routes/vts/OS_VTS_3857_Dark.json +7669 -0
- package/.server/server/plugins/map/routes/vts/OS_VTS_3857_Outdoor.json +7653 -0
- package/.server/server/plugins/map/routes/vts/README.md +5 -0
- package/.server/server/plugins/map/service.d.ts +14 -0
- package/.server/server/plugins/map/service.js +76 -0
- package/.server/server/plugins/map/service.js.map +1 -0
- package/.server/server/plugins/map/service.test.js +120 -0
- package/.server/server/plugins/map/service.test.js.map +1 -0
- package/.server/server/plugins/map/test/__stubs__/find.d.ts +3 -0
- package/.server/server/plugins/map/test/__stubs__/find.js +216 -0
- package/.server/server/plugins/map/test/__stubs__/find.js.map +1 -0
- package/.server/server/plugins/map/test/__stubs__/nearest.d.ts +37 -0
- package/.server/server/plugins/map/test/__stubs__/nearest.js +38 -0
- package/.server/server/plugins/map/test/__stubs__/nearest.js.map +1 -0
- package/.server/server/plugins/map/types.d.ts +232 -0
- package/.server/server/plugins/map/types.js +120 -0
- package/.server/server/plugins/map/types.js.map +1 -0
- package/package.json +3 -1
- package/src/client/javascripts/location-map.js +766 -0
- package/src/client/javascripts/shared.js +4 -0
- package/src/client/stylesheets/_location-fields.scss +11 -0
- package/src/client/stylesheets/application.scss +0 -1
- package/src/client/stylesheets/shared.scss +1 -0
- package/src/config/index.ts +1 -1
- package/src/server/plugins/engine/plugin.ts +11 -0
- package/src/server/plugins/engine/views/components/_location-field-base.html +1 -1
- package/src/server/plugins/engine/views/components/osgridreffield.html +4 -2
- package/src/server/plugins/map/index.js +19 -0
- package/src/server/plugins/map/routes/index.js +146 -0
- package/src/server/plugins/map/routes/vts/OS_VTS_3857/resources/sprites/dark.json +690 -0
- package/src/server/plugins/map/routes/vts/OS_VTS_3857/resources/sprites/dark.png +0 -0
- package/src/server/plugins/map/routes/vts/OS_VTS_3857/resources/sprites/dark@2x.json +690 -0
- package/src/server/plugins/map/routes/vts/OS_VTS_3857/resources/sprites/dark@2x.png +0 -0
- package/src/server/plugins/map/routes/vts/OS_VTS_3857/resources/sprites/greyscale.json +690 -0
- package/src/server/plugins/map/routes/vts/OS_VTS_3857/resources/sprites/greyscale.png +0 -0
- package/src/server/plugins/map/routes/vts/OS_VTS_3857/resources/sprites/greyscale@2x.json +690 -0
- package/src/server/plugins/map/routes/vts/OS_VTS_3857/resources/sprites/greyscale@2x.png +0 -0
- package/src/server/plugins/map/routes/vts/OS_VTS_3857/resources/sprites/sprite.json +690 -0
- package/src/server/plugins/map/routes/vts/OS_VTS_3857/resources/sprites/sprite.png +0 -0
- package/src/server/plugins/map/routes/vts/OS_VTS_3857/resources/sprites/sprite@2x.json +690 -0
- package/src/server/plugins/map/routes/vts/OS_VTS_3857/resources/sprites/sprite@2x.png +0 -0
- package/src/server/plugins/map/routes/vts/OS_VTS_3857_Black_and_White.json +7858 -0
- package/src/server/plugins/map/routes/vts/OS_VTS_3857_Dark.json +7669 -0
- package/src/server/plugins/map/routes/vts/OS_VTS_3857_Outdoor.json +7653 -0
- package/src/server/plugins/map/routes/vts/README.md +5 -0
- package/src/server/plugins/map/service.js +84 -0
- package/src/server/plugins/map/service.test.js +144 -0
- package/src/server/plugins/map/test/__stubs__/find.js +271 -0
- package/src/server/plugins/map/test/__stubs__/nearest.js +46 -0
- package/src/server/plugins/map/types.js +119 -0
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
File in this directory are sourced from https://github.com/OrdnanceSurvey/OS-Vector-Tile-API-Stylesheets
|
|
2
|
+
|
|
3
|
+
VTS_OUTDOOR_URL=https://raw.githubusercontent.com/OrdnanceSurvey/OS-Vector-Tile-API-Stylesheets/main/OS_VTS_3857_Outdoor.json
|
|
4
|
+
VTS_DARK_URL=https://raw.githubusercontent.com/OrdnanceSurvey/OS-Vector-Tile-API-Stylesheets/main/OS_VTS_3857_Dark.json
|
|
5
|
+
VTS_BLACK_AND_WHITE_URL=https://raw.githubusercontent.com/OrdnanceSurvey/OS-Vector-Tile-API-Stylesheets/main/OS_VTS_3857_Black_and_White.json
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { getErrorMessage } from '@defra/forms-model'
|
|
2
|
+
import Boom from '@hapi/boom'
|
|
3
|
+
|
|
4
|
+
import { createLogger } from '~/src/server/common/helpers/logging/logger.js'
|
|
5
|
+
import { getJson } from '~/src/server/services/httpService.js'
|
|
6
|
+
|
|
7
|
+
const logger = createLogger()
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Returns an empty result set
|
|
11
|
+
*/
|
|
12
|
+
function empty() {
|
|
13
|
+
/** @type {OsNamesFindResult[]} */
|
|
14
|
+
const results = []
|
|
15
|
+
|
|
16
|
+
return /** @type {OsNamesFindResponse} */ ({ header: {}, results })
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Logs OS names errors
|
|
21
|
+
* @param {unknown} err - the error
|
|
22
|
+
* @param {string} endpoint - the OS api endpoint
|
|
23
|
+
*/
|
|
24
|
+
function logErrorAndReturnEmpty(err, endpoint) {
|
|
25
|
+
const msg = `${getErrorMessage(err)} ${(Boom.isBoom(err) && err.data?.payload?.error?.message) ?? ''}`
|
|
26
|
+
|
|
27
|
+
logger.error(err, `Exception occured calling OS names ${endpoint} - ${msg}}`)
|
|
28
|
+
|
|
29
|
+
return empty()
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Fetch data from OS names API
|
|
34
|
+
* @param {string} url - the url to get address json data from
|
|
35
|
+
* @param {string} endpoint - the url endpoint description for logging
|
|
36
|
+
*/
|
|
37
|
+
async function getData(url, endpoint) {
|
|
38
|
+
const getJsonByType = /** @type {typeof getJson<OsNamesFindResponse>} */ (
|
|
39
|
+
getJson
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
try {
|
|
43
|
+
const response = await getJsonByType(url)
|
|
44
|
+
|
|
45
|
+
if (response.error) {
|
|
46
|
+
return logErrorAndReturnEmpty(response.error, endpoint)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const results = response.payload
|
|
50
|
+
|
|
51
|
+
return results
|
|
52
|
+
} catch (err) {
|
|
53
|
+
return logErrorAndReturnEmpty(err, endpoint)
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* OS names search find by query
|
|
59
|
+
* @param {string} query - the search term
|
|
60
|
+
* @param {string} apiKey - the OS api key
|
|
61
|
+
*/
|
|
62
|
+
export async function find(query, apiKey) {
|
|
63
|
+
const endpoint = 'find'
|
|
64
|
+
const url = `https://api.os.uk/search/names/v1/find?key=${apiKey}&query=${query}&fq=local_type:postcode%20local_type:hamlet%20local_type:village%20local_type:town%20local_type:city%20local_type:other_settlement&maxresults=8`
|
|
65
|
+
|
|
66
|
+
return getData(url, endpoint)
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* OS names search nearest by E/N
|
|
71
|
+
* @param {number} easting - the easting
|
|
72
|
+
* @param {number} northing - the northing
|
|
73
|
+
* @param {string} apiKey - the OS api key
|
|
74
|
+
*/
|
|
75
|
+
export async function nearest(easting, northing, apiKey) {
|
|
76
|
+
const endpoint = 'nearest'
|
|
77
|
+
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`
|
|
78
|
+
|
|
79
|
+
return getData(url, endpoint)
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* @import { OsNamesFindResponse, OsNamesFindResult } from '~/src/server/plugins/map/types.js'
|
|
84
|
+
*/
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import Boom from '@hapi/boom'
|
|
2
|
+
|
|
3
|
+
import * as service from '~/src/server/plugins/map/service.js'
|
|
4
|
+
import { result as findResult } from '~/src/server/plugins/map/test/__stubs__/find.js'
|
|
5
|
+
import { result as nearestResult } from '~/src/server/plugins/map/test/__stubs__/nearest.js'
|
|
6
|
+
import { getJson } from '~/src/server/services/httpService.js'
|
|
7
|
+
|
|
8
|
+
jest.mock('~/src/server/services/httpService.ts')
|
|
9
|
+
|
|
10
|
+
describe('Maps service', () => {
|
|
11
|
+
describe('find', () => {
|
|
12
|
+
it('should return entires', async () => {
|
|
13
|
+
jest.mocked(getJson).mockResolvedValueOnce({
|
|
14
|
+
res: /** @type {IncomingMessage} */ ({
|
|
15
|
+
statusCode: 200,
|
|
16
|
+
headers: {}
|
|
17
|
+
}),
|
|
18
|
+
payload: findResult,
|
|
19
|
+
error: undefined
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
const { results } = await service.find('NW1 6XE', 'apikey')
|
|
23
|
+
|
|
24
|
+
expect(results).toHaveLength(8)
|
|
25
|
+
expect(results.at(1)).toEqual({
|
|
26
|
+
GAZETTEER_ENTRY: {
|
|
27
|
+
ID: 'NW26XE',
|
|
28
|
+
NAMES_URI: 'http://data.ordnancesurvey.co.uk/id/postcodeunit/NW26XE',
|
|
29
|
+
NAME1: 'NW2 6XE',
|
|
30
|
+
TYPE: 'other',
|
|
31
|
+
LOCAL_TYPE: 'Postcode',
|
|
32
|
+
GEOMETRY_X: 523065,
|
|
33
|
+
GEOMETRY_Y: 185795,
|
|
34
|
+
MOST_DETAIL_VIEW_RES: 3500,
|
|
35
|
+
LEAST_DETAIL_VIEW_RES: 18000,
|
|
36
|
+
POPULATED_PLACE: 'London',
|
|
37
|
+
POPULATED_PLACE_URI:
|
|
38
|
+
'http://data.ordnancesurvey.co.uk/id/4000000074813508',
|
|
39
|
+
POPULATED_PLACE_TYPE:
|
|
40
|
+
'http://www.ordnancesurvey.co.uk/xml/codelists/localtype.xml#city',
|
|
41
|
+
DISTRICT_BOROUGH: 'Brent',
|
|
42
|
+
DISTRICT_BOROUGH_URI:
|
|
43
|
+
'http://data.ordnancesurvey.co.uk/id/7000000000011447',
|
|
44
|
+
DISTRICT_BOROUGH_TYPE:
|
|
45
|
+
'http://data.ordnancesurvey.co.uk/ontology/admingeo/LondonBorough',
|
|
46
|
+
COUNTY_UNITARY: 'Greater London',
|
|
47
|
+
COUNTY_UNITARY_URI:
|
|
48
|
+
'http://data.ordnancesurvey.co.uk/id/7000000000041441',
|
|
49
|
+
COUNTY_UNITARY_TYPE:
|
|
50
|
+
'http://data.ordnancesurvey.co.uk/ontology/admingeo/GreaterLondonAuthority',
|
|
51
|
+
REGION: 'London',
|
|
52
|
+
REGION_URI: 'http://data.ordnancesurvey.co.uk/id/7000000000041428',
|
|
53
|
+
COUNTRY: 'England',
|
|
54
|
+
COUNTRY_URI: 'http://data.ordnancesurvey.co.uk/id/country/england'
|
|
55
|
+
}
|
|
56
|
+
})
|
|
57
|
+
})
|
|
58
|
+
|
|
59
|
+
it('should return an empty response when an error is encountered', async () => {
|
|
60
|
+
jest.mocked(getJson).mockResolvedValueOnce({
|
|
61
|
+
res: /** @type {IncomingMessage} */ ({
|
|
62
|
+
statusCode: 300,
|
|
63
|
+
headers: {}
|
|
64
|
+
}),
|
|
65
|
+
payload: undefined,
|
|
66
|
+
error: new Error('Unknown error')
|
|
67
|
+
})
|
|
68
|
+
|
|
69
|
+
const { results } = await service.find('NW1 6XE', 'apikey')
|
|
70
|
+
|
|
71
|
+
expect(results).toHaveLength(0)
|
|
72
|
+
expect(results).toEqual([])
|
|
73
|
+
})
|
|
74
|
+
|
|
75
|
+
it('should return an empty response when a non 200 response is encountered', async () => {
|
|
76
|
+
jest
|
|
77
|
+
.mocked(getJson)
|
|
78
|
+
.mockRejectedValueOnce(
|
|
79
|
+
Boom.badRequest(
|
|
80
|
+
'OS API error',
|
|
81
|
+
new Error('Invalid postcode segments')
|
|
82
|
+
)
|
|
83
|
+
)
|
|
84
|
+
|
|
85
|
+
const { results } = await service.find('invalid postcode', 'apikey')
|
|
86
|
+
|
|
87
|
+
expect(results).toHaveLength(0)
|
|
88
|
+
expect(results).toEqual([])
|
|
89
|
+
})
|
|
90
|
+
})
|
|
91
|
+
|
|
92
|
+
describe('nearest', () => {
|
|
93
|
+
it('should return entries', async () => {
|
|
94
|
+
jest.mocked(getJson).mockResolvedValueOnce({
|
|
95
|
+
res: /** @type {IncomingMessage} */ ({
|
|
96
|
+
statusCode: 200,
|
|
97
|
+
headers: {}
|
|
98
|
+
}),
|
|
99
|
+
payload: nearestResult,
|
|
100
|
+
error: undefined
|
|
101
|
+
})
|
|
102
|
+
|
|
103
|
+
const { results } = await service.nearest(700000, 1300000, 'apikey')
|
|
104
|
+
|
|
105
|
+
expect(results).toHaveLength(1)
|
|
106
|
+
expect(results.at(0)).toEqual({
|
|
107
|
+
GAZETTEER_ENTRY: {
|
|
108
|
+
ID: 'NW26XE',
|
|
109
|
+
NAMES_URI: 'http://data.ordnancesurvey.co.uk/id/postcodeunit/NW26XE',
|
|
110
|
+
NAME1: 'NW2 6XE',
|
|
111
|
+
TYPE: 'other',
|
|
112
|
+
LOCAL_TYPE: 'Postcode',
|
|
113
|
+
GEOMETRY_X: 523065,
|
|
114
|
+
GEOMETRY_Y: 185795,
|
|
115
|
+
MOST_DETAIL_VIEW_RES: 3500,
|
|
116
|
+
LEAST_DETAIL_VIEW_RES: 18000,
|
|
117
|
+
POPULATED_PLACE: 'London',
|
|
118
|
+
POPULATED_PLACE_URI:
|
|
119
|
+
'http://data.ordnancesurvey.co.uk/id/4000000074813508',
|
|
120
|
+
POPULATED_PLACE_TYPE:
|
|
121
|
+
'http://www.ordnancesurvey.co.uk/xml/codelists/localtype.xml#city',
|
|
122
|
+
DISTRICT_BOROUGH: 'Brent',
|
|
123
|
+
DISTRICT_BOROUGH_URI:
|
|
124
|
+
'http://data.ordnancesurvey.co.uk/id/7000000000011447',
|
|
125
|
+
DISTRICT_BOROUGH_TYPE:
|
|
126
|
+
'http://data.ordnancesurvey.co.uk/ontology/admingeo/LondonBorough',
|
|
127
|
+
COUNTY_UNITARY: 'Greater London',
|
|
128
|
+
COUNTY_UNITARY_URI:
|
|
129
|
+
'http://data.ordnancesurvey.co.uk/id/7000000000041441',
|
|
130
|
+
COUNTY_UNITARY_TYPE:
|
|
131
|
+
'http://data.ordnancesurvey.co.uk/ontology/admingeo/GreaterLondonAuthority',
|
|
132
|
+
REGION: 'London',
|
|
133
|
+
REGION_URI: 'http://data.ordnancesurvey.co.uk/id/7000000000041428',
|
|
134
|
+
COUNTRY: 'England',
|
|
135
|
+
COUNTRY_URI: 'http://data.ordnancesurvey.co.uk/id/country/england'
|
|
136
|
+
}
|
|
137
|
+
})
|
|
138
|
+
})
|
|
139
|
+
})
|
|
140
|
+
})
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* @import { IncomingMessage } from 'node:http'
|
|
144
|
+
*/
|
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
/** @type {OsNamesFindResponse} */
|
|
2
|
+
export const result = {
|
|
3
|
+
header: {
|
|
4
|
+
uri: 'https://api.os.uk/search/names/v1/find?query=NW1%206XE&fq=local_type%3Apostcode%20local_type%3Ahamlet%20local_type%3Avillage%20local_type%3Atown%20local_type%3Acity%20local_type%3Aother_settlement&maxresults=8',
|
|
5
|
+
query: 'NW1 6XE',
|
|
6
|
+
format: 'JSON',
|
|
7
|
+
maxresults: 8,
|
|
8
|
+
offset: 0,
|
|
9
|
+
totalresults: 2016,
|
|
10
|
+
filter:
|
|
11
|
+
'fq=local_type:postcode local_type:hamlet local_type:village local_type:town local_type:city local_type:other_settlement'
|
|
12
|
+
},
|
|
13
|
+
results: [
|
|
14
|
+
{
|
|
15
|
+
GAZETTEER_ENTRY: {
|
|
16
|
+
ID: 'NW16XE',
|
|
17
|
+
NAMES_URI: 'http://data.ordnancesurvey.co.uk/id/postcodeunit/NW16XE',
|
|
18
|
+
NAME1: 'NW1 6XE',
|
|
19
|
+
TYPE: 'other',
|
|
20
|
+
LOCAL_TYPE: 'Postcode',
|
|
21
|
+
GEOMETRY_X: 527850,
|
|
22
|
+
GEOMETRY_Y: 182134,
|
|
23
|
+
MOST_DETAIL_VIEW_RES: 3500,
|
|
24
|
+
LEAST_DETAIL_VIEW_RES: 18000,
|
|
25
|
+
POPULATED_PLACE: 'City of Westminster',
|
|
26
|
+
POPULATED_PLACE_URI:
|
|
27
|
+
'http://data.ordnancesurvey.co.uk/id/4000000074559881',
|
|
28
|
+
POPULATED_PLACE_TYPE:
|
|
29
|
+
'http://www.ordnancesurvey.co.uk/xml/codelists/localtype.xml#city',
|
|
30
|
+
DISTRICT_BOROUGH: 'City of Westminster',
|
|
31
|
+
DISTRICT_BOROUGH_URI:
|
|
32
|
+
'http://data.ordnancesurvey.co.uk/id/7000000000011164',
|
|
33
|
+
DISTRICT_BOROUGH_TYPE:
|
|
34
|
+
'http://data.ordnancesurvey.co.uk/ontology/admingeo/LondonBorough',
|
|
35
|
+
COUNTY_UNITARY: 'Greater London',
|
|
36
|
+
COUNTY_UNITARY_URI:
|
|
37
|
+
'http://data.ordnancesurvey.co.uk/id/7000000000041441',
|
|
38
|
+
COUNTY_UNITARY_TYPE:
|
|
39
|
+
'http://data.ordnancesurvey.co.uk/ontology/admingeo/GreaterLondonAuthority',
|
|
40
|
+
REGION: 'London',
|
|
41
|
+
REGION_URI: 'http://data.ordnancesurvey.co.uk/id/7000000000041428',
|
|
42
|
+
COUNTRY: 'England',
|
|
43
|
+
COUNTRY_URI: 'http://data.ordnancesurvey.co.uk/id/country/england'
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
GAZETTEER_ENTRY: {
|
|
48
|
+
ID: 'NW26XE',
|
|
49
|
+
NAMES_URI: 'http://data.ordnancesurvey.co.uk/id/postcodeunit/NW26XE',
|
|
50
|
+
NAME1: 'NW2 6XE',
|
|
51
|
+
TYPE: 'other',
|
|
52
|
+
LOCAL_TYPE: 'Postcode',
|
|
53
|
+
GEOMETRY_X: 523065,
|
|
54
|
+
GEOMETRY_Y: 185795,
|
|
55
|
+
MOST_DETAIL_VIEW_RES: 3500,
|
|
56
|
+
LEAST_DETAIL_VIEW_RES: 18000,
|
|
57
|
+
POPULATED_PLACE: 'London',
|
|
58
|
+
POPULATED_PLACE_URI:
|
|
59
|
+
'http://data.ordnancesurvey.co.uk/id/4000000074813508',
|
|
60
|
+
POPULATED_PLACE_TYPE:
|
|
61
|
+
'http://www.ordnancesurvey.co.uk/xml/codelists/localtype.xml#city',
|
|
62
|
+
DISTRICT_BOROUGH: 'Brent',
|
|
63
|
+
DISTRICT_BOROUGH_URI:
|
|
64
|
+
'http://data.ordnancesurvey.co.uk/id/7000000000011447',
|
|
65
|
+
DISTRICT_BOROUGH_TYPE:
|
|
66
|
+
'http://data.ordnancesurvey.co.uk/ontology/admingeo/LondonBorough',
|
|
67
|
+
COUNTY_UNITARY: 'Greater London',
|
|
68
|
+
COUNTY_UNITARY_URI:
|
|
69
|
+
'http://data.ordnancesurvey.co.uk/id/7000000000041441',
|
|
70
|
+
COUNTY_UNITARY_TYPE:
|
|
71
|
+
'http://data.ordnancesurvey.co.uk/ontology/admingeo/GreaterLondonAuthority',
|
|
72
|
+
REGION: 'London',
|
|
73
|
+
REGION_URI: 'http://data.ordnancesurvey.co.uk/id/7000000000041428',
|
|
74
|
+
COUNTRY: 'England',
|
|
75
|
+
COUNTRY_URI: 'http://data.ordnancesurvey.co.uk/id/country/england'
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
GAZETTEER_ENTRY: {
|
|
80
|
+
ID: 'NW36XE',
|
|
81
|
+
NAMES_URI: 'http://data.ordnancesurvey.co.uk/id/postcodeunit/NW36XE',
|
|
82
|
+
NAME1: 'NW3 6XE',
|
|
83
|
+
TYPE: 'other',
|
|
84
|
+
LOCAL_TYPE: 'Postcode',
|
|
85
|
+
GEOMETRY_X: 526197,
|
|
86
|
+
GEOMETRY_Y: 185535,
|
|
87
|
+
MOST_DETAIL_VIEW_RES: 3500,
|
|
88
|
+
LEAST_DETAIL_VIEW_RES: 18000,
|
|
89
|
+
POPULATED_PLACE: 'Hampstead',
|
|
90
|
+
POPULATED_PLACE_URI:
|
|
91
|
+
'http://data.ordnancesurvey.co.uk/id/4000000074541613',
|
|
92
|
+
DISTRICT_BOROUGH: 'Camden',
|
|
93
|
+
DISTRICT_BOROUGH_URI:
|
|
94
|
+
'http://data.ordnancesurvey.co.uk/id/7000000000011244',
|
|
95
|
+
DISTRICT_BOROUGH_TYPE:
|
|
96
|
+
'http://data.ordnancesurvey.co.uk/ontology/admingeo/LondonBorough',
|
|
97
|
+
COUNTY_UNITARY: 'Greater London',
|
|
98
|
+
COUNTY_UNITARY_URI:
|
|
99
|
+
'http://data.ordnancesurvey.co.uk/id/7000000000041441',
|
|
100
|
+
COUNTY_UNITARY_TYPE:
|
|
101
|
+
'http://data.ordnancesurvey.co.uk/ontology/admingeo/GreaterLondonAuthority',
|
|
102
|
+
REGION: 'London',
|
|
103
|
+
REGION_URI: 'http://data.ordnancesurvey.co.uk/id/7000000000041428',
|
|
104
|
+
COUNTRY: 'England',
|
|
105
|
+
COUNTRY_URI: 'http://data.ordnancesurvey.co.uk/id/country/england'
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
GAZETTEER_ENTRY: {
|
|
110
|
+
ID: 'NW10XE',
|
|
111
|
+
NAMES_URI: 'http://data.ordnancesurvey.co.uk/id/postcodeunit/NW10XE',
|
|
112
|
+
NAME1: 'NW1 0XE',
|
|
113
|
+
TYPE: 'other',
|
|
114
|
+
LOCAL_TYPE: 'Postcode',
|
|
115
|
+
GEOMETRY_X: 529608,
|
|
116
|
+
GEOMETRY_Y: 183996,
|
|
117
|
+
MOST_DETAIL_VIEW_RES: 3500,
|
|
118
|
+
LEAST_DETAIL_VIEW_RES: 18000,
|
|
119
|
+
POPULATED_PLACE: 'Camden Town',
|
|
120
|
+
POPULATED_PLACE_URI:
|
|
121
|
+
'http://data.ordnancesurvey.co.uk/id/4000000074557754',
|
|
122
|
+
DISTRICT_BOROUGH: 'Camden',
|
|
123
|
+
DISTRICT_BOROUGH_URI:
|
|
124
|
+
'http://data.ordnancesurvey.co.uk/id/7000000000011244',
|
|
125
|
+
DISTRICT_BOROUGH_TYPE:
|
|
126
|
+
'http://data.ordnancesurvey.co.uk/ontology/admingeo/LondonBorough',
|
|
127
|
+
COUNTY_UNITARY: 'Greater London',
|
|
128
|
+
COUNTY_UNITARY_URI:
|
|
129
|
+
'http://data.ordnancesurvey.co.uk/id/7000000000041441',
|
|
130
|
+
COUNTY_UNITARY_TYPE:
|
|
131
|
+
'http://data.ordnancesurvey.co.uk/ontology/admingeo/GreaterLondonAuthority',
|
|
132
|
+
REGION: 'London',
|
|
133
|
+
REGION_URI: 'http://data.ordnancesurvey.co.uk/id/7000000000041428',
|
|
134
|
+
COUNTRY: 'England',
|
|
135
|
+
COUNTRY_URI: 'http://data.ordnancesurvey.co.uk/id/country/england'
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
GAZETTEER_ENTRY: {
|
|
140
|
+
ID: 'NW16AE',
|
|
141
|
+
NAMES_URI: 'http://data.ordnancesurvey.co.uk/id/postcodeunit/NW16AE',
|
|
142
|
+
NAME1: 'NW1 6AE',
|
|
143
|
+
TYPE: 'other',
|
|
144
|
+
LOCAL_TYPE: 'Postcode',
|
|
145
|
+
GEOMETRY_X: 527873,
|
|
146
|
+
GEOMETRY_Y: 182010,
|
|
147
|
+
MOST_DETAIL_VIEW_RES: 3500,
|
|
148
|
+
LEAST_DETAIL_VIEW_RES: 18000,
|
|
149
|
+
POPULATED_PLACE: 'City of Westminster',
|
|
150
|
+
POPULATED_PLACE_URI:
|
|
151
|
+
'http://data.ordnancesurvey.co.uk/id/4000000074559881',
|
|
152
|
+
POPULATED_PLACE_TYPE:
|
|
153
|
+
'http://www.ordnancesurvey.co.uk/xml/codelists/localtype.xml#city',
|
|
154
|
+
DISTRICT_BOROUGH: 'City of Westminster',
|
|
155
|
+
DISTRICT_BOROUGH_URI:
|
|
156
|
+
'http://data.ordnancesurvey.co.uk/id/7000000000011164',
|
|
157
|
+
DISTRICT_BOROUGH_TYPE:
|
|
158
|
+
'http://data.ordnancesurvey.co.uk/ontology/admingeo/LondonBorough',
|
|
159
|
+
COUNTY_UNITARY: 'Greater London',
|
|
160
|
+
COUNTY_UNITARY_URI:
|
|
161
|
+
'http://data.ordnancesurvey.co.uk/id/7000000000041441',
|
|
162
|
+
COUNTY_UNITARY_TYPE:
|
|
163
|
+
'http://data.ordnancesurvey.co.uk/ontology/admingeo/GreaterLondonAuthority',
|
|
164
|
+
REGION: 'London',
|
|
165
|
+
REGION_URI: 'http://data.ordnancesurvey.co.uk/id/7000000000041428',
|
|
166
|
+
COUNTRY: 'England',
|
|
167
|
+
COUNTRY_URI: 'http://data.ordnancesurvey.co.uk/id/country/england'
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
GAZETTEER_ENTRY: {
|
|
172
|
+
ID: 'NW16DE',
|
|
173
|
+
NAMES_URI: 'http://data.ordnancesurvey.co.uk/id/postcodeunit/NW16DE',
|
|
174
|
+
NAME1: 'NW1 6DE',
|
|
175
|
+
TYPE: 'other',
|
|
176
|
+
LOCAL_TYPE: 'Postcode',
|
|
177
|
+
GEOMETRY_X: 527681,
|
|
178
|
+
GEOMETRY_Y: 182107,
|
|
179
|
+
MOST_DETAIL_VIEW_RES: 3500,
|
|
180
|
+
LEAST_DETAIL_VIEW_RES: 18000,
|
|
181
|
+
POPULATED_PLACE: 'City of Westminster',
|
|
182
|
+
POPULATED_PLACE_URI:
|
|
183
|
+
'http://data.ordnancesurvey.co.uk/id/4000000074559881',
|
|
184
|
+
POPULATED_PLACE_TYPE:
|
|
185
|
+
'http://www.ordnancesurvey.co.uk/xml/codelists/localtype.xml#city',
|
|
186
|
+
DISTRICT_BOROUGH: 'City of Westminster',
|
|
187
|
+
DISTRICT_BOROUGH_URI:
|
|
188
|
+
'http://data.ordnancesurvey.co.uk/id/7000000000011164',
|
|
189
|
+
DISTRICT_BOROUGH_TYPE:
|
|
190
|
+
'http://data.ordnancesurvey.co.uk/ontology/admingeo/LondonBorough',
|
|
191
|
+
COUNTY_UNITARY: 'Greater London',
|
|
192
|
+
COUNTY_UNITARY_URI:
|
|
193
|
+
'http://data.ordnancesurvey.co.uk/id/7000000000041441',
|
|
194
|
+
COUNTY_UNITARY_TYPE:
|
|
195
|
+
'http://data.ordnancesurvey.co.uk/ontology/admingeo/GreaterLondonAuthority',
|
|
196
|
+
REGION: 'London',
|
|
197
|
+
REGION_URI: 'http://data.ordnancesurvey.co.uk/id/7000000000041428',
|
|
198
|
+
COUNTRY: 'England',
|
|
199
|
+
COUNTRY_URI: 'http://data.ordnancesurvey.co.uk/id/country/england'
|
|
200
|
+
}
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
GAZETTEER_ENTRY: {
|
|
204
|
+
ID: 'NW16EX',
|
|
205
|
+
NAMES_URI: 'http://data.ordnancesurvey.co.uk/id/postcodeunit/NW16EX',
|
|
206
|
+
NAME1: 'NW1 6EX',
|
|
207
|
+
TYPE: 'other',
|
|
208
|
+
LOCAL_TYPE: 'Postcode',
|
|
209
|
+
GEOMETRY_X: 527534,
|
|
210
|
+
GEOMETRY_Y: 182220,
|
|
211
|
+
MOST_DETAIL_VIEW_RES: 3500,
|
|
212
|
+
LEAST_DETAIL_VIEW_RES: 18000,
|
|
213
|
+
POPULATED_PLACE: 'City of Westminster',
|
|
214
|
+
POPULATED_PLACE_URI:
|
|
215
|
+
'http://data.ordnancesurvey.co.uk/id/4000000074559881',
|
|
216
|
+
POPULATED_PLACE_TYPE:
|
|
217
|
+
'http://www.ordnancesurvey.co.uk/xml/codelists/localtype.xml#city',
|
|
218
|
+
DISTRICT_BOROUGH: 'City of Westminster',
|
|
219
|
+
DISTRICT_BOROUGH_URI:
|
|
220
|
+
'http://data.ordnancesurvey.co.uk/id/7000000000011164',
|
|
221
|
+
DISTRICT_BOROUGH_TYPE:
|
|
222
|
+
'http://data.ordnancesurvey.co.uk/ontology/admingeo/LondonBorough',
|
|
223
|
+
COUNTY_UNITARY: 'Greater London',
|
|
224
|
+
COUNTY_UNITARY_URI:
|
|
225
|
+
'http://data.ordnancesurvey.co.uk/id/7000000000041441',
|
|
226
|
+
COUNTY_UNITARY_TYPE:
|
|
227
|
+
'http://data.ordnancesurvey.co.uk/ontology/admingeo/GreaterLondonAuthority',
|
|
228
|
+
REGION: 'London',
|
|
229
|
+
REGION_URI: 'http://data.ordnancesurvey.co.uk/id/7000000000041428',
|
|
230
|
+
COUNTRY: 'England',
|
|
231
|
+
COUNTRY_URI: 'http://data.ordnancesurvey.co.uk/id/country/england'
|
|
232
|
+
}
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
GAZETTEER_ENTRY: {
|
|
236
|
+
ID: 'NW16HE',
|
|
237
|
+
NAMES_URI: 'http://data.ordnancesurvey.co.uk/id/postcodeunit/NW16HE',
|
|
238
|
+
NAME1: 'NW1 6HE',
|
|
239
|
+
TYPE: 'other',
|
|
240
|
+
LOCAL_TYPE: 'Postcode',
|
|
241
|
+
GEOMETRY_X: 527621,
|
|
242
|
+
GEOMETRY_Y: 182113,
|
|
243
|
+
MOST_DETAIL_VIEW_RES: 3500,
|
|
244
|
+
LEAST_DETAIL_VIEW_RES: 18000,
|
|
245
|
+
POPULATED_PLACE: 'City of Westminster',
|
|
246
|
+
POPULATED_PLACE_URI:
|
|
247
|
+
'http://data.ordnancesurvey.co.uk/id/4000000074559881',
|
|
248
|
+
POPULATED_PLACE_TYPE:
|
|
249
|
+
'http://www.ordnancesurvey.co.uk/xml/codelists/localtype.xml#city',
|
|
250
|
+
DISTRICT_BOROUGH: 'City of Westminster',
|
|
251
|
+
DISTRICT_BOROUGH_URI:
|
|
252
|
+
'http://data.ordnancesurvey.co.uk/id/7000000000011164',
|
|
253
|
+
DISTRICT_BOROUGH_TYPE:
|
|
254
|
+
'http://data.ordnancesurvey.co.uk/ontology/admingeo/LondonBorough',
|
|
255
|
+
COUNTY_UNITARY: 'Greater London',
|
|
256
|
+
COUNTY_UNITARY_URI:
|
|
257
|
+
'http://data.ordnancesurvey.co.uk/id/7000000000041441',
|
|
258
|
+
COUNTY_UNITARY_TYPE:
|
|
259
|
+
'http://data.ordnancesurvey.co.uk/ontology/admingeo/GreaterLondonAuthority',
|
|
260
|
+
REGION: 'London',
|
|
261
|
+
REGION_URI: 'http://data.ordnancesurvey.co.uk/id/7000000000041428',
|
|
262
|
+
COUNTRY: 'England',
|
|
263
|
+
COUNTRY_URI: 'http://data.ordnancesurvey.co.uk/id/country/england'
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
]
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* @import { OsNamesFindResponse } from '~/src/server/plugins/map/types.js'
|
|
271
|
+
*/
|
|
@@ -0,0 +1,46 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {{
|
|
3
|
+
* ordnanceSurveyApiKey: string
|
|
4
|
+
* }} MapConfiguration
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
//
|
|
8
|
+
// Route types
|
|
9
|
+
//
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Map proxy query params
|
|
13
|
+
* @typedef {object} MapProxyQuery
|
|
14
|
+
* @property {string} url - the proxied url
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Map geocode query params
|
|
19
|
+
* @typedef {object} MapGeocodeQuery
|
|
20
|
+
* @property {string} query - name query
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Map reverse geocode query params
|
|
25
|
+
* @typedef {object} MapReverseGeocodeQuery
|
|
26
|
+
* @property {number} easting - the Easting point
|
|
27
|
+
* @property {number} northing - the Northing point
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Map geocode get request
|
|
32
|
+
* @typedef {object} MapProxyGetRequestRefs
|
|
33
|
+
* @property {MapProxyQuery} Query - Request query
|
|
34
|
+
*/
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Map geocode get request
|
|
38
|
+
* @typedef {object} MapGeocodeGetRequestRefs
|
|
39
|
+
* @property {MapGeocodeQuery} Query - Request query
|
|
40
|
+
*/
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Map reverst geocode get request
|
|
44
|
+
* @typedef {object} MapReverseGeocodeGetRequestRefs
|
|
45
|
+
* @property {MapReverseGeocodeQuery} Query - Request query
|
|
46
|
+
*/
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* @typedef {MapProxyGetRequestRefs} MapProxyRequestRefs
|
|
50
|
+
* @typedef {MapGeocodeGetRequestRefs} MapGeocodeRequestRefs
|
|
51
|
+
* @typedef {MapReverseGeocodeGetRequestRefs} MapReverseGeocodeRequestRefs
|
|
52
|
+
* @typedef {Request<MapGeocodeGetRequestRefs>} MapProxyGetRequest
|
|
53
|
+
* @typedef {Request<MapGeocodeGetRequestRefs>} MapGeocodeGetRequest
|
|
54
|
+
* @typedef {Request<MapReverseGeocodeGetRequestRefs>} MapReverseGeocodeGetRequest
|
|
55
|
+
* @typedef {MapProxyGetRequest | MapGeocodeGetRequest | MapReverseGeocodeGetRequest} MapRequest
|
|
56
|
+
*/
|
|
57
|
+
|
|
58
|
+
//
|
|
59
|
+
// Service types
|
|
60
|
+
//
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* @typedef {object} OsNamesFindResponse
|
|
64
|
+
* @property {OsNamesFindHeader} header - Metadata about the search request and results.
|
|
65
|
+
* @property {OsNamesFindResult[]} results - An array of matched place records from the search.
|
|
66
|
+
*/
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* @typedef {object} OsNamesFindHeader
|
|
70
|
+
* @property {string} uri - The query URI (usually same as search text).
|
|
71
|
+
* @property {string} query - The original text query string passed to the API.
|
|
72
|
+
* @property {string} format - The response format returned (e.g., "JSON").
|
|
73
|
+
* @property {number} maxresults - The maximum number of results requested.
|
|
74
|
+
* @property {number} offset - The offset used in the search results.
|
|
75
|
+
* @property {number} totalresults - The total number of results that matched the query.
|
|
76
|
+
* @property {string} filter - The original filter string passed to the API.
|
|
77
|
+
*/
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* @typedef {object} OsNamesFindGazetteerEntry
|
|
81
|
+
* @property {string} ID - Unique identifier for the place/feature.
|
|
82
|
+
* @property {string} NAMES_URI - A URI (identifier) for this named feature.
|
|
83
|
+
* @property {string} NAME1 - Primary name of the feature.
|
|
84
|
+
* @property {string} TYPE - General type classification of the feature.
|
|
85
|
+
* @property {string} LOCAL_TYPE - Local or more specific type classification.
|
|
86
|
+
* @property {number} GEOMETRY_X - Easting coordinate (British National Grid).
|
|
87
|
+
* @property {number} GEOMETRY_Y - Northing coordinate (British National Grid).
|
|
88
|
+
* @property {number} MOST_DETAIL_VIEW_RES - Most detailed resolution available.
|
|
89
|
+
* @property {number} LEAST_DETAIL_VIEW_RES - Least detailed resolution available.
|
|
90
|
+
* @property {number} [MBR_XMIN] - Minimum bounding box X (easting).
|
|
91
|
+
* @property {number} [MBR_YMIN] - Minimum bounding box Y (northing).
|
|
92
|
+
* @property {number} [MBR_XMAX] - Maximum bounding box X (easting).
|
|
93
|
+
* @property {number} [MBR_YMAX] - Maximum bounding box Y (northing).
|
|
94
|
+
* @property {string} [DISTRICT_BOROUGH] - (Optional) District borough.
|
|
95
|
+
* @property {string} [DISTRICT_BOROUGH_URI] - (Optional) URI for the district borough.
|
|
96
|
+
* @property {string} [DISTRICT_BOROUGH_TYPE] - (Optional) Type of the district borough.
|
|
97
|
+
* @property {string} [POSTCODE_DISTRICT] - (Optional) Postcode district.
|
|
98
|
+
* @property {string} [POSTCODE_DISTRICT_URI] - (Optional) URI for the postcode district.
|
|
99
|
+
* @property {string} [POPULATED_PLACE] - (Optional) Name of associated populated place.
|
|
100
|
+
* @property {string} [POPULATED_PLACE_URI] - (Optional) URI of populated place.
|
|
101
|
+
* @property {string} [POPULATED_PLACE_TYPE] - (Optional) Type of populated place.
|
|
102
|
+
* @property {string} [COUNTY_UNITARY] - (Optional) County or unitary authority name.
|
|
103
|
+
* @property {string} [COUNTY_UNITARY_URI] - (Optional) URI for county/unitary authority.
|
|
104
|
+
* @property {string} [COUNTY_UNITARY_TYPE] - (Optional) Classification of county/unitary authority.
|
|
105
|
+
* @property {string} [REGION] - (Optional) Region name.
|
|
106
|
+
* @property {string} [REGION_URI] - (Optional) URI for region.
|
|
107
|
+
* @property {string} [COUNTRY] - (Optional) Country name.
|
|
108
|
+
* @property {string} [COUNTRY_URI] - (Optional) URI for country.
|
|
109
|
+
*/
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* OS names GAZETTEER_ENTRY response
|
|
113
|
+
* @typedef {object} OsNamesFindResult
|
|
114
|
+
* @property {OsNamesFindGazetteerEntry} GAZETTEER_ENTRY - Gazetteer entry
|
|
115
|
+
*/
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* @import { Request } from '@hapi/hapi'
|
|
119
|
+
*/
|