Package chunmap.view.layer

Examples of chunmap.view.layer.VectorLayer


    Log.log(Logger.Info, "chunmap's googlemap服务已启动");
  }

  private Layer loadLayerData() {
    String path1="D:\\Temp\\mapdata\\cntry02\\cntry02.shp";
    VectorLayer layer =  LayerFactory.openShapeFile(path1,1);
    layer.setDefaultStyle(new Symbol[]{new GeneralSymbol(),new LabelSymbol()});
   
    //reproj
    CoordinateRef target = new CoordinateRef();
        target.setProjection(new Mercator());
    ReProjOp.changeCRS(layer.getFeatures(), target);
   
    return layer;
  }
View Full Code Here


    ShpDataSource pDR = new ShpDataSource(path);
        GeoDataAdapter pDA = new GeoDataAdapter(pDR);

        FeatureCollection fc = pDA.createFeatureList();
        pDR.close();
        return new VectorLayer(fc);
    }
View Full Code Here

              String s = data[labelColum].toString();
              shp.setLabel(s);
      }});
        fc.setFeatureSchama(pDR.getFeatureSchama());
        pDR.close();
        return new VectorLayer(fc);
    }
View Full Code Here

    public static VectorLayer OpenPostGIS(String tableName
        , PostgisConnection ConnectionString, String geom, String id)
    {
      PostgisDataSource pDR = new PostgisDataSource(tableName , geom, id,ConnectionString);
        GeoDataAdapter pDA = new GeoDataAdapter(pDR);
        VectorLayer layer = new VectorLayer(pDA.createFeatureList());
        pDR.close();
        return layer;
    }
View Full Code Here

        }

        fc.setMetadata( new LayerMetadata("Geometry",gs.get(0).getGeometryType()));
        fc.setEnvelope(eb.toEnvelop());

        return new VectorLayer(fc);
    }
View Full Code Here

        }

        fc.setMetadata (new LayerMetadata("Feature",GeometryType.GeometryCollection));
        fc.setEnvelope ( eb.toEnvelop());

        return new VectorLayer(fc);
    }
View Full Code Here

    });
   
    UiUtil.addButton(frame,map,"删除",new ActionListener() {
      @Override
      public void actionPerformed(ActionEvent arg0) {
        final VectorLayer l = (VectorLayer) map.getLayerCollection().getSelectedLayer();

              if (l == null)
              {
                  return;
              }

              l.getFeatures().find(new VisitFunc(){
          @Override
          public boolean execute(Feature f) {
            if (f != null)
                    {
                        boolean success=f.getFeatureClass().remove(f);
                        l.getFeatures().remove(f);
                        if (success)
                        {
                            map.refreshMap();
                        }
                        return false;
View Full Code Here

    String path2=
        "D:\\ChunMap\\ChunMap1.1.1\\Data\\gs\\city1.shp";
    String path3=
        "D:\\ChunMap\\ChunMap1.1.1\\Data\\gs\\river.shp";

    VectorLayer layer = (VectorLayerLayerFactory.openShapeFile(path1);
    layer.setDefaultStyle(new Symbol[]{new GeneralSymbol()});
    VectorLayer layer2 = (VectorLayer) LayerFactory.openShapeFile(path2);
    layer2.setDefaultStyle(new Symbol[]{new GeneralSymbol(Style2D.style2())});
    VectorLayer layer3 = (VectorLayer) LayerFactory.openShapeFile(path3);
    layer3.setDefaultStyle(new Symbol[]{new GeneralSymbol(Style2D.style1())});

    map.getLayerCollection().add(layer);
    map.getLayerCollection().add(layer2);
    map.getLayerCollection().add(layer3);
View Full Code Here

  protected void addLayer(MapCtrl map) {
    Layer layer = new GMLayer();
    map.getLayerCollection().add(layer);
   
    String path1="D:\\Temp\\mapdata\\cntry02\\cntry02.shp";
    VectorLayer layer1 = (VectorLayer) LayerFactory.openShapeFile(path1);
   
    //style
    Style2D style = new Style2D();
    style.setNeedArea(false);
    style.setStroke(new BasicStroke(3));
    layer1.setDefaultStyle(new Symbol[]{new GeneralSymbol(style)});
   
    //reproj
    CoordinateRef target = new CoordinateRef();
        target.setProjection(new Mercator());
    ReProjOp.changeCRS(layer1.getFeatures(), target);
   
        map.getLayerCollection().add(layer1);
  }
View Full Code Here

TOP

Related Classes of chunmap.view.layer.VectorLayer

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.