Drop-in replacement for ArcGIS esri/tasks/Locator / @arcgis/core/rest/locator, executed against a caller-configured GeocodingProvider.

import { LocatorCompat } from "@honua/sdk-js/esri-compat";
import { photonGeocodingProvider } from "@honua/sdk-js/geocoding";

const locator = new LocatorCompat({
provider: photonGeocodingProvider({ baseUrl: "https://photon.example.org" }),
});
const candidates = await locator.addressToLocations({
address: { SingleLine: "1 Honolulu Pl, HI" },
maxLocations: 5,
});

Constructors

Properties

apiKey: undefined | string
capabilityPolicy: CapabilityPolicy
eventBus: CompatEventBus
extentPaddingDegrees: number
loaded: boolean
maxLocations: number
provider: undefined | GeocodingProvider

Geocoding provider every operation runs against. Mutable so a migrated app can attach one after construction (locator.provider = photonGeocodingProvider(...)), which is the single assisted step the codemod cannot perform for you.

requestOptions: undefined | Readonly<Record<string, unknown>>
url: undefined | string

Accessors

Methods