# Removing space above and below 2D map

**URL:** <https://community.cesium.com/t/removing-space-above-and-below-2d-map/8506>\
**Category:** CesiumJS\
**Created:** [August 1, 2019, 11:08pm UTC](https://community.cesium.com/t/removing-space-above-and-below-2d-map/8506 "2019-08-01T23:08:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mitchell\_Day](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/mitchell_day/32/3229_2.png) [@Mitchell\_Day](https://community.cesium.com/u/Mitchell_Day)\
**Post date:** [August 1, 2019, 11:08pm UTC](https://community.cesium.com/t/removing-space-above-and-below-2d-map/8506/1 "2019-08-01T23:08:00Z")

</div>

**1. A concise explanation of the problem you’re experiencing.**

Hi I am trying to see if there is a way to limit the Cesium map canvas to the only the map in 2D - remove the blank space above and below.

**2. A minimal code example. If you’ve found a bug, this helps us reproduce and repair it.**

**3. Context. Why do you need to do this? We might know a better way to accomplish your goal.**

Because when in 2D it is unnecessary for the user to zoom out that far and see anything around the map

**4. The Cesium version you’re using, your operating system and browser.**

Cesium 1.51.0

 ![map_space_2d.PNG.jpg](https://global.discourse-cdn.com/cesium/original/1X/05d56f03e9b98bdf68185ba29670ce1e684cc98a.jpeg)

 ![map_space_2d - 2.PNG](https://global.discourse-cdn.com/cesium/original/1X/25a67f59c796cb924d0652780ffb605365525d5e.png)

---

<div class="post-metadata">

**Author:** ![omar](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/omar/32/1999_2.png) [@omar](https://community.cesium.com/u/omar)\
**Post date:** [August 9, 2019, 1:41pm UTC](https://community.cesium.com/t/removing-space-above-and-below-2d-map/8506/2 "2019-08-09T13:41:45Z")

</div>

You could try to limit the camera’s distance by listening in on the camera move event and clamping its position, or overriding the camera controls like in this example: [http://localhost:8080/Apps/Sandcastle/index.html?src=Camera%20Tutorial.html&label=All](http://localhost:8080/Apps/Sandcastle/index.html?src=Camera%20Tutorial.html&label=All)

---

<div class="post-metadata">

**Author:** ![yangmaoying28](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/yangmaoying28/32/26787_2.png) [@yangmaoying28](https://community.cesium.com/u/yangmaoying28)\
**Post date:** [February 27, 2025, 8:20am UTC](https://community.cesium.com/t/removing-space-above-and-below-2d-map/8506/3 "2025-02-27T08:20:06Z")

</div>

hello omar，The demo you gave seems to be a local link, not an online example.
