-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Control available scene modes in SceneModePicker #8005
Comments
Here's a Sandcastle with Columbus View turned off. Be sure to check out the code. |
I'll reproduce it here for better visibility.
|
I had quite the experience gazing in disbelief at the feature working with no custom code, until it occurred to me check the CSS! |
The CSS is a good short-term workaround, but it would be easy for the |
Thank you for the CSS example! Unfortunately, I can't replicate it in a production webpack environment. (There is no bucket.css) - I use require('cesium/Widgets/widget.css') in my javascript file. (As well as my own CSS file) Adding
to my CSS file does not remove the option from my drop down list. The CSS Solution would be fine for me, through an API solution would work just as well. |
@ognjenb If you right-click the offending button and hit "inspect", and then make sure the |
It does have the class class="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon cesium-scemeModePicker-visible" In the data-bind section it has a lot of things that say things like sceneMode === _sceneMode.COLUMBUS_VIEW or !== and the title of course of the button is "Columbus View". I don't have any rules overriding any of the default widgets other then the ones removing some of them from the viewer. |
Another thing you can try @owensjp is to get the button with JS and modify its CSS that way. For example, I used the browser inspector get the CSS selector for the button, and then the following line in JS can hide it:
|
Thanks Omar! That worked! |
The BaseLayerPicker allows you to pass an array of which imagery layers should be available. It would be nice if the SceneModePicker had a similar option.
This was requested on the forum. Currently it's hardcoded to show all 3. I think it should be easy to add an option to control this. I think you'd need to edit https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Widgets/SceneModePicker/SceneModePicker.js and https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Widgets/SceneModePicker/SceneModePickerViewModel.js.
The text was updated successfully, but these errors were encountered: