Class PolygonFeature

All Implemented Interfaces:
FeatureClickNotifier<PolygonFeature>, Serializable

public class PolygonFeature extends Feature implements FeatureClickNotifier<PolygonFeature>
Polygon feature with predefined PolygonGeometry. Usage example:
 protected void addPolygons(VectorSource source) {
     GeometryFactory geometryFactory = GeometryUtils.getGeometryFactory();

     LinearRing shell = geometryFactory.createLinearRing(new Coordinate[]{
             new Coordinate(9.844944, 44.011077),
             new Coordinate(12.286243, 44.525239),
             new Coordinate(18.389491, 40.011935),
             new Coordinate(15.732783, 38.003544),
             new Coordinate(9.844944, 44.011077),
     });
     Polygon polygon = geometryFactory.createPolygon(shell);
     source.addFeature(new PolygonFeature(polygon));
 }
 
See Also: