You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 26, 2019. It is now read-only.
Currently if you take a random Cesium sandcastle example (for example):
// Add several billboards based on the above image in the atlas.
viewer.entities.add({
position : Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883),
billboard : {
image : '../images/whiteShapes.png',
imageSubRegion : new Cesium.BoundingRectangle(49, 43, 18, 18),
color : Cesium.Color.LIME
}
});
viewer.entities.add({
position : Cesium.Cartesian3.fromDegrees(-84.0, 39.0),
billboard : {
image : '../images/whiteShapes.png',
imageSubRegion : new Cesium.BoundingRectangle(61, 23, 18, 18),
color : new Cesium.Color(0, 0.5, 1.0, 1.0)
}
});
It is compiler errors galore on the objects being added. This is because the API documentation states that these are meant to be Cesium.Entity instances. But because Cesium.Entity is a class, it is not assignable from an object that happens to have the same "shape" as it.
From this I strongly suspect that Entity should really be a TS interface, but have a declared var of the same name that defines the constructor.
With this pattern (and a switch that allows all members of the class-now-interface to be optional), it should allow for the above sandcastle example to be legal.
This is how TypeScript defines built-ins like Object, String, etc.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Currently if you take a random Cesium sandcastle example (for example):
It is compiler errors galore on the objects being added. This is because the API documentation states that these are meant to be
Cesium.Entity
instances. But becauseCesium.Entity
is a class, it is not assignable from an object that happens to have the same "shape" as it.From this I strongly suspect that
Entity
should really be a TS interface, but have a declared var of the same name that defines the constructor.So where we currently have this
The plugin should have the ability for us to say that
Entity
should be an interface, that should then generate something like this:With this pattern (and a switch that allows all members of the class-now-interface to be optional), it should allow for the above sandcastle example to be legal.
This is how TypeScript defines built-ins like
Object
,String
, etc.The text was updated successfully, but these errors were encountered: