Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KML Lines not clamped to ground #8404

Closed
fironalia opened this issue Nov 18, 2019 · 11 comments
Closed

KML Lines not clamped to ground #8404

fironalia opened this issue Nov 18, 2019 · 11 comments

Comments

@fironalia
Copy link

fironalia commented Nov 18, 2019

i have a kml that i want to add it to cesium, this kml contains lines and polygones.
polygones clamped to ground works fine, but lines are not working, is there any way to do it? or it is really a problem ??

@Crocsx
Copy link

Crocsx commented Nov 19, 2019

Might be related to #4326

@fironalia
Copy link
Author

this problem is related to kmldatasrouces.Only lines are not clamped.

@OmarShehata
Copy link
Contributor

@fironalia please share a Sandcastle example reproducing this issue. If you're not sure if it's a bug you can always ask on the Cesium forum.

@fironalia
Copy link
Author

@OmarShehata i am sure it is a bug, points and polygones are clamped to ground, but lines are not.
if you load any kml file that contains lines you will see that these lines are not clamped.
Polygones and points works fine.
i am loading points and polygones the same way with the lines.so for sure it is a bug, or there is something else missing that i dont know it.

@OmarShehata
Copy link
Contributor

@fironalia submitting a complete bug report requires putting together a reproducible code example that shows the issue so we can test/debug it. Otherwise it's unclear whether the problem is in your code, or if it is a bug, where the issue may be.

For example, are you setting the clampToGround option when loading the KML as shown in the docs? https://cesium.com/docs/cesiumjs-ref-doc/KmlDataSource.html?classFilter=kmlData#.load

Here's a code example that shows that shows a line from a KML file clamped to ground in CesiumJS.

@fironalia
Copy link
Author

fironalia commented Nov 19, 2019

i really thank you for your fast replies.
in the example, you are assigning to the coordinates an Altitude value (2357), i am not assigning an Altitude value to line coordinates same for the polygones. polygones without any altitude value, Clamped to ground works. but with lines it does not work.
And YES i am setting clampedToGround option when loading the KML.

@fironalia
Copy link
Author

fironalia commented Nov 20, 2019

@OmarShehata this is an example for a kml file that conains one line and one polygon, if you want to try it. you will see that lines are clamped to ellipsoid and not to the terrain.
and the javascript code is :
var kml = kmlDataSrouce.load('http://examplehost/example.kml',
{
camera : viewer.scene.camera,
canvas: viewer.scene.canvas,
clampToGround : true
});
viewer.dataSources.add(kml);

example1.txt

@fironalia
Copy link
Author

@OmarShehata am i right or wrong ?

@OmarShehata
Copy link
Contributor

@fironalia your line is not clamped because the tesselate flag is false by default. You can fix this by adding <tessellate>1</tessellate>. I'm closing this because it's not a bug. I opened a PR inhttps://github.com//pull/8428 to add a warning when the clampToGround flag is ignored or perhaps to document the cases when a line cannot be clamped.

@fironalia
Copy link
Author

fironalia commented Dec 5, 2019

@OmarShehata
when i add
**<tessellate>1</tessellate>** a message shows : An error occurred while rendering.Rendering has stopped.
i added tessellate to the same example i have sent right after the altitudeMode.

@fironalia
Copy link
Author

fironalia commented Dec 8, 2019

@OmarShehata
i tried the file "example1" with <tessellate>1</tessellate> in googleEarth and no error occured.
but in cesium the same message shows "An error occurred while rendering.Rendering has stopped.Undefined Object"

If I dont write <tessellate>1</tessellate> no error occured but line not clamping, when i write <tessellate>1</tessellate> the error occurs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants