Rename map-store-map-config-provider middleware

This commit is contained in:
Daniel García Aubert 2018-03-07 18:53:20 +01:00
parent faaf121eb6
commit 6c2f893651

View File

@ -47,7 +47,7 @@ LayergroupController.prototype.register = function(app) {
cors(), cors(),
userMiddleware(), userMiddleware(),
this.prepareContext, this.prepareContext,
getMapStoreMapConfigProvider(this.mapStore, this.userLimitsApi), createMapStoreMapConfigProvider(this.mapStore, this.userLimitsApi),
getTile(this.tileBackend, 'map_tile'), getTile(this.tileBackend, 'map_tile'),
setCacheControlHeader(), setCacheControlHeader(),
setLastModifiedHeader(), setLastModifiedHeader(),
@ -66,7 +66,7 @@ LayergroupController.prototype.register = function(app) {
cors(), cors(),
userMiddleware(), userMiddleware(),
this.prepareContext, this.prepareContext,
getMapStoreMapConfigProvider(this.mapStore, this.userLimitsApi), createMapStoreMapConfigProvider(this.mapStore, this.userLimitsApi),
getTile(this.tileBackend, 'map_tile'), getTile(this.tileBackend, 'map_tile'),
setCacheControlHeader(), setCacheControlHeader(),
setLastModifiedHeader(), setLastModifiedHeader(),
@ -86,7 +86,7 @@ LayergroupController.prototype.register = function(app) {
cors(), cors(),
userMiddleware(), userMiddleware(),
this.prepareContext, this.prepareContext,
getMapStoreMapConfigProvider(this.mapStore, this.userLimitsApi), createMapStoreMapConfigProvider(this.mapStore, this.userLimitsApi),
getTile(this.tileBackend, 'maplayer_tile'), getTile(this.tileBackend, 'maplayer_tile'),
setCacheControlHeader(), setCacheControlHeader(),
setLastModifiedHeader(), setLastModifiedHeader(),
@ -105,7 +105,7 @@ LayergroupController.prototype.register = function(app) {
cors(), cors(),
userMiddleware(), userMiddleware(),
this.prepareContext, this.prepareContext,
getMapStoreMapConfigProvider(this.mapStore, this.userLimitsApi), createMapStoreMapConfigProvider(this.mapStore, this.userLimitsApi),
getFeatureAttributes(this.attributesBackend), getFeatureAttributes(this.attributesBackend),
setCacheControlHeader(), setCacheControlHeader(),
setLastModifiedHeader(), setLastModifiedHeader(),
@ -123,7 +123,7 @@ LayergroupController.prototype.register = function(app) {
userMiddleware(), userMiddleware(),
allowQueryParams(['layer']), allowQueryParams(['layer']),
this.prepareContext, this.prepareContext,
getMapStoreMapConfigProvider(this.mapStore, this.userLimitsApi, forcedFormat), createMapStoreMapConfigProvider(this.mapStore, this.userLimitsApi, forcedFormat),
getPreviewImageByCenter(this.previewBackend), getPreviewImageByCenter(this.previewBackend),
setCacheControlHeader(), setCacheControlHeader(),
setLastModifiedHeader(), setLastModifiedHeader(),
@ -139,7 +139,7 @@ LayergroupController.prototype.register = function(app) {
userMiddleware(), userMiddleware(),
allowQueryParams(['layer']), allowQueryParams(['layer']),
this.prepareContext, this.prepareContext,
getMapStoreMapConfigProvider(this.mapStore, this.userLimitsApi, forcedFormat), createMapStoreMapConfigProvider(this.mapStore, this.userLimitsApi, forcedFormat),
getPreviewImageByBoundingBox(this.previewBackend), getPreviewImageByBoundingBox(this.previewBackend),
setCacheControlHeader(), setCacheControlHeader(),
setLastModifiedHeader(), setLastModifiedHeader(),
@ -173,7 +173,7 @@ LayergroupController.prototype.register = function(app) {
userMiddleware(), userMiddleware(),
allowQueryParams(allowedDataviewQueryParams), allowQueryParams(allowedDataviewQueryParams),
this.prepareContext, this.prepareContext,
getMapStoreMapConfigProvider(this.mapStore, this.userLimitsApi), createMapStoreMapConfigProvider(this.mapStore, this.userLimitsApi),
getDataview(this.dataviewBackend), getDataview(this.dataviewBackend),
setCacheControlHeader(), setCacheControlHeader(),
setLastModifiedHeader(), setLastModifiedHeader(),
@ -189,7 +189,7 @@ LayergroupController.prototype.register = function(app) {
userMiddleware(), userMiddleware(),
allowQueryParams(allowedDataviewQueryParams), allowQueryParams(allowedDataviewQueryParams),
this.prepareContext, this.prepareContext,
getMapStoreMapConfigProvider(this.mapStore, this.userLimitsApi), createMapStoreMapConfigProvider(this.mapStore, this.userLimitsApi),
getDataview(this.dataviewBackend), getDataview(this.dataviewBackend),
setCacheControlHeader(), setCacheControlHeader(),
setLastModifiedHeader(), setLastModifiedHeader(),
@ -205,7 +205,7 @@ LayergroupController.prototype.register = function(app) {
userMiddleware(), userMiddleware(),
allowQueryParams(allowedDataviewQueryParams), allowQueryParams(allowedDataviewQueryParams),
this.prepareContext, this.prepareContext,
getMapStoreMapConfigProvider(this.mapStore, this.userLimitsApi), createMapStoreMapConfigProvider(this.mapStore, this.userLimitsApi),
dataviewSearch(this.dataviewBackend), dataviewSearch(this.dataviewBackend),
setCacheControlHeader(), setCacheControlHeader(),
setLastModifiedHeader(), setLastModifiedHeader(),
@ -221,7 +221,7 @@ LayergroupController.prototype.register = function(app) {
userMiddleware(), userMiddleware(),
allowQueryParams(allowedDataviewQueryParams), allowQueryParams(allowedDataviewQueryParams),
this.prepareContext, this.prepareContext,
getMapStoreMapConfigProvider(this.mapStore, this.userLimitsApi), createMapStoreMapConfigProvider(this.mapStore, this.userLimitsApi),
dataviewSearch(this.dataviewBackend), dataviewSearch(this.dataviewBackend),
setCacheControlHeader(), setCacheControlHeader(),
setLastModifiedHeader(), setLastModifiedHeader(),
@ -282,8 +282,8 @@ function getRequestParams(locals) {
return params; return params;
} }
function getMapStoreMapConfigProvider (mapStore, userLimitsApi, forcedFormat = null) { function createMapStoreMapConfigProvider (mapStore, userLimitsApi, forcedFormat = null) {
return function getMapStoreMapConfigProviderMiddleware (req, res, next) { return function createMapStoreMapConfigProviderMiddleware (req, res, next) {
const { user } = res.locals; const { user } = res.locals;
const params = getRequestParams(res.locals); const params = getRequestParams(res.locals);