I’ve been working on MapLibre Compose full time du...
# compose-web
s
I’ve been working on MapLibre Compose full time during the holidays, but in a few days I’ll go back to my real job and so slow down my progress here. It’s a good time for contributors to get involved, especially if there’s some missing functionality you need for your own project. In particular, the recently launched support for Web is currently behind* Android and iOS in functionality, but there’s no blockers to getting it to (mostly) feature parity; just needs someone to do the work (mostly for layer styling glue code). If you’re interested, feel free to dive in (I promise I’ll be quick to review your PRs) or reach out to me if you have questions or need help navigating the codebase. *Desktop is also behind, but there’s some blockers there if you’re curious
👏 1
c
Oh nice! I've created my own Compose HTML wrapper for MapLibre for a personal website (https://redyeti.net/map/All) but it's hacky and only supports limited functionality, so would be very happy to give this a try and hopefully contribute too. I'll try and take a look this weekend - do you know how good a fit it will be for Compose HTML though?
s
It’s currently coupled to Compose Multiplatform (so, the canvas based Compose on web) but the layer styling code and other map management stuff is mostly independent of that, so the library could easily be refactored in the future to support alternative UI integrations like Compose HTML (Redwood comes to mind too). The library has its own custom composition to manage style layers.
So far I’ve only split off the expressions DSL into its own module
c
Ok thanks, makes sense. I'll take a look and try to get a feel for what would be involved in isolating the UI code.
s
My long term architecture plan is: • kotlin-maplibre-js contains Kotlin bindings for the maplibre-gl npm package, for Kotlin JS and Kotlin Wasm • kotlin-maplibre-native will contain Kotlin bindings for MapLibre Native • maplibre-compose-core (and internally, maplibre-compose-expressions) will contain a multiplatform API for the two above, plus things like Composable layer styling and utilities for map state • maplibre-compose integrates the above with Compose Multiplatform, and adds some expression DSL functions specific to that like adding Painter images to the style • maplibre-compose-html and others will integrate the above with Compose HTML and other Composable UI toolkits Currently things aren't fully split up like that, but the intention is to get there. Right now my focus is on getting the API right for Compose Multiplatform, and integrating with the MapLibre Native Core on desktop
c
Thanks for the overview, that's helpful. I had a go today at doing a quick and dirty hack of the existing code to see what it would take to get it working with Compose HTML: https://github.com/sargunv/maplibre-compose/compare/main...chrismiller:maplibre-compose:compose-html-test Compose HTML doesn't support
LocalLayoutDirection
,
LocalDensity
,
LocalFocusManager
so I had to strip those out, that was enough to get at least the basic map rendering OK.