0

I am trying setting up a self hosted VR-TheWorld server and render using Cesium.

When connecting to the VR-TheWorld server using a WebMapServiceImageryProvider (or a TileMapServiceImageryProvider) in cesium it connectes and renders correctly.

When point it to my locally hosted version, cesium throws the error:

An error occurred while rendering. Rendering has stopped.<br />
SecurityError: SecurityError

I cannot work out what is causing this error to occur, any pointers in the right direction would be appreciated.

HTML page used to connect below.

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Web Viewer</title>
    <!-- Use correct character set. -->
    <meta charset="utf-8">
    <!-- Tell IE to use the latest, best version (or Chrome Frame if pre-IE11). -->
    <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
    <script src="../Build/Cesium/Cesium.js"></script>
    <style>
        @import url(../Build/Cesium/Widgets/widgets.css);
        html, body, #cesiumContainer {
            width: 100%; height: 100%; margin: 0; padding: 0; overflow: hidden; 
        }
    </style>
</head>
<body>
    <div id="cesiumContainer"></div>
    <script type="text/javascript">
        var viewer = new Cesium.Viewer('cesiumContainer', {
            imageryProvider: new Cesium.WebMapServiceImageryProvider({
                url: 'http://www.vr-theworld.com/vr-theworld/tiles?',
                //url: 'http://vrtw.local/tiles?',
                layers: 1
            }),
            //imageryProvider: new Cesium.TileMapServiceImageryProvider({
                //url: 'http://www.vr-theworld.com/vr-theworld/tiles1.0.0/1/',
                //url: 'http://vrtw.local/tiles1.0.0/1/',
                //fileExtension: 'jpeg'
            //}),
            baseLayerPicker: false
        });
  </script>
</body>
</html>

1 Answers1

1

Turns out to be a CORS issue.

Once enabled on the localhost server cesium displayed the local data with no problems.

Community
  • 1
  • 1