[Lizmap] R: Issue with Displaying Popup on Selection in Lizmap

Fabio Pifferini Fabio.Pifferini at masotti.ch
Fri Jun 28 04:54:04 PDT 2024


Hi Philippe,
have you try the embedded feature of Lizmap ?

Popup (lizmap.com)<https://docs.lizmap.com/current/it/publish/configuration/popup.html>


Fabio

Da: Lizmap <lizmap-bounces at lists.osgeo.org> Per conto di Philippe CIANFARANI via Lizmap
Inviato: venerdì, 28 giugno 2024 12:10
A: lizmap at lists.osgeo.org
Oggetto: [Lizmap] Issue with Displaying Popup on Selection in Lizmap


Hello everyone,

I would like to display a popup when I select a point in Lizmap. I have added a script named displayPopupUnderSelected.js to my directory /............/media/js/monprojet.

// Définir la source de la légende pour le popup
var popup_layer_source = 'points_mesures_suivi_quantitatif_cce';

// Écouter l'événement de sélection de couche dans Lizmap
lizMap.events.on({
    layerClick: function(evt) {
        // Vérifier si la couche sélectionnée correspond à la source de légende
        if (evt.layerName === popup_layer_source && evt.feature) {
            // Construire le contenu HTML du popup avec l'image
            var html = '<div>';
            html += '<img src="adresse/images/legend.png"<http://sig-hautegironde.fr/lizmap/index.php/view/media/getMedia?repository=etiagecce&project=suivi_etiage_cce&path=media/images/legend.png> style="max-width: 100%; height: auto;">';
            html += '</div>';

            // Afficher le popup avec l'image
            LizMap.Popup.show({
                content: html,
                title: 'Légende',
                maxWidth: 400 // Largeur maximale du popup en pixels (ajustez selon vos besoins)
            });
        }
    }
});

However, nothing happens when I make a selection. I have enabled scripts in the admin panel. Additionally, there is a script named popup.js in the same directory. Could there be a conflict? Any ideas would be appreciated.

Thank you in advance.

Best regards,

--

Philippe CIANFARANI

Chef de projet SIG

Syndicat Mixte du SCoT de la Haute Gironde Blaye - Estuaire

Maison des Services au Public

32 rue des Maçons - BP 134

33391 Blaye Cedex

05.57.94.11.87/06.51.10.97.86
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/lizmap/attachments/20240628/8a3cea1d/attachment-0001.htm>


More information about the Lizmap mailing list