Select to view content in your preferred language

Display Popup from FeatureServer

1026
2
06-27-2023 01:34 PM
AddisonShaw
Occasional Contributor

We've got a popup style defined on our FeatureServer with specific attributes showing. It seems that when using the ArcGIS JS SDK that you are unable to render any pre-defined popups without duplicating the style as a popupTemplate.

Is it possible to use the pre-defined styles through the SDK, or is it mandatory to defined them programmatically? We ask because there will be clients displaying their custom Feature Layers on our web application's map and it would be very useful if we didn't have to programmatically redefine them for every client.

0 Kudos
2 Replies
LaurenBoyd
Esri Contributor

Hi @AddisonShaw -

How are you creating your FeatureLayer in the JS SDK?

You can use predefined popups if you're consuming a hosted feature service via a portal item. Here's an example application that adds a hosted feature layer via FeatureLayer.portalItem property where the popups were pre-configured in ArcGIS Pro before publishing the service: https://codepen.io/laurenb14/pen/qBQrKKM?editors=1000 

Lauren
0 Kudos
PLadd
by
Frequent Contributor

I'd like to take @AddisonShaw 's question a step further. How can we include the FeatureServer's pre-defined popup when using the Query widget?

All of the examples I have seen are writing code using the popupTemplate but I'd like the look of the popup to be consistent within the UI by using my pre-defined popup with the Query widget.

0 Kudos