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

Add support for feature state APIs #15480

Merged
merged 23 commits into from
Sep 18, 2019
Merged

Add support for feature state APIs #15480

merged 23 commits into from
Sep 18, 2019

Conversation

jmalanen
Copy link
Contributor

@jmalanen jmalanen commented Aug 26, 2019

Fixes: #11846

@jmalanen jmalanen force-pushed the jmalanen-feature-state branch 8 times, most recently from 8971073 to 41ea76b Compare August 26, 2019 15:11
@chloekraw chloekraw added the needs changelog Indicates PR needs a changelog entry prior to merging. label Aug 26, 2019
@jmalanen jmalanen force-pushed the jmalanen-feature-state branch 8 times, most recently from 20b4355 to 8afa0ba Compare August 28, 2019 12:54
@jmalanen jmalanen changed the title Add support for feature states Add support for feature state APIs Aug 28, 2019
@jmalanen jmalanen removed the needs changelog Indicates PR needs a changelog entry prior to merging. label Aug 29, 2019
@chloekraw chloekraw added the needs changelog Indicates PR needs a changelog entry prior to merging. label Aug 30, 2019
Copy link
Contributor

@asheemmamoowala asheemmamoowala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just have a couple notes on the implementation choices:

  • The use of std::map and std::unrodered_map is likely to provide unsatisfactory performance when there are large changes in feature state - for example: https://bl.ocks.org/asheemmamoowala/014fa054005f3a46a10fd6fc306f551f

  • The use of Convertible as the input parameter for setFeatureState makes it very broad, and hard to force type checking on the input data. The platform APIs will probably want to expose this functionality using platform-appropriate types (for example NSMutableDictionary on osx) which would create an extra step to make those into Convertible objects.

cc @julianrex @tobrun for input on the interface for platform SDKs.

@jmalanen jmalanen force-pushed the jmalanen-feature-state branch 3 times, most recently from 96d1864 to 1d64fe3 Compare September 3, 2019 14:34
@jmalanen
Copy link
Contributor Author

jmalanen commented Sep 4, 2019

Adding a screenshot of feature state demo on mbgl-glfw app. The demo implements the same hover effect as this GL-JS example.

Screenshot from 2019-09-04 15-33-19

@jmalanen jmalanen force-pushed the jmalanen-feature-state branch 2 times, most recently from 390781d to 185e70c Compare September 10, 2019 13:04
@jmalanen jmalanen marked this pull request as ready for review September 10, 2019 13:30
@jmalanen jmalanen force-pushed the jmalanen-feature-state branch 5 times, most recently from cbcf276 to 388673a Compare September 18, 2019 08:55
void getFeatureState(FeatureState& state,
const std::string& sourceID,
const optional<std::string>& sourceLayerID,
void setFeatureState(const std::string& sourceID, const optional<std::string>& sourceLayerID,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally, I prefer old style (chromium) where each argument is on a new line. @tmpsantos could we add exception for this to clang-format config?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tmpsantos could we add these to clang format?
BinPackParameters: false
AllowAllArgumentsOnNextLine: false

Copy link
Contributor

@pozdnyakov pozdnyakov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've agreed with @jmalanen that he will investigate moving feature state into GeometryTileFeature

@jmalanen jmalanen mentioned this pull request Sep 18, 2019
5 tasks
@jmalanen jmalanen added the Core The cross-platform C++ core, aka mbgl label Sep 18, 2019
@jmalanen jmalanen merged commit 8b355c7 into master Sep 18, 2019
@jmalanen jmalanen deleted the jmalanen-feature-state branch September 18, 2019 11:29
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 needs changelog Indicates PR needs a changelog entry prior to merging.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

QueryRenderedFeatures should include source and sourceLayer
5 participants