post data from server.js in cesium 1.47 to helloworld app

1. A concise explanation of the problem you’re experiencing.

2. A minimal code example. If you’ve found a bug, this helps us reproduce and repair it.

3. Context. Why do you need to do this? We might know a better way to accomplish your goal.

4. The Cesium version you’re using, your operating system and browser.

Hi! Could you give more details on what you’re trying to do and what issues you’ve run into?

i am new in cesium also in javascript kindly help me how to forward data to browser so that helloworld application can take tose data and based on that it will able to draw a line on cesium earth

Ah, cool :slight_smile:

Have you tried playing around first in Cesium Sandcastle?

You can paste the following code to put a polyline on Cesium World Terrain. Is this what you’re looking for?

var viewer = new Cesium.Viewer(‘cesiumContainer’, {

//Use Cesium World Terrain

terrainProvider : Cesium.createWorldTerrain()

});

viewer.entities.add({

  polyline : {

      positions : Cesium.Cartesian3.fromDegreesArray([

          86.953793, 27.928257,

          86.953793, 27.988257,

          86.896497, 27.988257

      ]),

      clampToGround : true,

      width : 5,

      material : new Cesium.PolylineOutlineMaterialProperty({

          color : Cesium.Color.ORANGE,

          outlineWidth : 2,

          outlineColor : Cesium.Color.BLACK

      })

  }

});

var target = new Cesium.Cartesian3(300770.50872389384, 5634912.131394585, 2978152.2865545116);

var offset = new Cesium.Cartesian3(6344.974098678562, -793.3419798081741, 2499.9508860763162);

viewer.camera.lookAt(target, offset);

viewer.camera.lookAtTransform(Cesium.Matrix4.IDENTITY);

``

This was taken from this Ground Clamping tutorial, which shows how to clamp different shapes to the terrain.

Hope this helps!

thak you for your valuable reply but i want that offset value should be passed from the server.js

Is there a specific reason you need it passed from server.js? And are you trying to make it so that the values are adjustable in your app? If so, server.js isn’t really the right place to do this!

This Cesium workshop that introduces how to use Cesium and its API could be helpful! Have you checked it out yet?

Actually I want to lat long information of a object passed from another application through UDP socket now I able to receive those information in server.is now my requirement is to pass those information to the hello world application so that it can draw a continuous line as per the information coming from time to time

Is there a specific reason you need it passed from server.js? And are you trying to make it so that the values are adjustable in your app? If so, server.js isn't really the right place to do this!

This Cesium workshop that introduces how to use Cesium and its API could be helpful! Have you checked it out yet?

thak you for your valuable reply but i want that offset value should be passed from the server.js

Ah, cool :slight_smile:

Have you tried playing around first in Cesium Sandcastle?

You can paste the following code to put a polyline on Cesium World Terrain. Is this what you're looking for?

var viewer = new Cesium.Viewer('cesiumContainer', {
//Use Cesium World Terrain
terrainProvider : Cesium.createWorldTerrain()
});

viewer.entities.add({
polyline : {
positions : Cesium.Cartesian3.fromDegreesArray([
86.953793, 27.928257,
86.953793, 27.988257,
86.896497, 27.988257
]),
clampToGround : true,
width : 5,
material : new Cesium.PolylineOutlineMaterialProperty({
color : Cesium.Color.ORANGE,
outlineWidth : 2,
outlineColor : Cesium.Color.BLACK
})
}
});

var target = new Cesium.Cartesian3(300770.50872389384, 5634912.131394585, 2978152.2865545116);
var offset = new Cesium.Cartesian3(6344.974098678562, -793.3419798081741, 2499.9508860763162);

viewer.camera.lookAt(target, offset);
viewer.camera.lookAtTransform(Cesium.Matrix4.IDENTITY);
This was taken from this Ground Clamping tutorial, which shows how to clamp different shapes to the terrain.

Hope this helps!

i am new in cesium also in javascript kindly help me how to forward
data to browser so that helloworld application can take tose data and
based on that it will able to draw a line on cesium ear

Thank u

Thank u if it not possible through server is then suggest me how I will forward data towards the helloworld application also that data required to come through UDP socket

I am new in cesium kindly help how bellow world application receive UDP packet data

I am new in cesium kindly help me how to receive UDP data in hello world application