Port parsers to new extents
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
goog.provide('ol.parser.ogc.OWSCommon_v1');
|
||||
goog.require('ol.Extent');
|
||||
goog.require('ol.parser.XML');
|
||||
|
||||
|
||||
@@ -196,9 +195,10 @@ ol.parser.ogc.OWSCommon_v1 = function() {
|
||||
var pointList = str.split(this.regExes.splitSpace);
|
||||
obj['right'] = pointList[0];
|
||||
obj['top'] = pointList[1];
|
||||
obj['bounds'] = new ol.Extent(parseFloat(obj['left']),
|
||||
parseFloat(obj['bottom']), parseFloat(obj['right']),
|
||||
parseFloat(obj['top']));
|
||||
obj['bounds'] = [
|
||||
parseFloat(obj['left']), parseFloat(obj['right']),
|
||||
parseFloat(obj['bottom']), parseFloat(obj['top'])
|
||||
];
|
||||
delete obj['left'];
|
||||
delete obj['bottom'];
|
||||
delete obj['right'];
|
||||
|
||||
@@ -153,8 +153,8 @@ describe('ol.parser.GeoJSON', function() {
|
||||
expect(first.get('name')).to.be('Afghanistan');
|
||||
var firstGeom = first.getGeometry();
|
||||
expect(firstGeom).to.be.a(ol.geom.Polygon);
|
||||
expect(firstGeom.getBounds().equals(
|
||||
new ol.Extent(60.52843, 29.318572, 75.158028, 38.486282)))
|
||||
expect(ol.extent.equals(firstGeom.getBounds(),
|
||||
[60.52843, 75.158028, 29.318572, 38.486282]))
|
||||
.to.be(true);
|
||||
|
||||
var last = result[178];
|
||||
@@ -162,8 +162,8 @@ describe('ol.parser.GeoJSON', function() {
|
||||
expect(last.get('name')).to.be('Zimbabwe');
|
||||
var lastGeom = last.getGeometry();
|
||||
expect(lastGeom).to.be.a(ol.geom.Polygon);
|
||||
expect(lastGeom.getBounds().equals(
|
||||
new ol.Extent(25.264226, -22.271612, 32.849861, -15.507787)))
|
||||
expect(ol.extent.equals(lastGeom.getBounds(),
|
||||
[25.264226, 32.849861, -22.271612, -15.507787]))
|
||||
.to.be(true);
|
||||
done();
|
||||
});
|
||||
@@ -200,8 +200,8 @@ describe('ol.parser.GeoJSON', function() {
|
||||
expect(first.get('name')).to.be('Afghanistan');
|
||||
var firstGeom = first.getGeometry();
|
||||
expect(firstGeom).to.be.a(ol.geom.Polygon);
|
||||
expect(firstGeom.getBounds().equals(
|
||||
new ol.Extent(60.52843, 29.318572, 75.158028, 38.486282)))
|
||||
expect(ol.extent.equals(firstGeom.getBounds(),
|
||||
[60.52843, 75.158028, 29.318572, 38.486282]))
|
||||
.to.be(true);
|
||||
|
||||
var last = result[178];
|
||||
@@ -209,8 +209,8 @@ describe('ol.parser.GeoJSON', function() {
|
||||
expect(last.get('name')).to.be('Zimbabwe');
|
||||
var lastGeom = last.getGeometry();
|
||||
expect(lastGeom).to.be.a(ol.geom.Polygon);
|
||||
expect(lastGeom.getBounds().equals(
|
||||
new ol.Extent(25.264226, -22.271612, 32.849861, -15.507787)))
|
||||
expect(ol.extent.equals(lastGeom.getBounds(),
|
||||
[25.264226, 32.849861, -22.271612, -15.507787]))
|
||||
.to.be(true);
|
||||
});
|
||||
});
|
||||
@@ -219,8 +219,8 @@ describe('ol.parser.GeoJSON', function() {
|
||||
|
||||
});
|
||||
|
||||
goog.require('ol.Extent');
|
||||
goog.require('ol.Feature');
|
||||
goog.require('ol.extent');
|
||||
goog.require('ol.geom.LinearRing');
|
||||
goog.require('ol.geom.LineString');
|
||||
goog.require('ol.geom.Point');
|
||||
|
||||
@@ -99,11 +99,11 @@ describe('ol.parser.ogc.wmtscapabilities_v1_0_0', function() {
|
||||
expect(layer.styles[1].legend).to.be(undefined);
|
||||
expect(layer.tileMatrixSetLinks.length).to.eql(1);
|
||||
expect(layer.tileMatrixSetLinks[0].tileMatrixSet).to.eql('BigWorld');
|
||||
expect(wgs84Bbox instanceof ol.Extent).to.be.ok();
|
||||
expect(wgs84Bbox.minX).to.eql(-180.0);
|
||||
expect(wgs84Bbox.maxX).to.eql(180.0);
|
||||
expect(wgs84Bbox.minY).to.eql(-90.0);
|
||||
expect(wgs84Bbox.maxY).to.eql(90.0);
|
||||
expect(wgs84Bbox).to.be.an(Array);
|
||||
expect(wgs84Bbox[0]).to.eql(-180.0);
|
||||
expect(wgs84Bbox[1]).to.eql(180.0);
|
||||
expect(wgs84Bbox[2]).to.eql(-90.0);
|
||||
expect(wgs84Bbox[3]).to.eql(90.0);
|
||||
expect(layer.resourceUrls.hasOwnProperty('tile')).to.be.ok();
|
||||
var format = 'image/png';
|
||||
expect(layer.resourceUrls.tile.hasOwnProperty(format)).to.be.ok();
|
||||
@@ -178,5 +178,4 @@ describe('ol.parser.ogc.wmtscapabilities_v1_0_0', function() {
|
||||
});
|
||||
|
||||
goog.require('goog.net.XhrIo');
|
||||
goog.require('ol.Extent');
|
||||
goog.require('ol.parser.ogc.WMTSCapabilities');
|
||||
|
||||
Reference in New Issue
Block a user