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

mbgl::Map::getStyleJSON() should reflect runtime styling changes #7563

Closed
1ec5 opened this issue Dec 31, 2016 · 2 comments
Closed

mbgl::Map::getStyleJSON() should reflect runtime styling changes #7563

1ec5 opened this issue Dec 31, 2016 · 2 comments
Labels
archived Archived because of inactivity Core The cross-platform C++ core, aka mbgl feature GL JS parity For feature parity with Mapbox GL JS runtime styling

Comments

@1ec5
Copy link
Contributor

1ec5 commented Dec 31, 2016

mbgl::Map::getStyleJSON() returns the exact string that was originally passed into mbgl::Map::setStyleJSON() or fetched from the style URL, even if the style has been mutated since then using the runtime styling API. It should instead return a serialized representation of the current style, reflecting any changes made using the runtime styling API (and annotations API?).

Ultimately, I think the iOS/macOS SDK should expose an -[MGLStyle JSONDataUsingEncoding:] method that would use mbgl::Map::getStyleJSON() to return the current style. This method would complement the initializers proposed in #6386, make it easier to implement the runtime styling API in React Native Mapbox GL (nitaliano/react-native-mapbox-gl#416), and allow macosapp to save out the results of any runtime styling changes in MapDocument.

/cc @jfirebaugh @frederoni

@1ec5 1ec5 added Core The cross-platform C++ core, aka mbgl feature runtime styling labels Dec 31, 2016
@1ec5 1ec5 added the GL JS parity For feature parity with Mapbox GL JS label Dec 31, 2016
@jfirebaugh
Copy link
Contributor

#7586 winds up implementing a good portion of the machinery needed for JSON stringification of a style.

@stale
Copy link

stale bot commented Nov 24, 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 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived Archived because of inactivity Core The cross-platform C++ core, aka mbgl feature GL JS parity For feature parity with Mapbox GL JS runtime styling
Projects
None yet
Development

No branches or pull requests

2 participants