Commit Graph

36 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
Petr Sloup
aa933e5154 Fix tests 2020-01-08 15:18:51 +01:00
Alban Mouton
c99a1a5425 Merge remote-tracking branch 'klokantech/master' into public_url
# Conflicts:
#	src/main.js
#	src/server.js
2018-12-19 09:53:40 +01:00
Petr Sloup
bc3d79bfdc Update dependencies 2018-09-14 08:14:28 +02:00
Masud Zare
72ea5ab05d fix corresponding test scenario 2018-05-07 15:58:32 +04:30
Alban Mouton
875521c5a8 add public_url option 2017-10-18 13:51:37 +02:00
Petr Sloup
698c527e94 Change endpoint URLs (close #154)
- styles at /style/{id}/style.json
- rendered tiles at /style/{id}/{z}/{x}/{y}.{format}
- TileJSONs at /style/{id}.json
2017-06-22 16:37:32 +02:00
Petr Sloup
5d93b1d4f9 Add healthcheck endpoint (close #140) 2017-05-10 08:57:51 +02:00
Petr Sloup
d30027e992 Modify all serve_* modules to return a Promise (preparation for #140) 2017-05-10 08:56:43 +02:00
Petr Sloup
f8949c1aa9 Configurable scale factors (close #121)
Also changes default maximum from `4x` to `3x`
2017-03-15 12:09:18 +01:00
Petr Sloup
2d29a21596 Do not add basename to tilejson and remove sensitive properties (see #69) 2016-12-20 13:55:36 +01:00
Petr Sloup
1c401f41a2 Update tests and links to use the new data 2016-12-15 10:51:18 +01:00
Petr Sloup
23c2aa54d0 Update tests 2016-08-25 11:09:01 +02:00
Petr Sloup
b4d6490e00 Large refactoring of usage (only mbtiles, default styles, ...) (#27) 2016-08-20 13:31:11 +02:00
Petr Sloup
fb758be730 Update tests to use v0.8 dataset 2016-07-27 12:32:53 +08:00
Petr Sloup
a0fbf7fb79 Fix font compositing (close #32) 2016-07-26 18:56:32 +07:00
Petr Sloup
575c1df524 Add tests for autofit static endpoints 2016-06-27 08:11:02 +02:00
Petr Sloup
d8f35bb70a Update area-based static tests 2016-06-27 08:01:28 +02:00
Petr Sloup
59cc66095f Minor test update 2016-05-04 13:57:00 +02:00
Petr Sloup
54073cecce Simplify URL for "static"
/styles/{id}/rendered/static/... -> /styles/{id}/static/...
2016-04-22 15:50:56 +02:00
Petr Sloup
a25ce62662 New urls for source data tiles and rendered tiles 2016-04-22 12:33:20 +02:00
Petr Sloup
c0fb4fd400 Support for raster mbtiles (issue #13) 2016-04-21 18:23:13 +02:00
Petr Sloup
074c873826 Support optional bearing and pitch in center-based static requests 2016-03-11 12:10:22 +01:00
Petr Sloup
1c73c14d84 Update and add tests 2016-03-11 11:27:17 +01:00
Petr Sloup
6f644a4c03 Serve TileJSONs on /{prefix}.json 2016-03-09 19:18:59 +01:00
Petr Sloup
9efa22b52b Add more tests + better structuring 2016-03-09 17:26:34 +01:00
Petr Sloup
d6e17c1a3a More tests for the endpoints 2016-03-09 13:22:06 +01:00
Petr Sloup
832b2d22be Do not invoke done in test setup 2016-03-09 12:34:16 +01:00
Petr Sloup
77755b548b Add first batch of tests 2016-03-09 11:26:02 +01:00