Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Style Development for unpublished, or private or local styles #954

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- Use same version number for web and desktop versions
- Add scheme type options for vector/raster tile
- Add `tileSize` field for raster and raster-dem tile sources
- For local style development, configure CORS & expose a public directory
- _...Add new stuff here..._

### 🐞 Bug fixes
Expand Down
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,27 @@ We ensure building and developing Maputnik works with the [current active LTS No

Check out our [Internationalization guide](./src/locales/README.md) for UI text related changes.

### Local Style Development

As a Maputnik developer, you can serve styles on the same server that used to develop the Maputnik app. This is useful if you want to test a style that is not public, or is in development.

For example,

1. Copy `unpublishedstyle.json` to the folder `/styles`
2. `npm run start` to start the `vite` local server
3. Verify by going to http://localhost:8888/styles/unpublishedstyle.json
4. Edit `src/config/styles.json`, then your new local style should be available: *Open > Gallery Styles*

```json
{
"id": "localstyle",
"title": "unpublishedstyle.json",
"url": "http://localhost:8888/styles/unpublishedstyle.json"
},
```

---

### Getting Involved
Join the #maplibre or #maputnik slack channel at OSMUS: get an invite at https://slack.openstreetmap.us/ Read the the below guide in order to get familiar with how we do things around here.

Expand Down
Empty file added styles/.gitkeep
Empty file.
2 changes: 2 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ import istanbul from "vite-plugin-istanbul";

export default defineConfig({
server: {
cors: true,
port: 8888,
},
publicDir: 'styles',
build: {
sourcemap: true
},
Expand Down
Loading