Closed alex-kowalczyk closed 1 year ago
have you tried if v4.6.1 fixes it?
I just tested your style and it looks like it is the same in 4.6.1 . I didn't change anything specific to glyphs and sprites, so I will have to try and track it down.
@acalcutt thanks for your response. Looking at the changelog, this 4.5.2 change might be related: "chore: cleanup useless decodeURIComponent() calls" https://github.com/maptiler/tileserver-gl/pull/1002/files
I does seem like https://github.com/liberty-rider/tileserver-gl/blob/869ab0489cb7b5396b46c051deda6afd15f38808/src/serve_rendered.js#L26 partially causes the issue.
With that included the style json returns
But with the old tester string it returns
I do have to wonder though, did raster maps work at all for you before with this style? There is also this other code on the rendering side that always seems to append path https://github.com/maptiler/tileserver-gl/blob/master/src/serve_rendered.js#L1237-L1260 which seems like it would have broken rendering for this style, and that has been like that for a while
EDIT: nevermind on the second location, that would only apply if the string started with sprites:// or glyphs:// I think
I used vector tiles only. Do you mean server-side rendered rasters of my vectors? Just tried to access "raster" variant on 4.5.1 through tileserver UI and yes, they work fine (fonts and glyphs correctly rendered on them)
Ya, the rendering part I am talking about makes the images on the index page next to your style, and also the images for the raster page you are talking about, to the right of your style on the index page.
When I revert the HttpTester string the vector tiles work again and and the style looks correct.
However when it tries to render it looks like it uses https://github.com/maptiler/tileserver-gl/blob/master/src/serve_rendered.js#L1237-L1260 and maplibre-native gets an error it adds in the path.
mlgl: {
class: 'Style',
severity: 'ERROR',
text: "Failed to load sprite: ENOENT: no such file or directory, open 'C:\\Users\\Andrew\\Documents\\GitHub\\tileserver-gl-wdb\\config\\https:\\tiles.wifidb.net\\styles\\WDB_DARK_MATTER\\sprite.png'"
}
I missed that the http testing code was actually in two places
https://github.com/liberty-rider/tileserver-gl/blob/869ab0489cb7b5396b46c051deda6afd15f38808/src/serve_style.js#L12 https://github.com/liberty-rider/tileserver-gl/blob/869ab0489cb7b5396b46c051deda6afd15f38808/src/serve_rendered.js#L26
Any chance you can put in a PR to revert these back to
const httpTester = /^(http(s)?:)?\/\//;
it will be easier for me to approve the change if someone else puts it in.
Thanks! Will do the PR.
@Caerbannog , just an fyi. this broke in v4.5.2 with https://github.com/maptiler/tileserver-gl/pull/1002
@acalcutt here goes the PR.
Thanks for the PR. I'll merge it as soon at the tests finish and make a new release.
Just a side FYI, I don't think this sections in your config.json does anything.
"sources": {
"europe": {
"url": "mbtiles://{europe}",
"type": "vector"
}
},
that format would be used in your style, the mystyle.json fie, to reference (data -> europe) in config.json
Ouch, sorry for creating this bug. I ignored the ^
in the regex when I reasoned about it.
v4.6.2 has been released, so let me know if that fixes your issue.
@Caerbannog I was just glad it wasn't my PR this time...haha
Just grabbed 4.6.2 docker image and tested with my jsons. Perfetto! Thank you so much @acalcutt !
With the following config.json and mystyle.json (relevant fragments) 4.5.1 displays nice map, while after updated to 4.6.0 it emits errors for glyphs and fonts and does not display vector map at all. Moreover, errors indicate that sprites URLs are concated with local "/data" root prefix. Revert to 4.5.1 fixed the issue.
Errors on startup:
Errors when serving:
config.json:
mystyle.json: