Wagtail-Geo-Widget is the complete map solution for your Wagtail site.
SyntaxWarning
on Python 3.12 (@jorenham)Full Changelog: https://github.com/Frojd/wagtail-geo-widget/compare/v8.1.0...v8.1.1
Full Changelog: https://github.com/Frojd/wagtail-geo-widget/compare/v8.0.0...v8.1.0
Full Changelog: https://github.com/Frojd/wagtail-geo-widget/compare/v7.0.0...v8.0.0
wagtailgeowidget.edit_handlers
has been renamed to wagtailgeowidget.panels
Full Changelog: https://github.com/Frojd/wagtail-geo-widget/compare/v6.1.0...v6.2.0
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.
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:
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:
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"),
),
]
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"),
]
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": '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'}