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

Warn when using runtime styling with unversioned style methods #8971

Closed
1ec5 opened this issue May 12, 2017 · 4 comments
Closed

Warn when using runtime styling with unversioned style methods #8971

1ec5 opened this issue May 12, 2017 · 4 comments
Labels
archived Archived because of inactivity iOS Mapbox Maps SDK for iOS macOS Mapbox Maps SDK for macOS runtime styling

Comments

@1ec5
Copy link
Contributor

1ec5 commented May 12, 2017

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

@1ec5 1ec5 added iOS Mapbox Maps SDK for iOS macOS Mapbox Maps SDK for macOS runtime styling labels May 12, 2017
@kkaefer
Copy link
Contributor

kkaefer commented May 12, 2017

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.

@jfirebaugh
Copy link
Contributor

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

@1ec5
Copy link
Contributor Author

1ec5 commented May 12, 2017

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

@stale stale bot added the archived Archived because of inactivity label Nov 7, 2018
@stale
Copy link

stale bot commented Nov 27, 2018

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

@stale stale bot closed this as completed Nov 27, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived Archived because of inactivity iOS Mapbox Maps SDK for iOS macOS Mapbox Maps SDK for macOS runtime styling
Projects
None yet
Development

No branches or pull requests

3 participants