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.

Configurable API hostname #6346

Closed
Closed

Description

@1ec5

#6309 is adding the ability to customize the meaning of mapbox: URLs to mbgl. We should offer a convenient way for the developer to modify the API hostname. Two options:

  1. Add a hostname property to MGLOfflineStorage whose setter calls mbgl::DefaultFileSource::setAPIBaseURL().
  2. Have MGLOfflineStorage call mbgl::DefaultFileSource::setAPIBaseURL() automatically based on an MGLMapboxAPIHostname user default.
  3. Same as (2), but as an Info.plist entry.

I prefer either (2) or (3) because MGLOfflineStorage is largely asynchronous and therefore easy to use incorrectly.

It’d be nice to call this option a “hostname” for consistency with the Mapbox Swift libraries’ existing API hostname options. However, “base URL” would be more correct since it looks like you can provide an arbitrary path and scheme in addition to the hostname. MGLAPIClient already has support for a MGLTelemetryTestServerURL user default that defaults to MGLAPIClientBaseURL, so I guess we can follow that naming scheme.

/cc @boundsj @tobrun

Activity

  1. added
    iOS
    macOS
    on Sep 15, 2016
  2. added this to the ios-v3.4.0 milestone on Sep 15, 2016
  3. 1ec5 commented on Sep 15, 2016

    @1ec5
    ContributorAuthor

    Also, if we end up making this a user default, we should provide constants for api.mapbox.com and any alternative hostnames we might need to support publicly.

  4. incanus commented on Sep 16, 2016

    @incanus
    Contributor

    Thoughts on moving this off of the milestone though @1ec5?

  5. self-assigned this
    on Oct 14, 2016
  6. added a commit that references this issue on Oct 16, 2016
    674304b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

featureiOSmacOS

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions