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 holes cannot be displayed #591

Closed
sunshine0576 opened this issue Sep 18, 2018 · 2 comments
Closed

Polygon holes cannot be displayed #591

sunshine0576 opened this issue Sep 18, 2018 · 2 comments
Labels

Comments

@sunshine0576
Copy link

    Style style = Style.builder()
            .fillColor(Color.RED)
            .strokeColor(Color.BLACK).build();

    Coordinate[] coord_shell=new Coordinate[]{
            new Coordinate(0,0),
            new Coordinate(10,0),
            new Coordinate(10,10),
            new Coordinate(0,10),
            new Coordinate(0,0)
    };
    Coordinate[] coord_hole1=new Coordinate[]{
            new Coordinate(2,2),
            new Coordinate(8,2),
            new Coordinate(8,8),
            new Coordinate(2,8),
            new Coordinate(2,2)
    };
    GeometryFactory geometryFactory=new GeometryFactory();
    LinearRing shell=geometryFactory.createLinearRing(coord_shell);
    LinearRing hole1=geometryFactory.createLinearRing(coord_hole1);
    Geometry geometry=geometryFactory.createPolygon(shell,new LinearRing[]{hole1});
    vectorLayer.add(new PolygonDrawable(geometry, style));
    vectorLayer.update();
@sunshine0576
Copy link
Author

1212

@devemux86
Copy link
Collaborator

See my answer in opensciencemap#178.

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

No branches or pull requests

2 participants