Only take the first component of formatted_address

This commit is contained in:
Fabio Manganiello 2018-05-23 08:06:52 +00:00
parent 3ce6cf8b41
commit a8015addbf
1 changed files with 1 additions and 1 deletions

View File

@ -33,7 +33,7 @@ class GoogleMapsPlugin(GooglePlugin):
logging.info('Google Maps geocode response for latlng ({},{}): {}'.
format(latitude, longitude, result))
address['address'] = result['formatted_address']
address['address'] = result['formatted_address'].split(',')[0]
for addr_component in result['address_components']:
for component_type in addr_component['types']:
if component_type == 'locality':