Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[LocationIQ] Add autocomplete + countrycodes & tag filters #1118

Closed
wants to merge 1 commit into from

Conversation

nassuf
Copy link

@nassuf nassuf commented May 5, 2021

  • Change locationIQ endpoint to the new one
  • Add autocomplete endpoint
  • Manage json to AddressCollection as autocomplete endpoint doest not return XML format
  • Add countrycodes filter (filter within a bunch of countries + tag filter (type of address)

@jbelien jbelien changed the title Add autocomplete + countrycodes & tag filters [LocationIQ] Add autocomplete + countrycodes & tag filters May 5, 2021
Copy link
Member

@jbelien jbelien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for your contribution @nassuf !

  • Could you make sure your PR passes the StyleCI check ?
  • Could you add a test for the autocomplete query ?
  • Could you add a test for the countrycodes parameter ?
  • Could you add a test for the tag parameter ?

If the search request also returns JSON, could you convert it so it's consistent with autocomplete request ?

Thanks!

{
$address = $query->getText();
$countrycodes = $query->getData('countrycodes');
$tag = $query->getData('tag');
$url = sprintf($this->getGeocodeAutocompleteEndpointUrl(), urlencode($address), $query->getLimit(), $countrycodes, $tag);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if countrycodes and/or tag is not set ?

* @param array $arrayResult
* @return Location
*/
private function arrayResultToArray(array $arrayResult): Location
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Name of the function is confusing I think. I would name it something like resultToLocation().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants