Rendering polygons from a GeoJSON

81 views
Skip to first unread message

Sam

unread,
Jun 10, 2019, 12:49:45 AM6/10/19
to cesium-dev
1. A concise explanation of the problem you're experiencing.
I am trying to render multiple polygons from a GeoJSON and fill them blue. I followed the example from the link below. The polygons render, but the "fill" is not applied and they are empty inside. It only shows the border.


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


3. Context. Why do you need to do this? We might know a better way to accomplish your goal.
I get a GeoJSON from a rest service with about 20 polygons. I need to shade them to show different regions on the globe to visualize rainfall data.



4. The Cesium version you're using, your operating system and browser.
1.50.0, Windows 10, Chrome


Thank you for your help

Scott Reynolds

unread,
Jun 10, 2019, 7:42:42 PM6/10/19
to cesium-dev
Your GeoJSON has the wrong geometry type, MultiLineString vs Polygon.

Sam

unread,
Jun 11, 2019, 12:19:12 PM6/11/19
to cesium-dev
Thanks Scott. That fixes it when I render a single polygon. However when I have multiple polygons, then only one of them is shaded. Do you know what is the best way to fix that? I put an example below.



Thanks


Scott Reynolds

unread,
Jun 12, 2019, 8:20:07 AM6/12/19
to cesium-dev
The MultiPolygon is poorly formed (missing braces around each line string that makes a single polyline. Sandcastle.


Sam

unread,
Jun 12, 2019, 11:51:15 AM6/12/19
to cesium-dev
Thanks Scott. That fixed the problem I was having.
Reply all
Reply to author
Forward
0 new messages