How to enable a popup for a OGCFeatureLayer

78
2
Jump to solution
09-30-2020 10:29 AM
Highlighted
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)
Reply
0 Kudos
1 Solution

Accepted Solutions
Highlighted
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

Reply
0 Kudos
2 Replies
Highlighted
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

Reply
0 Kudos
Highlighted
New Contributor III

Yes, it does work with the 4.17.

Thank you!