Mapbox Provider prevents searching for countries
まだ誰も着手していません。
評価
調査の方向性
283行目と301行目付近のMapbox.phpを確認し、fetchUrlとcontextフィールドを持たないMapbox結果の処理から始めます。contextデータに使用されている既存のモデルを追跡し、都市、地区、住所が既存の動作を維持したまま、国の結果が問題なく返されることを確認します。
索引モデルが issue の本文から書いたものです。
説明
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')
);
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
- 主要言語
- PHP
- スター
- 4k
- フォーク
- 525
- 平均マージ
- 8分
- マージ済み PR(30日)
- 1
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
geocoder-php/Geocoder のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
geocoder-php/Geocoder#1272 ·
-
question
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
geocoder-php/Geocoder#1267 · コメント 2 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
geocoder-php/Geocoder#1266 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 38/100
geocoder-php/Geocoder#1244 · コメント 2 件 · リアクション 2 件 ·
-
provider
難易度 4/5 3〜5日 初心者へのやさしさ 30/100
geocoder-php/Geocoder#1243 ·
geocoder-php/Geocoder の issue をすべて見る
似ている issue
-
sync-en
難易度 1/5 1〜3時間 初心者へのやさしさ 85/100
-
sync-en
難易度 1/5 1〜3時間 初心者へのやさしさ 85/100
-
Перевод устарел
難易度 1/5 1〜3時間 初心者へのやさしさ 78/100
-
[6.x]: "Cannot use object of type stdClass as array" loading Users index (regression of #19182) オープン
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100