Help with queryRenderedFeaturesAtPoint #3204
Unanswered
get-Friday
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
What happens is I'm trying to query polygon features from my mapbox in the center of my application screen, the problem is when I convert the coordinates in Point In View (because there's no a query features from coordinates as far as I know) and send them to the method it seems to query these features from the corner of the screen and not the center.
I've made this sketch to illustrate better my problem with this method. (Read polygon where I wrote layer, typo sorry)
Now to the code. Is quite simple what I'm doing, so I don't see what I'm doing wrong.
React native version: 0.70.10
rnmapbox/map version: 10.0.14
My Mapbox.MapView
Functions handling query features:
Here my const rendered is always returning the features of polygon B (like illustrated in the image above) instead of A which is at the center of the screen.
On getMapData my pointInView constant is always half the width and height my map size (for example my map is 392.7px wide and 648px tall in this screen, so the PiV is always half: 196.4/324) and this apparently does not translate correctly to the middle of the screen. I am trying to use this to get polygon A data.
I don't know what else to do in this situation, would be glad if someone would help me with this issue.
Beta Was this translation helpful? Give feedback.
All reactions