-
-
Notifications
You must be signed in to change notification settings - Fork 354
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add style json in MLNMapView #3240
base: main
Are you sure you want to change the base?
Conversation
Bloaty Results (iOS) 🐋Compared to main
Full report: https://maplibre-native.s3.eu-central-1.amazonaws.com/bloaty-results-ios/pr-3240-compared-to-main.txt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assuming that it's the same API as we have on Android - LGTM.
@louwers please help review and re-run the pipelines. |
MLNLogInfo(@"Starting %@ initialization.", NSStringFromClass([self class])); | ||
MLNLogDebug(@"Initializing frame: %@ styleJSON: %@", NSStringFromCGRect(frame), styleJSON); | ||
[self commonInit]; | ||
self.mbglMap.getStyle().loadJSON([styleJSON UTF8String]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If approach will first load the default style. It is possible that the user will first see the default style flash before this style is finally loaded.
return; | ||
} | ||
|
||
// Verify JSON is valid |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're already parsing the style when loading the style, so we parse the JSON another time.
This does not check if the style is really valid, it only checks if it is valid JSON.
Address issues 3052 - Support initializing map with string JSON style on iOS