[OpenLayers-Users] WMS layer with different SRS than basemap
Dejung Gewissler
dejung.gewissler at oit.state.nj.us
Fri Sep 19 12:46:50 EDT 2008
Thanks! That worked great.
Guillaume Sueur wrote:
> Hi,
>
> This is the answer I got from Chris few months ago when I asked for the
> same question :
> OpenLayers does not support the display of differently projected WMS
>
>>> layers. I'm assuming that in this case, your two different projection
>>> strings have the same projection, and that this isn't actually two
>>> different projections like OpenLayers tries to helpfully assume it is.
>>> If that's the case, then the code to modify is the getFullRequestString
>>> function: specifically, doing something like this:
>>>
>>> OpenLayers.Layer.WMS.prototype.getFullRequestString =
>>> function(newParams, altUrl) {
>>> var projectionCode = this.projection.toString();
>>> this.params.SRS = (projectionCode == "none") ? null :
>>>
> projectionCode;
>
>>> return OpenLayers.Layer.Grid.prototype.getFullRequestString.apply(
>>> this, arguments);
>>> }
>>>
>
> this should avoid map projection override of layer's specific projection
>
> Hope that helps
>
> Guillaume
>
> Dejung Gewissler a écrit :
>
>> Hi All-
>>
>> I've searched on Nabble for the answer to this to no avail. I know you
>> all are busy with the release cycle (!kudos to all that are involved!),
>> but I was hoping someone has an easy answer for this problem.
>>
>> I've got some WMS services coming from IMS or ArcGIS servers and some
>> others coming from GeoServer. Unfortunately ESRI identifies the NJ State
>> Plane (us feet) coordinate system as EPSG:102711 and GeoServer uses
>> EPSG:3432. ESRI doesn't have a EPSG:3432 and GeoServer doesn't have a
>> EPSG:102711!!! I understand that OpenLayers doesn't support raster
>> reprojection because it would be nearly impossible to do in a browser,
>> etc. My images, however, are fundamentally of the same projection,
>> albeit with a different SRS identifier. I just need them laid on top of
>> each other.
>>
>> I define my map with options {... projection: 'EPSG:102711' ...} and my
>> WMS overlays with {... srs: 'EPSG:3432' ...}. The WMS overlays are
>> nonetheless being sent with SRS=EPSG:102711. It seems that OL ignores
>> the passed-in srs in the layer constructor and defaults to whatever the
>> baselayer's projection is. That makes sense in stopping the raster
>> reprojection train, but poses a problem in my situation. Is there a way
>> to force the SRS change of a WMS overlay?
>>
>> Thanks,
>> Dejung
>> _______________________________________________
>> Users mailing list
>> Users at openlayers.org
>> http://openlayers.org/mailman/listinfo/users
>>
>>
>>
>
>
--
*Dejung Gewissler*
New Jersey Office of Information Technology
Office of Geographic Information Systems
200 Riverview Plaza
PO Box 212, Trenton, NJ 08625-0212
609.777.3754
More information about the Users
mailing list