Skip to content

Commit

Permalink
Fix #1518. Fixed thumbs relative URLs for catalog
Browse files Browse the repository at this point in the history
Now the relative url is created getting the right variable from the options
  • Loading branch information
offtherailz committed Mar 2, 2017
1 parent 8dc3380 commit 39730c9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion web/client/utils/CatalogUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ const getWMSBBox = (record) => {
}
return bbox;
};
const getBaseCatalogUrl = (url) => {
return url && url.replace(/\/csw$/, "/");
};

const getWMTSBBox = (record) => {
let layer = record;
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 39730c9

Please sign in to comment.