Cesium: Camera boundry

Created on 3 Jan 2017  路  18Comments  路  Source: CesiumGS/cesium

I've seen this requested on the forum a handful of times, most recently here: https://groups.google.com/forum/?hl=en#!topic/cesium-dev/z-kWiAZ1Jfg

For some applications, it would be helpful to define a rectangle to restrict the camera to view only a certain span of the map.

category - camera onramping priority - high type - enhancement

Most helpful comment

Yes please! I'll add this to my list

All 18 comments

I've seen other globes (at least WorldWind I think) handle this using a separate class, we could call ours CameraLimiter or something similar. This class would allow you to set min/max values for anything that makes sense on the Camera. Then every frame, it's job is to check for out of bounds values and set them to the min/max if they are outside the desired configuration. This should provide a flexible and elegant solution and allow us to set limits on all kinds of things (boundary, rotation, direction, etc..)

Also reported here: https://groups.google.com/forum/?hl=en#!topic/cesium-dev/x8-uWKKlYNc

@rahwang this could be a good one for you for next month if you are interested.

Yes please! I'll add this to my list

This will be helpful for something I'm working on too =)

Yep, I would love to see this because we'll have good use for it on cesium.com, has been on my todo list forever. I've has discussions with bagnell in the past on how best to implement this, so let me know if you want to talk before tackling it.

CC #3111

Sketchfab just added a similar feature: https://blog.sketchfab.com/introducing-camera-constraints/

I would appreciate this as well! Even a simple boolean option such as "clampCameraToEdges" for the 2D map would be great. It seems of marginal utility to let people scroll past the north & south poles, as you currently can.

Someone requested this at the FOSS4G cesium workshop as well. I think this would be a really popular feature if anyone has the chance to look at it soon.

It's also a nice onramping issue. @ggetz please add this to your backlog.

Any updates on when this feature will make it into a release?

@scottnc27603 no update, but contributions are very welcome if you have the bandwidth.

Initial work by @hanbollar in this branch: https://github.com/AnalyticalGraphicsInc/cesium/tree/camera-limiter

See #6381 and #6172

Requested on the forum again: https://groups.google.com/forum/#!topic/cesium-dev/NzcIdGyfSt4

@OmarShehata also had some thoughts in https://github.com/AnalyticalGraphicsInc/cesium/issues/8143#issue-491026306

where can i get the imp code?

Was this page helpful?
0 / 5 - 0 ratings