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

Perhaps support reverse geocoding? #6

Closed
samward1985 opened this issue Jan 7, 2014 · 4 comments
Closed

Perhaps support reverse geocoding? #6

samward1985 opened this issue Jan 7, 2014 · 4 comments

Comments

@samward1985
Copy link

Would be pretty simple to implement, at least for Google Maps. I might just do it and submit a pull request.

https://developers.google.com/maps/documentation/geocoding/

@toin0u
Copy link
Member

toin0u commented Jan 8, 2014

Hi, Geocoder already supports Google Maps reverse geocoding so why not use this provider and then the reverse method via the facade ?

@toin0u
Copy link
Member

toin0u commented Jan 12, 2014

try {
    var_dump(Geocoder::reverse(48.8234065, 2.3072665));
    } catch (\Exception $e)
         echo $e->getMessage();
}

You should get something like:

object(Geocoder\Result\Geocoded)[217]
  protected 'latitude' => float 48.8234065
  protected 'longitude' => float 2.3072665
  protected 'bounds' => 
    array (size=4)
      'south' => float 48.8234065
      'west' => float 2.3072665
      'north' => float 48.8234065
      'east' => float 2.3072665
  protected 'streetNumber' => string '10' (length=2)
  protected 'streetName' => string 'Rue Gambetta' (length=12)
  protected 'cityDistrict' => string '14Th Arrondissement Of Paris' (length=28)
  protected 'city' => string 'Paris' (length=5)
  protected 'zipcode' => string '92240' (length=5)
  protected 'county' => string 'Hauts-De-Seine' (length=14)
  protected 'countyCode' => string '92' (length=2)
  protected 'region' => string 'Île-De-France' (length=14)
  protected 'regionCode' => string 'IDF' (length=3)
  protected 'country' => string 'France' (length=6)
  protected 'countryCode' => string 'FR' (length=2)
  protected 'timezone' => null

@toin0u toin0u closed this as completed Jan 12, 2014
@samward1985
Copy link
Author

Wow. Totally missed the reverse function somehow. Sorry about that.

@toin0u
Copy link
Member

toin0u commented Jan 23, 2014

No problem ! :)

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

No branches or pull requests

2 participants