Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
8aba44c3b6
7 changed files with 66 additions and 36 deletions
22
Dockerfile
22
Dockerfile
|
@ -1,6 +1,12 @@
|
||||||
FROM debian:stretch
|
FROM node:6-stretch
|
||||||
MAINTAINER Petr Sloup <petr.sloup@klokantech.com>
|
MAINTAINER Petr Sloup <petr.sloup@klokantech.com>
|
||||||
|
|
||||||
|
ENV NODE_ENV="production"
|
||||||
|
VOLUME /data
|
||||||
|
WORKDIR /data
|
||||||
|
EXPOSE 80
|
||||||
|
ENTRYPOINT ["/usr/src/app/run.sh"]
|
||||||
|
|
||||||
RUN apt-get -qq update \
|
RUN apt-get -qq update \
|
||||||
&& DEBIAN_FRONTEND=noninteractive apt-get -y install \
|
&& DEBIAN_FRONTEND=noninteractive apt-get -y install \
|
||||||
apt-transport-https \
|
apt-transport-https \
|
||||||
|
@ -16,22 +22,8 @@ RUN apt-get -qq update \
|
||||||
libxxf86vm-dev \
|
libxxf86vm-dev \
|
||||||
xvfb \
|
xvfb \
|
||||||
x11-utils \
|
x11-utils \
|
||||||
&& echo "deb https://deb.nodesource.com/node_6.x stretch main" >> /etc/apt/sources.list.d/nodejs.list \
|
|
||||||
&& echo "deb-src https://deb.nodesource.com/node_6.x stretch main" >> /etc/apt/sources.list.d/nodejs.list \
|
|
||||||
&& apt-get -qq update \
|
|
||||||
&& DEBIAN_FRONTEND=noninteractive apt-get -y --allow-unauthenticated install \
|
|
||||||
nodejs \
|
|
||||||
&& rm /etc/apt/sources.list.d/nodejs.list \
|
|
||||||
&& apt-get clean
|
&& apt-get clean
|
||||||
|
|
||||||
RUN mkdir -p /usr/src/app
|
RUN mkdir -p /usr/src/app
|
||||||
COPY / /usr/src/app
|
COPY / /usr/src/app
|
||||||
RUN cd /usr/src/app && npm install --production
|
RUN cd /usr/src/app && npm install --production
|
||||||
|
|
||||||
VOLUME /data
|
|
||||||
WORKDIR /data
|
|
||||||
|
|
||||||
ENV NODE_ENV="production"
|
|
||||||
|
|
||||||
EXPOSE 80
|
|
||||||
ENTRYPOINT ["/usr/src/app/run.sh"]
|
|
||||||
|
|
|
@ -1,14 +1,12 @@
|
||||||
FROM node:6
|
FROM node:6
|
||||||
MAINTAINER Petr Sloup <petr.sloup@klokantech.com>
|
MAINTAINER Petr Sloup <petr.sloup@klokantech.com>
|
||||||
|
|
||||||
|
ENV NODE_ENV="production"
|
||||||
|
EXPOSE 80
|
||||||
|
VOLUME /data
|
||||||
|
WORKDIR /data
|
||||||
|
ENTRYPOINT ["node", "/usr/src/app/", "-p", "80"]
|
||||||
|
|
||||||
RUN mkdir -p /usr/src/app
|
RUN mkdir -p /usr/src/app
|
||||||
COPY / /usr/src/app
|
COPY / /usr/src/app
|
||||||
RUN cd /usr/src/app && npm install --production
|
RUN cd /usr/src/app && npm install --production
|
||||||
|
|
||||||
VOLUME /data
|
|
||||||
WORKDIR /data
|
|
||||||
|
|
||||||
ENV NODE_ENV="production"
|
|
||||||
|
|
||||||
EXPOSE 80
|
|
||||||
ENTRYPOINT ["node", "/usr/src/app/", "-p", "80"]
|
|
||||||
|
|
19
ISSUE_TEMPLATE.md
Normal file
19
ISSUE_TEMPLATE.md
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
It is great you want to help us making TileServer GL project better!
|
||||||
|
|
||||||
|
This is the right place only for a software bug report or a new software feature request.
|
||||||
|
|
||||||
|
The usage and installation questions belongs to https://stackoverflow.com/questions/tagged/openmaptiles
|
||||||
|
A guaranteed support and consulting from the core developers via https://openmaptiles.com/support/
|
||||||
|
|
||||||
|
Please search this GitHub repo for similar requests before posting (check also closed tickets).
|
||||||
|
|
||||||
|
When reporting a problem you have with the TileServer GL software please provide:
|
||||||
|
|
||||||
|
- Clear description of the problem: What steps will lead to reproducing the error on our computer? What is exactly wrong?
|
||||||
|
- Version of the TileServer GL software you have used
|
||||||
|
- Version and name of the operating system you use or other details of your setup
|
||||||
|
- Information about your used config / styles / vector tiles
|
||||||
|
- URL / link to the specific location in a live map demo where a bug is visible is always great
|
||||||
|
- Screenshot of the problem are cool! Drag&drop an image to the report here...
|
||||||
|
|
||||||
|
We love pull requests! If you are able to code, please send us your fix or code modification via GitHub... Thanks!
|
|
@ -9,6 +9,8 @@ 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`).
|
||||||
|
|
||||||
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
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
|
|
@ -95,6 +95,27 @@ Maximum image side length to be allowed to be rendered (including scale factor).
|
||||||
Be careful when changing this value since there are hardware limits that need to be considered.
|
Be careful when changing this value since there are hardware limits that need to be considered.
|
||||||
Default is ``2048``.
|
Default is ``2048``.
|
||||||
|
|
||||||
|
``minRendererPoolSizes``
|
||||||
|
------------------------
|
||||||
|
|
||||||
|
Minimum amount of raster tile renderers per scale factor.
|
||||||
|
The value is an array: the first element is the minimum amount of renderers for scale factor one, the second for scale factor two and so on.
|
||||||
|
If the array has less elements than ``maxScaleFactor``, then the last element is used for all remaining scale factors as well.
|
||||||
|
Selecting renderer pool sizes is a trade-off between memory use and speed.
|
||||||
|
A reasonable value will depend on your hardware and your amount of styles and scale factors.
|
||||||
|
If you have plenty of memory, you'll want to set this equal to ``maxRendererPoolSizes`` to avoid increased latency due to renderer destruction and recreation.
|
||||||
|
If you need to conserve memory, you'll want something lower than ``maxRendererPoolSizes``, possibly allocating more renderers to scale factors that are more common.
|
||||||
|
Default is ``[8, 4, 2]``.
|
||||||
|
|
||||||
|
``maxRendererPoolSizes``
|
||||||
|
------------------------
|
||||||
|
|
||||||
|
Maximum amount of raster tile renderers per scale factor.
|
||||||
|
The value and considerations are similar to ``minRendererPoolSizes`` above.
|
||||||
|
If you have plenty of memory, try setting these equal to or slightly above your processor count, e.g. if you have four processors, try a value of ``[6]``.
|
||||||
|
If you need to conserve memory, try lower values for scale factors that are less common.
|
||||||
|
Default is ``[16, 8, 4]``.
|
||||||
|
|
||||||
``watermark``
|
``watermark``
|
||||||
-----------
|
-----------
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
"node": ">=6 <7"
|
"node": ">=6 <7"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "mocha test/**.js"
|
"test": "mocha test/**.js --timeout 10000"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@mapbox/mapbox-gl-native": "3.5.7",
|
"@mapbox/mapbox-gl-native": "3.5.7",
|
||||||
|
|
|
@ -164,6 +164,7 @@ module.exports = function(options, repo, params, id, dataResolver) {
|
||||||
var parts = req.url.split('/');
|
var parts = req.url.split('/');
|
||||||
var sourceId = parts[2];
|
var sourceId = parts[2];
|
||||||
var source = map.sources[sourceId];
|
var source = map.sources[sourceId];
|
||||||
|
var sourceInfo = styleJSON.sources[sourceId];
|
||||||
var z = parts[3] | 0,
|
var z = parts[3] | 0,
|
||||||
x = parts[4] | 0,
|
x = parts[4] | 0,
|
||||||
y = parts[5].split('.')[0] | 0,
|
y = parts[5].split('.')[0] | 0,
|
||||||
|
@ -171,7 +172,7 @@ module.exports = function(options, repo, params, id, dataResolver) {
|
||||||
source.getTile(z, x, y, function(err, data, headers) {
|
source.getTile(z, x, y, function(err, data, headers) {
|
||||||
if (err) {
|
if (err) {
|
||||||
//console.log('MBTiles error, serving empty', err);
|
//console.log('MBTiles error, serving empty', err);
|
||||||
createEmptyResponse(source.format, source.color, callback);
|
createEmptyResponse(sourceInfo.format, sourceInfo.color, callback);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -344,18 +345,15 @@ module.exports = function(options, repo, params, id, dataResolver) {
|
||||||
});
|
});
|
||||||
|
|
||||||
var renderersReadyPromise = Promise.all(queue).then(function() {
|
var renderersReadyPromise = Promise.all(queue).then(function() {
|
||||||
// TODO: make pool sizes configurable
|
// standard and @2x tiles are much more usual -> default to larger pools
|
||||||
|
var minPoolSizes = options.minRendererPoolSizes || [8, 4, 2];
|
||||||
|
var maxPoolSizes = options.maxRendererPoolSizes || [16, 8, 4];
|
||||||
for (var s = 1; s <= maxScaleFactor; s++) {
|
for (var s = 1; s <= maxScaleFactor; s++) {
|
||||||
var minPoolSize = 2;
|
var i = Math.min(minPoolSizes.length - 1, s - 1);
|
||||||
|
var j = Math.min(maxPoolSizes.length - 1, s - 1);
|
||||||
// standard and @2x tiles are much more usual -> create larger pools
|
var minPoolSize = minPoolSizes[i];
|
||||||
if (s <= 2) {
|
var maxPoolSize = Math.max(minPoolSize, maxPoolSizes[j]);
|
||||||
minPoolSize *= 2;
|
map.renderers[s] = createPool(s, minPoolSize, maxPoolSize);
|
||||||
if (s <= 1) {
|
|
||||||
minPoolSize *= 2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
map.renderers[s] = createPool(s, minPoolSize, 2 * minPoolSize);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue