Package org.geomajas.plugin.rasterizing.command.dto

Examples of org.geomajas.plugin.rasterizing.command.dto.ClientGeometryLayerInfo


      }
    }
    mapRasterizingInfo.getExtraLayers().clear();
    for (WorldPaintable worldPaintable : map.getWorldPaintables().values()) {
      if (worldPaintable instanceof GfxGeometry) {
        ClientGeometryLayerInfo layer = new ClientGeometryLayerInfo();
        GfxGeometry geometry = (GfxGeometry) worldPaintable;
        layer.getGeometries().add(GeometryConverter.toDto((Geometry) geometry.getOriginalLocation()));
        FeatureStyleInfo style = new FeatureStyleInfo();
        style.setFillColor(geometry.getStyle().getFillColor());
        style.setFillOpacity(geometry.getStyle().getFillOpacity());
        style.setStrokeColor(geometry.getStyle().getStrokeColor());
        style.setStrokeOpacity(geometry.getStyle().getStrokeOpacity());
        style.setStrokeWidth((int) geometry.getStyle().getStrokeWidth());
        style.applyDefaults();
        layer.setStyle(style);
        layer.setLayerType(geometry.getGeometry().getLayerType());
        layer.setLabel(geometry.getId());
        layer.setId(geometry.getId());
        mapRasterizingInfo.getExtraLayers().add(layer);
      }
    }
  }
View Full Code Here


  public Layer createLayer(MapContext mapContext, ClientLayerInfo clientLayerInfo) throws GeomajasException {
    if (!(clientLayerInfo instanceof ClientGeometryLayerInfo)) {
      throw new IllegalStateException(
          "GeometryLayerFactory.createLayer() should only be called using ClientGeometryLayerInfo");
    }
    ClientGeometryLayerInfo layerInfo = (ClientGeometryLayerInfo) clientLayerInfo;
    LayerType layerType = layerInfo.getLayerType();
    Style style = styleFactoryService.createStyle(layerType, layerInfo.getStyle());
    GeometryDirectLayer layer = new GeometryDirectLayer(style, converterService.toInternal(layerType));
    for (Geometry geom : layerInfo.getGeometries()) {
      layer.getGeometries().add(converterService.toInternal(geom));
    }
    layer.getUserData().put(USERDATA_KEY_SHOWING, layerInfo.isShowing());
    layer.setTitle(layerInfo.getLabel());
    List<Rule> rules = new ArrayList<Rule>();
    // all rules are needed for map/legend
    for (FeatureTypeStyle fts : style.featureTypeStyles()) {
      for (Rule rule : fts.rules()) {
        rules.add(rule);
View Full Code Here

    mapInfo.setCrs("EPSG:4326");
    mapRasterizingInfo.setScale(1);
    mapRasterizingInfo.setTransparent(true);
    mapInfo.getWidgetInfo().put(MapRasterizingInfo.WIDGET_KEY, mapRasterizingInfo);

    ClientGeometryLayerInfo geo = new ClientGeometryLayerInfo();
    Geometry point = new Geometry(Geometry.POINT, 4326, 5);
    point.setCoordinates(new Coordinate[] { new Coordinate(20, 50) });
    geo.getGeometries().add(point);
    geo.setStyle(layerBeansPointStyleInfo.getFeatureStyles().get(0));
    geo.setLayerType(LayerType.POINT);
    mapInfo.getLayers().add(geo);
    new MapAssert(mapInfo).assertEqualImage("geometry.png", writeImages, DELTA);
  }
View Full Code Here

  private static final String IMAGE_CLASS_PATH = "org/geomajas/plugin/rasterizing/images/geometrylayer";

  @Test
  public void testPolygon() throws Exception {
    ClientGeometryLayerInfo geo = new ClientGeometryLayerInfo();
    geo.getGeometries().add(createPolygon());
    geo.setStyle(createPolygonStyle());
    geo.setLayerType(LayerType.POLYGON);

    ClientMapInfo mapInfo = new ClientMapInfo();
    mapInfo.setCrs("EPSG:4326");
    MapRasterizingInfo mapRasterizingInfo = new MapRasterizingInfo();
    mapRasterizingInfo.setBounds(new Bbox(0, 0, 100, 100));
View Full Code Here

TOP

Related Classes of org.geomajas.plugin.rasterizing.command.dto.ClientGeometryLayerInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.