Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Google Maps widget for address fields in Wagtail

Project Description
# wagtailgmaps [![PyPI](](

> Simple Google Maps address formatter and LatLng provider for [Wagtail]( fields.

*Check out [Awesome Wagtail]( for more awesome packages and resources from the Wagtail community.*

![Wagtailgmaps screenshot](./screenshot.png)

## Quickstart

``` $ pip install wagtailgmaps```

Add `wagtailgmaps` to your `` `INSTALLED_APPS` section.

Add some configuration in your `` file:

# Mandatory
WAGTAIL_ADDRESS_MAP_CENTER = 'Wellington, New Zealand'

# Optional

`WAGTAIL_ADDRESS_MAP_CENTER` must be a properly formatted address. Also, remember valid zoom levels go from 0 to 18. See [Map options]( for details.

> As of June 22 2016, Google maps requires an API key. See how to [Get a key]( While you're there, you'll also need to enable the [Geocoding Service](

wagtailgmaps expects a CharField (or any other field that renders as a text input) and comes with a MapFieldPanel. In your ``, your custom Page model would have something similar to:

address = models.CharField(max_length=255)
# ...

content_panels = [

Notice that the string you pass to the `MapFieldPanel` is the name of the field, just like when using `FieldPanels`.

If instead of outputting a formatted address, you want to output a LatLng, you should add `latlng=True` to the panel:

MapFieldPanel('address', latlng=True)

All the options available are:

- `heading` - A custom heading in the admin, defaults to "Location"
- `classname` - Add extra css classes to the field
- `latlng` - Field returns a LatLng instead of an address
- `centre` - A custom override for this field
- `zoom` - A custom override for this field

When editing the model from the admin interface the affected field shows up with a map, like the screenshot above.

If using the address option, the field gets updated according to the [Google Geocoding Service]( each time:

* The map marker gets dragged and dropped into a location (`dragend` JS event).
* Click happens somewhere in the map (`click` JS event).
* Return key is pressed after editing the field (`enterKey` JS event for return key only).

Feel free to edit the provided JS to add/edit the events you might need.

Once your address field is properly formatted and stored in the database you can use it in your front end Django templates. Example:

<a href="{{ address }}">Open map</a>

Or if you opted for the LatLng pair option:

<a href="{{ latlng }}">Open map</a>

## Development

### Releases

- Make a new branch for the release of the new version.
- Update the [CHANGELOG](
- Update the version number in `wagtailgmaps/`, following semver.
- Make a PR and squash merge it.
- Back on master with the PR merged, use `make publish` (confirm, and enter your password).
- Finally, go to GitHub and create a release and a tag for the new version.
- Done!
Release History

Release History

This version
History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
wagtailgmaps-0.4.tar.gz (12.6 kB) Copy SHA256 Checksum SHA256 Source Jan 15, 2018

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting