djangowagtailgeodjango

Default location in wagtail-geo-widget


I have successfully added a GeoAddressPanel and LeafletPanel to a Wagtail admin page using Wagtail Geo Widget. I'd like to override the default location but can't figure out how, any ideas?

This is what I have and that's working fine in the Wagtail admin:

  MultiFieldPanel(
        [
            GeoAddressPanel("address", geocoder=geocoders.NOMINATIM),
            LeafletPanel(
                "location", address_field="address"
            ),
        )

Tried some suggestion by Claude.ai, but it did not have a clue.


Solution

  • The default location setting is updated with adding an object {'lat': <latitude>, 'lng': <longitude> to GEO_WIDGET_DEFAULT_LOCATION in settings.py