Overview

To zoom to a specific area in Mirador 3, you can use the method described below.

https://github.com/ProjectMirador/mirador/wiki/M3---Mirador-3-Frequently-Asked-Questions#q-how-do-i-change-the-view-of-an-image-to-zoom-to-a-certain-area

Specifically, it looks like this.

c}c}v}mo;o;a)inxywhnxyrxyz;rBs::ies::::oaotditaodx11tgbbczzmob48hhzootoo:rto23:toxxiooIox01:oTTomm1nT,,8moonCCszo01CZZee/toZ01eoo=nnaoo,9noottbnmo5tmmMeeocme..irrxetrxyr..T.o=axyos=++d,,Zt{ooo{bbroroo.mexxa..TTcwdootiiZZidsoootpoonhammst...cwhuhiep(didatgachhtttei/Vo/in2e),2w;port(windowId,{

Internally, it appears that OpenSeadragon’s panTo and zoomTo are used.

The issue here is that zoomTo ignores constraints when zooming, as described in the following article.

https://github.com/openseadragon/openseadragon/issues/881

To address this, as shown in the following article, adding viewer.viewport.applyConstraints(); enables zooming that respects constraints.

Below, I introduce a somewhat forceful method to apply this setting to Mirador installed via npm.

Editing Mirador

Install Mirador with the following command.

npminstallmirador

A mirador folder is created under node_modules.

The following is an example of adding viewport.applyConstraints(); to a file within that folder.

{kv}eaylvvti}i}}}:uaahfferrii}trvvtetevi}i}i}i}":s(fhe(iahlhlaffffc_vcv.pvvvvit!erisisrvvvvvoftiaiariiiisutwseseiiiiimuhenepeveeee.rhec..vveveevevepniwvwiviwwwwaniraairiiiwiwwiwiwocseaeRSeeeeed;s.ndfefeepeppepepnt$rsretwrrrrd.cvdfwwowoowowoeipCWfae..CCAilaA(rpererrerernoroo=.trvvoolnosl!evortrttrtrttnonrceCiinnlfselisirC.C..C.C.Dpfltu.oeeffIoesIshetopozaososicsidhrvnwwiimR(CmETwnanopnenedo2girifppggae)haqie=fnfopftftUm=seeioo..gs;agulriTimliRiFpp==.nwgrrdfepneaeCvgogTygogldo_ste)ttelSogSlPoi.(.oC.t.iant_ttr..gioneo(rnexvz(orafptehtha={pzrpusducofwiovnotl(enihit=aoererapie!eoistiiv"tsisev=noe!cs=cnegr=wmetaopi,D.s$.i=Tms=eMevr.=ewrtneip$pveoT=sa!sat&vr!eai(!wdrpriwu(o!(ti(si&ivC=riov=eUoroeenv(=u!cscWeeio=Cnni=rppopwrdiv=nvhEaos!wenoteCdspse;eeidi(qnr(tpwfvns!wvoa,s2rfweueepuvl)hopiif(=eint2.;iewnfwraad;irogei)=refe.cnredieels.str,wg;Cwi(vaeCrenrv(el.;tp.vopgpindoCfeCPcsao.fozino.rev)noidoraCyscarefrfewafnnnonhedeltwitlves{ife&fpvarUns.mApg.iPrWgid&isansptez,do.gprCo,gg.sg,de)odrre)oor.&v)iWear;ovetot;pnltz&i;nodptSmid.tFsfdroefrripSegal,i;uovwolenrpwtetigemieRdgirehtipp,),ere.P)niriRo(r;w.sc!rgnCson)evevpavo{Xgot))virionip..nla;Se.envesttfit{twvwsaw.aainiaeipesecrrgeotreosIragg,neCwr)dCnee()optsovttf)no.,na..a){frsfsvvlitepiWaas{g.t!rgolle,sFte)ruu)elhv;lee;ttiiPd)rRpsr.uo(.ol{etvnpa)aiosyv;ten.eiiwTcreoeiaswnrln)e(Cev)rvodaCinIs{oefmWnwiaofeggrir.elgCfdd.olM.yniacfpta!i)cn=g;hv=.(adpsverIigedervsweP)per;osor)pt;s..cneonntTeirlSepdrIimnaggYe.st)a)rg{et.value){

With the above setting, when zooming using Mirador.actions.updateViewport, the zoom now respects constraints.

Summary

Ideally, it would be better to modify Mirador’s source code and rebuild it, but since I was unable to build Mirador successfully, I modified the pre-built files as an alternative approach.

I will continue investigating how to modify from the source code, but I hope this is helpful to others.