use of org.vaadin.addon.leaflet.LFeatureGroup in project v-leaflet by mstahv.
the class BasicJtsTest method getTestComponent.
public Component getTestComponent() {
leafletMap = new LMap();
// Not creating a name -> not added to the
lfg = new LFeatureGroup();
// overlay controller
Polygon poly = getPolygon();
Collection<LeafletLayer> lPoly = JTSUtil.toLayers(poly);
lfg.addComponent(lPoly);
MultiPolygon multiPolygon = getMultiPolygon();
Collection<LeafletLayer> lMultiPoly = JTSUtil.toLayers(multiPolygon);
lfg.addComponent(lMultiPoly);
LineString lineString = getLineString();
Collection<LeafletLayer> lLine = JTSUtil.toLayers(lineString);
lfg.addComponent(lLine);
// MultiLineString multiLineString = getMultiLineString();
// Collection<LeafletLayer> lMultiLine = JTSUtil.toLayers(multiLineString);
// lfg.addComponent(lMultiLine);
MultiPoint multiPoint = getMultiPoint();
Collection<LeafletLayer> lMultiPoint = JTSUtil.toLayers(multiPoint);
lfg.addComponent(lMultiPoint);
Point point = getPoint();
Collection<LeafletLayer> lPoint = JTSUtil.toLayers(point);
lfg.addComponent(lPoint);
leafletMap.setZoomLevel(5);
leafletMap.setCenter(multiPolygon.getCentroid());
leafletMap.addComponent(lfg);
return leafletMap;
}
use of org.vaadin.addon.leaflet.LFeatureGroup in project v-leaflet by mstahv.
the class PolygonWithHolesTest method getTestComponent.
public Component getTestComponent() {
leafletMap = new LMap();
// Not creating a name -> not added to the
lfg = new LFeatureGroup();
// overlay controller
LPolygon polygon = new LPolygon();
polygon.setPoints(new Point[] { new Point(0, 0), new Point(30, 30), new Point(30, 0) });
polygon.setHoles(new Point[] { new Point(20, 20), new Point(25, 25), new Point(25, 20) });
// non complete hole
polygon.setHoles(new Point[] { new Point(5, 10), new Point(15, 15), new Point(15, 10) });
polygon.setColor("green");
lfg.addComponent(polygon);
Polygon poly = getPolygon();
Collection<LeafletLayer> lPoly = JTSUtil.toLayers(poly);
lfg.addComponent(lPoly);
leafletMap.setZoomLevel(5);
leafletMap.addComponent(lfg);
leafletMap.zoomToContent();
return leafletMap;
}
Aggregations