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
I'm using the Mapbox Provider in my API to fetch coordinates for given entities. These entities can be either:
Countries
Cities
Districts
Addresses
However, the current implementation of the mapbox provider prevents from returning anything that doesn't contain a context.
When I run this snippet and watch the console, I see that the query to Mapbox is correct and data is returned.
$locations = $mapboxGeocoder->geocodeQuery(
GeocodeQuery::create($country->getName())
->withLocale('nl')
->withData('location_type', 'country')
);
This isn't a clean solution and additional models are required to make it a better implementation. However, the repo is read-only so I cannot help with the required changes
The text was updated successfully, but these errors were encountered:
This isn't a clean solution and additional models are required to make it a better implementation. However, the repo is read-only so I cannot help with the required changes
I'm using the Mapbox Provider in my API to fetch coordinates for given entities. These entities can be either:
However, the current implementation of the mapbox provider prevents from returning anything that doesn't contain a context.
When I run this snippet and watch the console, I see that the query to Mapbox is correct and data is returned.
$locations = $mapboxGeocoder->geocodeQuery(
GeocodeQuery::create($country->getName())
->withLocale('nl')
->withData('location_type', 'country')
);
However, the fetchUrl method in Mapbox.php simply breaks when a result without context is returned by Mapbox.
https://github.com/geocoder-php/mapbox-provider/blob/master/Mapbox.php#L283
When I remove that piece of code, and add an additional check here to check if context is available before iterating through it, the code returns the requested items.
https://github.com/geocoder-php/mapbox-provider/blob/master/Mapbox.php#L301
This isn't a clean solution and additional models are required to make it a better implementation. However, the repo is read-only so I cannot help with the required changes
The text was updated successfully, but these errors were encountered: