This repository has been archived by the owner on Aug 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Features returned by queryRenderedFeatures should return layer #7162
Labels
Core
The cross-platform C++ core, aka mbgl
feature
GL JS parity
For feature parity with Mapbox GL JS
Comments
1ec5
added
Core
The cross-platform C++ core, aka mbgl
feature
GL JS parity
For feature parity with Mapbox GL JS
labels
Nov 23, 2016
This was referenced Jul 18, 2018
This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions. |
Still needed for parity with GL JS. This feature would be very useful for working with expressions if mapbox/mapbox-gl-js#5677 were addressed at the same time. /cc @cmtoomey |
This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions. |
This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
Core
The cross-platform C++ core, aka mbgl
feature
GL JS parity
For feature parity with Mapbox GL JS
If you call
queryRenderedFeatures()
– or on iOS and macOS,-[MGLMapView visibleFeaturesAtPoint:inStyleLayersWithIdentifiers:]
– the features you get back should indicate the layer(s) the feature comes from. It should at least be a layer identifier. Better yet, we could port mapbox/mapbox-gl-js#879 and include the evaluated layer as part of the feature object.One use case is that, once #6097 lands, I’d like to implement in macosapp where you can right-click at a point and select Reveal in Layers from the context menu to select the layer that contains that feature in the Layers sidebar.
A more real-world use case might be that the developer wants to get all the roads that intersect at a given location, arranged in order, but the roads are spread among multiple layers (as they are in Mapbox Streets). If the developer issues multiple calls to
queryRenderedFeatures()
, one per layer, they’ll get all the roads, but they won’t be able to tell which road is on top of which without looking at the list of layers./cc @jfirebaugh @lbud @ericrwolfe
The text was updated successfully, but these errors were encountered: