Skip to content
New issue

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

RectanglePrimitive has been deprecated #14

Open
gezonthenet opened this issue Jan 20, 2016 · 7 comments
Open

RectanglePrimitive has been deprecated #14

gezonthenet opened this issue Jan 20, 2016 · 7 comments

Comments

@gezonthenet
Copy link

As of Cesium 1.17 RectanglePrimitve has been deprecated so this will need to be updated as the Extent primitive can no longer be drawn.

@mgiraldo
Copy link

@getardretard did you manage to figure out a way of solving this?

@gezonthenet
Copy link
Author

I am no expert but I updated this section:

if (extent == null) { 
                //extent = new Cesium.RectanglePrimitive();
                //extent.asynchronous = false;
                //primitives.add(extent);
                extent = new Cesium.Primitive({
                        geometryInstances :  new Cesium.RectangleGeometry()
                        //appearance : new Cesium.EllipsoidSurfaceAppearance({
                        //      material : Cesium.Material.fromType('Checkerboard')
                        //})
                });
                extent.asynchronous = false;
                primitives.add(extent);
}
extent.geometryInstances.rectangle = value;

But I cannot get the rectangle to be yellow when it is first drawn. When I add the appearance option (just to test) I get an error saying there is an undefined Worker.

@brackmayhall
Copy link

I just changed extent = new Cesium.RectanglePrimitive(); to extent = new Cesium.Primitive();

@raghuburgala
Copy link

Hi @getardretard, I am using following but still not getting rectangle while drawing.. did you get any solution for this.

if(extent == null) {
var rectangleInstance = new Cesium.GeometryInstance({
geometry : new Cesium.RectangleGeometry({
rectangle : value,
vertexFormat : Cesium.PerInstanceColorAppearance.VERTEX_FORMAT
}),
attributes : {
color : new Cesium.ColorGeometryInstanceAttribute(0.0, 1.0, 1.0, 0.5)
}
});

            extent = new Cesium.Primitive({
              geometryInstances : rectangleInstance,
              appearance : new Cesium.PerInstanceColorAppearance(),
              releaseGeometryInstances: false
            });
            //extent.material = options.material;
            extent.asynchronous = false;
            primitives.add(extent);
        }
        extent.geometryInstances.geometry._rectangle = value;

Thanks

@gezonthenet
Copy link
Author

Hi @raghuburgala, I still use the code I posted above. I haven't seen any update to this. It seems to do the job for me. Cheers.

@raghuburgala
Copy link

Hi @getardretard, I resolved my issue by using following code.

if(extent == null) { extent = new DrawHelper.ExtentPrimitive({ extent : value, material : options.material, }); extent.asynchronous = false; primitives.add(extent); } extent.setExtent(value);

Thanks.

@chillgis
Copy link

cesium version 1.24 can't find the api of RectanglePrimitive or ExtentPrimitive.
replace it GroundPrimitive,and i find it works!
http://cesiumjs.org/Cesium/Build/Documentation/GroundPrimitive.html?classFilter=GroundPrimitive

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants