New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set projection on WFS-layer retrieved by capabilities request. #284
Conversation
Hi @bentrm As you already mentioned you need to sign a Contributor Agreement to get your changes merged. Please sign and send it to psc [at] geoext.org. |
at my quick glance this morning this looked okay |
@@ -129,7 +129,8 @@ Ext.define('GeoExt.data.reader.WfsCapabilities', { | |||
layerOptions = { | |||
metadata: metadata, | |||
protocol: new OpenLayers.Protocol.WFS(protocolOptions), | |||
strategies: [new OpenLayers.Strategy.Fixed()] | |||
strategies: [new OpenLayers.Strategy.Fixed()], | |||
projection: new OpenLayers.Projection(featureType.srs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looking at the OpenLayers code for WFS 1.0.0, there is at least a theoretic chance that featureType.srs will not be set, so we can add a check here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess it's easiest to change to projection: featureType.srs
and leave it to OpenLayers to instanciate the projection object then. That way, projection is null as it has been if featureType.srs
is undefined. You're okay with that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure
I rebased the PR to reflect @bartvde's comments. CA has been sent. |
thanks! |
Set projection on WFS-layer retrieved by capabilities request (r=@chrismayer, @bartvde)
The change makes it easy to add a WFS-layer retrieved via a capabilities request.
If the layers projection differs from the map projection, features are now projected accordingly (requiring proj4js).
If you consider this worthwhile I'm happy to send a CA.