GeocodingService
Class: GeocodingService
Forward and reverse geocoding against the Wemap geocoding API.
Ported from livemap's GeocodingService without map-viewport helpers
(centerZoom / LocationObject). Use returned bbox / coordinates with
@wemap/geo and the map package as needed.
Do not instantiate this directly — retrieve a configured instance with
core.createGeocodingService().
Example
import { core } from '@wemap/core';
const geocoding = core.createGeocodingService({ language: 'fr', region: 'fr' });
const place = await geocoding.search('Paris');
const nearby = await geocoding.reverseGeocode(48.85, 2.35);
Constructors
Constructor
new GeocodingService(
options?):GeocodingService
Parameters
options?
Base URL and default language / region / bbox filters.
Returns
GeocodingService
Methods
reverseGeocode()
reverseGeocode(
latitude,longitude,options?):Promise<GeocodingResult|null>
Reverse-geocode a WGS84 coordinate to an address / place.
Parameters
latitude
number
Latitude in degrees
longitude
number
Longitude in degrees
options?
Pick<GeocodingSearchOptions, "language">
Returns
Promise<GeocodingResult | null>
search()
search(
query,options?):Promise<GeocodingResult|null>
Search for a place by text and return the best match, or null if none.
Parameters
query
string
options?
Returns
Promise<GeocodingResult | null>
searchMultiple()
searchMultiple(
query,options?):Promise<GeocodingResult[]>
Search for a place by text and return all matching features.
Parameters
query
string
options?
Returns
Promise<GeocodingResult[]>