Skip to content

lance-ts


lance-ts / geocodeOneLineAddress

Function: geocodeOneLineAddress()

geocodeOneLineAddress(address): Promise\<OneLineAddressMatch | undefined>

Defined in: one-line-address.ts:48

Returns the first result from whatever address matches it receives

async function geocode() {
 const result = await geocodeOneLineAddress("123 Foo Street, CA, 4242")
 console.log(result)
 // { coordinates: { x: NUMBER, y: NUMBER }, matchedAddress: "ADDR"}
}

Parameters

address

string

{string}

Returns

Promise\<OneLineAddressMatch | undefined>

Throws

Error - "HTTP Error" if response status is not 200 OK