Skip to content

Set the maximum zoom level to 18 (20m/50ft) in map configuration#87

Merged
benoit74 merged 1 commit intoopenzim:mainfrom
AdeelTahir-SE:feature/zoom-depth
Apr 7, 2026
Merged

Set the maximum zoom level to 18 (20m/50ft) in map configuration#87
benoit74 merged 1 commit intoopenzim:mainfrom
AdeelTahir-SE:feature/zoom-depth

Conversation

@AdeelTahir-SE
Copy link
Copy Markdown
Contributor

Fixed issue #86
Set the maximum zoom level to 18 (20m/50ft), as going further deep does not translate to better view

zoom-issue

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 33.33%. Comparing base (a4c6ade) to head (95c1e7a).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #87   +/-   ##
=======================================
  Coverage   33.33%   33.33%           
=======================================
  Files          11       11           
  Lines         981      981           
  Branches      133      133           
=======================================
  Hits          327      327           
  Misses        643      643           
  Partials       11       11           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Collaborator

@benoit74 benoit74 left a comment

Choose a reason for hiding this comment

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

And where does the 18 magic number comes from? (no need to write this is source code but justifying the choice in the PR would help).

Comment thread zimui/main.js Outdated
Comment thread CHANGELOG.md Outdated
@benoit74
Copy link
Copy Markdown
Collaborator

benoit74 commented Apr 3, 2026

Regarding max zoom, I barely understand your logic because we do not ZIM only Monaco region but the whole world. We hence need something OK (or okayish at least) for the whole world.

Since issue reported compared with https://www.openstreetmap.org/, what is the max zoom level over there? Can you find where and why they made this choice?

@AdeelTahir-SE
Copy link
Copy Markdown
Contributor Author

The maximum zoom level in OpenStreetMap is not the same everywhere; it varies by region. For example, in Monaco the maximum visible resolution is around 20 m, whereas in Alexander Island it is around 5 m. This variation is partly due to differences in latitude, as different latitudes produce different ground resolutions at the same zoom level.

In issue #86, the example used Monaco, where the maximum zoom corresponds to 20 m. Based on that, I experimented with different maxZoom values and found that setting maxZoom = 18 produces this level of detail for Monaco. Testing the same for Alexander Island in Antarctica gave a maximum visible resolution of 5 m, consistent with OpenStreetMap.

It is also important to note that the zoom level depends on the tile type (vector vs raster). In our case, we are using vector tiles from OpenMapTiles, and with this configuration, maxZoom = 18 appears to be the most appropriate setting.

@AdeelTahir-SE
Copy link
Copy Markdown
Contributor Author

Also according to my research OpenStreetMap is using maxZoom of 19 with raster tiles which will be equivalent to our maxZoom of 18 as we are using vector tiles instead of Raster tiles, which (vector tiles) provides roughly the same effective ground resolution as zoom 19 in the raster tiles.

@benoit74
Copy link
Copy Markdown
Collaborator

benoit74 commented Apr 6, 2026

The maximum zoom level in OpenStreetMap is not the same everywhere; it varies by region. For example, in Monaco the maximum visible resolution is around 20 m, whereas in Alexander Island it is around 5 m. This variation is partly due to differences in latitude, as different latitudes produce different ground resolutions at the same zoom level.

To me this does not indicate that max zoom level is not the same everywhere. It even kinda indicate the opposite: max zoom level is the same everywhere but due to latitude it does not produce the same maximum "resolution".

It is also important to note that the zoom level depends on the tile type (vector vs raster). In our case, we are using vector tiles from OpenMapTiles, and with this configuration, maxZoom = 18 appears to be the most appropriate setting.

I don't get this. Vector or raster, what is displayed is the same thing, only "encoding" changes.

Also according to my research OpenStreetMap is using maxZoom of 19 with raster tiles which will be equivalent to our maxZoom of 18 as we are using vector tiles instead of Raster tiles, which (vector tiles) provides roughly the same effective ground resolution as zoom 19 in the raster tiles.

Again I don't get this logic.

In issue #86, the example used Monaco, where the maximum zoom corresponds to 20 m. Based on that, I experimented with different maxZoom values and found that setting maxZoom = 18 produces this level of detail for Monaco. Testing the same for Alexander Island in Antarctica gave a maximum visible resolution of 5 m, consistent with OpenStreetMap.

Saying this from the very beginning would have been sufficient. LGTM, thank you.

Please:

  • squash your commits
  • fix the CHANGELOG content which mention zoom level 20?

@AdeelTahir-SE
Copy link
Copy Markdown
Contributor Author

All requested changes are done: commits squashed and CHANGELOG updated. Ready for final review.

@benoit74
Copy link
Copy Markdown
Collaborator

benoit74 commented Apr 7, 2026

For some reason, there is still 2 commits (including an unrelated one) to merge. Can you please check?

Screenshot 2026-04-07 at 14 54 12

@AdeelTahir-SE
Copy link
Copy Markdown
Contributor Author

My requested changes (commits squashed and CHANGELOG updated) are complete.
The extra commit (Add default ZIM tags based on Kiwix convention) was authored by you,which is unrelated to my work.
Please let me know if anything else is needed from my side.

For some reason, there is still 2 commits (including an unrelated one) to merge. Can you please check?

Screenshot 2026-04-07 at 14 54 12

Fix formatting in changelog and eslint issue when setting maxZoom value

Fix maximum zoom level in changelog to 18
@benoit74 benoit74 force-pushed the feature/zoom-depth branch from 4c5a2d3 to 95c1e7a Compare April 7, 2026 13:18
@benoit74
Copy link
Copy Markdown
Collaborator

benoit74 commented Apr 7, 2026

Your PR should not contain commits from another PR, especially once they have been merged to main. Here what you missed is a rebase. I've done it, thank you.

@benoit74 benoit74 self-requested a review April 7, 2026 13:18
Copy link
Copy Markdown
Collaborator

@benoit74 benoit74 left a comment

Choose a reason for hiding this comment

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

LGTM

@benoit74 benoit74 merged commit 76b7101 into openzim:main Apr 7, 2026
10 checks passed
@benoit74 benoit74 linked an issue Apr 14, 2026 that may be closed by this pull request
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.

Zoom is too deep should stop at 20m

2 participants