How to get datasource by DataSourceManager

454
1
11-07-2024 08:07 PM
Labels (2)
Than_HtetAung
Occasional Contributor

Hi All,

May I know how to get layer by datasource id, When I use Datasourcemanager.getInstance().getDataSource(datasourceid). If I input the map datasource id , I can get the web map. but if I choose the featurelayer datasource id I got undefined result.

I have selected the feature layer in the setting page.

I want to query like this, but I can't figure it out in any of the documentation

// layer.queryFeatures(query).then((results) =>{
      //   if (results.features && results.features[0]) {
      //     console.log('geofence layers')
      //     console.log(results.features)
      //   }
      // })
 
I am using experience builder version 1.15
1 Reply
DanielWebb
Frequent Contributor

Did you ever get this to work? I'm struggling with this too.

0 Kudos