-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Feature eventing (native equivalent of queryRenderedFeatures and querySourceFeatures) #352
Comments
It's not there yet on the native side, but it's coming. I could have sworn we had a ticket for this over here, but I guess not as I couldn't find it. So this is it :-) |
This will get a Cocoa API, by the way. So you should be able to turn gestures at a |
Alright, I'll stand by. Thanks! |
What is the status for a native |
It will be eventually, but the focus for now has just been on point annotations, which exist in a runtime style layer and query based on |
I am so pumped for |
Being able to select OSM base data would be an extremely valuable feature. This is something I'd enjoy working on. Could you point me in the right direction? |
Yes, I would check out the Point annotations do index based on tiles made at runtime as annotations are added and removed, which is how gestural touch of points on the map that are rendered in GL was possible. |
It looks like you have boost's rtree in there. Are you using this in the same way as rbush in the JS implementation? Are you saying only points are added to a spatial index? |
I'm poking around, and the only actual rtree usage I am seeing is in https://github.com/mapbox/mapbox-gl-native/blob/master/src/mbgl/text/collision.hpp#L32 Would we want to use the same container as is being used here for map geometries? I know PostGIS uses http://stackoverflow.com/questions/9891374/is-boost-geometry-mature-enough What do you guys think? Clearly this is not a trivial feature. |
Beginnings of this in 139b9e7. Right now it's just inserting feature names (actually, I realize we eventually want this to be style-aware (which it could fairly easily be) as well as eliminate the need for Next up is to plumb through interactive gestures such as we do with annotations right now. For debug purposes, we could even piggyback on / add results to the existing annotation query, at least for log-debugging. This should just be a fairly simple What we should end up with is tapping the map logging nearby POIs when present (i.e. at high zooms) as a proof of concept. Parsing output right now:
This currently does not noticeably affect rendering performance, even though it's adding to the R-tree from inside the workers ahead of render. It does affect things when you add all layers, which is really the meat of mapbox/mapbox-gl-js#1479 — automatically parsing all features at a much larger scale efficiently. |
Getting close here. Current blocker is the fact that we postpone parsing of symbol layers until dependencies are loaded, and thus far I've just been adding to a tile's feature tree during |
The downside to having buckets build up their own feature trees is duplication of code in each bucket type. |
Also of note here: what does a native |
I have started to work on implementing Android equivalent of #5110 in (will update with PR number once that lands). Before implementing the contents of #5110, I need to refactor the Android annotations API to match iOS more. As pointed out by @tmcw in #3288 and related, there are some fundamental issues with the current Android API. Matching the iOS API will not only help implementing this feature but will also make it easier for implementing parity features in the long run. |
Note that the iOS SDK is affected by #5201 just like the Android SDK is affected by #3288. If you do make MultiPoint a separate concept from Polyline and Polygon, it'll be a backwards-incompatible change. One alternative I proposed in #5201 (comment) was to create a new class to represent the GeoJSON concept of a multipoint, but call it something else. |
@1ec5
|
The discussion in #5201 is specific to the iOS SDK, which has MGLMultiPoint for compatibility with MapKit. That class actually does have code behind it, privately, which is why it can’t just be a protocol. If you’re OK with a backwards-incompatible change in the Android SDK (which would require a semver-major bump), I suggest making all four classes direct children of |
Breaking out port of |
…oint from Polyline/Polygon inheritance.
…in MapboxMap. Exposed constructors of Marker, Polyline and Polygon.
… for Android binding, removed Multipoint inheritance issue
…quivalent, removed duplicate src file names
@ivovandongen created an android follow up issue in #5869. |
I've been playing with MapboxGL, and I'm trying to figure out how to handle click events to select features. Is this functionality built in?
Looking at the JavaScript in the several blog posts that use mapbox-gl-js, I am able to got the Point object from a click event. Then, I see a function
map.featuresAt
, but I am not able to get it to return any features...Any clues? Regarding the native libraries, would this be in the Cocoa library?
The text was updated successfully, but these errors were encountered: