mapbox / mapbox-sdk-js

A JavaScript client to Mapbox services, supporting Node, browsers, and React Native
Other
719 stars 186 forks source link

Support a metadata param when creating a style #356

Closed tristen closed 4 years ago

tristen commented 4 years ago

Required for applications relying on writing a style out with the metadata object after the Styles API begins stripping that data out for performance.

andrewharvey commented 4 years ago

Will the API documentation at https://docs.mapbox.com/api/maps/#create-a-style also be updated to indicate this parameter?

elifitch commented 4 years ago

@andrewharvey Sure is! A PR is in-flight and will go out at the same time. This PR is still in a draft state and needs some adjustment. The API Side change will only prune mapbox specific metadata. Metadata keys that begin with the prefix mapbox:. This is to allow for faster style downloads that save a bit on KB by omitting metadata from the requested stylesheet that mostly exists to help Studio.

If you want to preserve that mapbox specific metadata, you can pass metadata=true as a query param when you get a style.

elifitch commented 4 years ago

@lednax this is now ready for review