Skip to content

Commit c02073e

Browse files
Configurable Google APIs libraries (#119)
The Google JS API libraries are configurable Co-authored-by: rsoltys <[email protected]>
1 parent 8fbfc7b commit c02073e

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

mapwidgets/settings.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
("region", "")
5050
),
5151
"LANGUAGE": "en",
52+
"LIBRARIES": "places",
5253
"MINIFED": not django_settings.DEBUG,
5354
"GOOGLE_MAP_API_SIGNATURE": "",
5455
"GOOGLE_MAP_API_KEY": "",

mapwidgets/widgets.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ def media(self):
6868
}
6969

7070
js = [
71-
'https://maps.googleapis.com/maps/api/js?libraries=places&language={}&key={}'.format(
72-
mw_settings.LANGUAGE, mw_settings.GOOGLE_MAP_API_KEY
71+
"https://maps.googleapis.com/maps/api/js?libraries={}&language={}&key={}".format(
72+
mw_settings.LIBRARIES, mw_settings.LANGUAGE, mw_settings.GOOGLE_MAP_API_KEY
7373
)
7474
]
7575

@@ -167,8 +167,8 @@ def media(self):
167167
}
168168

169169
js = [
170-
'https://maps.googleapis.com/maps/api/js?libraries=places&language={}&key={}'.format(
171-
mw_settings.LANGUAGE, mw_settings.GOOGLE_MAP_API_KEY
170+
"https://maps.googleapis.com/maps/api/js?libraries={}&language={}&key={}".format(
171+
mw_settings.LIBRARIES, mw_settings.LANGUAGE, mw_settings.GOOGLE_MAP_API_KEY
172172
)
173173
]
174174

0 commit comments

Comments
 (0)