You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When retriving addresses the sublocality value is allways null, even tho that the admistrative levels are filled corretly, any reason for this?
Any fix ?
Yes ofc, so the issue is that when i retrieve the subLocality, using the method getSublocality, or even by using the dumper GeoArray this property always comes null.
The adminLevels are filled, but the sublocality for some reason never gets assigned a value.
I don't get an error message, the error is the sublocality property don't come with data.
Provider : Mapbox (but I tested several, and i got the same problem)
Regarding the address, same as the provider using any PT address is null
Note @mrelliot69 I took the liberty to improve the formatting of the code in your comment to make it more readable.
Indeed, Mapbox provider does not return any sub-locality property (check Mapbox.php).
The available properties will depend on both the provider and the 3rd party API.
If the 3rd party API returns the sub-locality (for instance) but the provider doesn't "fetch" it, we can easily add it ; on the other hand, if the 3rd party API doesn't return a sub-locality, there is not much we can do.
In your use case, does the 3rd party API returns a sub-locality ?
Could you show us the response you get from the API ?
Note @mrelliot69 I took the liberty to improve the formatting of the code in your comment to make it more readable.
Indeed, Mapbox provider does not return any sub-locality property (check Mapbox.php).
The available properties will depend on both the provider and the 3rd party API. If the 3rd party API returns the sub-locality (for instance) but the provider doesn't "fetch" it, we can easily add it ; on the other hand, if the 3rd party API doesn't return a sub-locality, there is not much we can do.
In your use case, does the 3rd party API returns a sub-locality ? Could you show us the response you get from the API ?
yeah ofc, im attaching on this reply a response, so you can see it
Activity
jbelien commentedon May 20, 2023
Could you give us more details about your issue ?
What provider are you using ?
What address ?
Is there some error message ?
mrelliot69 commentedon May 20, 2023
Yes ofc, so the issue is that when i retrieve the subLocality, using the method getSublocality, or even by using the dumper GeoArray this property always comes null.
The adminLevels are filled, but the sublocality for some reason never gets assigned a value.
I don't get an error message, the error is the sublocality property don't come with data.
Provider : Mapbox (but I tested several, and i got the same problem)
Regarding the address, same as the provider using any PT address is null
Currently using this setup:
mtmail commentedon May 20, 2023
Which of the two providers was used? What is the input (address), what the output (full data structure)?
jbelien commentedon May 20, 2023
Indeed, Mapbox provider does not return any sub-locality property (check
Mapbox.php).The available properties will depend on both the provider and the 3rd party API.
If the 3rd party API returns the sub-locality (for instance) but the provider doesn't "fetch" it, we can easily add it ; on the other hand, if the 3rd party API doesn't return a sub-locality, there is not much we can do.
In your use case, does the 3rd party API returns a sub-locality ?
Could you show us the response you get from the API ?
mrelliot69 commentedon May 20, 2023
Its the first one (mapbox)
mrelliot69 commentedon May 20, 2023
yeah ofc, im attaching on this reply a response, so you can see it
As you can see the admin level 2 its lisbon so that in theory its also the sublocality and the admin level 2 the locality
jbelien commentedon May 20, 2023
You might be right but according to Mapbox response I don't think we can always assume that Admin Level 1 is the sub-locality.
Check the code here and you'll see that
localityis already correctly set (and that Admin Level 2 isregion).Could you show us a response from Mapbox API (the raw response, not the
MapboxAddressobject) to double check ? Thanks.jbelien commentedon May 20, 2023
According to Mapbox documentation there is indeed no sub-locality provided.