Underground navigation in global mode

Explore in the sandboxView live

This sample shows how to change the opacity and color of the ground and how to enable underground navigation in a global WebScene.

In a global scene the user is constrained by default to navigate above the ground surface, so setting the navigationConstraint to none will allow users to navigate under the ground.

Use dark colors for code blocksCopy
   
1
2
3
map.ground.navigationConstraint = {
  type: "none"
};

Sometimes it's useful to see what data lies under the ground surface without navigating below the surface. Setting the ground opacity to a value lower than 1 allows users to see through the ground surface. The opacity is applied to the basemaps (if any available) as well.

Use dark colors for code blocksCopy
 
1
map.ground.opacity = 0.6;

In this sample we visualize the scene at the street level. That's why a basemap is not really needed. To avoid having a grid as default, we set a surfaceColor on the ground:

Use dark colors for code blocksCopy
 
1
map.ground.surfaceColor = "#CFC7BC";

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.