Skip to content

Routing: Display addresses instead of coordinates if ReverseGeocoder is configured #864

Description

@dopenguin

Description

Use the reverseGeocoder plugin to retrieve addresses for the selected route coordinates and display them in the routing inputs instead of raw coordinates.

The reverseGeocoder plugin already provides the required building blocks: it watches configured coordinateSources and on change, resolves an address via reverseGeocode, then passes the resulting ReverseGeocoderFeature (which carries a human-readable title) to a configured addressTarget store action. This issue is about wiring the routing plugin into that mechanism so waypoint coordinates are shown as addresses.

Current behavior

The connection between the routing and reverseGeocoder plugin does not exist thus the coordinates are always displayed.

  • The store holds waypoints as raw coordinates in route (Coordinate[]).
  • Each waypoint input in RoutingInput.ce.vue binds directly to route[index], so the raw coordinate is what the user sees.
  • There is no coordinateSources/addressTarget link exposed by routing for reverseGeocoder to consume.

Expected behavior

Coordinates selected by a user are displayed as addresses if a client has the plugin reverseGeocoder configured.

  • When reverseGeocoder is configured with the routing plugin as a coordinate source, selecting/updating a waypoint triggers reverse geocoding.
  • The resolved address (ReverseGeocoderFeature.title) is stored in the routing state and displayed in the corresponding RoutingInput.ce.vue input while the coordinate is still used for the routing request.
  • If reverseGeocoder is not configured, behavior is unchanged and raw coordinates continue to be displayed.
  • Loading/failure of reverse geocoding does not block route calculation; on failure the coordinate remains displayed.

Affected areas

File What needs to change
src/plugins/routing/store.ts Expose per-waypoint coordinate(s) as a coordinateSource for reverseGeocoder, add state to hold the resolved address labels, and add an addressTarget action to receive ReverseGeocoderFeature results.
src/plugins/routing/components/RoutingInput.ce.vue Display the resolved address label instead of the raw route[index] value. Still use the raw coordinate as a fallback.
src/plugins/routing/types.ts Extend RoutingPluginOptions and types if configuration is needed to enable the integration.
src/plugins/reverseGeocoder/store.ts & src/plugins/reverseGeocoder/types.ts Verify coordinateSources support arrays of routing waypoints. Adjust if the current single-coordinate handling is insufficient.

Out of scope

A user can not search for addresses.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Fields

    No fields configured for Feature.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions