· 4 years ago · Jul 25, 2021, 08:14 AM
1 def get_location_by_address(self, address):
2 """This function returns a location from an address
3 """
4 #time.sleep(1)
5 apikey = self.registryValue('googlemapsAPI')
6 if not apikey:
7 raise callbacks.Error(_("Please configure the Google Maps API key in \
8 config plugins.Weather.googlemapsAPI"))
9
10 geolocator = GoogleV3(api_key=apikey)
11 location = geolocator.geocode(address)
12 return location