Commit Graph

278 Commits

Author SHA1 Message Date
v-electrolux
6742c7f45d
feat: add support for X-Forwarded-Path in style urls (#1239)
* add support for X-Forwarded-Path for styles too

* fix linting issue
2024-05-03 10:57:08 -04:00
Lukomo
bff699ba4a
feat: handle the X-Forwarded-Path header (#1197)
* feat: handle the X-Forwarded-Path header

* fix: lint

Signed-off-by: acalcutt <acalcutt@techidiots.net>

---------

Signed-off-by: acalcutt <acalcutt@techidiots.net>
Co-authored-by: Zsolt Jakubinyi <zsolt.jakubinyi@beamtrail.com>
Co-authored-by: acalcutt <acalcutt@techidiots.net>
2024-04-23 15:55:39 -04:00
Andrew Calcutt
66445e8653
Add support for multi-sprites in styles (#1232)
* fix: allow sprite array in styles

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* fix: add 'sprite/' to generated path

So it doesn't conflict with style json url

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* fix: allow old sprite endpoints to work

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* fix: lint

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* docs:  add multi-sprite name to endpoint

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* fix: duplicate styleJSON.sprite

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* fix: try to fix some codeql errors

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* fix: try to fix some codeql errors

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* fix: try to fix some codeql errors

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* fix: try to fix some codeql errors

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* fix: try to fix some codeql errors

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* fix: lint

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* fix: ci sprite issue

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* fix: remove console.log's

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* fix: use sprite id instead of name

Signed-off-by: acalcutt <acalcutt@techidiots.net>

* fix: add suggestions

Signed-off-by: acalcutt <acalcutt@techidiots.net>

* fix: remove unneeded array check

Signed-off-by: acalcutt <acalcutt@techidiots.net>

* fix: lint

Signed-off-by: acalcutt <acalcutt@techidiots.net>

* fix: don't force multi-sprites in style

Signed-off-by: acalcutt <acalcutt@techidiots.net>

* fix: move fixUrl and allowedOptions to utils

Signed-off-by: acalcutt <acalcutt@techidiots.net>

* fix: add test for default sprite

Signed-off-by: acalcutt <acalcutt@techidiots.net>

* fix: lint

Signed-off-by: acalcutt <acalcutt@techidiots.net>

---------

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
Signed-off-by: acalcutt <acalcutt@techidiots.net>
2024-04-23 14:51:37 -04:00
Jollyfant
87e5b72ca4
Fix exception in pmtiles format when GeoJSON is requested (#1188) 2024-02-26 12:34:13 -05:00
Andrew Calcutt
0fb5af61f6
fix: make consistent with tilejson endpoint (#1162) 2024-02-02 23:02:39 -05:00
dependabot[bot]
300925d432
fix(deps): Bump pmtiles from 2.11.0 to 3.0.0 (#1161)
* fix(deps): Bump pmtiles from 2.11.0 to 3.0.0

Bumps [pmtiles](https://github.com/protomaps/pmtiles) from 2.11.0 to 3.0.0.
- [Commits](https://github.com/protomaps/pmtiles/commits)

---
updated-dependencies:
- dependency-name: pmtiles
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix: update for named imports

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Andrew Calcutt <acalcutt@techidiots.net>
2024-02-02 22:12:26 -05:00
Andrew Calcutt
fe111ed18f
Fix incorrect TileSize in index.json and data.json data urls. Add TileSize option to index.json and rendered.json endpoints for rendered urls. (#1160)
* fix: tilesize should not be added to data endpoint

* fix: make tilesize and option of addtilejson urls

* docs: update tilesize info for index.json and rendered.json

* fix: lint
2024-02-02 10:37:35 -05:00
Andrew Calcutt
4a999e06a3
Fix 512px tiles so they work with maplibre-js raster 512 tilesize (#1152)
* fix: try to add attribution to wmts

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* fix: 512 tiles being wrong level for maplibre-js

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* fix: revert wmts zoom level hack

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* fix: test tileMargin

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* fix: remove broken mercator_512 change

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* fix: put back mercator

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* Revert "fix: try to add attribution to wmts"

This reverts commit b8d858f2c6d6354ea54a7fe18d08bb50d8f28219.

* fix: put back if

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* fix: semicolon

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* fix: semicolon

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* fix: lint

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* fix: center without mercator_512

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* fix: put back const

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* fix: lint

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* fix: text

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

---------

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
2024-01-29 20:54:05 -05:00
Andrew Calcutt
d68ab38442
Add support for 512 sized raster tiles - v2 (#1136)
* test: using 512px rendered tiles

Based on https://github.com/maptiler/tileserver-gl/pull/495

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* fix: use static renderer at zoom 0

renderer is not able to change the size of tile to more than 512px in tile mode

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* Add support for 512 sized raster tiles (#1)

* Enable setting tilesize for raster tiles

* Serve correct endpoint for raster tiles

* Add 256 & 512 sized raster layers to wmts getCapabilities document

* Update wmts getCapabilities tileMatrixSets

* Add rendered tiles format for getTileUrls method

* Update endpoints documentation

* Add and fix tiles_rendered tests

* fix: formatting

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* fix: corrent bad merge

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* fix: if tile size is undefined don't add it

needed for data endpoint right now

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* fix: set tile size in raster endpoints to 512

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* fix: add semicolon

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* fix: lint

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* fix: test z1 512px file that actually exists

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* fix: make tileSize optional

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* fix: cleaner if statement

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* docs: update tileSize to show as optional

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* fix: allow tile size in data url

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* fix: remove unneeded tileSize

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* fix: set data as 256 tileSize for consistency

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* docs: add note about optional data tileSize

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* fix: lint

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* Revert "fix: remove unneeded tileSize"

This reverts commit a4583161bf53653d65a4606c407ba9b5249d1061.

* fix: allow tile size to be set at json endpoints

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* fix: set default endpoint tilesizes

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* fix: don't use tilesize one data endpoint

It doesn't do anything

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* fix: default style endpoint to undefined

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* fix: zoom 0 workaround

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* Revert "fix: zoom 0 workaround"

This reverts commit 0f3bbd765c9c151016cec66768675f990676c8b3.

* fix: limit min zoom to 1 in viewer

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* fix: put back orig string

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* docs: add optional tilesize to TileJSON

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* fix: cleanup thumbnails

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* fix: default undefined like other data endpoints

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* fix: move data xyz_link

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* fix: remove console.log

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* fix: lint

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* chore: update version

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* fix: update path

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* fix: join error

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* fix: revert path change

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

---------

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
Co-authored-by: Petteri Pesonen <teemu.p.pesonen@gmail.com>
2024-01-25 21:23:07 -05:00
dependabot[bot]
3533918715
fix(deps): bump @maplibre/maplibre-gl-style-spec from 18.0.0 to 20.1.0 (#1125)
* fix(deps): bump @maplibre/maplibre-gl-style-spec from 18.0.0 to 20.1.0

Bumps [@maplibre/maplibre-gl-style-spec](https://github.com/maplibre/maplibre-gl-style-spec) from 18.0.0 to 20.1.0.
- [Release notes](https://github.com/maplibre/maplibre-gl-style-spec/releases)
- [Changelog](https://github.com/maplibre/maplibre-style-spec/blob/main/CHANGELOG.md)
- [Commits](https://github.com/maplibre/maplibre-gl-style-spec/compare/v18.0.0...v20.1.0)

---
updated-dependencies:
- dependency-name: "@maplibre/maplibre-gl-style-spec"
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix: refactor to use validateStyleMin

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Andrew Calcutt <acalcutt@techidiots.net>
2024-01-21 17:32:59 -05:00
Andrew Calcutt
ee602acc4c
Merge branch 'master' into refactor4 2023-11-25 21:01:33 -05:00
Martin d'Allens
407f6b2e30
Fix crash on ARM during rendering (#1077)
* chore: fix crash on ARM during rendering

Signed-off-by: Martin d'Allens <martin.dallens@liberty-rider.com>

* chore: remove useless comment

Signed-off-by: Martin d'Allens <martin.dallens@liberty-rider.com>

---------

Signed-off-by: Martin d'Allens <martin.dallens@liberty-rider.com>
2023-11-25 20:16:33 -05:00
Martin d'Allens
c9aa26a6de
fix: listFonts was broken, missing fonts could not fallback (#1076)
Promise code never worked: listFonts did not wait for fs.stat() to resolve().
This was not evident because late results were still used.

A recent PR made it worse: late results are now ignored.
This manifested for styles with missing fonts, no fallback could be used.

Signed-off-by: Martin d'Allens <martin.dallens@liberty-rider.com>
2023-11-24 11:48:50 -05:00
Martin d'Allens
b25a6420dd
chore: simplify alpha premultiplication, now supported by sharp (#1073)
Maplibre-native outputs premultiplied pixels values. The sharp library did not
support it so we added code to cancel the alpha premultiplication.
Note that this can only visible onr raster tiles (and probably static maps).

The sharp library now supports premultiplied pixels with the right config.
Let's use it: it should be faster and easie to maintain.

Feature announced here:
https://github.com/lovell/sharp/issues/1599#issuecomment-837004081

Feature developped here by @mnutt:
https://github.com/lovell/sharp/pull/2685

Signed-off-by: Martin d'Allens <martin.dallens@liberty-rider.com>
2023-11-23 12:16:31 -05:00
Martin d'Allens
36d3e9d356 chore: apply camelCase to function and variable names
Signed-off-by: Martin d'Allens <martin.dallens@liberty-rider.com>
2023-11-23 17:08:32 +01:00
Martin d'Allens
9a4ef3dedf chore: remove unused opt_nokey arg
Signed-off-by: Martin d'Allens <martin.dallens@liberty-rider.com>
2023-11-23 17:08:32 +01:00
Martin d'Allens
f69a2339b8 chore: remove duplicated field names to simplify code
Signed-off-by: Martin d'Allens <martin.dallens@liberty-rider.com>
2023-11-23 17:08:32 +01:00
Martin d'Allens
d9c2128ddf chore: compact arguments for renderOverlay and respondImage
Signed-off-by: Martin d'Allens <martin.dallens@liberty-rider.com>
2023-11-23 17:08:32 +01:00
Martin d'Allens
345b831edd chore: convert some promises to async/await
Signed-off-by: Martin d'Allens <martin.dallens@liberty-rider.com>
2023-11-23 17:08:32 +01:00
Martin d'Allens
526766c8f4
Extract nested functions and simplify a little (#1062)
* chore: make sure error exit codes of tests are returned

Signed-off-by: Martin d'Allens <martin.dallens@liberty-rider.com>

* chore: replace the last 'var' with 'const'

Signed-off-by: Martin d'Allens <martin.dallens@liberty-rider.com>

* chore: extract duplicated font listing

Signed-off-by: Martin d'Allens <martin.dallens@liberty-rider.com>

* chore: extract rendering functions to a new file

Signed-off-by: Martin d'Allens <martin.dallens@liberty-rider.com>

* chore: move nested respondImage() function to top level

Signed-off-by: Martin d'Allens <martin.dallens@liberty-rider.com>

* chore: simplify respondImage() args

Signed-off-by: Martin d'Allens <martin.dallens@liberty-rider.com>

* chore: fix typo in rendeAttribution

Signed-off-by: Martin d'Allens <martin.dallens@liberty-rider.com>

---------

Signed-off-by: Martin d'Allens <martin.dallens@liberty-rider.com>
2023-11-23 10:11:53 -05:00
Martin d'Allens
d7af5235bf
fix: clean error message, remove outdated data wmts (#1067)
Signed-off-by: Martin d'Allens <martin.dallens@liberty-rider.com>
2023-11-21 16:23:53 -05:00
dependabot[bot]
36f9320d50
chore(deps-dev): bump @typescript-eslint/eslint-plugin from 5.61.0 to 6.11.0 (#1052)
* chore(deps-dev): bump @typescript-eslint/eslint-plugin

Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 5.61.0 to 6.11.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.11.0/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix: warn for no-unused-vars,add argsIgnorePattern

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Andrew Calcutt <acalcutt@techidiots.net>
2023-11-15 21:31:28 -05:00
Andrew Calcutt
36f63de686
Replace request with axios (#1043)
* updating to replace request with axios

* swap request with axios in main.js

* fix: update text

Signed-off-by: acalcutt <acalcutt@techidiots.net>

* fix: update package-lock

Signed-off-by: acalcutt <acalcutt@techidiots.net>

* fix: update function name

Signed-off-by: acalcutt <acalcutt@techidiots.net>

* fix: lint

Signed-off-by: acalcutt <acalcutt@techidiots.net>

* fix: update axios

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

---------

Signed-off-by: acalcutt <acalcutt@techidiots.net>
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
Co-authored-by: Michael Jones <michaeljones@Michaels-MacBook-Pro.local>
Co-authored-by: jonesmj8537 <michael.j.jones.ctr@nga.mil>
2023-11-14 15:39:49 -05:00
Alek Kowalczyk
4568027046
Fixed Issue #1025 - URL-based glyphs and fonts break displaying of vector tiles (#1026)
Root cause: modified regex in #1002 caused URLs to be broken.
Fixed by reverting previous regexes.

Tests:
 * Confirmed by building and running locally with formerly breaking config.json and style json.
 * Run tests via Dockerfile_test
2023-10-20 14:02:45 -04:00
Ryan
c161667e0e
Ensure ID is maintained over deconstructing object (#1023) 2023-10-18 12:33:15 -04:00
Andrew Calcutt
a6dadfda28
Add pmtiles support (#1009)
Adds pmtiles support to TileServer-GL

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
Signed-off-by: Michael Nutt <michael@nuttnet.net>
Co-authored-by: Michael Nutt <michael@nuttnet.net>
2023-10-15 03:03:15 -04:00
Martin d'Allens
e8f64e2861
chore: cleanup useless decodeURIComponent() calls (#1002)
* chore: cleanup useless decodeURIComponent() calls

Signed-off-by: Martin d'Allens <martin.dallens@liberty-rider.com>

* chore: try to fix CodeQL failure "Polynomial regular expression"

Fix 1:
\d\.?\d* can backtrack catastrophically
\d(\.\d*)? is safer

Fix 2:
Useless parenthesis around "enc:"

Fix 3:
The httpTester regex was misleading. It did not really check for "http".
Simplified to show its true meaning. The behaviour should not have changed.

Signed-off-by: Martin d'Allens <martin.dallens@liberty-rider.com>

* chore: try to optimize the regex further, to fix CodeQL failure

Signed-off-by: Martin d'Allens <martin.dallens@liberty-rider.com>

* chore: consistency between previous changes, docs, and serve_style.js

Signed-off-by: Martin d'Allens <martin.dallens@liberty-rider.com>

---------

Signed-off-by: Martin d'Allens <martin.dallens@liberty-rider.com>
2023-10-13 19:08:28 -04:00
Boon Boonsiri
9348350ba3
Allow base 64 url as images for static maps (#1007)
* allow base-64 url as images

* Add option to config

* Refactoring

* Update docs

* feat: added base64 url images lint

Signed-off-by: Boon Boonsiri <bboonsir@uwaterloo.ca>

---------

Signed-off-by: Boon Boonsiri <bboonsir@uwaterloo.ca>
2023-10-12 01:22:51 -04:00
Craig Kochis
d4a5cc6074
Add support for stylized attribution text for static images (#1005)
* add support for stylized attribution text for static images

* restrict to static opt_mode

* adjust sizes

* chore: fix lint

Signed-off-by: Craig Kochis <cjkochis@gmail.com>

* chore: rename to staticAttributionText

Signed-off-by: Craig Kochis <cjkochis@gmail.com>

* chore: update docs

Signed-off-by: Craig Kochis <cjkochis@gmail.com>

* chore: add staticAttributionText to example config, and run lint

Signed-off-by: Craig Kochis <cjkochis@gmail.com>

---------

Signed-off-by: Craig Kochis <cjkochis@gmail.com>
2023-10-07 20:30:47 -04:00
Andrew Calcutt
7e246d0cd1 fix: lint
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
2023-09-27 00:16:54 -04:00
Robin
d759dd2952
fix: incorrect polyline decoding (#993)
* fix: incorrect polyline decoding
Don't split static image encoded path on pipe or comma

Signed-off-by: boldtrn <boldtrn@gmail.com>

* fix: still allow other parameters other than enc:
That way we can still style individual paths

Signed-off-by: boldtrn <boldtrn@gmail.com>

* chore: lint

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* chore: lint + comment

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* docs: try to clarify path information

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* fix: stroke color not working unless path is specified

i found this issue testing encoded paths. If width is not specifed, stroke color does not work

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* docs: show different options

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

---------

Signed-off-by: boldtrn <boldtrn@gmail.com>
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
Co-authored-by: Andrew Calcutt <acalcutt@techidiots.net>
2023-09-26 23:53:16 -04:00
Robin
c13e5e6821
fix: don't crash the server on processing issues (#994)
* fix: don't crash the server on processing issues
Use a try/catch for async functions

Signed-off-by: boldtrn <boldtrn@gmail.com>

* chore: run lint

Signed-off-by: boldtrn <boldtrn@gmail.com>

---------

Signed-off-by: boldtrn <boldtrn@gmail.com>
2023-09-26 09:41:29 -04:00
Samuel
02ee629f30
Static images: Allow styling each path differently (#972)
* fix: allow to style each individual path for static images

Signed-off-by: Samuel Leihkamm <s.leihkamm@gmx.com>

* chore: cleanup drawPath render function

Signed-off-by: Samuel Leihkamm <s.leihkamm@gmx.com>

---------

Signed-off-by: Samuel Leihkamm <s.leihkamm@gmx.com>
2023-09-21 22:55:54 -04:00
fvarga94
13eeeaffad
Resolve composite watermark issue (#908) 2023-06-30 12:58:21 -04:00
Nathan Gass
89c6eb7ddf
Use center and zoom from style json (#507)
* Use center and zoom from style json as default center for tilejson of rendered maps

* Round zoom as style spec allows fractional zooms while tilejson spec does not
2023-03-28 08:46:50 -04:00
zstadler
64adff0855
Handle SIGTERM (#782)
* Handle SIGTERM

Resolve #781

* Add `Caught signal ...` messages

Container log when sending a `SIGHUP` signal and then a `SIGTERM` signal using
`docker kill --signal ...` :

```
Starting tileserver-gl v4.4.8
[INFO] Automatically creating config file for zurich_switzerland.mbtiles
[INFO] Only a basic preview style will be used.
[INFO] See documentation to learn how to create config.json file.
Run with --verbose to see the config file here.
Starting server
Listening at http://[::]:8080/
Startup complete
Caught signal SIGHUP, refreshing
Stopping server and reloading config
Starting server
Listening at http://[::]:8080/
Startup complete
Caught signal SIGTERM, stopping gracefully
```

Note that the numeric signal values, as used in the shell version, were
replaced by signal names, as used in nodeJS.

* run 'npm run lint:js:fix'

---------

Co-authored-by: acalcutt <acalcutt@techidiots.net>
2023-03-01 10:05:21 -05:00
Manuel Roth
ea186d34df
fix: support for X-Forwarded-Host http header (#733)
* fix: fix support for overriding hostname by setting X-Forwarded-Host http header

Signed-off-by: Manuel Roth <manuelroth@hotmail.ch>

* fix: improve getUrlObject

Signed-off-by: Manuel Roth <manuelroth@hotmail.ch>

* Add documentation for getUrlObject function

Co-authored-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>

* Simplify getPublicUrl function

Co-authored-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>

* Remove variable

Co-authored-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>

* Use urlObject directly

Co-authored-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>

* fix: small fix

Signed-off-by: Manuel Roth <manuelroth@hotmail.ch>

---------

Signed-off-by: Manuel Roth <manuelroth@hotmail.ch>
Co-authored-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>
2023-01-31 20:35:16 -05:00
Daniel Kao
f94625ab05
fix: fix vectortile constructor (#723)
Signed-off-by: Daniel Kao <dkao@diplateevo.com>

Signed-off-by: Daniel Kao <dkao@diplateevo.com>
2023-01-20 17:41:18 -05:00
Vinayak Kulkarni
bb0cd60e64
feat: enable Google Polyline in Static Images endpoint 🕺 (#648)
* docs: update `encodedpath` documentation

Co-Authored-By: Niklas Hösl <nik.hoesl@hotmail.com>
Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>

* feat: enable `encodedpath` in query to load encoded polyline

Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>

* refactor!: update static map endpoint `path`

Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>

* chore: remove `console.log()`

Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>

* docs: remove `encodedpath` arg

Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>

* revert: docs update

Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>

* chore(deps): add `@mapbox/polyline` dep

Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>

* chore(deps): add `@mapbox/polyline` dep

Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>

* fix: enable default `stroke`

Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>

* docs: update documentation

Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>

* test: decode URI component

Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>

* fix: drawPath method

Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>

* fix: safely decode URI Component

Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>

* fix: enable multiple paths while extracting them from query

Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>

* fix: lockfile conflict

Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>

Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>
Co-authored-by: Niklas Hösl <nik.hoesl@hotmail.com>
2023-01-12 15:48:43 -05:00
Andrew Calcutt
138ac04676
allow tileMargin option (#694)
* allow tileMargin option

tile mode does not support more than one tile in maplibre-native, so tileMargin needs static mode to work.

* add space
2023-01-05 14:13:26 -05:00
Michael Nutt
a7af45ee3f
fix: Ensure font serving does not reflect userdata-derived errors as HTML (#647)
* fix: ensure font serving does not reflect userdata-derived errors as HTML

Signed-off-by: Michael Nutt <michael@nuttnet.net>
2022-11-24 11:07:11 -05:00
Andrew Calcutt
c134795b81
change docker to use port 8080 by default (#638)
* change docker to use default 8080 port
2022-11-20 23:00:41 -05:00
Vinayak Kulkarni
9b64093c42
style: fix lint issues in code 🕺 (#626)
* style: fix lint issues in code 🕺

Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>

* style: lint fix all files

Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>

* chore: add `keywords` for better reach

Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>

* feat: add `husky` & `commitlint`

Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>

* chore: ignore `public` directory

Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>

* revert: do not lint `public` directory

Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>

* style: fix issues with lint

Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>

* feat: add eslint config

Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>

* feat: add lint-staged

Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>

* style: lint fix all file(s)

Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>

* fix: ignore rules for light version

Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>

* fix: remove unnecessary space

Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>

* chore(deps): update lockfile

Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>

* style: autofix linting issue(s)

Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>

Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>
2022-11-08 22:56:07 -05:00
zstadler
50201f0a99
Add Docker Healthcheck (#636)
* Add Docker Healthcheck

Fixes #635

* Update Dockerfile_light

* Update healthcheck.js

fix healthcheck output error: "file:///usr/src/app/src/healthcheck.js:1\nvar http = require(\"http\");\n           ^\n\nReferenceError: require is not defined in ES module scope, you can use import instead\nThis file is being treated as an ES module because it has a '.js' file extension and '/usr/src/app/package.json' contains \"type\": \"module\". To treat it as a CommonJS script, rename it to use the '.cjs' file extension.\n    at file:///usr/src/app/src/healthcheck.js:1:12\n    at ModuleJob.run (node:internal/modules/esm/module_job:193:25)\n    at async Promise.all (index 0)\n    at async ESMLoader.import (node:internal/modules/esm/loader:526:24)\n    at async loadESM (node:internal/process/esm_loader:91:5)\n    at async handleMainPromise (node:internal/modules/run_main:65:12)\n"

* update version

Co-authored-by: acalcutt <acalcutt@techidiots.net>
2022-11-06 21:30:55 -05:00
Andrew Calcutt
212af8145c
fix canvas import (#631) 2022-10-28 19:04:20 -04:00
Andrew Calcutt
b6e2d101eb
Fix HUP kill not reloading config (#630)
* try to fix HUP config reset
* remove..outdated?.. require.cache
2022-10-28 11:53:21 -04:00
benedikt-brandtner-bikemap
f3f63498a8
Extended Static-Images Endpoint (#619)
* extended staticmap capabilities

* added allowRemoteMarkerIcons configuration option and restricted fetching of remote marker icons only when option is set to true;
asynchronously load all available icons in a settings object on server startup;
replaced fs.existsSync() call in serve_rendered when drawing marker icons with a check against available icons settings object;

* updated documentation for linecap parameter in staticmaps endpoint;
added linejoin parameter to staticmaps endpoint;

* added capability of staticmap endpoint to draw multiple paths
2022-10-27 22:55:46 -04:00
Monstrofil
38604c0a45
Bugfix: publicUrl is not used in some urls (#605)
In WMTS the publicUrl path was missed and it was not working properly.
Similar story about wmts.tmpl: the baseUrl is not working properly when
tileserver is hidden behind the proxy with different root path.

* Minor bugfix: make baseUrl always use '/' in the end

Co-authored-by: Oleksandr Shyshatskyi <oshyshatskyi@cloudlinux.com>
Co-authored-by: acalcutt <acalcutt@techidiots.net>
2022-09-30 09:18:13 -04:00
Andrew Calcutt
b2bd5eaa96
Convert to esm module syntax (#606)
* switch to esm module

* Update package.json

* change to maplibre package

* fix tests

* eslint

* remove extra package updates

* Delete package-lock.json

* change 'fs' to 'node:fs'

* put back node 10.

without the package updates this still works

* remove trailing commas

* remove unassociated fix / formatting

* remove unassociated fix

* remove eslint from this PR

* remove unassociated fix

* lint

* Merge remote-tracking branch 'upstream/master' into esm_update

* fix mlgl

* update maplibre-native to new version with arm64

* update minor version
2022-09-28 14:41:55 -04:00
Michael Nutt
7cfcc413c4
don't include duplicate attributions (#613) 2022-09-24 16:36:39 -04:00