Dear list,
I tried to load a simple layer (shape file) by code [1], but it doesn't work...
someone can help me?
this is my extension code for the execute method:

......
public void execute(String actionCommand) {
                // TODO Auto-generated method stub              
try {           
View v = (View) PluginServices.getMDIManager().getActiveWindow();
MapControl mapCtrl = v.getMapControl();
String layerName = actionCommand;
VectorialFileDriver driver = (VectorialFileDriver) 
LayerFactory.getDM().getDriver("gvSIG shp driver");          
FLayer prova = LayerFactory.createLayer(layerName, driver, new File 
("/Users/claudio/prova.shp"), CRSFactory.getCRS("EPSG:3003"));
prova.setVisible(true);
mapCtrl.getMapContext().getLayers().addLayer(prova);
}
catch (DriverLoadException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}               
        }

and this is the eclipse console error message:

ERROR [AWT-EventQueue-1] (BaseException.java:53) - 
com.hardcode.driverManager.DriverLoadException: formatString is null.
null
        at 
com.hardcode.driverManager.DriverManager.getDriver(DriverManager.java:170)
........


Thanks a lot for every reply,
Claudio

[1] 
http://www.gvsig.org/web/docdev/manual-para-desarrolladores-gvsig/librerias-internas/ejemplos-de-uso-de-fmap/anadir-una-capa-por-codigo

_______________________________________________
Gvsig_internacional mailing list
[email protected]
http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional

Reply via email to