t×tecexpressby TeKOcloud
DEv0.7.1
API & types / VUE

TxGeoAdapter.

Contract for custom geocoding/routing services. Call services yourself and bind results to the map.

ts
interface TxGeoAdapter {
  geocode?(query: string, signal?: AbortSignal): Promise<TxCoordinate[]>
  route?(points: TxCoordinate[], signal?: AbortSignal): Promise<TxCoordinate[]>
}
FieldMeaning
geocodeQueries a custom geographic service for coordinates matching text.
routeQueries a custom routing service for a route through waypoints.
ts
import type { TxGeoAdapter } from '@tekocloud.de/tecexpress'
const example: TxGeoAdapter = { geocode: async query => query ? [{ lat: 52.52, lng: 13.405 }] : [], route: async points => points }
console.log(example)