From c867b7042a67f6073c9a9f527acebc963fbdbf24 Mon Sep 17 00:00:00 2001 From: Jay Harris Date: Mon, 5 Feb 2024 21:30:28 +1300 Subject: [PATCH] Add mapref search --- src/layers/mapSheets.ts | 2355 +++++++++++++++++++++++++++++++++++++ src/search/geocode.ts | 14 +- src/utils/mapReference.ts | 2 +- 3 files changed, 2369 insertions(+), 2 deletions(-) diff --git a/src/layers/mapSheets.ts b/src/layers/mapSheets.ts index f26628e..de96bde 100644 --- a/src/layers/mapSheets.ts +++ b/src/layers/mapSheets.ts @@ -2352,3 +2352,2358 @@ export const NZMG = [ "sheet": "D50" } ] + +export const NZTM = [ + { + "xmin": 2410000, + "xmax": 2450000, + "ymin": 6760000, + "ymax": 6772604, + "sheet": "L1" + }, + { + "xmin": 2450000, + "xmax": 2490000, + "ymin": 6730000, + "ymax": 6760000, + "sheet": "M2" + }, + { + "xmin": 2490000, + "xmax": 2530000, + "ymin": 6730000, + "ymax": 6760000, + "sheet": "N2" + }, + { + "xmin": 2490000, + "xmax": 2530000, + "ymin": 6700000, + "ymax": 6730000, + "sheet": "N3" + }, + { + "xmin": 2530000, + "xmax": 2570000, + "ymin": 6700000, + "ymax": 6730000, + "sheet": "O3" + }, + { + "xmin": 2490000, + "xmax": 2530000, + "ymin": 6670000, + "ymax": 6700000, + "sheet": "N4" + }, + { + "xmin": 2530000, + "xmax": 2570000, + "ymin": 6670000, + "ymax": 6700000, + "sheet": "O4" + }, + { + "xmin": 2570000, + "xmax": 2610000, + "ymin": 6670000, + "ymax": 6700000, + "sheet": "P4" + }, + { + "xmin": 2610000, + "xmax": 2650000, + "ymin": 6670000, + "ymax": 6700000, + "sheet": "Q4" + }, + { + "xmin": 2490000, + "xmax": 2530000, + "ymin": 6640000, + "ymax": 6670000, + "sheet": "N5" + }, + { + "xmin": 2530000, + "xmax": 2570000, + "ymin": 6640000, + "ymax": 6670000, + "sheet": "O5" + }, + { + "xmin": 2570000, + "xmax": 2610000, + "ymin": 6640000, + "ymax": 6670000, + "sheet": "P5" + }, + { + "xmin": 2610000, + "xmax": 2650000, + "ymin": 6640000, + "ymax": 6670000, + "sheet": "Q5" + }, + { + "xmin": 2530000, + "xmax": 2570000, + "ymin": 6610000, + "ymax": 6640000, + "sheet": "O6" + }, + { + "xmin": 2570000, + "xmax": 2610000, + "ymin": 6610000, + "ymax": 6640000, + "sheet": "P6" + }, + { + "xmin": 2610000, + "xmax": 2650000, + "ymin": 6610000, + "ymax": 6640000, + "sheet": "Q6" + }, + { + "xmin": 2650000, + "xmax": 2690000, + "ymin": 6610000, + "ymax": 6640000, + "sheet": "R6" + }, + { + "xmin": 2530000, + "xmax": 2570000, + "ymin": 6580000, + "ymax": 6610000, + "sheet": "O7" + }, + { + "xmin": 2570000, + "xmax": 2610000, + "ymin": 6580000, + "ymax": 6610000, + "sheet": "P7" + }, + { + "xmin": 2610000, + "xmax": 2650000, + "ymin": 6580000, + "ymax": 6610000, + "sheet": "Q7" + }, + { + "xmin": 2650000, + "xmax": 2690000, + "ymin": 6580000, + "ymax": 6610000, + "sheet": "R7" + }, + { + "xmin": 2690000, + "xmax": 2730000, + "ymin": 6580000, + "ymax": 6610000, + "sheet": "S7" + }, + { + "xmin": 2570000, + "xmax": 2610000, + "ymin": 6550000, + "ymax": 6580000, + "sheet": "P8" + }, + { + "xmin": 2610000, + "xmax": 2650000, + "ymin": 6550000, + "ymax": 6580000, + "sheet": "Q8" + }, + { + "xmin": 2650000, + "xmax": 2690000, + "ymin": 6550000, + "ymax": 6580000, + "sheet": "R8" + }, + { + "xmin": 2690000, + "xmax": 2730000, + "ymin": 6550000, + "ymax": 6580000, + "sheet": "S8" + }, + { + "xmin": 2730000, + "xmax": 2770000, + "ymin": 6550000, + "ymax": 6580000, + "sheet": "T8" + }, + { + "xmin": 2570000, + "xmax": 2610000, + "ymin": 6520000, + "ymax": 6550000, + "sheet": "P9" + }, + { + "xmin": 2610000, + "xmax": 2650000, + "ymin": 6520000, + "ymax": 6550000, + "sheet": "Q9" + }, + { + "xmin": 2650000, + "xmax": 2690000, + "ymin": 6520000, + "ymax": 6550000, + "sheet": "R9" + }, + { + "xmin": 2690000, + "xmax": 2730000, + "ymin": 6520000, + "ymax": 6550000, + "sheet": "S9" + }, + { + "xmin": 2730000, + "xmax": 2770000, + "ymin": 6520000, + "ymax": 6550000, + "sheet": "T9" + }, + { + "xmin": 2610000, + "xmax": 2650000, + "ymin": 6490000, + "ymax": 6520000, + "sheet": "Q10" + }, + { + "xmin": 2650000, + "xmax": 2690000, + "ymin": 6490000, + "ymax": 6520000, + "sheet": "R10" + }, + { + "xmin": 2690000, + "xmax": 2730000, + "ymin": 6490000, + "ymax": 6520000, + "sheet": "S10" + }, + { + "xmin": 2730000, + "xmax": 2770000, + "ymin": 6490000, + "ymax": 6520000, + "sheet": "T10" + }, + { + "xmin": 2770000, + "xmax": 2810000, + "ymin": 6490000, + "ymax": 6520000, + "sheet": "U10" + }, + { + "xmin": 2610000, + "xmax": 2650000, + "ymin": 6460000, + "ymax": 6490000, + "sheet": "Q11" + }, + { + "xmin": 2650000, + "xmax": 2690000, + "ymin": 6460000, + "ymax": 6490000, + "sheet": "R11" + }, + { + "xmin": 2690000, + "xmax": 2730000, + "ymin": 6460000, + "ymax": 6490000, + "sheet": "S11" + }, + { + "xmin": 2730000, + "xmax": 2770000, + "ymin": 6460000, + "ymax": 6490000, + "sheet": "T11" + }, + { + "xmin": 2770000, + "xmax": 2810000, + "ymin": 6460000, + "ymax": 6490000, + "sheet": "U11" + }, + { + "xmin": 2610000, + "xmax": 2650000, + "ymin": 6430000, + "ymax": 6460000, + "sheet": "Q12" + }, + { + "xmin": 2650000, + "xmax": 2690000, + "ymin": 6430000, + "ymax": 6460000, + "sheet": "R12" + }, + { + "xmin": 2690000, + "xmax": 2730000, + "ymin": 6430000, + "ymax": 6460000, + "sheet": "S12" + }, + { + "xmin": 2730000, + "xmax": 2770000, + "ymin": 6430000, + "ymax": 6460000, + "sheet": "T12" + }, + { + "xmin": 2770000, + "xmax": 2810000, + "ymin": 6430000, + "ymax": 6460000, + "sheet": "U12" + }, + { + "xmin": 2650000, + "xmax": 2690000, + "ymin": 6400000, + "ymax": 6430000, + "sheet": "R13" + }, + { + "xmin": 2690000, + "xmax": 2730000, + "ymin": 6400000, + "ymax": 6430000, + "sheet": "S13" + }, + { + "xmin": 2730000, + "xmax": 2770000, + "ymin": 6400000, + "ymax": 6430000, + "sheet": "T13" + }, + { + "xmin": 2770000, + "xmax": 2810000, + "ymin": 6400000, + "ymax": 6430000, + "sheet": "U13" + }, + { + "xmin": 2650000, + "xmax": 2690000, + "ymin": 6370000, + "ymax": 6400000, + "sheet": "R14" + }, + { + "xmin": 2690000, + "xmax": 2730000, + "ymin": 6370000, + "ymax": 6400000, + "sheet": "S14" + }, + { + "xmin": 2730000, + "xmax": 2770000, + "ymin": 6370000, + "ymax": 6400000, + "sheet": "T14" + }, + { + "xmin": 2770000, + "xmax": 2810000, + "ymin": 6370000, + "ymax": 6400000, + "sheet": "U14" + }, + { + "xmin": 2810000, + "xmax": 2850000, + "ymin": 6370000, + "ymax": 6400000, + "sheet": "V14" + }, + { + "xmin": 2890000, + "xmax": 2930000, + "ymin": 6370000, + "ymax": 6400000, + "sheet": "X14" + }, + { + "xmin": 2930000, + "xmax": 2970000, + "ymin": 6370000, + "ymax": 6400000, + "sheet": "Y14" + }, + { + "xmin": 2970000, + "xmax": 3010000, + "ymin": 6370000, + "ymax": 6400000, + "sheet": "Z14" + }, + { + "xmin": 2610000, + "xmax": 2650000, + "ymin": 6340000, + "ymax": 6370000, + "sheet": "Q15" + }, + { + "xmin": 2650000, + "xmax": 2690000, + "ymin": 6340000, + "ymax": 6370000, + "sheet": "R15" + }, + { + "xmin": 2690000, + "xmax": 2730000, + "ymin": 6340000, + "ymax": 6370000, + "sheet": "S15" + }, + { + "xmin": 2730000, + "xmax": 2770000, + "ymin": 6340000, + "ymax": 6370000, + "sheet": "T15" + }, + { + "xmin": 2770000, + "xmax": 2810000, + "ymin": 6340000, + "ymax": 6370000, + "sheet": "U15" + }, + { + "xmin": 2810000, + "xmax": 2850000, + "ymin": 6340000, + "ymax": 6370000, + "sheet": "V15" + }, + { + "xmin": 2850000, + "xmax": 2890000, + "ymin": 6340000, + "ymax": 6370000, + "sheet": "W15" + }, + { + "xmin": 2890000, + "xmax": 2930000, + "ymin": 6340000, + "ymax": 6370000, + "sheet": "X15" + }, + { + "xmin": 2930000, + "xmax": 2970000, + "ymin": 6340000, + "ymax": 6370000, + "sheet": "Y15" + }, + { + "xmin": 2970000, + "xmax": 3010000, + "ymin": 6340000, + "ymax": 6370000, + "sheet": "Z15" + }, + { + "xmin": 2650000, + "xmax": 2690000, + "ymin": 6310000, + "ymax": 6340000, + "sheet": "R16" + }, + { + "xmin": 2690000, + "xmax": 2730000, + "ymin": 6310000, + "ymax": 6340000, + "sheet": "S16" + }, + { + "xmin": 2730000, + "xmax": 2770000, + "ymin": 6310000, + "ymax": 6340000, + "sheet": "T16" + }, + { + "xmin": 2770000, + "xmax": 2810000, + "ymin": 6310000, + "ymax": 6340000, + "sheet": "U16" + }, + { + "xmin": 2810000, + "xmax": 2850000, + "ymin": 6310000, + "ymax": 6340000, + "sheet": "V16" + }, + { + "xmin": 2850000, + "xmax": 2890000, + "ymin": 6310000, + "ymax": 6340000, + "sheet": "W16" + }, + { + "xmin": 2890000, + "xmax": 2930000, + "ymin": 6310000, + "ymax": 6340000, + "sheet": "X16" + }, + { + "xmin": 2930000, + "xmax": 2970000, + "ymin": 6310000, + "ymax": 6340000, + "sheet": "Y16" + }, + { + "xmin": 2970000, + "xmax": 3010000, + "ymin": 6310000, + "ymax": 6340000, + "sheet": "Z16" + }, + { + "xmin": 2650000, + "xmax": 2690000, + "ymin": 6280000, + "ymax": 6310000, + "sheet": "R17" + }, + { + "xmin": 2690000, + "xmax": 2730000, + "ymin": 6280000, + "ymax": 6310000, + "sheet": "S17" + }, + { + "xmin": 2730000, + "xmax": 2770000, + "ymin": 6280000, + "ymax": 6310000, + "sheet": "T17" + }, + { + "xmin": 2770000, + "xmax": 2810000, + "ymin": 6280000, + "ymax": 6310000, + "sheet": "U17" + }, + { + "xmin": 2810000, + "xmax": 2850000, + "ymin": 6280000, + "ymax": 6310000, + "sheet": "V17" + }, + { + "xmin": 2850000, + "xmax": 2890000, + "ymin": 6280000, + "ymax": 6310000, + "sheet": "W17" + }, + { + "xmin": 2890000, + "xmax": 2930000, + "ymin": 6280000, + "ymax": 6310000, + "sheet": "X17" + }, + { + "xmin": 2930000, + "xmax": 2970000, + "ymin": 6280000, + "ymax": 6310000, + "sheet": "Y17" + }, + { + "xmin": 2970000, + "xmax": 3010000, + "ymin": 6280000, + "ymax": 6310000, + "sheet": "Z17" + }, + { + "xmin": 2610000, + "xmax": 2650000, + "ymin": 6250000, + "ymax": 6280000, + "sheet": "Q18" + }, + { + "xmin": 2650000, + "xmax": 2690000, + "ymin": 6250000, + "ymax": 6280000, + "sheet": "R18" + }, + { + "xmin": 2690000, + "xmax": 2730000, + "ymin": 6250000, + "ymax": 6280000, + "sheet": "S18" + }, + { + "xmin": 2730000, + "xmax": 2770000, + "ymin": 6250000, + "ymax": 6280000, + "sheet": "T18" + }, + { + "xmin": 2770000, + "xmax": 2810000, + "ymin": 6250000, + "ymax": 6280000, + "sheet": "U18" + }, + { + "xmin": 2810000, + "xmax": 2850000, + "ymin": 6250000, + "ymax": 6280000, + "sheet": "V18" + }, + { + "xmin": 2850000, + "xmax": 2890000, + "ymin": 6250000, + "ymax": 6280000, + "sheet": "W18" + }, + { + "xmin": 2890000, + "xmax": 2930000, + "ymin": 6250000, + "ymax": 6280000, + "sheet": "X18" + }, + { + "xmin": 2930000, + "xmax": 2970000, + "ymin": 6250000, + "ymax": 6280000, + "sheet": "Y18" + }, + { + "xmin": 2570000, + "xmax": 2610000, + "ymin": 6220000, + "ymax": 6250000, + "sheet": "P19" + }, + { + "xmin": 2610000, + "xmax": 2650000, + "ymin": 6220000, + "ymax": 6250000, + "sheet": "Q19" + }, + { + "xmin": 2650000, + "xmax": 2690000, + "ymin": 6220000, + "ymax": 6250000, + "sheet": "R19" + }, + { + "xmin": 2690000, + "xmax": 2730000, + "ymin": 6220000, + "ymax": 6250000, + "sheet": "S19" + }, + { + "xmin": 2730000, + "xmax": 2770000, + "ymin": 6220000, + "ymax": 6250000, + "sheet": "T19" + }, + { + "xmin": 2770000, + "xmax": 2810000, + "ymin": 6220000, + "ymax": 6250000, + "sheet": "U19" + }, + { + "xmin": 2810000, + "xmax": 2850000, + "ymin": 6220000, + "ymax": 6250000, + "sheet": "V19" + }, + { + "xmin": 2850000, + "xmax": 2890000, + "ymin": 6220000, + "ymax": 6250000, + "sheet": "W19" + }, + { + "xmin": 2890000, + "xmax": 2930000, + "ymin": 6220000, + "ymax": 6250000, + "sheet": "X19" + }, + { + "xmin": 2930000, + "xmax": 2970000, + "ymin": 6220000, + "ymax": 6250000, + "sheet": "Y19" + }, + { + "xmin": 2570000, + "xmax": 2610000, + "ymin": 6190000, + "ymax": 6220000, + "sheet": "P20" + }, + { + "xmin": 2610000, + "xmax": 2650000, + "ymin": 6190000, + "ymax": 6220000, + "sheet": "Q20" + }, + { + "xmin": 2650000, + "xmax": 2690000, + "ymin": 6190000, + "ymax": 6220000, + "sheet": "R20" + }, + { + "xmin": 2690000, + "xmax": 2730000, + "ymin": 6190000, + "ymax": 6220000, + "sheet": "S20" + }, + { + "xmin": 2730000, + "xmax": 2770000, + "ymin": 6190000, + "ymax": 6220000, + "sheet": "T20" + }, + { + "xmin": 2770000, + "xmax": 2810000, + "ymin": 6190000, + "ymax": 6220000, + "sheet": "U20" + }, + { + "xmin": 2810000, + "xmax": 2850000, + "ymin": 6190000, + "ymax": 6220000, + "sheet": "V20" + }, + { + "xmin": 2850000, + "xmax": 2890000, + "ymin": 6190000, + "ymax": 6220000, + "sheet": "W20" + }, + { + "xmin": 2890000, + "xmax": 2930000, + "ymin": 6190000, + "ymax": 6220000, + "sheet": "X20" + }, + { + "xmin": 2930000, + "xmax": 2970000, + "ymin": 6190000, + "ymax": 6220000, + "sheet": "Y20" + }, + { + "xmin": 2570000, + "xmax": 2610000, + "ymin": 6160000, + "ymax": 6190000, + "sheet": "P21" + }, + { + "xmin": 2610000, + "xmax": 2650000, + "ymin": 6160000, + "ymax": 6190000, + "sheet": "Q21" + }, + { + "xmin": 2650000, + "xmax": 2690000, + "ymin": 6160000, + "ymax": 6190000, + "sheet": "R21" + }, + { + "xmin": 2690000, + "xmax": 2730000, + "ymin": 6160000, + "ymax": 6190000, + "sheet": "S21" + }, + { + "xmin": 2730000, + "xmax": 2770000, + "ymin": 6160000, + "ymax": 6190000, + "sheet": "T21" + }, + { + "xmin": 2770000, + "xmax": 2810000, + "ymin": 6160000, + "ymax": 6190000, + "sheet": "U21" + }, + { + "xmin": 2810000, + "xmax": 2850000, + "ymin": 6160000, + "ymax": 6190000, + "sheet": "V21" + }, + { + "xmin": 2850000, + "xmax": 2890000, + "ymin": 6160000, + "ymax": 6190000, + "sheet": "W21" + }, + { + "xmin": 2610000, + "xmax": 2650000, + "ymin": 6130000, + "ymax": 6160000, + "sheet": "Q22" + }, + { + "xmin": 2650000, + "xmax": 2690000, + "ymin": 6130000, + "ymax": 6160000, + "sheet": "R22" + }, + { + "xmin": 2690000, + "xmax": 2730000, + "ymin": 6130000, + "ymax": 6160000, + "sheet": "S22" + }, + { + "xmin": 2730000, + "xmax": 2770000, + "ymin": 6130000, + "ymax": 6160000, + "sheet": "T22" + }, + { + "xmin": 2770000, + "xmax": 2810000, + "ymin": 6130000, + "ymax": 6160000, + "sheet": "U22" + }, + { + "xmin": 2810000, + "xmax": 2850000, + "ymin": 6130000, + "ymax": 6160000, + "sheet": "V22" + }, + { + "xmin": 2850000, + "xmax": 2890000, + "ymin": 6130000, + "ymax": 6160000, + "sheet": "W22" + }, + { + "xmin": 2650000, + "xmax": 2690000, + "ymin": 6100000, + "ymax": 6130000, + "sheet": "R23" + }, + { + "xmin": 2690000, + "xmax": 2730000, + "ymin": 6100000, + "ymax": 6130000, + "sheet": "S23" + }, + { + "xmin": 2730000, + "xmax": 2770000, + "ymin": 6100000, + "ymax": 6130000, + "sheet": "T23" + }, + { + "xmin": 2770000, + "xmax": 2810000, + "ymin": 6100000, + "ymax": 6130000, + "sheet": "U23" + }, + { + "xmin": 2810000, + "xmax": 2850000, + "ymin": 6100000, + "ymax": 6130000, + "sheet": "V23" + }, + { + "xmin": 2450000, + "xmax": 2490000, + "ymin": 6070000, + "ymax": 6100000, + "sheet": "M24" + }, + { + "xmin": 2490000, + "xmax": 2530000, + "ymin": 6070000, + "ymax": 6100000, + "sheet": "N24" + }, + { + "xmin": 2690000, + "xmax": 2730000, + "ymin": 6070000, + "ymax": 6100000, + "sheet": "S24" + }, + { + "xmin": 2730000, + "xmax": 2770000, + "ymin": 6070000, + "ymax": 6100000, + "sheet": "T24" + }, + { + "xmin": 2770000, + "xmax": 2810000, + "ymin": 6070000, + "ymax": 6100000, + "sheet": "U24" + }, + { + "xmin": 2810000, + "xmax": 2850000, + "ymin": 6070000, + "ymax": 6100000, + "sheet": "V24" + }, + { + "xmin": 2410000, + "xmax": 2450000, + "ymin": 6040000, + "ymax": 6070000, + "sheet": "L25" + }, + { + "xmin": 2450000, + "xmax": 2490000, + "ymin": 6040000, + "ymax": 6070000, + "sheet": "M25" + }, + { + "xmin": 2490000, + "xmax": 2530000, + "ymin": 6040000, + "ymax": 6070000, + "sheet": "N25" + }, + { + "xmin": 2570000, + "xmax": 2610000, + "ymin": 6040000, + "ymax": 6070000, + "sheet": "P25" + }, + { + "xmin": 2650000, + "xmax": 2690000, + "ymin": 6040000, + "ymax": 6070000, + "sheet": "R25" + }, + { + "xmin": 2690000, + "xmax": 2730000, + "ymin": 6040000, + "ymax": 6070000, + "sheet": "S25" + }, + { + "xmin": 2730000, + "xmax": 2770000, + "ymin": 6040000, + "ymax": 6070000, + "sheet": "T25" + }, + { + "xmin": 2770000, + "xmax": 2810000, + "ymin": 6040000, + "ymax": 6070000, + "sheet": "U25" + }, + { + "xmin": 2410000, + "xmax": 2450000, + "ymin": 6010000, + "ymax": 6040000, + "sheet": "L26" + }, + { + "xmin": 2450000, + "xmax": 2490000, + "ymin": 6010000, + "ymax": 6040000, + "sheet": "M26" + }, + { + "xmin": 2490000, + "xmax": 2530000, + "ymin": 6010000, + "ymax": 6040000, + "sheet": "N26" + }, + { + "xmin": 2530000, + "xmax": 2570000, + "ymin": 6010000, + "ymax": 6040000, + "sheet": "O26" + }, + { + "xmin": 2570000, + "xmax": 2610000, + "ymin": 6010000, + "ymax": 6040000, + "sheet": "P26" + }, + { + "xmin": 2610000, + "xmax": 2650000, + "ymin": 6010000, + "ymax": 6040000, + "sheet": "Q26" + }, + { + "xmin": 2650000, + "xmax": 2690000, + "ymin": 6010000, + "ymax": 6040000, + "sheet": "R26" + }, + { + "xmin": 2690000, + "xmax": 2730000, + "ymin": 6010000, + "ymax": 6040000, + "sheet": "S26" + }, + { + "xmin": 2730000, + "xmax": 2770000, + "ymin": 6010000, + "ymax": 6040000, + "sheet": "T26" + }, + { + "xmin": 2770000, + "xmax": 2810000, + "ymin": 6010000, + "ymax": 6040000, + "sheet": "U26" + }, + { + "xmin": 2410000, + "xmax": 2450000, + "ymin": 5980000, + "ymax": 6010000, + "sheet": "L27" + }, + { + "xmin": 2450000, + "xmax": 2490000, + "ymin": 5980000, + "ymax": 6010000, + "sheet": "M27" + }, + { + "xmin": 2490000, + "xmax": 2530000, + "ymin": 5980000, + "ymax": 6010000, + "sheet": "N27" + }, + { + "xmin": 2530000, + "xmax": 2570000, + "ymin": 5980000, + "ymax": 6010000, + "sheet": "O27" + }, + { + "xmin": 2570000, + "xmax": 2610000, + "ymin": 5980000, + "ymax": 6010000, + "sheet": "P27" + }, + { + "xmin": 2610000, + "xmax": 2650000, + "ymin": 5980000, + "ymax": 6010000, + "sheet": "Q27" + }, + { + "xmin": 2650000, + "xmax": 2690000, + "ymin": 5980000, + "ymax": 6010000, + "sheet": "R27" + }, + { + "xmin": 2690000, + "xmax": 2730000, + "ymin": 5980000, + "ymax": 6010000, + "sheet": "S27" + }, + { + "xmin": 2730000, + "xmax": 2770000, + "ymin": 5980000, + "ymax": 6010000, + "sheet": "T27" + }, + { + "xmin": 2410000, + "xmax": 2450000, + "ymin": 5950000, + "ymax": 5980000, + "sheet": "L28" + }, + { + "xmin": 2450000, + "xmax": 2490000, + "ymin": 5950000, + "ymax": 5980000, + "sheet": "M28" + }, + { + "xmin": 2490000, + "xmax": 2530000, + "ymin": 5950000, + "ymax": 5980000, + "sheet": "N28" + }, + { + "xmin": 2530000, + "xmax": 2570000, + "ymin": 5950000, + "ymax": 5980000, + "sheet": "O28" + }, + { + "xmin": 2570000, + "xmax": 2610000, + "ymin": 5950000, + "ymax": 5980000, + "sheet": "P28" + }, + { + "xmin": 2610000, + "xmax": 2650000, + "ymin": 5950000, + "ymax": 5980000, + "sheet": "Q28" + }, + { + "xmin": 2650000, + "xmax": 2690000, + "ymin": 5950000, + "ymax": 5980000, + "sheet": "R28" + }, + { + "xmin": 2690000, + "xmax": 2730000, + "ymin": 5950000, + "ymax": 5980000, + "sheet": "S28" + }, + { + "xmin": 2730000, + "xmax": 2770000, + "ymin": 5950000, + "ymax": 5980000, + "sheet": "T28" + }, + { + "xmin": 2370000, + "xmax": 2410000, + "ymin": 5920000, + "ymax": 5950000, + "sheet": "K29" + }, + { + "xmin": 2410000, + "xmax": 2450000, + "ymin": 5920000, + "ymax": 5950000, + "sheet": "L29" + }, + { + "xmin": 2450000, + "xmax": 2490000, + "ymin": 5920000, + "ymax": 5950000, + "sheet": "M29" + }, + { + "xmin": 2490000, + "xmax": 2530000, + "ymin": 5920000, + "ymax": 5950000, + "sheet": "N29" + }, + { + "xmin": 2530000, + "xmax": 2570000, + "ymin": 5920000, + "ymax": 5950000, + "sheet": "O29" + }, + { + "xmin": 2570000, + "xmax": 2610000, + "ymin": 5920000, + "ymax": 5950000, + "sheet": "P29" + }, + { + "xmin": 2610000, + "xmax": 2650000, + "ymin": 5920000, + "ymax": 5950000, + "sheet": "Q29" + }, + { + "xmin": 2370000, + "xmax": 2410000, + "ymin": 5890000, + "ymax": 5920000, + "sheet": "K30" + }, + { + "xmin": 2410000, + "xmax": 2450000, + "ymin": 5890000, + "ymax": 5920000, + "sheet": "L30" + }, + { + "xmin": 2450000, + "xmax": 2490000, + "ymin": 5890000, + "ymax": 5920000, + "sheet": "M30" + }, + { + "xmin": 2490000, + "xmax": 2530000, + "ymin": 5890000, + "ymax": 5920000, + "sheet": "N30" + }, + { + "xmin": 2530000, + "xmax": 2570000, + "ymin": 5890000, + "ymax": 5920000, + "sheet": "O30" + }, + { + "xmin": 2570000, + "xmax": 2610000, + "ymin": 5890000, + "ymax": 5920000, + "sheet": "P30" + }, + { + "xmin": 2330000, + "xmax": 2370000, + "ymin": 5860000, + "ymax": 5890000, + "sheet": "J31" + }, + { + "xmin": 2370000, + "xmax": 2410000, + "ymin": 5860000, + "ymax": 5890000, + "sheet": "K31" + }, + { + "xmin": 2410000, + "xmax": 2450000, + "ymin": 5860000, + "ymax": 5890000, + "sheet": "L31" + }, + { + "xmin": 2450000, + "xmax": 2490000, + "ymin": 5860000, + "ymax": 5890000, + "sheet": "M31" + }, + { + "xmin": 2490000, + "xmax": 2530000, + "ymin": 5860000, + "ymax": 5890000, + "sheet": "N31" + }, + { + "xmin": 2530000, + "xmax": 2570000, + "ymin": 5860000, + "ymax": 5890000, + "sheet": "O31" + }, + { + "xmin": 2570000, + "xmax": 2610000, + "ymin": 5860000, + "ymax": 5890000, + "sheet": "P31" + }, + { + "xmin": 2330000, + "xmax": 2370000, + "ymin": 5830000, + "ymax": 5860000, + "sheet": "J32" + }, + { + "xmin": 2370000, + "xmax": 2410000, + "ymin": 5830000, + "ymax": 5860000, + "sheet": "K32" + }, + { + "xmin": 2410000, + "xmax": 2450000, + "ymin": 5830000, + "ymax": 5860000, + "sheet": "L32" + }, + { + "xmin": 2450000, + "xmax": 2490000, + "ymin": 5830000, + "ymax": 5860000, + "sheet": "M32" + }, + { + "xmin": 2490000, + "xmax": 2530000, + "ymin": 5830000, + "ymax": 5860000, + "sheet": "N32" + }, + { + "xmin": 2530000, + "xmax": 2570000, + "ymin": 5830000, + "ymax": 5860000, + "sheet": "O32" + }, + { + "xmin": 2290000, + "xmax": 2330000, + "ymin": 5800000, + "ymax": 5830000, + "sheet": "I33" + }, + { + "xmin": 2330000, + "xmax": 2370000, + "ymin": 5800000, + "ymax": 5830000, + "sheet": "J33" + }, + { + "xmin": 2370000, + "xmax": 2410000, + "ymin": 5800000, + "ymax": 5830000, + "sheet": "K33" + }, + { + "xmin": 2410000, + "xmax": 2450000, + "ymin": 5800000, + "ymax": 5830000, + "sheet": "L33" + }, + { + "xmin": 2450000, + "xmax": 2490000, + "ymin": 5800000, + "ymax": 5830000, + "sheet": "M33" + }, + { + "xmin": 2490000, + "xmax": 2530000, + "ymin": 5800000, + "ymax": 5830000, + "sheet": "N33" + }, + { + "xmin": 2530000, + "xmax": 2570000, + "ymin": 5800000, + "ymax": 5830000, + "sheet": "O33" + }, + { + "xmin": 2250000, + "xmax": 2290000, + "ymin": 5770000, + "ymax": 5800000, + "sheet": "H34" + }, + { + "xmin": 2290000, + "xmax": 2330000, + "ymin": 5770000, + "ymax": 5800000, + "sheet": "I34" + }, + { + "xmin": 2330000, + "xmax": 2370000, + "ymin": 5770000, + "ymax": 5800000, + "sheet": "J34" + }, + { + "xmin": 2370000, + "xmax": 2410000, + "ymin": 5770000, + "ymax": 5800000, + "sheet": "K34" + }, + { + "xmin": 2410000, + "xmax": 2450000, + "ymin": 5770000, + "ymax": 5800000, + "sheet": "L34" + }, + { + "xmin": 2450000, + "xmax": 2490000, + "ymin": 5770000, + "ymax": 5800000, + "sheet": "M34" + }, + { + "xmin": 2490000, + "xmax": 2530000, + "ymin": 5770000, + "ymax": 5800000, + "sheet": "N34" + }, + { + "xmin": 2210000, + "xmax": 2250000, + "ymin": 5740000, + "ymax": 5770000, + "sheet": "G35" + }, + { + "xmin": 2250000, + "xmax": 2290000, + "ymin": 5740000, + "ymax": 5770000, + "sheet": "H35" + }, + { + "xmin": 2290000, + "xmax": 2330000, + "ymin": 5740000, + "ymax": 5770000, + "sheet": "I35" + }, + { + "xmin": 2330000, + "xmax": 2370000, + "ymin": 5740000, + "ymax": 5770000, + "sheet": "J35" + }, + { + "xmin": 2370000, + "xmax": 2410000, + "ymin": 5740000, + "ymax": 5770000, + "sheet": "K35" + }, + { + "xmin": 2410000, + "xmax": 2450000, + "ymin": 5740000, + "ymax": 5770000, + "sheet": "L35" + }, + { + "xmin": 2450000, + "xmax": 2490000, + "ymin": 5740000, + "ymax": 5770000, + "sheet": "M35" + }, + { + "xmin": 2490000, + "xmax": 2530000, + "ymin": 5740000, + "ymax": 5770000, + "sheet": "N35" + }, + { + "xmin": 2170000, + "xmax": 2210000, + "ymin": 5710000, + "ymax": 5740000, + "sheet": "F36" + }, + { + "xmin": 2210000, + "xmax": 2250000, + "ymin": 5710000, + "ymax": 5740000, + "sheet": "G36" + }, + { + "xmin": 2250000, + "xmax": 2290000, + "ymin": 5710000, + "ymax": 5740000, + "sheet": "H36" + }, + { + "xmin": 2290000, + "xmax": 2330000, + "ymin": 5710000, + "ymax": 5740000, + "sheet": "I36" + }, + { + "xmin": 2330000, + "xmax": 2370000, + "ymin": 5710000, + "ymax": 5740000, + "sheet": "J36" + }, + { + "xmin": 2370000, + "xmax": 2410000, + "ymin": 5710000, + "ymax": 5740000, + "sheet": "K36" + }, + { + "xmin": 2410000, + "xmax": 2450000, + "ymin": 5710000, + "ymax": 5740000, + "sheet": "L36" + }, + { + "xmin": 2450000, + "xmax": 2490000, + "ymin": 5710000, + "ymax": 5740000, + "sheet": "M36" + }, + { + "xmin": 2490000, + "xmax": 2530000, + "ymin": 5710000, + "ymax": 5740000, + "sheet": "N36" + }, + { + "xmin": 2130000, + "xmax": 2170000, + "ymin": 5680000, + "ymax": 5710000, + "sheet": "E37" + }, + { + "xmin": 2170000, + "xmax": 2210000, + "ymin": 5680000, + "ymax": 5710000, + "sheet": "F37" + }, + { + "xmin": 2210000, + "xmax": 2250000, + "ymin": 5680000, + "ymax": 5710000, + "sheet": "G37" + }, + { + "xmin": 2250000, + "xmax": 2290000, + "ymin": 5680000, + "ymax": 5710000, + "sheet": "H37" + }, + { + "xmin": 2290000, + "xmax": 2330000, + "ymin": 5680000, + "ymax": 5710000, + "sheet": "I37" + }, + { + "xmin": 2330000, + "xmax": 2370000, + "ymin": 5680000, + "ymax": 5710000, + "sheet": "J37" + }, + { + "xmin": 2370000, + "xmax": 2410000, + "ymin": 5680000, + "ymax": 5710000, + "sheet": "K37" + }, + { + "xmin": 2410000, + "xmax": 2450000, + "ymin": 5680000, + "ymax": 5710000, + "sheet": "L37" + }, + { + "xmin": 2450000, + "xmax": 2490000, + "ymin": 5680000, + "ymax": 5710000, + "sheet": "M37" + }, + { + "xmin": 2490000, + "xmax": 2530000, + "ymin": 5680000, + "ymax": 5710000, + "sheet": "N37" + }, + { + "xmin": 2090000, + "xmax": 2130000, + "ymin": 5650000, + "ymax": 5680000, + "sheet": "D38" + }, + { + "xmin": 2130000, + "xmax": 2170000, + "ymin": 5650000, + "ymax": 5680000, + "sheet": "E38" + }, + { + "xmin": 2170000, + "xmax": 2210000, + "ymin": 5650000, + "ymax": 5680000, + "sheet": "F38" + }, + { + "xmin": 2210000, + "xmax": 2250000, + "ymin": 5650000, + "ymax": 5680000, + "sheet": "G38" + }, + { + "xmin": 2250000, + "xmax": 2290000, + "ymin": 5650000, + "ymax": 5680000, + "sheet": "H38" + }, + { + "xmin": 2290000, + "xmax": 2330000, + "ymin": 5650000, + "ymax": 5680000, + "sheet": "I38" + }, + { + "xmin": 2330000, + "xmax": 2370000, + "ymin": 5650000, + "ymax": 5680000, + "sheet": "J38" + }, + { + "xmin": 2370000, + "xmax": 2410000, + "ymin": 5650000, + "ymax": 5680000, + "sheet": "K38" + }, + { + "xmin": 2090000, + "xmax": 2130000, + "ymin": 5620000, + "ymax": 5650000, + "sheet": "D39" + }, + { + "xmin": 2130000, + "xmax": 2170000, + "ymin": 5620000, + "ymax": 5650000, + "sheet": "E39" + }, + { + "xmin": 2170000, + "xmax": 2210000, + "ymin": 5620000, + "ymax": 5650000, + "sheet": "F39" + }, + { + "xmin": 2210000, + "xmax": 2250000, + "ymin": 5620000, + "ymax": 5650000, + "sheet": "G39" + }, + { + "xmin": 2250000, + "xmax": 2290000, + "ymin": 5620000, + "ymax": 5650000, + "sheet": "H39" + }, + { + "xmin": 2290000, + "xmax": 2330000, + "ymin": 5620000, + "ymax": 5650000, + "sheet": "I39" + }, + { + "xmin": 2330000, + "xmax": 2370000, + "ymin": 5620000, + "ymax": 5650000, + "sheet": "J39" + }, + { + "xmin": 2370000, + "xmax": 2410000, + "ymin": 5620000, + "ymax": 5650000, + "sheet": "K39" + }, + { + "xmin": 2050000, + "xmax": 2090000, + "ymin": 5590000, + "ymax": 5620000, + "sheet": "C40" + }, + { + "xmin": 2090000, + "xmax": 2130000, + "ymin": 5590000, + "ymax": 5620000, + "sheet": "D40" + }, + { + "xmin": 2130000, + "xmax": 2170000, + "ymin": 5590000, + "ymax": 5620000, + "sheet": "E40" + }, + { + "xmin": 2170000, + "xmax": 2210000, + "ymin": 5590000, + "ymax": 5620000, + "sheet": "F40" + }, + { + "xmin": 2210000, + "xmax": 2250000, + "ymin": 5590000, + "ymax": 5620000, + "sheet": "G40" + }, + { + "xmin": 2250000, + "xmax": 2290000, + "ymin": 5590000, + "ymax": 5620000, + "sheet": "H40" + }, + { + "xmin": 2290000, + "xmax": 2330000, + "ymin": 5590000, + "ymax": 5620000, + "sheet": "I40" + }, + { + "xmin": 2330000, + "xmax": 2370000, + "ymin": 5590000, + "ymax": 5620000, + "sheet": "J40" + }, + { + "xmin": 2010000, + "xmax": 2050000, + "ymin": 5560000, + "ymax": 5590000, + "sheet": "B41" + }, + { + "xmin": 2050000, + "xmax": 2090000, + "ymin": 5560000, + "ymax": 5590000, + "sheet": "C41" + }, + { + "xmin": 2090000, + "xmax": 2130000, + "ymin": 5560000, + "ymax": 5590000, + "sheet": "D41" + }, + { + "xmin": 2130000, + "xmax": 2170000, + "ymin": 5560000, + "ymax": 5590000, + "sheet": "E41" + }, + { + "xmin": 2170000, + "xmax": 2210000, + "ymin": 5560000, + "ymax": 5590000, + "sheet": "F41" + }, + { + "xmin": 2210000, + "xmax": 2250000, + "ymin": 5560000, + "ymax": 5590000, + "sheet": "G41" + }, + { + "xmin": 2250000, + "xmax": 2290000, + "ymin": 5560000, + "ymax": 5590000, + "sheet": "H41" + }, + { + "xmin": 2290000, + "xmax": 2330000, + "ymin": 5560000, + "ymax": 5590000, + "sheet": "I41" + }, + { + "xmin": 2330000, + "xmax": 2370000, + "ymin": 5560000, + "ymax": 5590000, + "sheet": "J41" + }, + { + "xmin": 2010000, + "xmax": 2050000, + "ymin": 5530000, + "ymax": 5560000, + "sheet": "B42" + }, + { + "xmin": 2050000, + "xmax": 2090000, + "ymin": 5530000, + "ymax": 5560000, + "sheet": "C42" + }, + { + "xmin": 2090000, + "xmax": 2130000, + "ymin": 5530000, + "ymax": 5560000, + "sheet": "D42" + }, + { + "xmin": 2130000, + "xmax": 2170000, + "ymin": 5530000, + "ymax": 5560000, + "sheet": "E42" + }, + { + "xmin": 2170000, + "xmax": 2210000, + "ymin": 5530000, + "ymax": 5560000, + "sheet": "F42" + }, + { + "xmin": 2210000, + "xmax": 2250000, + "ymin": 5530000, + "ymax": 5560000, + "sheet": "G42" + }, + { + "xmin": 2250000, + "xmax": 2290000, + "ymin": 5530000, + "ymax": 5560000, + "sheet": "H42" + }, + { + "xmin": 2290000, + "xmax": 2330000, + "ymin": 5530000, + "ymax": 5560000, + "sheet": "I42" + }, + { + "xmin": 2330000, + "xmax": 2370000, + "ymin": 5530000, + "ymax": 5560000, + "sheet": "J42" + }, + { + "xmin": 2010000, + "xmax": 2050000, + "ymin": 5500000, + "ymax": 5530000, + "sheet": "B43" + }, + { + "xmin": 2050000, + "xmax": 2090000, + "ymin": 5500000, + "ymax": 5530000, + "sheet": "C43" + }, + { + "xmin": 2090000, + "xmax": 2130000, + "ymin": 5500000, + "ymax": 5530000, + "sheet": "D43" + }, + { + "xmin": 2130000, + "xmax": 2170000, + "ymin": 5500000, + "ymax": 5530000, + "sheet": "E43" + }, + { + "xmin": 2170000, + "xmax": 2210000, + "ymin": 5500000, + "ymax": 5530000, + "sheet": "F43" + }, + { + "xmin": 2210000, + "xmax": 2250000, + "ymin": 5500000, + "ymax": 5530000, + "sheet": "G43" + }, + { + "xmin": 2250000, + "xmax": 2290000, + "ymin": 5500000, + "ymax": 5530000, + "sheet": "H43" + }, + { + "xmin": 2290000, + "xmax": 2330000, + "ymin": 5500000, + "ymax": 5530000, + "sheet": "I43" + }, + { + "xmin": 2330000, + "xmax": 2370000, + "ymin": 5500000, + "ymax": 5530000, + "sheet": "J43" + }, + { + "xmin": 1970000, + "xmax": 2010000, + "ymin": 5470000, + "ymax": 5500000, + "sheet": "A44" + }, + { + "xmin": 2010000, + "xmax": 2050000, + "ymin": 5470000, + "ymax": 5500000, + "sheet": "B44" + }, + { + "xmin": 2050000, + "xmax": 2090000, + "ymin": 5470000, + "ymax": 5500000, + "sheet": "C44" + }, + { + "xmin": 2090000, + "xmax": 2130000, + "ymin": 5470000, + "ymax": 5500000, + "sheet": "D44" + }, + { + "xmin": 2130000, + "xmax": 2170000, + "ymin": 5470000, + "ymax": 5500000, + "sheet": "E44" + }, + { + "xmin": 2170000, + "xmax": 2210000, + "ymin": 5470000, + "ymax": 5500000, + "sheet": "F44" + }, + { + "xmin": 2210000, + "xmax": 2250000, + "ymin": 5470000, + "ymax": 5500000, + "sheet": "G44" + }, + { + "xmin": 2250000, + "xmax": 2290000, + "ymin": 5470000, + "ymax": 5500000, + "sheet": "H44" + }, + { + "xmin": 2290000, + "xmax": 2330000, + "ymin": 5470000, + "ymax": 5500000, + "sheet": "I44" + }, + { + "xmin": 2330000, + "xmax": 2370000, + "ymin": 5470000, + "ymax": 5500000, + "sheet": "J44" + }, + { + "xmin": 1970000, + "xmax": 2010000, + "ymin": 5440000, + "ymax": 5470000, + "sheet": "A45" + }, + { + "xmin": 2010000, + "xmax": 2050000, + "ymin": 5440000, + "ymax": 5470000, + "sheet": "B45" + }, + { + "xmin": 2050000, + "xmax": 2090000, + "ymin": 5440000, + "ymax": 5470000, + "sheet": "C45" + }, + { + "xmin": 2090000, + "xmax": 2130000, + "ymin": 5440000, + "ymax": 5470000, + "sheet": "D45" + }, + { + "xmin": 2130000, + "xmax": 2170000, + "ymin": 5440000, + "ymax": 5470000, + "sheet": "E45" + }, + { + "xmin": 2170000, + "xmax": 2210000, + "ymin": 5440000, + "ymax": 5470000, + "sheet": "F45" + }, + { + "xmin": 2210000, + "xmax": 2250000, + "ymin": 5440000, + "ymax": 5470000, + "sheet": "G45" + }, + { + "xmin": 2250000, + "xmax": 2290000, + "ymin": 5440000, + "ymax": 5470000, + "sheet": "H45" + }, + { + "xmin": 2290000, + "xmax": 2330000, + "ymin": 5440000, + "ymax": 5470000, + "sheet": "I45" + }, + { + "xmin": 2010000, + "xmax": 2050000, + "ymin": 5410000, + "ymax": 5440000, + "sheet": "B46" + }, + { + "xmin": 2050000, + "xmax": 2090000, + "ymin": 5410000, + "ymax": 5440000, + "sheet": "C46" + }, + { + "xmin": 2090000, + "xmax": 2130000, + "ymin": 5410000, + "ymax": 5440000, + "sheet": "D46" + }, + { + "xmin": 2130000, + "xmax": 2170000, + "ymin": 5410000, + "ymax": 5440000, + "sheet": "E46" + }, + { + "xmin": 2170000, + "xmax": 2210000, + "ymin": 5410000, + "ymax": 5440000, + "sheet": "F46" + }, + { + "xmin": 2210000, + "xmax": 2250000, + "ymin": 5410000, + "ymax": 5440000, + "sheet": "G46" + }, + { + "xmin": 2250000, + "xmax": 2290000, + "ymin": 5410000, + "ymax": 5440000, + "sheet": "H46" + }, + { + "xmin": 2010000, + "xmax": 2050000, + "ymin": 5380000, + "ymax": 5410000, + "sheet": "B47" + }, + { + "xmin": 2090000, + "xmax": 2130000, + "ymin": 5380000, + "ymax": 5410000, + "sheet": "D47" + }, + { + "xmin": 2130000, + "xmax": 2170000, + "ymin": 5380000, + "ymax": 5410000, + "sheet": "E47" + }, + { + "xmin": 2170000, + "xmax": 2210000, + "ymin": 5380000, + "ymax": 5410000, + "sheet": "F47" + }, + { + "xmin": 2210000, + "xmax": 2250000, + "ymin": 5380000, + "ymax": 5410000, + "sheet": "G47" + }, + { + "xmin": 2250000, + "xmax": 2290000, + "ymin": 5380000, + "ymax": 5410000, + "sheet": "H47" + }, + { + "xmin": 2090000, + "xmax": 2130000, + "ymin": 5350000, + "ymax": 5380000, + "sheet": "D48" + }, + { + "xmin": 2130000, + "xmax": 2170000, + "ymin": 5350000, + "ymax": 5380000, + "sheet": "E48" + }, + { + "xmin": 2170000, + "xmax": 2210000, + "ymin": 5350000, + "ymax": 5380000, + "sheet": "F48" + }, + { + "xmin": 2050000, + "xmax": 2090000, + "ymin": 5320000, + "ymax": 5350000, + "sheet": "C49" + }, + { + "xmin": 2090000, + "xmax": 2130000, + "ymin": 5320000, + "ymax": 5350000, + "sheet": "D49" + }, + { + "xmin": 2130000, + "xmax": 2170000, + "ymin": 5320000, + "ymax": 5350000, + "sheet": "E49" + }, + { + "xmin": 2050000, + "xmax": 2090000, + "ymin": 5290000, + "ymax": 5320000, + "sheet": "C50" + }, + { + "xmin": 2090000, + "xmax": 2130000, + "ymin": 5290000, + "ymax": 5320000, + "sheet": "D50" + } +] diff --git a/src/search/geocode.ts b/src/search/geocode.ts index 0e73fa3..7785287 100644 --- a/src/search/geocode.ts +++ b/src/search/geocode.ts @@ -1,3 +1,4 @@ +import { convertNZMGReferenceToLatLng } from '../utils/mapReference'; import { getPlaces, type Place } from './places'; const getMatch = (queryParts: string[], place: Place) => { @@ -39,7 +40,18 @@ const searchNzPlaces = async (query: string, maxResults = 100): Promise return results } -export default async (query: string, sources = [searchNzPlaces]): Promise => { +const searchMapReferences = async (query: string): Promise => { + const ref = convertNZMGReferenceToLatLng(query)! + console.log(ref) + return [ref].filter(r => r).map(([lat, lon]) => ({ + name: query, + lat, + lon, + type: 'map-ref' + })) +} + +export default async (query: string, sources = [searchNzPlaces, searchMapReferences]): Promise => { const results = await Promise.all(sources.map(s => s(query))); return results.reduce((prev, next) => [...prev, ...next], []) } diff --git a/src/utils/mapReference.ts b/src/utils/mapReference.ts index 9eb89f9..e4b4f20 100644 --- a/src/utils/mapReference.ts +++ b/src/utils/mapReference.ts @@ -11,7 +11,7 @@ const coordToMap = (min: number, max: number, coord: string) => { return fromMin < min ? baseFrom(max) : fromMin } -export const convertNZMGReferenceToLatLng = (reference: string) => { +export const convertNZMGReferenceToLatLng = (reference: string): [number, number] | undefined => { const match = referenceRegex.exec(reference); if (!match) return;