Skip to content Skip to sidebar Skip to footer

Getting Layer Features With Querysourcefeature

I'm trying to get all features from Mapbox style layer. I found querySourceFeature() method. However, I cannot get exact source. Here simple code block from Mapbox documentation. I

Solution 1:

In order to get style layer as source, we should use VectorSource().

VectorSource source = style.getSourceAs("composite");

"composite" is layer' source variable in "style.json".

For querySourceFeatures(), we should give layerSource(String[]) and Expression.

List<Feature> all_features = source.querySourceFeatures(source_layers,Expression);

"source_layers" is layer' source-layer variable in "style.json".

Post a Comment for "Getting Layer Features With Querysourcefeature"