Rename center and bbox middlewares

This commit is contained in:
Daniel García Aubert
2018-03-07 18:51:43 +01:00
parent 83ab65163d
commit faaf121eb6
+6 -6
View File
@@ -124,7 +124,7 @@ LayergroupController.prototype.register = function(app) {
allowQueryParams(['layer']),
this.prepareContext,
getMapStoreMapConfigProvider(this.mapStore, this.userLimitsApi, forcedFormat),
center(this.previewBackend),
getPreviewImageByCenter(this.previewBackend),
setCacheControlHeader(),
setLastModifiedHeader(),
getAffectedTables(this.layergroupAffectedTables, this.pgConnection),
@@ -140,7 +140,7 @@ LayergroupController.prototype.register = function(app) {
allowQueryParams(['layer']),
this.prepareContext,
getMapStoreMapConfigProvider(this.mapStore, this.userLimitsApi, forcedFormat),
bbox(this.previewBackend),
getPreviewImageByBoundingBox(this.previewBackend),
setCacheControlHeader(),
setLastModifiedHeader(),
getAffectedTables(this.layergroupAffectedTables, this.pgConnection),
@@ -422,8 +422,8 @@ function getTile (tileBackend, profileLabel = 'tile') {
};
}
function center (previewBackend) {
return function centerMiddleware (req, res, next) {
function getPreviewImageByCenter (previewBackend) {
return function getPreviewImageByCenterMiddleware (req, res, next) {
const width = +req.params.width;
const height = +req.params.height;
const zoom = +req.params.z;
@@ -457,8 +457,8 @@ function center (previewBackend) {
};
}
function bbox (previewBackend) {
return function bboxMiddleware (req, res, next) {
function getPreviewImageByBoundingBox (previewBackend) {
return function getPreviewImageByBoundingBoxMiddleware (req, res, next) {
const width = +req.params.width;
const height = +req.params.height;
const bounds = {