how to limit camera zoom levels?

and camera ranges?

Hi there,

Cesium chooses the optimal tile zoom level based on camera position and canvas resolution – this is just a fundamental part of how tiled maps work. We don’t have a way for you to directly set zoom level since it’s handled by Cesium dynamically, but Cesium does allows you to specify the maximum error tolerance for what is considered “optimal”. By default, this value is 2.0 (because it uses less bandwidth). I would recommend lowering it to 1.5 which will use more bandwidth but should fix this use case unless you are right at a zoom level boundary. Here’s the doc for maximumScreenSpaceError: https://cesiumjs.org/Cesium/Build/Documentation/Globe.html#maximumScreenSpaceError you would access via scene.globe.maximumScreenSpaceError.

What do you mean camera ranges?

Best,

  • Rachel

For a little more insight into

Hi Rachel.
Thank you for your response.

About camera range,for excample,I draw a rectangle on the cesium,the camera can only move within this rectangle,and zoom level,like this effect:http://www.wish3d.com/projectPage/82f80da6-d139-4a18-a9cf-4bac0182ac34.

Sincerely,

Zhang

在 2017年5月16日星期二 UTC+8上午12:37:10,Rachel Hwang写道:

Hi Zhang,

I’ll try to write up a quick code example for you. Meanwhile, see this related discussion. https://groups.google.com/forum/?hl=en#!topic/cesium-dev/tAp48bXcQRw

Best,

  • Rachel

Hi Rachel,
Thank you so much! It’s very useful!

I’m sorry to bother you , I have another question.There is a car model in cesium. viewer.trackedEntity can follow the car.But I want to put my view in the cab.I set camera’s position,heading,pitch,roll can do this,but it can’t follow.I don’t know how to do that.

I’m looking forward to your reply.

Best,

Zhang

在 2017年5月17日星期三 UTC+8上午5:03:49,Rachel Hwang写道:

Hi Zhang,

Here’s another helpful thread you might find useful – see Matt’s example code, it should be close to what you need: https://groups.google.com/d/msg/cesium-dev/-mDNh2qlTZQ/WOIPQHVNAgAJ

Hope that helps!

  • Rachel