Are WebScene popups a thing?

476
1
Jump to solution
09-21-2021 03:36 PM
BrentGrossman
New Contributor III

I'm struggling to get popups to show up when I click on a feature displayed in a portal WebScene in my code. I know that popups are enabled for my layers, because when I view the WebScene in Scene Viewer in my browser, I see the popups when I click on features.

I notice that in the example here: https://developers.arcgis.com/javascript/latest/display-a-web-scene/, that when I click on a feature, it gets highlighted, but no popup appears. I don't know if popups are enabled for the layers in that WebScene, but when I tried to modify that code to show my WebScene, for which popups are enabled, they still don't show up.

Is it possible to have a portal WebScene in my web application and show popups for its feature layers?

0 Kudos
1 Solution

Accepted Solutions
GreteSoosalu
Esri Contributor

Hi Brent,
Yes, web scenes in web apps can have popups!

Unless the layer’s popups are disabled, the Scene Viewer always shows one: no matter whether a user has configured a popup or not. In the latter case, a popup with a default template is shown.
When the same web scene is loaded in a web app, the layers without such a configuration won’t display a popup. To enable them, you need to add the following line in your code:

view.popup.defaultPopupTemplateEnabled = true; 

See more here. Let me know if this solves your problem.


 

By the way, in the sample you refer to, the popups are displayed below the map because the CSS file is missing due to a typo. But once I changed the URL in the codepen to point to the latest style file, the popups appear correctly again. We’ll get that sample fixed.

View solution in original post

1 Reply
GreteSoosalu
Esri Contributor

Hi Brent,
Yes, web scenes in web apps can have popups!

Unless the layer’s popups are disabled, the Scene Viewer always shows one: no matter whether a user has configured a popup or not. In the latter case, a popup with a default template is shown.
When the same web scene is loaded in a web app, the layers without such a configuration won’t display a popup. To enable them, you need to add the following line in your code:

view.popup.defaultPopupTemplateEnabled = true; 

See more here. Let me know if this solves your problem.


 

By the way, in the sample you refer to, the popups are displayed below the map because the CSS file is missing due to a typo. But once I changed the URL in the codepen to point to the latest style file, the popups appear correctly again. We’ll get that sample fixed.