<p>So it is possible to do this in leaflet by setting <code>maxBounds</code> on the map, but there's no way to do it only in the vertical direction so it also stops you scrolling past the dateline in either direction.</p>
<p>The other option would be to add our <code>moveend</code> handler to enforce it in only one direction, which is basically has <code>maxBounds</code> works internally.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/issues/2147#issuecomment-465074127">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABWnLaE52rg0lVS0gdGNn-TqGOBEMPC5ks5vO9CYgaJpZM4bCG-w">mute the thread</a>.<img src="https://github.com/notifications/beacon/ABWnLfPqEMXKnpaM5B2wN6BsLrnlr-dGks5vO9CYgaJpZM4bCG-w.gif" height="1" width="1" alt="" /></p>
<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/openstreetmap/openstreetmap-website","title":"openstreetmap/openstreetmap-website","subtitle":"GitHub repository","main_image_url":"https://github.githubassets.com/images/email/message_cards/header.png","avatar_image_url":"https://github.githubassets.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/openstreetmap/openstreetmap-website"}},"updates":{"snippets":[{"icon":"PERSON","message":"@tomhughes in #2147: So it is possible to do this in leaflet by setting `maxBounds` on the map, but there's no way to do it only in the vertical direction so it also stops you scrolling past the dateline in either direction.\r\n\r\nThe other option would be to add our `moveend` handler to enforce it in only one direction, which is basically has `maxBounds` works internally."}],"action":{"name":"View Issue","url":"https://github.com/openstreetmap/openstreetmap-website/issues/2147#issuecomment-465074127"}}}</script>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/issues/2147#issuecomment-465074127",
"url": "https://github.com/openstreetmap/openstreetmap-website/issues/2147#issuecomment-465074127",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>