Skip to content

Commit

Permalink
readme updated
Browse files Browse the repository at this point in the history
  • Loading branch information
jordij committed Oct 2, 2015
1 parent a6b1393 commit 8bc6059
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ wagtailgmaps

![Wagtailgmaps screenshot](http://i.imgur.com/9m9Gfcf.png)

Simple Google Maps address formatter for Wagtail fields.
Simple Google Maps address formatter and LatLng provider for Wagtail fields.

# Quickstart

Expand Down Expand Up @@ -43,9 +43,21 @@ address_panels = MultiFieldPanel([

Notice the `FieldPanel` is embedded in a `MultiFieldPanel`, even if it only contains a single element. If you define your `FieldPanel` outside it won't work. The app supports more than one map (field) at the same time.

If instead of outputting a formatted address, you want to output a LatLng, you should add `gmap--latlng` modifier class to the panel:

```
latlng = models.CharField(max_length=255)
panels = [
MultiFieldPanel([
FieldPanel('latlng', classname="gmap gmap--latlng"),
], heading="Map location"),
]
```

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

The field gets updated according to the [Google Geocoding Service](https://developers.google.com/maps/documentation/geocoding/) each time:
If using the address option, the field gets updated according to the [Google Geocoding Service](https://developers.google.com/maps/documentation/geocoding/) each time:

* The map market gets dragged and dropped into a location (`dragend` JS event).
* Click happens somewhere in the map (`click` JS event).
Expand All @@ -58,3 +70,9 @@ Once your address field is properly formatted and stored in the database you can
```
<a href="http://maps.google.com/?q={{ address }}">Open map</a>
```

Or if you opted for the LatLng pair option:

```
<a href="http://maps.google.com/?q={{ latlng }}">Open map</a>
```

0 comments on commit 8bc6059

Please sign in to comment.