polygon line width

516 views
Skip to first unread message

michael...@shonborn-becker.com

unread,
Oct 19, 2015, 12:48:02 PM10/19/15
to cesium-dev
I'm getting a line width of 1 pixel each time for polygons despite setting different line widths in the KML:
<LineStyle><color>#FF000000</color><colorMode>normal</colorMode><width>3</width></LineStyle>
I'm displaying as follows:
                    var kmlDocument = new DOMParser().parseFromString(kmlString, "application/xml");
                    viewer.dataSources.add(Cesium.KmlDataSource.load(kmlDocument));
How is Cesium interpreting the KML for the polygon outline?

Matthew Amato

unread,
Oct 20, 2015, 12:53:14 AM10/20/15
to cesiu...@googlegroups.com
Are you on Windows?  If so the answer is that your browser is artificially limiting the width of geometry outlines to 1.  Line width will work on non-windows systems like Android, Linux, and Mac.  I wrote up a fairly comprehensive answer to this question a while ago on Stack Overflow, here's the link: http://stackoverflow.com/a/25405483/3191039

If you aren't on Windows, then this may be a bug.

--
You received this message because you are subscribed to the Google Groups "cesium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cesium-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

michael...@shonborn-becker.com

unread,
Oct 20, 2015, 10:51:00 AM10/20/15
to cesium-dev
I'm using Firefox on windows 7. I've noticed the problem also using the same KML file in Cesium Viewer on IE and on Chrome. The problem is with polygons only. I have no trouble rendering thick polylines (LineString).

Matthew Amato

unread,
Oct 20, 2015, 10:56:30 AM10/20/15
to cesiu...@googlegroups.com
Yes, this applies to polygons and other shape/volume geometry only.  Polylines go through a very different (and complicated) rendering path.  So the behavior you are seeing is a limitation of browsers on Windows, and not Cesium.

Berwyn McKilligan

unread,
Oct 21, 2015, 1:06:53 PM10/21/15
to cesium-dev
As a work around for drawing polygons with wider line widths I am draw a regular polyline with the desired thickness in addition to the polygon.

Where things get a little tricky is with polygons on the ground with terrain. To get the lines to follow the terrain one needs to sample the terrain and break each line segment into subsegments with the sampled elevation 

Guillaume Beraudo

unread,
Oct 22, 2015, 4:29:18 AM10/22/15
to Cesium Dev
Berwyn, polygon on terrain is now supported by Cesium.

Reply all
Reply to author
Forward
0 new messages