GML parsing with new extent structure

This commit is contained in:
Tim Schaub
2013-09-03 17:44:17 -06:00
parent 9226472380
commit 3ea6041714
4 changed files with 15 additions and 16 deletions
+3 -4
View File
@@ -2,6 +2,7 @@ goog.provide('ol.parser.ogc.GML_v2');
goog.require('goog.array');
goog.require('goog.object');
goog.require('ol.extent');
goog.require('ol.parser.ogc.GML');
@@ -35,8 +36,7 @@ ol.parser.ogc.GML_v2 = function(opt_options) {
[node, coordinates, container]);
this.readChildNodes(node, coordinates);
container.projection = node.getAttribute('srsName');
container.bounds = [coordinates[0][0][0], coordinates[0][1][0],
coordinates[0][0][1], coordinates[0][1][1]];
container.bounds = ol.extent.clone(coordinates[0]);
}
});
goog.object.extend(this.writers['http://www.opengis.net/gml'], {
@@ -104,8 +104,7 @@ ol.parser.ogc.GML_v2 = function(opt_options) {
},
'Box': function(extent) {
var node = this.createElementNS('gml:Box');
this.writeNode('coordinates', [[extent[0], extent[1]],
[extent[2], extent[3]]], null, node);
this.writeNode('coordinates', extent, null, node);
// srsName attribute is optional for gml:Box
if (goog.isDefAndNotNull(this.srsName)) {
node.setAttribute('srsName', this.srsName);