Experience Builder - access pop-up for layers added through custom widget

381
0
05-26-2021 11:54 AM
KayceeFaunce
New Contributor III

Hi! Hopefully the correct forum for this question. My first time working with custom widgets in Experience Builder (v1.4), I thought I'd start with implementing and editing the layer toggle widget found here: https://github.com/Esri/arcgis-experience-builder-sdk-resources/tree/master/samples/widgets/view-lay....

I notice that pop-ups for the layers added to the map through this widget cannot be accessed. Could anyone help me figure out what modifications I need to make to enable pop-ups? I thought adding defaultPopupTemplateEnabled: true where the featureLayer is added in widget.tsx would work, but no luck:

 

      if (evt.target.value && evt.target.value !== "") {
        // Create and add the new Feature Layer
        const featureLayer = new FeatureLayer({
          url: evt.target.value,
		  defaultPopupTemplateEnabled: true
        });
        this.state.jimuMapView.view.map.add(featureLayer);
        this.setState({
          featureLayerOnMap: featureLayer,
        });
      }
    } else {
      console.error(
        "You probably need to choose your map in the settings panel."
      );
    }
  };

 

Thanks!

0 Kudos
0 Replies