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

Move class handling to Style #6207

Merged
merged 7 commits into from
Sep 13, 2016
Merged

Move class handling to Style #6207

merged 7 commits into from
Sep 13, 2016

Conversation

brunoabinader
Copy link
Member

Fixes #6118.

  • Map::Impl now owns class data.
  • This prevents class state being reset upon mbgl::Style state changes.
  • Adds new mbgl::setClassTransition to cleanup class API.
    • Updated GLFW and darwin API usage accordingly
  • Update Qt QML: classes property now belongs to QQuickMapboxGL (map) instead of QQuickMapboxGLStyle (style)

@brunoabinader brunoabinader added feature GL JS parity For feature parity with Mapbox GL JS labels Aug 30, 2016
@mention-bot
Copy link

@brunoabinader, thanks for your PR! By analyzing this pull request, we identified @jfirebaugh, @1ec5 and @incanus to be potential reviewers.

@brunoabinader
Copy link
Member Author

Tagging @tmpsantos for reviewing the Qt changes 👍

@brunoabinader brunoabinader force-pushed the 6118-map-class-ownership branch 3 times, most recently from de2055e to 84d9abf Compare August 30, 2016 16:24
@jfirebaugh
Copy link
Contributor

@brunoabinader Sorry for the flip-flop, but after reviewing how style batch updates happen in GL JS and will need to happen in native for #5701, I think you had the right idea moving classes to Style, and we should stick with that (and change JS to match -- mapbox/mapbox-gl-js#2385). I'm prepping a PR for JS that demonstrates the benefit pretty clearly.

👍 on setClassTransition though, the existing transition argument behaves strangely (only most recent value is respected).

@tmpsantos
Copy link
Contributor

Reviewed offline.

@brunoabinader brunoabinader force-pushed the 6118-map-class-ownership branch from 84d9abf to 06a615e Compare September 12, 2016 11:11
@brunoabinader
Copy link
Member Author

@jfirebaugh rewrote the PR, keeping class handling in Style and applying the transition options changes. @tmpsantos we can forward the QML style property behavior changes to the upcoming QML style layer PR.


auto duration = mbgl::Milliseconds(300);
map.setTransitionOptions({ { duration } });
EXPECT_EQ(map.getTransitionOptions().duration->count(),
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you just do EXPECT_EQ(map.getTransitionOptions().duration, duration) here? Ditto line 260.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes and no - with the current implementation I get invalid operands to binary expression ('const std::experimental::fundamentals_v1::optional<std::__1::chrono::duration<long long, std::__1::ratio<1, 1000000000> > >' and 'const std::__1::chrono::duration<long long, std::__1::ratio<1, 1000> >') - but if I encapsulate duration inside mbgl::Duration then it works fine 👍 Thanks!

@jfirebaugh
Copy link
Contributor

LGTM, modulo the nit in the test code and the CI failures.

@brunoabinader brunoabinader force-pushed the 6118-map-class-ownership branch from 06a615e to 2619db1 Compare September 13, 2016 09:52
@brunoabinader brunoabinader force-pushed the 6118-map-class-ownership branch from 2619db1 to fdaf26b Compare September 13, 2016 10:00
@brunoabinader brunoabinader merged commit fdaf26b into master Sep 13, 2016
@brunoabinader brunoabinader deleted the 6118-map-class-ownership branch September 13, 2016 11:56
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature GL JS parity For feature parity with Mapbox GL JS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants