-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
The writeFeatures method should always return a string #3003
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
Conversation
This is now ready for review, TIA |
* @inheritDoc | ||
* Encode an array of features as a GeoJSON object. | ||
* | ||
* @function |
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 you don't need @function
in that case. As I understand it we use @function
as an indicator to the docs tool that this is a function. But it's not necessary in that case.
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.
Ah indeed, good point.
I've just added minor comments. It looks good to me. Thanks for tackling this Bart! |
The writeFeatures method should always return a string (r=@elemoine)
@@ -105,7 +105,7 @@ if ('download' in exportGPXElement) { | |||
clone.getGeometry().transform(projection, 'EPSG:4326'); | |||
features.push(clone); | |||
}); | |||
var node = new ol.format.GPX().writeFeatures(features); | |||
var node = new ol.format.GPX().writeFeaturesNode(features); |
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.
Shouldn't this be simplified to use writeFeatures
instead of creating a node and then serializing with XMLSerializer
below?
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.
good point will fix on Monday
Sent from my iPhone
On 6 dec. 2014, at 20:21, Tim Schaub [email protected] wrote:
In examples/gpx.js:
@@ -105,7 +105,7 @@ if ('download' in exportGPXElement) {
clone.getGeometry().transform(projection, 'EPSG:4326');
features.push(clone);
});
var node = new ol.format.GPX().writeFeatures(features);
Shouldn't this be simplified to use writeFeatures instead of creating a node and then serializing with XMLSerializer below?var node = new ol.format.GPX().writeFeaturesNode(features);
—
Reply to this email directly or view it on GitHub.
Thanks for this work @bartvde. |
This PR fixes #2102
All writeFeatures, writeFeature and writeGeometry methods now return a string. The respective methods such as writeFeaturesObject (JSON) and writeFeaturesNode (XML) have been marked api but not stable as yet.