Merge branch 'master' into refactor
This commit is contained in:
commit
96161fc656
3 changed files with 5 additions and 4 deletions
|
@ -9,7 +9,7 @@ Vector and raster maps with GL styles. Server side rendering by Mapbox GL Native
|
||||||
|
|
||||||
## Get Started
|
## 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
|
Install `tileserver-gl` with server-side raster rendering of vector tiles with npm
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,7 @@ Alternatively, you can use ``tileserver-gl-light`` package instead, which is pur
|
||||||
From source
|
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
|
npm install
|
||||||
node .
|
node .
|
||||||
|
|
|
@ -142,6 +142,7 @@ module.exports = (options, repo, params, id, publicUrl, dataResolver) => {
|
||||||
const createPool = (ratio, min, max) => {
|
const createPool = (ratio, min, max) => {
|
||||||
const createRenderer = (ratio, createCallback) => {
|
const createRenderer = (ratio, createCallback) => {
|
||||||
const renderer = new mbgl.Map({
|
const renderer = new mbgl.Map({
|
||||||
|
mode: "tile",
|
||||||
ratio: ratio,
|
ratio: ratio,
|
||||||
request: (req, callback) => {
|
request: (req, callback) => {
|
||||||
const protocol = req.url.split(':')[0];
|
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);
|
const tileMargin = Math.max(options.tileMargin || 0, 0);
|
||||||
if (z > 2 && tileMargin > 0) {
|
if (z > 2 && tileMargin > 0) {
|
||||||
params.width += tileMargin * 2 * scale;
|
params.width += tileMargin * 2;
|
||||||
params.height += tileMargin * 2 * scale;
|
params.height += tileMargin * 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
renderer.render(params, (err, data) => {
|
renderer.render(params, (err, data) => {
|
||||||
|
|
Loading…
Reference in a new issue