zsoooc Posted November 16, 2018 Report Share Posted November 16, 2018 (edited) Hi All! I would like to test the Ol-Cesium on my computer with this example: https://openlayers.org/ol-cesium/examples/oldfashioned.html I saved the olcs.css, olcesium.js and Cesium.js file into my webserver's folder. So, here is my code (I replaced only the lines where JS and CSS are located, the others are the same). The 2D view with only OpenLayers is works well, but the 3D Cesium view doesn't. The map is black, and I got no error messages in console. Do you have any tips what cause this error? <html> <head> <meta charset="UTF-8"> <link rel="stylesheet" href="https://cdn.rawgit.com/openlayers/openlayers.github.io/master/en/v5.3.0/css/ol.css" type="text/css"> <link rel="stylesheet" href="olcs.css" type="text/css"> <style> #map { height: 300px; width: 500px } </style> <script src="https://cdn.rawgit.com/openlayers/openlayers.github.io/master/en/v5.3.0/build/ol.js"></script> <script src="olcesium.js"></script> <script src="Cesium.js"></script> </head> <body> <p>Old-fashioned example</p> <input id="enable" type="button" value="Enable/disable" /> <div id="map"></div> </body> <script> var ol2d = new ol.Map({ layers: [ new ol.layer.Tile({ source: new ol.source.OSM() }) ], target: 'map', view: new ol.View({ center: ol.proj.transform([25, 20], 'EPSG:4326', 'EPSG:3857'), zoom: 3 }) }); var ol3d = new olcs.OLCesium({ map: ol2d, }); ol3d.setEnabled(true); var setEnabled = function() {ol3d.setEnabled(!ol3d.getEnabled())}; document.getElementById('enable').addEventListener('click', setEnabled); </script> </html> Edited November 16, 2018 by zsoooc insert image Quote Link to comment Share on other sites More sharing options...
Lurker Posted November 19, 2018 Report Share Posted November 19, 2018 this path : https://openlayers.org/ol-cesium/node_modules/@camptocamp/cesium/Build/CesiumUnminified/Cesium.js seems a part of whole cesium system, so if you just make this file local and do not have others then, it failed Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.