From 39730c9c3bcbcbaf0435cb2c438e060f47132d1e Mon Sep 17 00:00:00 2001 From: Lorenzo Natali Date: Thu, 2 Mar 2017 15:17:33 +0100 Subject: [PATCH] Fix #1518. Fixed thumbs relative URLs for catalog Now the relative url is created getting the right variable from the options --- web/client/utils/CatalogUtils.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/web/client/utils/CatalogUtils.js b/web/client/utils/CatalogUtils.js index e9cca6a860..ce37ab2c09 100644 --- a/web/client/utils/CatalogUtils.js +++ b/web/client/utils/CatalogUtils.js @@ -29,6 +29,9 @@ const getWMSBBox = (record) => { } return bbox; }; +const getBaseCatalogUrl = (url) => { + return url && url.replace(/\/csw$/, "/"); +}; const getWMTSBBox = (record) => { let layer = record; @@ -115,7 +118,7 @@ const converters = { if (thumbURL) { let absolute = (thumbURL.indexOf("http") === 0); if (!absolute) { - thumbURL = options.catalogURL + "/" + thumbURL; + thumbURL = (getBaseCatalogUrl(options.url) || "") + thumbURL; } } // create the references array (now only wms is supported)