maplibre-rs monthly

Categories: maplibre-rs
Authors: Max Ammann

maplibre-rs is an upcoming and cross-platform vector map renderer written in Rust. If you want to get in touch with the developers, visit the chat or join the MapLibre (#maplibre and #maplibre-rs) community within the OpenStreetMap Slack. You can get an invitation here.

๐Ÿ“ฐ News

Technically, this is not a “monthly” as I did not find the time in the past months to regularly write these. A lot has happened in the past months, though!

At least three major features and a few quality-of-developer-life features are cooking and are soon ready for testing. For better debugging I integrated egui into maplibre-rs. This should make it easy to display statistics like the current FPS or selected feature on the map. I could also imagine that a style editor in the style of Maputnik could be feasible.

Apart from egui, I also added a visualizing red border around tiles. This helped to improve the data loading performance of the renderer, as it became obvious which data loaded too slow.

egui integration
egui integration

In late summer, @Drabble already started working on a proof-of-concept for extruded 3D buildings. The work required several rebases over the months, but it survived and looks stunning! As per-feature rendering is currently missing, all buildings have the same height right now. I hope to change that in the near future. I noticed that design changes are usually accompanied by multiple concrete problems. As we integrate more features which are dependent on feature properties (building height, color properties, etc.) the required design changes will be uncovered.

building extrusion
3D building extrusion

In parallel @Quillasp worked on adding raster tile support to maplibre-rs. It already works on native platforms (Android, iOS, Linux, Windows) and in browsers. The decoding of the images is done using WebWorkers. In the future, the browser should be tasked with the decoding jobs.

raster tile rendering
Raster tiles

Last but not least, I ported the SDF font rendering from the maps-rs prototype by Luke Seelenbinder. On the second try, it worked quite perfectly. Currently, there is no collision detection in place, which means that labels overlap while zooming in and out. Collision detection on its own is an interesting problem. On the OSM Slack we discussed whether this could be implemented on the GPU. Current ideas for that are documented in a GitHub issue.

Text Rendering using SDFs

All the above features are not yet merged into the main branch of maplibre-rs as further design changes need to happen. For example, the management of GPU resources is very verbose right now. Additions of GPU resources and requires changes in some core engine struct. To mitigate this, further abstractions need to be invented. After those design changes and resolving all discussions in the PRs we can merge in the features.

Apart from those new features, kim pham is currently working on parsing the MapLibre style specification, including its expressions. Based on this work, the plan is that we generate statistics about the most frequently used style specification features. This way we can create issues for all the missing features and prioritize them according to their usage.

Finally, I want to mention that maplibre-rs has now an RFC process described here. Based on that, I wrote an RFC about how data is exchanged between WebWorkers and the main thread here. I think this is a great way to document progress. Let’s see how that process will be used in the future!

๐Ÿ  Housekeeping

The following will summarize what happened last week on GitHub.

๐ŸŽ Merged Pull Requests

  • #227 Improve processing by @maxammann
    Tiles are processed now immediately, instead of distributing work over frames.

  • #226 Add debug lines and improve tile queuing by @maxammann
    Red lines around tiles were added for debugging. Queuing of tiles has also been improved.

  • #224 Automatically choose texture format based on adapter by @maxammann
    Texture formats are now selected based on what the GPU supports.

  • #222 Improve error handling by @maxammann
    Complete rewrite of errors throughout maplibre-rs to follow best practices.

  • #214 Make writing rendered tiles to disk optional, and disable for bench by @maxammann
    Benchmarks no longer write PNGs to disk.

  • #213 Fix tracy by using re-export by @maxammann

  • #211 Switch to own host for test-data by @maxammann

  • #209 Switch to powershell by @maxammann
    Some windows goodies.

  • #208 justfile: automatically install wasm32 target for nightly toolchain by @julienr

  • #206 Clippy fixes by @julienr

  • #195 Create a matrix job for apple by @maxammann
    Improves CI time by a factor of 3.

  • #188 Bootstrap RFCs and add initial RFC by @maxammann
    We have now an official RFC process!

  • #174 New WASM executor by @maxammann
    We are no longer restricted to use SharedArrayBuffer. This means maplibre-rs runs now on any website!

  • #149 Define a minimum and maximum pitch by @maxammann

๐ŸŽ New Issues

  • #229 Limit work done per frame by @maxammann
    This should reduce frame drops.

  • #216 Upgrade criterion and use cargo-criterion by @maxammann

  • #212 Rendering does not work on Windows+Nvidia+Vulkan by @maxammann
    This could need some reproduction by windows folks.

  • #201 Upgrade Rust to 1.65 by @maxammann
    New goodies!

  • #187 maplibre-demo: High CPU and GPU usage on macOS while idle by @vollkorntomate
    Discussions about idling.

  • #185 Separation of map rendering and input controls in different Rust crates by @DerKarlos
    Discussion about input handling.

  • #182 Flutter support by @maxammann
    Just an idea :)

๐Ÿงต Current Discussions


๐Ÿ‘‹ Contributors

  • @DerKarlos - Thanks for discussions about input handling!
  • @julienr - Thanks for code improvements!
  • @Quillasp - Thanks for raster tile rendering!
  • @vollkorntomate - Thanks for raising a discussion about CPU/GPU usage!