File tree Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Original file line number Diff line number Diff line change @@ -84,10 +84,7 @@ function zoomScoped(geo, projection) {
8484
8585 function syncCb ( set ) {
8686 var bounds = geo . bounds ;
87- var center = projection . invert ( [
88- bounds [ 0 ] [ 0 ] + ( bounds [ 1 ] [ 0 ] - bounds [ 0 ] [ 0 ] ) / 2 ,
89- bounds [ 0 ] [ 1 ] + ( bounds [ 1 ] [ 1 ] - bounds [ 0 ] [ 1 ] ) / 2
90- ] ) ;
87+ var center = projection . invert ( geo . midPt ) ;
9188
9289 set ( 'center.lon' , center [ 0 ] ) ;
9390 set ( 'center.lat' , center [ 1 ] ) ;
@@ -167,10 +164,7 @@ function zoomNonClipped(geo, projection) {
167164 function syncCb ( set ) {
168165 var rotate = projection . rotate ( ) ;
169166 var bounds = geo . bounds ;
170- var center = projection . invert ( [
171- bounds [ 0 ] [ 0 ] + ( bounds [ 1 ] [ 0 ] - bounds [ 0 ] [ 0 ] ) / 2 ,
172- bounds [ 0 ] [ 1 ] + ( bounds [ 1 ] [ 1 ] - bounds [ 0 ] [ 1 ] ) / 2
173- ] ) ;
167+ var center = projection . invert ( geo . midPt ) ;
174168
175169 set ( 'projection.rotation.lon' , - rotate [ 0 ] ) ;
176170 set ( 'center.lon' , center [ 0 ] ) ;
You can’t perform that action at this time.
0 commit comments