2016-06-13 11 views
0

Ich habe an einer Aufgabe in Odoo9 gearbeitet, um Längengrad mit Bing map api zu erhalten. In Odoo 9 gibt es ein Modell namens base_geolocalize, wo sie dieses benutzt haben Funktion für lat/long bekommen ist durch die Hilfe von google apiKoordinaten eines bestimmten Ortes mit Bing Map api in python/odoo

def find(addr): 

url = 'https://maps.googleapis.com/maps/api/geocode/json?sensor=false&key=AIzaSyAL-rowwysUmteIHcOXac86AbPiTV1j2zw&address=' 


try: 
    result = json.load(urllib.urlopen(url)) 
except Exception, e: 
    raise UserError(_(
     'Cannot contact geolocation servers. Please make sure that your internet connection is up and running (%s).') % e) 
if result['status'] != 'OK': 
    _logger.info('GEOLOCATION: status not OK' + str(result)) 
    return None 

try: 
    geo = result['results'][0]['geometry']['location'] 
    return float(geo['lat']), float(geo['lng']) 
except (KeyError, ValueError): 
    return None 

Meine Frage, dass: - Kann ich das gleiche Ergebnis mit bing Karte und how.Please Hilfe bekommen. Dank

Antwort