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

Polygon outlineWidth property is ignored #4223

Closed
pierotofy opened this issue Aug 22, 2016 · 4 comments
Closed

Polygon outlineWidth property is ignored #4223

pierotofy opened this issue Aug 22, 2016 · 4 comments

Comments

@pierotofy
Copy link
Contributor

While running this code:

Cesium.Math.setRandomNumberSeed(1234);

var viewer = new Cesium.Viewer('cesiumContainer', { infoBox : false });
var entities = viewer.entities;
var positions = Cesium.Cartesian3.fromDegreesArray([
            -107.0, 31.0,
            -107.0, 39.0,
            -97.0, 39.0,
            -97.0, 31.0
        ]);

entities.add({
    polygon : {
        height: 0,
        hierarchy : new Cesium.PolygonHierarchy(positions),
        material : Cesium.Color.BLUE,
        outline: true,
        outlineColor: Cesium.Color.RED,
        outlineWidth: 50
    }
});


viewer.zoomTo(viewer.entities);

Note the outlineWidth set to 50, which should draw a fairly thick outline.

But the outline is fairly thin, and doesn't change if you modify the value to something else, say 1, or 200.

image

@hpinkos
Copy link
Contributor

hpinkos commented Aug 22, 2016

Hello @pierotofy,
Sorry, but line width is something that is dependent on the browser's WebGL implementation, so it's a little beyond our control.
I believe a wider line is currently only supported on Safari? I'm not quite sure.

@hpinkos hpinkos closed this as completed Aug 22, 2016
@pierotofy
Copy link
Contributor Author

Should this be mentioned somewhere in the docs?

@mramato
Copy link
Member

mramato commented Aug 22, 2016

See this post: http://stackoverflow.com/a/25405483/3191039 It's a limitation of the WebGL implementations on Windows (but is completely in spec). It works on standard OpenGL implementations (which means phones, Linux, Mac, and etc.)

The maximum value on the current system is documented and exposed via scene.maximumAliasedLineWidth and this limitations is also mentioned in our Visualizing Spatial Data tutorial.

@pierotofy
Copy link
Contributor Author

Ok! Thanks to both for the info!

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

3 participants