diff --git a/packages/geocoder/src/apis/otp/index.ts b/packages/geocoder/src/apis/otp/index.ts index 4cbadd1a6..24c712edc 100644 --- a/packages/geocoder/src/apis/otp/index.ts +++ b/packages/geocoder/src/apis/otp/index.ts @@ -11,11 +11,12 @@ type OTPGeocoderResponse = { results: { coordinate: { lat: number, - lng: number, + lon: number, }, code: string, name: string, - id: string + id: string, + modes: string[] }[] } | undefined diff --git a/packages/geocoder/src/geocoders/otp.ts b/packages/geocoder/src/geocoders/otp.ts index 4a73e85b8..7ca884c64 100644 --- a/packages/geocoder/src/geocoders/otp.ts +++ b/packages/geocoder/src/geocoders/otp.ts @@ -23,11 +23,11 @@ export default class OTPGeocoder extends Geocoder { rewriteAutocompleteResponse(response: OTPGeocoderResponse): MultiGeocoderResponse { return { features: response?.results?.map(stop => ({ - geometry: { type: "Point", coordinates: [stop.coordinate.lng, stop.coordinate.lat] }, + geometry: { type: "Point", coordinates: [stop.coordinate.lon, stop.coordinate.lat] }, id: stop.id, // TODO: if non-stops are supported, these need to be detected here and // this layer property updated accordingly - properties: { layer: "stops", source: "otp", name: stop.name, label: stop.code }, + properties: { layer: "stops", source: "otp", modes: stop.modes, name: stop.name, label: `${stop.name} (${stop.code})` }, type: "Feature" })), type: "FeatureCollection"