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

add basic web UI #1395

Merged
merged 38 commits into from
Jul 14, 2024
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
9e94256
include Martin WebUI into Rust build
nyurik Jan 17, 2024
5c390c0
fix CI
nyurik Jan 17, 2024
04f7b14
fix CI
nyurik Jan 17, 2024
a5ab9a6
first ui commit base vite project
tomeronen Jan 19, 2024
63f2a4f
base cover image
tomeronen Jan 19, 2024
cfbf8f6
rename ui folder
tomeronen Jan 19, 2024
f4e8c05
rename ui folder
tomeronen Jan 19, 2024
8c69c11
rename ui folder
tomeronen Jan 19, 2024
35f9fee
Merge branch 'maplibre:main' into create-base-from-ui
tomeronen Jan 20, 2024
d00a256
Merge branch 'main' into create-base-from-ui
nyurik Feb 2, 2024
a650f30
use _assets dir
paigewilliams Jul 1, 2024
16ac350
update martin-ui README
paigewilliams Jul 1, 2024
342955f
Merge branch 'main' into paige-williams-create-base-from-ui
paigewilliams Jul 2, 2024
5b10751
use symlink for logo
paigewilliams Jul 2, 2024
51dff9d
Merge branch 'main' into paige-williams-create-base-from-ui
nyurik Jul 9, 2024
e322645
Updated lock
nyurik Jul 9, 2024
62ff5a1
use asterisk in README
paigewilliams Jul 10, 2024
c8db479
update martin/build.rs
paigewilliams Jul 10, 2024
e8b9ef7
output assets to /_ dir
paigewilliams Jul 10, 2024
b610053
use node version 18
paigewilliams Jul 10, 2024
8e77392
change target to /_/ dir
paigewilliams Jul 10, 2024
0ae74ca
set publicDir to /_/
paigewilliams Jul 10, 2024
3ac5ae6
plave entryFileNames under assets dir
paigewilliams Jul 11, 2024
c19591c
use _/assets as assetsDir
paigewilliams Jul 11, 2024
b3bba2b
fix favicon
nyurik Jul 12, 2024
58862d3
fix docker build to use NPM
nyurik Jul 12, 2024
4883fd9
make ignore files consistent
nyurik Jul 12, 2024
af00f1f
use v20
nyurik Jul 12, 2024
670fdd6
fix
nyurik Jul 12, 2024
79b632a
use old nodejs
nyurik Jul 12, 2024
327e6b9
build-fix
nyurik Jul 12, 2024
2078b77
Merge branch 'main' into paige-williams-create-base-from-ui
nyurik Jul 12, 2024
301a6a1
fix cross build
nyurik Jul 14, 2024
d754a4b
npm access
nyurik Jul 14, 2024
6a6d4ba
npm access
nyurik Jul 14, 2024
d25d411
enable/disable web ui with CLI/config
nyurik Jul 14, 2024
c6cd46e
lints and docks
nyurik Jul 14, 2024
b053a2a
Bump minor semver
nyurik Jul 14, 2024
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
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,6 @@ config.yml
tests/output/
tmp/
.aws-sam/

**/node_modules/
**/dist/
60 changes: 60 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ actix-cors = "0.7"
actix-http = "3"
actix-rt = "2"
actix-web = "4"
actix-web-static-files = "4"
anyhow = "1.0"
approx = "0.5.1"
async-trait = "0.1"
Expand Down Expand Up @@ -80,6 +81,7 @@ spreet = { version = "0.11", default-features = false }
sqlite-compressions = { version = "0.2.12", default-features = false, features = ["bsdiffraw", "gzip"] }
sqlite-hashes = { version = "0.7.3", default-features = false, features = ["md5", "aggregate", "hex"] }
sqlx = { version = "0.7", features = ["sqlite", "runtime-tokio"] }
static-files = "0.2"
subst = { version = "0.3", features = ["yaml"] }
thiserror = "1"
tile-grid = "0.6"
Expand Down
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,29 @@ from large `PostgreSQL` databases, and serve tiles from `PMTiles` and `MBTiles`

## Features

* Serve [vector tiles](https://github.com/mapbox/vector-tile-spec) from
* [PostGIS](https://github.com/postgis/postgis) databases, automatically discovering compatible tables and functions
* [PMTile](https://protomaps.com/blog/pmtiles-v3-whats-new), both local files and over HTTP
* [MBTile](https://github.com/mapbox/mbtiles-spec) files
* [Combine](https://maplibre.org/martin/sources-composite.html) multiple tile sources into one
* Generate [sprites](https://maplibre.org/martin/sources-sprites.html) and [font glyphs](https://maplibre.org/martin/sources-fonts.html)
* Generate tiles in bulk from any Martin-supported sources into an `MBTiles` file with [martin-cp](https://maplibre.org/martin/martin-cp.html) tool
* Examine, copy, validate, compare, and apply diffs between `MBTiles` files with [mbtiles](https://maplibre.org/martin/tools.html#mbtiles) tool
- Serve [vector tiles](https://github.com/mapbox/vector-tile-spec) from
nyurik marked this conversation as resolved.
Show resolved Hide resolved
- [PostGIS](https://github.com/postgis/postgis) databases, automatically discovering compatible tables and functions
- [PMTile](https://protomaps.com/blog/pmtiles-v3-whats-new), both local files and over HTTP
- [MBTile](https://github.com/mapbox/mbtiles-spec) files
- [Combine](https://maplibre.org/martin/sources-composite.html) multiple tile sources into one
- Generate [sprites](https://maplibre.org/martin/sources-sprites.html) and [font glyphs](https://maplibre.org/martin/sources-fonts.html)
- Generate tiles in bulk from any Martin-supported sources into an `MBTiles` file with [martin-cp](https://maplibre.org/martin/martin-cp.html) tool
- Examine, copy, validate, compare, and apply diffs between `MBTiles` files with [mbtiles](https://maplibre.org/martin/tools.html#mbtiles) tool

## Documentation

* [Quick Start](https://maplibre.org/martin/quick-start.html)
* [Installation](https://maplibre.org/martin/installation.html)
* Running with [CLI](https://maplibre.org/martin/run-with-cli.html)
- [Quick Start](https://maplibre.org/martin/quick-start.html)
- [Installation](https://maplibre.org/martin/installation.html)
- Running with [CLI](https://maplibre.org/martin/run-with-cli.html)
or [configuration file](https://maplibre.org/martin/config-file.html)
* [Usage and API](https://maplibre.org/martin/using.html)
- [Usage and API](https://maplibre.org/martin/using.html)

## License

Licensed under either of

* Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or <http://www.apache.org/licenses/LICENSE-2.0>)
* MIT license ([LICENSE-MIT](LICENSE-MIT) or <http://opensource.org/licenses/MIT>)
- Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or <http://www.apache.org/licenses/LICENSE-2.0>)
- MIT license ([LICENSE-MIT](LICENSE-MIT) or <http://opensource.org/licenses/MIT>)
at your option.

### Contribution
Expand Down
2 changes: 1 addition & 1 deletion docs/src/using.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Martin data is available via the HTTP `GET` endpoints:

| URL | Description |
|-----------------------------------------|------------------------------------------------|
| `/` | Status text, that will eventually show web UI |
| `/` | Web UI |
| `/catalog` | [List of all sources](#catalog) |
| `/{sourceID}` | [Source TileJSON](#source-tilejson) |
| `/{sourceID}/{z}/{x}/{y}` | Map Tiles |
Expand Down
18 changes: 18 additions & 0 deletions martin-ui/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react-hooks/recommended',
],
ignorePatterns: ['dist', '.eslintrc.cjs'],
parser: '@typescript-eslint/parser',
plugins: ['react-refresh'],
rules: {
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
},
}
24 changes: 24 additions & 0 deletions martin-ui/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
12 changes: 12 additions & 0 deletions martin-ui/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Martin Web UI

A web interface for previewing tiles served by Martin.

### Run locally

To run just the web interface

```bash
npm i
npm run dev
```
32 changes: 32 additions & 0 deletions martin-ui/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="icon" type="image/x-icon" href="/favicon.ico">
<meta property="og:url" content="https://maplibre.org" />
<meta property="og:title" content="Martin — vector tiles server" />
<meta property="og:description" content="Vector Tiles from Large Databases on the Fly" />
<meta property="og:image" content="%PUBLIC_URL%/martin.png" />
<meta name="msapplication-TileColor" content="#ffffff">
<meta name="msapplication-TileImage" content="%PUBLIC_URL%/favicons/ms-icon-144x144.png">
<meta name="theme-color" content="#ffffff">
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.

Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `yarn run build`.
-->
<title>Martin — vector tiles server</title>
</head>
<body>
<noscript>
You need to enable JavaScript to run this app.
</noscript>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
Loading
Loading