Compare commits

..

20 Commits

Author SHA1 Message Date
Petr Sloup
4996848bdc Update package version to 2.6.0 2019-08-26 12:16:06 +02:00
Petr Sloup
aa7ae575d0 Flatten 3D buildings when rendering to remove artifacts 2019-08-26 12:10:49 +02:00
Petr Sloup
9603703908 Minor css fix 2019-08-26 12:10:32 +02:00
Petr Sloup
e44104254e Update handlebars 2019-07-12 11:25:08 +02:00
Petr Sloup
58b536036f Merge pull request #370 from golubev/patch-1
update 'installation.rst': fix a mistake
2019-06-25 07:58:53 +02:00
Sergii Golubev
a68e095400 update 'installation.rst': fix a mistake 2019-06-24 18:56:04 +03:00
Petr Sloup
53b28b35f1 Merge pull request #369 from bradh/patch-1
Trivial typo fix in docs
2019-06-24 07:39:44 +02:00
Brad Hards
58f92ae947 Trivial typo fix in docs 2019-06-22 11:02:36 +10:00
Petr Sloup
e506014763 Minor /styles.json fix (close #361) 2019-04-29 06:48:23 +02:00
Petr Sloup
7c5e7e94e9 Merge pull request #358 from disarticulate/master
Use verbose flag to debug corrupted mbtiles
2019-04-25 10:34:28 +02:00
Eric Xanderson
e6747ebb78 Merge pull request #2 from disarticulate/patch-2
verbose output empty tile warning
2019-04-23 20:53:17 -05:00
Eric Xanderson
2a87ad19c9 Merge pull request #1 from disarticulate/patch-1
add verbose to options
2019-04-23 20:52:46 -05:00
Eric Xanderson
ba62f0bf30 verbose output empty tile warning
Empty tile warning details; definitely what you would expect if there's not a catastrophic error, but you're getting blank tiles.

such as: ```
MBTiles error, serving empty { Error: SQLITE_CORRUPT: database disk image is malformed
lily_tile_server |     at Error (native) errno: 11, code: 'SQLITE_CORRUPT' }

```
https://github.com/klokantech/tileserver-gl/issues/323
2019-04-23 20:51:39 -05:00
Eric Xanderson
08369a666d add verbose to options
pass verbose to server for better handling of warnings
2019-04-23 20:43:56 -05:00
Petr Sloup
f771d41788 Merge pull request #355 from cyclemap/master
let the user define a log file or a log format
2019-04-15 08:00:28 +02:00
adrian
9dda95ee8e let the user define a log file or a log format
log file defaults to standard out.

log format defaults to current behavior ('tiny' for production, 'dev' for dev, and not enabled in test)
2019-04-13 11:55:37 -04:00
Petr Sloup
63483a3155 Merge pull request #339 from ibesora/master
Removes body data from http 204 response
2019-01-07 14:16:30 +01:00
Isaac Besora Vilardaga
bca5191ad9 Removes body data from http 204 response 2019-01-07 13:48:22 +01:00
Petr Sloup
245d9765a9 Merge pull request #337 from mcolmant/master
Correctly retrieve the public_url parameter on start
2019-01-03 10:57:05 +01:00
Maxime Colmant
e8134dfeb0 fix: correctly retrieve the public_url parameter on start 2018-12-26 16:26:49 +01:00
8 changed files with 37 additions and 14 deletions

View File

@@ -43,7 +43,7 @@ Static images
* ``fill`` - color to use as the fill (e.g. ``red``, ``rgba(255,255,255,0.5)``, ``#0000ff``)
* ``stroke`` - color of the path stroke
* ``width`` - width of the stroke
* ``padding`` - "percetange" padding for fitted endpoints (area-based and path autofit)
* ``padding`` - "percentage" padding for fitted endpoints (area-based and path autofit)
* value of ``0.1`` means "add 10% size to each side to make sure the area of interest is nicely visible"

View File

@@ -11,7 +11,7 @@ Just run ``docker run --rm -it -v $(pwd):/data -p 8080:80 klokantech/tileserver-
Additional options (see :doc:`/usage`) can be passed to the TileServer GL by appending them to the end of this command. You can, for example, do the following:
* ``docker run ... klokantech/tileserver-gl my-tiles.mbtiles`` -- explicitly specify which mbtiles to use (if you have more in the folder)
* ``docker run ... klokantech/tileserver-gl --mbtiles my-tiles.mbtiles`` -- explicitly specify which mbtiles to use (if you have more in the folder)
* ``docker run ... klokantech/tileserver-gl --verbose`` -- to see the default config created automatically
npm

View File

@@ -1,6 +1,6 @@
{
"name": "tileserver-gl",
"version": "2.5.0",
"version": "2.6.0",
"description": "Map tile server for JSON GL styles - vector and server side generated raster tiles",
"main": "src/main.js",
"bin": "src/main.js",
@@ -31,7 +31,7 @@
"cors": "2.8.5",
"express": "4.16.4",
"glyph-pbf-composite": "0.0.2",
"handlebars": "4.0.12",
"handlebars": "4.1.2",
"http-shutdown": "^1.2.0",
"morgan": "1.9.1",
"pbf": "3.1.0",

View File

@@ -81,6 +81,7 @@ section {
}
.item img {
position: absolute;
display: block;
margin: 30px;
width: 128px;
height: 128px;

View File

@@ -43,7 +43,7 @@ var opts = require('commander')
'Disable Cross-origin resource sharing headers'
)
.option(
'-u|--public_url',
'-u|--public_url <url>',
'Enable exposing the server on subpaths, not necessarily the root of the domain'
)
.option(
@@ -54,6 +54,14 @@ var opts = require('commander')
'-s, --silent',
'Less verbose output'
)
.option(
'-l|--log_file <file>',
'output log file (defaults to standard out)'
)
.option(
'-f|--log_format <format>',
'define the log format: https://github.com/expressjs/morgan#morganformat-options'
)
.version(
packageJson.version,
'-v, --version'
@@ -73,7 +81,10 @@ var startServer = function(configPath, config) {
bind: opts.bind,
port: opts.port,
cors: opts.cors,
verbose: opts.verbose,
silent: opts.silent,
logFile: opts.log_file,
logFormat: opts.log_format,
publicUrl: publicUrl
});
};

View File

@@ -89,7 +89,7 @@ module.exports = function(options, repo, params, id, styles, publicUrl) {
source.getTile(z, x, y, function(err, data, headers) {
if (err) {
if (/does not exist/.test(err.message)) {
return res.status(204).send(err.message);
return res.status(204).send();
} else {
return res.status(500).send(err.message);
}

View File

@@ -177,7 +177,7 @@ module.exports = function(options, repo, params, id, publicUrl, dataResolver) {
format = parts[5].split('.')[1];
source.getTile(z, x, y, function(err, data, headers) {
if (err) {
//console.log('MBTiles error, serving empty', err);
if (options.verbose) console.log('MBTiles error, serving empty', err);
createEmptyResponse(sourceInfo.format, sourceInfo.color, callback);
return;
}
@@ -263,6 +263,18 @@ module.exports = function(options, repo, params, id, publicUrl, dataResolver) {
styleJSON.glyphs = 'fonts://' + styleJSON.glyphs;
}
(styleJSON.layers || []).forEach(function(layer) {
if (layer && layer.paint) {
// Remove (flatten) 3D buildings
if (layer.paint['fill-extrusion-height']) {
layer.paint['fill-extrusion-height'] = 0;
}
if (layer.paint['fill-extrusion-base']) {
layer.paint['fill-extrusion-base'] = 0;
}
}
});
var tileJSON = {
'tilejson': '2.0.0',
'name': styleJSON.name,

View File

@@ -41,12 +41,11 @@ function start(opts) {
app.enable('trust proxy');
if (process.env.NODE_ENV == 'production') {
app.use(morgan('tiny', {
skip: function(req, res) { return opts.silent && (res.statusCode == 200 || res.statusCode == 304) }
}));
} else if (process.env.NODE_ENV !== 'test') {
app.use(morgan('dev', {
if (process.env.NODE_ENV !== 'test') {
var defaultLogFormat = process.env.NODE_ENV == 'production' ? 'tiny' : 'dev';
var logFormat = opts.logFormat || defaultLogFormat;
app.use(morgan(logFormat, {
stream: opts.logFile ? fs.createWriteStream(opts.logFile, { flags: 'a' }) : process.stdout,
skip: function(req, res) { return opts.silent && (res.statusCode == 200 || res.statusCode == 304) }
}));
}
@@ -198,7 +197,7 @@ function start(opts) {
name: styleJSON.name,
id: id,
url: utils.getPublicUrl(opts.publicUrl, req) +
'/styles/' + id + '/style.json' + query
'styles/' + id + '/style.json' + query
});
});
res.send(result);