@Override public void onClick() { ExtendedLayerEditor cadastreObjectLayer = getTargetCadastreObjectLayer(); if (cadastreObjectLayer.getFeatureCollection().size() > 0) { ReferencedEnvelope envelope = cadastreObjectLayer.getFeatureCollection().getBounds(); envelope.expandBy(10); this.getMapControl().setDisplayArea(envelope); } super.onClick(); }
/** * It adds a editor layer in the map. * * @param layerName layer name * @param layerTitle layer title * @param geometryType geometry type for this layer * @param styleResource the resource name .xml in the location of resources for layer styles. This * resource location is added in the path decided in SLD_RESOURCES { * @see org.sola.clients.geotools.ui.layers.SolaFeatureLayer}. * @return */ public ExtendedLayerEditor addLayerEditor( String layerName, String layerTitle, Geometries geometryType, String styleResource, String extraFieldsFormat) { ExtendedLayerEditor layer = null; try { layer = new ExtendedLayerEditor(layerName, geometryType, styleResource, extraFieldsFormat); layer.setTitle(layerTitle); this.addLayer(layer); } catch (InitializeLayerException ex) { Messaging.getInstance().show(ex.getMessage()); } return layer; }
private List<SurveyPointBean> getTargetPoints() { ExtendedLayerEditor cadastreObjectLayer = getTargetCadastreObjectLayer(); List<SurveyPointBean> targetPoints = new ArrayList<SurveyPointBean>(); for (VertexInformation vertexInformation : cadastreObjectLayer.getVertexList()) { Object labelAttribute = vertexInformation .getVertexFeature() .getAttribute(ControlsBundleForPlanGeneration.LAYER_FIELD_LABEL); if (labelAttribute == null) { continue; } SurveyPointBean surveyPoint = new SurveyPointBean(); surveyPoint.setFeatureGeom( (Geometry) vertexInformation.getVertexFeature().getDefaultGeometry()); surveyPoint.setId(labelAttribute.toString()); targetPoints.add(surveyPoint); } return targetPoints; }