-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Conversation
@ivovandongen, thanks for your PR! By analyzing this pull request, we identified @jfirebaugh, @1ec5 and @incanus to be potential reviewers. |
@@ -352,6 +352,8 @@ void Map::Impl::loadStyleJSON(const std::string& json) { | |||
|
|||
// force style cascade, causing all pending transitions to complete. | |||
style->cascade(Clock::now(), mode); | |||
|
|||
view.notifyMapChange(MapChangeDidFinishLoadingStyle); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably need a signal for style loading failures. In case of parsing error, the MapChangeDidFinishLoadingStyle
will be emitted here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In that case, does it make more sense to add the signals to the Style itself?
In https://github.com/mapbox/mapbox-gl-native/blob/master/src/mbgl/style/style.cpp#L95 we can best check for parse errors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think so.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tmpsantos to keep things clean, I've added a method to the observer on Style and kept the signal emitting in Map.
ad801d7
to
c51baaa
Compare
|
||
// But not when the style couldn't be parsed | ||
emitted = false; | ||
test.view.setMapChangeCallback([&](MapChange change) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to redefine this callback.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point...
c51baaa
to
5688526
Compare
5688526
to
2f62f97
Compare
@tmpsantos I've committed the changes you requested. Let me know if there's anything else or that it can be merged. |
Fixes #4527
Needed to properly time callbacks in #6032