jazzband / django-floppyforms

Full control of form rendering in the templates.
http://django-floppyforms.readthedocs.org/
Other
841 stars 148 forks source link

Allow usage of a Google Maps API KEY with BaseGMapWidget #174

Closed victor-o-silva closed 8 years ago

victor-o-silva commented 8 years ago

Since June 2016, Google Maps API requires an API Key, otherwise the maps may fail to load:

selection_001

This PR gives developers the ability to supply their API Keys to the Google Maps API by setting the attribute google_maps_api_key in BaseGMapWidget subclasses:

class GMapPolygonWidget(forms.gis.BaseGMapWidget, forms.gis.PolygonWidget):
    google_maps_api_key = 'YOUR-GOOGLE-MAPS-API-KEY-HERE'

Changes

floppyforms/gis/widgets.py

docs/geodjango.rst

victor-o-silva commented 8 years ago

Travis failed before the tests even started:

mv: cannot stat `/etc/apt/sources.list.d/pgdg-source.list': No such file or directory The command "sudo mv /etc/apt/sources.list.d/pgdg-source.list /tmp" failed and exited with 1

gregmuellegger commented 8 years ago

That is great work! Thanks for the investigation and PR. I'll test the changes locally and will then get it merged and released.

gregmuellegger commented 8 years ago

Merged and released as 1.7.0: https://pypi.python.org/pypi/django-floppyforms