-
-
Notifications
You must be signed in to change notification settings - Fork 738
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
queryRenderedFeatures should returns original feature geometry #2886
Comments
Repeating my reply from slack: |
@HarelM Thank you for feedbacks. I understand But as a developer of Mapbox/Maplibre, this behaviour of |
This library is about rendering the data, not about storing it for you. |
@HarelM ok. I agree this is not bug. I saw this is well documented on the website (https://maplibre.org/maplibre-gl-js/docs/API/classes/maplibregl.Map/#queryrenderedfeatures). I am sorry for this. Maybe you can consider this issue as a feature request. By the way, what may confuse developers is the definition of |
For what it’s worth, the original Mapbox GL team did want to support this use case: mapbox/mapbox-gl-js#5639. It isn’t quite the case that GL JS can’t be used as geometry storage; after all, it is typically the only storage of vector tile data in the application. Storing both the tiled and untiled data in memory adds some overhead that may not always be desirable. The iOS does store the original, untiled data as a property of the source. However, this doesn’t affect feature querying; developers still need to filter that data manually. |
Let me close this issue now since it’s not a bug. I understood the purpose of both methods is not for getting geometry of features. It can be used for getting just attributes. |
maplibre-gl-js version:
browser: Google Chrome
Steps to Trigger Behavior
{polygon layer name added in No.1 step}
});Link to Demonstration
There is my working branch and preview here (watergis/svelte-maplibre-components#283).
village
layer.queryRenderedFeatures
The geometries from queryRenderedFeatures are split by tiles as shown in the below screenshot. and it returns 41 features since there are only 28 unique features in village layer.
Expected Behavior
It would be better if queryRenderedFeatures returns original geometry of features.
Actual Behavior
queryRenderedFeatures returns duplicated features split by multiple tiles
References
There are same issues reported for mapbox-gl-js.
The text was updated successfully, but these errors were encountered: