Skip to content

Commit a58aa35

Browse files
Merge branch 'dev' into build-with-vite
2 parents 60151c9 + f6a3686 commit a58aa35

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/actions/map.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,12 @@ export function setLocation(payload) {
4444
const state = getState()
4545

4646
// reverse geocode point location if requested
47-
if (payload?.reverseGeocode) {
47+
// if the name ends with a colon and a space, something has gone wrong with the
48+
// e-scooter name generation and we need to reverse geocoder instead
49+
50+
// TODO: add a configuration item to allow this to be overridden on a node type basis.
51+
// However, this will require an otp-ui patch
52+
if (payload?.location?.name.endsWith(': ') || payload?.reverseGeocode) {
4853
getGeocoder(state.otp.config.geocoder)
4954
.reverse({ point: payload.location })
5055
.then((location) => {

0 commit comments

Comments
 (0)