Show legend on cesium slope, aspect and elevation

Dear All,

I’ve found the slope, aspect and elevation map of cesium through given link:- https://sandcastle.cesium.com/?src=Globe%20Materials.html
But legends are not available here. Is there any way to show the legends on map so that user can understand the meaning of the colors.

Thanks in Advance

You can use normal css/html to show legends on your application. The UI you see in the linked Sandcastle is some built-in UI elements we created for demo purposes. There is not an equivalent for legends.

1 Like

Thanks, yeah I can use css /html to show the legends but problem is here, how i’ll get the value respect to the colors and meaning of the colors in given example.

Extracting the meaning of the colors will require closer inspection of the code. For instance, if you are looking at the shading for elevation, you can see that on line 78, there are certain values for the elevation ramp:

[0.0, 0.045, 0.1, 0.15, 0.37, 0.54, 1.0]

These correspond to the colors represented from lines 97 to 103. You will need to match those colors up with the elevation ranges.

We are currently making improvements to our Sandcastle user experience. I will add this to our discussion to create better descriptions of Sandcastle examples, which will hopefully help you do the steps above.

1 Like

Dear dzung,

Thank you so much to make it very clear. It’s very helpful to me.

Thanks & Regards
Shashi

1 Like

Hi Dzung,
Already we had a discussion regarding the elevation/slope/aspect maps in the given sandcastle.
https://sandcastle.cesium.com/?src=Globe%20Materials.html.
I had issue with how to show legends and u suggest to show the values [0.0, 0.045, 0.1, 0.15, 0.37, 0.54, 1.0] using html/css it’s ok.

But problem is that it doesn’t make very clear to my client they want legends something like given images.
Aspect-Map-Legend

.
But I’ve not found any value like that in cesium sandcastle map. If it’s possible to kindly make it possible.

With best regards
Shashi