Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions jvm/src/test/resources/styles/multisprite/style.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
"name": "test-sprites",
"sources": {
"test_label": {
"minzoom": 0,
"maxzoom": 0,
"type": "geojson",
"data": {
"type": "FeatureCollection",
Expand Down Expand Up @@ -373,4 +371,4 @@
"duration": 0,
"delay": 0
}
}
}
2 changes: 0 additions & 2 deletions jvm/src/test/resources/styles/style_geojson_ch_label.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
"sources": {

"test_label": {
"minzoom": 0,
"maxzoom": 0,
"type": "geojson",
"data": {
"type": "FeatureCollection",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,7 @@ class GeoJSONVT: public GeoJSONVTInterface, public std::enable_shared_from_this<
void initialize(const std::shared_ptr<GeoJson> &geoJson) {
// If the GeoJSON contains only points, there is no need to split it into smaller tiles,
// as there are no opportunities for simplification, merging, or meaningful point reduction.
// Keep point-only sources on a single zoom level only if minZoom is explicitly configured (> 0).
// For the default minZoom=0 case, collapsing to z0 creates very large matching tolerances and can
// hide unrelated points due to symbol ownership deduplication.
if (geoJson->hasOnlyPoints && options.minZoom > 0) {
if (geoJson->hasOnlyPoints) {
options.maxZoom = options.minZoom;
Comment on lines +149 to 150
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Preserve default maxZoom for point-only GeoJSON sources

Reverting this condition to if (geoJson->hasOnlyPoints) makes every point-only source collapse to a single zoom level by setting options.maxZoom = options.minZoom, and minZoom defaults to 0 when the style omits it (Tiled2dMapVectorLayerParserHelper.cpp only sets options.minZoom when minzoom is present). In the common case of GeoJSON sources without explicit minzoom, this forces all symbols through z0 geometry and reintroduces the missing-point behavior (points get dropped at runtime due to coarse matching/collision ownership) that #919 fixed.

Useful? React with 👍 / 👎.

}

Expand Down Expand Up @@ -186,8 +183,9 @@ class GeoJSONVT: public GeoJSONVTInterface, public std::enable_shared_from_this<
}

void reload(const std::shared_ptr<GeoJson> &geoJson) override {
// Keep behavior consistent with initialize().
if (geoJson->hasOnlyPoints && options.minZoom > 0) {
// If the GeoJSON contains only points, there is no need to split it into smaller tiles,
// as there are no opportunities for simplification, merging, or meaningful point reduction.
if (geoJson->hasOnlyPoints) {
options.maxZoom = options.minZoom;
}

Expand Down
Loading