There are multiple problems with your code.
-
You are using double quotes inside of your string which is also defined with double quotes.
-
You aren’t properly escaping new lines
-
You are using CzmlDataSource instead of KmlDataSource
-
KmlDataSource doesn’t take a string, only a url or parsed Document.
Here’s what the working code looks like:
var viewer = new Cesium.Viewer(‘cesiumContainer’);
var testkml=’<?xml version="1.0" encoding="UTF-8"?>\
\
\
\
New point\
This is a new point.\
\
\
135.2, 35.4, 0.\
\
\
\
\
';
var parser = new DOMParser();
viewer.dataSources.add(Cesium.KmlDataSource.load(parser.parseFromString(testkml, “text/xml”)));