Closed MightyPork closed 2 months ago
Hi, which example HTML file are you using?
The issue is definitely in here, I am merging in the breaking 4.0 major version changes and some layers have mixed geometry types so we need to add geometry filters to the styles.
this one https://github.com/protomaps/PMTiles/blob/main/js/examples/maplibre.html
you can also see it live on my test page, it's all static files on apache and some CDN for assets
you need to modify the water
rule to have a filter
on geometry type:
id: "water",
type: "fill",
filter: ["==", ["geometry-type"], "Polygon"],
I will work on updating the examples
So basically the tiles contain closed lines (polygons) as well as open lines and the bug was that it closed the open lines using the fill style?
the fix works perfectly :+1:
yes, exactly. This has to do with the Basemaps repo which generates the 20240924.pmtiles
in the public bucket, I'm making a new major revision of the tileset which changes the layers around. So examples written against the previous revision (v3) may be affected, thanks for working through this and let me know if you encounter similar issues.
hmmm, I added (guessed) more styles using the reference at https://maplibre.org/maplibre-style-spec/ and now I also see little streams and possibly other features. These completely disappeared with adding the filter for fill.
[
{
"id": "water2",
"source": "selfhosted",
"source-layer": "water",
"type": "line",
"filter": ["==", ["geometry-type"], "LineString"],
"paint": {
"line-color": "#80b1d3",
},
},
{
"id": "water3",
"source": "selfhosted",
"source-layer": "water",
"type": "line",
"filter": ["==", ["geometry-type"], "MultiLineString"],
"paint": {
"line-color": "#80b1d3",
},
},
{
"id": "water4",
"source": "selfhosted",
"source-layer": "water",
"type": "fill",
"filter": ["==", ["geometry-type"], "MultiPolygon"],
"paint": {
"fill-color": "#80b1d3",
},
},
]
Is there a good-to-use-as-is style compatible with the v4 format I could use instead of trying to make my own?
Should be fixed by https://github.com/protomaps/PMTiles/pull/464
the new style for v4 is not on NPM yet but you can either copy-paste it from maps.protomaps.com Get Style JSON
or you can check out http://github.com/protomaps/basemaps repo and run npm run generate-styles
in the styles/
directory. For V4 the serialized JSON style has a version per chosen language (en
, de
etc) in dist/styles
If I want the map to use local names (I'm making maps for Czech Republic, so e.g. Labe instead of Elbe)... I will have to generate my own planet file first, or the language in styles somehow does this? Or it just changes what font is used?
If you run generate-styles
there should be a file like dist/light/cs.json
which is the Czech localized version of the style. The planet tileset is the same for all languages.
I opened the issue here https://github.com/maplibre/maplibre-gl-js/issues/4763 but maybe it is a bug in this repo instead. More details are in the other issue.
the map file was grabbed today using this command:
I get the same broken rendering with your example html file, completely unchanged outside of editing the source link and coordinates.
This bug does not reproduce with the example file https://pmtiles.io/protomaps(vector)ODbL_firenze.pmtiles
my pmtiles command line tool is installed from AUR, version 1.20.0