@@ -251,10 +251,13 @@ export class OpenSeadragonCenterPanel extends CenterPanel<
251251      maxZoomPixelRatio : this . config . options . maxZoomPixelRatio  ||  2 , 
252252      controlsFadeDelay : this . config . options . controlsFadeDelay  ||  250 , 
253253      controlsFadeLength : this . getControlsFadeLength ( ) , 
254-       navigatorPosition :
255-         this . config . options . navigatorPosition  ||  "BOTTOM_RIGHT" , 
254+       navigatorPosition : this . extension . helper . isContinuous ( ) 
255+         ? "BOTTOM_LEFT" 
256+         : this . config . options . navigatorPosition  ||  "BOTTOM_RIGHT" , 
256257      navigatorHeight : "100px" , 
257258      navigatorWidth : "100px" , 
259+       navigatorMaintainSizeRatio : false , 
260+       navigatorAutoResize : false , 
258261      animationTime : this . config . options . animationTime  ||  1.2 , 
259262      visibilityRatio : this . config . options . visibilityRatio  ||  0.5 , 
260263      constrainDuringPan : Bools . getBool ( 
@@ -914,6 +917,13 @@ export class OpenSeadragonCenterPanel extends CenterPanel<
914917
915918    this . setNavigatorVisible ( ) ; 
916919
920+     // resize navigator for continuous manifests 
921+     if  ( this . extension . helper . isContinuous ( ) )  { 
922+       setTimeout ( ( )  =>  { 
923+         this . resizeNavigatorForContinuous ( ) ; 
924+       } ,  200 ) ; 
925+     } 
926+ 
917927    this . overlayAnnotations ( ) ; 
918928
919929    this . updateBounds ( ) ; 
@@ -927,6 +937,58 @@ export class OpenSeadragonCenterPanel extends CenterPanel<
927937    this . isFirstLoad  =  false ; 
928938  } 
929939
940+   private  resizeNavigatorForContinuous ( ) : void   { 
941+     if  ( ! this . viewer  ||  ! this . viewer . navigator )  return ; 
942+ 
943+     const  homeBounds  =  this . viewer . world . getHomeBounds ( ) ; 
944+     const  contentAspectRatio  =  homeBounds . width  /  homeBounds . height ; 
945+ 
946+     const  viewportWidth  =  this . $viewer . width ( ) ; 
947+     const  viewportHeight  =  this . $viewer . height ( ) ; 
948+     const  maxNavigatorWidth  =  100 ; 
949+     const  maxNavigatorHeight  =  100 ; 
950+     const  minVerticalNavigatorWidth  =  60 ; 
951+     const  minHorizontalNavigatorHeight  =  40 ; 
952+ 
953+     let  navigatorWidth : number ; 
954+     let  navigatorHeight : number ; 
955+ 
956+     if  ( this . extension . helper . isVerticallyAligned ( ) )  { 
957+       navigatorHeight  =  viewportHeight  -  this . $zoomInButton . height ( )  -  4 ; 
958+       navigatorWidth  =  navigatorHeight  *  contentAspectRatio ; 
959+ 
960+       // Enforce max width 
961+       if  ( navigatorWidth  >  maxNavigatorWidth )  { 
962+         navigatorWidth  =  maxNavigatorWidth ; 
963+       } 
964+ 
965+       // Enforce min width 
966+       if  ( navigatorWidth  <  minVerticalNavigatorWidth )  { 
967+         navigatorWidth  =  minVerticalNavigatorWidth ; 
968+       } 
969+     }  else  { 
970+       navigatorWidth  =  viewportWidth ; 
971+       navigatorHeight  =  navigatorWidth  /  contentAspectRatio ; 
972+ 
973+       // Enforce max height 
974+       if  ( navigatorHeight  >  maxNavigatorHeight )  { 
975+         navigatorHeight  =  maxNavigatorHeight ; 
976+       } 
977+ 
978+       // Enforce min height 
979+       if  ( navigatorHeight  <  minHorizontalNavigatorHeight )  { 
980+         navigatorHeight  =  minHorizontalNavigatorHeight ; 
981+       } 
982+     } 
983+ 
984+     const  navigatorElement  =  this . viewer . navigator . element ; 
985+     navigatorElement . style . width  =  `${ navigatorWidth }  px` ; 
986+     navigatorElement . style . height  =  `${ navigatorHeight }  px` ; 
987+ 
988+     this . viewer . navigator . viewport . fitBounds ( homeBounds ,  true ) ; 
989+     this . viewer . navigator . updateSize ( ) ; 
990+   } 
991+ 
930992  zoomToInitialAnnotation ( ) : void   { 
931993    const  annotationRect : AnnotationRect  |  null  = 
932994      this . getInitialAnnotationRect ( ) ; 
@@ -1508,20 +1570,14 @@ export class OpenSeadragonCenterPanel extends CenterPanel<
15081570          ) ; 
15091571          break ; 
15101572      } 
1511-     } 
15121573
1513-     // stretch navigator, allowing time for OSD to resize 
1514-     setTimeout ( ( )  =>  { 
1574+       // resize navigator for continuous manifests 
15151575      if  ( this . extension . helper . isContinuous ( ) )  { 
1516-         if  ( this . extension . helper . isHorizontallyAligned ( ) )  { 
1517-           const  width : number  = 
1518-             this . $viewer . width ( )  -  this . $viewer . rightMargin ( ) ; 
1519-           this . $navigator . width ( width ) ; 
1520-         }  else  { 
1521-           this . $navigator . height ( this . $viewer . height ( ) ) ; 
1522-         } 
1576+         setTimeout ( ( )  =>  { 
1577+           this . resizeNavigatorForContinuous ( ) ; 
1578+         } ,  200 ) ; 
15231579      } 
1524-     } ,   100 ) ; 
1580+     } 
15251581  } 
15261582
15271583  setFocus ( ) : void   { 
0 commit comments