Commits

Mikhail Korobov committed e22b978

API_key переименован в api_key

Comments (0)

Files changed (1)

yandex_maps/api.py

 STATIC_MAPS_URL = 'http://static-maps.yandex.ru/1.x/?'
 GEOCODE_URL = 'http://geocode-maps.yandex.ru/1.x/?'
 
-def get_map_url(API_key, longtitude, latitude, zoom, width, height):
+def get_map_url(api_key, longtitude, latitude, zoom, width, height):
     ''' returns URL of static yandex map '''
     params = [
        'll=%0.7f,%0.7f' % (longtitude, latitude,),
        'z=%d' % zoom,
        'l=map',
        'pt=%0.7f,%0.7f' % (longtitude, latitude,),
-       'key=%s' % API_key
+       'key=%s' % api_key
     ]
     return STATIC_MAPS_URL + '&'.join(params)
 
-def geocode(API_key, address, timeout=2):
+def geocode(api_key, address, timeout=2):
     ''' returns (longtitude, latitude,) tuple for given address '''
     if isinstance(address, unicode):
         address = address.encode('utf8')
-    params = urllib.urlencode({'geocode': address, 'key': API_key})
+    params = urllib.urlencode({'geocode': address, 'key': api_key})
     url = GEOCODE_URL + params
     try:
         status_code, response = http.request('GET', url, timeout=timeout)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.