@honua/sdk-js/geocoding — HonuaGeocodingClient for forward / reverse geocoding and typeahead suggestions over a Honua-hosted GeocodeServer.
@honua/sdk-js/geocoding
HonuaGeocodingClient
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"); Copy
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);}); Copy
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);});
@honua/sdk-js/geocoding—HonuaGeocodingClientfor forward / reverse geocoding and typeahead suggestions over a Honua-hosted GeocodeServer.Example
Example: Debounced typeahead