Skip to content

feat(location): introduce a public API for location providers - #41255

Draft
tcitworld wants to merge 1 commit into
masterfrom
location-provider
Draft

feat(location): introduce a public API for location providers#41255
tcitworld wants to merge 1 commit into
masterfrom
location-provider

Conversation

@tcitworld

Copy link
Copy Markdown
Member

Summary

Currently each app does location search & geocoding itself, and it's limited to OpenStreetMap's public Nominatim service. This will allow people to install other app providers, such as Google Maps, Pelias, OpenCage, Photon, etc. This will also allow some providers to provide autocomplete support.

TODO

  • tests
  • create at least one other provider (GMaps ?)
  • add support for custom endpoint for the nominatim provider
  • support a common set of options
  • fix geometry type (should it be always a point?)
  • add the nominatim app to shipped apps

Checklist

Currently each app does location search & geocoding itself, and it's limited to OpenStreetMap's
public Nominatim service. This will allow people to install other app providers, such as Google
Maps, Pelias, OpenCage, Photon, etc. This will also allow some providers to provide autocomplete
support.
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
try {
return $provider->geocode($longitude, $latitude, $options);
} catch (RuntimeException $e) {
$this->logger->warning("Failed to geocode coords {$longitude}:${latitude} using provider {$provider->getName()}", ['exception' => $e]);

Check failure

Code scanning / Psalm

UndefinedInterfaceMethod

Method OCP\Location\ILocationProvider::getName does not exist
try {
return $provider->search($address, $options);
} catch (RuntimeException $e) {
$this->logger->warning("Failed to search for location {$address} using provider {$provider->getName()}", ['exception' => $e]);

Check failure

Code scanning / Psalm

UndefinedInterfaceMethod

Method OCP\Location\ILocationProvider::getName does not exist
return $provider->autocomplete($address, $options);
}
} catch (RuntimeException $e) {
$this->logger->warning("Failed to autocomplete location {$address} using provider {$provider->getName()}", ['exception' => $e]);

Check failure

Code scanning / Psalm

UndefinedInterfaceMethod

Method OCP\Location\ILocationProvider::getName does not exist
@solracsfsolracsf added this to the Nextcloud 28 milestone Nov 21, 2023
@blizzzblizzz mentioned this pull request Nov 22, 2023
5 tasks
@blizzzblizzz modified the milestones: Nextcloud 28, Nextcloud 29Nov 23, 2023
This was referenced Mar 12, 2024
@AltahrimAltahrim mentioned this pull request Mar 20, 2024
@blizzzblizzz modified the milestones: Nextcloud 31, Nextcloud 32Jan 29, 2025
@blizzzblizzz modified the milestones: Nextcloud 33, Nextcloud 34Feb 16, 2026
@susnuxsusnux added the community pull requests from community label Jun 9, 2026
@susnuxsusnux removed this from the Nextcloud 34.0.1 milestone Jun 9, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2. developingWork in progresscommunitypull requests from communityenhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants

@tcitworld@github-advanced-security@joshtrichards@susnux@blizzz@solracsf@skjnldsv@nextcloud-bot