two viewer primitives synchronize

159 views
Skip to first unread message

Feldon Cooper

unread,
Jan 25, 2019, 2:00:13 AM1/25/19
to cesium-dev
1. A concise explanation of the problem you're experiencing.
i create two cesium viewer in one page, i get the primitiveA use viewerA.scene.primitives.get(id) function,
but when i call viewerB.scene.primitives.add(primitiveA)  there is no primitive display on viewerB

2. A minimal code example. If you've found a bug, this helps us reproduce and repair it.

for (var i = 0; i < viewerA.scene.primitives.length; ++i) {
var p = viewerA.scene.primitives.get(i);

if (p) {
viewB.scene.primitives.add(p)
}
}

3. Context. Why do you need to do this? We might know a better way to accomplish your goal.

i create two cesium viewer in one page, and i want to synchronize two viewer's primitives 
--- after i draw rectangle on viewer A  use the scene.primitives , display the same rectangle on viewer B
i don't want to call the viewerB.scene.primitives.add function , because there will be much more oparation to synchronize .


4. The Cesium version you're using, your operating system and browser.
Cesium:1.43
OS:win10
browser: Chrome 70


Omar Shehata

unread,
Jan 28, 2019, 7:56:46 AM1/28/19
to cesium-dev
I don't think you can take one primitive and add it to two viewers like that. There's a lot of assumptions about the state of the primitive that won't be compatible with this setup. 

You might need to keep track of the global state yourself and synchronize the two primitives. 

I think a better approach is if CesiumJS could somehow support a multi-camera view mode, that would be in the same viewer, kind of like how the imagery split works:


Can you describe more about your use case? That'll help us collect information for figuring out if this is a feature that'll be useful to users/the community.

Feldon Cooper

unread,
Apr 12, 2019, 2:07:41 AM4/12/19
to cesiu...@googlegroups.com
There is a common need for monitoring system:
Users want to see more then one screen at the same time and each screen show a map in 3D or 2D and display diffrent images.
For example,the first shows satellite images in 3D ,the second shows road map in  2D, .....
They expect the multiple screens show the same data and synchronized.
The data maybe come from server or mouse ploting.
 
If there is a easy way to get full property of whole primitives on one viewer and draw them directly to another viewer the synchronizing will be workable.

Omar Shehata <omar.same...@gmail.com> 于2019年1月28日周一 下午8:56写道:
--
You received this message because you are subscribed to a topic in the Google Groups "cesium-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cesium-dev/SUqz4UGrSMA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cesium-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Omar Shehata

unread,
Apr 18, 2019, 1:20:20 PM4/18/19
to cesium-dev
Thanks Feldon!

I found an issue for this on GitHub, and I shared your thoughts there: https://github.com/AnalyticalGraphicsInc/cesium/issues/5214

Supporting multiple viewports would be the right way to do this because then there would be no need to duplicate any data, and it would just be a matter of defining a second camera.
To unsubscribe from this group and all its topics, send an email to cesium-dev+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
Message has been deleted
0 new messages