feat(core): Add public stringifyGeoJSON to mbgl::style::conversion#4345
Open
yuiseki wants to merge 1 commit into
Open
feat(core): Add public stringifyGeoJSON to mbgl::style::conversion#4345yuiseki wants to merge 1 commit into
yuiseki wants to merge 1 commit into
Conversation
This was referenced Jun 15, 2026
Contributor
Bloaty Results 🐋Compared to main Full report: https://maplibre-native.s3.eu-central-1.amazonaws.com/bloaty-results/pr-4345-compared-to-main.txtCompared to d387090 (legacy) Full report: https://maplibre-native.s3.eu-central-1.amazonaws.com/bloaty-results/pr-4345-compared-to-legacy.txt |
Contributor
|
Benchmark Results ⚡ Full report: https://maplibre-native.s3.eu-central-1.amazonaws.com/benchmark-results/pr-4345-compared-to-main.txt |
ciscorn
added a commit
to maplibre/maplibre-native-rs
that referenced
this pull request
Jun 19, 2026
I found `MLN_PRECOMPILE=1` builds are currently broken, but this was not caught by CI. This PR updates the precompiled MapLibre Native release and fixes the link setup: (Some of these changes are based on #237 by @yuiseki - thanks!) - Update the precompiled MLN release to the [latest core release](https://github.com/maplibre/maplibre-native/releases/tag/core-fa8a9c8e3261ce64940127aecc1d52f540c21c57) - Restore the vendored bridge include path - Link required system libraries for precompiled builds (`libuv` on non-Apple targets, `sqlite3` on Apple targets) - Avoid direct `mapbox::geojson` symbols from the Rust bridge, since they are hidden in the amalgam - Comment out now-unused `GeoJson::to_json_string()` - no public mbgl API yet maplibre/maplibre-native#4345 - Add precompiled CI coverage to prevent regressions Note: macOS still does not work with `MLN_PRECOMPILE=1` because the amalgam (built with `armerge --keep-symbols 'mbgl.*'`) also hides the C++ exception RTTI symbols. --------- Co-authored-by: yuiseki <yui.matsumura@geolonia.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Launch Checklist
mbgl::*wrapper around geojson-cpp. geojson-cpp is ISC-licensed, already vendored inmaplibre-native-base, and already used directly insrc/mbgl(thewithinanddistanceexpressions, andrapidjson_conversion.hpp). No code is copied from any Mapbox project.mapbox::geojson::stringify.CHANGELOG.md. Can add on request.What this does
Adds
std::string mbgl::style::conversion::stringifyGeoJSON(const GeoJSON&). It is the serialize counterpart to the existingparseGeoJSON, and it just callsmapbox::geojson::stringify.Why
The core amalgam is built with
armerge --keep-symbols 'mbgl.*', so onlymbgl::*symbols are exported and the bundledmapbox::geojson::*functions are hidden on purpose. A consumer that links the amalgam can already parse GeoJSON through the publicparseGeoJSON, but there is no public way to turn aGeoJSONback into a string. This adds that missing piece, so downstream bindings do not have to reach intomapbox::geojsonor bundle their own JSON writer.This is what
maplibre-native-rsneeds in order to bring back itsGeoJson::to_json_string(see maplibre/maplibre-native-rs#237).Related