2

I have saved NaturalEarth data set in my desktop. Then I created a view as below.

        <script>
            var viewer = new Cesium.Viewer('cesiumContainer', {
                imageryProvider: Cesium.createTileMapServiceImageryProvider({
                    url: 'C:\Users\name\Desktop\NaturalEarthII'
                }),
                baseLayerPicker: false,
                geocoder: false
            });
        </script>

But the viewer does not show the map. What I want is to use Natural Earth data set offline. But if I saved the data set in 'Assets/Textures/NaturalEarthII' in cesium folder in the project it works fine with the below code.

 var viewer = new Cesium.Viewer('cesiumContainer', {
                imageryProvider: Cesium.createTileMapServiceImageryProvider({
                    url: Cesium.buildModuleUrl('Assets/Textures/NaturalEarthII')
                }),
                baseLayerPicker: false,
                geocoder: false
            });

What's the wrong I have made?

  • Websites can't access local files. You need to serve the files, as Cesium's debug server.js does for its reduced copy of NaturalEarthII. Cesium is requesting those from the server and it's up to the server to read them from disk, even if client and server both live on the same machine. – emackey Aug 17 '18 at 4:11

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.