@@ -727,23 +727,8 @@ proto.getView = function() {
727
727
var center = { lon : lon , lat : lat } ;
728
728
729
729
var canvas = map . getCanvas ( ) ;
730
- var width = canvas . width ;
731
- var height = canvas . height ;
732
-
733
- var p00 , p10 , p11 , p01 ;
734
-
735
- // attempt finding correct scale for Retina display
736
- for ( var scale = 2 ; scale > 0 ; scale -- ) {
737
- var w = width / scale ;
738
- var h = height / scale ;
739
-
740
- p00 = map . unproject ( [ 0 , 0 ] ) . toArray ( ) ;
741
- p10 = map . unproject ( [ w , 0 ] ) . toArray ( ) ;
742
- p11 = map . unproject ( [ w , h ] ) . toArray ( ) ;
743
- p01 = map . unproject ( [ 0 , h ] ) . toArray ( ) ;
744
-
745
- if ( Math . abs ( lon - ( p00 [ 0 ] + p11 [ 0 ] ) / 2 ) < 0.0001 ) break ;
746
- }
730
+ var w = parseInt ( canvas . style . width ) ;
731
+ var h = parseInt ( canvas . style . height ) ;
747
732
748
733
return {
749
734
center : center ,
@@ -752,10 +737,10 @@ proto.getView = function() {
752
737
pitch : map . getPitch ( ) ,
753
738
_derived : {
754
739
coordinates : [
755
- p00 ,
756
- p10 ,
757
- p11 ,
758
- p01
740
+ map . unproject ( [ 0 , 0 ] ) . toArray ( ) ,
741
+ map . unproject ( [ w , 0 ] ) . toArray ( ) ,
742
+ map . unproject ( [ w , h ] ) . toArray ( ) ,
743
+ map . unproject ( [ 0 , h ] ) . toArray ( )
759
744
]
760
745
}
761
746
} ;
0 commit comments