Skip to content

Commit

Permalink
Merge pull request #4416 from camptocamp/fix_ie11_print_params
Browse files Browse the repository at this point in the history
Fix issue with print and IE 11.
  • Loading branch information
arnaud-morvan committed Nov 28, 2018
2 parents 3266af9 + f8f391f commit f35d5ee
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/services/print.js
Original file line number Diff line number Diff line change
Expand Up @@ -298,15 +298,17 @@ ngeo.Print.prototype.encodeImageWmsLayer_ = function(arr, layer) {
*/
ngeo.Print.prototype.encodeWmsLayer_ = function(arr, opacity, url, params) {
let url_url = new URL(url);

// work-around to normalize IE11 & Edge ogcserver encoding issue
if (this.isMs && url_url.search.indexOf('+')) {
url_url = new URL(url_url.origin + url_url.pathname + url_url.search.replace(/\+/g, '%20'));
}

const customParams = {'TRANSPARENT': true};
if (url_url.searchParams) {
for (const element of url_url.searchParams) {
customParams[element[0]] = element[1];
}
/** @type {Object} */ (url_url.searchParams).forEach((value, key) => {
customParams[key] = value;
});
}
for (const key in params) {
const value = params[key];
Expand Down

0 comments on commit f35d5ee

Please sign in to comment.