I had a openlayers 3 map with EPSG:4258 as view's projection and some layers into it. Now I would like to use Cesium and be able to switch 2D/3D map. I follow the steps from his repository https://github.com/openlayers/ol3-cesium but I have some problems. Here's my maps init.

var map = new ol.Map({
  controls: ol.control.defaults({
    attribution: false // No atribución
  }).extend([mousePositionControl, // MousePosition
    //new ol.control.FullScreen(), // FullScreen
    new ol.control.LayerSwitcher({tipLabel: 'Leyenda'}), // LayerSwitcher
    new ol.control.ScaleLine(), // ScaleLine
    //new ol.control.ZoomSlider(), // ZoomSlider
  target: 'map',
  view: new ol.View({
    projection: proj,
    zoom: 3,
    center: ol.proj.fromLonLat([-0.47343, 39.42811], 'EPSG:4258'),
    minZoom: 0,
    maxZoom: 10

ol3d = new olcs.OLCesium({
  map : map
scene = ol3d.getCesiumScene(),
terrainProvider = new Cesium.CesiumTerrainProvider({
  url : '//assets.agi.com/stk-terrain/world'


Nothing is rendered if I enable the Cesium map. MousePositionControl show NaN coordinates.

Also I get an error if I try to add Layers to map after ol3d.setEnable(true) is set.

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.