Add utility method to provide Sector object from WGS84BoundingBox element

This commit is contained in:
Zach Glueckert 2017-02-22 17:51:58 -05:00
parent 2c18114b5c
commit 5082d06413
2 changed files with 14 additions and 9 deletions

View File

@ -127,11 +127,7 @@ define([
"No bounding box was specified in the layer or tile matrix set capabilities."));
}
} else if (config.wgs84BoundingBox) {
this.sector = new Sector(
config.wgs84BoundingBox.lowerCorner[1],
config.wgs84BoundingBox.upperCorner[1],
config.wgs84BoundingBox.lowerCorner[0],
config.wgs84BoundingBox.upperCorner[0]);
this.sector = config.wgs84BoundingBox.getSector();
} else if (this.tileMatrixSet.boundingBox &&
WmtsLayer.isEpsg4326Crs(this.tileMatrixSet.boundingBox.crs)) {
this.sector = new Sector(

View File

@ -7,12 +7,14 @@
*/
define([
'../error/ArgumentError',
'../util/Logger',
'../ogc/OwsDescription'
'../geom/Sector',
'../ogc/OwsDescription',
'../util/Logger'
],
function (ArgumentError,
Logger,
OwsDescription) {
Sector,
OwsDescription,
Logger) {
"use strict";
/**
@ -244,6 +246,13 @@ define([
}
}
// Add a utility which provides a Sector based on the WGS84BoundingBox element
if (element.localName === "WGS84BoundingBox") {
result.getSector = function () {
return new Sector(result.lowerCorner[1], result.upperCorner[1], result.lowerCorner[0], result.upperCorner[0]);
}
}
return result;
};