File tree 1 file changed +2
-8
lines changed
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) {
84
84
85
85
function syncCb ( set ) {
86
86
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 ) ;
91
88
92
89
set ( 'center.lon' , center [ 0 ] ) ;
93
90
set ( 'center.lat' , center [ 1 ] ) ;
@@ -167,10 +164,7 @@ function zoomNonClipped(geo, projection) {
167
164
function syncCb ( set ) {
168
165
var rotate = projection . rotate ( ) ;
169
166
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 ) ;
174
168
175
169
set ( 'projection.rotation.lon' , - rotate [ 0 ] ) ;
176
170
set ( 'center.lon' , center [ 0 ] ) ;
You can’t perform that action at this time.
0 commit comments