geocoder-php / GeocoderLaravel

Geocoder service provider for Laravel
http://geocoder-php.org/GeocoderLaravel/
MIT License
704 stars 102 forks source link

how to use Google Maps Places provider: ->withData(...)? #174

Closed wivaku closed 4 years ago

wivaku commented 4 years ago

General Information

GeocoderLaravel Version: 4.3.2 Laravel Version: 7.15.0 PHP Version: 7.4.7 Operating System and Version: macOS

Issue Description

Google Maps Places states it expects additional parameter (key, name, type) https://geocoder-php.org/docs/providers/googlemapsplaces/

$results = $provider
->reverseQuery(ReverseQuery::fromCoordinates(-33.892674, 151.200727)
->withData('type', 'bar'));

How to use in Laravel?

Steps to Replicate

$result = app('geocoder')
->using('google_maps_places')
->reverseQuery(\Geocoder\Query\ReverseQuery::fromCoordinates(-33.892674, 151.200727))
->withData('type', 'bar')
;
// error: One of `type`, `keyword`, `name` is required to be set in the Query data for Reverse Geocoding
wivaku commented 4 years ago

never mind