sylvainjule / kirby-locator

A simple map & geolocation field, built on top of open-source services and Mapbox. Kirby 3 and 4.
97 stars 14 forks source link

Location address not being found when location is at a square, not a street #56

Closed martinknorr closed 10 months ago

martinknorr commented 1 year ago

When using Nomatim I had a strange bug that for some locations an address wouldn't be found while still returning house numbers and the location itself correctly. Some digging let me tho this line:

https://github.com/sylvainjule/kirby-locator/blob/f2f94f077cca14844c0a449b93f5396f963ae79c/src/field/Locator.vue#L452

In my case the location was actually at a (market) square so naturally the resonse address wasn't a road.

To fix this I suggest you change the line to:

'address': response.address.road ?? response.address.road ?? response.address.square,

So if no road is found the square will be used.

Cheers for the great plugin I thought it might be useful to anyone else struggling with this issue ✌️