Replies: 1 comment 1 reply
|
If you have a UI that edits a style I don't think you need maputnik, you can simply use maplibre-gl-js itself, can't you? Regarding embedding maputnik in other applications, I think that making it generic with the relevant look and feel of the host application is a lot of work, and I'm not sure it will really look good. In any case, I think a better problem statement might be worth defining here... |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I've been looking into using Maputnik inside a larger application, where the host app owns things like routing, loading and saving styles, and possibly the surrounding UI.
I put together two rough POCs to see what this could look like.
Embeddable React editor
This version wraps the existing Maputnik editor in a React component. The host provides the style and handles persistence, while Maputnik keeps control of most of the editor UI.
feature/embeddable-editor
Headless editor core
The second version moves style state and editor operations into a small framework-independent core, with React hooks on top. The sample uses the same core in two ways: once with existing Maputnik components, and once with a custom shadcn UI.
feature/headless-editor-core
The headless experiment came from a question that came up while building the first POC: for deeper integrations, is it more useful to reuse the whole editor, or to provide the editing model and let the host build its own UI?
Both branches are still experiments. I'm not proposing a finished API at this point. Before taking either approach further, I'd like to understand whether this is something others would use and whether it belongs in Maputnik itself.
This could also make it easier to add style editing to applications built around Martin (maplibre/martin#852) or similar tile-serving stacks. The host could keep control of sources, authentication and style storage, while using either the complete Maputnik editor or only the headless editing building blocks.
A few questions:
Any feedback on the general direction would be useful. The implementation details can change; right now I'm mainly interested in whether the use case exists.
All reactions