Skip to content

Clearer min/max zoom handling for geojson sources#921

Open
matzf wants to merge 1 commit intomainfrom
feature/geojson-source-minmaxzoom
Open

Clearer min/max zoom handling for geojson sources#921
matzf wants to merge 1 commit intomainfrom
feature/geojson-source-minmaxzoom

Conversation

@matzf
Copy link
Copy Markdown
Contributor

@matzf matzf commented Mar 19, 2026

Always accept explicitly configured min/maxzoom value for geojson sources. As optimization, keep point-only sources on a single zoom level (either minzoom or maxzoom), unless minZoom and maxZoom are both explicitly configured.
If no min/maxzoom are configured, the point-only tile is created at level 0. Effectively, this reverts #919.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8a62f6844b

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +374 to +376
} else if (config.maxZoom.has_value()) {
options.minZoom = *config.maxZoom;
options.maxZoom = *config.maxZoom;
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 Do not collapse maxzoom-only point sources to minzoom=maxzoom

For point-only GeoJSON sources that specify only maxzoom, getEffectiveOptions() now forces both minZoom and maxZoom to that value. Tiled2dMapVectorGeoJSONLayerConfig::getZoomLevelInfos() therefore advertises only that one zoom level, and the default Tiled2dMapSource::onVisibleBoundsChanged() path drops the source at lower camera zooms because underzoom is disabled when the first available zoom identifier is not 0. A style like {"type":"geojson","maxzoom":25,...} used to render across z0..25; after this change it will stay invisible until the camera reaches z25.

Useful? React with 👍 / 👎.

Always accept explicitly configured min/maxzoom value for geojson sources.
As optimization, keep point-only sources on a single zoom level (either
minzoom or maxzoom), unless minZoom and maxZoom are both explicitly
configured.
If no min/maxzoom are configured, the point-only tile is created at level 0.
Effectively, this reverts #919.
@matzf matzf force-pushed the feature/geojson-source-minmaxzoom branch from 8a62f68 to ce9c54a Compare March 19, 2026 13:58
@matzf
Copy link
Copy Markdown
Contributor Author

matzf commented Mar 19, 2026

FWIW, benchmark comparison failure is expected; tests on main branch are failing (that's why this PR exists!).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant