# Cesium Toggle Buttons for Raster and Vector Data

**URL:** <https://community.cesium.com/t/cesium-toggle-buttons-for-raster-and-vector-data/14908>\
**Category:** CesiumJS\
**Created:** [August 19, 2021, 11:15am UTC](https://community.cesium.com/t/cesium-toggle-buttons-for-raster-and-vector-data/14908 "2021-08-19T11:15:42Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![sam.rothstein](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/sam.rothstein/32/6584_2.png) [@sam.rothstein](https://community.cesium.com/u/sam.rothstein)\
**Post date:** [August 19, 2021, 2:00pm UTC](https://community.cesium.com/t/cesium-toggle-buttons-for-raster-and-vector-data/14908/2 "2021-08-19T14:00:24Z")

</div>

@edallsystems

I found a few community forum threads that can help you get started creating buttons.

If you are looking to add a button to the top-right corner of the toolbar, check out the following thread:

> [@Adding an HTML button to the top-right toolbar?](https://community.cesium.com/t/adding-an-html-button-to-the-top-right-toolbar/10777):
>
> I know it’s possible to add an HTML button to the toolbar’s location seen at the top-right of the Cesium Viewer, which is this: However, when a button is added via assigning its \< div \> class to be the same as the toolbar, it will often sit on top of another button. Is there a way to add a button to this toolbar such that all of the other, pre-existing buttons will move to the side to allow its placement there, without the button occluding any others?

Ultimately, adding a toggle button to the viewer is more of a general HTML/CSS issue than a CesiumJS issue. The following threads provide great high-level information.

> [@Add a toggle button to viewer](https://community.cesium.com/t/add-a-toggle-button-to-viewer/8793):
>
> To clarify, I want to overlay a button on top of the viewer like is in the sandcastle example. When I do it like this, it positions the button above the viewer. toolbarLeftClass: { display: “block”, position: “absolute”, top: “5px”, left: “5px” }, cesiumContainerId: { position: “relative”, width: “100%”, height: “100%”, margin: “0”, padding: “0”, overflow: “hidden” }, this.cesiumContainer = element}\> Click me!

> [@How to put a button at the top of Cesium panel?](https://community.cesium.com/t/how-to-put-a-button-at-the-top-of-cesium-panel/2732):
>
> Hi! I have a Cesium panel and I want to put a button at the top of it (see below). [[image] ](https://i.imgur.com/KKI2W5R.png) When the user presses that button, the selected entity must be deleted. To achieve that goal, I wrote this code: \<h1\>My app\</h1\> \<div ng-show="authenticated"\> &nbsp;&nbsp;&nbsp;\<div id="cesiumContainer"\>\</div\> &nbsp;&nbsp;&nbsp;&nbsp;\<div id="toolbar"\>\</div\> &nbsp;&nbsp;&nbsp;&nbsp;\<script\> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var viewer = new Cesium.Viewer('cesiumContainer', &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;timeline: false, &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;animation: false, &nbsp;&nbsp;&nbsp;…

Let me know if you have any other questions or concerns!

-Sam

---

_[View the full topic](https://community.cesium.com/t/cesium-toggle-buttons-for-raster-and-vector-data/14908)._
