I have a GeoJson file that is pretty simple. A bunch of line strings between markers. Most of it looks great, but some of the lines appear to be tapering off into nothing, or disappearing. I’ll add a picture to show what I’m talking about.
I originally thought the lines may have been going below the surface, but when I raised the entire layer into the sky, the problem persisted.
I also tried changing the stroke width, but that didn’t help.
Here is the function I’m using to add the data to my map:
function renderMap(data) {
var dataSource = Cesium.GeoJsonDataSource.load(data, {
stroke: Cesium.Color.fromBytes(0, 230, 240, 38)
});
viewer.dataSources.add(dataSource);
viewer.zoomTo(dataSource);
}
``
I’m using Chrome on OSX, but the problem is on Safari as well.
Thanks for the help!
This appears to be a bug in how GeoJSON is displayed. I’ve attached a sandcastle with my data and the same problem is evident in many of the lines.
GeoJSON simplestyle.html (2.08 KB)
Hi Arel,
I was able to reproduce this, and we are tracking this issue in GitHub. I’ll update it with this report as well. There’s a workaround in that thread for the time being.
Thanks,
Gabby
I just figured out what was causing the problem. I’ll also post on the GH issue.
If I had polyline or GeoJson line with three points, where the third point was the same as the first point, the line would appear tapered. So, for example, I track flights. If a flight flew from JFK to SFO and back to JFK, the line would appear tapered at the point of return to JFK, so SFO. My solution was, on a multi point polyline to just add in a conditional that if the origin and destination were the same, don’t add the destination to the polyline.
Thanks for providing the workaround in both places!