diff --git a/README.md b/README.md index 6b8c3583..bb0cadfb 100755 --- a/README.md +++ b/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/(?.*) { @@ -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. diff --git a/mart.png b/logo.png similarity index 100% rename from mart.png rename to logo.png diff --git a/tests/debug.html b/tests/debug.html index e8beb01c..b4725b9f 100644 --- a/tests/debug.html +++ b/tests/debug.html @@ -1,54 +1,62 @@ + + + Martin Debug Page + + + - - - Martin Debug - - - - - + #map { + position: absolute; + top: 0; + bottom: 0; + width: 100%; + } + + - + +
-
+ - + map.on('load', function() { + map.addLayer({ + id: 'public.points', + type: 'circle', + source: { + type: 'vector', + url: 'http://localhost:3000/public.points.json' + }, + 'source-layer': 'public.points' + }); - \ No newline at end of file + map.on('click', 'public.points', function(event) { + console.log(event.features); + }); + }); + + +