When declaring new WALK.View()

$(“.zoom_btn”).click(function () {
let newZoom = $(this).attr(“data-zoom”);
let position = viewer.getCameraPosition();
let rotation = viewer.getCameraRotation();
var view = new WALK.View();

view.position.x = position.x; //포지션지정
view.position.y = position.y;
view.position.z = position.z;
view.rotation.yawDeg = rotation.yawDeg; //로테이션 지정
view.rotation.pitchDeg = rotation.yaw;
view.fov = newZoom; //fov 수정
console.log("vv", view);
viewer.switchToView(view);
viewer.requestFrame();

});

If I run this, when I click the view again, a black screen is displayed. Is there a problem with this syntax?

I solved it. It seems that newZoom is entered as a character, so I changed it to int format.

1 Like