# Selecting an entity switch from 2D into 3D mode

**URL:** <https://community.cesium.com/t/selecting-an-entity-switch-from-2d-into-3d-mode/7314>\
**Category:** CesiumJS\
**Created:** [August 18, 2018, 8:21am UTC](https://community.cesium.com/t/selecting-an-entity-switch-from-2d-into-3d-mode/7314 "2018-08-18T08:21:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![harald.pollak73](https://avatars.discourse-cdn.com/v4/letter/h/a6a055/32.png) [@harald.pollak73](https://community.cesium.com/u/harald.pollak73)\
**Post date:** [August 18, 2018, 8:21am UTC](https://community.cesium.com/t/selecting-an-entity-switch-from-2d-into-3d-mode/7314/1 "2018-08-18T08:21:05Z")

</div>

I'm just playing around with CesiumJS. It is embedded in a little Angular Frontend and im loading entities from a Spring Backend.

I'm using 2D only ( at this time ).  
When I'm selecting an Entity it's correct renderd ( setting the points pixelSize and the Color but the view switches from 2D into 3D.

// picking the position of a translucent primitive  
&nbsp;&nbsp;&nbsp;&nbsp;this.viewer.screenSpaceEventHandler.setInputAction(  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;movement =\> {  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;const pickedFeature = this.viewer.scene.pick(movement.position);  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;console.log('pos:' + movement.position);  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (!Cesium.defined(pickedFeature)) {  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// nothing picked  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;console.log('nothing picked!');  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} else {  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;const entity = this.ds.entities.getById(pickedFeature.id.id);  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;entity.point.pixelSize = 15;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;entity.point.color = Cesium.Color.fromCssColorString('RED');  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;console.log(entity.id);  
// this.viewer.zoomTo(entity);  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.viewer.render();  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// const worldPosition = this.viewer.scene.pickPosition(movement.position);  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}, Cesium.ScreenSpaceEventType.LEFT\_CLICK);

CesiumJS: 1.47.0  
Chrome: 68.0.3440.106  
Firefox: 61.0.1

Can anybody tell me, whats to do to keep 2D mode?

best regards  
Harry

---

<div class="post-metadata">

**Author:** ![omar](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/omar/32/1999_2.png) [@omar](https://community.cesium.com/u/omar)\
**Post date:** [August 22, 2018, 1:36pm UTC](https://community.cesium.com/t/selecting-an-entity-switch-from-2d-into-3d-mode/7314/2 "2018-08-22T13:36:39Z")

</div>

I’m having some trouble recreating this. Does it only happen when you set the pixelSize and color on click? Can you show the settings you initialize when you create the viewer?

If you can put together a running[Sandcastle example](https://cesiumjs.org/Cesium/Build/Apps/Sandcastle) of this issue that’ll help a lot too.
