I am developing a custom widget in ArcGIS Experience Builder, I have apply the definition expression on a layer to filter the locations on the map(using a webmap from ArcGIS Enterprises portal in my application).
The issue is when I click on the location to view the popup, all locations starts displaying on map and this (#data_s=id%3AdataSource_1-Risk_Database_Master_2_2642%3A100941) has been added in the url.
So, it seems that popups in experience builder is managed through the Data Source. Can anybody help me to resolve this issue. Any documentation or tutorial for the datasource.
OR
Is it possible to disable this behaviour in ArcGIS Experience Builder, and handle the popup display programmatically.
@JeffreyThompson2 , @Ke_Xu , @ShengdiZhang
Here , how i am applying filter through defination expression on feature layer.
try {
// find the layer(risk locations) in the map to alter the definationexpression according to selected tile where clause
const layer: any = jimuMapView.view.map.layers.find((layer: any) => layer?.url === tile.layer);
if (layer) {
// Apply query as a definition expression
layer.definitionExpression = tile.whereClause;
await layer.refresh();
// Optional: Zoom to features
const queryParam = new Query({
where: tile.whereClause,
returnGeometry: true,
// outFields: ['*'],
});
const result = await query.executeQueryJSON(tile.layerUrl, queryParam);
if (result.features.length > 0) {
await jimuMapView.view.goTo(result.features.map((f) => f.geometry));
}
else {
await jimuMapView.view.goTo(jimuMapView.view?.map.initialViewProperties?.viewpoint?.targetGeometry);
}
} else {
console.warn(`Layer with URL ${tile.layerUrl} not found in map`);
console.log('Available layers:', jimuMapView.view.map.layers.toArray());
}
} catch (error) {
console.error('Error applying query to map:', error);
}
Best Regards,