alexpechkarev / google-maps

Collection of Google Maps API Web Services for Laravel
https://alexpechkarev.github.io/google-maps/
MIT License
523 stars 115 forks source link

Get administrative_area_level_4 #103

Closed dekyuda closed 1 year ago

dekyuda commented 2 years ago

How to get only administrative area level 4 with this library ? Thanks

alexpechkarev commented 1 year ago

Hi @dekyuda,

You can pass an optional result_type parameter with administrative_area_level_4 value.

See Reverse geocoding requests for more details. According to the documentation not all nations exhibit these administrative levels.

    $rsp = \GoogleMaps::load('geocoding')
    ->setParamByKey('latlng', '53.793066,-3.05577')
    ->setParamByKey('result_type', 'administrative_area_level_4')
    ->get('results');