/** * Converts lat long to easting and northing * @param {object} param * @param {number} param.lat * @param {number} param.long * @returns {{ easting: number, northing: number }} */ export function latLongToEastingNorthing({ lat, long }: { lat: number; long: number; }): { easting: number; northing: number; }; /** * Converts easting and northing to lat long * @param {object} param * @param {number} param.easting * @param {number} param.northing * @returns {{ lat: number, long: number }} */ export function eastingNorthingToLatLong({ easting, northing }: { easting: number; northing: number; }): { lat: number; long: number; }; /** * Converts lat long to an ordnance survey grid reference * @param {object} param * @param {number} param.lat * @param {number} param.long * @returns {string} */ export function latLongToOsGridRef({ lat, long }: { lat: number; long: number; }): string; /** * Converts an ordnance survey grid reference to lat long * @param {string} osGridRef * @returns {{ lat: number, long: number }} */ export function osGridRefToLatLong(osGridRef: string): { lat: number; long: number; }; /** * Get the grid ref from the first coordinate of a long/lat feature * @param {Feature} feature */ export function getCoordinateGridRef(feature: Feature): any; /** * Get the centroid grid ref from a long/lat feature * @param {Feature} feature */ export function getCentroidGridRef(feature: Feature): any; /** * Make a form submit handler that only allows submissions from allowed buttons * @param {HTMLButtonElement[]} buttons - the form buttons to allow submissions */ export function formSubmitFactory(buttons: HTMLButtonElement[]): (e: SubmitEvent) => void; /** * Initialise location maps * @param {Partial} config - the map configuration */ export function initMaps(config?: Partial): void; /** * OS API request proxy factory * @param {string} apiPath - the root API path */ export function makeTileRequestTransformer(apiPath: string): (url: string, resourceType: string) => { url: string; headers: {}; }; /** * Create a Defra map instance * @param {string} mapId - the map id * @param {InteractiveMapInitConfig} initConfig - the map initial configuration * @param {MapsEnvironmentConfig} mapsConfig - the map environment params */ export function createMap(mapId: string, initConfig: InteractiveMapInitConfig, mapsConfig: MapsEnvironmentConfig): { map: InteractiveMap; interactPlugin: any; }; /** * Updates the marker position and moves the map view port the new location * @param {InteractiveMap} map - the map component instance (of InteractiveMap) * @param {MapLibreMap} mapProvider - the map provider instance (of MapLibreMap) * @param {MapCenter} center - the point */ export function centerMap(map: InteractiveMap, mapProvider: MapLibreMap, center: MapCenter): void; /** @type {InteractiveMapInitConfig} */ export const defaultConfig: InteractiveMapInitConfig; export namespace EVENTS { let mapReady: string; let interactMarkerChange: string; let drawReady: string; let drawCreated: string; let drawEdited: string; let drawCancelled: string; } export function transformGeocodeRequest(request: { url: string; options: { method: "get"; }; }): Request; /** * - an instance of a InteractiveMap */ export type InteractiveMap = { /** * - register callback listeners to map events */ on: Function; /** * - adds a new panel to the map */ addPanel: Function; /** * - adds/updates a marker */ addMarker: Function; /** * - removes a marker */ removeMarker: Function; /** * - adds/updates a button */ addButton: Function; /** * - toggle the state of a button */ toggleButtonState: Function; }; export type MapLibreMap = { /** * - pans/zooms to a new location */ flyTo: Function; /** * - fits the my to the new bounds */ fitBounds: Function; }; /** * - Map center point as [long, lat] */ export type MapCenter = [number, number]; /** * - additional config that can be provided to InteractiveMap */ export type InteractiveMapInitConfig = { /** * - the zoom level of the map */ zoom: string; /** * - the center point of the map */ center: MapCenter; /** * - the markers to add to the map */ markers?: { id: string; coords: MapCenter; }[] | undefined; /** * - additional plugins */ plugins?: any[] | undefined; }; export type TileData = { /** * - the outdoor tile URL */ VTS_OUTDOOR_URL: string; /** * - the dark tile URL */ VTS_DARK_URL: string; /** * - the black and white tile URL */ VTS_BLACK_AND_WHITE_URL: string; }; export type MapsEnvironmentConfig = { /** * - the root asset path */ assetPath: string; /** * - the root API path */ apiPath: string; /** * - the tile data config */ data: TileData; }; import type { Feature } from '~/src/server/plugins/engine/types.js';