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
this.viewer.screenSpaceEventHandler.setInputAction(
movement => {
const pickedFeature = this.viewer.scene.pick(movement.position);
console.log('pos:' + movement.position);
if (!Cesium.defined(pickedFeature)) {
// nothing picked
console.log('nothing picked!');
return;
} else {
const entity = this.ds.entities.getById(pickedFeature.id.id);
entity.point.pixelSize = 15;
entity.point.color = Cesium.Color.fromCssColorString('RED');
console.log(entity.id);
// this.viewer.zoomTo(entity);
}
this.viewer.render();
// const worldPosition = this.viewer.scene.pickPosition(movement.position);
}, 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