Commit graph

133 commits

Author SHA1 Message Date
Andrew Calcutt
a106fec3fc fix: get data sources specified in style to work
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
2023-10-14 20:33:42 -04:00
Andrew Calcutt
446038e216 Merge remote-tracking branch 'upstream/master' into pmtiles
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
2023-10-13 20:44:22 -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
Andrew Calcutt
4b05f36fcc fix: simplify source to data mapping
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
2023-10-13 13:57:44 -04:00
Andrew Calcutt
759e51fe05 fix: remove PMtilesClose
I'm not sure this is really needed

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
2023-10-13 11:01:16 -04:00
Andrew Calcutt
a24a48bd1e fix: try to support pmtiles with fromdata set
I'm not sure how this is supposed to be used, but i don't want it to only be allowed in mbtiles

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
2023-10-13 01:01:59 -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
Andrew Calcutt
68168ce7b6 fix: lint
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
2023-10-12 01:05:27 -04:00
Andrew Calcutt
e66360c469 fix: cannot access source
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
2023-10-12 00:50:26 -04:00
Andrew Calcutt
9f79c25232 fix: constant code ql error
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
2023-10-12 00:44:24 -04:00
Andrew Calcutt
a5cc66729d refactor: only pass back metadata
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
2023-10-12 00:26:39 -04:00
Andrew Calcutt
36cc712b9a fix: rendering failing due to wrong name
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
2023-10-11 21:36:17 -04:00
Andrew Calcutt
3691975d88 fix: make it so pmtiles:// can be used in styles
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
2023-10-11 16:51:35 -04:00
Andrew Calcutt
fde9ed96a5 feat: allow web https based pmtiles to be loaded
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
2023-10-11 13:18:03 -04:00
Andrew Calcutt
3f45c38663 fix: lint
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
2023-10-11 13:18:03 -04:00
Andrew Calcutt
f13d6e52d9 refactor: rework so remote pmtiles may be possible
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
2023-10-11 13:18:01 -04:00
Andrew Calcutt
e9459b9cd2 fix: put back linux ordering
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
2023-10-11 13:18:01 -04:00
Andrew Calcutt
0b99d8ddd1 feat: allow 'pmtiles:' in configs. open file less
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
2023-10-11 13:18:00 -04:00
Andrew Calcutt
0c19728cc2 fix: don't unzip data, it is already done
the pmtiles getZxy function already decompresses the file

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
2023-10-11 13:17:59 -04:00
Andrew Calcutt
08b3a943a6 fix: lint
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
2023-10-11 13:17:57 -04:00
Andrew Calcutt
371e757e5b fix: add missing semicolon
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
2023-10-11 13:17:57 -04:00
Andrew Calcutt
9cebc4459c fix: remove unused variables
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
2023-10-11 13:17:56 -04:00
Andrew Calcutt
93d91b35b9 fix: put back default windows support
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
2023-10-11 13:17:55 -04:00
Andrew Calcutt
85290024a9 feat: get maplibre-native to render a png tile
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
2023-10-11 13:17:54 -04:00
Andrew Calcutt
07b0f8b306 fix: put back linux order of sharp and canvas
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
2023-10-11 13:17:54 -04:00
Andrew Calcutt
4772f0efdc feat: move pmtiles to it's own file
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
2023-10-11 13:17:53 -04:00
Andrew Calcutt
ca51104ece feat: get vector tiles to serve
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
2023-10-11 13:17:53 -04:00
Andrew Calcutt
f7582ba822 feat: move bounds, center, minzoom, maxzoom
move into metadata

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
2023-10-11 13:17:52 -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
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
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
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
Andrew Calcutt
212af8145c
fix canvas import (#631) 2022-10-28 19:04:20 -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
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
Nathan Gass
edd36dd251
Open mbtiles in readonly mode (#506) 2022-09-24 12:17:35 -04:00
Frank
161ac5ff84
Fix rendering with tileMargin on top and bottom border of map (#571)
Co-authored-by: Frank Stolle <f.stolle@hosting-agency.de>
2022-09-22 23:22:06 -04:00
acalcutt
8584a117fe change to single quotes 2022-09-21 10:31:57 -04:00
acalcutt
c1e9dc76ea more static respondImage 2022-09-20 23:33:51 -04:00
acalcutt
80d3699383 try to make a separate static renderer pool 2022-09-20 23:12:01 -04:00
acalcutt
72fdf84292 Change to use maplibre-native and maplibre-gl-style-spec 2022-09-14 17:33:02 -04:00
bheupers
4036d528ec
Render up to scale level 22
For detailed city rendering we need to render rasterfiles up to and including level 21. Therefore I propose to change the maximum raster level to 22
2020-11-04 14:42:46 +01:00
Petr Sloup
5585f49396
Update serve_rendered.js
Fix accidentally removed #414
2020-04-07 10:29:19 +02:00