Hi Amador,

> Hi guys, I'm trying to create a program that select a determinate polygon
> from a shapefile, I've many layers (Roads, Buildings, Rivers, and so on),
> so I wanna select a polygon depend of the layer that I want so use.

One way of restricting operations to a chosen map layer is to use the
MapLayer.setSelected( boolean ) method...

        int layerToUse = ...
        int k = 0;
        for (MapLayer layer : myMapContext.getLayers()) {
            layer.setSelected(k == layerToUse);
            k++ ;
        }

Then later your operation can query each layer with
MapLayer.isSelected() to see if it should work on it.

Hope this helps
Michael

------------------------------------------------------------------------------

_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to