-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Conversation
@@ -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'; |
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.
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.
@ahocevar I've updated the PR based on your review, if you have time for a last look that would be appreciated |
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. |
Some of the commits (invalid XML, specify srsName) here are still valid, so I'll clean this up. |
@ahocevar this is now updated to only contain the necessary changes |
var format = new ol.format.WFS(); | ||
var updateFeature = new ol.Feature(); | ||
updateFeature.setGeometryName('the_geom'); | ||
updateFeature.set('geometry', undefined); |
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 can get rid of this workaround once #2059 (comment) gets done
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.
If you rebase now that #2098 is merged, this can go away.
rebased just now and got rid of the workaround |
given @ahocevar's previous review(s) on this I'm going to merge this in now, all the contentious changes have been removed |
Create valid XML in ol.format.WFS and ability to specify srsName (r=@ahocevar)
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.