Search code examples
javascriptmavencesiumjs

include cesium in a project


I'm working on a maven project, and I want to integrate Cesium into a html page I did this in my page html:

<link rel="stylesheet" href="./lib/Cesium/Widgets/CesiumWidget/CesiumWidget.css" type="text/css">
<script src="./lib/Cesium/Cesium.js"></script>

<div id="cesiumContainer"></div>
  <script>
var widget = new Cesium.CesiumWidget('cesiumContainer');
</script>

i have this error message :

Cesium.js:488 Uncaught SyntaxError: Invalid regular expression: /[×-ת؀-Û¿Ý-ݿࢠ-ࣿ]/: Range out of order in character class
    at new RegExp (<anonymous>)
    at Cesium.js:488
    at c (Cesium.js:451)
    at a (Cesium.js:451)
    at c (Cesium.js:451)
    at a (Cesium.js:451)
    at c (Cesium.js:451)
    at a (Cesium.js:451)
    at c (Cesium.js:451)
    at a (Cesium.js:451)
(anonymous) @ Cesium.js:488
c @ Cesium.js:451
a @ Cesium.js:451
c @ Cesium.js:451
a @ Cesium.js:451
c @ Cesium.js:451
a @ Cesium.js:451
c @ Cesium.js:451
a @ Cesium.js:451
c @ Cesium.js:451
d @ Cesium.js:451
(anonymous) @ Cesium.js:538
(anonymous) @ Cesium.js:538
(index):259 Uncaught ReferenceError: Cesium is not defined
    at (index):259
(anonymous) @ (index):259

he does not recognize that: Cesium.Viewer

What is the procedure to be done and the libraries I need to integrate?


Solution

  • Whatever web server you are using is not properly configured to send the Cesium.js file as UTF-8.

    You can either add <meta charset="UTF-8"> to your page's <head> tag or add charset="UTF-8" to the <script> tag.