Open 1ec5 opened 7 years ago
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.
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