@@ -727,23 +727,8 @@ proto.getView = function() {
727727 var center = { lon : lon , lat : lat } ;
728728
729729 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 ) ;
747732
748733 return {
749734 center : center ,
@@ -752,10 +737,10 @@ proto.getView = function() {
752737 pitch : map . getPitch ( ) ,
753738 _derived : {
754739 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 ( )
759744 ]
760745 }
761746 } ;
0 commit comments