|
From: George T. <geo...@ya...> - 2012-07-19 10:54:56
|
Hello Michael, after a few attempts to understand how JMapFrame would receive the individual layers with the correct projection I have given up further debugging. I found it easier to continue with the workaround described above than finding all lines in JMapFrame that need rewriting if one common projection is needed rather than simply overlaying unrelated projections. For simple applications with a single datasource, JMapFrame is still helpful. Thanks George ________________________________ Von: Michael Bedward <mic...@gm...> An: George Taylor <geo...@ya...> CC: "geo...@li..." <geo...@li...> Gesendet: 4:47 Dienstag, 17.Juli 2012 Betreff: Re: [Geotools-gt2-users] define projection when overlaying WMS and shapefile in JMapFrame On 17 July 2012 00:59, George Taylor <geo...@ya...> wrote: > > Instead I am now using the following workaround: > I first render the shapefile with the correct projection using a GTRenderer. > Next I request the image from the WMS Server using a GetMapRequest which has > the correct projection set. Finally the WMS image can be drawn on top of the > rendered shapefile. > > The JMapFrame ignores the projection setting, when the individual layers are > requested. > Hello George, Thanks for the further report on this. I'm afraid that I don't have an idea for what is causing the problem at the moment. JMapFrame doesn't do any projection setting itself, it merely passes the bounds and crs to the MapViewport object, to be subsequently passed to the renderer. But your observations suggest that the order of events (bounds setting vs loading layers) affects the end result. If you have the chance to step through what is happening in a debugger and are able to identify the problem area(s) in the map pane or viewport code that would be helpful. Otherwise it will have to wait until I next have time for gt-swing work which I'm afraid will not be soon. Michael |