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.

Warn when using runtime styling with unversioned style methods #8971

Closed

Description

@1ec5

The iOS and macOS SDKs should warn developers when they try to use unversioned style URLs with the runtime styling API.

Per #6301 (comment), the style URL factory methods on MGLStyle would append a query parameter like ?x-darwin-versioned=false to the returned URL. -[MGLMapView setStyleURL:] would then detect that parameter, strip it, and set an ivar. -[MGLStyle style] would log a warning to the console if the ivar is set; similarly, we’d log a warning to the console just before calling -[MGLMapViewDelegate mapView:didFinishLoadingStyle:]. The warning would be throttled to once per session, and perhaps we could make it debug-only.

There’s a risk that the developer is relying on the absolute URLs returned by these factory methods, and this change would cause those URLs to change. That could be a good argument against implementing this proposal and instead waiting for #6386, which would change the factory methods to return MGLStyle objects instead of NSURLs.

/cc @kkaefer @boundsj

Activity

  1. added
    iOS
    macOS
    on May 12, 2017
  2. kkaefer commented on May 12, 2017

    @kkaefer
    Member

    I'm not too keen on an additional parameter because it means we'll have to special case it when requesting + storing to the database.

  3. jfirebaugh commented on May 12, 2017

    @jfirebaugh
    Contributor

    Same, and I'm optimistic about having core support for #6386 soon.

  4. 1ec5 commented on May 12, 2017

    @1ec5
    ContributorAuthor

    This would be completely transparent to mbgl because MGLMapView would strip the parameter before calling setStyleURL.

  5. added
    archived
    on Nov 7, 2018
  6. stale commented on Nov 27, 2018

    @stale

    This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.

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

    archivediOSmacOSruntime styling

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions