Hello Patrik/Steve,
i am trying to render groundoverlay on the cesium map with the coordinates of ground overlay as -122.3868805967123,37.7900762525768,0
i tried calculation coordinates positions based on west , east, south or north. as given below
double west = bbox.getHighX();
double south = bbox.getHighY();
double east = bbox.getLowX();
double north = bbox.getLowY();
Cartographic cartographicArray = {new Cartographic(west, north, 0),new Cartographic(east, north, 0), new Cartographic(east, south, 0), new Cartographic(west, south, 0),new Cartographic(west, north, 0)};
the czml which is generated based on the above code snippet is as given below:
[
{
“id”:“document”,
“version”:“1.0”
},
{
“id”:“CZML1421214062290011078271077277762”,
“description”:“ground overlay Feature”,
“polygon”:{
“material”:{
“solidColor”:{
“color”:{
“rgba”:[
255,127,127,153
]
}
}
},
“fill”:true,
“positions”:{
“cartographicDegrees”:[
-122.38598228464069,37.78917794050518,0,-122.38777890878391,37.78917794050518,0,-122.38777890878391,37.79097456464842,0,-122.38598228464069,37.79097456464842,0,-122.38598228464069,37.78917794050518,0
]
}
}
}
]
but still i am unable to render the ground overlay on the cesium map. i am going wrong at the positions only, could you please let me know whether the above way of generation of positions is the rightway for generation of coordinate degrees positions . please let me know where i have gone wrong in rendering ground overlay on cesium map.
i could do the above in javascript as given below, but not able to render the same in czml as given above. it would be great if u could provide the alternative for the below in CZML.
can we replicate the below rectangle primitive in CZML.
var filledPolygonRectangle = new Cesium.RectanglePrimitive({
rectangle : Cesium.Rectangle.fromDegrees(east,north,west,south),
//rotation : Cesium.Math.toRadians(45),
fill : ‘true’,
id : layerId,
material : Cesium.Material.fromType(Cesium.Material.ImageType , {
image : logoUrl
})
});
scene.primitives.add(filledPolygonRectangle);
thanks a lot .
regards
chandrika