|
Hi Martin ! I've understand what you told me but I don't know how
to initialise the Envelope. Could you help be a bit more and tell me what to
write in the brackets: Envelope envelope = new Envelope( ??? ); Thanks! Virginie -----Message d'origine----- 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. |
- RE: [Geotools-gt2-users] Problem with RenderedMapScale Virginie BERRE
- Re: [Geotools-gt2-users] Problem with RenderedMap... Martin Desruisseaux
