mirror of
https://github.com/maputnik/editor.git
synced 2026-04-23 18:00:05 +00:00
Previously the desktop build lived in a separate repo and had to
download a released version of the maputnik editor source code. Now that
both live in the same repo, the desktop version can simply run the
maputnik build command and use those generated files.
This commit also removes the ci-desktop workflow, which is not needed.
The regular ci workflow already built the desktop version (this commit
also fixes that build).
Fixes #919
If this works for you all, it would be lovely to create a new tag or
release on GitHub for two reasons:
1. So the latest binaries are easier to locate, and
2. So I can update my [submission to
homebrew](6e536ff007)
to make installation easier (for os x users at least)
73 lines
2.2 KiB
Markdown
73 lines
2.2 KiB
Markdown
# Maputnik Desktop [][github-action-ci]
|
|
---
|
|
|
|
A Golang based cross platform executable for integrating Maputnik locally.
|
|
This binary packages up the JavaScript and CSS bundle produced by maputnik
|
|
and embeds it in the program for easy distribution. It also allows
|
|
exposing a local style file and work on it both in Maputnik and with your favorite
|
|
editor.
|
|
|
|
Report issues on [maplibre/maputnik](https://github.com/maplibre/maputnik).
|
|
|
|
## Install
|
|
|
|
You can download a single binary for Linux, OSX or Windows from [the latest releases of **maplibre/maputnik**](https://github.com/maplibre/maputnik/editor/releases/latest).
|
|
|
|
### Usage
|
|
|
|
Simply start up a web server and access the Maputnik editor GUI at `localhost:8000`.
|
|
|
|
```bash
|
|
maputnik
|
|
```
|
|
|
|
Expose a local style file to Maputnik allowing the web based editor
|
|
to save to the local filesystem.
|
|
|
|
```bash
|
|
maputnik --file basic-v9.json
|
|
```
|
|
|
|
Watch the local style for changes and inform the editor via web socket.
|
|
This makes it possible to edit the style with a local text editor and still
|
|
use Maputnik.
|
|
|
|
```bash
|
|
maputnik --watch --file basic-v9.json
|
|
```
|
|
|
|
Choose a local port to listen on, instead of using the default port 8000.
|
|
|
|
```bash
|
|
maputnik --port 8001
|
|
```
|
|
|
|
Specify a path to a directory which, if it exists, will be served under http://localhost:8000/static/ .
|
|
Could be used to serve sprites and glyphs.
|
|
|
|
```bash
|
|
maputnik --static ./localFolder
|
|
```
|
|
|
|
### API
|
|
|
|
`maputnik` exposes the configured styles via a HTTP API.
|
|
|
|
| Method | Description
|
|
|---------------------------------|---------------------------------------
|
|
| `GET /styles` | List the ID of all configured style files
|
|
| `GET /styles/{filename}` | Get contents of a single style file
|
|
| `PUT /styles/{filename}` | Update contents of a style file
|
|
| `WEBSOCKET /ws` | Listen to change events for the configured style files
|
|
|
|
### Build
|
|
|
|
From the root of the [maplibre/maputnik](https://github.com/maplibre/maputnik) project, install the deps and run the desktop-build command.
|
|
|
|
```
|
|
npm install
|
|
npm run build-desktop
|
|
```
|
|
|
|
You should now find the `maputnik` binary in your `bin` directory.
|