How to enable a popup for a OGCFeatureLayer

581
2
Jump to solution
09-30-2020 10:29 AM
julienrobitaille
New Contributor III

Hello,

From the documentation, to enable a popup using the OGCFeatureLayer you first need to set popupEnable to true, and either set Popup.defaultPopuTemplateEnabled to true or use your own template. I have tried bith things, neither of them work. When I click on a feature in the map, nothing is happening. 

Here is the relevant section of my code:

            Popup.defaultPopupTemplateEnabled = true;
            
            var layer_marais = new OGCFeatureLayer({
                url: "http://localhost:32769/geoserver/ogc/features/",
                collectionId: "OGSL:marais_pointe-fortin_ichtyo_longt_2019",
                legendEnabled: true,
                popupEnabled: true,
 
            })

Anybody have the same issue, or could help me with it?

Thanks in advanced! 

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
ReneRubalcava
Frequent Contributor

It looks like this works in the next version of the API, so will work in 4.17 release.

https://codepen.io/odoe/pen/KKzLLgP?editors=1000 

View solution in original post

0 Kudos
2 Replies
ReneRubalcava
Frequent Contributor

It looks like this works in the next version of the API, so will work in 4.17 release.

https://codepen.io/odoe/pen/KKzLLgP?editors=1000 

0 Kudos
julienrobitaille
New Contributor III

Yes, it does work with the 4.17.

Thank you!