You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
01edd45 moved the state holding the list of active classes to Style. In gl-js, we had had previously (mapbox/mapbox-gl-js#911, mapbox/mapbox-gl-js#916) decided that Map was the correct holder of this state, because it is desirable for it to persist across style loads or reloads. This is particularly true on native, where reloads of a style can happen implicitly during revalidation. In that case, having the class list state reset, as currently happens, is unexpected.
If we make this change, we'll need to revert #5974.
If we make this change, we'll need to revert #5974.
MGLStyle accesses the class list through (a weak pointer to) MGLMapView and therefore through mbgl::Map, so there wouldn’t be a technical need to move the class methods back to MGLMapView. Semantically, would there be a problem with keeping the style class methods on MGLStyle?
OK, fair enough. (Annotation layers do persist across style changes, so it isn't unprecedented to have some style-related settings carry over. But I can't think of any downsides to keeping the class API on MGLMapView.)
Good to know @jfirebaugh - I'm going to forward these changes into our Qt API - specifically QQuickMapboxGLStyle, putting class handling back to QQuickMapboxGL (Map).
Activity
jfirebaugh commentedon Aug 22, 2016
At a minimum, we need to remove this line and add a test that a style reloaded due to revalidation does not reset the class list.
1ec5 commentedon Aug 22, 2016
MGLStyle accesses the class list through (a weak pointer to) MGLMapView and therefore through
mbgl::Map, so there wouldn’t be a technical need to move the class methods back to MGLMapView. Semantically, would there be a problem with keeping the style class methods on MGLStyle?jfirebaugh commentedon Aug 22, 2016
Yes -- if the state belongs to the map object, it's misleading for the accessors to live on the style object (mapbox/mapbox-gl-js#916 (comment)).
1ec5 commentedon Aug 22, 2016
OK, fair enough. (Annotation layers do persist across style changes, so it isn't unprecedented to have some style-related settings carry over. But I can't think of any downsides to keeping the class API on MGLMapView.)
brunoabinader commentedon Aug 30, 2016
Good to know @jfirebaugh - I'm going to forward these changes into our Qt API - specifically
QQuickMapboxGLStyle, putting class handling back toQQuickMapboxGL(Map).