Hi,
I am using GeoJSON files for my project with Cesium..
so far they are all loaded as yellow, transparent buildings.
is there a way to load the styles saved via QGIS for example,
it saves the styles in a different layer as SLD or a .qml
Any Ideas how I can achieve my pre-customised symbology?
or other methods to get an attribute defined style, i.e. according to height or population?
Thanks a bunch
Hi there,
I don’t know of a way to load a style file of that format, but fortunately it’s pretty easy to style your geojson files afterwards. See this sandcastle example: http://cesiumjs.org/Cesium/Apps/Sandcastle/index.html?src=GeoJSON%20and%20TopoJSON.html&label=Showcases
Hope that helps,
Hey Rachel,
Thank you so much for your help.
but I have one more question:
Will the code example of (3D Tiles Feature Styling) work for GeoJson data?
particularly the function: where is colours the data according to height.
function colorByHeight() {
    tileset.style = new Cesium.Cesium3DTileStyle({
        color: {
            conditions: [
                ["\{height\} >= 300", "rgba\(45, 0, 75, 0\.5\)"\],
\["{height} >= 200", "rgb(102, 71, 151)"],
                ["\{height\} >= 100", "rgb\(170, 162, 204\)"\],
\["{height} >= 50", "rgb(224, 226, 238)"],
                ["\{height\} >= 25", "rgb\(252, 230, 200\)"\],
\["{height} >= 10", "rgb(248, 176, 87)"],
                ["${height} >= 5", "rgb(198, 106, 11)"],
                ["true", "rgb(127, 59, 8)"]
            ]
        }
    });
}
"" tileset.style = new Cesium.Cesium3DTileStyle({""
is there any way I can apply that to GeoJson data?
Hi there,
Unfortunately that styling language is currently something that’s unique to 3D tiles.
Best,
Thank you Rachel...
you've been a great help