[GIS] Interactions in OpenLayers 3 – Cesium

3d-mapcesiumopenlayers

I went through the oL3- Cesium examples provided on their website.
There was an example here which comprised of selecting the features in 2D view and the same will be reflected in the 3D one as well. But, when I went through the code, there was no interaction defined as such. They were extracting the feature present on the highlighted/ clicked coordinate,if any, and were applying styles.

What I mean to say is, there was no predefined interaction for selection thing, like it is in OL3 documentation here.
So I wanted to ask are there actually no predefined interactions as of now, in this OL3-Cesium integration or am I missing out on something ? I primarily followed those examples provided on their website to understand the working.

Update :

In the example I provided above,they extracted the feature, if any, present at the clicked coordinate.That's reflected in 3D view as well.
But when I try to add Ol3's select interaction in this :


var selectClick = new ol.interaction.Select({condition: ol.events.condition.click});
select = selectClick;
if (select !== null) {
map.addInteraction(select);
select.on('select', function(e) {
select.setStyle(selectionstyle);
});
}

Features in 2D are being selected fine but it's not reflecting in the 3D view. So are these interactions not yet supported in Ol3-Cesium or I'm doing wrong?

Best Answer

If you look at the selection.js source of the example you linked, you will see these lines:

var ol3d = new olcs.OLCesium({map: map, target: 'map3d'});
var scene = ol3d.getCesiumScene();
ol3d.setEnabled(true);

This sets up the link between the OpenLayers map and the Caesium view, not the interaction control, which deals with events in the OpenLayers map view only. Here is the relevant Caesium source code. In that code, you will see that the linking is done via two further modules, RasterSynchronized and VectorSynchronizer.

The comments at the top of both of these files make it clear that the interaction is only from OpenLayers to Caesium, eg,

Unidirectionally synchronize OpenLayers vector layers to Cesium.

The ol.interaction.Select that comes later deals entirely with updating the styles on the OpenLayers map view, it is no way relates to the interaction with Caesium.