1
0
mirror of https://github.com/django/django.git synced 2025-07-04 09:49:12 +00:00

gis: Fixed #6289 (added extra_context keyword to GoogleMap). Thanks omat & arien.

git-svn-id: http://code.djangoproject.com/svn/django/branches/gis@7027 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Justin Bronn 2008-01-18 16:49:51 +00:00
parent 8da13e60c2
commit feebe39429

View File

@ -18,7 +18,8 @@ class GoogleMap(object):
def __init__(self, key=None, api_url=None, version=None, def __init__(self, key=None, api_url=None, version=None,
center_lat=0.0, center_lon=0.0, zoom=1, center_lat=0.0, center_lon=0.0, zoom=1,
dom_id='map', load_func='gmap_load', dom_id='map', load_func='gmap_load',
kml_urls=[], template='gis/google/js/google-map.js'): kml_urls=[], template='gis/google/js/google-map.js',
extra_context={}):
# The Google Maps API Key defined in the settings will be used # The Google Maps API Key defined in the settings will be used
# if not passed in as a parameter. The use of an API key is # if not passed in as a parameter. The use of an API key is
@ -67,6 +68,7 @@ class GoogleMap(object):
'load_func' : load_func, 'load_func' : load_func,
'zoom' : zoom, 'zoom' : zoom,
} }
params.update(extra_context)
self.js = render_to_string(template, params) self.js = render_to_string(template, params)
@property @property