tileserver-gl 4.1.1 → 4.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.dockerignore CHANGED
@@ -1,6 +1,7 @@
1
1
  *
2
2
  !src
3
3
  !public
4
+ !test
4
5
  !package.json
5
6
  !package-lock.json
6
7
  !docker-entrypoint.sh
package/.eslintrc.cjs ADDED
@@ -0,0 +1,32 @@
1
+ module.exports = {
2
+ root: true,
3
+ env: {
4
+ browser: true,
5
+ node: true,
6
+ es6: true,
7
+ },
8
+ parserOptions: {
9
+ parser: '@typescript-eslint/parser',
10
+ ecmaVersion: 2020,
11
+ sourceType: 'module',
12
+ lib: ['es2020'],
13
+ ecmaFeatures: {
14
+ jsx: true,
15
+ tsx: true,
16
+ },
17
+ },
18
+ plugins: ['prettier', 'jsdoc', 'security'],
19
+ extends: [
20
+ 'prettier',
21
+ 'plugin:@typescript-eslint/recommended',
22
+ 'plugin:@typescript-eslint/eslint-recommended',
23
+ 'plugin:prettier/recommended',
24
+ 'plugin:jsdoc/recommended',
25
+ 'plugin:security/recommended',
26
+ ],
27
+ // add your custom rules here
28
+ rules: {
29
+ 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
30
+ 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
31
+ },
32
+ };
package/.gitattributes ADDED
@@ -0,0 +1,11 @@
1
+ ###############################################################################
2
+ # Set default behavior to automatically normalize line endings.
3
+ ###############################################################################
4
+ * text=auto
5
+
6
+ ###############################################################################
7
+ # behavior for Unix scripts
8
+ #
9
+ # Unix scripts are treated as binary by default.
10
+ ###############################################################################
11
+ *.sh eol=lf
@@ -0,0 +1,21 @@
1
+ #!/bin/sh
2
+ . "$(dirname "$0")/_/husky.sh"
3
+
4
+ NAME=$(git config user.name)
5
+ EMAIL=$(git config user.email)
6
+
7
+ if [ -z "$NAME" ]; then
8
+ echo "empty git config user.name"
9
+ exit 1
10
+ fi
11
+
12
+ if [ -z "$EMAIL" ]; then
13
+ echo "empty git config user.email"
14
+ exit 1
15
+ fi
16
+
17
+ git interpret-trailers --if-exists doNothing --trailer \
18
+ "Signed-off-by: $NAME <$EMAIL>" \
19
+ --in-place "$1"
20
+
21
+ npm exec --no -- commitlint --edit $1
@@ -0,0 +1,4 @@
1
+ #!/bin/sh
2
+ . "$(dirname "$0")/_/husky.sh"
3
+
4
+ npm exec --no -- lint-staged --no-stash
package/Dockerfile CHANGED
@@ -1,63 +1,85 @@
1
- FROM node:16-bullseye AS builder
2
-
3
- RUN export DEBIAN_FRONTEND=noninteractive \
4
- && apt-get -qq update \
5
- && apt-get -y --no-install-recommends install \
6
- apt-transport-https \
7
- curl \
8
- unzip \
1
+ FROM ubuntu:focal AS builder
2
+
3
+ ENV NODE_ENV="production"
4
+
5
+ RUN set -ex; \
6
+ export DEBIAN_FRONTEND=noninteractive; \
7
+ apt-get -qq update; \
8
+ apt-get -y --no-install-recommends install \
9
9
  build-essential \
10
- python \
10
+ ca-certificates \
11
+ wget \
12
+ pkg-config \
13
+ xvfb \
14
+ libglfw3-dev \
15
+ libuv1-dev \
16
+ libjpeg-turbo8 \
17
+ libicu66 \
11
18
  libcairo2-dev \
12
- libgles2-mesa-dev \
13
- libgbm-dev \
14
- libprotobuf-dev \
15
- && apt-get -y --purge autoremove \
16
- && apt-get clean \
17
- && rm -rf /var/lib/apt/lists/*
19
+ libpango1.0-dev \
20
+ libjpeg-dev \
21
+ libgif-dev \
22
+ librsvg2-dev \
23
+ libcurl4-openssl-dev \
24
+ libpixman-1-dev; \
25
+ wget -qO- https://deb.nodesource.com/setup_16.x | bash; \
26
+ apt-get install -y nodejs; \
27
+ apt-get -y remove wget; \
28
+ apt-get -y --purge autoremove; \
29
+ apt-get clean; \
30
+ rm -rf /var/lib/apt/lists/*;
18
31
 
19
- COPY . /usr/src/app
32
+ RUN mkdir -p /usr/src/app
33
+ COPY package* /usr/src/app/
20
34
 
21
- ENV NODE_ENV="production"
35
+ RUN cd /usr/src/app && npm ci --omit=dev
22
36
 
23
- RUN cd /usr/src/app && npm install --production
37
+ FROM ubuntu:focal AS final
24
38
 
39
+ ENV \
40
+ NODE_ENV="production" \
41
+ CHOKIDAR_USEPOLLING=1 \
42
+ CHOKIDAR_INTERVAL=500
25
43
 
26
- FROM node:16-bullseye-slim AS final
27
-
28
- RUN export DEBIAN_FRONTEND=noninteractive \
29
- && apt-get -qq update \
30
- && apt-get -y --no-install-recommends install \
31
- libgles2-mesa \
32
- libegl1 \
44
+ RUN set -ex; \
45
+ export DEBIAN_FRONTEND=noninteractive; \
46
+ groupadd -r node; \
47
+ useradd -r -g node node; \
48
+ apt-get -qq update; \
49
+ apt-get -y --no-install-recommends install \
50
+ ca-certificates \
51
+ wget \
33
52
  xvfb \
34
- xauth \
53
+ libglfw3 \
54
+ libuv1 \
55
+ libjpeg-turbo8 \
56
+ libicu66 \
57
+ libcairo2 \
58
+ libgif7 \
35
59
  libopengl0 \
60
+ libpixman-1-0 \
36
61
  libcurl4 \
37
- curl \
38
- libuv1-dev \
39
- libc6-dev \
40
- libcap2-bin \
41
- && apt-get -y --purge autoremove \
42
- && apt-get clean \
43
- && rm -rf /var/lib/apt/lists/*
44
-
45
- RUN curl http://archive.ubuntu.com/ubuntu/pool/main/libj/libjpeg-turbo/libjpeg-turbo8_2.0.3-0ubuntu1_amd64.deb --output libjpeg-turbo8_2.0.3-0ubuntu1_amd64.deb
46
- RUN apt install ./libjpeg-turbo8_2.0.3-0ubuntu1_amd64.deb
47
- RUN curl http://archive.ubuntu.com/ubuntu/pool/main/i/icu/libicu66_66.1-2ubuntu2_amd64.deb --output libicu66_66.1-2ubuntu2_amd64.deb
48
- RUN apt install ./libicu66_66.1-2ubuntu2_amd64.deb
49
-
50
- COPY --from=builder /usr/src/app /app
62
+ librsvg2-2 \
63
+ libpango1.0; \
64
+ wget -qO- https://deb.nodesource.com/setup_16.x | bash; \
65
+ apt-get install -y nodejs; \
66
+ apt-get -y remove wget; \
67
+ apt-get -y --purge autoremove; \
68
+ apt-get clean; \
69
+ rm -rf /var/lib/apt/lists/*;
51
70
 
52
- ENV NODE_ENV="production"
53
- ENV CHOKIDAR_USEPOLLING=1
54
- ENV CHOKIDAR_INTERVAL=500
71
+ COPY --from=builder /usr/src/app /usr/src/app
55
72
 
73
+ COPY . /usr/src/app
74
+
75
+ RUN mkdir -p /data && chown node:node /data
56
76
  VOLUME /data
57
77
  WORKDIR /data
58
78
 
59
- EXPOSE 80
79
+ EXPOSE 8080
60
80
 
61
81
  USER node:node
62
82
 
63
- ENTRYPOINT ["/app/docker-entrypoint.sh"]
83
+ ENTRYPOINT ["/usr/src/app/docker-entrypoint.sh"]
84
+
85
+ HEALTHCHECK CMD node /usr/src/app/src/healthcheck.js
package/Dockerfile_light CHANGED
@@ -1,14 +1,35 @@
1
- FROM node:16-bullseye
1
+ FROM ubuntu:focal
2
2
 
3
- ENV NODE_ENV="production"
4
- ENV CHOKIDAR_USEPOLLING=1
5
- ENV CHOKIDAR_INTERVAL=500
6
- EXPOSE 80
3
+ ENV \
4
+ NODE_ENV="production" \
5
+ CHOKIDAR_USEPOLLING=1 \
6
+ CHOKIDAR_INTERVAL=500
7
+
8
+ RUN set -ex; \
9
+ export DEBIAN_FRONTEND=noninteractive; \
10
+ groupadd -r node; \
11
+ useradd -r -g node node; \
12
+ apt-get -qq update; \
13
+ apt-get -y --no-install-recommends install \
14
+ ca-certificates \
15
+ wget; \
16
+ wget -qO- https://deb.nodesource.com/setup_16.x | bash; \
17
+ apt-get install -y nodejs; \
18
+ apt-get -y remove wget; \
19
+ apt-get -y --purge autoremove; \
20
+ apt-get clean; \
21
+ rm -rf /var/lib/apt/lists/*;
22
+
23
+ EXPOSE 8080
24
+
25
+ RUN mkdir -p /data && chown node:node /data
7
26
  VOLUME /data
8
27
  WORKDIR /data
9
28
  ENTRYPOINT ["/usr/src/app/docker-entrypoint.sh"]
10
29
 
11
30
  RUN mkdir -p /usr/src/app
12
31
  COPY / /usr/src/app
13
- RUN cd /usr/src/app && npm install --production
32
+ RUN cd /usr/src/app && npm install --omit=dev
14
33
  RUN ["chmod", "+x", "/usr/src/app/docker-entrypoint.sh"]
34
+ USER node:node
35
+ HEALTHCHECK CMD node /usr/src/app/src/healthcheck.js
package/Dockerfile_test CHANGED
@@ -2,34 +2,43 @@
2
2
  # Simply run "docker build -f Dockerfile_test ."
3
3
  # WARNING: sometimes it fails with a core dumped exception
4
4
 
5
- FROM node:16-bullseye
5
+ FROM ubuntu:focal
6
6
 
7
- RUN apt-get -qq update \
8
- && DEBIAN_FRONTEND=noninteractive apt-get -y install \
9
- apt-transport-https \
10
- curl \
11
- unzip \
12
- build-essential \
13
- python \
14
- libcairo2-dev \
15
- libgles2-mesa-dev \
16
- libgbm-dev \
17
- libllvm3.9 \
18
- libprotobuf-dev \
19
- libxxf86vm-dev \
20
- libopengl0 \
21
- xvfb \
22
- && apt-get clean
7
+ ENV NODE_ENV="development"
8
+
9
+ RUN set -ex; \
10
+ export DEBIAN_FRONTEND=noninteractive; \
11
+ apt-get -qq update; \
12
+ apt-get -y --no-install-recommends install \
13
+ unzip \
14
+ build-essential \
15
+ ca-certificates \
16
+ wget \
17
+ pkg-config \
18
+ xvfb \
19
+ libglfw3-dev \
20
+ libuv1-dev \
21
+ libjpeg-turbo8 \
22
+ libicu66 \
23
+ libcairo2-dev \
24
+ libpango1.0-dev \
25
+ libjpeg-dev \
26
+ libgif-dev \
27
+ librsvg2-dev \
28
+ libcurl4-openssl-dev \
29
+ libpixman-1-dev; \
30
+ wget -qO- https://deb.nodesource.com/setup_16.x | bash; \
31
+ apt-get install -y nodejs; \
32
+ apt-get clean;
23
33
 
24
34
  RUN mkdir -p /usr/src/app
25
35
  WORKDIR /usr/src/app
26
36
 
27
- RUN wget -O test_data.zip https://github.com/maptiler/tileserver-gl/releases/download/v1.3.0/test_data.zip
28
- RUN unzip -q test_data.zip -d test_data
29
-
30
- ENV NODE_ENV="test"
37
+ RUN wget -O test_data.zip https://github.com/maptiler/tileserver-gl/releases/download/v1.3.0/test_data.zip; \
38
+ unzip -q test_data.zip -d test_data
31
39
 
32
40
  COPY package.json .
33
41
  RUN npm install
34
42
  COPY / .
43
+
35
44
  RUN xvfb-run --server-args="-screen 0 1024x768x24" npm test
package/README.md CHANGED
@@ -44,7 +44,7 @@ An alternative to npm to start the packed software easier is to install [Docker]
44
44
  Example using a mbtiles file
45
45
  ```bash
46
46
  wget https://github.com/maptiler/tileserver-gl/releases/download/v1.3.0/zurich_switzerland.mbtiles
47
- docker run --rm -it -v $(pwd):/data -p 8080:80 maptiler/tileserver-gl --mbtiles zurich_switzerland.mbtiles
47
+ docker run --rm -it -v $(pwd):/data -p 8080:8080 maptiler/tileserver-gl --mbtiles zurich_switzerland.mbtiles
48
48
  [in your browser, visit http://[server ip]:8080]
49
49
  ```
50
50
 
@@ -52,13 +52,13 @@ Example using a config.json + style + mbtiles file
52
52
  ```bash
53
53
  wget https://github.com/maptiler/tileserver-gl/releases/download/v1.3.0/test_data.zip
54
54
  unzip test_data.zip
55
- docker run --rm -it -v $(pwd):/data -p 8080:80 maptiler/tileserver-gl
55
+ docker run --rm -it -v $(pwd):/data -p 8080:8080 maptiler/tileserver-gl
56
56
  [in your browser, visit http://[server ip]:8080]
57
57
  ```
58
58
 
59
59
  Example using a different path
60
60
  ```bash
61
- docker run --rm -it -v /your/local/config/path:/data -p 8080:80 maptiler/tileserver-gl
61
+ docker run --rm -it -v /your/local/config/path:/data -p 8080:8080 maptiler/tileserver-gl
62
62
  ```
63
63
  replace '/your/local/config/path' with the path to your config file
64
64
 
@@ -0,0 +1,3 @@
1
+ module.exports = {
2
+ extends: ['@commitlint/config-conventional'],
3
+ };
@@ -20,7 +20,7 @@ trap refresh HUP
20
20
 
21
21
  if ! which -- "${1}"; then
22
22
  # first arg is not an executable
23
- xvfb-run -a --server-args="-screen 0 1024x768x24" -- node /app/ -p 80 "$@" &
23
+ xvfb-run -a --server-args="-screen 0 1024x768x24" -- node /usr/src/app/ "$@" &
24
24
  # Wait exits immediately on signals which have traps set. Store return value and wait
25
25
  # again for all jobs to actually complete before continuing.
26
26
  wait $! || RETVAL=$?
@@ -20,7 +20,7 @@ trap refresh HUP
20
20
 
21
21
  if ! which -- "${1}"; then
22
22
  # first arg is not an executable
23
- node /usr/src/app/ -p 80 "$@" &
23
+ node /usr/src/app/ "$@" &
24
24
  # Wait exits immediately on signals which have traps set. Store return value and wait
25
25
  # again for all jobs to actually complete before continuing.
26
26
  wait $! || RETVAL=$?
package/docs/config.rst CHANGED
@@ -14,6 +14,7 @@ Example:
14
14
  "root": "",
15
15
  "fonts": "fonts",
16
16
  "sprites": "sprites",
17
+ "icons": "icons",
17
18
  "styles": "styles",
18
19
  "mbtiles": ""
19
20
  },
@@ -31,6 +32,7 @@ Example:
31
32
  "serveAllFonts": false,
32
33
  "serveAllStyles": false,
33
34
  "serveStaticMaps": true,
35
+ "allowRemoteMarkerIcons": true,
34
36
  "tileMargin": 0
35
37
  },
36
38
  "styles": {
@@ -141,6 +143,13 @@ Optional string to be rendered into the raster tiles (and static maps) as waterm
141
143
  Can be used for hard-coding attributions etc. (can also be specified per-style).
142
144
  Not used by default.
143
145
 
146
+ ``allowRemoteMarkerIcons``
147
+ --------------
148
+
149
+ Allows the rendering of marker icons fetched via http(s) hyperlinks.
150
+ For security reasons only allow this if you can control the origins from where the markers are fetched!
151
+ Default is to disallow fetching of icons from remote sources.
152
+
144
153
  ``styles``
145
154
  ==========
146
155
 
@@ -38,15 +38,41 @@ Static images
38
38
  * ``path`` - comma-separated ``lng,lat``, pipe-separated pairs
39
39
 
40
40
  * e.g. ``5.9,45.8|5.9,47.8|10.5,47.8|10.5,45.8|5.9,45.8``
41
+ * can be provided multiple times
41
42
 
42
- * ``latlng`` - indicates the ``path`` coordinates are in ``lat,lng`` order rather than the usual ``lng,lat``
43
+ * ``latlng`` - indicates coordinates are in ``lat,lng`` order rather than the usual ``lng,lat``
43
44
  * ``fill`` - color to use as the fill (e.g. ``red``, ``rgba(255,255,255,0.5)``, ``#0000ff``)
44
45
  * ``stroke`` - color of the path stroke
45
46
  * ``width`` - width of the stroke
47
+ * ``linecap`` - rendering style for the start and end points of the path
48
+ * ``linejoin`` - rendering style for overlapping segments of the path with differing directions
49
+ * ``border`` - color of the optional border path stroke
50
+ * ``borderwidth`` - width of the border stroke (default 10% of width)
51
+ * ``marker`` - Marker in format ``lng,lat|iconPath|option|option|...``
52
+
53
+ * Will be rendered with the bottom center at the provided location
54
+ * ``lng,lat`` and ``iconPath`` are mandatory and icons won't be rendered without them
55
+ * ``iconPath`` is either a link to an image served via http(s) or a path to a file relative to the configured icon path
56
+ * ``option`` must adhere to the format ``optionName:optionValue`` and supports the following names
57
+
58
+ * ``scale`` - Factor to scale image by
59
+
60
+ * e.g. ``0.5`` - Scales the image to half it's original size
61
+
62
+ * ``offset`` - Image offset as positive or negative pixel value in format ``[offsetX],[offsetY]``
63
+
64
+ * scales with ``scale`` parameter since image placement is relative to it's size
65
+ * e.g. ``2,-4`` - Image will be moved 2 pixel to the right and 4 pixel in the upwards direction from the provided location
66
+
67
+ * e.g. ``5.9,45.8|marker-start.svg|scale:0.5|offset:2,-4``
68
+ * can be provided multiple times
69
+
46
70
  * ``padding`` - "percentage" padding for fitted endpoints (area-based and path autofit)
47
71
 
48
72
  * value of ``0.1`` means "add 10% size to each side to make sure the area of interest is nicely visible"
49
73
 
74
+ * ``maxzoom`` - Maximum zoom level (only for auto endpoint where zoom level is calculated and not provided)
75
+
50
76
  * You can also use (experimental) ``/styles/{id}/static/raw/...`` endpoints with raw spherical mercator coordinates (EPSG:3857) instead of WGS84.
51
77
 
52
78
  * The static images are not available in the ``tileserver-gl-light`` version.
@@ -7,7 +7,7 @@ Docker
7
7
 
8
8
  When running docker image, no special installation is needed -- the docker will automatically download the image if not present.
9
9
 
10
- Just run ``docker run --rm -it -v $(pwd):/data -p 8080:80 maptiler/tileserver-gl``.
10
+ Just run ``docker run --rm -it -v $(pwd):/data -p 8080:8080 maptiler/tileserver-gl``.
11
11
 
12
12
  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:
13
13
 
@@ -0,0 +1,4 @@
1
+ module.exports = {
2
+ '*.{js,ts}': 'npm run lint:js',
3
+ '*.{yml}': 'npm run lint:yml',
4
+ };
package/package.json CHANGED
@@ -1,21 +1,21 @@
1
1
  {
2
2
  "name": "tileserver-gl",
3
- "version": "4.1.1",
3
+ "version": "4.2.0",
4
4
  "description": "Map tile server for JSON GL styles - vector and server side generated raster tiles",
5
5
  "main": "src/main.js",
6
6
  "bin": "src/main.js",
7
7
  "type": "module",
8
- "repository": {
9
- "type": "git",
10
- "url": "git+https://github.com/maptiler/tileserver-gl.git"
11
- },
12
- "license": "BSD-2-Clause",
13
- "engines": {
14
- "node": ">=14.15.0 <17"
15
- },
16
8
  "scripts": {
17
9
  "test": "mocha test/**.js --timeout 10000",
18
- "docker": "docker build -f Dockerfile . && docker run --rm -i -p 8080:80 $(docker build -q .)"
10
+ "lint:yml": "yamllint --schema=CORE_SCHEMA *.{yml,yaml}",
11
+ "lint:js": "npm run lint:eslint && npm run lint:prettier",
12
+ "lint:js:fix": "npm run lint:eslint:fix && npm run lint:prettier:fix",
13
+ "lint:eslint": "eslint \"{,!(node_modules|dist|static|public)/**/}*.{js,ts,cjs,mjs}\" --ignore-path .gitignore",
14
+ "lint:eslint:fix": "eslint --fix \"{,!(node_modules|dist|static|public)/**/}*.{js,ts,cjs,mjs}\" --ignore-path .gitignore",
15
+ "lint:prettier": "prettier --check \"{,!(node_modules|dist|static|public)/**/}*.{js,ts,cjs,mjs,json}\" --ignore-path .gitignore",
16
+ "lint:prettier:fix": "prettier --write \"{,!(node_modules|dist|static|public)/**/}*.{js,ts,cjs,mjs,json}\" --ignore-path .gitignore",
17
+ "docker": "docker build -f Dockerfile . && docker run --rm -i -p 8080:8080 $(docker build -q .)",
18
+ "prepare": "node -e \"if (process.env.NODE_ENV !== 'production'){ process.exit(1) } \" || husky install"
19
19
  },
20
20
  "dependencies": {
21
21
  "@mapbox/glyph-pbf-composite": "0.0.3",
@@ -39,11 +39,44 @@
39
39
  "proj4": "2.8.0",
40
40
  "request": "2.88.2",
41
41
  "sharp": "0.31.0",
42
- "tileserver-gl-styles": "2.0.0"
42
+ "tileserver-gl-styles": "2.0.0",
43
+ "sanitize-filename": "1.6.3"
43
44
  },
44
45
  "devDependencies": {
46
+ "@commitlint/cli": "^17.1.2",
47
+ "@commitlint/config-conventional": "^17.1.0",
48
+ "@typescript-eslint/eslint-plugin": "^5.38.0",
49
+ "@typescript-eslint/parser": "^5.38.0",
45
50
  "chai": "4.3.6",
51
+ "eslint": "^8.24.0",
52
+ "eslint-config-prettier": "^8.5.0",
53
+ "eslint-plugin-jsdoc": "^39.3.6",
54
+ "eslint-plugin-prettier": "^4.2.1",
55
+ "eslint-plugin-security": "^1.5.0",
56
+ "husky": "^8.0.1",
57
+ "lint-staged": "^13.0.3",
46
58
  "mocha": "^10.0.0",
47
- "supertest": "^6.2.4"
48
- }
59
+ "prettier": "^2.7.1",
60
+ "should": "^13.2.3",
61
+ "supertest": "^6.2.4",
62
+ "yaml-lint": "^1.7.0"
63
+ },
64
+ "keywords": [
65
+ "maptiler",
66
+ "tileserver-gl",
67
+ "maplibre-gl",
68
+ "tileserver"
69
+ ],
70
+ "license": "BSD-2-Clause",
71
+ "engines": {
72
+ "node": ">=14.15.0 <17"
73
+ },
74
+ "repository": {
75
+ "url": "git+https://github.com/maptiler/tileserver-gl.git",
76
+ "type": "git"
77
+ },
78
+ "bugs": {
79
+ "url": "https://github.com/maptiler/tileserver-gl/issues"
80
+ },
81
+ "homepage": "https://github.com/maptiler/tileserver-gl#readme"
49
82
  }
@@ -0,0 +1,13 @@
1
+ module.exports = {
2
+ $schema: 'http://json.schemastore.org/prettierrc',
3
+ semi: true,
4
+ arrowParens: 'always',
5
+ singleQuote: true,
6
+ trailingComma: 'all',
7
+ bracketSpacing: true,
8
+ htmlWhitespaceSensitivity: 'css',
9
+ insertPragma: false,
10
+ tabWidth: 2,
11
+ useTabs: false,
12
+ endOfLine: 'lf',
13
+ };
@@ -11,7 +11,7 @@
11
11
  <ows:Operation name="GetCapabilities">
12
12
  <ows:DCP>
13
13
  <ows:HTTP>
14
- <ows:Get xlink:href="{{baseUrl}}/wmts/{{id}}/">
14
+ <ows:Get xlink:href="{{baseUrl}}wmts/{{id}}/">
15
15
  <ows:Constraint name="GetEncoding">
16
16
  <ows:AllowedValues>
17
17
  <ows:Value>RESTful</ows:Value>
@@ -24,7 +24,7 @@
24
24
  <ows:Operation name="GetTile">
25
25
  <ows:DCP>
26
26
  <ows:HTTP>
27
- <ows:Get xlink:href="{{baseUrl}}/styles/">
27
+ <ows:Get xlink:href="{{baseUrl}}styles/">
28
28
  <ows:Constraint name="GetEncoding">
29
29
  <ows:AllowedValues>
30
30
  <ows:Value>RESTful</ows:Value>
@@ -50,7 +50,7 @@
50
50
  <TileMatrixSetLink>
51
51
  <TileMatrixSet>GoogleMapsCompatible</TileMatrixSet>
52
52
  </TileMatrixSetLink>
53
- <ResourceURL format="image/png" resourceType="tile" template="{{baseUrl}}/styles/{{id}}/{TileMatrix}/{TileCol}/{TileRow}.png{{key_query}}"/>
53
+ <ResourceURL format="image/png" resourceType="tile" template="{{baseUrl}}styles/{{id}}/{TileMatrix}/{TileCol}/{TileRow}.png{{key_query}}"/>
54
54
  </Layer><TileMatrixSet>
55
55
  <ows:Title>GoogleMapsCompatible</ows:Title>
56
56
  <ows:Abstract>GoogleMapsCompatible EPSG:3857</ows:Abstract>
@@ -403,5 +403,5 @@
403
403
  <MatrixHeight>262144</MatrixHeight>
404
404
  </TileMatrix></TileMatrixSet>
405
405
  </Contents>
406
- <ServiceMetadataURL xlink:href="{{baseUrl}}/wmts/{{id}}/"/>
406
+ <ServiceMetadataURL xlink:href="{{baseUrl}}wmts/{{id}}/"/>
407
407
  </Capabilities>
package/publish.js CHANGED
@@ -12,25 +12,33 @@
12
12
 
13
13
  // SYNC THE `light` FOLDER
14
14
 
15
- import child_process from 'child_process'
16
- child_process.execSync('rsync -av --exclude="light" --exclude=".git" --exclude="node_modules" --delete . light', {
17
- stdio: 'inherit'
18
- });
15
+ import child_process from 'child_process';
16
+ child_process.execSync(
17
+ 'rsync -av --exclude="light" --exclude=".git" --exclude="node_modules" --delete . light',
18
+ {
19
+ stdio: 'inherit',
20
+ },
21
+ );
19
22
 
20
23
  // PATCH `package.json`
21
24
  import fs from 'fs';
22
25
  import path from 'path';
23
- import {fileURLToPath} from 'url';
26
+ import { fileURLToPath } from 'url';
24
27
  const __filename = fileURLToPath(import.meta.url);
25
28
  const __dirname = path.dirname(__filename);
26
- const packageJson = JSON.parse(fs.readFileSync(__dirname + '/package.json', 'utf8'))
29
+ const packageJson = JSON.parse(
30
+ fs.readFileSync(__dirname + '/package.json', 'utf8'),
31
+ );
27
32
 
28
33
  packageJson.name += '-light';
29
- packageJson.description = 'Map tile server for JSON GL styles - serving vector tiles';
34
+ packageJson.description =
35
+ 'Map tile server for JSON GL styles - serving vector tiles';
30
36
  delete packageJson.dependencies['canvas'];
31
37
  delete packageJson.dependencies['@maplibre/maplibre-gl-native'];
32
38
  delete packageJson.dependencies['sharp'];
33
39
 
40
+ delete packageJson.scripts['prepare'];
41
+
34
42
  delete packageJson.optionalDependencies;
35
43
  delete packageJson.devDependencies;
36
44
 
@@ -51,10 +59,10 @@ if (process.argv.length > 2 && process.argv[2] == '--no-publish') {
51
59
 
52
60
  // tileserver-gl
53
61
  child_process.execSync('npm publish . --access public', {
54
- stdio: 'inherit'
62
+ stdio: 'inherit',
55
63
  });
56
64
 
57
65
  // tileserver-gl-light
58
66
  child_process.execSync('npm publish ./light --access public', {
59
- stdio: 'inherit'
67
+ stdio: 'inherit',
60
68
  });
package/run.sh CHANGED
@@ -29,7 +29,7 @@ export DISPLAY=:${displayNumber}.${screenNumber}
29
29
 
30
30
  echo
31
31
  cd /data
32
- node /usr/src/app/ -p 80 "$@" &
32
+ node /usr/src/app/ "$@" &
33
33
  child=$!
34
34
  wait "$child"
35
35