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
Accept feature projection in GeoJSON constructor #5917
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
goog.provide('ol.format.Feature'); | ||
|
||
goog.require('ol.geom.Geometry'); | ||
goog.require('ol.obj'); | ||
goog.require('ol.proj'); | ||
|
||
|
||
|
@@ -24,6 +25,12 @@ ol.format.Feature = function() { | |
*/ | ||
this.defaultDataProjection = null; | ||
|
||
/** | ||
* @protected | ||
* @type {ol.proj.Projection} | ||
*/ | ||
this.defaultFeatureProjection = null; | ||
|
||
}; | ||
|
||
|
||
|
@@ -64,19 +71,10 @@ ol.format.Feature.prototype.getReadOptions = function(source, opt_options) { | |
* Updated options. | ||
*/ | ||
ol.format.Feature.prototype.adaptOptions = function(options) { | ||
var updatedOptions; | ||
if (options) { | ||
updatedOptions = { | ||
featureProjection: options.featureProjection, | ||
dataProjection: options.dataProjection ? | ||
options.dataProjection : this.defaultDataProjection, | ||
rightHanded: options.rightHanded | ||
}; | ||
if (options.decimals) { | ||
updatedOptions.decimals = options.decimals; | ||
} | ||
} | ||
return updatedOptions; | ||
return ol.obj.assign({ | ||
dataProjection: this.defaultDataProjection, | ||
featureProjection: this.defaultFeatureProjection | ||
}, options); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Where did There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ahh yes, I somehow didn't see the |
||
}; | ||
|
||
|
||
|
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.
do we want to mark this option stable?
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 think it makes sense to call this stable. I'll merge as is, and if there is disagreement, we can change it before the release.