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

Move class state back to Map #6118

Closed
Closed

Description

@jfirebaugh

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.

cc @brunoabinader @1ec5 @frederoni

Activity

  1. jfirebaugh commented on Aug 22, 2016

    @jfirebaugh
    ContributorAuthor

    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.

  2. added
    Core
    on Aug 22, 2016
  3. 1ec5 commented on Aug 22, 2016

    @1ec5
    Contributor

    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?

  4. jfirebaugh commented on Aug 22, 2016

    @jfirebaugh
    ContributorAuthor

    Semantically, would there be a problem with keeping the style class methods on MGLStyle?

    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)).

  5. 1ec5 commented on Aug 22, 2016

    @1ec5
    Contributor

    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.)

  6. brunoabinader commented on Aug 30, 2016

    @brunoabinader
    Contributor

    Good to know @jfirebaugh - I'm going to forward these changes into our Qt API - specifically QQuickMapboxGLStyle, putting class handling back to QQuickMapboxGL (Map).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Core

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions