Module geocoding

@honua/sdk-js/geocodingHonuaGeocodingClient for forward / reverse geocoding and typeahead suggestions over a Honua-hosted GeocodeServer.

import { HonuaGeocodingClient } from "@honua/sdk-js/geocoding";

const geo = new HonuaGeocodingClient({
baseUrl: "https://your-honua-server.example",
locatorName: "world-geocoder",
});

const results = await geo.forwardGeocode("1 Honolulu Pl, HI");
// reverseGeocode is latitude-first, then longitude.
const here = await geo.reverseGeocode(21.30, -157.85);
const hints = await geo.suggest("honol");
let timer: ReturnType<typeof setTimeout> | undefined;
input.addEventListener("input", (event) => {
clearTimeout(timer);
const text = (event.target as HTMLInputElement).value;
timer = setTimeout(async () => {
render(await geo.suggest(text));
}, 200);
});

References

Re-exports CapabilityPolicy