From 8bc6059a2f95d34c954b8527e52249e9b34eda56 Mon Sep 17 00:00:00 2001 From: jordij Date: Fri, 2 Oct 2015 14:01:09 +1300 Subject: [PATCH] readme updated --- README.md | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ca8d58a..5a66d44 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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). @@ -58,3 +70,9 @@ Once your address field is properly formatted and stored in the database you can ``` Open map ``` + +Or if you opted for the LatLng pair option: + +``` +Open map +```