Skip to main content

Geolocation field and widget

CI Status

This package provides a z3c.form field and a widget implementing LeafletJS from pat-leaflet to define Latitude / Longitude information.

Features

  • GeolocationField field included to use in your project.

  • Geolocation control panel included to define the Maps parameters.

Screenshots

After installation, you will find a new behavior available, go to Site Setup > Add-on Configuration > Geolocation as the following screenshot:

The Geolocation Settings

The Geolocation Settings.

Use

This package is used as a dependency in some other Plone add-ons, like collective.geolocationbehavior but can also be used directly in your own content type schema:

from plone.formwidget.geolocation import GeolocationField

...

geolocation = GeolocationField(
    title="Geolocation",
    description="Select the location of this content",
)

The map marker has a popup containing object title / description (by default). The template and/or the class used to generate the popup content can be overridden to change it (see @@geolocation-geojson-popup view).

Versions

  • plone.formwidget.geolocation 4.0.x -> Plone 6.2.x

  • plone.formwidget.geolocation 3.0.x -> Plone 6.0.x and 6.1.x

  • plone.formwidget.geolocation 2.2.x -> Plone 5.2.x

Examples

This add-on can be seen in action at the following add-ons:

Translations

This product has been translated into

  • Dutch

  • French

  • German

  • Spanish

Installation

Add the plone.formwidget.geolocation into the file backend/pyproject.toml in the section dependencies.

dependencies = [
    "Products.CMFPlone==6.1.2",
    "plone.api",
    "plone.restapi",
    "plone.volto",
    "plone.formwidget.geolocation",
]

and then running “make backend-build”.

Contribute

Support

If you are having issues, please let us know at our issue tracker.

License

The project is licensed under the GPLv2.

Changelog

4.0.0 (2026-11-27)

  • Breaking: Plone 6.2 only support. [erral]

  • Breaking: native namespaces [erral]

  • Breaking: src-layout [erral]

  • Add Basque translation [erral]

  • Add Spanish translation [macagua]

  • Add new translation strings [macagua]

  • Add more improvements about the sources code [macagua]

  • Fixed the warning “Line to long” message [macagua]

3.0.7 (2024-08-28)

3.0.6 (2023-10-31)

  • Add default_input_zoom and default_display_zoom options in control panel [mpeeters]

3.0.5 (2023-06-28)

  • Fix controlpanel icon. [petschki]

  • Fix showing map when creating content and sanitize default lat/lng values with or without default initial configuration settings. [petschki]

3.0.4 (2023-06-02)

  • Fix usage of default location from configuration [mpeeters]

  • Ensure that the marker is the main marker to fix geosearch [mpeeters]

  • Add missing French translation [laulaz]

  • Add missing translation in widget display template [laulaz]

  • Updated resources: pat-leaflet=2.1.1, Patternslib=9.9.4 [petschki]

3.0.3 (2023-01-13)

  • Fix configlet: boolean field cannot be required (otherwise it is impossible to set it to False) [laulaz]

3.0.2 (2022-11-10)

  • Fix widget display mode: initialize map with actually saved lat/lon values. [petschki]

3.0.1 (2022-10-19)

  • Remove the height style from the geolocation input widget map. It is already set by pat-leaflet. [thet]

3.0.0 (2022-10-11)

  • Update to ES6 refactored @patternslib/pat-leaflet.

  • Integrate Plone resources with module federation. [petschki]

2.2.5 (2022-09-22)

  • Fix an issue when the geolocation is empty [mpeeters, laulaz]

  • Allow to change map marker popup default content (#35). See @@geolocation-geojson-popup view. [laulaz]

2.2.4 (2022-06-02)

  • Add French translations [laulaz]

  • Add plone.restapi deserializer (if plone.restapi is installed). [laulaz]

  • Allow to set default geolocation on new contents (via bool field in config). If not checked, the default geolocation is only used to center map. Also, the geolocation map will not show on an object if no geolocation was defined. [laulaz]

2.2.3 (2021-05-26)

  • Add plone.restapi serializer (if plone.restapi is installed). [bsuttor, laulaz]

  • Specify that latitude and longitude fields can be not required. [boulch]

  • Allow empty latitude and longitude. [bsuttor]

2.2.2 (2020-07-10)

  • Fix popup displaying the string “None” when no description was given. [parruc]

  • Add default_location information to maps-configuration view. [bsuttor]

2.2.1 (2019-06-07)

  • Translate map ids. [thet]

2.2.0 (2019-04-24)

  • add geolocation settings for leaflet [petschki]

  • Fix for Python 3. [pbauer]

2.1.3 (2017-12-06)

  • Only include the leaflet bundle where it is needed via add_bundle_on_request. [thet]

2.1.2 (2017-04-04)

  • Explicitly include necessary zcml dependencies to avoid having to explicitly doing that in tests. plone.app.testing disables z3c.autoinclude. [thet]

2.1.1 (2017-03-06)

  • Add upgrade step for changes in 2.1 + register missing upgrade steps for Plone 5 migration. [thet]

2.1 (2017-02-28)

  • Use bundle-leaflet from the plone.patternslib package. This should give an out-of-the-box leaflet integration. [thet]

2.0 (2016-10-06)

  • Make geolocation formwidget work with pat-leaflet. [thet]

  • Support for Plone 5 only, using plone.patternslib and providing an own bundle. [thet]

1.4 (2015-11-26)

  • Leaflet: After searching, bind new marker to update lat/lng input field and remove MarkerClusterGroup. Fix annoying ‘Uncaught Error: Couldn’t autodetect L.Icon.Default.imagePath, set it manually.’ [thet]

  • Update Leaflet dependencies. [thet]

1.3 (2015-07-15)

  • Add Leaflet as mapping widget. Use bower/grunt managed resources. [thet]

  • Remove the div.geolocation elements. Instead, render the list of geolocation points as JSON value on a data-geopoints attribute on the map element. [thet]

  • Reintroduce package level imports and avoid circular import by moving out the message factory. [thet]

  • Remove the map id attribute on the map element and use instead a map css class. [thet]

1.2.1 (2015-03-04)

  • Avoid circular imports by removing the package level imports. [thet]

1.2 (2015-03-04)

  • PEP8. [thet]

1.1 (2014-04-30)

  • Simplify templates and cleanup Google Map leftovers. [thet]

  • Convert default locations strings from Products.Maps to tuples with floats. [thet]

  • Improve handling of non-required geolocation fields with missing values. [davisagli]

  • Fix display template markup to be compatible with recent versions of Products.Maps. [davisagli]

  • Add supermodel import/export handler. [davisagli]

  • Fix declaration of exported names. [davisagli]

  • Remove dependency on Products.Maps. Don’t fail, if default_location is not set or maps_configuration adapter not found. [thet]

1.0 (2013-02-07)

  • Initial release

Metadata

Release files for plone.formwidget.geolocation 4.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for plone.formwidget.geolocation 4.0.0
File Size Uploaded Provenance Actions
plone_formwidget_geolocation-4.0.0.tar.gz 2.6 MB Without provenance Details for plone_formwidget_geolocation-4.0.0.tar.gz

Release files / plone_formwidget_geolocation-4.0.0.tar.gz

Download URL plone_formwidget_geolocation-4.0.0.tar.gz
Size 2.6 MB
Tags Source
SHA-256 checksum
How to use checksums
6275056da9b88452497be0683fb4b8c729ef045ace45d9e2381d7e17bb37e823
BLAKE2b-256 checksum
How to use checksums
fbf19014ce82e46d10237e4dc277f678d91e482ee219c2deace5d697c82dcceb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.5

Security for plone.formwidget.geolocation 4.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page