Query a WFS Layer with Feature Reduction Cluster

20
0
Thursday
ShariMeier
New Contributor

Hi there, 

I'm currently working with a WFS Layer with a feature reduction to create clusters. 

Now I need to identify on which cluster a user has clicked on the map and which objects are included in this cluster. As I made the feature reduction on the client-side - I assumed that I needed to choose a query method that does the query on client-side. I tried it directly on the layerView and the WFS layer ( see code example below).

However, both ways don't recognize the cluster. But they return the points behind the cluster or, more precisely, in the cluster if I accidentally click on the exact spot where original points were when I'm trying to select the cluster. What am I missing here?

Thanks in advance for your tips and help!

Best wishes, 
Shari


//query on WFSLayerView
const query = (layerView.layer as WFSLayer).createQuery();
query.geometry = point;
query.distance = distance;
query.units = 'meters';
query.spatialRelationship = 'intersects';
query.returnGeometry = true;
query.outFields = ['*'];

(layerView as WFSLayerView).queryFeatures(query).then(function (results) {
console.log(results.features);
});

//query on WFSLayer
return fromPromise(
(layer as WFSLayer).queryFeatures({
geometry: point,
distance: distance,
units: 'meters',
spatialRelationship: 'intersects',
returnGeometry: true,
outFields: ['*'],
}),
).pipe(
map((featureSet: FeatureSet) => {
console.log(featureSet.features);
}),
);

 

0 Kudos
0 Replies