baseLayerPicker set to false effects picking demo

**I was playing with the code on the Sandcastle demo Drawing On Terrain and noticed if I turned off the attribute **baseLayerPicker which I thought just hides the imagery widget.

**It will effect the mouse position picking code giving a wrong position. Is this a bug? **

e.g.

var viewer = new Cesium.Viewer(‘cesiumContainer’, {

selectionIndicator : false,

baseLayerPicker : false,

infoBox : false,

terrainProvider : Cesium.createWorldTerrain()

});

https://cesiumjs.org/Cesium/Build/Apps/Sandcastle/?src=Drawing%20on%20Terrain.html

Hey Alan,

Thanks for reporting this. This does sound like a bug, which I’ve opened an issue for:

https://github.com/AnalyticalGraphicsInc/cesium/issues/7261

It looks like replacing:

var earthPosition = viewer.scene.pickPosition(event.position);

``

with:

var ray = viewer.camera.getPickRay(event.position);

var earthPosition = viewer.scene.globe.pick(ray, viewer.scene);

``

fixes it.

Thank you Omar for raising this issue. It is always interesting to read the history behind decisions.
This also fixes a similar issue when the sceneMode is changed to SCENE2D