Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Features returned by queryRenderedFeatures should return layer #7162

Open
1ec5 opened this issue Nov 23, 2016 · 4 comments
Open

Features returned by queryRenderedFeatures should return layer #7162

1ec5 opened this issue Nov 23, 2016 · 4 comments
Labels
Core The cross-platform C++ core, aka mbgl feature GL JS parity For feature parity with Mapbox GL JS

Comments

@1ec5
Copy link
Contributor

1ec5 commented Nov 23, 2016

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

@stale
Copy link

stale bot commented Nov 23, 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.

@stale stale bot closed this as completed Nov 23, 2018
@1ec5
Copy link
Contributor Author

1ec5 commented Jun 26, 2019

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

@1ec5 1ec5 reopened this Jun 26, 2019
@stale stale bot removed the archived Archived because of inactivity label Jun 26, 2019
@stale stale bot added the archived Archived because of inactivity label Dec 23, 2019
@stale
Copy link

stale bot commented Dec 23, 2019

This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.

@stale stale bot closed this as completed Dec 23, 2019
@julianrex julianrex reopened this Jan 2, 2020
@stale stale bot removed the archived Archived because of inactivity label Jan 2, 2020
@stale stale bot added the archived Archived because of inactivity label Jul 2, 2020
@stale
Copy link

stale bot commented Jul 3, 2020

This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.

@stale stale bot closed this as completed Jul 3, 2020
@1ec5 1ec5 reopened this Jul 14, 2020
@stale stale bot removed the archived Archived because of inactivity label Jul 14, 2020
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
Projects
None yet
Development

No branches or pull requests

2 participants