We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I am trying to style Cesium OSM Buildings using Resium's Cesium3DTileset and style attribute. Below is the component:
Cesium3DTileset
style
import * as React from 'react' import {CameraFlyTo, Cesium3DTileset, Primitive, Viewer} from 'resium' import {Cartesian3, Cesium3DTileStyle, createOsmBuildings, createWorldTerrain, Ion, IonResource, Math} from 'cesium' interface BuildingsProps { } interface BuildingsState { style: Cesium3DTileStyle } export default class Buildings extends React.Component<BuildingsProps, BuildingsState> { constructor(props: BuildingsProps) { super(props) this.state = { style: new Cesium3DTileStyle({ color: { conditions: [ [ "${feature['building']} === 'apartments' || ${feature['building']} === 'residential'", "color('cyan', 0.9)", ], [true, "color('white')"], ], }, }) } } render() { return ( <Viewer animation={false} full terrainProvider={createWorldTerrain()} useBrowserRecommendedResolution={true} > <CameraFlyTo cancelFlightOnUnmount destination={Cartesian3.fromDegrees(-122.3472, 47.598, 370)} once orientation={ { heading: Math.toRadians(10), pitch: Math.toRadians(-10) } } /> <Cesium3DTileset url={IonResource.fromAssetId(96188)} style={this.state.style} /> </Viewer> ) } }
The map view is rendering properly but the style is not. Can someone help me out with this?
The text was updated successfully, but these errors were encountered:
This is a workaround I have found, and it works:
<Cesium3DTileset immediatelyLoadDesiredLevelOfDetail={true} url={IonResource.fromAssetId(96188)} onReady={(tileset) => { var extras = tileset.asset.extras; if ( defined(extras) && defined(extras.ion) && defined(extras.ion.defaultStyle) ) { tileset.style = new Cesium3DTileStyle({ color: { conditions: [ ['${elementId} === 266548230',"color('red')"], ['${elementId} === 266547173',"color('red')"], ['${elementId} === 820382924',"color('green')"], [true, 'color("white")'] ] } }); } }} `` />
<Cesium3DTileset immediatelyLoadDesiredLevelOfDetail={true}
url={IonResource.fromAssetId(96188)}
onReady={(tileset) => {
var extras = tileset.asset.extras;
if (
defined(extras) &&
defined(extras.ion) &&
defined(extras.ion.defaultStyle)
) {
tileset.style = new Cesium3DTileStyle({
color: {
conditions: [
['${elementId} === 266548230',"color('red')"],
['${elementId} === 266547173',"color('red')"],
['${elementId} === 820382924',"color('green')"],
[true, 'color("white")']
]
}
});
}}
/>
Sorry, something went wrong.
Resium v1.14 fixed this bug. Try it!
Hi, In Resium how you managed to create createOsmBuildings()
No branches or pull requests
I am trying to style Cesium OSM Buildings using Resium's
Cesium3DTileset
andstyle
attribute. Below is the component:The map view is rendering properly but the style is not. Can someone help me out with this?
The text was updated successfully, but these errors were encountered: