Virginie BERRE a écrit :
I would like to add a RenderedMapScale to a StyledMapPane but it doesn’t
display the right scale.
StyledMapPane mapPane = new StyledMapPane();
mapPane.setPaintingWhileAdjusting(true);
mapPane.getRenderer().addLayer(new RenderedMapScale());
There is nothing more to do in principle...
/Envelope envelope = new Envelope(mapPane.getVisibleArea());/
/GridCoverage rGC = new GridCoverage("WMSGC", image,
GeographicCoordinateSystem.WGS84, envelope);/
We may have a problem here. The envelope given to the GridCoverage
should be the envelope of the real data. It is usually know from an
external source (totally independant of rendering). For example you may
know that yours image cover an area from 5°W to 15°E and 20°N to 30°N.
MapPane.getVisibleArea() is absolutly not a reliable way to get the
Envelope for the coverage, because the MapPane visible area is strongly
dependent of factors unrelated to the "real" data, like user zoom,
widget size, etc. The GridCoverage should be created in a way totally
independent from MapPane or Renderer.
Martin.
-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server.
Download it for free - -and be entered to win a 42" plasma tv or your very
own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users