tileserver-gl-light 4.6.6 → 4.8.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/.eslintrc.cjs CHANGED
@@ -28,5 +28,9 @@ module.exports = {
28
28
  rules: {
29
29
  'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
30
30
  'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
31
+ '@typescript-eslint/no-unused-vars': [
32
+ 'warn',
33
+ { argsIgnorePattern: 'next|err|info|reject' },
34
+ ],
31
35
  },
32
36
  };
@@ -9,7 +9,7 @@ permissions:
9
9
 
10
10
  jobs:
11
11
  ci:
12
- runs-on: ubuntu-20.04
12
+ runs-on: ubuntu-22.04
13
13
  steps:
14
14
  - name: Check out repository ✨ (non-dependabot)
15
15
  if: ${{ github.actor != 'dependabot[bot]' }}
@@ -25,13 +25,13 @@ jobs:
25
25
  - name: Checkout
26
26
  uses: actions/checkout@v4
27
27
  - name: Initialize CodeQL
28
- uses: github/codeql-action/init@v2
28
+ uses: github/codeql-action/init@v3
29
29
  with:
30
30
  languages: ${{ matrix.language }}
31
31
  queries: +security-and-quality
32
32
  - name: Autobuild
33
- uses: github/codeql-action/autobuild@v2
33
+ uses: github/codeql-action/autobuild@v3
34
34
  - name: Perform CodeQL Analysis
35
- uses: github/codeql-action/analyze@v2
35
+ uses: github/codeql-action/analyze@v3
36
36
  with:
37
37
  category: '/language:${{ matrix.language }}'
@@ -9,7 +9,7 @@ permissions:
9
9
 
10
10
  jobs:
11
11
  ct:
12
- runs-on: ubuntu-20.04
12
+ runs-on: ubuntu-22.04
13
13
  steps:
14
14
  - name: Check out repository ✨ (non-dependabot)
15
15
  if: ${{ github.actor != 'dependabot[bot]' }}
@@ -38,7 +38,7 @@ jobs:
38
38
  cache: 'npm'
39
39
 
40
40
  - name: Install dependencies 🚀
41
- run: npm ci --prefer-offline --no-audit --omit=optional
41
+ run: npm ci --prefer-offline --no-audit
42
42
 
43
43
  - name: Pull test data 📦
44
44
  run: >-
@@ -16,7 +16,7 @@ on:
16
16
  jobs:
17
17
  release:
18
18
  name: 'Build, Test, Publish'
19
- runs-on: ubuntu-20.04
19
+ runs-on: ubuntu-22.04
20
20
  steps:
21
21
  - name: Check out repository ✨
22
22
  uses: actions/checkout@v4
@@ -38,7 +38,7 @@ jobs:
38
38
  cache: 'npm'
39
39
 
40
40
  - name: Install dependencies 🚀
41
- run: npm ci --prefer-offline --no-audit --omit=optional
41
+ run: npm ci --prefer-offline --no-audit
42
42
 
43
43
  - name: Pull test data 📦
44
44
  run: >-
package/Dockerfile CHANGED
@@ -1,4 +1,4 @@
1
- FROM ubuntu:focal
1
+ FROM ubuntu:jammy
2
2
 
3
3
  ENV \
4
4
  NODE_ENV="production" \
@@ -16,7 +16,7 @@ RUN set -ex; \
16
16
  gnupg; \
17
17
  mkdir -p /etc/apt/keyrings; \
18
18
  curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg; \
19
- echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list; \
19
+ echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list; \
20
20
  apt-get -qq update; \
21
21
  apt-get install -y nodejs; \
22
22
  npm i -g npm@latest; \
package/Dockerfile_test CHANGED
@@ -2,7 +2,7 @@
2
2
  # Simply run "docker build -f Dockerfile_test ."
3
3
  # WARNING: sometimes it fails with a core dumped exception
4
4
 
5
- FROM ubuntu:focal
5
+ FROM ubuntu:jammy
6
6
 
7
7
  ENV NODE_ENV="development"
8
8
 
@@ -19,7 +19,7 @@ RUN set -ex; \
19
19
  libglfw3-dev \
20
20
  libuv1-dev \
21
21
  libjpeg-turbo8 \
22
- libicu66 \
22
+ libicu70 \
23
23
  libcairo2-dev \
24
24
  libpango1.0-dev \
25
25
  libjpeg-dev \
package/README.md CHANGED
@@ -28,8 +28,8 @@ docker build -t tileserver-gl-light .
28
28
  [Download from OpenMapTiles.com](https://openmaptiles.com/downloads/planet/) or [create](https://github.com/openmaptiles/openmaptiles) your vector tile, and run following in directory contains your *.mbtiles.
29
29
 
30
30
  ```
31
- docker run --rm -it -v $(pwd):/data -p 8000:80 tileserver-gl-light
31
+ docker run --rm -it -v $(pwd):/data -p 8080:8080 tileserver-gl-light
32
32
  ```
33
33
 
34
34
  ## Documentation
35
- You can read full documentation of this project at https://tileserver.readthedocs.io/.
35
+ You can read full documentation of this project at https://maptiler-tileserver.readthedocs.io/
package/docs/config.rst CHANGED
@@ -132,6 +132,19 @@ If you have plenty of memory, try setting these equal to or slightly above your
132
132
  If you need to conserve memory, try lower values for scale factors that are less common.
133
133
  Default is ``[16, 8, 4]``.
134
134
 
135
+ ``pbfAlias``
136
+ ------------------------
137
+
138
+ Some CDNs did not handle .pbf extension as a static file correctly.
139
+ The default URLs (with .pbf) are always available, but an alternative can be set.
140
+ An example extension suffix would be ".pbf.pict".
141
+
142
+ ``serveAllFonts``
143
+ ------------------------
144
+
145
+ If this option is enabled, all the fonts from the ``paths.fonts`` will be served.
146
+ Otherwise only the fonts referenced by available styles will be served.
147
+
135
148
  ``serveAllStyles``
136
149
  ------------------------
137
150
 
@@ -139,10 +152,16 @@ If this option is enabled, all the styles from the ``paths.styles`` will be serv
139
152
  The process will also watch for changes in this directory and remove/add more styles dynamically.
140
153
  It is recommended to also use the ``serveAllFonts`` option when using this option.
141
154
 
155
+ ``serveStaticMaps``
156
+ ------------------------
157
+
158
+ If this option is enabled, all the static map endpoints will be served.
159
+ Default is ``true``.
160
+
142
161
  ``watermark``
143
162
  -----------
144
163
 
145
- Optional string to be rendered into the raster tiles (and static maps) as watermark (bottom-left corner).
164
+ Optional string to be rendered into the raster tiles and static maps as watermark (bottom-left corner).
146
165
  Not used by default.
147
166
 
148
167
  ``staticAttributionText``
@@ -52,14 +52,14 @@ Static images
52
52
 
53
53
  * can be provided multiple times
54
54
 
55
- * ``latlng`` - indicates coordinates are in ``lat,lng`` order rather than the usual ``lng,lat``
56
- * ``fill`` - color to use as the fill (e.g. ``red``, ``rgba(255,255,255,0.5)``, ``#0000ff``)
57
- * ``stroke`` - color of the path stroke
58
- * ``width`` - width of the stroke
59
- * ``linecap`` - rendering style for the start and end points of the path
60
- * ``linejoin`` - rendering style for overlapping segments of the path with differing directions
61
- * ``border`` - color of the optional border path stroke
62
- * ``borderwidth`` - width of the border stroke (default 10% of width)
55
+ * ``latlng`` - indicates coordinates are in ``lat,lng`` order rather than the usual ``lng,lat`` for paths and markers
56
+ * ``fill`` - default color to use as the fill (e.g. ``red``, ``rgba(255,255,255,0.5)``, ``#0000ff``) for all paths
57
+ * ``stroke`` - default color of the path stroke for all paths
58
+ * ``width`` - default width of the stroke for all paths
59
+ * ``linecap`` - rendering style for the start and end points of all paths - see https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineCap
60
+ * ``linejoin`` - rendering style for joining successive segments of all paths when the direction changes - see https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineJoin
61
+ * ``border`` - color of the optional border stroke for all paths ; the border is like a halo around the stroke
62
+ * ``borderwidth`` - width of the border stroke (default 10% of stroke width) for all paths
63
63
  * ``marker`` - Marker in format ``lng,lat|iconPath|option|option|...``
64
64
 
65
65
  * Will be rendered with the bottom center at the provided location
@@ -17,61 +17,48 @@ Additional options (see :doc:`/usage`) can be passed to the TileServer GL by app
17
17
  npm
18
18
  ===
19
19
 
20
- Just run ``npm install -g tileserver-gl``.
20
+ npm is supported on the following platforms with `Native Dependencies <#id1>`_ installed.
21
21
 
22
+ - Operating systems:
22
23
 
23
- Native dependencies
24
- -------------------
25
-
26
- There are some native dependencies that you need to make sure are installed if you plan to run the TileServer GL natively without docker.
27
- The precise package names you need to install may differ on various platforms.
28
-
29
- These are required on Debian 11:
30
- * ``libgles2-mesa``
31
- * ``libegl1``
32
- * ``xvfb``
33
- * ``xauth``
34
- * ``libopengl0``
35
- * ``libcurl4``
36
- * ``curl``
37
- * ``libuv1-dev``
38
- * ``libc6-dev``
39
- * ``http://archive.ubuntu.com/ubuntu/pool/main/libj/libjpeg-turbo/libjpeg-turbo8_2.0.3-0ubuntu1_amd64.deb``
40
- * ``http://archive.ubuntu.com/ubuntu/pool/main/i/icu/libicu66_66.1-2ubuntu2_amd64.deb``
41
-
42
- These are required on Ubuntu 20.04:
43
- * ``libcairo2-dev``
44
- * ``libjpeg8-dev``
45
- * ``libpango1.0-dev``
46
- * ``libgif-dev``
47
- * ``build-essential``
48
- * ``g++``
49
- * ``xvfb``
50
- * ``libgles2-mesa-dev``
51
- * ``libgbm-dev``
52
- * ``libxxf86vm-dev``
53
-
54
- ``tileserver-gl-light`` on npm
55
- ==============================
56
-
57
- Alternatively, you can use ``tileserver-gl-light`` package instead, which is pure javascript (does not have any native dependencies) and can run anywhere, but does not contain rasterization features.
24
+ - Ubuntu 22.04 (x64/arm64)
25
+ - macOS 12 (x64/arm64)
26
+ - Windows (x64)
58
27
 
28
+ - Node.js 18,20
29
+
30
+ Install globally from npmjs.
31
+ ------------------------------
32
+ ::
59
33
 
60
- From source
61
- ===========
34
+ npm install -g tileserver-gl
35
+ tileserver-gl
62
36
 
63
- Make sure you have Node v18 (nvm install 18) and run::
37
+ Install locally from source
38
+ -------------------
39
+ ::
64
40
 
41
+ git clone https://github.com/maptiler/tileserver-gl.git
42
+ cd tileserver-gl
65
43
  npm install
66
44
  node .
67
45
 
46
+ Native dependencies
47
+ -------------------
68
48
 
69
- On OSX
70
- ======
49
+ Ubuntu 22.04 (x64/arm64)
50
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
51
+ - apt install build-essential pkg-config xvfb libglfw3-dev libuv1-dev libjpeg-turbo8 libicu70 libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev gir1.2-rsvg-2.0 librsvg2-2 librsvg2-common libcurl4-openssl-dev libpixman-1-dev libpixman-1-0
71
52
 
72
- Make sure to have dependencies of canvas_ package installed::
53
+ MacOS 12 (x64/arm64)
54
+ ~~~~~~~~~~~~~~~~~~~~~~
55
+ - brew install pkg-config cairo libpng jpeg giflib
73
56
 
74
- brew install pkg-config cairo libpng jpeg giflib
57
+ Windows (x64)
58
+ ~~~~~~~~~~~~~~~~~~~~~~~~~
59
+ - `Microsoft Visual C++ 2015-2022 Redistributable <https://aka.ms/vs/17/release/vc_redist.x64.exe>`_
75
60
 
61
+ ``tileserver-gl-light`` on npm
62
+ ==============================
76
63
 
77
- .. _canvas: https://www.npmjs.com/package/canvas
64
+ Alternatively, you can use ``tileserver-gl-light`` package instead, which is pure javascript (does not have any native dependencies) and can run anywhere, but does not contain rasterization features.
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "tileserver-gl-light",
3
- "version": "4.6.6",
3
+ "version": "4.8.0",
4
4
  "description": "Map tile server for JSON GL styles - serving vector tiles",
5
5
  "main": "src/main.js",
6
6
  "bin": "src/main.js",
7
7
  "type": "module",
8
8
  "scripts": {
9
- "test": "mocha test/**.js --timeout 10000",
9
+ "test": "mocha test/**.js --timeout 10000 --exit",
10
10
  "lint:yml": "yamllint --schema=CORE_SCHEMA *.{yml,yaml}",
11
11
  "lint:js": "npm run lint:eslint && npm run lint:prettier",
12
12
  "lint:js:fix": "npm run lint:eslint:fix && npm run lint:prettier:fix",
@@ -14,7 +14,7 @@
14
14
  "lint:eslint:fix": "eslint --fix \"{,!(node_modules|dist|static|public)/**/}*.{js,ts,cjs,mjs}\" --ignore-path .gitignore",
15
15
  "lint:prettier": "prettier --check \"{,!(node_modules|dist|static|public)/**/}*.{js,ts,cjs,mjs,json}\" --ignore-path .gitignore",
16
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 .)"
17
+ "docker": "docker build . && docker run --rm -i -p 8080:8080 $(docker build -q .)"
18
18
  },
19
19
  "dependencies": {
20
20
  "@mapbox/glyph-pbf-composite": "0.0.3",
@@ -23,9 +23,9 @@
23
23
  "@mapbox/sphericalmercator": "1.2.0",
24
24
  "@mapbox/vector-tile": "1.3.1",
25
25
  "@maplibre/maplibre-gl-style-spec": "18.0.0",
26
- "@sindresorhus/fnv1a": "3.0.0",
26
+ "@sindresorhus/fnv1a": "3.1.0",
27
27
  "advanced-pool": "0.3.3",
28
- "axios": "^1.6.1",
28
+ "axios": "^1.6.5",
29
29
  "chokidar": "3.5.3",
30
30
  "clone": "2.1.2",
31
31
  "color": "4.2.3",
@@ -37,7 +37,7 @@
37
37
  "morgan": "1.10.0",
38
38
  "pbf": "3.2.1",
39
39
  "pmtiles": "2.11.0",
40
- "proj4": "2.9.2",
40
+ "proj4": "2.10.0",
41
41
  "sanitize-filename": "1.6.3",
42
42
  "tileserver-gl-styles": "2.0.0"
43
43
  },
@@ -60,6 +60,11 @@
60
60
  padding: 0;
61
61
  }
62
62
 
63
+ .leaflet-container img.leaflet-tile {
64
+ /* See: https://bugs.chromium.org/p/chromium/issues/detail?id=600120 */
65
+ mix-blend-mode: plus-lighter;
66
+ }
67
+
63
68
  .leaflet-container.leaflet-touch-zoom {
64
69
  -ms-touch-action: pan-x pan-y;
65
70
  touch-action: pan-x pan-y;
@@ -646,7 +651,7 @@ svg.leaflet-image-layer.leaflet-interactive path {
646
651
  }
647
652
 
648
653
  /* Printing */
649
-
654
+
650
655
  @media print {
651
656
  /* Prevent printers from removing background-images of controls. */
652
657
  .leaflet-control {