Wagtail Geo Widget Versions Save

Wagtail-Geo-Widget is the complete map solution for your Wagtail site.

v8.1.1

4 months ago

[8.1.1] - 2023.12.29

Fixed

  • Fix invalid regex escape character causing a SyntaxWarning on Python 3.12 (@jorenham)
  • Upgrade example docker image python version to 3.12 (@marteinn)

Full Changelog: https://github.com/Frojd/wagtail-geo-widget/compare/v8.1.0...v8.1.1

v8.1.0

4 months ago

[8.1.0] - 2023.12.22

Added

  • Add tests for Wagtail 5.1 (@katdom13)
  • Add support for Wagtail 5.2 (@marteinn)
  • Add support for Python 3.12 (@marteinn)

Fixed

  • Fix broken readme link (@wimfeijen)
  • Include contribution guidelones in README (@marteinn)
  • Throw Exception if geo string is invalid in GoogleMapsBlock to_python (@marteinn)

Removed

  • Drop support for Python 3.7 (@katdom13)
  • Drop support for Wagtail 5.0 (@marteinn)
  • Drop support for Wagtail 4.2 (@marteinn)

Full Changelog: https://github.com/Frojd/wagtail-geo-widget/compare/v8.0.0...v8.1.0

v8.0.0

11 months ago

[8.0.0] - 2023.05.21

Fixed

  • Add Wagtail 5.0 compability (@marteinn)
  • Add MAPBOX_LANGUAGE setting to handle mobox language (@Pytsh)

Removed

  • Drop support for Wagtail < 4.1 (@marteinn)

New Contributors

Full Changelog: https://github.com/Frojd/wagtail-geo-widget/compare/v7.0.0...v8.0.0

v7.0.0

1 year ago

Added

  • Add Wagtail 4 compability (@katdom13)
  • Add contribution documentation (@marteinn)

Changed

  • Update StreamFieldPanel to just FieldPanel in tests (@katdom13)
  • Update StreamFields to have additional argument use_json_field in test (@katdom13)
  • Rename wagtailgeowidget.edit_handlers to wagtailgeowidget.panels (@katdom13)
  • Update imports in docs (@katdom13)

Fixed

  • Ensure setup() is only called after user focus if showEmptyLocation is true (@kleingeist)
  • Add support for permissions on field panels (@unicode-it)

Breaking changes

  • wagtailgeowidget.edit_handlers has been renamed to wagtailgeowidget.panels

v6.2.0

1 year ago

Added

  • Add Wagtail 3 compability (@marteinn)
  • Add French translations (@ThbtSprt)

Changed

  • Make GEO_WIDGET_EMPTY_LOCATION False by default (@marteinn)

Removed

  • Drop support for Wagtail 2.14 (@marteinn)

Fixed

  • Add support for running outside of docker with custom .env file in development (@marteinn)

Full Changelog: https://github.com/Frojd/wagtail-geo-widget/compare/v6.1.0...v6.2.0

v6.1.0

2 years ago

This releases introduces official Wagtail 2.16 and Django 4 support. It also adds geoencoding support for Mapbox. We have also reorganized the test suite, changed test runner to pytest and started to add coverage to widgets, more work will be done here in the future.

Added

  • Add geocoding support for Mapbox (@marteinn)
  • Add Wagtail 2.16 support

Fixed

  • Fix: Replace ugettext with gettext (@mariusboe)
  • Fix: Add documentation on leaflet settings (@marteinn)
  • Fix: Replace test runniner with pytest
  • Fix: Drop duplicated tests from wagtailgeowidget/tests

v6.0.0

2 years ago

This is a big release that adds Leaflet support, moves GoogleMaps as its own panel/block types and deprecates GeoPanel/GeoBlock.

It also adds Telepath support to the widgets and therefore dropping < Wagtail 2.14 support.

Finally it also introduces the concept of geocoders, which lets us configure which geocoder to use in the address field. Currently Google Maps Geocoding and Nominatim are supported, but more might come in the future. (PR:s are much appreciated!)

Changelog:

  • Add support for Leaflet with LeafletPanel/LeafletBlock (Martin Sandström)
  • Add standalone block and panel for GoogleMaps (Martin Sandström)
  • Deprecate GeoPanel, GeoBlock and GeoWidget in favour of GoogleMapsPanel, GoogleMapsBlock and GoogleMapsWidget (Martin Sandström)
  • Add panel for address field (Martin Sandström)
  • Add geocoding support for Nominatim (Martin Sandström)
  • Add telepath to widgets (Martin Sandström)
  • Drop support for Wagtail < 2.14 (Martin Sandström)
  • Add Swedish translations (Martin Sandströms)
  • Fix: Disable form submit on latlang field enter (Martin Sandström)
  • Fix: Apply prettier formatting to all js (Martin Sandström)

Note: Upgrading from 5 to 6

6.0.0 is backwards compatible so GeoPanel/GeoField will continue to function but are now aliases to GoogleMapsPanel/GoogleMapsBlock. Using GeoPanel/GeoField will raise warnings. They will be removed in version 7.

Also note that it is still possible to supply a address parameter pointing to a FieldPanel, but this behaviour is also deprecated in favor of using GeoAddressPanel for your address field. This behaviour will also be removed in a feature release, most likely in 8.

To migrate to 6, do the following:

  • Replace GeoPanel with GoogleMapsPanel. Example:
from django.db import models
from wagtail.core.models import Page
from wagtailgeowidget.edit_handlers import GoogleMapsPanel

class StandardPage(Page):
    location = models.CharField(max_length=250, blank=True, null=True)

    content_panels = Page.content_panels + [
        MultiFieldPanel(
            [
                GoogleMapsPanel("location"),
            ],
            _("Geo details"),
        ),
    ]
  • Replace GeoBlock with GoogleMapsBlock. Example:
from django.db import models
from wagtail.core.fields import StreamField
from wagtail.core.models import Page
from wagtailgeowidget.blocks import GoogleMapsBlock
from wagtail.admin.edit_handlers import StreamFieldPanel

class StreamPage(Page):
    body = StreamField(
        [
            ("map", GoogleMapsBlock()),
        ]

    content_panels = Page.content_panels + [
        StreamFieldPanel("body"),
    ]

  • Replace FieldPanel('address') with GeoAddressPanel("address", geocoder=geocoders.GOOGLE_MAPS). Example:
from django.db import models
from wagtail.core.models import Page
from wagtailgeowidget.edit_handlers import (
    GeoAddressPanel,
    GoogleMapsPanel,
)
 from wagtailgeowidget import geocoders

class StandardPage(Page):
    address = models.CharField(max_length=250, blank=True, null=True)
    location = models.CharField(max_length=250, blank=True, null=True)

    content_panels = Page.content_panels + [
        MultiFieldPanel(
            [
                GeoAddressPanel("address", geocoder=geocoders.GOOGLE_MAPS),
                GoogleMapsPanel("location", address_field="address"),
            ],
            _("Geo details"),
        ),
    ]

New settings

Because of the new Leaflet panel/block we have two new settings:

  • GEO_WIDGET_LEAFLET_TILE_LAYER: Which title provider to use in Leaflet. By default it is OSM. (https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png).
  • GEO_WIDGET_LEAFLET_TILE_LAYER_OPTIONS: The tile layer options for leaflet, it supports the following arguments. Default is {"attribution": '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'}