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.

Reverse MGLStyle.layers #7474

Closed
Closed

Description

@1ec5

MGLStyle’s layers property should be ordered from back to front, not from front to back.

In #6097, I said:

The layers array is ordered from front to back, for consistency with Cocoa, as opposed to mbgl’s back-to-front ordering.

I was mistaken: similar arrays in Cocoa are ordered from back to front (NSView.subviews, UIView.subviews, UIApplication.windows) or specify no explicit order (NSApplication.windows). (Apple Events and AppleScript do treat “front” as a synonym for “first” and “back” as a synonym for “last”, but that shouldn’t inform the API we expose in this SDK.)

I think a last-minute breaking change before the release is probably the right decision in the long run. Reversing the array will simplify MGLStyle somewhat, as it removes an impedance mismatch with mbgl. It’ll also make the iOS and macOS SDKs more consistent with the Android SDK and GL JS. Moreover, the layers property was only published a few days ago in beta 5, along with more convenient methods like -insertLayer:aboveLayer:, so direct indexing into layers should be relatively rare.

/cc @boundsj @frederoni @ericrwolfe @bsudekum

Activity

  1. added
    iOS
    macOS
    release blocker
    on Dec 18, 2016
  2. added this to the ios-v3.4.0 milestone on Dec 18, 2016
  3. boundsj commented on Jan 3, 2017

    @boundsj
    Contributor

    This was fixed by #7484 cc @frederoni @1ec5

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

    bugiOSmacOSrelease blockerruntime styling

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions