tangram
tangram copied to clipboard
Enable introspection of feature parsing/rendering info
We currently support the return of some feature information via our interactive draw parameter and feature picking events (and getFeatureAtPixel() method).
For a design environment like Tangram Play, it would be very useful to have more such info available. For example, this could enable the user to click any feature/pixel, and get info not just on the feature itself, but also the Tangram layer names it matched, and specific draw parameters that were used to build and render it.
Here's a list of information to consider. Because of added overhead for some of these (especially those that require copying or storing additional styling data that is currently discarded), we may want to put some of this functionality behind an explicit "introspection" mode that can be enabled by the client (e.g. Tangram Play).
- [x] Enable feature picking/selection for all objects (not just those marked as
interactive) - [x] Feature properties
- [x] Data source name and layer the feature originated from
- [x] Scene layers the feature matched (e.g.
[roads.bridges, roads.paths]) - [ ] Computed
drawblock for matching scene layers (result ofdrawblock merging) - [ ] Computed
drawparameters for specific feature (e.g. after JS function-based parameters are evaluated)
Data source name and layer added in be3640a7e554182e2b1e4bce9aefc817867dc785 & 2b47f8ee895f11b9f7a0e785f0440ebd6c8cdf5b.
Matching scene layer names added in #274.
"Introspection mode" WIP (currently enables interactivity for all features) in https://github.com/tangrams/tangram/compare/introspection.
+1
Ability to turn introspection on/off for all features at run-time included in #303, will be in 0.8. Remaining items such as computed draw parameters remain to be done.