switch map 2d/3d with ol3cesium or leaflet and display some layers in 2d and some layers only in 3d

280 views
Skip to first unread message

Tiziana Ferro

unread,
Apr 1, 2016, 10:05:44 AM4/1/16
to cesium-dev
Using ol3cesium I have a button,  call a javascript and switch fron 2d to 3d using 
var ol3d = new olcs.OLCesium({map: map}); // map is the ol.Map instance
ol3d.setEnabled(true);
then, i have 2 questions:
1) how to create a similar javascript for switch 2d/3d using leaflet?
2) using openlayers3 and not leaflet, can I trap the name of current displayed map? I need to display some layers when I am in 2d mode and after the click, when the current map id 3d, i need to put off some layers and on different layers then i have not displayed in the 2d map (i need some layers only in 2d mode and some layers only in 3d mode)
Thanks!



Guillaume Beraudo

unread,
Apr 1, 2016, 10:52:11 AM4/1/16
to Cesium Dev
Hi,

You can get the list of layers in a map with map.getLayers() as indicated in http://openlayers.org/en/master/apidoc/ol.Map.html.
Then you can check visiblity.

In OL3-Cesium, to get different layers in 2D and 3D you can replace the synchronizers. Check the OLCesium constructor
to see how to pass your own synchronizers. http://openlayers.org/ol3-cesium/apidoc/olcs.OLCesium.html.

Guillaume

--
You received this message because you are subscribed to the Google Groups "cesium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cesium-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages