1- import WebGLMap from 'ol/WebGLMap' ;
21import Map from 'ol/Map' ;
32import View from 'ol/View' ;
43import TileLayer from 'ol/layer/Tile' ;
@@ -360,16 +359,14 @@ class VLWholeSlideMicroscopyImageViewer {
360359 const totalSizes = [ ] ;
361360 const resolutions = [ ] ;
362361 const origins = [ ] ;
363- const offset = [ 0 , - 1 ] ;
362+ const offset = [ 0 , 0 ] ;
364363 const basePixelSpacing = _getPixelSpacing ( this [ _pyramidBaseMetadata ] ) ;
365364 const baseColumns = this [ _pyramidBaseMetadata ] . Columns ;
366365 const baseRows = this [ _pyramidBaseMetadata ] . Rows ;
367366 const baseTotalPixelMatrixColumns = this [ _pyramidBaseMetadata ] . TotalPixelMatrixColumns ;
368367 const baseTotalPixelMatrixRows = this [ _pyramidBaseMetadata ] . TotalPixelMatrixRows ;
369368 const baseColFactor = Math . ceil ( baseTotalPixelMatrixColumns / baseColumns ) ;
370369 const baseRowFactor = Math . ceil ( baseTotalPixelMatrixRows / baseRows ) ;
371- const baseAdjustedTotalPixelMatrixColumns = baseColumns * baseColFactor ;
372- const baseAdjustedTotalPixelMatrixRows = baseRows * baseRowFactor ;
373370 for ( let j = ( nLevels - 1 ) ; j >= 0 ; j -- ) {
374371 const columns = this [ _pyramidMetadata ] [ j ] . Columns ;
375372 const rows = this [ _pyramidMetadata ] [ j ] . Rows ;
@@ -378,15 +375,13 @@ class VLWholeSlideMicroscopyImageViewer {
378375 const pixelSpacing = _getPixelSpacing ( this [ _pyramidMetadata ] [ j ] ) ;
379376 const colFactor = Math . ceil ( totalPixelMatrixColumns / columns ) ;
380377 const rowFactor = Math . ceil ( totalPixelMatrixRows / rows ) ;
381- const adjustedTotalPixelMatrixColumns = columns * colFactor ;
382- const adjustedTotalPixelMatrixRows = rows * rowFactor ;
383378 tileSizes . push ( [
384379 columns ,
385380 rows
386381 ] ) ;
387382 totalSizes . push ( [
388- adjustedTotalPixelMatrixColumns ,
389- adjustedTotalPixelMatrixRows
383+ totalPixelMatrixColumns ,
384+ totalPixelMatrixRows
390385 ] ) ;
391386
392387 /*
@@ -404,7 +399,8 @@ class VLWholeSlideMicroscopyImageViewer {
404399 origins . push ( offset ) ;
405400 }
406401 resolutions . reverse ( ) ;
407- tileSizes . reverse ( ) ;
402+ tileSizes . reverse ( ) ; // FIXME
403+ totalSizes . reverse ( ) ; // FIXME
408404 origins . reverse ( ) ;
409405
410406 // Functions won't be able to access "this"
@@ -427,12 +423,7 @@ class VLWholeSlideMicroscopyImageViewer {
427423 */
428424 let z = tileCoord [ 0 ] ;
429425 let y = tileCoord [ 1 ] + 1 ;
430- /*
431- * The vertical axis is inverted for the chosen tile source, i.e.
432- * it starts at -1 at the top left corner and descreases along the
433- * vertical axis to the lower left corner of the viewport.
434- */
435- let x = - ( tileCoord [ 2 ] + 1 ) + 1 ;
426+ let x = tileCoord [ 2 ] + 1 ;
436427 let index = x + "-" + y ;
437428 let path = pyramidFrameMappings [ z ] [ index ] ;
438429 if ( path === undefined ) {
@@ -662,6 +653,7 @@ class VLWholeSlideMicroscopyImageViewer {
662653 if ( options . controls . has ( 'overview' ) ) {
663654 this [ _controls ] . overview = new OverviewMap ( {
664655 view : overviewView ,
656+ layers : [ imageLayer , this [ _drawingLayer ] ] ,
665657 collapsed : true ,
666658 } ) ;
667659 }
@@ -670,26 +662,14 @@ class VLWholeSlideMicroscopyImageViewer {
670662 * Creates the map with the defined layers and view and renders it via
671663 * WebGL.
672664 */
673- if ( this [ _usewebgl ] ) {
674- this [ _map ] = new WebGLMap ( {
675- layers : [ imageLayer , this [ _drawingLayer ] ] ,
676- view : view ,
677- controls : [ ] ,
678- loadTilesWhileAnimating : true ,
679- loadTilesWhileInteracting : true ,
680- logo : false
681- } ) ;
682- } else {
683-
684- this [ _map ] = new Map ( {
685- layers : [ imageLayer , this [ _drawingLayer ] ] ,
686- view : view ,
687- controls : [ ] ,
688- loadTilesWhileAnimating : true ,
689- loadTilesWhileInteracting : true ,
690- logo : false
691- } ) ;
692- }
665+ this [ _map ] = new Map ( {
666+ layers : [ imageLayer , this [ _drawingLayer ] ] ,
667+ view : view ,
668+ controls : [ ] ,
669+ loadTilesWhileAnimating : true ,
670+ loadTilesWhileInteracting : true ,
671+ logo : false
672+ } ) ;
693673
694674 for ( let control in this [ _controls ] ) {
695675 this [ _map ] . addControl ( this [ _controls ] [ control ] ) ;
@@ -701,7 +681,7 @@ class VLWholeSlideMicroscopyImageViewer {
701681 resize ( ) {
702682 this [ _map ] . updateSize ( ) ;
703683 }
704-
684+
705685
706686 /* Renders the images.
707687 */
@@ -710,6 +690,7 @@ class VLWholeSlideMicroscopyImageViewer {
710690 console . error ( 'container must be provided for rendering images' )
711691 }
712692 this [ _map ] . setTarget ( options . container ) ;
693+ this [ _map ] . updateSize ( ) ;
713694
714695 // Style scale element (overriding default Openlayers CSS "ol-scale-line")
715696 let scaleElement = this [ _controls ] [ 'scale' ] . element ;
0 commit comments