Merge branch 'master' into refactor

This commit is contained in:
Petr Sloup 2019-12-30 11:49:37 +01:00 committed by GitHub
commit 96161fc656
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 4 deletions

View file

@ -9,7 +9,7 @@ Vector and raster maps with GL styles. Server side rendering by Mapbox GL Native
## Get Started
Make sure you have Node.js version **6** installed (running `node -v` it should output something like `v6.11.3`).
Make sure you have Node.js version **10** installed (running `node -v` it should output something like `v10.17.0`).
Install `tileserver-gl` with server-side raster rendering of vector tiles with npm

View file

@ -41,7 +41,7 @@ Alternatively, you can use ``tileserver-gl-light`` package instead, which is pur
From source
===========
Make sure you have Node v6 (nvm install 6) and run::
Make sure you have Node v10 (nvm install 10) and run::
npm install
node .

View file

@ -142,6 +142,7 @@ module.exports = (options, repo, params, id, publicUrl, dataResolver) => {
const createPool = (ratio, min, max) => {
const createRenderer = (ratio, createCallback) => {
const renderer = new mbgl.Map({
mode: "tile",
ratio: ratio,
request: (req, callback) => {
const protocol = req.url.split(':')[0];
@ -415,8 +416,8 @@ module.exports = (options, repo, params, id, publicUrl, dataResolver) => {
const tileMargin = Math.max(options.tileMargin || 0, 0);
if (z > 2 && tileMargin > 0) {
params.width += tileMargin * 2 * scale;
params.height += tileMargin * 2 * scale;
params.width += tileMargin * 2;
params.height += tileMargin * 2;
}
renderer.render(params, (err, data) => {