mirror of
https://github.com/maplibre/martin.git
synced 2024-12-18 12:21:56 +03:00
docs: ✏️ add notes on debugging
This commit is contained in:
parent
ca8b330544
commit
cbe9e89909
16
README.md
16
README.md
@ -6,7 +6,7 @@
|
||||
|
||||
Martin is a [PostGIS](https://github.com/postgis/postgis) [vector tiles](https://github.com/mapbox/vector-tile-spec) server suitable for large databases. Martin is written in [Rust](https://github.com/rust-lang/rust) using [Actix](https://github.com/actix/actix-web) web framework.
|
||||
|
||||
![Martin](https://raw.githubusercontent.com/urbica/martin/master/mart.png)
|
||||
![Martin](https://raw.githubusercontent.com/urbica/martin/master/logo.png)
|
||||
|
||||
- [Requirements](#requirements)
|
||||
- [Installation](#installation)
|
||||
@ -26,6 +26,7 @@ Martin is a [PostGIS](https://github.com/postgis/postgis) [vector tiles](https:/
|
||||
- [Using with Docker](#using-with-docker)
|
||||
- [Using with Nginx](#using-with-nginx)
|
||||
- [Building from Source](#building-from-source)
|
||||
- [Debugging](#debugging)
|
||||
- [Development](#development)
|
||||
|
||||
## Requirements
|
||||
@ -309,7 +310,7 @@ docker run \
|
||||
|
||||
## Using with Nginx
|
||||
|
||||
If you are running martin behind nginx proxy, you may want to rewrite request URL, so martin can properly handle tile urls in TileJSON endpoints.
|
||||
If you are running martin behind nginx proxy, you may want to rewrite request URL, to properly handle tile urls in [TileJSON](#table-source-tilejson) [endpoints](#function-source-tilejson).
|
||||
|
||||
```nginx
|
||||
location ~ /tiles/(?<fwd_path>.*) {
|
||||
@ -335,6 +336,17 @@ cd ./target/release/
|
||||
./martin postgres://postgres@localhost/db
|
||||
```
|
||||
|
||||
## Debugging
|
||||
|
||||
Log levels are controlled on a per-module basis, and by default all logging is disabled except for errors. Logging is controlled via the `RUST_LOG` environment variable. The value of this environment variable is a comma-separated list of logging directives.
|
||||
|
||||
This will enable verbose logging for the `actix_web` module and enable debug logging for the `martin` and `postgres` modules:
|
||||
|
||||
```shell
|
||||
export RUST_LOG=actix_web=info,martin=debug,postgres=debug
|
||||
martin postgres://postgres@localhost/db
|
||||
```
|
||||
|
||||
## Development
|
||||
|
||||
Install project dependencies and check if all the tests are running.
|
||||
|
Before Width: | Height: | Size: 57 KiB After Width: | Height: | Size: 57 KiB |
@ -1,12 +1,18 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset='utf-8' />
|
||||
<title>Martin Debug</title>
|
||||
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
|
||||
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.49.0/mapbox-gl.js'></script>
|
||||
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.49.0/mapbox-gl.css' rel='stylesheet' />
|
||||
<meta charset="utf-8" />
|
||||
<title>Martin Debug Page</title>
|
||||
<meta
|
||||
name="viewport"
|
||||
content="initial-scale=1,maximum-scale=1,user-scalable=no"
|
||||
/>
|
||||
<script src="https://api.tiles.mapbox.com/mapbox-gl-js/v0.52.0/mapbox-gl.js"></script>
|
||||
<link
|
||||
href="https://api.tiles.mapbox.com/mapbox-gl-js/v0.52.0/mapbox-gl.css"
|
||||
rel="stylesheet"
|
||||
/>
|
||||
|
||||
<style>
|
||||
body {
|
||||
margin: 0;
|
||||
@ -23,11 +29,11 @@
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div id='map'></div>
|
||||
<div id="map"></div>
|
||||
|
||||
<script>
|
||||
mapboxgl.accessToken = 'pk.eyJ1Ijoic3RlcGFua3V6bWluIiwiYSI6Ik1ieW5udm8ifQ.25EOEC2-N92NCWT0Ci9w-Q';
|
||||
mapboxgl.accessToken =
|
||||
'pk.eyJ1Ijoic3RlcGFua3V6bWluIiwiYSI6Ik1ieW5udm8ifQ.25EOEC2-N92NCWT0Ci9w-Q';
|
||||
|
||||
var map = new mapboxgl.Map({
|
||||
container: 'map',
|
||||
@ -38,17 +44,19 @@
|
||||
|
||||
map.on('load', function() {
|
||||
map.addLayer({
|
||||
"id": "public.points",
|
||||
"type": "circle",
|
||||
"source": {
|
||||
"type": "vector",
|
||||
"url": "http://localhost:3000/public.points.json",
|
||||
id: 'public.points',
|
||||
type: 'circle',
|
||||
source: {
|
||||
type: 'vector',
|
||||
url: 'http://localhost:3000/public.points.json'
|
||||
},
|
||||
"source-layer": "public.points"
|
||||
'source-layer': 'public.points'
|
||||
});
|
||||
|
||||
map.on('click', 'public.points', function(event) {
|
||||
console.log(event.features);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user