Skip to content

Commit

Permalink
Merge pull request #3422 from camptocamp/fix_ogc-server_encoding
Browse files Browse the repository at this point in the history
Fix ogc server encoding for IE11/Edge
  • Loading branch information
sbrunner committed Jan 23, 2018
2 parents fd3bb56 + e27e251 commit cdacd17
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/services/print.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,12 @@ ngeo.Print = function(url, $http, ngeoLayerHelper) {
* @private
*/
this.printNativeAngle_ = true;

/**
* @type {boolean}
* @private
*/
this.isMs = new URL('http://_/?a=+').searchParams.get('a') == '+';
};


Expand Down Expand Up @@ -287,7 +293,11 @@ ngeo.Print.prototype.encodeImageWmsLayer_ = function(arr, layer) {
* @private
*/
ngeo.Print.prototype.encodeWmsLayer_ = function(arr, opacity, url, params) {
const url_url = new URL(url);
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) {
Expand Down

0 comments on commit cdacd17

Please sign in to comment.