Handling a Scene Data Source with a Related Map Data Source

91
1
Jump to solution
yesterday
DavidSolari
MVP Regular Contributor

ExB Developer Edition 1.17.0

I'm working through a bug where a set of map service layers in a Scene is filtered out of my DataSourceSelector. My "hideDs" function takes in the current DataSource JSON, the dataSourceId of the JMV and a geometry type string, then does this:

const hideDataSource = (dsJson: IMDataSourceJson, jmvDataSourceId: string, geomType: GeometryType) => {
    const ds = DataSourceManager.getInstance().getDataSource(dsJson.id);
    return (ds.parentDataSource?.id !== jmvDataSourceId) || ds.getGeometryType() !== geomType
}

This works fine with my test Maps but when I try with a Scene, it looks like the "parentDataSource" is a completely different source with a "WEB_MAP" type, which means my filter breaks. Is this expected behaviour with Scenes in ExB? Is there a way to safely correlate the two data sources? Would selecting this source even work in widgets?

0 Kudos
1 Solution

Accepted Solutions
DavidSolari
MVP Regular Contributor

Whoops, false alarm! I left another, virtually identical map in my test experience that was tripping things up. The real issue is that map service layers have the entire service as their parent, so I need to use this modified listing to check for that:

const hideDataSource = (dsJson: IMDataSourceJson, jmvDataSourceId: string, geomType: GeometryType) => {
    const ds = dsManager.getDataSource(dsJson.id);
    return !((ds.parentDataSource?.id ?? "").startsWith(jmvDataSourceId)) || ds.getGeometryType() !== geomType
}

View solution in original post

0 Kudos
1 Reply
DavidSolari
MVP Regular Contributor

Whoops, false alarm! I left another, virtually identical map in my test experience that was tripping things up. The real issue is that map service layers have the entire service as their parent, so I need to use this modified listing to check for that:

const hideDataSource = (dsJson: IMDataSourceJson, jmvDataSourceId: string, geomType: GeometryType) => {
    const ds = dsManager.getDataSource(dsJson.id);
    return !((ds.parentDataSource?.id ?? "").startsWith(jmvDataSourceId)) || ds.getGeometryType() !== geomType
}
0 Kudos