How can I access current zoom level, and how can I adjust zoom level with a similar result as when I scroll the mouse wheel?
2. A minimal code example. If you've found a bug, this helps us reproduce and repair it.
(Not a bug, a question on how to access and set zoom level)
3. Context. Why do you need to do this? We might know a better way to accomplish your goal.
Check this as an example: http://www.paralogg.se/cesium/0F300687F300491
(default Zoom level is too close to start with, and when you have multiple entities and switches entity to follow, the zoom levels gets too close again...)
4. The Cesium version you're using, your operating system and browser.
Current Cesium version, running on Google Cloud (Appengine), and you choose your browser... :)
By cloning current viewer camera position, it could be applied to the following of another entity. My code below (on toggle of entity to follow):
function toggleFollow(flNumber) {
if (follow==flNumber) {
follow = "0"
savedCamera = viewer.camera.position.clone(); // save camera offset before we unfollow all (else we would loose this)
viewer.trackedEntity = undefined;
//console.log(savedCamera);
showPPCfor('');
} else {
follow = flNumber;
viewer.trackedEntity = wingEntity[flNumber];
// if we unfollowed all, no camera offset is available, so use the saved one
if (Math.abs(viewer.camera.position['x'])+Math.abs(viewer.camera.position['y'])+Math.abs(viewer.camera.position['z']) > 100000) {
wingEntity[flNumber].viewFrom= savedCamera;
} else { // use the latest if available
wingEntity[flNumber].viewFrom= viewer.camera.position;
}