When i first saw the doc of those renderers i thought that the =
ShapeRenderer only Render ShapeFIles layers, while StreamRenderer Render =
the rest (sorry about my english). But, i added a non ShapeFile Layer to =
my context and, surprisely, appears my layer at my map. But i start to =
see a thing:
When i load all my shapes, the performance was ok, but when i load "1 =
point" the performance decreased considerably. So i start to look at =
ShapeFileRenderer and found that the variable that tell SheFileRenderer =
to render like a ShapeFile or like a Stream was wrong(pontualy, i didnt =
see other impacts), it only consider the last layer, so if the last =
layer was a non shape file layer, it renderer all the context with the =
StreamRenderer. Id like to share with u these changes...
i will try to put the code here...
change the ShapeFileRenderer.setContext() to:
public void setContext( MapContext context )
if( context =3D=3D null )
context =3D new DefaultMapContext();
this.context =3D context;
in the paint() method, before :
if( layerIndexInfo =3D=3D null )
renderWithStreamingRenderer( currLayer, graphics, paintArea, =
envelope, transform );
MapLayer layers =3D context.getLayers();
layerIndexInfo =3D new IndexInfo[layers.length];
DataStore ds =3D layers[i].getFeatureSource().getDataStore();
if( ds instanceof ShapefileDataStore )
ShapefileDataStore sds =3D (ShapefileDataStore) ds;
layerIndexInfo[i] =3D useIndex( sds );
catch( Exception e )
layerIndexInfo[i] =3D new IndexInfo( IndexInfo.TREE_NONE, null, null =
LOGGER.fine( "Exception while trying to use index" + =
layerIndexInfo =3D null;
then it will delegate only the non ShapeFiles Layer to StreamRenderer.
i Hope it helps.
Get latest updates about Open Source Projects, Conferences and News.