Return empty features from vectorSource.features method
See original GitHub issueDescribe the bug
Simply I am try to get features from vector source layer by layer id. Layer loading perfectly in map and i can
this.oMap.queryRenderedFeaturesAtPoint([event.properties.screenPointX, event.properties.screenPointY], [], ["idPlotInfo"]);
above working for fine, my requirement is get features by filter.
To Reproduce
<MapboxGL.VectorSource ref={(e) => { this.oPlot = e }} id="idPlots" tms={true} tileUrlTemplates={["pbfUrlplotm@EPSG:900913_1024@pbf/{z}/{x}/{y}.pbf"]}>
<MapboxGL.FillLayer id="idPlotInfo" sourceID="idPlots" sourceLayerID="plotm" style={{ fillColor: "red", visibility: "visible" }} />
</MapboxGL.VectorSource>
getFeatures(){
const res = await this.oPlot.features(["idPlotInfo"]);
console.log(res);
}
res:
{
"type": "FeatureCollection",
"features": []
}
Versions (please complete the following information):
- Platform: android and ios
- Platform OS: android 13, ios 15
- Device: iphone 7 plus and samsung galaxy s8plus
- Emulator/ Simulator: yes and also real device
- Dev OS: macos 11.6
- react-native-mapbox-gl Version : 8.3.0
- Mapbox GL version: 6.3.0
- React Native Version: 63.4
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:7 (6 by maintainers)
Top Results From Across the Web
vector source returning empty in source.getFeatures()
I can see the layer on the map when i run it. But the problem is when i use alert message to check...
Read more >OpenLayers v7.1.0 API - Class: VectorSource
Will be null unless the source was configured with useSpatialIndex set to false , or with an Collection as features . Returns: The...
Read more >Remove All Features from Vector Layer in OpenLayers 3
Vector has a clear method that you can use to remove all the features from ... This is how you will use that...
Read more >OpenLayers v5.3.2 API - Class: VectorSource
If the callback returns a "truthy" value, iteration will stop and the function will return the same value. If you are interested in...
Read more >getFeaturesAtCoordinate returns an empty array #3703 - GitHub
I have some features at the same coordinate and when I check using ... array when on empty source', function(){ + var got...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ok i will create sample repo and send link for reference
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.