Search code examples
google-earth-engine

Google Earth Engine, hide widgets in Map.ui


Can I hide all widgets in https://code.earthengine.google.com/ when loading a map? (all standard widgets including +-(zoom), map/satellite, drawing tools...)

I would like to create an app and embed it into a website without the widgets, just displaying the loaded dataset.


Solution

  • Yes, you can hide all of the controls.

    Map.setControlVisibility({all: false});
    

    Depending on your application, you might also want to prevent it from being panned or zoomed:

    Map.setLocked(true);
    

    These examples are for the default map, but the same methods are also applicable to any ui.Map objects you create in your app if you are setting up a custom UI from scratch.