@@ -209,6 +209,14 @@ describe('ol.proj', function() {
209
209
210
210
describe ( 'Proj4js integration' , function ( ) {
211
211
212
+ var proj4 = window . proj4 ;
213
+
214
+ afterEach ( function ( ) {
215
+ delete proj4 . defs [ 'EPSG:21781' ] ;
216
+ window . proj4 = proj4 ;
217
+ ol . proj . setProj4 ( window . proj4 ) ;
218
+ } ) ;
219
+
212
220
it ( 'creates ol.proj.Projection instance from EPSG:21781' , function ( ) {
213
221
proj4 . defs ( 'EPSG:21781' ,
214
222
'+proj=somerc +lat_0=46.95240555555556 +lon_0=7.439583333333333 ' +
@@ -218,8 +226,6 @@ describe('ol.proj', function() {
218
226
expect ( proj . getCode ( ) ) . to . eql ( 'EPSG:21781' ) ;
219
227
expect ( proj . getUnits ( ) ) . to . eql ( 'm' ) ;
220
228
expect ( proj . getMetersPerUnit ( ) ) . to . eql ( 1 ) ;
221
-
222
- delete proj4 . defs [ 'EPSG:21781' ] ;
223
229
} ) ;
224
230
225
231
it ( 'can use an alternative namespace for proj4' , function ( ) {
@@ -235,10 +241,6 @@ describe('ol.proj', function() {
235
241
expect ( proj . getCode ( ) ) . to . eql ( 'EPSG:21781' ) ;
236
242
expect ( proj . getUnits ( ) ) . to . eql ( 'm' ) ;
237
243
expect ( proj . getMetersPerUnit ( ) ) . to . eql ( 1 ) ;
238
-
239
- delete proj4new . defs [ 'EPSG:21781' ] ;
240
- window . proj4 = proj4 ;
241
- ol . proj . setProj4 ( window . proj4 ) ;
242
244
} ) ;
243
245
244
246
it ( 'creates ol.proj.Projection instance from EPSG:3739' , function ( ) {
@@ -250,8 +252,6 @@ describe('ol.proj', function() {
250
252
expect ( proj . getCode ( ) ) . to . eql ( 'EPSG:3739' ) ;
251
253
expect ( proj . getUnits ( ) ) . to . eql ( 'us-ft' ) ;
252
254
expect ( proj . getMetersPerUnit ( ) ) . to . eql ( 1200 / 3937 ) ;
253
-
254
- delete proj4 . defs [ 'EPSG:3739' ] ;
255
255
} ) ;
256
256
257
257
it ( 'allows Proj4js projections to be used transparently' , function ( ) {
@@ -270,7 +270,6 @@ describe('ol.proj', function() {
270
270
'EPSG:4326' , 'EPSG:21781' ) ;
271
271
expect ( point [ 0 ] ) . to . roughlyEqual ( 600072.300 , 1 ) ;
272
272
expect ( point [ 1 ] ) . to . roughlyEqual ( 200146.976 , 1 ) ;
273
- delete proj4 . defs [ 'EPSG:21781' ] ;
274
273
} ) ;
275
274
276
275
it ( 'works with ol.proj.fromLonLat and ol.proj.toLonLat' , function ( ) {
@@ -285,7 +284,6 @@ describe('ol.proj', function() {
285
284
point = ol . proj . toLonLat ( point , 'EPSG:21781' ) ;
286
285
expect ( point [ 0 ] ) . to . roughlyEqual ( lonLat [ 0 ] , 1 ) ;
287
286
expect ( point [ 1 ] ) . to . roughlyEqual ( lonLat [ 1 ] , 1 ) ;
288
- delete proj4 . defs [ 'EPSG:21781' ] ;
289
287
} ) ;
290
288
291
289
it ( 'caches the new Proj4js projections given their srsCode' , function ( ) {
@@ -300,7 +298,6 @@ describe('ol.proj', function() {
300
298
var proj2 = ol . proj . get ( srsCode ) ;
301
299
expect ( ol . proj . equivalent ( proj2 , proj ) ) . to . be ( true ) ;
302
300
delete proj4 . defs [ code ] ;
303
- delete proj4 . defs [ srsCode ] ;
304
301
} ) ;
305
302
306
303
it ( 'numerically estimates point scale at the equator' , function ( ) {
0 commit comments