mapbox / mapbox-gl-native

Interactive, thoroughly customizable maps in native Android, iOS, macOS, Node.js, and Qt applications, powered by vector tiles and OpenGL
https://mapbox.com/mobile
Other
4.35k stars 1.33k forks source link

iOS missing querySourceFeatures #16467

Closed jradasaurus closed 4 years ago

jradasaurus commented 4 years ago

Hello,

It appears iOS SDK does not have a querySourceFeatures method. Checking both the documentation and the source code there does not appear to be a way to query for all features (only the related visible feature methods are available).

The Android SDK has it: https://docs.mapbox.com/android/maps/overview/query/#query-source-features

The JS SDK has it: https://docs.mapbox.com/mapbox-gl-js/api/#map#querysourcefeatures

And the relevant changes were merged into GL Native Core in 2017: https://github.com/mapbox/mapbox-gl-native/pull/8263

Is there a reason it's not available in the iOS SDK? It seems it was supposed to be part of iOS 3.5.0 release (a few years ago). Any information on this much appreciated- maybe I missed the API documentation!

My use case: I want to show a popup that lists all of the features contained at a specific point (or small bbox)- and do that for all layers/features, not just the few that are visibly rendered (ie I want to capture lower level layers from my data source which are custom marine tiles).

julianrex commented 4 years ago

@jradasaurus the following methods both call querySourceFeatures behind the scenes:

Note that these methods are not on MGLMapView but on the source.