I have a geojson with some polygons, added it as a source and created a layer to show those features on the mapbox map.
Since I am using this method: (Edit from the sample souce: MapboxGLAndroidSDKTestApp)
final PointF pixel = mapboxMap.getProjection().toScreenLocation(point);
List<Feature> fList = mapboxMap.queryRenderedFeatures(pixel, "polygons");
for(Feature feature:fList){
Log.d(TAG,"FeatureInfo: "+feature.toJson());
}
I can check if the marker is inside one of those polygons by passing the marker position to it.
But when I move my camera far away to the marker, the polygon is not rendered and the checker is not work anymore.
So my question is, is there any way to check if the marker is inside the polygon, which no matter where is my camera pointing at?