File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -93,11 +93,14 @@ var LeafletMapModel = widgets.DOMWidgetModel.extend({
93
93
west : 180
94
94
} ;
95
95
Object . keys ( views ) . reduce ( function ( bnds , key ) {
96
- var view_bounds = views [ key ] . obj . getBounds ( ) ;
97
- bnds . north = Math . max ( bnds . north , view_bounds . getNorth ( ) ) ;
98
- bnds . south = Math . min ( bnds . south , view_bounds . getSouth ( ) ) ;
99
- bnds . east = Math . max ( bnds . east , view_bounds . getEast ( ) ) ;
100
- bnds . west = Math . min ( bnds . west , view_bounds . getWest ( ) ) ;
96
+ var obj = views [ key ] . obj ;
97
+ if ( obj ) {
98
+ var view_bounds = obj . getBounds ( ) ;
99
+ bnds . north = Math . max ( bnds . north , view_bounds . getNorth ( ) ) ;
100
+ bnds . south = Math . min ( bnds . south , view_bounds . getSouth ( ) ) ;
101
+ bnds . east = Math . max ( bnds . east , view_bounds . getEast ( ) ) ;
102
+ bnds . west = Math . min ( bnds . west , view_bounds . getWest ( ) ) ;
103
+ }
101
104
return bnds ;
102
105
} , bounds ) ;
103
106
that . set ( 'north' , bounds . north ) ;
You can’t perform that action at this time.
0 commit comments