Skip to content

Cap map min zoom so the world can't tile more than ~2x#8

Merged
cmehat merged 2 commits into
mainfrom
seo/meta-tags
Jun 19, 2026
Merged

Cap map min zoom so the world can't tile more than ~2x#8
cmehat merged 2 commits into
mainfrom
seo/meta-tags

Conversation

@cmehat

@cmehat cmehat commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings June 18, 2026 18:23

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR adjusts the Leaflet map configuration to limit how far users can zoom out, aiming to reduce how many wrapped “world copies” can appear when zoomed out.

Changes:

  • Set a minimum zoom level on the Leaflet map (minZoom: 2) during initialization.
Comments suppressed due to low confidence (1)

docs/index.html:66

  • minZoom: 2 limits how far users can zoom out, but it doesn’t actually prevent the world from repeating (multiple wrapped copies) on wide viewports; at zoom 2 the world is ~1024px wide, so displays wider than ~2048px can still show >2 copies. If the goal is to stop tiling/repetition, set noWrap: true on the tile layer (and optionally add maxBounds on the map to avoid panning into blank space).
  var map = L.map("map", { minZoom: 2 }).setView([30, 20], 3);
  L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", {
    attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
    maxZoom: 18
  }).addTo(map);

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@cmehat cmehat merged commit 13195d6 into main Jun 19, 2026
1 check passed
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.

2 participants