Skip to content
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

Merged
merged 1 commit into from Sep 2, 2014

Conversation

bentrm
Copy link
Member

@bentrm bentrm commented Sep 2, 2014

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.

@chrismayer
Copy link
Contributor

Hi @bentrm
thanks for providing this. Especially for providing also unit tests tackling your changes. That's really cool.
For me the PR looks good, but I would like to hear @bartvde 's opinion about this because he is the master of OGC-Format related classes and he did a lot work on them.

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.

@bartvde
Copy link
Member

bartvde commented Sep 2, 2014

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)
Copy link
Member

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?

Copy link
Member Author

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?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure

@bentrm
Copy link
Member Author

bentrm commented Sep 2, 2014

I rebased the PR to reflect @bartvde's comments. CA has been sent.

@bartvde
Copy link
Member

bartvde commented Sep 2, 2014

thanks!

bartvde added a commit that referenced this pull request Sep 2, 2014
Set projection on WFS-layer retrieved by capabilities request (r=@chrismayer, @bartvde)
@bartvde bartvde merged commit d58cf60 into geoext:master Sep 2, 2014
@bentrm bentrm deleted the defaultsrs branch September 8, 2014 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants