Help with a custom content type to storage Latitude and longitude values and drawing it on the Maps

Hi guys

I need help with a custom content type to storage Latitude and longitude values

The a custom content type currently defines the coordinates field as follows:

    coordinates = schema.TextLine(
        title=_("Coordinates"),
        description=_("Please, fills the latitude and longitude values"),
        required=False,
    )

This content type is a migration to a custom Dexterity content type on Plone 6,

The currently content type (Archetypes) is in a Plone 4 website, as the following screenshot:

This information (Coordinates) is necessary to display searches by category of personalized content and to display the location on a Google Maps map.

  1. Option 1: You can select certain category criteria to apply a search filter.
  2. Option 2: List of all custom content type
  3. Option 2: Draw the localization on the map based the `coordinates` values

The above image is implemented for Plone Classic UI with Zope templating. I need to implement that in Volto components.

Overview of Versions

  • Plone 6.1.2 (6109)
  • CMF 3.7
  • Zope 5.13
  • Python 3.12.11 (main, Jun 18 2025, 19:09:13) [GCC 12.2.0]
  • PIL 11.2.1 (Pillow)
  • WSGI: Activated
  • Server: waitress 3.0.2
  • Volto 18.29.1
  • plone.restapi 9.15.1

Add-ons

  • @plone/volto-slate 18.7.1

  • @eeacms/volto-accordion-block 11.0.4

  • volto-subblocks 2.1.0

  • volto-form-block 3.13.0

  • volto-multilingual-widget 3.2.1

  • volto-gdpr-privacy 2.2.15

  • @mbarde/volto-fullcalendar-block 1.0.1

  • @kitconcept/volto-banner-block 1.1.0

  • @kitconcept/volto-bm3-compat 1.0.0-alpha.1

  • @kitconcept/volto-button-block 4.0.0

  • @kitconcept/volto-carousel-block 2.0.0

  • @kitconcept/volto-heading-block 2.5.0

  • @kitconcept/volto-highlight-block 4.5.0

  • @kitconcept/volto-introduction-block 1.1.0

  • @kitconcept/volto-logos-block 3.0.0

  • @kitconcept/volto-separator-block 4.2.1

  • @kitconcept/volto-slider-block 6.4.1

  • @plonegovbr/volto-social-media 2.0.0-alpha.10

  • @kitconcept/volto-light-theme 7.6.0

  • volto-project 1.0.0-alpha.0

I have the following packages installed on the backend:

  • plone.formwidget.geolocation==3.0.8.dev0
  • collective.geolocationbehavior==1.7.3.dev0

I have some reasonable doubts:

  1. Is it correct to use ’schema.TextLine’ for the ’coordinates’ attribute?
  2. collective/collective.venue: Dexterity venue type for use with events. Could it be useful to me?
  3. It is better to apply ‘collective.geolocationbehavior‘, so I don't use the ’coordinates’ attribute?

I am genuinely concerned that this data cannot be shared. ’coordinates’ attribute with Volto.

Any idea?

plone.formwidget.geolocation provides a schema field GeolocationField ( plone.formwidget.geolocation/plone/formwidget/geolocation/field.py at master · collective/plone.formwidget.geolocation · GitHub ) which contains an object with two attributes: latitude, longitude …

It further provides a z3cform widget and dataconverter to show these values in two fields and a searchable map, but this is for Classic-UI only (with pat-leaflet)

to migrate your data you can use plone.restapi deserializer and provide the data like this:

{
  "mygeolocationfield": {
    "latitude": 43.0234,
    "longitude": 13.2345
  }
}

collective.geolocationbehavior adds a behavior which uses the field and widget from plone.formwidget.geolocation

AFAIK collective.venue is also classic-ui only and has a behavior with several venue fields.

You can see all of those (enhanced with collective.collectionfilter) in action here for example: Projects — English

As I’m not a Volto developer, I do not know how to bring this to volto unfortunately.

EDIT: since there is a plone.restapi serializer too, it might be possible to get that information to Volto somehow…

2 Likes