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

Create valid XML in ol.format.WFS and ability to specify srsName #2090

Merged
merged 1 commit into from
May 21, 2014
Merged

Create valid XML in ol.format.WFS and ability to specify srsName #2090

merged 1 commit into from
May 21, 2014

Conversation

bartvde
Copy link
Member

@bartvde bartvde commented May 21, 2014

Make sure we create xmlns for the featurePrefix on both Update and Delete.
Ability to specify an srsName on the geometry contained by the Update.

@bartvde bartvde changed the title no way to set geometryName on an update in ol.format.WFS Ability to set geometryName on an update in ol.format.WFS May 21, 2014
@@ -354,8 +354,10 @@ ol.format.WFS.writeDelete_ = function(node, feature, objectStack) {
var context = objectStack[objectStack.length - 1];
goog.asserts.assert(goog.isObject(context));
var featureType = goog.object.get(context, 'featureType');
var featurePrefix = goog.object.get(context, 'featurePrefix');
var featurePrefix = goog.object.get(context, 'featurePrefix') || 'feature';
Copy link
Member

Choose a reason for hiding this comment

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

You should use goog.isDef(goog.object.get(context, 'featurePrefix')) here. 'feature' (for the default feature prefix) should also be defined once as a constant instead of multiple times as a string literal.
Same in L378.

@bartvde
Copy link
Member Author

bartvde commented May 21, 2014

@ahocevar I've updated the PR based on your review, if you have time for a last look that would be appreciated

@bartvde
Copy link
Member Author

bartvde commented May 21, 2014

okay after some discussion with @ahocevar we came to the conclusion that it's better to have the geometryName on the GeoJSON format instead. So closing this one.

@bartvde bartvde closed this May 21, 2014
@bartvde
Copy link
Member Author

bartvde commented May 21, 2014

Some of the commits (invalid XML, specify srsName) here are still valid, so I'll clean this up.

@bartvde
Copy link
Member Author

bartvde commented May 21, 2014

@ahocevar this is now updated to only contain the necessary changes

@bartvde bartvde changed the title Ability to set geometryName on an update in ol.format.WFS Create valid XML in ol.format.WFS and ability to specify srsName May 21, 2014
var format = new ol.format.WFS();
var updateFeature = new ol.Feature();
updateFeature.setGeometryName('the_geom');
updateFeature.set('geometry', undefined);
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 can get rid of this workaround once #2059 (comment) gets done

Copy link
Member

Choose a reason for hiding this comment

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

If you rebase now that #2098 is merged, this can go away.

@bartvde
Copy link
Member Author

bartvde commented May 21, 2014

rebased just now and got rid of the workaround

@bartvde
Copy link
Member Author

bartvde commented May 21, 2014

given @ahocevar's previous review(s) on this I'm going to merge this in now, all the contentious changes have been removed

bartvde added a commit that referenced this pull request May 21, 2014
Create valid XML in ol.format.WFS and ability to specify srsName (r=@ahocevar)
@bartvde bartvde merged commit db35a85 into openlayers:master May 21, 2014
@bartvde bartvde deleted the wfs-update branch May 21, 2014 17:04
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