question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Return empty features from vectorSource.features method

See original GitHub issue

Describe 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:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
ansarikhurshid786commented, Oct 20, 2021

Ok i will create sample repo and send link for reference

0reactions
stale[bot]commented, Apr 18, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found