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
Labels
archived
Archived because of inactivity
iOS
Mapbox Maps SDK for iOS
macOS
Mapbox Maps SDK for macOS
runtime styling
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
The text was updated successfully, but these errors were encountered: