From: giuseppe la s. <gla...@gm...> - 2011-01-11 22:07:02
|
Yes john you must use projcode. Tomorrow i send you an example. Regards giuseppe Inviato da iPhone di Giuseppe La Scaleia Il giorno 11/gen/2011, alle ore 21:38, John Preston <byh...@gm...> ha scritto: > OK, furthur experimentation indicates that if I send the map request > to geoserver with a different projection then the map is returned ok, > but the bbox coordinates have to be in the different projection. So > I'll need the projection transform stuff working but these function > all seem to do nothing. Do I have to have some other javascripts > loaded to get this part of gwt-openlayers working > > John > > ---------- Forwarded message ---------- > From: John Preston <byh...@gm...> > Date: Tue, Jan 11, 2011 at 3:09 PM > Subject: Reprojection of wns malyer and tranforming of point does not > seem to work. > To: gwt...@li... > > > I have a problem getting reprojection of wms layer maps working and I > would apprciate if someone could tell me what I'm doing wrong. > > I have two maps in two different projections and I would like to > overlay them. I use the following code to do this. > > ////////////////////////////////////////////////////////////////////////////////////////// > MapOptions mapOptions = new MapOptions(); > mapOptions.setNumZoomLevels(10); > mapOptions.setProjection("EPSG:3448"); > mapOptions.setDisplayProjection(new Projection("EPSG:3448")); > > mapOptions.setUnits("m"); > mapOptions.setMaxExtent(new Bounds(100000, 100000, 900000, 700000)); > mapOptions.setAllOverlays(true); > mapOptions.setMaxResolutionToAuto(); > > mapWidget = new MapWidget("100%", "100%", mapOptions); > add(mapWidget, new BorderLayoutData(LayoutRegion.CENTER)); > Map map = mapWidget.getMap(); > > // Defining a WMS and adding it to the map > WMSParams wmsParams = new WMSParams(); > wmsParams.setFormat("image/png"); > wmsParams.setLayers("area1"); > wmsParams.setIsTransparent(true); > wmsParams.setStyles(""); > > WMSOptions wmsLayerParams = new WMSOptions(); > wmsLayerParams.setBuffer(0); > wmsLayerParams.setSingleTile(false); > wmsLayerParams.setMaxExtent(new Bounds(100000, 100000, 300000, 200000)); > wmsLayerParams.setProjection("EPSG:24200"); > WMS wmsLayer = new WMS("First map on old projection", > "http://localhost:8086/geoserver/wms", wmsParams, wmsLayerParams); > > // Add layer to open layers map > map.addLayer(wmsLayer); > > // Defining a WMS and adding it to the map > wmsParams = new WMSParams(); > wmsParams.setFormat("image/png"); > wmsParams.setLayers("area2"); > wmsParams.setIsTransparent(true); > wmsParams.setStyles(""); > > wmsLayerParams = new WMSOptions(); > wmsLayerParams.setBuffer(0); > wmsLayerParams.setSingleTile(false); > wmsLayerParams.setMaxExtent(new Bounds(500000, 500000, 800000, 700000)); > wmsLayerParams.setProjection("EPSG:24200"); > WMS wmsLayer = new WMS("Second map in new projection", > "http://localhost:8086/geoserver/wms", wmsParams, wmsLayerParams); > > // Add layer to open layers map > map.addLayer(wmsLayer); > > map.setCenter(new LonLat(400000, 400000)); > ////////////////////////////////////////////////////////////////////////////////////////// > > The two maps hold data for adjacent areas but they are in different > projections. I want to be able to set the map display projection to > one of the projections, EPSG:3448 for instance, and re-project (on the > fly) the other map so I can overlay them. Hence I set the map display > projection to EPSG:3448, and when I am creating the wms layer I set > the srs of the request to the display projection. However I get an > empty map if I do this. When I set the projection of the wms request > to the projection of the data it contains then I get the map but it > has not been reprojected. I've searched for a simple reprojection > example to try and follow but I can't find any. > > I've also noticed that if I try to tranform coordinates from one > projection to another I get no change. When I try the following code > the coordinates of the lonlat object remain the same instead of them > being offset by about 500000 for the x and y values. > > LonLat pt = new LonLat(250000, 140000); > pt.transform("EPSG:3448", "EPSG:24200"); > > Do I need to include some extra javascripts to get the projection working. > > Can anyone help me. > > John > > ------------------------------------------------------------------------------ > Protect Your Site and Customers from Malware Attacks > Learn about various malware tactics and how to avoid them. Understand > malware threats, the impact they can have on your business, and how you > can protect your company and customers by using code signing. > http://p.sf.net/sfu/oracle-sfdevnl > _______________________________________________ > Gwt-openlayers-users mailing list > Gwt...@li... > https://lists.sourceforge.net/lists/listinfo/gwt-openlayers-users |