incorporate review from @ahocevar

This commit is contained in:
Bart van den Eijnden
2013-05-15 14:50:37 +02:00
parent 5ad4734c24
commit 2ad3ee6f99
7 changed files with 34 additions and 31 deletions
+6 -3
View File
@@ -29,8 +29,8 @@ ol.parser.ogc.GML = function(opt_options) {
if (goog.isDef(opt_options)) {
goog.object.extend(this, opt_options);
}
if (!goog.isDef(this.xy)) {
this.xy = true;
if (!goog.isDef(this.axisOrientation)) {
this.axisOrientation = 'enu';
}
if (!goog.isDef(this.extractAttributes)) {
this.extractAttributes = true;
@@ -182,7 +182,7 @@ ol.parser.ogc.GML = function(opt_options) {
var points = new Array(numPoints);
for (var i = 0; i < numPoints; ++i) {
coords = pointList[i].split(cs).map(parseFloat);
if (this.xy) {
if (this.axisOrientation.substr(0, 2) === 'en') {
points[i] = coords;
} else {
if (coords.length === 2) {
@@ -552,5 +552,8 @@ ol.parser.ogc.GML.prototype.createGeometry_ = function(container,
ol.parser.ogc.GML.prototype.readFeaturesFromString =
function(str, opt_options) {
this.readFeaturesOptions_ = opt_options;
if (goog.isDef(opt_options) && goog.isDef(opt_options.projection)) {
this.axisOrientation = opt_options.projection.getAxisOrientation();
}
return this.read(str).features;
};