Skip to content

DF-1105: Interactive map - replace UMD with ESM#419

Open
davidjamesstone wants to merge 1 commit into
mainfrom
feature/DF-1105-esm-maps
Open

DF-1105: Interactive map - replace UMD with ESM#419
davidjamesstone wants to merge 1 commit into
mainfrom
feature/DF-1105-esm-maps

Conversation

@davidjamesstone
Copy link
Copy Markdown
Contributor

Proposed change

Import maps assets via ESM not UMD to avoid needing to webpack copy the assets in host frontend app (e.g. forms-runner)

Jira ticket: https://eaflood.atlassian.net/browse/DF-1105

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Misc. (documentation, build updates, etc)

Checklist

  • You have executed this code locally and it performs as expected.
  • You have added tests to verify your code works.
  • You have added code comments and JSDoc, where appropriate.
  • There is no commented-out code.
  • You have added developer docs in README.md and docs/* (where appropriate, e.g. new features).
  • The tests are passing (npm run test).
  • The linting checks are passing (npm run lint).
  • The code has been formatted (npm run format).

@davidjamesstone davidjamesstone changed the title Interactive map - replace UMD with ESM DF-1105: Interactive map - replace UMD with ESM Jun 4, 2026
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Jun 4, 2026

mapProvider: defra.maplibreProvider(),
reverseGeocodeProvider: defra.openNamesProvider({
url: `${apiPath}/reverse-geocode-proxy?easting={easting}&northing={northing}`
}),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did you intend on removing this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes - we're not using the reverse geocode. It was doing no harm but shouldn't be there.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do the routes need removing?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Up to you. I kept them in previously in case we ever decided to use them.

/**
 * OS names search nearest by E/N
 * @param {number} easting - the easting
 * @param {number} northing - the northing
 * @param {string} apiKey - the OS api key
 */
export async function nearest(easting, northing, apiKey) {
  const endpoint = 'nearest'
  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....`

  return getData(url, endpoint)
}

You think we'll ever need to do reverse geocoding?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If not, I'll remove the nearest service function and route to it.

Comment thread package.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants