Create a popup and tooltip for every feature on a multivalue geofield field.

Created on 28 August 2025, about 2 months ago

I would like to know if there is a straightforward or already implemented way to set dynamically tooltip and popup values on every feature included in the map. The thing is with the configuration that exists now, these configured in widget tooltip and popup values are being applied on all features that correspond to the multivalue geofield field. Is there anything that already solves that, or do I need to use hooks and Leaflet JS personalizations? I noticed that using GeoJSON input field, even if you include properties for tooltip and popup, they are ignored.

I saw the following example from some years ago, but I donโ€™t find how to achieve the desired result.
https://www.geodemocracy.com/drupal_geofield_stack_demo/web/geoplaces-map-leaflet

๐Ÿ’ฌ Support request
Status

Active

Version

10.3

Component

Documentation

Created by

๐Ÿ‡บ๐Ÿ‡พUruguay opantoja Montevideo

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @opantoja
  • ๐Ÿ‡ฎ๐Ÿ‡นItaly itamair

    Hi @opantoja ... thanks for reporting this.

    First of all, be aware that your link to the Drupal Leaflet demo page is broken / wrong.
    I guess you wanted to point to this instead:
    https://www.geodemocracy.com/drupal_geofield_stack_demo/web/geoplaces-ma...

    What your are trying to achieve here is not supported by the Drupal Leaflet module and the Drupal Entity and Fields API architecture itself, I would say.
    As you can see (or get) Drupal Leaflet Popup and/or Tooltip can be populated (at the moment) with some other field value(s) of the Entity the Geofield belongs to, or with some specific View Display of the Entity itself.
    Thus it is pretty evident that in case of a Multivalue Geofield each Marker representing a different instance/delta of that could refer to the same entity content (and Popup or Tooltip) definition.
    Am I clear in what I mean?
    Indeed in the Drupal Leaflet demo page that you are referring to, a different Popup or Tooltip does correspond to different Contents / Nodes with different Geofield (not multivalue).

    If you really want to implement a 1 Content / Entity to N Geofields / Markers with multi specific Popups / Tooltip (still referring to the same parent Content / Entity), then you should extend your actual data model and implement a Content with Multi Field (such a Paragraph type) and implement your Geofield field in the Paragraph and add specific info (for your Popup / Tooltip) in other Paragraph type fields ...
    Of course you will need to adjust / extend your Leaflet View and make it working on that Paragraph Geofield (instead of the Geofield applied directly to your Content / Entity, that you should need anymore).

    Hope my suggestions (tips and hints) could make sense and be sufficiently clear to you.
    This is all a matter of Drupal architecting creativity and data modelling awareness (learning by doing and getting to the proper point ... ).

Production build 0.71.5 2024