@@ -10,26 +10,23 @@ goog.require('ol.layer.Image');
1010goog . require ( 'ol.layer.Tile' ) ;
1111goog . require ( 'ol.Map' ) ;
1212goog . require ( 'ol.proj' ) ;
13- goog . require ( 'ol.proj.proj4' ) ;
1413
15- if ( typeof ol . proj . proj4 . get ( ) == 'function' ) {
16- const epsg21781def = [
17- '+proj=somerc' ,
18- '+lat_0=46.95240555555556' ,
19- '+lon_0=7.439583333333333' ,
20- '+k_0=1' ,
21- '+x_0=600000' ,
22- '+y_0=200000' ,
23- '+ellps=bessel' ,
24- '+towgs84=674.374,15.056,405.346,0,0,0,0' ,
25- '+units=m' ,
26- '+no_defs'
27- ] . join ( ' ' ) ;
28- const epsg21781extent = [ 420000 , 30000 , 900000 , 350000 ] ;
14+ const epsg21781def = [
15+ '+proj=somerc' ,
16+ '+lat_0=46.95240555555556' ,
17+ '+lon_0=7.439583333333333' ,
18+ '+k_0=1' ,
19+ '+x_0=600000' ,
20+ '+y_0=200000' ,
21+ '+ellps=bessel' ,
22+ '+towgs84=674.374,15.056,405.346,0,0,0,0' ,
23+ '+units=m' ,
24+ '+no_defs'
25+ ] . join ( ' ' ) ;
26+ const epsg21781extent = [ 420000 , 30000 , 900000 , 350000 ] ;
2927
30- ol . proj . proj4 . get ( ) . defs ( 'EPSG:21781' , epsg21781def ) ;
31- ol . proj . get ( 'EPSG:21781' ) . setExtent ( epsg21781extent ) ;
32- }
28+ proj4 . defs ( 'EPSG:21781' , epsg21781def ) ;
29+ ol . proj . get ( 'EPSG:21781' ) . setExtent ( epsg21781extent ) ;
3330
3431const customProjSource = new ol . source . ImageWMS ( {
3532 attributions : '© <a href="http://www.geo.admin.ch/internet/geoportal/' +
0 commit comments