[OpenLayers-Users] Several layers with different projections

Greg Allensworth gregor at greeninfo.org
Wed Nov 9 12:23:34 EST 2011


On 11/9/2011 9:17 AM, Eric Lemoine wrote:
> Quick answer is no. The map works with a single projection,
> and every layer in the map is diplayed in that projection.

Correct. The longer answer is that there is a hack for 
OpenLayers.Layer.WMS which allows the WMS request to be made in that 
server's supported SRS. This addresses a case where the remote WMS does 
not support the SRS used in the map.

http://lists.osgeo.org/pipermail/openlayers-users/attachments/20110808/aedcfd23/WMS.js

The magic is in getFullRequestString() where the bbox used for the 
request is recomputed based on the map's SRS and the layer's own SRS. 
Simply add  srs:'EPSG:4326' to your layer options (4th arg in the 
constructor) and you get automagic reprojection.

-- 
Greg Allensworth, Web GIS Developer
BS  A+  Network+  Security+  Linux+  Server+
GreenInfo Network - Information and Mapping in the Public Interest
564 Market Street, Suite 510  San Francisco CA 94104
PH: 415-979-0343 x302  FX: 415-979-0371    email: gregor at greeninfo.org
Web: www.GreenInfo.org     www.MapsPortal.org

Subscribe to MapLines, our e-newsletter, at www.GreenInfo.org


More information about the Users mailing list