maplibre-rs monthly MapLibre

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 #maplibre:matrix.org chat or join the MapLibre (#maplibre and #maplibre-rs) community within the OpenStreetMap Slack. You can get an invitation here .

๐Ÿ“ฐ News

It has been an exciting summer - FOSS4G happened and a paper about maplibre-rs was published. The whole MapLibre team was able to meet! We met our sponsors and other awesome people from the open-source community.

And because a picture is worth a thousand words:

Our community

Behind the scenes, I was working on providing an alternative multi-threading implementation for the web platform. Because atomics are only supported by enabling specific HTTP headers , we really need a more portable implementation which does not rely on these atomics. Instead of doing real multithreading in the browser, we want to do multiprocessing through WebWorkers. I designed an interface which should work well for most data-processing needs. The interface is called AsyncProcedureCall.

 1#[derive(Clone)]
 2pub enum Message<T: Transferables> {
 3    TileTessellated(T::TileTessellated),
 4    UnavailableLayer(T::UnavailableLayer),
 5    TessellatedLayer(T::TessellatedLayer),
 6}
 7
 8#[derive(Clone, Serialize, Deserialize)]
 9pub enum Input {
10    TileRequest(TileRequest),
11}
12
13pub type AsyncProcedure<C> = fn(input: Input, context: C) -> AsyncProcedureFuture;
14
15pub trait AsyncProcedureCall<T: Transferables, HC: HttpClient>: 'static {
16    type Context: Context<T, HC> + Send;
17
18    fn receive(&mut self) -> Option<Message<T>>;
19
20    fn schedule(&self, input: Input, procedure: AsyncProcedure<Self::Context>);
21}

Instead of relying on mutexes and MPSC channels, the implementation of this APC for the web relies on WebWorkers and sending ArrayBuffers .

I’m working on this in a rather large #174 . As not much else is going on in the project, merging probably won’t cause issues.

๐Ÿ  House Keeping

The following will summarizes what happened last week on GitHub.

๐ŸŽ Merged Pull Requests

  • #169 Add watch functionality for web by @maxammann
    We have now build tools for the web which automatically reloads the demo in the browser for changes in Rust.

  • #167 Add citation instructions by @maxammann
    The maplibre-rs is now officially citable in others scientific work!

  • #160 Add CLI to demo by @maxammann
    A CLI allows users now to configure the demo on Linux, Windows and macOS.

  • #154 Run scheduled builds by @maxammann
    We regularly build our main branch now, to detect breaking dependencies.

  • #80 Refactor WebWorker pool by @maxammann
    This is the start of a major refactor for async tasks on the web.

๐ŸŽ New Issues

  • #166 ReferenceError: Can’t find variable: Worker by @maxammann
    This bug blocks us currently on Safari (iOS/macOS). I’m actively working right now to provide a build which does not use atomics.

  • #164 INVALID_ENUM: framebuffertexture2d invalid attachment by @maxammann
    This is a bug in older versions in Safari. With the release of iOS 16 and Safari 16 this is fixed now.

  • #161 Limit the maximum and minimum zoom level by @hanchao
    We got a great bug report! It seems like people are experimenting with maplibre-rs in the wild!

๐Ÿงต Current Discussions

None.

๐Ÿ‘‹ Contributors