Skip to content

Commit

Permalink
Fix displaying of wms in ol3 along cesiumjs
Browse files Browse the repository at this point in the history
Remove SRS or CRS from url depending on wms version, because
only one of them is necessary.
Also modification of original OL layer source should not be done,
but clone instead.
  • Loading branch information
raitisbe committed Jan 24, 2019
1 parent 220f7e9 commit 5d992a6
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions components/hscesium/hs_cesium_layers.js
Original file line number Diff line number Diff line change
Expand Up @@ -282,10 +282,16 @@ define(['ol', 'moment', 'proj4'],
//Same as normal tiled WebMapServiceImageryProvider, but with bigger tileWidth and tileHeight
createSingleImageProvider(ol_lyr) {
var src = ol_lyr.getSource();
var params = src.getParams();
var params = Object.assign({}, src.getParams());
params.VERSION = params.VERSION || '1.1.1';
if (params.VERSION.indexOf('1.1.') == 0) params.CRS = 'EPSG:4326';
if (params.VERSION.indexOf('1.3.') == 0) params.SRS = 'EPSG:4326';
if (params.VERSION.indexOf('1.1.') == 0) {
params.CRS = 'EPSG:4326';
delete params.SRS;
}
if (params.VERSION.indexOf('1.3.') == 0) {
params.SRS = 'EPSG:4326';
delete params.CRS;
}
params.FROMCRS = 'EPSG:4326';
var prm_cache = {
url: src.getUrl(),
Expand Down Expand Up @@ -341,4 +347,4 @@ define(['ol', 'moment', 'proj4'],
};
return me
}
)
)

0 comments on commit 5d992a6

Please sign in to comment.